1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: pubdlg.cxx,v $
10 * $Revision: 1.12.186.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sd.hxx"
34 #ifdef SD_DLLIMPLEMENTATION
35 #undef SD_DLLIMPLEMENTATION
37 #include <com/sun/star/beans/PropertyValue.hpp>
38 #include <unotools/ucbstreamhelper.hxx>
39 #include <vcl/lstbox.hxx>
40 #include <svtools/FilterConfigItem.hxx>
41 #ifndef _SV_BUTTON_HXX
42 #include <vcl/button.hxx>
44 #include <vcl/fixed.hxx>
45 #include <vcl/combobox.hxx>
46 #include <svtools/svmedit.hxx>
47 #include <svtools/intitem.hxx>
48 #include <svtools/aeitem.hxx>
49 #include <svtools/itemset.hxx>
50 #include <svtools/stritem.hxx>
51 #include <vcl/msgbox.hxx>
52 #include <svtools/valueset.hxx>
53 #include <vcl/graph.hxx>
54 #include <svtools/eitem.hxx>
55 #include <svx/impgrf.hxx>
56 #include <svtools/colrdlg.hxx>
57 #include <svx/colritem.hxx>
58 #include <tools/list.hxx>
59 #include <sdiocmpt.hxx>
60 #include <sfx2/docfile.hxx>
61 #include <sfx2/app.hxx>
63 #include <svtools/useroptions.hxx>
64 #include <svtools/pathoptions.hxx>
66 #include "sdresid.hxx"
69 #include "htmlattr.hxx"
72 #include "buttonset.hxx"
76 using namespace com::sun::star::uno
;
77 using namespace com::sun::star::beans
;
79 extern void InterpolateFixedBitmap( FixedBitmap
* pBitmap
);
81 // Kennung fuer die Config Datei mit den Html Einstellungen
82 const UINT16 nMagic
= (UINT16
)0x1977;
84 // Key fuer die soffice.ini
85 #define KEY_QUALITY "JPG-EXPORT-QUALITY"
87 // Die Help Ids der einzelnen Seiten
88 ULONG aPageHelpIds
[NOOFPAGES
] =
90 HID_SD_HTMLEXPORT_PAGE1
,
91 HID_SD_HTMLEXPORT_PAGE2
,
92 HID_SD_HTMLEXPORT_PAGE3
,
93 HID_SD_HTMLEXPORT_PAGE4
,
94 HID_SD_HTMLEXPORT_PAGE5
,
95 HID_SD_HTMLEXPORT_PAGE6
98 // *********************************************************************
99 // Diese Klasse enthaelt alle Einstellungen des Html-Export Autopiloten
100 // *********************************************************************
101 class SdPublishingDesign
104 String m_aDesignName
;
106 HtmlPublishMode m_eMode
;
108 // special WebCast options
109 PublishingScript m_eScript
;
113 // special Kiosk options
115 UINT32 m_nSlideDuration
;
118 // special HTML options
123 UINT16 m_nResolution
;
124 String m_aCompression
;
125 PublishingFormat m_eFormat
;
127 BOOL m_bHiddenSlides
;
129 // titel page information
135 BOOL m_bCreated
; // not used
137 // buttons and colorscheme
138 INT16 m_nButtonThema
;
148 SdPublishingDesign();
150 int operator ==(const SdPublishingDesign
& rDesign
) const;
151 friend SvStream
& operator >> (SvStream
& rIn
, SdPublishingDesign
& rDesign
);
152 friend SvStream
& operator << (SvStream
& rOut
, const SdPublishingDesign
& rDesign
);
155 // =====================================================================
156 // Default Einstellungen erzeugen
157 // =====================================================================
158 SdPublishingDesign::SdPublishingDesign()
160 m_eMode
= PUBLISH_HTML
;
161 m_bContentPage
= TRUE
;
164 m_eFormat
= FORMAT_PNG
;
166 String
aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/JPG" ) );
167 FilterConfigItem
aFilterConfigItem( aFilterConfigPath
);
168 sal_Int32 nCompression
= aFilterConfigItem
.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( KEY_QUALITY
) ), 75 );
169 m_aCompression
= UniString::CreateFromInt32( nCompression
);
170 m_aCompression
.Append( sal_Unicode('%') );
172 SvtUserOptions aUserOptions
;
174 m_nResolution
= PUB_LOWRES_WIDTH
;
175 m_aAuthor
= aUserOptions
.GetFirstName();
176 if( m_aAuthor
.Len() && aUserOptions
.GetLastName().getLength() )
177 m_aAuthor
+= sal_Unicode(' ');
178 m_aAuthor
+= (String
)aUserOptions
.GetLastName();
179 m_aEMail
= aUserOptions
.GetEmail();
181 //-/ m_bCreated = TRUE;
185 m_bUseAttribs
= TRUE
;
188 m_aBackColor
= COL_WHITE
;
189 m_aTextColor
= COL_BLACK
;
190 m_aLinkColor
= COL_BLUE
;
191 m_aVLinkColor
= COL_LIGHTBLUE
;
192 m_aALinkColor
= COL_GRAY
;
194 m_eScript
= SCRIPT_ASP
;
197 m_nSlideDuration
= 15;
200 m_bSlideSound
= TRUE
;
201 m_bHiddenSlides
= FALSE
;
204 // =====================================================================
205 // Vergleicht die Member ohne den Namen zu beachten
206 // =====================================================================
207 int SdPublishingDesign::operator ==(const SdPublishingDesign
& rDesign
) const
211 m_eMode
== rDesign
.m_eMode
&&
212 m_nResolution
== rDesign
.m_nResolution
&&
213 m_aCompression
== rDesign
.m_aCompression
&&
214 m_eFormat
== rDesign
.m_eFormat
&&
215 m_bHiddenSlides
== rDesign
.m_bHiddenSlides
&&
216 ( // compare html options
217 (m_eMode
!= PUBLISH_HTML
&& m_eMode
!= PUBLISH_FRAMES
) ||
219 m_bContentPage
== rDesign
.m_bContentPage
&&
220 m_bNotes
== rDesign
.m_bNotes
&&
221 m_aAuthor
== rDesign
.m_aAuthor
&&
222 m_aEMail
== rDesign
.m_aEMail
&&
223 m_aWWW
== rDesign
.m_aWWW
&&
224 m_aMisc
== rDesign
.m_aMisc
&&
225 m_bDownload
== rDesign
.m_bDownload
&&
226 //-/ m_bCreated == rDesign.m_bCreated &&
227 m_nButtonThema
== rDesign
.m_nButtonThema
&&
228 m_bUserAttr
== rDesign
.m_bUserAttr
&&
229 m_aBackColor
== rDesign
.m_aBackColor
&&
230 m_aTextColor
== rDesign
.m_aTextColor
&&
231 m_aLinkColor
== rDesign
.m_aLinkColor
&&
232 m_aVLinkColor
== rDesign
.m_aVLinkColor
&&
233 m_aALinkColor
== rDesign
.m_aALinkColor
&&
234 m_bUseAttribs
== rDesign
.m_bUseAttribs
&&
235 m_bSlideSound
== rDesign
.m_bSlideSound
&&
236 m_bUseColor
== rDesign
.m_bUseColor
239 ( // compare kiosk options
240 (m_eMode
!= PUBLISH_KIOSK
) ||
242 m_bAutoSlide
== rDesign
.m_bAutoSlide
&&
243 m_bSlideSound
== rDesign
.m_bSlideSound
&&
247 m_nSlideDuration
== rDesign
.m_nSlideDuration
&&
248 m_bEndless
== rDesign
.m_bEndless
253 ( // compare WebCast options
254 (m_eMode
!= PUBLISH_WEBCAST
) ||
256 m_eScript
== rDesign
.m_eScript
&&
258 m_eScript
!= SCRIPT_PERL
||
260 m_aURL
== rDesign
.m_aURL
&&
261 m_aCGI
== rDesign
.m_aCGI
269 // =====================================================================
270 // Dieses Design aus Stream laden
271 // =====================================================================
272 SvStream
& operator >> (SvStream
& rIn
, SdPublishingDesign
& rDesign
)
274 SdIOCompat
aIO(rIn
, STREAM_READ
);
278 rIn
.ReadByteString( rDesign
.m_aDesignName
, RTL_TEXTENCODING_UTF8
);
280 rDesign
.m_eMode
= (HtmlPublishMode
)nTemp16
;
281 rIn
>> rDesign
.m_bContentPage
;
282 rIn
>> rDesign
.m_bNotes
;
283 rIn
>> rDesign
.m_nResolution
;
284 rIn
.ReadByteString( rDesign
.m_aCompression
, RTL_TEXTENCODING_UTF8
);
286 rDesign
.m_eFormat
= (PublishingFormat
)nTemp16
;
287 rIn
.ReadByteString( rDesign
.m_aAuthor
, RTL_TEXTENCODING_UTF8
);
288 rIn
.ReadByteString( rDesign
.m_aEMail
, RTL_TEXTENCODING_UTF8
);
289 rIn
.ReadByteString( rDesign
.m_aWWW
, RTL_TEXTENCODING_UTF8
);
290 rIn
.ReadByteString( rDesign
.m_aMisc
, RTL_TEXTENCODING_UTF8
);
291 rIn
>> rDesign
.m_bDownload
;
292 rIn
>> rDesign
.m_bCreated
; // not used
293 rIn
>> rDesign
.m_nButtonThema
;
294 rIn
>> rDesign
.m_bUserAttr
;
295 rIn
>> rDesign
.m_aBackColor
;
296 rIn
>> rDesign
.m_aTextColor
;
297 rIn
>> rDesign
.m_aLinkColor
;
298 rIn
>> rDesign
.m_aVLinkColor
;
299 rIn
>> rDesign
.m_aALinkColor
;
300 rIn
>> rDesign
.m_bUseAttribs
;
301 rIn
>> rDesign
.m_bUseColor
;
304 rDesign
.m_eScript
= (PublishingScript
)nTemp16
;
305 rIn
.ReadByteString( rDesign
.m_aURL
, RTL_TEXTENCODING_UTF8
);
306 rIn
.ReadByteString( rDesign
.m_aCGI
, RTL_TEXTENCODING_UTF8
);
308 rIn
>> rDesign
.m_bAutoSlide
;
309 rIn
>> rDesign
.m_nSlideDuration
;
310 rIn
>> rDesign
.m_bEndless
;
311 rIn
>> rDesign
.m_bSlideSound
;
312 rIn
>> rDesign
.m_bHiddenSlides
;
317 // =====================================================================
318 // Dieses Design in Stream speichern
319 // =====================================================================
320 SvStream
& operator << (SvStream
& rOut
, const SdPublishingDesign
& rDesign
)
322 // Letzter Parameter ist die aktuelle Versionsnummer des Codes
323 SdIOCompat
aIO(rOut
, STREAM_WRITE
, 0);
326 rOut
.WriteByteString( rDesign
.m_aDesignName
, RTL_TEXTENCODING_UTF8
);
328 rOut
<< (UINT16
)rDesign
.m_eMode
;
329 rOut
<< rDesign
.m_bContentPage
;
330 rOut
<< rDesign
.m_bNotes
;
331 rOut
<< rDesign
.m_nResolution
;
332 rOut
.WriteByteString( rDesign
.m_aCompression
, RTL_TEXTENCODING_UTF8
);
333 rOut
<< (UINT16
)rDesign
.m_eFormat
;
334 rOut
.WriteByteString( rDesign
.m_aAuthor
, RTL_TEXTENCODING_UTF8
);
335 rOut
.WriteByteString( rDesign
.m_aEMail
, RTL_TEXTENCODING_UTF8
);
336 rOut
.WriteByteString( rDesign
.m_aWWW
, RTL_TEXTENCODING_UTF8
);
337 rOut
.WriteByteString( rDesign
.m_aMisc
, RTL_TEXTENCODING_UTF8
);
338 rOut
<< rDesign
.m_bDownload
;
339 rOut
<< rDesign
.m_bCreated
; // not used
340 rOut
<< rDesign
.m_nButtonThema
;
341 rOut
<< rDesign
.m_bUserAttr
;
342 rOut
<< rDesign
.m_aBackColor
;
343 rOut
<< rDesign
.m_aTextColor
;
344 rOut
<< rDesign
.m_aLinkColor
;
345 rOut
<< rDesign
.m_aVLinkColor
;
346 rOut
<< rDesign
.m_aALinkColor
;
347 rOut
<< rDesign
.m_bUseAttribs
;
348 rOut
<< rDesign
.m_bUseColor
;
350 rOut
<< (UINT16
)rDesign
.m_eScript
;
351 rOut
.WriteByteString( rDesign
.m_aURL
, RTL_TEXTENCODING_UTF8
);
352 rOut
.WriteByteString( rDesign
.m_aCGI
, RTL_TEXTENCODING_UTF8
);
354 rOut
<< rDesign
.m_bAutoSlide
;
355 rOut
<< rDesign
.m_nSlideDuration
;
356 rOut
<< rDesign
.m_bEndless
;
357 rOut
<< rDesign
.m_bSlideSound
;
358 rOut
<< rDesign
.m_bHiddenSlides
;
363 // *********************************************************************
364 // Dialog zur eingabe eines Namens fuer ein Design
365 // *********************************************************************
366 class SdDesignNameDlg
: public ModalDialog
371 CancelButton m_aBtnCancel
;
374 SdDesignNameDlg(Window
* pWindow
, const String
& aName
);
376 String
GetDesignName();
377 DECL_LINK( ModifyHdl
, Edit
* );
380 // *********************************************************************
381 // SdPublishingDlg Methoden
382 // *********************************************************************
384 // =====================================================================
385 // Konstruktor des Dialogs
386 // =====================================================================
387 SdPublishingDlg::SdPublishingDlg(Window
* pWindow
, DocumentType eDocType
)
388 : ModalDialog(pWindow
, SdResId( DLG_PUBLISHING
))
389 , mpButtonSet( new ButtonSet() )
390 , aBottomLine( this, SdResId( BOTTOM_LINE
) )
391 , aHelpButton(this,SdResId(BUT_HELP
))
392 , aCancelButton(this,SdResId(BUT_CANCEL
))
393 , aLastPageButton(this,SdResId(BUT_LAST
))
394 , aNextPageButton(this,SdResId(BUT_NEXT
))
395 , aFinishButton(this,SdResId(BUT_FINISH
))
396 , aAssistentFunc(NOOFPAGES
)
397 , m_bButtonsDirty(TRUE
)
398 , m_bDesignListDirty(FALSE
)
401 m_bImpress
= eDocType
== DOCUMENT_TYPE_IMPRESS
;
406 //setzt die Ausgangsseite
407 aAssistentFunc
.GotoPage(1);
408 aLastPageButton
.Disable();
411 aFinishButton
.SetClickHdl(LINK(this,SdPublishingDlg
,FinishHdl
));
412 aLastPageButton
.SetClickHdl(LINK(this,SdPublishingDlg
,LastPageHdl
));
413 aNextPageButton
.SetClickHdl(LINK(this,SdPublishingDlg
,NextPageHdl
));
415 pPage1_NewDesign
->SetClickHdl(LINK(this,SdPublishingDlg
,DesignHdl
));
416 pPage1_OldDesign
->SetClickHdl(LINK(this,SdPublishingDlg
,DesignHdl
));
417 pPage1_Designs
->SetSelectHdl(LINK(this,SdPublishingDlg
,DesignSelectHdl
));
418 pPage1_DelDesign
->SetClickHdl(LINK(this,SdPublishingDlg
,DesignDeleteHdl
));
420 pPage2_Standard
->SetClickHdl(LINK(this,SdPublishingDlg
,BaseHdl
));
421 pPage2_Standard_FB
->SetBorderStyle(WINDOW_BORDER_MONO
);
422 pPage2_Frames
->SetClickHdl(LINK(this,SdPublishingDlg
,BaseHdl
));
423 pPage2_Frames_FB
->SetBorderStyle(WINDOW_BORDER_MONO
);
424 pPage2_Kiosk
->SetClickHdl(LINK(this,SdPublishingDlg
,BaseHdl
));
425 pPage2_Kiosk_FB
->SetBorderStyle(WINDOW_BORDER_MONO
);
426 pPage2_WebCast
->SetClickHdl(LINK(this,SdPublishingDlg
,BaseHdl
));
427 pPage2_WebCast_FB
->SetBorderStyle(WINDOW_BORDER_MONO
);
429 pPage2_Content
->SetClickHdl(LINK(this,SdPublishingDlg
,ContentHdl
));
431 pPage2_ASP
->SetClickHdl(LINK(this,SdPublishingDlg
,WebServerHdl
));
432 pPage2_PERL
->SetClickHdl(LINK(this,SdPublishingDlg
,WebServerHdl
));
433 String
aText( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM("index")) );
434 aText
+= String(SdResId(STR_HTMLEXP_DEFAULT_EXTENSION
));
435 pPage2_Index
->SetText(aText
);
436 pPage2_CGI
->SetText( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "/cgi-bin/" ) ) );
438 pPage3_Png
->SetClickHdl(LINK(this,SdPublishingDlg
, GfxFormatHdl
));
439 pPage3_Gif
->SetClickHdl(LINK(this,SdPublishingDlg
, GfxFormatHdl
));
440 pPage3_Jpg
->SetClickHdl(LINK(this,SdPublishingDlg
, GfxFormatHdl
));
441 pPage3_Quality
->Enable(FALSE
);
443 pPage3_Resolution_1
->SetClickHdl(LINK(this,SdPublishingDlg
, ResolutionHdl
));
444 pPage3_Resolution_2
->SetClickHdl(LINK(this,SdPublishingDlg
, ResolutionHdl
));
445 pPage3_Resolution_3
->SetClickHdl(LINK(this,SdPublishingDlg
, ResolutionHdl
));
447 pPage2_ChgDefault
->SetClickHdl(LINK(this,SdPublishingDlg
, SlideChgHdl
));
448 pPage2_ChgAuto
->SetClickHdl(LINK(this,SdPublishingDlg
, SlideChgHdl
));
449 pPage2_Duration
->SetFormat( TIMEF_SEC
);
451 pPage5_Buttons
->SetSelectHdl(LINK(this,SdPublishingDlg
, ButtonsHdl
));
452 pPage5_Buttons
->SetStyle( pPage5_Buttons
->GetStyle() | WB_VSCROLL
);
454 pPage6_Back
->SetClickHdl(LINK(this,SdPublishingDlg
, ColorHdl
));
455 pPage6_Text
->SetClickHdl(LINK(this,SdPublishingDlg
, ColorHdl
));
456 pPage6_Link
->SetClickHdl(LINK(this,SdPublishingDlg
, ColorHdl
));
457 pPage6_VLink
->SetClickHdl(LINK(this,SdPublishingDlg
, ColorHdl
));
458 pPage6_ALink
->SetClickHdl(LINK(this,SdPublishingDlg
, ColorHdl
));
460 pPage6_DocColors
->Check();
464 pPage3_Quality
->InsertEntry( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "25%" ) ) );
465 pPage3_Quality
->InsertEntry( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "50%" ) ) );
466 pPage3_Quality
->InsertEntry( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "75%" ) ) );
467 pPage3_Quality
->InsertEntry( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "100%" ) ) );
469 pPage5_Buttons
->SetColCount( 1 );
470 pPage5_Buttons
->SetLineCount( 4 );
471 pPage5_Buttons
->SetExtraSpacing( 1 );
473 for( UINT16 nIndex
= 0; nIndex
< m_pDesignList
->Count(); nIndex
++ )
475 SdPublishingDesign
*pDesign
= (SdPublishingDesign
*)
476 m_pDesignList
->GetObject(nIndex
);
478 pPage1_Designs
->InsertEntry(pDesign
->m_aDesignName
);
481 pPage6_Preview
->SetBorderStyle(WINDOW_BORDER_MONO
);
485 SetHelpId(aPageHelpIds
[0]);
487 aNextPageButton
.GrabFocus();
490 // =====================================================================
492 // =====================================================================
493 SdPublishingDlg::~SdPublishingDlg()
497 for( UINT16 nIndex
= 0; nIndex
< m_pDesignList
->Count(); nIndex
++ )
498 delete (SdPublishingDesign
*)m_pDesignList
->GetObject(nIndex
);
501 delete m_pDesignList
;
505 // =====================================================================
506 // Dialog Controls erzeugen und in die Seiten des Assistenten einbinden
507 // =====================================================================
508 void SdPublishingDlg::CreatePages()
511 aAssistentFunc
.InsertControl(1,
512 pPage1_Bmp
= new FixedBitmap(this,SdResId(PAGE1_BMP
)));
513 aAssistentFunc
.InsertControl(1,
514 pPage1_Titel
= new FixedLine(this,SdResId(PAGE1_TITEL
)));
515 aAssistentFunc
.InsertControl(1,
516 pPage1_NewDesign
= new RadioButton(this,SdResId(PAGE1_NEW_DESIGN
)));
517 aAssistentFunc
.InsertControl(1,
518 pPage1_OldDesign
= new RadioButton(this,SdResId(PAGE1_OLD_DESIGN
)));
519 aAssistentFunc
.InsertControl(1,
520 pPage1_Designs
= new ListBox(this,SdResId(PAGE1_DESIGNS
)));
521 aAssistentFunc
.InsertControl(1,
522 pPage1_DelDesign
= new PushButton(this,SdResId(PAGE1_DEL_DESIGN
)));
523 aAssistentFunc
.InsertControl(1,
524 pPage1_Desc
= new FixedText(this,SdResId(PAGE1_DESC
)));
528 aAssistentFunc
.InsertControl(2,
529 pPage2_Bmp
= new FixedBitmap(this,SdResId(PAGE2_BMP
)));
530 aAssistentFunc
.InsertControl(2,
531 pPage2_Titel
= new FixedLine(this,SdResId(PAGE2_TITEL
)));
532 aAssistentFunc
.InsertControl(2,
533 pPage2_Standard
= new RadioButton(this,SdResId(PAGE2_STANDARD
)));
534 aAssistentFunc
.InsertControl(2,
535 pPage2_Frames
= new RadioButton(this,SdResId(PAGE2_FRAMES
)));
536 aAssistentFunc
.InsertControl(2,
537 pPage2_Kiosk
= new RadioButton(this,SdResId(PAGE2_KIOSK
)));
538 aAssistentFunc
.InsertControl(2,
539 pPage2_WebCast
= new RadioButton(this,SdResId(PAGE2_WEBCAST
)));
540 aAssistentFunc
.InsertControl(2,
541 pPage2_Standard_FB
= new FixedBitmap(this,SdResId(PAGE2_NOFRAMES_FB
)));
542 aAssistentFunc
.InsertControl(2,
543 pPage2_Frames_FB
= new FixedBitmap(this,SdResId(PAGE2_FRAMES_FB
)));
544 aAssistentFunc
.InsertControl(2,
545 pPage2_Kiosk_FB
= new FixedBitmap(this,SdResId(PAGE2_KIOSK_FB
)));
546 aAssistentFunc
.InsertControl(2,
547 pPage2_WebCast_FB
= new FixedBitmap(this,SdResId(PAGE2_WEBCAST_FB
)));
549 aAssistentFunc
.InsertControl(2,
550 pPage2_Titel_Html
= new FixedLine(this,SdResId(PAGE2_TITEL_HTML
)));
551 aAssistentFunc
.InsertControl(2,
552 pPage2_Content
= new CheckBox(this,SdResId(PAGE2_CONTENT
)));
554 aAssistentFunc
.InsertControl(2,
555 pPage2_Notes
= new CheckBox(this,SdResId(PAGE2_NOTES
)));
557 aAssistentFunc
.InsertControl(2,
558 pPage2_Titel_WebCast
= new FixedLine(this,SdResId(PAGE2_TITEL_WEBCAST
)));
559 aAssistentFunc
.InsertControl(2,
560 pPage2_Index_txt
= new FixedText(this,SdResId(PAGE2_INDEX_TXT
)));
561 aAssistentFunc
.InsertControl(2,
562 pPage2_Index
= new Edit(this,SdResId(PAGE2_INDEX
)));
563 aAssistentFunc
.InsertControl(2,
564 pPage2_ASP
= new RadioButton(this,SdResId(PAGE2_ASP
)));
565 aAssistentFunc
.InsertControl(2,
566 pPage2_PERL
= new RadioButton(this,SdResId(PAGE2_PERL
)));
567 aAssistentFunc
.InsertControl(2,
568 pPage2_URL_txt
= new FixedText(this,SdResId(PAGE2_URL_TXT
)));
569 aAssistentFunc
.InsertControl(2,
570 pPage2_URL
= new Edit(this,SdResId(PAGE2_URL
)));
571 aAssistentFunc
.InsertControl(2,
572 pPage2_CGI_txt
= new FixedText(this,SdResId(PAGE2_CGI_TXT
)));
573 aAssistentFunc
.InsertControl(2,
574 pPage2_CGI
= new Edit(this,SdResId(PAGE2_CGI
)));
575 aAssistentFunc
.InsertControl(2,
576 pPage2_Vert
= new FixedLine( this,SdResId( PAGE2_VERT
)));
577 aAssistentFunc
.InsertControl(2,
578 pPage2_Titel_Kiosk
= new FixedLine(this,SdResId(PAGE2_TITEL_KIOSK
)));
579 aAssistentFunc
.InsertControl(2,
580 pPage2_ChgDefault
= new RadioButton(this,SdResId(PAGE2_CHG_DEFAULT
)));
581 aAssistentFunc
.InsertControl(2,
582 pPage2_ChgAuto
= new RadioButton(this,SdResId(PAGE2_CHG_AUTO
)));
583 aAssistentFunc
.InsertControl(2,
584 pPage2_Duration_txt
= new FixedText(this,SdResId(PAGE2_DURATION_TXT
)));
585 aAssistentFunc
.InsertControl(2,
586 pPage2_Duration
= new TimeField(this,SdResId(PAGE2_DURATION_TMF
)));
587 aAssistentFunc
.InsertControl(2,
588 pPage2_Endless
= new CheckBox(this,SdResId(PAGE2_ENDLESS
)));
591 aAssistentFunc
.InsertControl(3,
592 pPage3_Bmp
= new FixedBitmap(this,SdResId(PAGE3_BMP
)));
593 aAssistentFunc
.InsertControl(3,
594 pPage3_Titel1
= new FixedLine(this,SdResId(PAGE3_TITEL_1
)));
595 aAssistentFunc
.InsertControl(3,
596 pPage3_Png
= new RadioButton(this,SdResId(PAGE3_PNG
)));
597 aAssistentFunc
.InsertControl(3,
598 pPage3_Gif
= new RadioButton(this,SdResId(PAGE3_GIF
)));
599 aAssistentFunc
.InsertControl(3,
600 pPage3_Jpg
= new RadioButton(this,SdResId(PAGE3_JPG
)));
601 aAssistentFunc
.InsertControl(3,
602 pPage3_Quality_txt
= new FixedText(this,SdResId(PAGE3_QUALITY_TXT
)));
603 aAssistentFunc
.InsertControl(3,
604 pPage3_Quality
= new ComboBox(this,SdResId(PAGE3_QUALITY
)));
605 aAssistentFunc
.InsertControl(3,
606 pPage3_Vert
= new FixedLine( this,SdResId( PAGE3_VERT
)));
607 aAssistentFunc
.InsertControl(3,
608 pPage3_Titel2
= new FixedLine(this,SdResId(PAGE3_TITEL_2
)));
609 aAssistentFunc
.InsertControl(3,
610 pPage3_Resolution_1
= new RadioButton(this,SdResId(PAGE3_RESOLUTION_1
)));
611 aAssistentFunc
.InsertControl(3,
612 pPage3_Resolution_2
= new RadioButton(this,SdResId(PAGE3_RESOLUTION_2
)));
613 aAssistentFunc
.InsertControl(3,
614 pPage3_Resolution_3
= new RadioButton(this,SdResId(PAGE3_RESOLUTION_3
)));
615 aAssistentFunc
.InsertControl(3,
616 pPage3_Titel3
= new FixedLine(this,SdResId(PAGE3_TITEL_3
)));
617 aAssistentFunc
.InsertControl(3,
618 pPage3_SldSound
= new CheckBox(this,SdResId(PAGE3_SLD_SOUND
)));
619 aAssistentFunc
.InsertControl(3,
620 pPage3_HiddenSlides
= new CheckBox(this,SdResId(PAGE3_HIDDEN_SLIDES
)));
623 aAssistentFunc
.InsertControl(4,
624 pPage4_Bmp
= new FixedBitmap(this,SdResId(PAGE4_BMP
)));
625 aAssistentFunc
.InsertControl(4,
626 pPage4_Titel1
= new FixedLine(this,SdResId(PAGE4_TITEL_1
)));
627 aAssistentFunc
.InsertControl(4,
628 pPage4_Author_txt
= new FixedText(this,SdResId(PAGE4_AUTHOR_TXT
)));
629 aAssistentFunc
.InsertControl(4,
630 pPage4_Author
= new Edit(this,SdResId(PAGE4_AUTHOR
)));
631 aAssistentFunc
.InsertControl(4,
632 pPage4_Email_txt
= new FixedText(this,SdResId(PAGE4_EMAIL_TXT
)));
633 aAssistentFunc
.InsertControl(4,
634 pPage4_Email
= new Edit(this,SdResId(PAGE4_EMAIL_EDIT
)));
635 aAssistentFunc
.InsertControl(4,
636 pPage4_WWW_txt
= new FixedText(this,SdResId(PAGE4_WWW_TXT
)));
637 aAssistentFunc
.InsertControl(4,
638 pPage4_WWW
= new Edit(this,SdResId(PAGE4_WWW_EDIT
)));
639 aAssistentFunc
.InsertControl(4,
640 pPage4_Titel2
= new FixedText(this,SdResId(PAGE4_TITEL_2
)));
641 aAssistentFunc
.InsertControl(4,
642 pPage4_Misc
= new MultiLineEdit(this,SdResId(PAGE4_MISC
)));
644 aAssistentFunc
.InsertControl(4,
645 pPage4_Download
= new CheckBox(this,SdResId(PAGE4_DOWNLOAD
)));
646 //-/ aAssistentFunc.InsertControl(4,
647 //-/ pPage4_Created = new CheckBox(this,SdResId(PAGE4_CREATED)));
650 aAssistentFunc
.InsertControl(5,
651 pPage5_Bmp
= new FixedBitmap(this,SdResId(PAGE5_BMP
)));
652 aAssistentFunc
.InsertControl(5,
653 pPage5_Titel
= new FixedLine(this,SdResId(PAGE5_TITEL
)));
654 aAssistentFunc
.InsertControl(5,
655 pPage5_TextOnly
= new CheckBox(this, SdResId(PAGE5_TEXTONLY
)));
656 aAssistentFunc
.InsertControl(5,
657 pPage5_Buttons
= new ValueSet(this,SdResId(PAGE5_BUTTONS
)));
660 aAssistentFunc
.InsertControl(6,
661 pPage6_Bmp
= new FixedBitmap(this,SdResId(PAGE6_BMP
)));
662 aAssistentFunc
.InsertControl(6,
663 pPage6_Titel
= new FixedLine(this,SdResId(PAGE6_TITEL
)));
664 aAssistentFunc
.InsertControl(6,
665 pPage6_DocColors
= new RadioButton(this,SdResId(PAGE6_DOCCOLORS
)));
666 aAssistentFunc
.InsertControl(6,
667 pPage6_Default
= new RadioButton(this,SdResId(PAGE6_DEFAULT
)));
668 aAssistentFunc
.InsertControl(6,
669 pPage6_User
= new RadioButton(this,SdResId(PAGE6_USER
)));
670 aAssistentFunc
.InsertControl(6,
671 pPage6_Text
= new PushButton(this,SdResId(PAGE6_TEXT
)));
672 aAssistentFunc
.InsertControl(6,
673 pPage6_Link
= new PushButton(this,SdResId(PAGE6_LINK
)));
674 aAssistentFunc
.InsertControl(6,
675 pPage6_ALink
= new PushButton(this,SdResId(PAGE6_ALINK
)));
676 aAssistentFunc
.InsertControl(6,
677 pPage6_VLink
= new PushButton(this,SdResId(PAGE6_VLINK
)));
678 aAssistentFunc
.InsertControl(6,
679 pPage6_Back
= new PushButton(this,SdResId(PAGE6_BACK
)));
680 aAssistentFunc
.InsertControl(6,
681 pPage6_Preview
= new SdHtmlAttrPreview(this,SdResId(PAGE6_PREVIEW
)));
683 InterpolateFixedBitmap(pPage1_Bmp
);
685 InterpolateFixedBitmap(pPage2_Bmp
);
686 InterpolateFixedBitmap(pPage2_Standard_FB
);
687 InterpolateFixedBitmap(pPage2_Frames_FB
);
688 InterpolateFixedBitmap(pPage2_Kiosk_FB
);
689 InterpolateFixedBitmap(pPage2_WebCast_FB
);
691 InterpolateFixedBitmap(pPage3_Bmp
);
692 InterpolateFixedBitmap(pPage4_Bmp
);
694 InterpolateFixedBitmap(pPage5_Bmp
);
695 InterpolateFixedBitmap(pPage6_Bmp
);
698 // =====================================================================
699 // Dialog Controls wieder entfernen
700 // =====================================================================
701 void SdPublishingDlg::RemovePages()
705 delete pPage1_NewDesign
;
706 delete pPage1_OldDesign
;
707 delete pPage1_Designs
;
708 delete pPage1_DelDesign
;
713 delete pPage2_Standard
;
714 delete pPage2_Frames
;
716 delete pPage2_WebCast
;
717 delete pPage2_Standard_FB
;
718 delete pPage2_Frames_FB
;
719 delete pPage2_Kiosk_FB
;
720 delete pPage2_WebCast_FB
;
722 delete pPage2_Titel_Html
;
723 delete pPage2_Content
;
728 delete pPage2_Titel_WebCast
;
729 delete pPage2_Index_txt
;
733 delete pPage2_URL_txt
;
735 delete pPage2_CGI_txt
;
738 delete pPage2_Titel_Kiosk
;
739 delete pPage2_ChgDefault
;
740 delete pPage2_ChgAuto
;
741 delete pPage2_Duration_txt
;
742 delete pPage2_Duration
;
743 delete pPage2_Endless
;
746 delete pPage3_Titel1
;
750 delete pPage3_Quality_txt
;
751 delete pPage3_Quality
;
753 delete pPage3_Titel2
;
754 delete pPage3_Resolution_1
;
755 delete pPage3_Resolution_2
;
756 delete pPage3_Resolution_3
;
757 delete pPage3_Titel3
;
758 delete pPage3_SldSound
;
759 delete pPage3_HiddenSlides
;
762 delete pPage4_Titel1
;
763 delete pPage4_Author_txt
;
764 delete pPage4_Author
;
765 delete pPage4_Email_txt
;
767 delete pPage4_WWW_txt
;
769 delete pPage4_Titel2
;
772 delete pPage4_Download
;
773 //-/ delete pPage4_Created;
777 delete pPage5_TextOnly
;
778 delete pPage5_Buttons
;
782 delete pPage6_Default
;
789 delete pPage6_DocColors
;
790 delete pPage6_Preview
;
793 // =====================================================================
794 // Dialog mit defaultwerten initialisieren
795 // =====================================================================
796 void SdPublishingDlg::SetDefaults()
798 SdPublishingDesign aDefault
;
799 SetDesign(&aDefault
);
801 pPage1_NewDesign
->Check(TRUE
);
802 pPage1_OldDesign
->Check(FALSE
);
806 // =====================================================================
807 // Das SfxItemSet mit den Einstellungen des Dialogs fuettern
808 // =====================================================================
809 void SdPublishingDlg::GetParameterSequence( Sequence
< PropertyValue
>& rParams
)
811 std::vector
< PropertyValue
> aProps
;
813 PropertyValue aValue
;
817 aValue
.Name
= OUString( RTL_CONSTASCII_USTRINGPARAM( "PublishMode" ) );
818 aValue
.Value
<<= (sal_Int32
)(pPage2_Standard
->IsChecked()?PUBLISH_HTML
:
819 pPage2_Frames
->IsChecked()?PUBLISH_FRAMES
:
820 pPage2_Kiosk
->IsChecked()?PUBLISH_KIOSK
:PUBLISH_WEBCAST
);
821 aProps
.push_back( aValue
);
823 aValue
.Name
= OUString( RTL_CONSTASCII_USTRINGPARAM( "IsExportContentsPage" ) );
824 aValue
.Value
<<= (sal_Bool
)pPage2_Content
->IsChecked();
825 aProps
.push_back( aValue
);
829 aValue
.Name
= OUString( RTL_CONSTASCII_USTRINGPARAM( "IsExportNotes" ) );
830 aValue
.Value
<<= (sal_Bool
)pPage2_Notes
->IsChecked();
831 aProps
.push_back( aValue
);
834 if( pPage2_WebCast
->IsChecked() )
836 aValue
.Name
= OUString( RTL_CONSTASCII_USTRINGPARAM( "WebCastScriptLanguage" ) );
837 if( pPage2_ASP
->IsChecked() )
838 aValue
.Value
<<= OUString( RTL_CONSTASCII_USTRINGPARAM( "asp" ) );
840 aValue
.Value
<<= OUString( RTL_CONSTASCII_USTRINGPARAM( "perl" ) );
841 aProps
.push_back( aValue
);
843 aValue
.Name
= OUString( RTL_CONSTASCII_USTRINGPARAM( "WebCastCGIURL" ) );
844 aValue
.Value
<<= OUString( pPage2_CGI
->GetText() );
845 aProps
.push_back( aValue
);
847 aValue
.Name
= OUString( RTL_CONSTASCII_USTRINGPARAM( "WebCastTargetURL" ) );
848 aValue
.Value
<<= OUString( pPage2_URL
->GetText() );
849 aProps
.push_back( aValue
);
851 aValue
.Name
= OUString( RTL_CONSTASCII_USTRINGPARAM( "IndexURL" ) );
852 aValue
.Value
<<= OUString( pPage2_Index
->GetText() );
853 aProps
.push_back( aValue
);
856 if( pPage2_Kiosk
->IsChecked() && pPage2_ChgAuto
->IsChecked() )
858 aValue
.Name
= OUString( RTL_CONSTASCII_USTRINGPARAM( "KioskSlideDuration" ) );
859 aValue
.Value
<<= (sal_uInt32
)pPage2_Duration
->GetTime().GetMSFromTime() / 1000;
860 aProps
.push_back( aValue
);
862 aValue
.Name
= OUString( RTL_CONSTASCII_USTRINGPARAM( "KioskEndless" ) );
863 aValue
.Value
<<= (sal_Bool
)pPage2_Endless
->IsChecked();
864 aProps
.push_back( aValue
);
869 aValue
.Name
= OUString( RTL_CONSTASCII_USTRINGPARAM( "Width" ) );
870 sal_Int32 nTmpWidth
= 512;
871 if( pPage3_Resolution_2
->IsChecked() )
873 else if( pPage3_Resolution_3
->IsChecked() )
876 aValue
.Value
<<= nTmpWidth
;
877 aProps
.push_back( aValue
);
879 aValue
.Name
= OUString( RTL_CONSTASCII_USTRINGPARAM( "Compression" ) );
880 aValue
.Value
<<= OUString( pPage3_Quality
->GetText() );
881 aProps
.push_back( aValue
);
883 aValue
.Name
= OUString( RTL_CONSTASCII_USTRINGPARAM( "Format" ) );
885 if( pPage3_Png
->IsChecked() )
886 nFormat
= static_cast<sal_Int32
>(FORMAT_PNG
);
887 else if( pPage3_Gif
->IsChecked() )
888 nFormat
= static_cast<sal_Int32
>(FORMAT_GIF
);
890 nFormat
= static_cast<sal_Int32
>(FORMAT_JPG
);
891 aValue
.Value
<<= nFormat
;
892 aProps
.push_back( aValue
);
894 aValue
.Name
= OUString( RTL_CONSTASCII_USTRINGPARAM( "SlideSound" ) );
895 aValue
.Value
<<= pPage3_SldSound
->IsChecked() ? sal_True
: sal_False
;
896 aProps
.push_back( aValue
);
898 aValue
.Name
= OUString( RTL_CONSTASCII_USTRINGPARAM( "HiddenSlides" ) );
899 aValue
.Value
<<= pPage3_HiddenSlides
->IsChecked() ? sal_True
: sal_False
;
900 aProps
.push_back( aValue
);
903 aValue
.Name
= OUString( RTL_CONSTASCII_USTRINGPARAM( "Author" ) );
904 aValue
.Value
<<= OUString( pPage4_Author
->GetText() );
905 aProps
.push_back( aValue
);
907 aValue
.Name
= OUString( RTL_CONSTASCII_USTRINGPARAM( "EMail" ) );
908 aValue
.Value
<<= OUString( pPage4_Email
->GetText() );
909 aProps
.push_back( aValue
);
911 // #92433# try to guess protocol for user's homepage
912 INetURLObject
aHomeURL( pPage4_WWW
->GetText(),
913 INET_PROT_HTTP
, // default proto is HTTP
914 INetURLObject::ENCODE_ALL
);
916 aValue
.Name
= OUString( RTL_CONSTASCII_USTRINGPARAM( "HomepageURL" ) );
917 aValue
.Value
<<= OUString( aHomeURL
.GetMainURL( INetURLObject::NO_DECODE
) );
918 aProps
.push_back( aValue
);
920 aValue
.Name
= OUString( RTL_CONSTASCII_USTRINGPARAM( "UserText" ) );
921 aValue
.Value
<<= OUString( pPage4_Misc
->GetText() );
922 aProps
.push_back( aValue
);
926 aValue
.Name
= OUString( RTL_CONSTASCII_USTRINGPARAM( "EnableDownload" ) );
927 aValue
.Value
<<= (sal_Bool
)pPage4_Download
->IsChecked();
928 aProps
.push_back( aValue
);
932 if( !pPage5_TextOnly
->IsChecked() )
934 aValue
.Name
= OUString( RTL_CONSTASCII_USTRINGPARAM( "UseButtonSet" ) );
935 aValue
.Value
<<= (sal_Int32
)(pPage5_Buttons
->GetSelectItemId() - 1);
936 aProps
.push_back( aValue
);
940 if( pPage6_User
->IsChecked() )
942 aValue
.Name
= OUString( RTL_CONSTASCII_USTRINGPARAM( "BackColor" ) );
943 aValue
.Value
<<= (sal_Int32
)m_aBackColor
.GetColor();
944 aProps
.push_back( aValue
);
946 aValue
.Name
= OUString( RTL_CONSTASCII_USTRINGPARAM( "TextColor" ) );
947 aValue
.Value
<<= (sal_Int32
)m_aTextColor
.GetColor();
948 aProps
.push_back( aValue
);
950 aValue
.Name
= OUString( RTL_CONSTASCII_USTRINGPARAM( "LinkColor" ) );
951 aValue
.Value
<<= (sal_Int32
)m_aLinkColor
.GetColor();
952 aProps
.push_back( aValue
);
954 aValue
.Name
= OUString( RTL_CONSTASCII_USTRINGPARAM( "VLinkColor" ) );
955 aValue
.Value
<<= (sal_Int32
)m_aVLinkColor
.GetColor();
956 aProps
.push_back( aValue
);
958 aValue
.Name
= OUString( RTL_CONSTASCII_USTRINGPARAM( "ALinkColor" ) );
959 aValue
.Value
<<= (sal_Int32
)m_aALinkColor
.GetColor();
960 aProps
.push_back( aValue
);
963 if( pPage6_DocColors
->IsChecked() )
965 aValue
.Name
= OUString( RTL_CONSTASCII_USTRINGPARAM( "IsUseDocumentColors" ) );
966 aValue
.Value
<<= (sal_Bool
)sal_True
;
967 aProps
.push_back( aValue
);
971 // aSet.Put(SfxBoolItem(ATTR_PUBLISH_SLIDESOUND,pPage6_Sound->IsChecked()));
974 rParams
.realloc( aProps
.size() );
975 PropertyValue
* pParams
= rParams
.getArray();
977 for( std::vector
< PropertyValue
>::iterator i
= aProps
.begin(); i
!= aProps
.end(); i
++ )
983 // =====================================================================
984 // Clickhandler fuer die Radiobuttons zur Designauswahl
985 // =====================================================================
986 IMPL_LINK( SdPublishingDlg
, DesignHdl
, RadioButton
*, pButton
)
988 if(pButton
== pPage1_NewDesign
)
990 pPage1_NewDesign
->Check(TRUE
); // wegen DesignDeleteHdl
991 pPage1_OldDesign
->Check(FALSE
);
992 pPage1_Designs
->Disable();
993 pPage1_DelDesign
->Disable();
996 SdPublishingDesign aDefault
;
997 SetDesign(&aDefault
);
1001 pPage1_NewDesign
->Check(FALSE
);
1002 pPage1_Designs
->Enable();
1003 pPage1_DelDesign
->Enable();
1005 if(pPage1_Designs
->GetSelectEntryCount() == 0)
1006 pPage1_Designs
->SelectEntryPos(0);
1008 USHORT nPos
= pPage1_Designs
->GetSelectEntryPos();
1009 m_pDesign
= (SdPublishingDesign
*)m_pDesignList
->GetObject(nPos
);
1010 DBG_ASSERT(m_pDesign
, "Kein Design? Das darf nicht sein! (CL)");
1013 SetDesign(m_pDesign
);
1019 // =====================================================================
1020 // Clickhandler fuer die auswahl eines Designs
1021 // =====================================================================
1022 IMPL_LINK( SdPublishingDlg
, DesignSelectHdl
, ListBox
*, EMPTYARG
)
1024 USHORT nPos
= pPage1_Designs
->GetSelectEntryPos();
1025 m_pDesign
= (SdPublishingDesign
*)m_pDesignList
->GetObject(nPos
);
1026 DBG_ASSERT(m_pDesign
, "Kein Design? Das darf nicht sein! (CL)");
1029 SetDesign(m_pDesign
);
1036 // =====================================================================
1037 // Clickhandler fuer das loeschen eines Designs
1038 // =====================================================================
1039 IMPL_LINK( SdPublishingDlg
, DesignDeleteHdl
, PushButton
*, EMPTYARG
)
1041 USHORT nPos
= pPage1_Designs
->GetSelectEntryPos();
1042 SdPublishingDesign
* pDesign
= (SdPublishingDesign
*)
1043 m_pDesignList
->GetObject(nPos
);
1044 DBG_ASSERT(pDesign
, "Kein Design? Das darf nicht sein! (CL)");
1048 m_pDesignList
->Remove(pDesign
);
1049 pPage1_Designs
->RemoveEntry(nPos
);
1052 if(m_pDesign
== pDesign
)
1053 DesignHdl( pPage1_NewDesign
);
1057 m_bDesignListDirty
= TRUE
;
1064 // =====================================================================
1065 // Clickhandler fuer das ändern des Servertyps
1066 // =====================================================================
1067 IMPL_LINK( SdPublishingDlg
, WebServerHdl
, RadioButton
*, pButton
)
1069 BOOL bASP
= pButton
== pPage2_ASP
;
1071 pPage2_ASP
->Check( bASP
);
1072 pPage2_PERL
->Check( !bASP
);
1078 // =====================================================================
1079 // Clickhandler fuer die Radiobuttons der Auswahl des Grafikformates
1080 // =====================================================================
1081 IMPL_LINK( SdPublishingDlg
, GfxFormatHdl
, RadioButton
*, pButton
)
1083 pPage3_Png
->Check( pButton
== pPage3_Png
);
1084 pPage3_Gif
->Check( pButton
== pPage3_Gif
);
1085 pPage3_Jpg
->Check( pButton
== pPage3_Jpg
);
1086 pPage3_Quality
->Enable(pButton
== pPage3_Jpg
);
1090 // =====================================================================
1091 // Clickhandler fuer die Radiobuttons Stanrard/Frames
1092 // =====================================================================
1093 IMPL_LINK( SdPublishingDlg
, BaseHdl
, RadioButton
*, EMPTYARG
)
1096 if(pButton == pPage3_Standard)
1097 pPage3_Frames->Check( pButton == pPage3 );
1099 pPage3_Standard->Check(FALSE);
1106 // =====================================================================
1107 // Clickhandler fuer die CheckBox der Titelseite
1108 // =====================================================================
1109 IMPL_LINK( SdPublishingDlg
, ContentHdl
, RadioButton
*, EMPTYARG
)
1111 if(pPage2_Content
->IsChecked())
1113 if(!aAssistentFunc
.IsEnabled(4))
1115 aAssistentFunc
.EnablePage(4);
1121 if(aAssistentFunc
.IsEnabled(4))
1123 aAssistentFunc
.DisablePage(4);
1130 // =====================================================================
1131 // Clickhandler fuer die Radiobuttons Aufloesung
1132 // =====================================================================
1133 IMPL_LINK( SdPublishingDlg
, ResolutionHdl
, RadioButton
*, pButton
)
1135 pPage3_Resolution_1
->Check(pButton
== pPage3_Resolution_1
);
1136 pPage3_Resolution_2
->Check(pButton
== pPage3_Resolution_2
);
1137 pPage3_Resolution_3
->Check(pButton
== pPage3_Resolution_3
);
1142 // =====================================================================
1143 // Clickhandler fuer das ValueSet mit den Bitmap Schaltflaechen
1144 // =====================================================================
1145 IMPL_LINK( SdPublishingDlg
, ButtonsHdl
, ValueSet
*, EMPTYARG
)
1147 // wird eine Bitmap Schaltflaeche gewaehlt, TexOnly ausschalten
1148 pPage5_TextOnly
->Check(FALSE
);
1152 // =====================================================================
1153 // Das SfxItemSet mit den Einstellungen des Dialogs fuettern
1154 // =====================================================================
1155 IMPL_LINK( SdPublishingDlg
, ColorHdl
, PushButton
*, pButton
)
1157 SvColorDialog
aDlg(this);
1159 if(pButton
== pPage6_Back
)
1161 aDlg
.SetColor( m_aBackColor
);
1162 if(aDlg
.Execute() == RET_OK
)
1163 m_aBackColor
= aDlg
.GetColor();
1165 else if(pButton
== pPage6_Text
)
1167 aDlg
.SetColor( m_aTextColor
);
1168 if(aDlg
.Execute() == RET_OK
)
1169 m_aTextColor
= aDlg
.GetColor();
1171 else if(pButton
== pPage6_Link
)
1173 aDlg
.SetColor( m_aLinkColor
);
1174 if(aDlg
.Execute() == RET_OK
)
1175 m_aLinkColor
= aDlg
.GetColor();
1177 else if(pButton
== pPage6_VLink
)
1179 aDlg
.SetColor( m_aVLinkColor
);
1180 if(aDlg
.Execute() == RET_OK
)
1181 m_aVLinkColor
= aDlg
.GetColor();
1183 else if(pButton
== pPage6_ALink
)
1185 aDlg
.SetColor( m_aALinkColor
);
1186 if(aDlg
.Execute() == RET_OK
)
1187 m_aALinkColor
= aDlg
.GetColor();
1190 pPage6_User
->Check(TRUE
);
1191 pPage6_Preview
->SetColors( m_aBackColor
, m_aTextColor
, m_aLinkColor
,
1192 m_aVLinkColor
, m_aALinkColor
);
1193 pPage6_Preview
->Invalidate();
1197 IMPL_LINK( SdPublishingDlg
, SlideChgHdl
, RadioButton
*, EMPTYARG
)
1203 // =====================================================================
1204 // Clickhandler fuer den Ok Button
1205 // =====================================================================
1206 IMPL_LINK( SdPublishingDlg
, FinishHdl
, OKButton
*, EMPTYARG
)
1209 SdPublishingDesign
* pDesign
= new SdPublishingDesign();
1214 if(pPage1_OldDesign
->IsChecked() && m_pDesign
)
1217 if(!(*pDesign
== *m_pDesign
))
1222 SdPublishingDesign aDefaultDesign
;
1223 if(!(aDefaultDesign
== *pDesign
))
1231 aName
= m_pDesign
->m_aDesignName
;
1238 SdDesignNameDlg
aDlg(this, aName
);
1240 if ( aDlg
.Execute() == RET_OK
)
1242 pDesign
->m_aDesignName
= aDlg
.GetDesignName();
1244 SdPublishingDesign
* pSameNameDes
= NULL
;
1246 for( nIndex
= 0; nIndex
< m_pDesignList
->Count(); nIndex
++ )
1248 pSameNameDes
= (SdPublishingDesign
*)
1249 m_pDesignList
->GetObject(nIndex
);
1250 if(pSameNameDes
->m_aDesignName
== pDesign
->m_aDesignName
)
1254 if(nIndex
< m_pDesignList
->Count())
1256 ErrorBox
aErrorBox(this, WB_YES_NO
,
1257 String(SdResId(STR_PUBDLG_SAMENAME
)));
1258 bRetry
= aErrorBox
.Execute() == RET_NO
;
1262 m_pDesignList
->Remove(pSameNameDes
);
1263 delete pSameNameDes
;
1269 m_pDesignList
->Insert(pDesign
);
1270 m_bDesignListDirty
= TRUE
;
1280 if(m_bDesignListDirty
)
1287 // =====================================================================
1288 // Refresh des Dialogs beim wechsel der Seite
1289 // =====================================================================
1290 void SdPublishingDlg::ChangePage()
1292 int nPage
= aAssistentFunc
.GetCurrentPage();
1293 SetHelpId(aPageHelpIds
[nPage
-1]);
1297 if( aNextPageButton
.IsEnabled() )
1298 aNextPageButton
.GrabFocus();
1300 aFinishButton
.GrabFocus();
1303 void SdPublishingDlg::UpdatePage()
1305 aNextPageButton
.Enable(!aAssistentFunc
.IsLastPage());
1306 aLastPageButton
.Enable(!aAssistentFunc
.IsFirstPage());
1308 int nPage
= aAssistentFunc
.GetCurrentPage();
1313 if(pPage1_NewDesign
->IsChecked())
1315 pPage1_Designs
->Disable();
1316 pPage1_DelDesign
->Disable();
1319 if(m_pDesignList
&& m_pDesignList
->Count() == 0)
1320 pPage1_OldDesign
->Disable();
1323 pPage2_Frames_FB
->Show(pPage2_Frames
->IsChecked());
1324 pPage2_Standard_FB
->Show(pPage2_Standard
->IsChecked());
1325 pPage2_Kiosk_FB
->Show(pPage2_Kiosk
->IsChecked());
1326 pPage2_WebCast_FB
->Show(pPage2_WebCast
->IsChecked());
1328 if( pPage2_WebCast
->IsChecked() )
1330 pPage2_Titel_WebCast
->Show();
1332 pPage2_PERL
->Show();
1333 pPage2_URL_txt
->Show();
1335 pPage2_CGI_txt
->Show();
1337 pPage2_Index_txt
->Show();
1338 pPage2_Index
->Show();
1340 BOOL bPerl
= pPage2_PERL
->IsChecked();
1341 pPage2_Index
->Enable(bPerl
);
1342 pPage2_Index_txt
->Enable(bPerl
);
1343 pPage2_URL_txt
->Enable(bPerl
);
1344 pPage2_URL
->Enable(bPerl
);
1345 pPage2_CGI_txt
->Enable(bPerl
);
1346 pPage2_CGI
->Enable(bPerl
);
1350 pPage2_Titel_WebCast
->Hide();
1352 pPage2_PERL
->Hide();
1353 pPage2_URL_txt
->Hide();
1355 pPage2_CGI_txt
->Hide();
1357 pPage2_Index
->Hide();
1358 pPage2_Index_txt
->Hide();
1361 if( pPage2_Kiosk
->IsChecked() )
1363 pPage2_Titel_Kiosk
->Show();
1364 pPage2_ChgDefault
->Show();
1365 pPage2_ChgAuto
->Show();
1366 pPage2_Duration_txt
->Show();
1367 pPage2_Duration
->Show();
1368 pPage2_Endless
->Show();
1369 BOOL bAuto
= pPage2_ChgAuto
->IsChecked();
1370 pPage2_Duration
->Enable(bAuto
);
1371 pPage2_Endless
->Enable(bAuto
);
1375 pPage2_Titel_Kiosk
->Hide();
1376 pPage2_ChgDefault
->Hide();
1377 pPage2_ChgAuto
->Hide();
1378 pPage2_Duration
->Hide();
1379 pPage2_Duration_txt
->Hide();
1380 pPage2_Endless
->Hide();
1383 if( pPage2_Standard
->IsChecked() || pPage2_Frames
->IsChecked() )
1385 pPage2_Titel_Html
->Show();
1386 pPage2_Content
->Show();
1388 pPage2_Notes
->Show();
1392 pPage2_Titel_Html
->Hide();
1393 pPage2_Content
->Hide();
1395 pPage2_Notes
->Hide();
1399 if( pPage2_Kiosk
->IsChecked() || pPage2_WebCast
->IsChecked() )
1400 aNextPageButton
.Disable();
1402 if( pPage2_WebCast
->IsChecked() )
1403 pPage3_SldSound
->Disable();
1405 pPage3_Quality
->Enable(pPage3_Jpg
->IsChecked());
1409 if( m_bButtonsDirty
)
1410 LoadPreviewButtons();
1415 /** loads the html buttons from the button sets, creates a preview and fills the
1418 void SdPublishingDlg::LoadPreviewButtons()
1420 if( mpButtonSet
.get() )
1422 const int nButtonCount
= 8;
1423 static const char *pButtonNames
[nButtonCount
] =
1435 std::vector
< rtl::OUString
> aButtonNames
;
1436 for( int i
= 0; i
< nButtonCount
; ++i
)
1437 aButtonNames
.push_back( rtl::OUString::createFromAscii( pButtonNames
[i
] ) );
1439 int nSetCount
= mpButtonSet
->getCount();
1443 for( int nSet
= 0; nSet
< nSetCount
; ++nSet
)
1445 if( mpButtonSet
->getPreview( nSet
, aButtonNames
, aImage
) )
1447 pPage5_Buttons
->InsertItem( (USHORT
)nSet
+1, aImage
);
1448 if( nHeight
< aImage
.GetSizePixel().Height() )
1449 nHeight
= aImage
.GetSizePixel().Height();
1453 pPage5_Buttons
->SetItemHeight( nHeight
);
1454 m_bButtonsDirty
= FALSE
;
1458 // =====================================================================
1459 // Clickhandler fuer den Weiter Button
1460 // =====================================================================
1461 IMPL_LINK( SdPublishingDlg
, NextPageHdl
, PushButton
*, EMPTYARG
)
1463 aAssistentFunc
.NextPage();
1468 // =====================================================================
1469 // Setzt die Controlls im Dialog gemaess den Einstellungen im Design
1470 // =====================================================================
1471 void SdPublishingDlg::SetDesign( SdPublishingDesign
* pDesign
)
1476 pPage2_Standard
->Check(pDesign
->m_eMode
== PUBLISH_HTML
);
1477 pPage2_Frames
->Check(pDesign
->m_eMode
== PUBLISH_FRAMES
);
1478 pPage2_Kiosk
->Check(pDesign
->m_eMode
== PUBLISH_KIOSK
);
1479 pPage2_WebCast
->Check(pDesign
->m_eMode
== PUBLISH_WEBCAST
);
1481 pPage2_Content
->Check(pDesign
->m_bContentPage
);
1482 if(pDesign
->m_bContentPage
)
1483 aAssistentFunc
.EnablePage(4);
1485 aAssistentFunc
.DisablePage(4);
1488 pPage2_Notes
->Check(pDesign
->m_bNotes
);
1490 pPage2_ASP
->Check(pDesign
->m_eScript
== SCRIPT_ASP
);
1491 pPage2_PERL
->Check(pDesign
->m_eScript
== SCRIPT_PERL
);
1492 pPage2_CGI
->SetText(pDesign
->m_aCGI
);
1493 pPage2_URL
->SetText(pDesign
->m_aURL
);
1495 pPage2_ChgDefault
->Check( !pDesign
->m_bAutoSlide
);
1496 pPage2_ChgAuto
->Check( pDesign
->m_bAutoSlide
);
1499 aTime
.MakeTimeFromMS( pDesign
->m_nSlideDuration
* 1000 );
1500 pPage2_Duration
->SetTime( aTime
);
1502 pPage2_Endless
->Check( pDesign
->m_bEndless
);
1504 pPage3_Png
->Check(pDesign
->m_eFormat
== FORMAT_PNG
);
1505 pPage3_Gif
->Check(pDesign
->m_eFormat
== FORMAT_GIF
);
1506 pPage3_Jpg
->Check(pDesign
->m_eFormat
== FORMAT_JPG
);
1507 pPage3_Quality
->Enable(pDesign
->m_eFormat
== FORMAT_JPG
);
1509 pPage3_Quality
->SetText(pDesign
->m_aCompression
);
1510 pPage3_Resolution_1
->Check(pDesign
->m_nResolution
== PUB_LOWRES_WIDTH
);
1511 pPage3_Resolution_2
->Check(pDesign
->m_nResolution
== PUB_MEDRES_WIDTH
);
1512 pPage3_Resolution_3
->Check(pDesign
->m_nResolution
== PUB_HIGHRES_WIDTH
);
1514 pPage3_SldSound
->Check( pDesign
->m_bSlideSound
);
1515 pPage3_HiddenSlides
->Check( pDesign
->m_bHiddenSlides
);
1517 pPage4_Author
->SetText(pDesign
->m_aAuthor
);
1518 pPage4_Email
->SetText(pDesign
->m_aEMail
);
1519 pPage4_WWW
->SetText(pDesign
->m_aWWW
);
1520 pPage4_Misc
->SetText(pDesign
->m_aMisc
);
1522 pPage4_Download
->Check(pDesign
->m_bDownload
);
1523 //-/ pPage4_Created->Check(pDesign->m_bCreated);
1525 pPage5_TextOnly
->Check(pDesign
->m_nButtonThema
== -1);
1526 if(pDesign
->m_nButtonThema
!= -1)
1529 LoadPreviewButtons();
1530 pPage5_Buttons
->SelectItem(pDesign
->m_nButtonThema
+ 1);
1533 pPage5_Buttons
->SetNoSelection();
1535 pPage6_User
->Check(pDesign
->m_bUserAttr
);
1536 m_aBackColor
= pDesign
->m_aBackColor
;
1537 m_aTextColor
= pDesign
->m_aTextColor
;
1538 m_aLinkColor
= pDesign
->m_aLinkColor
;
1539 m_aVLinkColor
= pDesign
->m_aVLinkColor
;
1540 m_aALinkColor
= pDesign
->m_aALinkColor
;
1542 pPage6_DocColors
->Check(pDesign
->m_bUseColor
);
1544 pPage6_Preview
->SetColors( m_aBackColor
, m_aTextColor
, m_aLinkColor
,
1545 m_aVLinkColor
, m_aALinkColor
);
1546 pPage6_Preview
->Invalidate();
1551 // =====================================================================
1552 // Uebertraegt den Status der Dialog Controlls in das Design
1553 // =====================================================================
1554 void SdPublishingDlg::GetDesign( SdPublishingDesign
* pDesign
)
1559 pDesign
->m_eMode
= pPage2_Standard
->IsChecked()?PUBLISH_HTML
:
1560 pPage2_Frames
->IsChecked()?PUBLISH_FRAMES
:
1561 pPage2_Kiosk
->IsChecked()?PUBLISH_KIOSK
:
1564 pDesign
->m_bContentPage
= pPage2_Content
->IsChecked();
1566 pDesign
->m_bNotes
= pPage2_Notes
->IsChecked();
1568 if( pPage3_Gif
->IsChecked() )
1569 pDesign
->m_eFormat
= FORMAT_GIF
;
1570 else if( pPage3_Jpg
->IsChecked() )
1571 pDesign
->m_eFormat
= FORMAT_JPG
;
1573 pDesign
->m_eFormat
= FORMAT_PNG
;
1575 pDesign
->m_aCompression
= pPage3_Quality
->GetText();
1577 pDesign
->m_nResolution
= pPage3_Resolution_1
->IsChecked()?PUB_LOWRES_WIDTH
:
1578 (pPage3_Resolution_2
->IsChecked()?PUB_MEDRES_WIDTH
:PUB_HIGHRES_WIDTH
);
1580 pDesign
->m_bSlideSound
= pPage3_SldSound
->IsChecked();
1581 pDesign
->m_bHiddenSlides
= pPage3_HiddenSlides
->IsChecked();
1583 pDesign
->m_aAuthor
= pPage4_Author
->GetText();
1584 pDesign
->m_aEMail
= pPage4_Email
->GetText();
1585 pDesign
->m_aWWW
= pPage4_WWW
->GetText();
1586 pDesign
->m_aMisc
= pPage4_Misc
->GetText();
1587 pDesign
->m_bDownload
= m_bImpress
?pPage4_Download
->IsChecked():FALSE
;
1588 //-/ pDesign->m_bCreated = pPage4_Created->IsChecked();
1590 if(pPage5_TextOnly
->IsChecked())
1591 pDesign
->m_nButtonThema
= -1;
1593 pDesign
->m_nButtonThema
= pPage5_Buttons
->GetSelectItemId() - 1;
1595 pDesign
->m_bUserAttr
= pPage6_User
->IsChecked();
1596 pDesign
->m_aBackColor
= m_aBackColor
;
1597 pDesign
->m_aTextColor
= m_aTextColor
;
1598 pDesign
->m_aLinkColor
= m_aLinkColor
;
1599 pDesign
->m_aVLinkColor
= m_aVLinkColor
;
1600 pDesign
->m_aALinkColor
= m_aALinkColor
;
1601 pDesign
->m_bUseColor
= pPage6_DocColors
->IsChecked();
1604 pDesign
->m_eScript
= pPage2_ASP
->IsChecked()?SCRIPT_ASP
:SCRIPT_PERL
;
1605 pDesign
->m_aCGI
= pPage2_CGI
->GetText();
1606 pDesign
->m_aURL
= pPage2_URL
->GetText();
1608 pDesign
->m_bAutoSlide
= pPage2_ChgAuto
->IsChecked();
1609 pDesign
->m_nSlideDuration
= (UINT32
)pPage2_Duration
->GetTime().GetMSFromTime() / 1000;
1610 pDesign
->m_bEndless
= pPage2_Endless
->IsChecked();
1613 // =====================================================================
1614 // Clickhandler fuer den Zurueck Button
1615 // =====================================================================
1616 IMPL_LINK( SdPublishingDlg
, LastPageHdl
, PushButton
*, EMPTYARG
)
1618 aAssistentFunc
.PreviousPage();
1623 // =====================================================================
1625 // =====================================================================
1626 BOOL
SdPublishingDlg::Load()
1628 m_bDesignListDirty
= FALSE
;
1630 m_pDesignList
= new List();
1632 INetURLObject
aURL( SvtPathOptions().GetUserConfigPath() );
1633 aURL
.Append( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "designs.sod" ) ) );
1635 // check if file exists, SfxMedium shows an errorbox else
1637 com::sun::star::uno::Reference
< com::sun::star::task::XInteractionHandler
> xHandler
;
1638 SvStream
* pIStm
= ::utl::UcbStreamHelper::CreateStream( aURL
.GetMainURL( INetURLObject::NO_DECODE
), STREAM_READ
, xHandler
);
1640 sal_Bool bOk
= pIStm
&& ( pIStm
->GetError() == 0);
1649 SfxMedium
aMedium( aURL
.GetMainURL( INetURLObject::NO_DECODE
), STREAM_READ
| STREAM_NOCREATE
, TRUE
);
1651 SvStream
* pStream
= aMedium
.GetInStream();
1659 if(aCheck
!= nMagic
)
1662 SdIOCompat
aIO(*pStream
, STREAM_READ
);
1665 *pStream
>> nDesigns
;
1667 for( UINT16 nIndex
= 0;
1668 pStream
->GetError() == SVSTREAM_OK
&& nIndex
< nDesigns
;
1671 SdPublishingDesign
* pDesign
= new SdPublishingDesign();
1672 *pStream
>> *pDesign
;
1674 m_pDesignList
->Insert(pDesign
);
1677 return( pStream
->GetError() == SVSTREAM_OK
);
1680 // =====================================================================
1681 // Designs speichern
1682 // =====================================================================
1683 BOOL
SdPublishingDlg::Save()
1685 INetURLObject
aURL( SvtPathOptions().GetUserConfigPath() );
1686 aURL
.Append( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "designs.sod" ) ) );
1687 SfxMedium
aMedium( aURL
.GetMainURL( INetURLObject::NO_DECODE
), STREAM_WRITE
| STREAM_TRUNC
, FALSE
);
1690 SvStream
* pStream
= aMedium
.GetOutStream();
1695 UINT16 aCheck
= nMagic
;
1698 // damit SdIOCompat vor dem Stream destruiert wird
1700 SdIOCompat
aIO(*pStream
, STREAM_WRITE
, 0);
1702 UINT16 nDesigns
= (UINT16
) m_pDesignList
->Count();
1703 *pStream
<< nDesigns
;
1705 for( UINT16 nIndex
= 0;
1706 pStream
->GetError() == SVSTREAM_OK
&& nIndex
< nDesigns
;
1709 SdPublishingDesign
* pDesign
= (SdPublishingDesign
*)
1710 m_pDesignList
->GetObject(nIndex
);
1711 *pStream
<< *pDesign
;
1718 return( aMedium
.GetError() == 0 );
1721 // *********************************************************************
1722 // SdDesignNameDlg Methoden
1723 // *********************************************************************
1725 // =====================================================================
1727 // =====================================================================
1728 SdDesignNameDlg::SdDesignNameDlg(Window
* pWindow
, const String
& aName
):
1729 ModalDialog (pWindow
, SdResId( DLG_DESIGNNAME
)),
1730 m_aEdit (this, SdResId(EDT_NAME
)),
1731 m_aBtnOK (this, SdResId(BTN_SAVE
)),
1732 m_aBtnCancel (this, SdResId(BTN_NOSAVE
))
1735 m_aEdit
.SetModifyHdl(LINK(this, SdDesignNameDlg
, ModifyHdl
));
1736 m_aEdit
.SetText(aName
);
1737 m_aBtnOK
.Enable(aName
.Len() != 0);
1740 // =====================================================================
1742 // =====================================================================
1743 String
SdDesignNameDlg::GetDesignName()
1745 return m_aEdit
.GetText();
1748 // =====================================================================
1750 // =====================================================================
1751 IMPL_LINK( SdDesignNameDlg
, ModifyHdl
, Edit
*, EMPTYARG
)
1753 m_aBtnOK
.Enable(m_aEdit
.GetText().Len() != 0);