dlgass.cxx (74cbd1f1) dlgass.cxx (2155a943)
1/**************************************************************
1/**************************************************************
2 *
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
19 *
20 *************************************************************/
21
22
23
24// MARKER(update_precomp.py): autogen include statement, do not remove
25#include "precompiled_sd.hxx"
26
27#ifdef SD_DLLIMPLEMENTATION

--- 88 unchanged lines hidden (view full) ---

116 String maPath;
117};
118
119DECLARE_LIST( PasswordEntryList, PasswordEntry * )
120
121// ====================================================================
122
123/** A simple wrapper that looks like a PushButton and is used to force the
20 *************************************************************/
21
22
23
24// MARKER(update_precomp.py): autogen include statement, do not remove
25#include "precompiled_sd.hxx"
26
27#ifdef SD_DLLIMPLEMENTATION

--- 88 unchanged lines hidden (view full) ---

116 String maPath;
117};
118
119DECLARE_LIST( PasswordEntryList, PasswordEntry * )
120
121// ====================================================================
122
123/** A simple wrapper that looks like a PushButton and is used to force the
124 broadcasting of focus events primarily for accessibility tools.
125 Forcing focus events is achieved by using two identical PushButtons
126 which, when the focus event is requested, are exchanged and play focus
127 ping-pong by moving the focus from one to the other.
124 broadcasting of focus events primarily for accessibility tools.
125 Forcing focus events is achieved by using two identical PushButtons
126 which, when the focus event is requested, are exchanged and play focus
127 ping-pong by moving the focus from one to the other.
128*/
129class NextButton
130{
131public:
128*/
129class NextButton
130{
131public:
132 NextButton (::Window* pParent, const ResId& rResId);
132 NextButton (::Window* pParent, const ResId& rResId);
133
133
134 void ForceFocusEventBroadcast (void);
134 void ForceFocusEventBroadcast (void);
135 void SetClickHdl (const Link& rLink);
135 void SetClickHdl (const Link& rLink);
136 bool IsEnabled (void);
136 bool IsEnabled (void);
137 void Enable (bool bEnable);
138
139private:
137 void Enable (bool bEnable);
138
139private:
140 PushButton maNextButton1;
141 PushButton maNextButton2;
142 bool mbIsFirstButtonActive;
140 PushButton maNextButton1;
141 PushButton maNextButton2;
142 bool mbIsFirstButtonActive;
143};
144
145
146
147// ====================================================================
148
149class AssistentDlgImpl : public SfxListener
150{
151public:
143};
144
145
146
147// ====================================================================
148
149class AssistentDlgImpl : public SfxListener
150{
151public:
152 AssistentDlgImpl( ::Window* pWindow, const Link& rFinishLink, sal_Bool bAutoPilot );
152 AssistentDlgImpl( ::Window* pWindow, const Link& rFinishLink, sal_Bool bAutoPilot );
153 ~AssistentDlgImpl();
154
153 ~AssistentDlgImpl();
154
155 /// Local mutex used to serialize concurrent method calls.
156 ::osl::Mutex maMutex;
155 // Local mutex used to serialize concurrent method calls.
156 ::osl::Mutex maMutex;
157
158 SfxObjectShellLock GetDocument();
159
160 /** closes the current preview docshell */
161 void CloseDocShell();
162
157
158 SfxObjectShellLock GetDocument();
159
160 /** closes the current preview docshell */
161 void CloseDocShell();
162
163 /** Extract form the history list of recently used files the impress
163 /** Extract form the history list of recently used files the Impress
164 files and insert them into a listbox.
165 */
166 void ScanDocmenu (void);
164 files and insert them into a listbox.
165 */
166 void ScanDocmenu (void);
167 /** Flag that is set to sal_True after the recently used files have been
168 scanned.
167 /** Flag that is set to sal_True after the recently used files have been
168 scanned.
169 */
170 sal_Bool mbRecentDocumentsReady;
171
169 */
170 sal_Bool mbRecentDocumentsReady;
171
172 /** When the list of templates has not been scanned already this is done
173 when this method is called. That includes requesting the whole list
174 of templates from UCB and extracting from that list the impress
175 templates and layouts and storing them for later use in
176 <member>maPresentList</member>. Note that the first call to this
177 method after installing a new Office may take some time.
172 /** When the list of templates has not been scanned already this is done
173 when this method is called. That includes requesting the whole list
174 of templates from UCB and extracting from that list the Impress
175 templates and layouts and storing them for later use in
176 <member>maPresentList</member>. Note that the first call to this
177 method after installing a new Office may take some time.
178 */
179 void ProvideTemplates (void);
180
178 */
179 void ProvideTemplates (void);
180
181 /** This method transfers the template folders from the template scanner
182 to the internal structures of this class. On termination it sets
181 /** This method transfers the template folders from the template scanner
182 to the internal structures of this class. On termination it sets
183 the flag <member>mbTemplatesReady</member> to <TRUE/> to indicate
184 that the templates are available.
183 the flag <member>mbTemplatesReady</member> to <TRUE/> to indicate
184 that the templates are available.
185 @param rTemplateFolders
186 This is a list of template folders. This method takes ownership
187 of the supplied entries by removing them from the list and
188 transferring them to an internal structure.
185 @param rTemplateFolders
186 This is a list of template folders. This method takes ownership
187 of the supplied entries by removing them from the list and
188 transferring them to an internal structure.
189 */
190 void TemplateScanDone (std::vector<TemplateDir*>& rTemplateFolders);
191
189 */
190 void TemplateScanDone (std::vector<TemplateDir*>& rTemplateFolders);
191
192 /** Flag that is set to sal_True after the impress templates have been
193 scanned.
192 /** Flag that is set to sal_True after the Impress templates have been
193 scanned.
194 */
195 sal_Bool mbTemplatesReady;
196
194 */
195 sal_Bool mbTemplatesReady;
196
197 /** Flag used to prevent nested or concurrent calls to the
198 <member>UpdatePreview</memember> method. A <TRUE/> value indicates
199 that a preview update is currently active.
200 */
201 sal_Bool mbPreviewUpdating;
197 /** Flag used to prevent nested or concurrent calls to the
198 <member>UpdatePreview</member> method. A <TRUE/> value indicates
199 that a preview update is currently active.
200 */
201 sal_Bool mbPreviewUpdating;
202
203 ::Window* mpWindow;
204
205 void SavePassword( SfxObjectShellLock xDoc, const String& rPath );
206 void RestorePassword( SfxItemSet* pSet, const String& rPath );
207 String GetPassword( const String rPath );
208 void DeletePassords();
209
210 PasswordEntryList maPasswordList;
211
212 String maDocFile;
213 String maLayoutFile;
214
215 String GetDocFileName();
216 String GetLayoutFileName();
217
202
203 ::Window* mpWindow;
204
205 void SavePassword( SfxObjectShellLock xDoc, const String& rPath );
206 void RestorePassword( SfxItemSet* pSet, const String& rPath );
207 String GetPassword( const String rPath );
208 void DeletePassords();
209
210 PasswordEntryList maPasswordList;
211
212 String maDocFile;
213 String maLayoutFile;
214
215 String GetDocFileName();
216 String GetLayoutFileName();
217
218 /// List of URLs of recently used impress files.
218 // List of URLs of recently used Impress files.
219 std::vector<String*> maOpenFilesList;
220
219 std::vector<String*> maOpenFilesList;
220
221 /// List of folders containing data about impress templates.
221 // List of folders containing data about Impress templates.
222 std::vector<TemplateDir*> maPresentList;
223
222 std::vector<TemplateDir*> maPresentList;
223
224 /// Currently selected template folder.
224 // Currently selected template folder.
225 TemplateDir* mpTemplateRegion;
226
225 TemplateDir* mpTemplateRegion;
226
227 /// Currently selected layout folder.
227 // Currently selected layout folder.
228 TemplateDir* mpLayoutRegion;
229
230 // preview
231 sal_Bool mbUserDataDirty;
232 Timer maPrevTimer;
233 Timer maEffectPrevTimer;
234 Timer maUpdatePageListTimer;
235 Timer maStartScanTimer;
236
237 SfxObjectShellLock xDocShell;
238
228 TemplateDir* mpLayoutRegion;
229
230 // preview
231 sal_Bool mbUserDataDirty;
232 Timer maPrevTimer;
233 Timer maEffectPrevTimer;
234 Timer maUpdatePageListTimer;
235 Timer maStartScanTimer;
236
237 SfxObjectShellLock xDocShell;
238
239 ::std::auto_ptr<WindowUpdater> mpWindowUpdater;
239 ::std::auto_ptr<WindowUpdater> mpWindowUpdater;
240
241 sal_Bool mbPreview;
242 sal_uInt16 mnShowPage;
243 sal_Bool mbDocPreview;
244
245 sal_uLong mnTemplate;
246
247 String maPageListFile;

--- 12 unchanged lines hidden (view full) ---

260
261 void SelectTemplateRegion( const String& rRegion );
262 void SelectLayoutRegion( const String& rRegion );
263
264 void UpdatePage();
265 void ChangePage();
266 void LeavePage();
267
240
241 sal_Bool mbPreview;
242 sal_uInt16 mnShowPage;
243 sal_Bool mbDocPreview;
244
245 sal_uLong mnTemplate;
246
247 String maPageListFile;

--- 12 unchanged lines hidden (view full) ---

260
261 void SelectTemplateRegion( const String& rRegion );
262 void SelectLayoutRegion( const String& rRegion );
263
264 void UpdatePage();
265 void ChangePage();
266 void LeavePage();
267
268 String GetUiTextForCommand (const ::rtl::OUString& aCommandURL);
269 Image GetUiIconForCommand (const ::rtl::OUString& aCommandURL);
268 String GetUiTextForCommand (const ::rtl::OUString& aCommandURL);
269 Image GetUiIconForCommand (const ::rtl::OUString& aCommandURL);
270
271 DECL_LINK( StartScanHdl, void * );
272 DECL_LINK( SelectFileHdl, ListBox * );
273 DECL_LINK( SelectRegionHdl, ListBox * );
274 DECL_LINK( UpdatePreviewHdl, void * );
275 DECL_LINK( UpdatePageListHdl, void * );
276 DECL_LINK( StartTypeHdl, RadioButton * );
277 DECL_LINK( SelectTemplateHdl, ListBox * );
278 DECL_LINK( NextPageHdl, PushButton * );
279 DECL_LINK( LastPageHdl, PushButton * );
280 DECL_LINK( PreviewFlagHdl, CheckBox * );
281 DECL_LINK( EffectPreviewHdl, Button * );
282 DECL_LINK( SelectLayoutHdl, ListBox * );
283 DECL_LINK( PageSelectHdl, Control * );
284 DECL_LINK( PresTypeHdl, RadioButton * );
285 DECL_LINK( UpdateUserDataHdl, Edit* );
286 DECL_LINK( SelectEffectHdl, void* );
270
271 DECL_LINK( StartScanHdl, void * );
272 DECL_LINK( SelectFileHdl, ListBox * );
273 DECL_LINK( SelectRegionHdl, ListBox * );
274 DECL_LINK( UpdatePreviewHdl, void * );
275 DECL_LINK( UpdatePageListHdl, void * );
276 DECL_LINK( StartTypeHdl, RadioButton * );
277 DECL_LINK( SelectTemplateHdl, ListBox * );
278 DECL_LINK( NextPageHdl, PushButton * );
279 DECL_LINK( LastPageHdl, PushButton * );
280 DECL_LINK( PreviewFlagHdl, CheckBox * );
281 DECL_LINK( EffectPreviewHdl, Button * );
282 DECL_LINK( SelectLayoutHdl, ListBox * );
283 DECL_LINK( PageSelectHdl, Control * );
284 DECL_LINK( PresTypeHdl, RadioButton * );
285 DECL_LINK( UpdateUserDataHdl, Edit* );
286 DECL_LINK( SelectEffectHdl, void* );
287 DECL_LINK( OpenButtonHdl, Button * );
287 DECL_LINK( OpenButtonHdl, Button * );
288
289 // Common
290 Assistent maAssistentFunc;
291 CheckBox maPreviewFlag;
292 CheckBox maStartWithFlag;
293 HelpButton maHelpButton;
294 CancelButton maCancelButton;
295 PushButton maLastPageButton;
288
289 // Common
290 Assistent maAssistentFunc;
291 CheckBox maPreviewFlag;
292 CheckBox maStartWithFlag;
293 HelpButton maHelpButton;
294 CancelButton maCancelButton;
295 PushButton maLastPageButton;
296 NextButton maNextPageButton;
296 NextButton maNextPageButton;
297 OKButton maFinishButton;
298 SdDocPreviewWin maPreview;
299
297 OKButton maFinishButton;
298 SdDocPreviewWin maPreview;
299
300 String maCreateStr;
301 String maOpenStr;
300 String maCreateStr;
301 String maOpenStr;
302
302
303 // Seite 1
303 // Page 1
304 FixedBitmap* mpPage1FB;
305 FixedLine* mpPage1ArtFL;
306 RadioButton* mpPage1EmptyRB;
307 RadioButton* mpPage1TemplateRB;
308 ListBox* mpPage1RegionLB;
309 ListBox* mpPage1TemplateLB;
310 RadioButton* mpPage1OpenRB;
311 ListBox* mpPage1OpenLB;
304 FixedBitmap* mpPage1FB;
305 FixedLine* mpPage1ArtFL;
306 RadioButton* mpPage1EmptyRB;
307 RadioButton* mpPage1TemplateRB;
308 ListBox* mpPage1RegionLB;
309 ListBox* mpPage1TemplateLB;
310 RadioButton* mpPage1OpenRB;
311 ListBox* mpPage1OpenLB;
312 PushButton* mpPage1OpenPB;
312 PushButton* mpPage1OpenPB;
313
313
314 // Seite 2
314 // Page 2
315 FixedBitmap* mpPage2FB;
316 FixedLine* mpPage2LayoutFL;
317 ListBox* mpPage2RegionLB;
318 ListBox* mpPage2LayoutLB;
319 FixedLine* mpPage2OutTypesFL;
320 RadioButton* mpPage2Medium1RB;
321 RadioButton* mpPage2Medium2RB;
322 RadioButton* mpPage2Medium3RB;
323 RadioButton* mpPage2Medium4RB;
324 RadioButton* mpPage2Medium5RB;
325
315 FixedBitmap* mpPage2FB;
316 FixedLine* mpPage2LayoutFL;
317 ListBox* mpPage2RegionLB;
318 ListBox* mpPage2LayoutLB;
319 FixedLine* mpPage2OutTypesFL;
320 RadioButton* mpPage2Medium1RB;
321 RadioButton* mpPage2Medium2RB;
322 RadioButton* mpPage2Medium3RB;
323 RadioButton* mpPage2Medium4RB;
324 RadioButton* mpPage2Medium5RB;
325
326 // Seite 3
326 // Page 3
327 FixedBitmap* mpPage3FB;
328 FixedLine* mpPage3EffectFL;
329 FixedText* mpPage3EffectFT;
330 FadeEffectLB* mpPage3EffectLB;
331 FixedText* mpPage3SpeedFT;
332 ListBox* mpPage3SpeedLB;
333 FixedLine* mpPage3PresTypeFL;
334 RadioButton* mpPage3PresTypeLiveRB;
335 RadioButton* mpPage3PresTypeKioskRB;
336 FixedText* mpPage3PresTimeFT;
337 TimeField* mpPage3PresTimeTMF;
338 FixedText* mpPage3BreakFT;
339 TimeField* mpPage3BreakTMF;
340 CheckBox* mpPage3LogoCB;
341
327 FixedBitmap* mpPage3FB;
328 FixedLine* mpPage3EffectFL;
329 FixedText* mpPage3EffectFT;
330 FadeEffectLB* mpPage3EffectLB;
331 FixedText* mpPage3SpeedFT;
332 ListBox* mpPage3SpeedLB;
333 FixedLine* mpPage3PresTypeFL;
334 RadioButton* mpPage3PresTypeLiveRB;
335 RadioButton* mpPage3PresTypeKioskRB;
336 FixedText* mpPage3PresTimeFT;
337 TimeField* mpPage3PresTimeTMF;
338 FixedText* mpPage3BreakFT;
339 TimeField* mpPage3BreakTMF;
340 CheckBox* mpPage3LogoCB;
341
342 // Seite 4
342 // Page 4
343 FixedBitmap* mpPage4FB;
344 FixedLine* mpPage4PersonalFL;
345 FixedText* mpPage4AskNameFT;
346 Edit* mpPage4AskNameEDT;
347 FixedText* mpPage4AskTopicFT;
348 Edit* mpPage4AskTopicEDT;
349 FixedText* mpPage4AskInfoFT;
350 MultiLineEdit* mpPage4AskInfoEDT;
351
343 FixedBitmap* mpPage4FB;
344 FixedLine* mpPage4PersonalFL;
345 FixedText* mpPage4AskNameFT;
346 Edit* mpPage4AskNameEDT;
347 FixedText* mpPage4AskTopicFT;
348 Edit* mpPage4AskTopicEDT;
349 FixedText* mpPage4AskInfoFT;
350 MultiLineEdit* mpPage4AskInfoEDT;
351
352 // Seite 5
352 // Page 5
353 FixedBitmap* mpPage5FB;
354 FixedText* mpPage5PageListFT;
355 SdPageListControl* mpPage5PageListCT;
356 CheckBox* mpPage5SummaryCB;
357
358};
359
360
361
362// ====================================================================
363
364AssistentDlgImpl::AssistentDlgImpl( ::Window* pWindow, const Link& rFinishLink, sal_Bool bAutoPilot ) :
365 mpTemplateRegion(NULL),
366 mpLayoutRegion(NULL),
367 mbUserDataDirty(sal_False),
368 xDocShell (NULL),
353 FixedBitmap* mpPage5FB;
354 FixedText* mpPage5PageListFT;
355 SdPageListControl* mpPage5PageListCT;
356 CheckBox* mpPage5SummaryCB;
357
358};
359
360
361
362// ====================================================================
363
364AssistentDlgImpl::AssistentDlgImpl( ::Window* pWindow, const Link& rFinishLink, sal_Bool bAutoPilot ) :
365 mpTemplateRegion(NULL),
366 mpLayoutRegion(NULL),
367 mbUserDataDirty(sal_False),
368 xDocShell (NULL),
369 mpWindowUpdater (new WindowUpdater()),
369 mpWindowUpdater (new WindowUpdater()),
370 mbPreview(sal_True),
371 mnShowPage(0),
372 mbDocPreview(sal_False),
373 maAssistentFunc(5),
374 maPreviewFlag(pWindow,SdResId(CB_PREVIEW)),
375 maStartWithFlag(pWindow,SdResId(CB_STARTWITH)),
376 maHelpButton(pWindow,SdResId(BUT_HELP)),
377 maCancelButton(pWindow,SdResId(BUT_CANCEL)),
378 maLastPageButton(pWindow,SdResId(BUT_LAST)),
379 maNextPageButton(pWindow,SdResId(BUT_NEXT)),
380 maFinishButton(pWindow,SdResId(BUT_FINISH)),
381 maPreview(pWindow,SdResId(CT_PREVIEW)),
370 mbPreview(sal_True),
371 mnShowPage(0),
372 mbDocPreview(sal_False),
373 maAssistentFunc(5),
374 maPreviewFlag(pWindow,SdResId(CB_PREVIEW)),
375 maStartWithFlag(pWindow,SdResId(CB_STARTWITH)),
376 maHelpButton(pWindow,SdResId(BUT_HELP)),
377 maCancelButton(pWindow,SdResId(BUT_CANCEL)),
378 maLastPageButton(pWindow,SdResId(BUT_LAST)),
379 maNextPageButton(pWindow,SdResId(BUT_NEXT)),
380 maFinishButton(pWindow,SdResId(BUT_FINISH)),
381 maPreview(pWindow,SdResId(CT_PREVIEW)),
382 maCreateStr(SdResId(STR_CREATE)),
383 maOpenStr(SdResId(STR_OPEN))
382 maCreateStr(SdResId(STR_CREATE)),
383 maOpenStr(SdResId(STR_OPEN))
384{
385 maPageListFile += sal_Unicode('?'),
384{
385 maPageListFile += sal_Unicode('?'),
386 mbRecentDocumentsReady = sal_False;
386 mbRecentDocumentsReady = sal_False;
387 mbTemplatesReady = sal_False;
387 mbTemplatesReady = sal_False;
388 mbPreviewUpdating = sal_False;
388 mbPreviewUpdating = sal_False;
389
390 mpWindow = pWindow;
391
392 if(bAutoPilot)
393 maStartWithFlag.Hide();
394 else
395 maAssistentFunc.InsertControl(1, &maStartWithFlag );
396
389
390 mpWindow = pWindow;
391
392 if(bAutoPilot)
393 maStartWithFlag.Hide();
394 else
395 maAssistentFunc.InsertControl(1, &maStartWithFlag );
396
397 //page1 wird initialisiert und an die Assistentenfunktionalitaet
398 //uebergeben
397 // Page1 wird initialisiert und an die Assistentenfunktionalitaet
398 // uebergeben
399 maAssistentFunc.InsertControl(1, &maPreview );
400 maAssistentFunc.InsertControl(1, &maPreviewFlag );
401 maAssistentFunc.InsertControl(1,
402 mpPage1FB = new FixedBitmap(pWindow,SdResId(FB_PAGE1)));
403 maAssistentFunc.InsertControl(1,
404 mpPage1ArtFL = new FixedLine(pWindow,SdResId(FL_PAGE1_ARTGROUP)));
405 maAssistentFunc.InsertControl(1,
406 mpPage1EmptyRB=new RadioButton(pWindow,SdResId(RB_PAGE1_EMPTY)));

--- 5 unchanged lines hidden (view full) ---

412 mpPage1RegionLB = new ListBox(pWindow,SdResId(LB_PAGE1_REGION)));
413 maAssistentFunc.InsertControl(1,
414 mpPage1TemplateLB=new ListBox(pWindow,SdResId(LB_PAGE1_TEMPLATES)));
415 maAssistentFunc.InsertControl(1,
416 mpPage1OpenPB=new PushButton(pWindow,SdResId(PB_PAGE1_OPEN)));
417 maAssistentFunc.InsertControl(1,
418 mpPage1OpenLB=new ListBox(pWindow,SdResId(LB_PAGE1_OPEN)));
419
399 maAssistentFunc.InsertControl(1, &maPreview );
400 maAssistentFunc.InsertControl(1, &maPreviewFlag );
401 maAssistentFunc.InsertControl(1,
402 mpPage1FB = new FixedBitmap(pWindow,SdResId(FB_PAGE1)));
403 maAssistentFunc.InsertControl(1,
404 mpPage1ArtFL = new FixedLine(pWindow,SdResId(FL_PAGE1_ARTGROUP)));
405 maAssistentFunc.InsertControl(1,
406 mpPage1EmptyRB=new RadioButton(pWindow,SdResId(RB_PAGE1_EMPTY)));

--- 5 unchanged lines hidden (view full) ---

412 mpPage1RegionLB = new ListBox(pWindow,SdResId(LB_PAGE1_REGION)));
413 maAssistentFunc.InsertControl(1,
414 mpPage1TemplateLB=new ListBox(pWindow,SdResId(LB_PAGE1_TEMPLATES)));
415 maAssistentFunc.InsertControl(1,
416 mpPage1OpenPB=new PushButton(pWindow,SdResId(PB_PAGE1_OPEN)));
417 maAssistentFunc.InsertControl(1,
418 mpPage1OpenLB=new ListBox(pWindow,SdResId(LB_PAGE1_OPEN)));
419
420 // Align the button and list box displayed for the "open existing file"
421 // radio button with the text of that radio button.
422 {
423 RadioButton aEmptyRB (mpWindow);
424 sal_Int32 nIndent (aEmptyRB.CalcMinimumSize(0).Width());
425 sal_Int32 nLeft (mpPage1OpenRB->GetPosPixel().X() + nIndent);
426 sal_Int32 nWidth (mpPage1OpenRB->GetSizePixel().Width() - nIndent);
427 mpPage1OpenPB->SetPosSizePixel(
428 Point(nLeft, mpPage1OpenPB->GetPosPixel().Y()),
429 Size(mpPage1OpenPB->GetSizePixel()));
430 mpPage1OpenLB->SetPosSizePixel(
431 Point(nLeft, mpPage1OpenLB->GetPosPixel().Y()),
432 Size(nWidth, mpPage1OpenLB->GetSizePixel().Height()));
433 }
420 // Align the button and list box displayed for the "open existing file"
421 // radio button with the text of that radio button.
422 {
423 RadioButton aEmptyRB (mpWindow);
424 sal_Int32 nIndent (aEmptyRB.CalcMinimumSize(0).Width());
425 sal_Int32 nLeft (mpPage1OpenRB->GetPosPixel().X() + nIndent);
426 sal_Int32 nWidth (mpPage1OpenRB->GetSizePixel().Width() - nIndent);
427 mpPage1OpenPB->SetPosSizePixel(
428 Point(nLeft, mpPage1OpenPB->GetPosPixel().Y()),
429 Size(mpPage1OpenPB->GetSizePixel()));
430 mpPage1OpenLB->SetPosSizePixel(
431 Point(nLeft, mpPage1OpenLB->GetPosPixel().Y()),
432 Size(nWidth, mpPage1OpenLB->GetSizePixel().Height()));
433 }
434
434
435 // Set text and icon of the 'Open...' button.
436 {
437 String sText (GetUiTextForCommand(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Open"))));
438 // Remove the mnemonic and add a leading space so that icon and text
439 // are not too close together.
440 sText.SearchAndReplaceAll(String(RTL_CONSTASCII_STRINGPARAM("~")),String());
441 sText.Insert(String(RTL_CONSTASCII_STRINGPARAM(" ")),0);
442 mpPage1OpenPB->SetText(sText);
443 // Place icon left of text and both centered in the button.
444 mpPage1OpenPB->SetModeImage(
445 GetUiIconForCommand(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Open"))),
446 BMP_COLOR_NORMAL);
447 mpPage1OpenPB->EnableImageDisplay(sal_True);
448 mpPage1OpenPB->EnableTextDisplay(sal_True);
449 mpPage1OpenPB->SetImageAlign(IMAGEALIGN_LEFT);
450 mpPage1OpenPB->SetStyle(mpPage1OpenPB->GetStyle() | WB_CENTER);
451 }
435 // Set text and icon of the 'Open...' button.
436 {
437 String sText (GetUiTextForCommand(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Open"))));
438 // Remove the mnemonic and add a leading space so that icon and text
439 // are not too close together.
440 sText.SearchAndReplaceAll(String(RTL_CONSTASCII_STRINGPARAM("~")),String());
441 sText.Insert(String(RTL_CONSTASCII_STRINGPARAM(" ")),0);
442 mpPage1OpenPB->SetText(sText);
443 // Place icon left of text and both centered in the button.
444 mpPage1OpenPB->SetModeImage(
445 GetUiIconForCommand(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Open"))),
446 BMP_COLOR_NORMAL);
447 mpPage1OpenPB->EnableImageDisplay(sal_True);
448 mpPage1OpenPB->EnableTextDisplay(sal_True);
449 mpPage1OpenPB->SetImageAlign(IMAGEALIGN_LEFT);
450 mpPage1OpenPB->SetStyle(mpPage1OpenPB->GetStyle() | WB_CENTER);
451 }
452
453 // links&handler
454 mpPage1RegionLB->SetSelectHdl(LINK(this,AssistentDlgImpl,SelectRegionHdl));
455 mpPage1RegionLB->SetDropDownLineCount( 6 );
456 mpPage1TemplateLB->SetSelectHdl(LINK(this,AssistentDlgImpl,SelectTemplateHdl));
457 mpPage1TemplateLB->InsertEntry(String(SdResId(STR_ISLOADING)));
458
459 mpPage1EmptyRB->SetClickHdl(LINK(this,AssistentDlgImpl,StartTypeHdl));
460 mpPage1TemplateRB->SetClickHdl(LINK(this,AssistentDlgImpl,StartTypeHdl));
461 mpPage1OpenRB->SetClickHdl(LINK(this,AssistentDlgImpl,StartTypeHdl));
462 mpPage1OpenLB->SetSelectHdl(LINK(this,AssistentDlgImpl,SelectFileHdl));
463 mpPage1OpenLB->SetDoubleClickHdl(rFinishLink);
452
453 // links&handler
454 mpPage1RegionLB->SetSelectHdl(LINK(this,AssistentDlgImpl,SelectRegionHdl));
455 mpPage1RegionLB->SetDropDownLineCount( 6 );
456 mpPage1TemplateLB->SetSelectHdl(LINK(this,AssistentDlgImpl,SelectTemplateHdl));
457 mpPage1TemplateLB->InsertEntry(String(SdResId(STR_ISLOADING)));
458
459 mpPage1EmptyRB->SetClickHdl(LINK(this,AssistentDlgImpl,StartTypeHdl));
460 mpPage1TemplateRB->SetClickHdl(LINK(this,AssistentDlgImpl,StartTypeHdl));
461 mpPage1OpenRB->SetClickHdl(LINK(this,AssistentDlgImpl,StartTypeHdl));
462 mpPage1OpenLB->SetSelectHdl(LINK(this,AssistentDlgImpl,SelectFileHdl));
463 mpPage1OpenLB->SetDoubleClickHdl(rFinishLink);
464 mpPage1OpenPB->SetClickHdl(LINK(this,AssistentDlgImpl,OpenButtonHdl));
465 // mpPage1OpenLB->InsertEntry(String(SdResId(STR_WIZARD_POSITION)));
464 mpPage1OpenPB->SetClickHdl(LINK(this,AssistentDlgImpl,OpenButtonHdl));
465// mpPage1OpenLB->InsertEntry(String(SdResId(STR_WIZARD_POSITION)));
466
466
467 // Seite 2
467 // Page 2
468 maAssistentFunc.InsertControl(2, &maPreview );
469 maAssistentFunc.InsertControl(2, &maPreviewFlag );
470 maAssistentFunc.InsertControl(2,
471 mpPage2FB = new FixedBitmap(pWindow,SdResId(FB_PAGE2)));
472 maAssistentFunc.InsertControl(2,
473 mpPage2LayoutFL = new FixedLine( pWindow, SdResId(FL_PAGE2_LAYOUT) ));
474 maAssistentFunc.InsertControl(2,
475 mpPage2RegionLB = new ListBox(pWindow,SdResId(LB_PAGE2_REGION) ));

--- 14 unchanged lines hidden (view full) ---

490 mpPage2Medium2RB = new RadioButton( pWindow, SdResId(RB_PAGE2_MEDIUM2) ));
491 mpPage2Medium5RB->Check();
492
493 mpPage2RegionLB->SetSelectHdl(LINK(this,AssistentDlgImpl,SelectRegionHdl));
494 mpPage2RegionLB->SetDropDownLineCount( 6 );
495 mpPage2LayoutLB->SetSelectHdl(LINK(this,AssistentDlgImpl,SelectLayoutHdl));
496 mpPage2LayoutLB->InsertEntry(String(SdResId(STR_ISLOADING)));
497
468 maAssistentFunc.InsertControl(2, &maPreview );
469 maAssistentFunc.InsertControl(2, &maPreviewFlag );
470 maAssistentFunc.InsertControl(2,
471 mpPage2FB = new FixedBitmap(pWindow,SdResId(FB_PAGE2)));
472 maAssistentFunc.InsertControl(2,
473 mpPage2LayoutFL = new FixedLine( pWindow, SdResId(FL_PAGE2_LAYOUT) ));
474 maAssistentFunc.InsertControl(2,
475 mpPage2RegionLB = new ListBox(pWindow,SdResId(LB_PAGE2_REGION) ));

--- 14 unchanged lines hidden (view full) ---

490 mpPage2Medium2RB = new RadioButton( pWindow, SdResId(RB_PAGE2_MEDIUM2) ));
491 mpPage2Medium5RB->Check();
492
493 mpPage2RegionLB->SetSelectHdl(LINK(this,AssistentDlgImpl,SelectRegionHdl));
494 mpPage2RegionLB->SetDropDownLineCount( 6 );
495 mpPage2LayoutLB->SetSelectHdl(LINK(this,AssistentDlgImpl,SelectLayoutHdl));
496 mpPage2LayoutLB->InsertEntry(String(SdResId(STR_ISLOADING)));
497
498 // Seite 3
498 // Page 3
499 maAssistentFunc.InsertControl(3, &maPreview );
500 maAssistentFunc.InsertControl(3, &maPreviewFlag );
501 maAssistentFunc.InsertControl(3,
502 mpPage3FB = new FixedBitmap(pWindow,SdResId(FB_PAGE3)));
503 maAssistentFunc.InsertControl(3,
504 mpPage3EffectFL = new FixedLine( pWindow, SdResId(FL_PAGE3_EFFECT) ));
505 maAssistentFunc.InsertControl(3,
506 mpPage3EffectFT = new FixedText( pWindow, SdResId(FT_PAGE3_EFFECT) ));

--- 44 unchanged lines hidden (view full) ---

551 // set cursor in timefield
552 Edit *pEditPage3PresTimeTMF = mpPage3PresTimeTMF->GetField();
553 Edit *pEditPage3BreakTMF = mpPage3BreakTMF->GetField();
554 Selection aSel1( pEditPage3PresTimeTMF->GetMaxTextLen(), pEditPage3PresTimeTMF->GetMaxTextLen() );
555 Selection aSel2( pEditPage3BreakTMF->GetMaxTextLen(), pEditPage3BreakTMF->GetMaxTextLen() );
556 pEditPage3PresTimeTMF->SetSelection( aSel1 );
557 pEditPage3BreakTMF->SetSelection( aSel2 );
558
499 maAssistentFunc.InsertControl(3, &maPreview );
500 maAssistentFunc.InsertControl(3, &maPreviewFlag );
501 maAssistentFunc.InsertControl(3,
502 mpPage3FB = new FixedBitmap(pWindow,SdResId(FB_PAGE3)));
503 maAssistentFunc.InsertControl(3,
504 mpPage3EffectFL = new FixedLine( pWindow, SdResId(FL_PAGE3_EFFECT) ));
505 maAssistentFunc.InsertControl(3,
506 mpPage3EffectFT = new FixedText( pWindow, SdResId(FT_PAGE3_EFFECT) ));

--- 44 unchanged lines hidden (view full) ---

551 // set cursor in timefield
552 Edit *pEditPage3PresTimeTMF = mpPage3PresTimeTMF->GetField();
553 Edit *pEditPage3BreakTMF = mpPage3BreakTMF->GetField();
554 Selection aSel1( pEditPage3PresTimeTMF->GetMaxTextLen(), pEditPage3PresTimeTMF->GetMaxTextLen() );
555 Selection aSel2( pEditPage3BreakTMF->GetMaxTextLen(), pEditPage3BreakTMF->GetMaxTextLen() );
556 pEditPage3PresTimeTMF->SetSelection( aSel1 );
557 pEditPage3BreakTMF->SetSelection( aSel2 );
558
559 // Seite 4
559 // Page 4
560 maAssistentFunc.InsertControl(4,
561 mpPage4FB = new FixedBitmap(pWindow,SdResId(FB_PAGE4)));
562 maAssistentFunc.InsertControl(4,
563 mpPage4PersonalFL = new FixedLine( pWindow, SdResId(FL_PAGE4_PERSONAL) ));
564 maAssistentFunc.InsertControl(4,
565 mpPage4AskNameFT = new FixedText( pWindow, SdResId(FT_PAGE4_ASKNAME) ));
566 maAssistentFunc.InsertControl(4,
567 mpPage4AskNameEDT = new Edit( pWindow, SdResId(EDT_PAGE4_ASKNAME) ));

--- 5 unchanged lines hidden (view full) ---

573 mpPage4AskInfoFT = new FixedText( pWindow, SdResId(FT_PAGE4_ASKINFORMATION) ));
574 maAssistentFunc.InsertControl(4,
575 mpPage4AskInfoEDT = new MultiLineEdit( pWindow, SdResId(EDT_PAGE4_ASKINFORMATION) ));
576
577 mpPage4AskNameEDT->SetModifyHdl(LINK(this,AssistentDlgImpl,UpdateUserDataHdl));
578 mpPage4AskTopicEDT->SetModifyHdl(LINK(this,AssistentDlgImpl,UpdateUserDataHdl));
579 mpPage4AskInfoEDT->SetModifyHdl(LINK(this,AssistentDlgImpl,UpdateUserDataHdl));
580
560 maAssistentFunc.InsertControl(4,
561 mpPage4FB = new FixedBitmap(pWindow,SdResId(FB_PAGE4)));
562 maAssistentFunc.InsertControl(4,
563 mpPage4PersonalFL = new FixedLine( pWindow, SdResId(FL_PAGE4_PERSONAL) ));
564 maAssistentFunc.InsertControl(4,
565 mpPage4AskNameFT = new FixedText( pWindow, SdResId(FT_PAGE4_ASKNAME) ));
566 maAssistentFunc.InsertControl(4,
567 mpPage4AskNameEDT = new Edit( pWindow, SdResId(EDT_PAGE4_ASKNAME) ));

--- 5 unchanged lines hidden (view full) ---

573 mpPage4AskInfoFT = new FixedText( pWindow, SdResId(FT_PAGE4_ASKINFORMATION) ));
574 maAssistentFunc.InsertControl(4,
575 mpPage4AskInfoEDT = new MultiLineEdit( pWindow, SdResId(EDT_PAGE4_ASKINFORMATION) ));
576
577 mpPage4AskNameEDT->SetModifyHdl(LINK(this,AssistentDlgImpl,UpdateUserDataHdl));
578 mpPage4AskTopicEDT->SetModifyHdl(LINK(this,AssistentDlgImpl,UpdateUserDataHdl));
579 mpPage4AskInfoEDT->SetModifyHdl(LINK(this,AssistentDlgImpl,UpdateUserDataHdl));
580
581 // page 5
581 // Page 5
582 maAssistentFunc.InsertControl(5, &maPreview );
583 maAssistentFunc.InsertControl(5, &maPreviewFlag );
584 maAssistentFunc.InsertControl(5,
585 mpPage5FB = new FixedBitmap(pWindow,SdResId(FB_PAGE5)));
586 maAssistentFunc.InsertControl(5,
587 mpPage5PageListFT = new FixedText( pWindow, SdResId( FT_PAGE5_PAGELIST ) ));
588 maAssistentFunc.InsertControl(5,
589 mpPage5PageListCT = new SdPageListControl( pWindow, SdResId( CT_PAGE5_PAGELIST ) ));
590 maAssistentFunc.InsertControl(5,
591 mpPage5SummaryCB = new CheckBox( pWindow, SdResId( CB_PAGE5_SUMMARY ) ));
592
593 mpPage5PageListCT->SetSelectHdl(LINK(this,AssistentDlgImpl, PageSelectHdl));
594
595
582 maAssistentFunc.InsertControl(5, &maPreview );
583 maAssistentFunc.InsertControl(5, &maPreviewFlag );
584 maAssistentFunc.InsertControl(5,
585 mpPage5FB = new FixedBitmap(pWindow,SdResId(FB_PAGE5)));
586 maAssistentFunc.InsertControl(5,
587 mpPage5PageListFT = new FixedText( pWindow, SdResId( FT_PAGE5_PAGELIST ) ));
588 maAssistentFunc.InsertControl(5,
589 mpPage5PageListCT = new SdPageListControl( pWindow, SdResId( CT_PAGE5_PAGELIST ) ));
590 maAssistentFunc.InsertControl(5,
591 mpPage5SummaryCB = new CheckBox( pWindow, SdResId( CB_PAGE5_SUMMARY ) ));
592
593 mpPage5PageListCT->SetSelectHdl(LINK(this,AssistentDlgImpl, PageSelectHdl));
594
595
596 // generell
597 InterpolateFixedBitmap( mpPage1FB );
598 InterpolateFixedBitmap( mpPage2FB );
599 InterpolateFixedBitmap( mpPage3FB );
600 InterpolateFixedBitmap( mpPage4FB );
601 InterpolateFixedBitmap( mpPage5FB );
596 // General
597 InterpolateFixedBitmap( mpPage1FB );
598 InterpolateFixedBitmap( mpPage2FB );
599 InterpolateFixedBitmap( mpPage3FB );
600 InterpolateFixedBitmap( mpPage4FB );
601 InterpolateFixedBitmap( mpPage5FB );
602
603 maLastPageButton.SetClickHdl(LINK(this,AssistentDlgImpl, LastPageHdl ));
604 maNextPageButton.SetClickHdl(LINK(this,AssistentDlgImpl, NextPageHdl ));
605
606 maPreviewFlag.Check( mbPreview );
607 maPreviewFlag.SetClickHdl(LINK(this, AssistentDlgImpl, PreviewFlagHdl ));
608 maPreview.SetClickHdl(LINK(this,AssistentDlgImpl, EffectPreviewHdl ));
609
602
603 maLastPageButton.SetClickHdl(LINK(this,AssistentDlgImpl, LastPageHdl ));
604 maNextPageButton.SetClickHdl(LINK(this,AssistentDlgImpl, NextPageHdl ));
605
606 maPreviewFlag.Check( mbPreview );
607 maPreviewFlag.SetClickHdl(LINK(this, AssistentDlgImpl, PreviewFlagHdl ));
608 maPreview.SetClickHdl(LINK(this,AssistentDlgImpl, EffectPreviewHdl ));
609
610 //setzt die Ausgangsseite
610 // setzt die Ausgangsseite
611 maAssistentFunc.GotoPage(1);
612 maLastPageButton.Disable();
613
614 maPrevTimer.SetTimeout( 200 );
615 maPrevTimer.SetTimeoutHdl( LINK( this, AssistentDlgImpl, UpdatePreviewHdl));
616
617 maEffectPrevTimer.SetTimeout( 50 );
618 maEffectPrevTimer.SetTimeoutHdl( LINK( this, AssistentDlgImpl, EffectPreviewHdl ));
619
620 maUpdatePageListTimer.SetTimeout( 50 );
621 maUpdatePageListTimer.SetTimeoutHdl( LINK( this, AssistentDlgImpl, UpdatePageListHdl));
622
623 SetStartType( ST_EMPTY );
624
625 ChangePage();
626
611 maAssistentFunc.GotoPage(1);
612 maLastPageButton.Disable();
613
614 maPrevTimer.SetTimeout( 200 );
615 maPrevTimer.SetTimeoutHdl( LINK( this, AssistentDlgImpl, UpdatePreviewHdl));
616
617 maEffectPrevTimer.SetTimeout( 50 );
618 maEffectPrevTimer.SetTimeoutHdl( LINK( this, AssistentDlgImpl, EffectPreviewHdl ));
619
620 maUpdatePageListTimer.SetTimeout( 50 );
621 maUpdatePageListTimer.SetTimeoutHdl( LINK( this, AssistentDlgImpl, UpdatePageListHdl));
622
623 SetStartType( ST_EMPTY );
624
625 ChangePage();
626
627 mpWindowUpdater->RegisterWindow (&maPreview);
627 mpWindowUpdater->RegisterWindow (&maPreview);
628
629 UpdatePreview( sal_True );
630
628
629 UpdatePreview( sal_True );
630
631 //check whether we should start with a template document initialy and preselect it
631 // check whether we should start with a template document initially and preselect it
632 const ::rtl::OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.PresentationDocument" ) );
632 const ::rtl::OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.PresentationDocument" ) );
633 String aStandardTemplate( SfxObjectFactory::GetStandardTemplate( aServiceName ) );
634 if( aStandardTemplate.Len() )
635 {
636 ProvideTemplates();
633 String aStandardTemplate( SfxObjectFactory::GetStandardTemplate( aServiceName ) );
634 if( aStandardTemplate.Len() )
635 {
636 ProvideTemplates();
637
637
638 //find aStandardTemplate in maPresentList
639 TemplateDir* pStandardTemplateDir = 0;
640 TemplateEntry* pStandardTemplateEntry = 0;
638 // find aStandardTemplate in maPresentList
639 TemplateDir* pStandardTemplateDir = 0;
640 TemplateEntry* pStandardTemplateEntry = 0;
641
641
642 std::vector<TemplateDir*>::iterator I;
643 for (I=maPresentList.begin(); I!=maPresentList.end(); I++)
644 {
645 TemplateDir* pDir = *I;
646 std::vector<TemplateEntry*>::iterator J;
642 std::vector<TemplateDir*>::iterator I;
643 for (I=maPresentList.begin(); I!=maPresentList.end(); I++)
644 {
645 TemplateDir* pDir = *I;
646 std::vector<TemplateEntry*>::iterator J;
647 for (J=pDir->maEntries.begin(); J!=pDir->maEntries.end(); J++)
647 for (J=pDir->maEntries.begin(); J!=pDir->maEntries.end(); J++)
648 {
649 TemplateEntry* pEntry = *J;
650 if(pEntry->msPath == aStandardTemplate)
651 {
652 pStandardTemplateDir = pDir;
653 pStandardTemplateEntry = pEntry;
654 break;
655 }
656 }
657 if(pStandardTemplateDir)
658 break;
659 }
648 {
649 TemplateEntry* pEntry = *J;
650 if(pEntry->msPath == aStandardTemplate)
651 {
652 pStandardTemplateDir = pDir;
653 pStandardTemplateEntry = pEntry;
654 break;
655 }
656 }
657 if(pStandardTemplateDir)
658 break;
659 }
660
660
661 //preselect template
662 if( pStandardTemplateDir && pStandardTemplateEntry )
663 {
664 mpPage1RegionLB->SelectEntry( pStandardTemplateDir->msRegion );
665 SelectTemplateRegion( pStandardTemplateDir->msRegion );
666 mpPage1TemplateLB->SelectEntry( pStandardTemplateEntry->msTitle );
667 SelectTemplateHdl(mpPage1TemplateLB);
668 }
669 }
661 // preselect template
662 if( pStandardTemplateDir && pStandardTemplateEntry )
663 {
664 mpPage1RegionLB->SelectEntry( pStandardTemplateDir->msRegion );
665 SelectTemplateRegion( pStandardTemplateDir->msRegion );
666 mpPage1TemplateLB->SelectEntry( pStandardTemplateEntry->msTitle );
667 SelectTemplateHdl(mpPage1TemplateLB);
668 }
669 }
670}
671
672
673
674
675AssistentDlgImpl::~AssistentDlgImpl()
676{
677 CloseDocShell();
678
679 DeletePassords();
680
670}
671
672
673
674
675AssistentDlgImpl::~AssistentDlgImpl()
676{
677 CloseDocShell();
678
679 DeletePassords();
680
681 // Delete the template file infos.
681 // Delete the template file infos.
682 std::vector<TemplateDir*>::iterator I;
683 std::vector<TemplateEntry*>::iterator J;
684 for (I=maPresentList.begin(); I!=maPresentList.end(); I++)
685 {
686 for (J=(*I)->maEntries.begin(); J!=(*I)->maEntries.end(); J++)
687 delete (*J);
688 delete (*I);
689 }
690
682 std::vector<TemplateDir*>::iterator I;
683 std::vector<TemplateEntry*>::iterator J;
684 for (I=maPresentList.begin(); I!=maPresentList.end(); I++)
685 {
686 for (J=(*I)->maEntries.begin(); J!=(*I)->maEntries.end(); J++)
687 delete (*J);
688 delete (*I);
689 }
690
691 // Seite 1
691 // Page 1
692 delete mpPage1FB;
693 delete mpPage1ArtFL;
694 delete mpPage1EmptyRB;
695 delete mpPage1TemplateRB;
696 delete mpPage1TemplateLB;
697 delete mpPage1RegionLB;
698 delete mpPage1OpenRB;
699 delete mpPage1OpenLB;
692 delete mpPage1FB;
693 delete mpPage1ArtFL;
694 delete mpPage1EmptyRB;
695 delete mpPage1TemplateRB;
696 delete mpPage1TemplateLB;
697 delete mpPage1RegionLB;
698 delete mpPage1OpenRB;
699 delete mpPage1OpenLB;
700 delete mpPage1OpenPB;
700 delete mpPage1OpenPB;
701
701
702 // Seite 2
702 // Page 2
703 delete mpPage2FB;
704 delete mpPage2LayoutFL;
705 delete mpPage2RegionLB;
706 delete mpPage2LayoutLB;
707 delete mpPage2OutTypesFL;
708 delete mpPage2Medium1RB;
709 delete mpPage2Medium2RB;
710 delete mpPage2Medium3RB;
711 delete mpPage2Medium4RB;
712 delete mpPage2Medium5RB;
713
703 delete mpPage2FB;
704 delete mpPage2LayoutFL;
705 delete mpPage2RegionLB;
706 delete mpPage2LayoutLB;
707 delete mpPage2OutTypesFL;
708 delete mpPage2Medium1RB;
709 delete mpPage2Medium2RB;
710 delete mpPage2Medium3RB;
711 delete mpPage2Medium4RB;
712 delete mpPage2Medium5RB;
713
714 // Seite 3
714 // Page 3
715 delete mpPage3FB;
716 delete mpPage3EffectFL;
717 delete mpPage3EffectFT;
718 delete mpPage3EffectLB;
719 delete mpPage3SpeedFT;
720 delete mpPage3SpeedLB;
721 delete mpPage3PresTypeFL;
722 delete mpPage3PresTypeLiveRB;
723 delete mpPage3PresTypeKioskRB;
724 delete mpPage3PresTimeFT;
725 delete mpPage3PresTimeTMF;
726 delete mpPage3BreakFT;
727 delete mpPage3BreakTMF;
728 delete mpPage3LogoCB;
729
715 delete mpPage3FB;
716 delete mpPage3EffectFL;
717 delete mpPage3EffectFT;
718 delete mpPage3EffectLB;
719 delete mpPage3SpeedFT;
720 delete mpPage3SpeedLB;
721 delete mpPage3PresTypeFL;
722 delete mpPage3PresTypeLiveRB;
723 delete mpPage3PresTypeKioskRB;
724 delete mpPage3PresTimeFT;
725 delete mpPage3PresTimeTMF;
726 delete mpPage3BreakFT;
727 delete mpPage3BreakTMF;
728 delete mpPage3LogoCB;
729
730 // Seite 4
730 // Page 4
731 delete mpPage4FB;
732 delete mpPage4PersonalFL;
733 delete mpPage4AskNameFT;
734 delete mpPage4AskNameEDT;
735 delete mpPage4AskTopicFT;
736 delete mpPage4AskTopicEDT;
737 delete mpPage4AskInfoFT;
738 delete mpPage4AskInfoEDT;
739
731 delete mpPage4FB;
732 delete mpPage4PersonalFL;
733 delete mpPage4AskNameFT;
734 delete mpPage4AskNameEDT;
735 delete mpPage4AskTopicFT;
736 delete mpPage4AskTopicEDT;
737 delete mpPage4AskInfoFT;
738 delete mpPage4AskInfoEDT;
739
740 // Seite 5
740 // Page 5
741 delete mpPage5FB;
742 delete mpPage5PageListFT;
743 delete mpPage5PageListCT;
744 delete mpPage5SummaryCB;
745
741 delete mpPage5FB;
742 delete mpPage5PageListFT;
743 delete mpPage5PageListCT;
744 delete mpPage5SummaryCB;
745
746 // Delete the file history list.
746 // Delete the file history list.
747 std::vector<String*>::iterator I2;
748 for (I2=maOpenFilesList.begin(); I2!=maOpenFilesList.end(); I2++)
749 delete *I2;
750}
751
752void AssistentDlgImpl::CloseDocShell()
753{
754 if(xDocShell.Is())

--- 20 unchanged lines hidden (view full) ---

775 mpWindow = NULL;
776}
777
778
779
780
781void AssistentDlgImpl::ScanDocmenu (void)
782{
747 std::vector<String*>::iterator I2;
748 for (I2=maOpenFilesList.begin(); I2!=maOpenFilesList.end(); I2++)
749 delete *I2;
750}
751
752void AssistentDlgImpl::CloseDocShell()
753{
754 if(xDocShell.Is())

--- 20 unchanged lines hidden (view full) ---

775 mpWindow = NULL;
776}
777
778
779
780
781void AssistentDlgImpl::ScanDocmenu (void)
782{
783 if( mbRecentDocumentsReady )
784 return;
783 if( mbRecentDocumentsReady )
784 return;
785
786 uno::Sequence<uno::Sequence<beans::PropertyValue> > aHistory =
787 SvtHistoryOptions().GetList (ePICKLIST);
788
785
786 uno::Sequence<uno::Sequence<beans::PropertyValue> > aHistory =
787 SvtHistoryOptions().GetList (ePICKLIST);
788
789 uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
790 uno::Reference< container::XNameAccess > xFilterFactory( xFactory->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.FilterFactory" ) ) ), uno::UNO_QUERY );
789 uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
790 uno::Reference< container::XNameAccess > xFilterFactory( xFactory->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.FilterFactory" ) ) ), uno::UNO_QUERY );
791
791
792 Reference< ::com::sun::star::ucb::XSimpleFileAccess > xFileAccess(
793 xFactory->createInstance(
794 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess"))),
795 UNO_QUERY_THROW);
792 Reference< ::com::sun::star::ucb::XSimpleFileAccess > xFileAccess(
793 xFactory->createInstance(
794 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess"))),
795 UNO_QUERY_THROW);
796
797 sal_uInt32 nCount = aHistory.getLength();
798 for (sal_uInt32 nItem=0; nItem<nCount; ++nItem)
799 {
796
797 sal_uInt32 nCount = aHistory.getLength();
798 for (sal_uInt32 nItem=0; nItem<nCount; ++nItem)
799 {
800 // Get the current history item's properties.
800 // Get the current history item's properties.
801 uno::Sequence<beans::PropertyValue> aPropertySet = aHistory[nItem];
802 rtl::OUString sURL;
803 rtl::OUString sFilter;
804 rtl::OUString sTitle;
805 rtl::OUString sPassword;
806 sal_uInt32 nPropertyCount = aPropertySet.getLength();
807 for (sal_uInt32 nProperty=0; nProperty<nPropertyCount; ++nProperty)
808 if (aPropertySet[nProperty].Name == HISTORY_PROPERTYNAME_URL)
809 aPropertySet[nProperty].Value >>= sURL;
810 else if (aPropertySet[nProperty].Name == HISTORY_PROPERTYNAME_FILTER)
811 aPropertySet[nProperty].Value >>= sFilter;
812 else if (aPropertySet[nProperty].Name == HISTORY_PROPERTYNAME_TITLE)
813 aPropertySet[nProperty].Value >>= sTitle;
814 else if (aPropertySet[nProperty].Name == HISTORY_PROPERTYNAME_PASSWORD)
815 aPropertySet[nProperty].Value >>= sPassword;
816
801 uno::Sequence<beans::PropertyValue> aPropertySet = aHistory[nItem];
802 rtl::OUString sURL;
803 rtl::OUString sFilter;
804 rtl::OUString sTitle;
805 rtl::OUString sPassword;
806 sal_uInt32 nPropertyCount = aPropertySet.getLength();
807 for (sal_uInt32 nProperty=0; nProperty<nPropertyCount; ++nProperty)
808 if (aPropertySet[nProperty].Name == HISTORY_PROPERTYNAME_URL)
809 aPropertySet[nProperty].Value >>= sURL;
810 else if (aPropertySet[nProperty].Name == HISTORY_PROPERTYNAME_FILTER)
811 aPropertySet[nProperty].Value >>= sFilter;
812 else if (aPropertySet[nProperty].Name == HISTORY_PROPERTYNAME_TITLE)
813 aPropertySet[nProperty].Value >>= sTitle;
814 else if (aPropertySet[nProperty].Name == HISTORY_PROPERTYNAME_PASSWORD)
815 aPropertySet[nProperty].Value >>= sPassword;
816
817 // If the entry is an impress file then insert it into the
818 // history list and the list box.
819 uno::Sequence< beans::PropertyValue > lProps;
820 if (xFilterFactory->hasByName(sFilter))
821 {
822 uno::Any aFilterPropSet = xFilterFactory->getByName( sFilter );
823 aFilterPropSet >>= lProps;
824 }
817 // If the entry is an Impress file then insert it into the
818 // history list and the list box.
819 uno::Sequence< beans::PropertyValue > lProps;
820 if (xFilterFactory->hasByName(sFilter))
821 {
822 uno::Any aFilterPropSet = xFilterFactory->getByName( sFilter );
823 aFilterPropSet >>= lProps;
824 }
825
825
826 sal_Int32 nPropCount = lProps.getLength();
827 rtl::OUString sFactoryName;
828 for( sal_Int32 i=0; i<nPropCount; ++i )
829 {
830 if( lProps[i].Name.compareToAscii( "DocumentService" ) == 0 &&
831 (lProps[i].Value >>= sFactoryName) &&
832 sFactoryName.compareToAscii( "com.sun.star.presentation.PresentationDocument" ) == 0 )
833 {
834 // yes, it's an impress document
835 INetURLObject aURL;
826 sal_Int32 nPropCount = lProps.getLength();
827 rtl::OUString sFactoryName;
828 for( sal_Int32 i=0; i<nPropCount; ++i )
829 {
830 if( lProps[i].Name.compareToAscii( "DocumentService" ) == 0 &&
831 (lProps[i].Value >>= sFactoryName) &&
832 sFactoryName.compareToAscii( "com.sun.star.presentation.PresentationDocument" ) == 0 )
833 {
834 // yes, it's an Impress document
835 INetURLObject aURL;
836
836
837 // Do not include the file if it does not exist.
838 if (xFileAccess.is() && ! xFileAccess->exists(sURL))
839 continue;
837 // Do not include the file if it does not exist.
838 if (xFileAccess.is() && ! xFileAccess->exists(sURL))
839 continue;
840
840
841 aURL.SetSmartURL (sURL);
842 // The password is set only when it is not empty.
843 if (sPassword.getLength() > 0)
844 aURL.SetPass (sPassword);
845 maOpenFilesList.push_back (new String (aURL.GetMainURL( INetURLObject::NO_DECODE )));
846 mpPage1OpenLB->InsertEntry (sTitle);
847 break;
848 }
841 aURL.SetSmartURL (sURL);
842 // The password is set only when it is not empty.
843 if (sPassword.getLength() > 0)
844 aURL.SetPass (sPassword);
845 maOpenFilesList.push_back (new String (aURL.GetMainURL( INetURLObject::NO_DECODE )));
846 mpPage1OpenLB->InsertEntry (sTitle);
847 break;
848 }
849 }
850 }
849 }
850 }
851 mbRecentDocumentsReady = sal_True;
852 try
853 {
854 UpdatePreview(sal_True);
855 }
856 catch (uno::RuntimeException& )
857 {
858 // Ignore all exceptions.
859 }
851 mbRecentDocumentsReady = sal_True;
852 try
853 {
854 UpdatePreview(sal_True);
855 }
856 catch (uno::RuntimeException& )
857 {
858 // Ignore all exceptions.
859 }
860}
861
862
863
864void AssistentDlgImpl::ProvideTemplates (void)
865{
860}
861
862
863
864void AssistentDlgImpl::ProvideTemplates (void)
865{
866 if ( ! mbTemplatesReady)
867 {
868 TemplateScanner aScanner;
869 aScanner.Scan ();
870 TemplateScanDone (aScanner.GetFolderList());
866 if ( ! mbTemplatesReady)
867 {
868 TemplateScanner aScanner;
869 aScanner.Scan ();
870 TemplateScanDone (aScanner.GetFolderList());
871
871
872 try
873 {
874 UpdatePreview(sal_True);
875 }
876 catch (uno::RuntimeException& e)
877 {
878 // Ignore all exceptions.
879 (void) e;
880 }
881 }
872 try
873 {
874 UpdatePreview(sal_True);
875 }
876 catch (uno::RuntimeException& e)
877 {
878 // Ignore all exceptions.
879 (void) e;
880 }
881 }
882}
883
884void AssistentDlgImpl::TemplateScanDone (
882}
883
884void AssistentDlgImpl::TemplateScanDone (
885 std::vector<TemplateDir*>& rTemplateFolder)
885 std::vector<TemplateDir*>& rTemplateFolder)
886{
886{
887 // This method is called from a thread. Therefore we get the solar mutex.
887 // This method is called from a thread. Therefore we get the solar mutex.
888 ::vos::OGuard aGuard (Application::GetSolarMutex());
889
888 ::vos::OGuard aGuard (Application::GetSolarMutex());
889
890 // Copy the contents of the given template folders to a local list.
891 maPresentList.swap (rTemplateFolder);
890 // Copy the contents of the given template folders to a local list.
891 maPresentList.swap (rTemplateFolder);
892
892
893 // Fill in the list box on the first page.
893 // Fill in the list box on the first page.
894 int nFirstEntry = 0;
895 mpPage1RegionLB->Clear();
896 std::vector<TemplateDir*>::iterator I;
897 int i;
898 for (i=0,I=maPresentList.begin(); I!=maPresentList.end(); I++,i++)
899 {
900 TemplateDir* pDir = *I;
894 int nFirstEntry = 0;
895 mpPage1RegionLB->Clear();
896 std::vector<TemplateDir*>::iterator I;
897 int i;
898 for (i=0,I=maPresentList.begin(); I!=maPresentList.end(); I++,i++)
899 {
900 TemplateDir* pDir = *I;
901 if (pDir == NULL)
902 continue;
901 if (pDir == NULL)
902 continue;
903
903
904 // HACK! presnt directory is always initially selected.
905 // We have to look at the first entry to get a URL.
906 if (!pDir->maEntries.empty() )
907 {
908 TemplateEntry* pEntry = pDir->maEntries.front();
909 if (pEntry != NULL)
910 if (pEntry->msPath.SearchAscii("presnt") != STRING_NOTFOUND)
911 nFirstEntry = i;
912 }
904 // HACK! present directory is always initially selected.
905 // We have to look at the first entry to get a URL.
906 if (!pDir->maEntries.empty() )
907 {
908 TemplateEntry* pEntry = pDir->maEntries.front();
909 if (pEntry != NULL)
910 if (pEntry->msPath.SearchAscii("presnt") != STRING_NOTFOUND)
911 nFirstEntry = i;
912 }
913
914 mpPage1RegionLB->InsertEntry (pDir->msRegion);
915 }
916 mpPage1RegionLB->SelectEntryPos ((sal_uInt16)nFirstEntry);
917 mpPage1RegionLB->Update();
918 SelectTemplateRegion (mpPage1RegionLB->GetSelectEntry());
919
913
914 mpPage1RegionLB->InsertEntry (pDir->msRegion);
915 }
916 mpPage1RegionLB->SelectEntryPos ((sal_uInt16)nFirstEntry);
917 mpPage1RegionLB->Update();
918 SelectTemplateRegion (mpPage1RegionLB->GetSelectEntry());
919
920 // Fill in the list box on the second page.
920 // Fill in the list box on the second page.
921 nFirstEntry = 0;
922 mpPage2RegionLB->Clear();
923 for (i=0,I=maPresentList.begin(); I!=maPresentList.end(); I++,i++)
924 {
925 TemplateDir* pDir = *I;
921 nFirstEntry = 0;
922 mpPage2RegionLB->Clear();
923 for (i=0,I=maPresentList.begin(); I!=maPresentList.end(); I++,i++)
924 {
925 TemplateDir* pDir = *I;
926 if (pDir == NULL)
927 continue;
926 if (pDir == NULL)
927 continue;
928
929 // HACK! layout directory is always initially selected.
928
929 // HACK! layout directory is always initially selected.
930 // We have to look at the first entry to get a URL.
931 if (!pDir->maEntries.empty() )
932 {
933 TemplateEntry* pEntry = pDir->maEntries.front();
934 if (pEntry != NULL)
935 if (pEntry->msPath.SearchAscii("layout") != STRING_NOTFOUND)
936 nFirstEntry = i;
937 }
930 // We have to look at the first entry to get a URL.
931 if (!pDir->maEntries.empty() )
932 {
933 TemplateEntry* pEntry = pDir->maEntries.front();
934 if (pEntry != NULL)
935 if (pEntry->msPath.SearchAscii("layout") != STRING_NOTFOUND)
936 nFirstEntry = i;
937 }
938
939 mpPage2RegionLB->InsertEntry (pDir->msRegion);
940 }
941 mpPage2RegionLB->SelectEntryPos ((sal_uInt16)nFirstEntry);
942 mpPage2RegionLB->Update();
943 SelectLayoutRegion (mpPage2RegionLB->GetSelectEntry());
944
938
939 mpPage2RegionLB->InsertEntry (pDir->msRegion);
940 }
941 mpPage2RegionLB->SelectEntryPos ((sal_uInt16)nFirstEntry);
942 mpPage2RegionLB->Update();
943 SelectLayoutRegion (mpPage2RegionLB->GetSelectEntry());
944
945 // Make the changes visible.
945 // Make the changes visible.
946 mbTemplatesReady = sal_True;
947 if (mpWindow)
948 UpdatePage();
949}
950
951
952
953
954// ********************************************************************
946 mbTemplatesReady = sal_True;
947 if (mpWindow)
948 UpdatePage();
949}
950
951
952
953
954// ********************************************************************
955// Status Methoden
955// Status methods
956// ********************************************************************
957
958void AssistentDlgImpl::SetStartType( StartType eType )
959{
960 mpPage1EmptyRB->SetState( eType == ST_EMPTY );
961 mpPage1TemplateRB->SetState( eType == ST_TEMPLATE );
962 mpPage1OpenRB->SetState( eType == ST_OPEN );
963 maNextPageButton.Enable( eType != ST_OPEN );

--- 71 unchanged lines hidden (view full) ---

1035 if(pEntry)
1036 aFile = pEntry->msPath;
1037
1038 return aFile;
1039}
1040
1041SfxObjectShellLock AssistentDlgImpl::GetDocument()
1042{
956// ********************************************************************
957
958void AssistentDlgImpl::SetStartType( StartType eType )
959{
960 mpPage1EmptyRB->SetState( eType == ST_EMPTY );
961 mpPage1TemplateRB->SetState( eType == ST_TEMPLATE );
962 mpPage1OpenRB->SetState( eType == ST_OPEN );
963 maNextPageButton.Enable( eType != ST_OPEN );

--- 71 unchanged lines hidden (view full) ---

1035 if(pEntry)
1036 aFile = pEntry->msPath;
1037
1038 return aFile;
1039}
1040
1041SfxObjectShellLock AssistentDlgImpl::GetDocument()
1042{
1043// mbPreview = sal_False; // Document nicht anzeigen
1044 UpdatePreview(sal_False); // aber komplett laden
1043// mbPreview = sal_False; // Document nicht anzeigen
1044 UpdatePreview(sal_False); // aber komplett laden
1045 UpdatePageList();
1046
1047 SfxObjectShell* pShell = xDocShell;
1048 ::sd::DrawDocShell* pDocShell = PTR_CAST(::sd::DrawDocShell,pShell);
1049 SdDrawDocument* pDoc = pDocShell?pDocShell->GetDoc():NULL;
1050
1051 if(pDoc)
1052 {

--- 12 unchanged lines hidden (view full) ---

1065 sal_uInt16 nPgRelNum = 0;
1066 while( nPgAbsNum < nPageCount )
1067 {
1068 SdPage* pPage = pDoc->GetSdPage( nPgRelNum, PK_STANDARD );
1069 if( mpPage5PageListCT->IsPageChecked(nPgAbsNum) )
1070 {
1071 mpPage3EffectLB->applySelected(pPage);
1072 const sal_uInt16 nPos = mpPage3SpeedLB->GetSelectEntryPos();
1045 UpdatePageList();
1046
1047 SfxObjectShell* pShell = xDocShell;
1048 ::sd::DrawDocShell* pDocShell = PTR_CAST(::sd::DrawDocShell,pShell);
1049 SdDrawDocument* pDoc = pDocShell?pDocShell->GetDoc():NULL;
1050
1051 if(pDoc)
1052 {

--- 12 unchanged lines hidden (view full) ---

1065 sal_uInt16 nPgRelNum = 0;
1066 while( nPgAbsNum < nPageCount )
1067 {
1068 SdPage* pPage = pDoc->GetSdPage( nPgRelNum, PK_STANDARD );
1069 if( mpPage5PageListCT->IsPageChecked(nPgAbsNum) )
1070 {
1071 mpPage3EffectLB->applySelected(pPage);
1072 const sal_uInt16 nPos = mpPage3SpeedLB->GetSelectEntryPos();
1073 pPage->setTransitionDuration( (nPos == 0) ? 3.0 : (nPos == 1) ? 2.0 : 1.0 );
1073 pPage->setTransitionDuration( (nPos == 0) ? 3.0 : (nPos == 1) ? 2.0 : 1.0 );
1074 if(bKiosk)
1075 {
1076 pPage->SetPresChange( PRESCHANGE_AUTO );
1077 pPage->SetTime(nNewTime);
1078 }
1079 nPgRelNum++;
1080 }
1081 else
1082 {
1074 if(bKiosk)
1075 {
1076 pPage->SetPresChange( PRESCHANGE_AUTO );
1077 pPage->SetTime(nNewTime);
1078 }
1079 nPgRelNum++;
1080 }
1081 else
1082 {
1083 // diese Seite loeschen
1084 pDoc->DeletePage( (nPgRelNum << 1) + 2 ); // Notizseite loeschen
1085 pDoc->DeletePage( (nPgRelNum << 1) + 1 ); // Seite loeschen
1083 // delete this page
1084 pDoc->DeletePage( (nPgRelNum << 1) + 2 ); // NotizPage loeschen
1085 pDoc->DeletePage( (nPgRelNum << 1) + 1 ); // delete page
1086 }
1087
1088 nPgAbsNum++;
1089 }
1090 }
1091 else
1092 {
1093 DBG_ERROR("sd::AssistentDlgImpl::GetDocument(), no template?");

--- 24 unchanged lines hidden (view full) ---

1118 {
1119 mpWindow->SetHelpId( PageHelpIds[nPage-1]);
1120 }
1121
1122 UpdatePage();
1123
1124 if( maNextPageButton.IsEnabled() )
1125 {
1086 }
1087
1088 nPgAbsNum++;
1089 }
1090 }
1091 else
1092 {
1093 DBG_ERROR("sd::AssistentDlgImpl::GetDocument(), no template?");

--- 24 unchanged lines hidden (view full) ---

1118 {
1119 mpWindow->SetHelpId( PageHelpIds[nPage-1]);
1120 }
1121
1122 UpdatePage();
1123
1124 if( maNextPageButton.IsEnabled() )
1125 {
1126 maNextPageButton.ForceFocusEventBroadcast();
1126 maNextPageButton.ForceFocusEventBroadcast();
1127 }
1128 else
1129 maFinishButton.GrabFocus();
1130}
1131
1132void AssistentDlgImpl::UpdatePage()
1133{
1134 sal_uInt16 nPage = (sal_uInt16)maAssistentFunc.GetCurrentPage();
1135
1136 switch(nPage)
1137 {
1138 case 1:
1139 {
1127 }
1128 else
1129 maFinishButton.GrabFocus();
1130}
1131
1132void AssistentDlgImpl::UpdatePage()
1133{
1134 sal_uInt16 nPage = (sal_uInt16)maAssistentFunc.GetCurrentPage();
1135
1136 switch(nPage)
1137 {
1138 case 1:
1139 {
1140 // Elemente auf der ersten Seite abhaengig vom Starttype Zeigen
1140 // Elemente auf der ersten Page abhaengig vom Starttype zeigen
1141 SetStartType( GetStartType() );
1142 mpPage1TemplateRB->Enable(sal_True /*mbTemplatesReady*/);
1143 break;
1144 }
1145
1146 case 2:
1147 {
1148 mpPage2RegionLB->Enable(mbTemplatesReady);

--- 60 unchanged lines hidden (view full) ---

1209IMPL_LINK( AssistentDlgImpl, SelectEffectHdl, void*, EMPTYARG )
1210{
1211 maEffectPrevTimer.Start();
1212 return 0;
1213}
1214
1215IMPL_LINK( AssistentDlgImpl, OpenButtonHdl, Button*, pButton )
1216{
1141 SetStartType( GetStartType() );
1142 mpPage1TemplateRB->Enable(sal_True /*mbTemplatesReady*/);
1143 break;
1144 }
1145
1146 case 2:
1147 {
1148 mpPage2RegionLB->Enable(mbTemplatesReady);

--- 60 unchanged lines hidden (view full) ---

1209IMPL_LINK( AssistentDlgImpl, SelectEffectHdl, void*, EMPTYARG )
1210{
1211 maEffectPrevTimer.Start();
1212 return 0;
1213}
1214
1215IMPL_LINK( AssistentDlgImpl, OpenButtonHdl, Button*, pButton )
1216{
1217 // Clear the selection and forward the call.
1218 mpPage1OpenLB->SetNoSelection();
1219 return mpPage1OpenLB->GetDoubleClickHdl().Call(pButton);
1217 // Clear the selection and forward the call.
1218 mpPage1OpenLB->SetNoSelection();
1219 return mpPage1OpenLB->GetDoubleClickHdl().Call(pButton);
1220}
1221
1222IMPL_LINK( AssistentDlgImpl, EffectPreviewHdl, Button *, EMPTYARG )
1223{
1224 if(mbPreview && xDocShell.Is() )
1225 {
1226 SfxObjectShell* pShell = xDocShell;
1227 DrawDocShell* pDocShell = dynamic_cast< DrawDocShell * >(pShell);

--- 69 unchanged lines hidden (view full) ---

1297 return 0;
1298}
1299
1300IMPL_LINK( AssistentDlgImpl, StartTypeHdl, RadioButton *, pButton )
1301{
1302 StartType eType = pButton == mpPage1EmptyRB?ST_EMPTY:pButton == mpPage1TemplateRB?ST_TEMPLATE:ST_OPEN;
1303
1304 if(eType == ST_TEMPLATE)
1220}
1221
1222IMPL_LINK( AssistentDlgImpl, EffectPreviewHdl, Button *, EMPTYARG )
1223{
1224 if(mbPreview && xDocShell.Is() )
1225 {
1226 SfxObjectShell* pShell = xDocShell;
1227 DrawDocShell* pDocShell = dynamic_cast< DrawDocShell * >(pShell);

--- 69 unchanged lines hidden (view full) ---

1297 return 0;
1298}
1299
1300IMPL_LINK( AssistentDlgImpl, StartTypeHdl, RadioButton *, pButton )
1301{
1302 StartType eType = pButton == mpPage1EmptyRB?ST_EMPTY:pButton == mpPage1TemplateRB?ST_TEMPLATE:ST_OPEN;
1303
1304 if(eType == ST_TEMPLATE)
1305 ProvideTemplates();
1306 else if(eType == ST_OPEN)
1307 ScanDocmenu();
1305 ProvideTemplates();
1306 else if(eType == ST_OPEN)
1307 ScanDocmenu();
1308
1309 SetStartType( eType );
1310
1311 if(eType == ST_TEMPLATE)
1312 {
1313 mpPage1TemplateLB->SelectEntryPos(0);
1314 mpPage2Medium5RB->Check();
1315 }
1316 else if(eType == ST_OPEN)
1317 mpPage1OpenLB->SelectEntryPos(0);
1318
1319 maPrevTimer.Start();
1320 return 0;
1321}
1322
1323
1324IMPL_LINK( AssistentDlgImpl, NextPageHdl, PushButton *, EMPTYARG )
1325{
1308
1309 SetStartType( eType );
1310
1311 if(eType == ST_TEMPLATE)
1312 {
1313 mpPage1TemplateLB->SelectEntryPos(0);
1314 mpPage2Medium5RB->Check();
1315 }
1316 else if(eType == ST_OPEN)
1317 mpPage1OpenLB->SelectEntryPos(0);
1318
1319 maPrevTimer.Start();
1320 return 0;
1321}
1322
1323
1324IMPL_LINK( AssistentDlgImpl, NextPageHdl, PushButton *, EMPTYARG )
1325{
1326 // When changing from the first to the second page make sure that the
1327 // templates are present.
1326 // When changing from the first to the second page make sure that the
1327 // templates are present.
1328 if (maAssistentFunc.GetCurrentPage() == 1)
1328 if (maAssistentFunc.GetCurrentPage() == 1)
1329 ProvideTemplates();
1329 ProvideTemplates();
1330
1330
1331 // Change to the next page.
1331 // Change to the next page.
1332 LeavePage();
1333 maAssistentFunc.NextPage();
1334 ChangePage();
1335 return 0;
1336}
1337
1338IMPL_LINK( AssistentDlgImpl, LastPageHdl, PushButton *, EMPTYARG )
1339{
1340 LeavePage();
1341 maAssistentFunc.PreviousPage();
1342 ChangePage();
1343 return 0;
1344}
1345
1346IMPL_LINK( AssistentDlgImpl, PresTypeHdl, RadioButton*, EMPTYARG )
1347{
1348 if(maDocFile.Len() == 0)
1332 LeavePage();
1333 maAssistentFunc.NextPage();
1334 ChangePage();
1335 return 0;
1336}
1337
1338IMPL_LINK( AssistentDlgImpl, LastPageHdl, PushButton *, EMPTYARG )
1339{
1340 LeavePage();
1341 maAssistentFunc.PreviousPage();
1342 ChangePage();
1343 return 0;
1344}
1345
1346IMPL_LINK( AssistentDlgImpl, PresTypeHdl, RadioButton*, EMPTYARG )
1347{
1348 if(maDocFile.Len() == 0)
1349 {
1350 maNextPageButton.Enable(false);
1351 }
1349 {
1350 maNextPageButton.Enable(false);
1351 }
1352
1353 sal_Bool bKiosk = mpPage3PresTypeKioskRB->IsChecked();
1354 mpPage3PresTimeFT->Enable(bKiosk);
1355 mpPage3BreakFT->Enable(bKiosk);
1356 mpPage3PresTimeTMF->Enable(bKiosk);
1357 mpPage3BreakTMF->Enable(bKiosk);
1358 mpPage3LogoCB->Enable(bKiosk);
1359 return 0;

--- 76 unchanged lines hidden (view full) ---

1436 if( pPage->GetAutoLayout() == AUTOLAYOUT_NONE )
1437 pPage->SetAutoLayout(AUTOLAYOUT_TITLE, sal_True);
1438
1439 SdrTextObj* pObj;
1440 String aEmptyString;
1441
1442 if( aTopic.Len() )
1443 {
1352
1353 sal_Bool bKiosk = mpPage3PresTypeKioskRB->IsChecked();
1354 mpPage3PresTimeFT->Enable(bKiosk);
1355 mpPage3BreakFT->Enable(bKiosk);
1356 mpPage3PresTimeTMF->Enable(bKiosk);
1357 mpPage3BreakTMF->Enable(bKiosk);
1358 mpPage3LogoCB->Enable(bKiosk);
1359 return 0;

--- 76 unchanged lines hidden (view full) ---

1436 if( pPage->GetAutoLayout() == AUTOLAYOUT_NONE )
1437 pPage->SetAutoLayout(AUTOLAYOUT_TITLE, sal_True);
1438
1439 SdrTextObj* pObj;
1440 String aEmptyString;
1441
1442 if( aTopic.Len() )
1443 {
1444 pObj = dynamic_cast<SdrTextObj*>( pPage->GetPresObj( PRESOBJ_TITLE ) );
1444 pObj = dynamic_cast<SdrTextObj*>( pPage->GetPresObj( PRESOBJ_TITLE ) );
1445 if( pObj )
1446 {
1447 pPage->SetObjText( pObj, NULL, PRESOBJ_TITLE, aTopic );
1448 pObj->NbcSetStyleSheet( pPage->GetStyleSheetForPresObj( PRESOBJ_TITLE ), sal_True );
1449 pObj->SetEmptyPresObj(sal_False);
1450 }
1451
1452 }

--- 44 unchanged lines hidden (view full) ---

1497 mpPage5PageListCT->Clear();
1498
1499 if(pDoc)
1500 mpPage5PageListCT->Fill(pDoc);
1501}
1502
1503void AssistentDlgImpl::UpdatePreview( sal_Bool bDocPreview )
1504{
1445 if( pObj )
1446 {
1447 pPage->SetObjText( pObj, NULL, PRESOBJ_TITLE, aTopic );
1448 pObj->NbcSetStyleSheet( pPage->GetStyleSheetForPresObj( PRESOBJ_TITLE ), sal_True );
1449 pObj->SetEmptyPresObj(sal_False);
1450 }
1451
1452 }

--- 44 unchanged lines hidden (view full) ---

1497 mpPage5PageListCT->Clear();
1498
1499 if(pDoc)
1500 mpPage5PageListCT->Fill(pDoc);
1501}
1502
1503void AssistentDlgImpl::UpdatePreview( sal_Bool bDocPreview )
1504{
1505 // Guard against multiple concurrent execution to this method caused either
1506 // by calls from different threads or recursion.
1507 ::osl::MutexGuard aGuard (maMutex);
1508 if (mbPreviewUpdating)
1509 return;
1510 mbPreviewUpdating = sal_True;
1505 // Guard against multiple concurrent execution to this method caused either
1506 // by calls from different threads or recursion.
1507 ::osl::MutexGuard aGuard (maMutex);
1508 if (mbPreviewUpdating)
1509 return;
1510 mbPreviewUpdating = sal_True;
1511
1512 if(!mbPreview && bDocPreview)
1513 {
1514 maPreview.Invalidate();
1515 maPreview.SetObjectShell(0);
1511
1512 if(!mbPreview && bDocPreview)
1513 {
1514 maPreview.Invalidate();
1515 maPreview.SetObjectShell(0);
1516 mbPreviewUpdating = sal_False;
1516 mbPreviewUpdating = sal_False;
1517 return;
1518 }
1519
1520 String aDocFile = GetDocFileName();
1521 String aLayoutFile = GetLayoutFileName();
1522 String aEmptyStr;
1523
1524 SfxApplication *pSfxApp = SFX_APP();

--- 22 unchanged lines hidden (view full) ---

1547 bChangeMaster = (aLayoutFile.Len() != 0) && (maLayoutFile != aLayoutFile);
1548 }
1549 else if( aDocFile == maDocFile && ( mbDocPreview == bDocPreview || bDocPreview ) )
1550 {
1551 if( aLayoutFile != maLayoutFile )
1552 {
1553 SfxObjectShell* pShell = xDocShell;
1554 DrawDocShell* pDocShell = PTR_CAST(DrawDocShell,pShell);
1517 return;
1518 }
1519
1520 String aDocFile = GetDocFileName();
1521 String aLayoutFile = GetLayoutFileName();
1522 String aEmptyStr;
1523
1524 SfxApplication *pSfxApp = SFX_APP();

--- 22 unchanged lines hidden (view full) ---

1547 bChangeMaster = (aLayoutFile.Len() != 0) && (maLayoutFile != aLayoutFile);
1548 }
1549 else if( aDocFile == maDocFile && ( mbDocPreview == bDocPreview || bDocPreview ) )
1550 {
1551 if( aLayoutFile != maLayoutFile )
1552 {
1553 SfxObjectShell* pShell = xDocShell;
1554 DrawDocShell* pDocShell = PTR_CAST(DrawDocShell,pShell);
1555 ::svl::IUndoManager* pUndoMgr = pDocShell?pDocShell->GetUndoManager():NULL;
1555 ::svl::IUndoManager* pUndoMgr = pDocShell?pDocShell->GetUndoManager():NULL;
1556 if(pUndoMgr)
1557 pUndoMgr->Undo();
1558 mbUserDataDirty = sal_True;
1559 }
1560 else
1561 bChangeMaster = sal_False;
1562 }
1563 else

--- 7 unchanged lines hidden (view full) ---

1571
1572 SfxItemSet* pSet = new SfxAllItemSet( pSfxApp->GetPool() );
1573 if(IsOwnFormat(aDocFile))
1574 {
1575 pSet->Put( SfxBoolItem( SID_TEMPLATE, sal_True ) );
1576 if(bDocPreview)
1577 pSet->Put( SfxBoolItem( SID_PREVIEW, sal_True ) );
1578 RestorePassword( pSet, aDocFile );
1556 if(pUndoMgr)
1557 pUndoMgr->Undo();
1558 mbUserDataDirty = sal_True;
1559 }
1560 else
1561 bChangeMaster = sal_False;
1562 }
1563 else

--- 7 unchanged lines hidden (view full) ---

1571
1572 SfxItemSet* pSet = new SfxAllItemSet( pSfxApp->GetPool() );
1573 if(IsOwnFormat(aDocFile))
1574 {
1575 pSet->Put( SfxBoolItem( SID_TEMPLATE, sal_True ) );
1576 if(bDocPreview)
1577 pSet->Put( SfxBoolItem( SID_PREVIEW, sal_True ) );
1578 RestorePassword( pSet, aDocFile );
1579 if( (lErr = pSfxApp->LoadTemplate( xDocShell, aDocFile, sal_True, pSet )) != 0 )
1579 if( (lErr = pSfxApp->LoadTemplate( xDocShell, aDocFile, sal_True, pSet )) != 0 )
1580 ErrorHandler::HandleError(lErr);
1581 else
1582 SavePassword( xDocShell, aDocFile );
1583 }
1584 else
1585 {
1586 const String aTargetStr( RTL_CONSTASCII_USTRINGPARAM("_default") );
1587
1588 SfxRequest aReq( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, SFX_APP()->GetPool() );
1589 aReq.AppendItem( SfxStringItem( SID_FILE_NAME, aDocFile ));
1590 aReq.AppendItem( SfxStringItem( SID_REFERER, aEmptyStr ) );
1580 ErrorHandler::HandleError(lErr);
1581 else
1582 SavePassword( xDocShell, aDocFile );
1583 }
1584 else
1585 {
1586 const String aTargetStr( RTL_CONSTASCII_USTRINGPARAM("_default") );
1587
1588 SfxRequest aReq( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, SFX_APP()->GetPool() );
1589 aReq.AppendItem( SfxStringItem( SID_FILE_NAME, aDocFile ));
1590 aReq.AppendItem( SfxStringItem( SID_REFERER, aEmptyStr ) );
1591 aReq.AppendItem( SfxStringItem( SID_TARGETNAME, aTargetStr ) );
1591 aReq.AppendItem( SfxStringItem( SID_TARGETNAME, aTargetStr ) );
1592 aReq.AppendItem( SfxBoolItem( SID_HIDDEN, sal_True ) );
1593 aReq.AppendItem( SfxBoolItem( SID_PREVIEW, bDocPreview ) );
1594
1592 aReq.AppendItem( SfxBoolItem( SID_HIDDEN, sal_True ) );
1593 aReq.AppendItem( SfxBoolItem( SID_PREVIEW, bDocPreview ) );
1594
1595 const SfxViewFrameItem* pRet = PTR_CAST( SfxViewFrameItem, SFX_APP()->ExecuteSlot( aReq ) );
1595 const SfxViewFrameItem* pRet = PTR_CAST( SfxViewFrameItem, SFX_APP()->ExecuteSlot( aReq ) );
1596
1597 if ( pRet && pRet->GetFrame() && pRet->GetFrame()->GetObjectShell() )
1598 xDocShell = pRet->GetFrame()->GetObjectShell();
1599 }
1600
1601
1602 Application::SetDefDialogParent( pParent );
1603

--- 14 unchanged lines hidden (view full) ---

1618 Application::SetDefDialogParent( mpWindow );
1619
1620 if(IsOwnFormat(aLayoutFile))
1621 {
1622 pSet->Put( SfxBoolItem( SID_TEMPLATE, sal_True ) );
1623 pSet->Put( SfxBoolItem( SID_PREVIEW, sal_True ) );
1624
1625 RestorePassword( pSet, aLayoutFile );
1596
1597 if ( pRet && pRet->GetFrame() && pRet->GetFrame()->GetObjectShell() )
1598 xDocShell = pRet->GetFrame()->GetObjectShell();
1599 }
1600
1601
1602 Application::SetDefDialogParent( pParent );
1603

--- 14 unchanged lines hidden (view full) ---

1618 Application::SetDefDialogParent( mpWindow );
1619
1620 if(IsOwnFormat(aLayoutFile))
1621 {
1622 pSet->Put( SfxBoolItem( SID_TEMPLATE, sal_True ) );
1623 pSet->Put( SfxBoolItem( SID_PREVIEW, sal_True ) );
1624
1625 RestorePassword( pSet, aLayoutFile );
1626 if( (lErr = pSfxApp->LoadTemplate( xLayoutDocShell, aLayoutFile, sal_True, pSet )) != 0 )
1626 if( (lErr = pSfxApp->LoadTemplate( xLayoutDocShell, aLayoutFile, sal_True, pSet )) != 0 )
1627 ErrorHandler::HandleError(lErr);
1628 SavePassword( xLayoutDocShell, aLayoutFile );
1629 }
1630
1631 Application::SetDefDialogParent( pParent );
1632
1633 // die Implementierung ermitteln
1634 SfxObjectShell* pShell = xDocShell;
1635 DrawDocShell* pDocShell = PTR_CAST(DrawDocShell,pShell);
1636 SdDrawDocument* pDoc = pDocShell?pDocShell->GetDoc():NULL;
1637
1638 pShell = xLayoutDocShell;
1639 pDocShell = PTR_CAST(DrawDocShell,pShell);
1640 SdDrawDocument* pLayoutDoc = pDocShell?pDocShell->GetDoc():NULL;
1641
1642 if( pDoc && pLayoutDoc )
1643 {
1627 ErrorHandler::HandleError(lErr);
1628 SavePassword( xLayoutDocShell, aLayoutFile );
1629 }
1630
1631 Application::SetDefDialogParent( pParent );
1632
1633 // die Implementierung ermitteln
1634 SfxObjectShell* pShell = xDocShell;
1635 DrawDocShell* pDocShell = PTR_CAST(DrawDocShell,pShell);
1636 SdDrawDocument* pDoc = pDocShell?pDocShell->GetDoc():NULL;
1637
1638 pShell = xLayoutDocShell;
1639 pDocShell = PTR_CAST(DrawDocShell,pShell);
1640 SdDrawDocument* pLayoutDoc = pDocShell?pDocShell->GetDoc():NULL;
1641
1642 if( pDoc && pLayoutDoc )
1643 {
1644 pDoc->SetMasterPage(0, aEmptyStr, pLayoutDoc, sal_True, sal_False );
1644 pDoc->SetMasterPage(0, aEmptyStr, pLayoutDoc, sal_True, sal_False );
1645 }
1646 else
1647 {
1648 DBG_ERROR("sd::AssistentDlgImpl::UpdatePreview(), no document for preview?");
1649 }
1650
1651 mbUserDataDirty = sal_True;
1652 }

--- 4 unchanged lines hidden (view full) ---

1657
1658 if ( !xDocShell.Is() || !mbPreview )
1659 maPreview.SetObjectShell( 0 );
1660 else
1661 {
1662 maPreview.SetObjectShell( xDocShell, mnShowPage );
1663 }
1664
1645 }
1646 else
1647 {
1648 DBG_ERROR("sd::AssistentDlgImpl::UpdatePreview(), no document for preview?");
1649 }
1650
1651 mbUserDataDirty = sal_True;
1652 }

--- 4 unchanged lines hidden (view full) ---

1657
1658 if ( !xDocShell.Is() || !mbPreview )
1659 maPreview.SetObjectShell( 0 );
1660 else
1661 {
1662 maPreview.SetObjectShell( xDocShell, mnShowPage );
1663 }
1664
1665 mbPreviewUpdating = sal_False;
1665 mbPreviewUpdating = sal_False;
1666}
1667
1668void AssistentDlgImpl::SavePassword( SfxObjectShellLock xDoc, const String& rPath )
1669{
1670 if(xDoc.Is())
1671 {
1672 SfxMedium * pMedium = xDoc->GetMedium();
1673 if(pMedium && pMedium->IsStorage())
1674 {
1675 SfxItemSet * pSet = pMedium->GetItemSet();
1666}
1667
1668void AssistentDlgImpl::SavePassword( SfxObjectShellLock xDoc, const String& rPath )
1669{
1670 if(xDoc.Is())
1671 {
1672 SfxMedium * pMedium = xDoc->GetMedium();
1673 if(pMedium && pMedium->IsStorage())
1674 {
1675 SfxItemSet * pSet = pMedium->GetItemSet();
1676 const SfxPoolItem *pItem = 0;
1677 if( pSet->GetItemState(SID_PASSWORD, sal_True, &pItem) == SFX_ITEM_SET )
1678 {
1679 //TODO/MBA: testing
1680 String aPass( ((const SfxStringItem*)pItem)->GetValue());
1681 if(aPass.Len() == 0)
1682 return;
1676 const SfxPoolItem *pItem = 0;
1677 if( pSet->GetItemState(SID_PASSWORD, sal_True, &pItem) == SFX_ITEM_SET )
1678 {
1679 // TODO/MBA: testing
1680 String aPass( ((const SfxStringItem*)pItem)->GetValue());
1681 if(aPass.Len() == 0)
1682 return;
1683
1683
1684 PasswordEntry* pEntry = maPasswordList.First();
1685 while(pEntry)
1686 {
1687 if(pEntry->maPath == rPath)
1688 break;
1684 PasswordEntry* pEntry = maPasswordList.First();
1685 while(pEntry)
1686 {
1687 if(pEntry->maPath == rPath)
1688 break;
1689
1689
1690 pEntry = maPasswordList.Next();
1690 pEntry = maPasswordList.Next();
1691
1691
1692 }
1692 }
1693
1693
1694 if(pEntry == NULL)
1695 {
1696 pEntry = new PasswordEntry();
1697 pEntry->maPath = rPath;
1698 maPasswordList.Insert( pEntry );
1699 }
1694 if(pEntry == NULL)
1695 {
1696 pEntry = new PasswordEntry();
1697 pEntry->maPath = rPath;
1698 maPasswordList.Insert( pEntry );
1699 }
1700
1700
1701 if(pEntry)
1702 pEntry->maPassword = aPass;
1703 }
1701 if(pEntry)
1702 pEntry->maPassword = aPass;
1703 }
1704 }
1705 }
1706}
1707
1708void AssistentDlgImpl::RestorePassword( SfxItemSet* pSet, const String& rPath )
1709{
1710 String aPassword( GetPassword( rPath ) );
1711

--- 35 unchanged lines hidden (view full) ---

1747 return !aExt.EqualsIgnoreCaseAscii( "ppt" );
1748}
1749
1750
1751
1752
1753String AssistentDlgImpl::GetUiTextForCommand (const ::rtl::OUString& sCommandURL)
1754{
1704 }
1705 }
1706}
1707
1708void AssistentDlgImpl::RestorePassword( SfxItemSet* pSet, const String& rPath )
1709{
1710 String aPassword( GetPassword( rPath ) );
1711

--- 35 unchanged lines hidden (view full) ---

1747 return !aExt.EqualsIgnoreCaseAscii( "ppt" );
1748}
1749
1750
1751
1752
1753String AssistentDlgImpl::GetUiTextForCommand (const ::rtl::OUString& sCommandURL)
1754{
1755 String sLabel;
1756 Reference<container::XNameAccess> xUICommandLabels;
1755 String sLabel;
1756 Reference<container::XNameAccess> xUICommandLabels;
1757
1757
1758 try
1759 {
1760 do
1761 {
1762 if (sCommandURL.getLength() == 0)
1763 break;
1758 try
1759 {
1760 do
1761 {
1762 if (sCommandURL.getLength() == 0)
1763 break;
1764
1764
1765 // Retrieve popup menu labels
1766 Reference<lang::XMultiServiceFactory> xFactory (
1767 ::comphelper::getProcessServiceFactory ());
1768 if ( ! xFactory.is())
1769 break;
1765 // Retrieve popup menu labels
1766 Reference<lang::XMultiServiceFactory> xFactory (
1767 ::comphelper::getProcessServiceFactory ());
1768 if ( ! xFactory.is())
1769 break;
1770
1770
1771 ::rtl::OUString sModuleIdentifier (
1772 RTL_CONSTASCII_USTRINGPARAM("com.sun.star.presentation.PresentationDocument"));
1773 Reference<container::XNameAccess> xNameAccess (
1774 xFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
1775 "com.sun.star.frame.UICommandDescription"))),
1776 UNO_QUERY);
1777 if ( ! xNameAccess.is())
1778 break;
1779 Any a = xNameAccess->getByName(sModuleIdentifier);
1780 a >>= xUICommandLabels;
1781 if ( ! xUICommandLabels.is())
1782 break;
1771 ::rtl::OUString sModuleIdentifier (
1772 RTL_CONSTASCII_USTRINGPARAM("com.sun.star.presentation.PresentationDocument"));
1773 Reference<container::XNameAccess> xNameAccess (
1774 xFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
1775 "com.sun.star.frame.UICommandDescription"))),
1776 UNO_QUERY);
1777 if ( ! xNameAccess.is())
1778 break;
1779 Any a = xNameAccess->getByName(sModuleIdentifier);
1780 a >>= xUICommandLabels;
1781 if ( ! xUICommandLabels.is())
1782 break;
1783
1783
1784 ::rtl::OUString sString;
1785 Sequence<beans::PropertyValue> aProperties;
1786 Any aAny (xUICommandLabels->getByName(sCommandURL));
1787 if (aAny >>= aProperties)
1788 {
1789 sal_Int32 nCount (aProperties.getLength());
1790 for (sal_Int32 i=0; i<nCount; i++)
1791 {
1792 ::rtl::OUString sPropertyName (aProperties[i].Name);
1793 if (sPropertyName.equalsAscii("Label"))
1794 {
1795 aProperties[i].Value >>= sString;
1796 break;
1797 }
1798 }
1799 }
1800 sLabel = sString;
1801 }
1802 while(false);
1803 }
1804 catch (com::sun::star::uno::Exception& rException)
1805 {
1806 (void)rException;
1807 }
1784 ::rtl::OUString sString;
1785 Sequence<beans::PropertyValue> aProperties;
1786 Any aAny (xUICommandLabels->getByName(sCommandURL));
1787 if (aAny >>= aProperties)
1788 {
1789 sal_Int32 nCount (aProperties.getLength());
1790 for (sal_Int32 i=0; i<nCount; i++)
1791 {
1792 ::rtl::OUString sPropertyName (aProperties[i].Name);
1793 if (sPropertyName.equalsAscii("Label"))
1794 {
1795 aProperties[i].Value >>= sString;
1796 break;
1797 }
1798 }
1799 }
1800 sLabel = sString;
1801 }
1802 while(false);
1803 }
1804 catch (com::sun::star::uno::Exception& rException)
1805 {
1806 (void)rException;
1807 }
1808
1808
1809 return sLabel;
1809 return sLabel;
1810}
1811
1812
1813
1814
1815Image AssistentDlgImpl::GetUiIconForCommand (const ::rtl::OUString& sCommandURL)
1816{
1810}
1811
1812
1813
1814
1815Image AssistentDlgImpl::GetUiIconForCommand (const ::rtl::OUString& sCommandURL)
1816{
1817 Image aIcon;
1818 Reference<container::XNameAccess> xUICommandLabels;
1817 Image aIcon;
1818 Reference<container::XNameAccess> xUICommandLabels;
1819
1819
1820 try
1821 {
1822 do
1823 {
1824 if (sCommandURL.getLength() == 0)
1825 break;
1820 try
1821 {
1822 do
1823 {
1824 if (sCommandURL.getLength() == 0)
1825 break;
1826
1826
1827 // Retrieve popup menu labels
1828 Reference<lang::XMultiServiceFactory> xFactory (
1829 ::comphelper::getProcessServiceFactory ());
1830 if ( ! xFactory.is())
1831 break;
1827 // Retrieve popup menu labels
1828 Reference<lang::XMultiServiceFactory> xFactory (
1829 ::comphelper::getProcessServiceFactory ());
1830 if ( ! xFactory.is())
1831 break;
1832
1832
1833 ::rtl::OUString sModuleIdentifier (
1834 RTL_CONSTASCII_USTRINGPARAM("com.sun.star.presentation.PresentationDocument"));
1833 ::rtl::OUString sModuleIdentifier (
1834 RTL_CONSTASCII_USTRINGPARAM("com.sun.star.presentation.PresentationDocument"));
1835
1835
1836 Reference<com::sun::star::ui::XModuleUIConfigurationManagerSupplier> xSupplier (
1837 xFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
1838 "com.sun.star.ui.ModuleUIConfigurationManagerSupplier"))),
1839 UNO_QUERY_THROW);
1836 Reference<com::sun::star::ui::XModuleUIConfigurationManagerSupplier> xSupplier (
1837 xFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
1838 "com.sun.star.ui.ModuleUIConfigurationManagerSupplier"))),
1839 UNO_QUERY_THROW);
1840
1840
1841 Reference<com::sun::star::ui::XUIConfigurationManager> xManager (
1842 xSupplier->getUIConfigurationManager(sModuleIdentifier));
1843 if ( ! xManager.is())
1844 break;
1841 Reference<com::sun::star::ui::XUIConfigurationManager> xManager (
1842 xSupplier->getUIConfigurationManager(sModuleIdentifier));
1843 if ( ! xManager.is())
1844 break;
1845
1845
1846 Reference<com::sun::star::ui::XImageManager> xImageManager (
1847 xManager->getImageManager(),
1848 UNO_QUERY_THROW);
1846 Reference<com::sun::star::ui::XImageManager> xImageManager (
1847 xManager->getImageManager(),
1848 UNO_QUERY_THROW);
1849
1849
1850 Sequence<rtl::OUString> aCommandList(1);
1851 aCommandList[0] = sCommandURL;
1852 Sequence<Reference<graphic::XGraphic> > xIconList (
1853 xImageManager->getImages(0,aCommandList));
1854 if ( ! xIconList.hasElements())
1855 break;
1850 Sequence<rtl::OUString> aCommandList(1);
1851 aCommandList[0] = sCommandURL;
1852 Sequence<Reference<graphic::XGraphic> > xIconList (
1853 xImageManager->getImages(0,aCommandList));
1854 if ( ! xIconList.hasElements())
1855 break;
1856
1856
1857 aIcon = Graphic(xIconList[0]).GetBitmapEx();
1858 }
1859 while(false);
1860 }
1861 catch (com::sun::star::uno::Exception& rException)
1862 {
1863 (void)rException;
1864 }
1857 aIcon = Graphic(xIconList[0]).GetBitmapEx();
1858 }
1859 while(false);
1860 }
1861 catch (com::sun::star::uno::Exception& rException)
1862 {
1863 (void)rException;
1864 }
1865
1865
1866 return aIcon;
1866 return aIcon;
1867}
1868
1869
1870//////////////////////////////////////////////
1871
1872AssistentDlg::AssistentDlg(Window* pParent, sal_Bool bAutoPilot) :
1873 ModalDialog(pParent,SdResId(DLG_ASS))
1874{
1875 Link aFinishLink = LINK(this,AssistentDlg, FinishHdl);
1876 mpImpl = new AssistentDlgImpl( this, aFinishLink, bAutoPilot );
1877
1867}
1868
1869
1870//////////////////////////////////////////////
1871
1872AssistentDlg::AssistentDlg(Window* pParent, sal_Bool bAutoPilot) :
1873 ModalDialog(pParent,SdResId(DLG_ASS))
1874{
1875 Link aFinishLink = LINK(this,AssistentDlg, FinishHdl);
1876 mpImpl = new AssistentDlgImpl( this, aFinishLink, bAutoPilot );
1877
1878 //Buttonbelegung
1878 // Buttonbelegung
1879 mpImpl->maFinishButton.SetClickHdl(LINK(this,AssistentDlg,FinishHdl));
1880
1881 FreeResource();
1882}
1883
1884IMPL_LINK( AssistentDlg, FinishHdl, OKButton *, EMPTYARG )
1885{
1879 mpImpl->maFinishButton.SetClickHdl(LINK(this,AssistentDlg,FinishHdl));
1880
1881 FreeResource();
1882}
1883
1884IMPL_LINK( AssistentDlg, FinishHdl, OKButton *, EMPTYARG )
1885{
1886 if( GetStartType() == ST_OPEN )
1886 if( GetStartType() == ST_OPEN )
1887 {
1887 {
1888 //if we do not have a file here asked for one before ending the dialog
1889 String aFileToOpen = GetDocPath();
1888 // if we do not have a file here asked for one before ending the dialog
1889 String aFileToOpen = GetDocPath();
1890 if(aFileToOpen.Len() == 0)
1891 {
1890 if(aFileToOpen.Len() == 0)
1891 {
1892 sfx2::FileDialogHelper aFileDlg( WB_OPEN, ::String::CreateFromAscii("simpress") );
1892 sfx2::FileDialogHelper aFileDlg( WB_OPEN, ::String::CreateFromAscii("simpress") );
1893
1894 if ( aFileDlg.Execute() == ERRCODE_NONE )
1895 aFileToOpen = aFileDlg.GetPath();
1893
1894 if ( aFileDlg.Execute() == ERRCODE_NONE )
1895 aFileToOpen = aFileDlg.GetPath();
1896 if( aFileToOpen.Len() == 0)
1897 return 1;
1898 else
1899 {
1900 //add the selected file to the recent-file-listbox and select the new entry
1901 //this is necessary for 'GetDocPath()' returning the selected file after end of dialog
1896 if( aFileToOpen.Len() == 0)
1897 return 1;
1898 else
1899 {
1900 //add the selected file to the recent-file-listbox and select the new entry
1901 //this is necessary for 'GetDocPath()' returning the selected file after end of dialog
1902
1902
1903 INetURLObject aURL;
1904 aURL.SetSmartURL(aFileToOpen);
1905 mpImpl->maOpenFilesList.push_back (new String (aURL.GetMainURL( INetURLObject::NO_DECODE )));
1906 sal_uInt16 nNewPos = mpImpl->mpPage1OpenLB->InsertEntry(aURL.getName());
1907 mpImpl->mpPage1OpenLB->SelectEntryPos(nNewPos);
1908 }
1903 INetURLObject aURL;
1904 aURL.SetSmartURL(aFileToOpen);
1905 mpImpl->maOpenFilesList.push_back (new String (aURL.GetMainURL( INetURLObject::NO_DECODE )));
1906 sal_uInt16 nNewPos = mpImpl->mpPage1OpenLB->InsertEntry(aURL.getName());
1907 mpImpl->mpPage1OpenLB->SelectEntryPos(nNewPos);
1908 }
1909 }
1909 }
1910 }
1910 }
1911
1911
1912 //Ende
1912 // End
1913 mpImpl->EndDialog(RET_OK);
1914 EndDialog(RET_OK);
1915 return 0;
1916}
1917
1918AssistentDlg::~AssistentDlg()
1919{
1920 delete mpImpl;
1921}
1922
1923
1924SfxObjectShellLock AssistentDlg::GetDocument()
1925{
1926 return mpImpl->GetDocument();
1927}
1928
1929OutputType AssistentDlg::GetOutputMedium() const
1930{
1931 if(mpImpl->mpPage2Medium1RB->IsChecked())
1913 mpImpl->EndDialog(RET_OK);
1914 EndDialog(RET_OK);
1915 return 0;
1916}
1917
1918AssistentDlg::~AssistentDlg()
1919{
1920 delete mpImpl;
1921}
1922
1923
1924SfxObjectShellLock AssistentDlg::GetDocument()
1925{
1926 return mpImpl->GetDocument();
1927}
1928
1929OutputType AssistentDlg::GetOutputMedium() const
1930{
1931 if(mpImpl->mpPage2Medium1RB->IsChecked())
1932 return OUTPUT_PRESENTATION;
1932 return OUTPUT_PRESENTATION_4_BY_3;
1933 else if(mpImpl->mpPage2Medium2RB->IsChecked())
1934 return OUTPUT_SLIDE;
1935 else if(mpImpl->mpPage2Medium3RB->IsChecked())
1936 return OUTPUT_OVERHEAD;
1937 else if(mpImpl->mpPage2Medium4RB->IsChecked())
1938 return OUTPUT_PAGE;
1939 else
1940 return OUTPUT_ORIGINAL;

--- 31 unchanged lines hidden (view full) ---

1972}
1973
1974
1975
1976
1977//===== NextButton ============================================================
1978
1979NextButton::NextButton (::Window* pParent, const ResId& rResId)
1933 else if(mpImpl->mpPage2Medium2RB->IsChecked())
1934 return OUTPUT_SLIDE;
1935 else if(mpImpl->mpPage2Medium3RB->IsChecked())
1936 return OUTPUT_OVERHEAD;
1937 else if(mpImpl->mpPage2Medium4RB->IsChecked())
1938 return OUTPUT_PAGE;
1939 else
1940 return OUTPUT_ORIGINAL;

--- 31 unchanged lines hidden (view full) ---

1972}
1973
1974
1975
1976
1977//===== NextButton ============================================================
1978
1979NextButton::NextButton (::Window* pParent, const ResId& rResId)
1980 : maNextButton1(pParent, rResId),
1981 maNextButton2(pParent, rResId),
1982 mbIsFirstButtonActive(true)
1980 : maNextButton1(pParent, rResId),
1981 maNextButton2(pParent, rResId),
1982 mbIsFirstButtonActive(true)
1983{
1983{
1984 // Hide the unused button.
1985 maNextButton2.Hide();
1984 // Hide the unused button.
1985 maNextButton2.Hide();
1986}
1987
1988
1989
1990
1991void NextButton::ForceFocusEventBroadcast (void)
1992{
1986}
1987
1988
1989
1990
1991void NextButton::ForceFocusEventBroadcast (void)
1992{
1993 // Hide the currently visible button and show and focus the other one.
1994 if (mbIsFirstButtonActive)
1995 {
1996 mbIsFirstButtonActive = false;
1997 maNextButton2.Show();
1998 maNextButton2.GrabFocus();
1999 maNextButton1.Hide();
2000 }
2001 else
2002 {
2003 mbIsFirstButtonActive = true;
2004 maNextButton1.Show();
2005 maNextButton1.GrabFocus();
2006 maNextButton2.Hide();
2007 }
1993 // Hide the currently visible button and show and focus the other one.
1994 if (mbIsFirstButtonActive)
1995 {
1996 mbIsFirstButtonActive = false;
1997 maNextButton2.Show();
1998 maNextButton2.GrabFocus();
1999 maNextButton1.Hide();
2000 }
2001 else
2002 {
2003 mbIsFirstButtonActive = true;
2004 maNextButton1.Show();
2005 maNextButton1.GrabFocus();
2006 maNextButton2.Hide();
2007 }
2008}
2009
2010
2011
2012
2013void NextButton::SetClickHdl (const Link& rLink)
2014{
2008}
2009
2010
2011
2012
2013void NextButton::SetClickHdl (const Link& rLink)
2014{
2015 // Forward the setting of the click handler to the two buttons
2016 // regardless of which one is currently visible.
2017 maNextButton1.SetClickHdl(rLink);
2018 maNextButton2.SetClickHdl(rLink);
2015 // Forward the setting of the click handler to the two buttons
2016 // regardless of which one is currently visible.
2017 maNextButton1.SetClickHdl(rLink);
2018 maNextButton2.SetClickHdl(rLink);
2019}
2020
2021
2022
2023
2024bool NextButton::IsEnabled (void)
2025{
2019}
2020
2021
2022
2023
2024bool NextButton::IsEnabled (void)
2025{
2026 // Because the buttons are both either enabled or disabled, it is
2027 // sufficient to ask one to determine the state.
2028 return maNextButton1.IsEnabled();
2026 // Because the buttons are both either enabled or disabled, it is
2027 // sufficient to ask one to determine the state.
2028 return maNextButton1.IsEnabled();
2029}
2030
2031
2032
2033
2034void NextButton::Enable (bool bEnable)
2035{
2029}
2030
2031
2032
2033
2034void NextButton::Enable (bool bEnable)
2035{
2036 // Enable or disable both buttons but do not change visibility or focus.
2037 maNextButton1.Enable(bEnable);
2038 maNextButton2.Enable(bEnable);
2036 // Enable or disable both buttons but do not change visibility or focus.
2037 maNextButton1.Enable(bEnable);
2038 maNextButton2.Enable(bEnable);
2039}
2039}
2040
2041/* vim: set noet sw=4 ts=4: */