Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : :
30 : : #ifdef SD_DLLIMPLEMENTATION
31 : : #undef SD_DLLIMPLEMENTATION
32 : : #endif
33 : : #include <com/sun/star/beans/PropertyValue.hpp>
34 : : #include <unotools/ucbstreamhelper.hxx>
35 : : #include <vcl/lstbox.hxx>
36 : : #include <svtools/FilterConfigItem.hxx>
37 : : #include <vcl/button.hxx>
38 : : #include <vcl/fixed.hxx>
39 : : #include <vcl/combobox.hxx>
40 : : #include <svtools/svmedit.hxx>
41 : : #include <svl/intitem.hxx>
42 : : #include <svl/aeitem.hxx>
43 : : #include <svl/itemset.hxx>
44 : : #include <svl/stritem.hxx>
45 : : #include <vcl/msgbox.hxx>
46 : : #include <svtools/valueset.hxx>
47 : : #include <vcl/graph.hxx>
48 : : #include <svl/eitem.hxx>
49 : : #include <svtools/colrdlg.hxx>
50 : : #include <editeng/colritem.hxx>
51 : : #include <tools/urlobj.hxx>
52 : : #include <sdiocmpt.hxx>
53 : : #include <sfx2/docfile.hxx>
54 : : #include <sfx2/app.hxx>
55 : : #include <pres.hxx>
56 : : #include <unotools/useroptions.hxx>
57 : : #include <unotools/pathoptions.hxx>
58 : :
59 : : #include "sdresid.hxx"
60 : : #include "sdattr.hxx"
61 : : #include "pubdlg.hrc"
62 : : #include "htmlattr.hxx"
63 : : #include "htmlex.hxx"
64 : : #include "helpids.h"
65 : : #include "buttonset.hxx"
66 : :
67 : : using namespace std;
68 : : using namespace com::sun::star::uno;
69 : : using namespace com::sun::star::beans;
70 : :
71 : : using ::rtl::OUString;
72 : :
73 : : extern void InterpolateFixedBitmap( FixedBitmap * pBitmap );
74 : :
75 : : //ID for the config-data with the HTML-settings
76 : : const sal_uInt16 nMagic = (sal_uInt16)0x1977;
77 : :
78 : : // Key for the soffice.ini
79 : : #define KEY_QUALITY "JPG-EXPORT-QUALITY"
80 : :
81 : : // The Help-IDs of the pages
82 : : const char* aPageHelpIds[NOOFPAGES] =
83 : : {
84 : : HID_SD_HTMLEXPORT_PAGE1,
85 : : HID_SD_HTMLEXPORT_PAGE2,
86 : : HID_SD_HTMLEXPORT_PAGE3,
87 : : HID_SD_HTMLEXPORT_PAGE4,
88 : : HID_SD_HTMLEXPORT_PAGE5,
89 : : HID_SD_HTMLEXPORT_PAGE6
90 : : };
91 : :
92 : : // This class has all the settings for the HTML-export autopilot
93 : 0 : class SdPublishingDesign
94 : : {
95 : : public:
96 : : String m_aDesignName;
97 : :
98 : : HtmlPublishMode m_eMode;
99 : :
100 : : // special WebCast options
101 : : PublishingScript m_eScript;
102 : : String m_aCGI;
103 : : String m_aURL;
104 : :
105 : : // special Kiosk options
106 : : sal_Bool m_bAutoSlide;
107 : : sal_uInt32 m_nSlideDuration;
108 : : sal_Bool m_bEndless;
109 : :
110 : : // special HTML options
111 : : sal_Bool m_bContentPage;
112 : : sal_Bool m_bNotes;
113 : :
114 : : // misc options
115 : : sal_uInt16 m_nResolution;
116 : : String m_aCompression;
117 : : PublishingFormat m_eFormat;
118 : : sal_Bool m_bSlideSound;
119 : : sal_Bool m_bHiddenSlides;
120 : :
121 : : // titel page information
122 : : String m_aAuthor;
123 : : String m_aEMail;
124 : : String m_aWWW;
125 : : String m_aMisc;
126 : : sal_Bool m_bDownload;
127 : : sal_Bool m_bCreated; // not used
128 : :
129 : : // buttons and colorscheme
130 : : sal_Int16 m_nButtonThema;
131 : : sal_Bool m_bUserAttr;
132 : : Color m_aBackColor;
133 : : Color m_aTextColor;
134 : : Color m_aLinkColor;
135 : : Color m_aVLinkColor;
136 : : Color m_aALinkColor;
137 : : sal_Bool m_bUseAttribs;
138 : : sal_Bool m_bUseColor;
139 : :
140 : : SdPublishingDesign();
141 : :
142 : : int operator ==(const SdPublishingDesign & rDesign) const;
143 : : friend SvStream& operator >> (SvStream& rIn, SdPublishingDesign& rDesign);
144 : : friend SvStream& operator << (SvStream& rOut, const SdPublishingDesign& rDesign);
145 : : };
146 : :
147 : : // load Default-settings
148 : 0 : SdPublishingDesign::SdPublishingDesign()
149 : : {
150 : 0 : m_eMode = PUBLISH_HTML;
151 : 0 : m_bContentPage = sal_True;
152 : 0 : m_bNotes = sal_True;
153 : :
154 : 0 : m_eFormat = FORMAT_PNG;
155 : :
156 : 0 : String aFilterConfigPath( "Office.Common/Filter/Graphic/Export/JPG" );
157 : 0 : FilterConfigItem aFilterConfigItem( aFilterConfigPath );
158 : 0 : sal_Int32 nCompression = aFilterConfigItem.ReadInt32( OUString( KEY_QUALITY ), 75 );
159 : 0 : m_aCompression = UniString::CreateFromInt32( nCompression );
160 : 0 : m_aCompression.Append( sal_Unicode('%') );
161 : :
162 : 0 : SvtUserOptions aUserOptions;
163 : :
164 : 0 : m_nResolution = PUB_LOWRES_WIDTH;
165 : 0 : m_aAuthor = aUserOptions.GetFirstName();
166 : 0 : if( m_aAuthor.Len() && !aUserOptions.GetLastName().isEmpty() )
167 : 0 : m_aAuthor += sal_Unicode(' ');
168 : 0 : m_aAuthor += (String)aUserOptions.GetLastName();
169 : 0 : m_aEMail = aUserOptions.GetEmail();
170 : 0 : m_bDownload = sal_False;
171 : 0 : m_nButtonThema = -1;
172 : :
173 : 0 : m_bUserAttr = sal_False;
174 : 0 : m_bUseAttribs = sal_True;
175 : 0 : m_bUseColor = sal_True;
176 : :
177 : 0 : m_aBackColor = COL_WHITE;
178 : 0 : m_aTextColor = COL_BLACK;
179 : 0 : m_aLinkColor = COL_BLUE;
180 : 0 : m_aVLinkColor = COL_LIGHTBLUE;
181 : 0 : m_aALinkColor = COL_GRAY;
182 : :
183 : 0 : m_eScript = SCRIPT_ASP;
184 : :
185 : 0 : m_bAutoSlide = sal_True;
186 : 0 : m_nSlideDuration = 15;
187 : 0 : m_bEndless = sal_True;
188 : :
189 : 0 : m_bSlideSound = sal_True;
190 : 0 : m_bHiddenSlides = sal_False;
191 : 0 : }
192 : :
193 : : // Compares the values without paying attention to the name
194 : 0 : int SdPublishingDesign::operator ==(const SdPublishingDesign & rDesign) const
195 : : {
196 : : return
197 : : (
198 : : m_eMode == rDesign.m_eMode &&
199 : : m_nResolution == rDesign.m_nResolution &&
200 : 0 : m_aCompression == rDesign.m_aCompression &&
201 : : m_eFormat == rDesign.m_eFormat &&
202 : : m_bHiddenSlides == rDesign.m_bHiddenSlides &&
203 : : ( // compare html options
204 : : (m_eMode != PUBLISH_HTML && m_eMode != PUBLISH_FRAMES) ||
205 : : (
206 : : m_bContentPage == rDesign.m_bContentPage &&
207 : : m_bNotes == rDesign.m_bNotes &&
208 : 0 : m_aAuthor == rDesign.m_aAuthor &&
209 : 0 : m_aEMail == rDesign.m_aEMail &&
210 : 0 : m_aWWW == rDesign.m_aWWW &&
211 : 0 : m_aMisc == rDesign.m_aMisc &&
212 : : m_bDownload == rDesign.m_bDownload &&
213 : : m_nButtonThema == rDesign.m_nButtonThema &&
214 : : m_bUserAttr == rDesign.m_bUserAttr &&
215 : 0 : m_aBackColor == rDesign.m_aBackColor &&
216 : 0 : m_aTextColor == rDesign.m_aTextColor &&
217 : 0 : m_aLinkColor == rDesign.m_aLinkColor &&
218 : 0 : m_aVLinkColor == rDesign.m_aVLinkColor &&
219 : 0 : m_aALinkColor == rDesign.m_aALinkColor &&
220 : : m_bUseAttribs == rDesign.m_bUseAttribs &&
221 : : m_bSlideSound == rDesign.m_bSlideSound &&
222 : : m_bUseColor == rDesign.m_bUseColor
223 : : )
224 : : ) &&
225 : : ( // compare kiosk options
226 : : (m_eMode != PUBLISH_KIOSK) ||
227 : : (
228 : : m_bAutoSlide == rDesign.m_bAutoSlide &&
229 : : m_bSlideSound == rDesign.m_bSlideSound &&
230 : : (
231 : 0 : !m_bAutoSlide ||
232 : : (
233 : : m_nSlideDuration == rDesign.m_nSlideDuration &&
234 : : m_bEndless == rDesign.m_bEndless
235 : : )
236 : : )
237 : : )
238 : : ) &&
239 : : ( // compare WebCast options
240 : : (m_eMode != PUBLISH_WEBCAST) ||
241 : : (
242 : : m_eScript == rDesign.m_eScript &&
243 : : (
244 : : m_eScript != SCRIPT_PERL ||
245 : : (
246 : 0 : m_aURL == rDesign.m_aURL &&
247 : 0 : m_aCGI == rDesign.m_aCGI
248 : : )
249 : : )
250 : : )
251 : : )
252 : 0 : );
253 : : }
254 : :
255 : : // Load the design from the stream
256 : 0 : SvStream& operator >> (SvStream& rIn, SdPublishingDesign& rDesign)
257 : : {
258 : 0 : SdIOCompat aIO(rIn, STREAM_READ);
259 : :
260 : : sal_uInt16 nTemp16;
261 : :
262 : : rDesign.m_aDesignName = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIn,
263 : 0 : RTL_TEXTENCODING_UTF8);
264 : 0 : rIn >> nTemp16;
265 : 0 : rDesign.m_eMode = (HtmlPublishMode)nTemp16;
266 : 0 : rIn >> rDesign.m_bContentPage;
267 : 0 : rIn >> rDesign.m_bNotes;
268 : 0 : rIn >> rDesign.m_nResolution;
269 : : rDesign.m_aCompression = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIn,
270 : 0 : RTL_TEXTENCODING_UTF8);
271 : 0 : rIn >> nTemp16;
272 : 0 : rDesign.m_eFormat = (PublishingFormat)nTemp16;
273 : : rDesign.m_aAuthor = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIn,
274 : 0 : RTL_TEXTENCODING_UTF8);
275 : : rDesign.m_aEMail = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIn,
276 : 0 : RTL_TEXTENCODING_UTF8);
277 : : rDesign.m_aWWW = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIn,
278 : 0 : RTL_TEXTENCODING_UTF8);
279 : : rDesign.m_aMisc = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIn,
280 : 0 : RTL_TEXTENCODING_UTF8);
281 : 0 : rIn >> rDesign.m_bDownload;
282 : 0 : rIn >> rDesign.m_bCreated; // not used
283 : 0 : rIn >> rDesign.m_nButtonThema;
284 : 0 : rIn >> rDesign.m_bUserAttr;
285 : 0 : rIn >> rDesign.m_aBackColor;
286 : 0 : rIn >> rDesign.m_aTextColor;
287 : 0 : rIn >> rDesign.m_aLinkColor;
288 : 0 : rIn >> rDesign.m_aVLinkColor;
289 : 0 : rIn >> rDesign.m_aALinkColor;
290 : 0 : rIn >> rDesign.m_bUseAttribs;
291 : 0 : rIn >> rDesign.m_bUseColor;
292 : :
293 : 0 : rIn >> nTemp16;
294 : 0 : rDesign.m_eScript = (PublishingScript)nTemp16;
295 : : rDesign.m_aURL = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIn,
296 : 0 : RTL_TEXTENCODING_UTF8);
297 : : rDesign.m_aCGI = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIn,
298 : 0 : RTL_TEXTENCODING_UTF8);
299 : :
300 : 0 : rIn >> rDesign.m_bAutoSlide;
301 : 0 : rIn >> rDesign.m_nSlideDuration;
302 : 0 : rIn >> rDesign.m_bEndless;
303 : 0 : rIn >> rDesign.m_bSlideSound;
304 : 0 : rIn >> rDesign.m_bHiddenSlides;
305 : :
306 : 0 : return rIn;
307 : : }
308 : :
309 : : // Set the design to the stream
310 : 0 : SvStream& operator << (SvStream& rOut, const SdPublishingDesign& rDesign)
311 : : {
312 : : // The last parameter is the versionnumber of the code
313 : 0 : SdIOCompat aIO(rOut, STREAM_WRITE, 0);
314 : :
315 : : // Name
316 : : write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOut, rDesign.m_aDesignName,
317 : 0 : RTL_TEXTENCODING_UTF8);
318 : :
319 : 0 : rOut << (sal_uInt16)rDesign.m_eMode;
320 : 0 : rOut << rDesign.m_bContentPage;
321 : 0 : rOut << rDesign.m_bNotes;
322 : 0 : rOut << rDesign.m_nResolution;
323 : : write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOut, rDesign.m_aCompression,
324 : 0 : RTL_TEXTENCODING_UTF8);
325 : 0 : rOut << (sal_uInt16)rDesign.m_eFormat;
326 : : write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOut, rDesign.m_aAuthor,
327 : 0 : RTL_TEXTENCODING_UTF8);
328 : : write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOut, rDesign.m_aEMail,
329 : 0 : RTL_TEXTENCODING_UTF8);
330 : : write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOut, rDesign.m_aWWW,
331 : 0 : RTL_TEXTENCODING_UTF8);
332 : : write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOut, rDesign.m_aMisc,
333 : 0 : RTL_TEXTENCODING_UTF8);
334 : 0 : rOut << rDesign.m_bDownload;
335 : 0 : rOut << rDesign.m_bCreated; // not used
336 : 0 : rOut << rDesign.m_nButtonThema;
337 : 0 : rOut << rDesign.m_bUserAttr;
338 : 0 : rOut << rDesign.m_aBackColor;
339 : 0 : rOut << rDesign.m_aTextColor;
340 : 0 : rOut << rDesign.m_aLinkColor;
341 : 0 : rOut << rDesign.m_aVLinkColor;
342 : 0 : rOut << rDesign.m_aALinkColor;
343 : 0 : rOut << rDesign.m_bUseAttribs;
344 : 0 : rOut << rDesign.m_bUseColor;
345 : :
346 : 0 : rOut << (sal_uInt16)rDesign.m_eScript;
347 : : write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOut, rDesign.m_aURL,
348 : 0 : RTL_TEXTENCODING_UTF8);
349 : : write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOut, rDesign.m_aCGI,
350 : 0 : RTL_TEXTENCODING_UTF8);
351 : :
352 : 0 : rOut << rDesign.m_bAutoSlide;
353 : 0 : rOut << rDesign.m_nSlideDuration;
354 : 0 : rOut << rDesign.m_bEndless;
355 : 0 : rOut << rDesign.m_bSlideSound;
356 : 0 : rOut << rDesign.m_bHiddenSlides;
357 : :
358 : 0 : return rOut;
359 : : }
360 : :
361 : : // Dialog for the entry of the name of the design
362 : 0 : class SdDesignNameDlg : public ModalDialog
363 : : {
364 : : private:
365 : : Edit m_aEdit;
366 : : OKButton m_aBtnOK;
367 : : CancelButton m_aBtnCancel;
368 : :
369 : : public:
370 : : SdDesignNameDlg(Window* pWindow, const String& aName );
371 : :
372 : : String GetDesignName();
373 : : DECL_LINK(ModifyHdl, void *);
374 : : };
375 : :
376 : : // SdPublishingDlg Methods
377 : :
378 : 0 : SdPublishingDlg::SdPublishingDlg(Window* pWindow, DocumentType eDocType)
379 : : : ModalDialog(pWindow, SdResId( DLG_PUBLISHING ))
380 : 0 : , mpButtonSet( new ButtonSet() )
381 : : , aBottomLine( this, SdResId( BOTTOM_LINE ) )
382 : : , aHelpButton(this,SdResId(BUT_HELP))
383 : : , aCancelButton(this,SdResId(BUT_CANCEL))
384 : : , aLastPageButton(this,SdResId(BUT_LAST))
385 : : , aNextPageButton(this,SdResId(BUT_NEXT))
386 : : , aFinishButton(this,SdResId(BUT_FINISH))
387 : : , aAssistentFunc(NOOFPAGES)
388 : : , m_bButtonsDirty(sal_True)
389 : : , m_bDesignListDirty(sal_False)
390 : 0 : , m_pDesign(NULL)
391 : : {
392 : 0 : m_bImpress = eDocType == DOCUMENT_TYPE_IMPRESS;
393 : :
394 : 0 : CreatePages();
395 : 0 : Load();
396 : :
397 : : //setzt die Ausgangsseite
398 : 0 : aAssistentFunc.GotoPage(1);
399 : 0 : aLastPageButton.Disable();
400 : :
401 : : //Buttonbelegung
402 : 0 : aFinishButton.SetClickHdl(LINK(this,SdPublishingDlg,FinishHdl));
403 : 0 : aLastPageButton.SetClickHdl(LINK(this,SdPublishingDlg,LastPageHdl));
404 : 0 : aNextPageButton.SetClickHdl(LINK(this,SdPublishingDlg,NextPageHdl));
405 : :
406 : 0 : pPage1_NewDesign->SetClickHdl(LINK(this,SdPublishingDlg,DesignHdl));
407 : 0 : pPage1_OldDesign->SetClickHdl(LINK(this,SdPublishingDlg,DesignHdl));
408 : 0 : pPage1_Designs->SetSelectHdl(LINK(this,SdPublishingDlg,DesignSelectHdl));
409 : 0 : pPage1_DelDesign->SetClickHdl(LINK(this,SdPublishingDlg,DesignDeleteHdl));
410 : :
411 : 0 : pPage2_Standard->SetClickHdl(LINK(this,SdPublishingDlg,BaseHdl));
412 : 0 : pPage2_Standard_FB->SetBorderStyle(WINDOW_BORDER_MONO);
413 : 0 : pPage2_Frames->SetClickHdl(LINK(this,SdPublishingDlg,BaseHdl));
414 : 0 : pPage2_Frames_FB->SetBorderStyle(WINDOW_BORDER_MONO);
415 : 0 : pPage2_Kiosk->SetClickHdl(LINK(this,SdPublishingDlg,BaseHdl));
416 : 0 : pPage2_Kiosk_FB->SetBorderStyle(WINDOW_BORDER_MONO);
417 : 0 : pPage2_WebCast->SetClickHdl(LINK(this,SdPublishingDlg,BaseHdl));
418 : 0 : pPage2_WebCast_FB->SetBorderStyle(WINDOW_BORDER_MONO);
419 : :
420 : 0 : pPage2_Content->SetClickHdl(LINK(this,SdPublishingDlg,ContentHdl));
421 : :
422 : 0 : pPage2_ASP->SetClickHdl(LINK(this,SdPublishingDlg,WebServerHdl));
423 : 0 : pPage2_PERL->SetClickHdl(LINK(this,SdPublishingDlg,WebServerHdl));
424 : 0 : String aText( OUString("index") );
425 : 0 : aText += String(SdResId(STR_HTMLEXP_DEFAULT_EXTENSION));
426 : 0 : pPage2_Index->SetText(aText);
427 : 0 : pPage2_CGI->SetText( OUString( "/cgi-bin/" ) );
428 : :
429 : 0 : pPage3_Png->SetClickHdl(LINK(this,SdPublishingDlg, GfxFormatHdl));
430 : 0 : pPage3_Gif->SetClickHdl(LINK(this,SdPublishingDlg, GfxFormatHdl));
431 : 0 : pPage3_Jpg->SetClickHdl(LINK(this,SdPublishingDlg, GfxFormatHdl));
432 : 0 : pPage3_Quality->Enable(sal_False);
433 : :
434 : 0 : pPage3_Resolution_1->SetClickHdl(LINK(this,SdPublishingDlg, ResolutionHdl ));
435 : 0 : pPage3_Resolution_2->SetClickHdl(LINK(this,SdPublishingDlg, ResolutionHdl ));
436 : 0 : pPage3_Resolution_3->SetClickHdl(LINK(this,SdPublishingDlg, ResolutionHdl ));
437 : :
438 : 0 : pPage2_ChgDefault->SetClickHdl(LINK(this,SdPublishingDlg, SlideChgHdl));
439 : 0 : pPage2_ChgAuto->SetClickHdl(LINK(this,SdPublishingDlg, SlideChgHdl));
440 : 0 : pPage2_Duration->SetFormat( TIMEF_SEC );
441 : :
442 : 0 : pPage5_Buttons->SetSelectHdl(LINK(this,SdPublishingDlg, ButtonsHdl ));
443 : 0 : pPage5_Buttons->SetStyle( pPage5_Buttons->GetStyle() | WB_VSCROLL );
444 : :
445 : 0 : pPage6_Back->SetClickHdl(LINK(this,SdPublishingDlg, ColorHdl ));
446 : 0 : pPage6_Text->SetClickHdl(LINK(this,SdPublishingDlg, ColorHdl ));
447 : 0 : pPage6_Link->SetClickHdl(LINK(this,SdPublishingDlg, ColorHdl ));
448 : 0 : pPage6_VLink->SetClickHdl(LINK(this,SdPublishingDlg, ColorHdl ));
449 : 0 : pPage6_ALink->SetClickHdl(LINK(this,SdPublishingDlg, ColorHdl ));
450 : :
451 : 0 : pPage6_DocColors->Check();
452 : :
453 : 0 : FreeResource();
454 : :
455 : 0 : pPage3_Quality->InsertEntry( OUString( "25%" ) );
456 : 0 : pPage3_Quality->InsertEntry( OUString( "50%" ) );
457 : 0 : pPage3_Quality->InsertEntry( OUString( "75%" ) );
458 : 0 : pPage3_Quality->InsertEntry( OUString( "100%" ) );
459 : :
460 : 0 : pPage5_Buttons->SetColCount( 1 );
461 : 0 : pPage5_Buttons->SetLineCount( 4 );
462 : 0 : pPage5_Buttons->SetExtraSpacing( 1 );
463 : :
464 : 0 : boost::ptr_vector<SdPublishingDesign>::iterator it;
465 : 0 : for( it = m_aDesignList.begin(); it != m_aDesignList.end(); ++it )
466 : 0 : pPage1_Designs->InsertEntry(it->m_aDesignName);
467 : :
468 : 0 : pPage6_Preview->SetBorderStyle(WINDOW_BORDER_MONO);
469 : :
470 : 0 : SetDefaults();
471 : :
472 : 0 : SetHelpId(aPageHelpIds[0]);
473 : :
474 : 0 : aNextPageButton.GrabFocus();
475 : 0 : }
476 : :
477 : 0 : SdPublishingDlg::~SdPublishingDlg()
478 : : {
479 : 0 : RemovePages();
480 : 0 : }
481 : :
482 : : // Generate dialog controls and embed them in the pages
483 : 0 : void SdPublishingDlg::CreatePages()
484 : : {
485 : : // Page 1
486 : : aAssistentFunc.InsertControl(1,
487 : 0 : pPage1_Titel = new FixedLine(this,SdResId(PAGE1_TITEL)));
488 : : aAssistentFunc.InsertControl(1,
489 : 0 : pPage1_NewDesign = new RadioButton(this,SdResId(PAGE1_NEW_DESIGN)));
490 : : aAssistentFunc.InsertControl(1,
491 : 0 : pPage1_OldDesign = new RadioButton(this,SdResId(PAGE1_OLD_DESIGN)));
492 : : aAssistentFunc.InsertControl(1,
493 : 0 : pPage1_Designs = new ListBox(this,SdResId(PAGE1_DESIGNS)));
494 : : aAssistentFunc.InsertControl(1,
495 : 0 : pPage1_DelDesign = new PushButton(this,SdResId(PAGE1_DEL_DESIGN)));
496 : : aAssistentFunc.InsertControl(1,
497 : 0 : pPage1_Desc = new FixedText(this,SdResId(PAGE1_DESC)));
498 : :
499 : :
500 : : // Page 2
501 : : aAssistentFunc.InsertControl(2,
502 : 0 : pPage2_Titel = new FixedLine(this,SdResId(PAGE2_TITEL )));
503 : : aAssistentFunc.InsertControl(2,
504 : 0 : pPage2_Standard = new RadioButton(this,SdResId(PAGE2_STANDARD)));
505 : : aAssistentFunc.InsertControl(2,
506 : 0 : pPage2_Frames = new RadioButton(this,SdResId(PAGE2_FRAMES)));
507 : : aAssistentFunc.InsertControl(2,
508 : 0 : pPage2_Kiosk = new RadioButton(this,SdResId(PAGE2_KIOSK)));
509 : : aAssistentFunc.InsertControl(2,
510 : 0 : pPage2_WebCast = new RadioButton(this,SdResId(PAGE2_WEBCAST)));
511 : : aAssistentFunc.InsertControl(2,
512 : 0 : pPage2_Standard_FB = new FixedBitmap(this,SdResId(PAGE2_NOFRAMES_FB)));
513 : : aAssistentFunc.InsertControl(2,
514 : 0 : pPage2_Frames_FB = new FixedBitmap(this,SdResId(PAGE2_FRAMES_FB)));
515 : : aAssistentFunc.InsertControl(2,
516 : 0 : pPage2_Kiosk_FB = new FixedBitmap(this,SdResId(PAGE2_KIOSK_FB)));
517 : : aAssistentFunc.InsertControl(2,
518 : 0 : pPage2_WebCast_FB = new FixedBitmap(this,SdResId(PAGE2_WEBCAST_FB)));
519 : :
520 : : aAssistentFunc.InsertControl(2,
521 : 0 : pPage2_Titel_Html = new FixedLine(this,SdResId(PAGE2_TITEL_HTML)));
522 : : aAssistentFunc.InsertControl(2,
523 : 0 : pPage2_Content = new CheckBox(this,SdResId(PAGE2_CONTENT)));
524 : 0 : if(m_bImpress)
525 : : aAssistentFunc.InsertControl(2,
526 : 0 : pPage2_Notes = new CheckBox(this,SdResId(PAGE2_NOTES)));
527 : :
528 : : aAssistentFunc.InsertControl(2,
529 : 0 : pPage2_Titel_WebCast = new FixedLine(this,SdResId(PAGE2_TITEL_WEBCAST)));
530 : : aAssistentFunc.InsertControl(2,
531 : 0 : pPage2_Index_txt = new FixedText(this,SdResId(PAGE2_INDEX_TXT)));
532 : : aAssistentFunc.InsertControl(2,
533 : 0 : pPage2_Index = new Edit(this,SdResId(PAGE2_INDEX)));
534 : : aAssistentFunc.InsertControl(2,
535 : 0 : pPage2_ASP = new RadioButton(this,SdResId(PAGE2_ASP)));
536 : : aAssistentFunc.InsertControl(2,
537 : 0 : pPage2_PERL = new RadioButton(this,SdResId(PAGE2_PERL)));
538 : : aAssistentFunc.InsertControl(2,
539 : 0 : pPage2_URL_txt = new FixedText(this,SdResId(PAGE2_URL_TXT)));
540 : : aAssistentFunc.InsertControl(2,
541 : 0 : pPage2_URL = new Edit(this,SdResId(PAGE2_URL)));
542 : : aAssistentFunc.InsertControl(2,
543 : 0 : pPage2_CGI_txt = new FixedText(this,SdResId(PAGE2_CGI_TXT)));
544 : : aAssistentFunc.InsertControl(2,
545 : 0 : pPage2_CGI = new Edit(this,SdResId(PAGE2_CGI)));
546 : : aAssistentFunc.InsertControl(2,
547 : 0 : pPage2_Vert = new FixedLine( this,SdResId( PAGE2_VERT )));
548 : : aAssistentFunc.InsertControl(2,
549 : 0 : pPage2_Titel_Kiosk = new FixedLine(this,SdResId(PAGE2_TITEL_KIOSK)));
550 : : aAssistentFunc.InsertControl(2,
551 : 0 : pPage2_ChgDefault = new RadioButton(this,SdResId(PAGE2_CHG_DEFAULT)));
552 : : aAssistentFunc.InsertControl(2,
553 : 0 : pPage2_ChgAuto = new RadioButton(this,SdResId(PAGE2_CHG_AUTO)));
554 : : aAssistentFunc.InsertControl(2,
555 : 0 : pPage2_Duration_txt = new FixedText(this,SdResId(PAGE2_DURATION_TXT)));
556 : : aAssistentFunc.InsertControl(2,
557 : 0 : pPage2_Duration = new TimeField(this,SdResId(PAGE2_DURATION_TMF)));
558 : : aAssistentFunc.InsertControl(2,
559 : 0 : pPage2_Endless = new CheckBox(this,SdResId(PAGE2_ENDLESS)));
560 : :
561 : : // Page 3
562 : : aAssistentFunc.InsertControl(3,
563 : 0 : pPage3_Titel1 = new FixedLine(this,SdResId(PAGE3_TITEL_1)));
564 : : aAssistentFunc.InsertControl(3,
565 : 0 : pPage3_Png = new RadioButton(this,SdResId(PAGE3_PNG)));
566 : : aAssistentFunc.InsertControl(3,
567 : 0 : pPage3_Gif = new RadioButton(this,SdResId(PAGE3_GIF)));
568 : : aAssistentFunc.InsertControl(3,
569 : 0 : pPage3_Jpg = new RadioButton(this,SdResId(PAGE3_JPG)));
570 : : aAssistentFunc.InsertControl(3,
571 : 0 : pPage3_Quality_txt = new FixedText(this,SdResId(PAGE3_QUALITY_TXT)));
572 : : aAssistentFunc.InsertControl(3,
573 : 0 : pPage3_Quality = new ComboBox(this,SdResId(PAGE3_QUALITY)));
574 : : aAssistentFunc.InsertControl(3,
575 : 0 : pPage3_Vert = new FixedLine( this,SdResId( PAGE3_VERT )));
576 : : aAssistentFunc.InsertControl(3,
577 : 0 : pPage3_Titel2 = new FixedLine(this,SdResId(PAGE3_TITEL_2)));
578 : : aAssistentFunc.InsertControl(3,
579 : 0 : pPage3_Resolution_1 = new RadioButton(this,SdResId(PAGE3_RESOLUTION_1)));
580 : : aAssistentFunc.InsertControl(3,
581 : 0 : pPage3_Resolution_2 = new RadioButton(this,SdResId(PAGE3_RESOLUTION_2)));
582 : : aAssistentFunc.InsertControl(3,
583 : 0 : pPage3_Resolution_3 = new RadioButton(this,SdResId(PAGE3_RESOLUTION_3)));
584 : : aAssistentFunc.InsertControl(3,
585 : 0 : pPage3_Titel3 = new FixedLine(this,SdResId(PAGE3_TITEL_3)));
586 : : aAssistentFunc.InsertControl(3,
587 : 0 : pPage3_SldSound = new CheckBox(this,SdResId(PAGE3_SLD_SOUND)));
588 : : aAssistentFunc.InsertControl(3,
589 : 0 : pPage3_HiddenSlides = new CheckBox(this,SdResId(PAGE3_HIDDEN_SLIDES)));
590 : :
591 : : // Page 4
592 : : aAssistentFunc.InsertControl(4,
593 : 0 : pPage4_Titel1 = new FixedLine(this,SdResId(PAGE4_TITEL_1)));
594 : : aAssistentFunc.InsertControl(4,
595 : 0 : pPage4_Author_txt = new FixedText(this,SdResId(PAGE4_AUTHOR_TXT)));
596 : : aAssistentFunc.InsertControl(4,
597 : 0 : pPage4_Author = new Edit(this,SdResId(PAGE4_AUTHOR)));
598 : : aAssistentFunc.InsertControl(4,
599 : 0 : pPage4_Email_txt = new FixedText(this,SdResId(PAGE4_EMAIL_TXT)));
600 : : aAssistentFunc.InsertControl(4,
601 : 0 : pPage4_Email = new Edit(this,SdResId(PAGE4_EMAIL_EDIT)));
602 : : aAssistentFunc.InsertControl(4,
603 : 0 : pPage4_WWW_txt = new FixedText(this,SdResId(PAGE4_WWW_TXT)));
604 : : aAssistentFunc.InsertControl(4,
605 : 0 : pPage4_WWW = new Edit(this,SdResId(PAGE4_WWW_EDIT)));
606 : : aAssistentFunc.InsertControl(4,
607 : 0 : pPage4_Titel2 = new FixedText(this,SdResId(PAGE4_TITEL_2)));
608 : : aAssistentFunc.InsertControl(4,
609 : 0 : pPage4_Misc = new MultiLineEdit(this,SdResId(PAGE4_MISC)));
610 : 0 : if(m_bImpress)
611 : : aAssistentFunc.InsertControl(4,
612 : 0 : pPage4_Download = new CheckBox(this,SdResId(PAGE4_DOWNLOAD)));
613 : :
614 : : // Page 5
615 : : aAssistentFunc.InsertControl(5,
616 : 0 : pPage5_Titel = new FixedLine(this,SdResId(PAGE5_TITEL)));
617 : : aAssistentFunc.InsertControl(5,
618 : 0 : pPage5_TextOnly = new CheckBox(this, SdResId(PAGE5_TEXTONLY)));
619 : : aAssistentFunc.InsertControl(5,
620 : 0 : pPage5_Buttons = new ValueSet(this,SdResId(PAGE5_BUTTONS)));
621 : :
622 : : // Page 6
623 : : aAssistentFunc.InsertControl(6,
624 : 0 : pPage6_Titel = new FixedLine(this,SdResId(PAGE6_TITEL)));
625 : : aAssistentFunc.InsertControl(6,
626 : 0 : pPage6_DocColors = new RadioButton(this,SdResId(PAGE6_DOCCOLORS)));
627 : : aAssistentFunc.InsertControl(6,
628 : 0 : pPage6_Default = new RadioButton(this,SdResId(PAGE6_DEFAULT)));
629 : : aAssistentFunc.InsertControl(6,
630 : 0 : pPage6_User = new RadioButton(this,SdResId(PAGE6_USER)));
631 : : aAssistentFunc.InsertControl(6,
632 : 0 : pPage6_Text = new PushButton(this,SdResId(PAGE6_TEXT)));
633 : : aAssistentFunc.InsertControl(6,
634 : 0 : pPage6_Link = new PushButton(this,SdResId(PAGE6_LINK)));
635 : : aAssistentFunc.InsertControl(6,
636 : 0 : pPage6_ALink = new PushButton(this,SdResId(PAGE6_ALINK)));
637 : : aAssistentFunc.InsertControl(6,
638 : 0 : pPage6_VLink = new PushButton(this,SdResId(PAGE6_VLINK)));
639 : : aAssistentFunc.InsertControl(6,
640 : 0 : pPage6_Back = new PushButton(this,SdResId(PAGE6_BACK)));
641 : : aAssistentFunc.InsertControl(6,
642 : 0 : pPage6_Preview = new SdHtmlAttrPreview(this,SdResId(PAGE6_PREVIEW)));
643 : :
644 : 0 : InterpolateFixedBitmap(pPage2_Standard_FB);
645 : 0 : InterpolateFixedBitmap(pPage2_Frames_FB);
646 : 0 : InterpolateFixedBitmap(pPage2_Kiosk_FB);
647 : 0 : InterpolateFixedBitmap(pPage2_WebCast_FB);
648 : 0 : }
649 : :
650 : : // Delete the controls of the dialog
651 : 0 : void SdPublishingDlg::RemovePages()
652 : : {
653 : 0 : delete pPage1_Titel;
654 : 0 : delete pPage1_NewDesign;
655 : 0 : delete pPage1_OldDesign;
656 : 0 : delete pPage1_Designs;
657 : 0 : delete pPage1_DelDesign;
658 : 0 : delete pPage1_Desc;
659 : :
660 : 0 : delete pPage2_Titel;
661 : 0 : delete pPage2_Standard;
662 : 0 : delete pPage2_Frames;
663 : 0 : delete pPage2_Kiosk;
664 : 0 : delete pPage2_WebCast;
665 : 0 : delete pPage2_Standard_FB;
666 : 0 : delete pPage2_Frames_FB;
667 : 0 : delete pPage2_Kiosk_FB;
668 : 0 : delete pPage2_WebCast_FB;
669 : :
670 : 0 : delete pPage2_Titel_Html;
671 : 0 : delete pPage2_Content;
672 : 0 : if(m_bImpress)
673 : 0 : delete pPage2_Notes;
674 : :
675 : 0 : delete pPage2_Vert;
676 : 0 : delete pPage2_Titel_WebCast;
677 : 0 : delete pPage2_Index_txt;
678 : 0 : delete pPage2_Index;
679 : 0 : delete pPage2_ASP;
680 : 0 : delete pPage2_PERL;
681 : 0 : delete pPage2_URL_txt;
682 : 0 : delete pPage2_URL;
683 : 0 : delete pPage2_CGI_txt;
684 : 0 : delete pPage2_CGI;
685 : :
686 : 0 : delete pPage2_Titel_Kiosk;
687 : 0 : delete pPage2_ChgDefault;
688 : 0 : delete pPage2_ChgAuto;
689 : 0 : delete pPage2_Duration_txt;
690 : 0 : delete pPage2_Duration;
691 : 0 : delete pPage2_Endless;
692 : :
693 : 0 : delete pPage3_Titel1;
694 : 0 : delete pPage3_Png;
695 : 0 : delete pPage3_Gif;
696 : 0 : delete pPage3_Jpg;
697 : 0 : delete pPage3_Quality_txt;
698 : 0 : delete pPage3_Quality;
699 : 0 : delete pPage3_Vert;
700 : 0 : delete pPage3_Titel2;
701 : 0 : delete pPage3_Resolution_1;
702 : 0 : delete pPage3_Resolution_2;
703 : 0 : delete pPage3_Resolution_3;
704 : 0 : delete pPage3_Titel3;
705 : 0 : delete pPage3_SldSound;
706 : 0 : delete pPage3_HiddenSlides;
707 : :
708 : 0 : delete pPage4_Titel1;
709 : 0 : delete pPage4_Author_txt;
710 : 0 : delete pPage4_Author;
711 : 0 : delete pPage4_Email_txt;
712 : 0 : delete pPage4_Email;
713 : 0 : delete pPage4_WWW_txt;
714 : 0 : delete pPage4_WWW;
715 : 0 : delete pPage4_Titel2;
716 : 0 : delete pPage4_Misc;
717 : 0 : if(m_bImpress)
718 : 0 : delete pPage4_Download;
719 : :
720 : 0 : delete pPage5_Titel;
721 : 0 : delete pPage5_TextOnly;
722 : 0 : delete pPage5_Buttons;
723 : :
724 : 0 : delete pPage6_Titel;
725 : 0 : delete pPage6_Default;
726 : 0 : delete pPage6_User;
727 : 0 : delete pPage6_Back;
728 : 0 : delete pPage6_Text;
729 : 0 : delete pPage6_Link;
730 : 0 : delete pPage6_VLink;
731 : 0 : delete pPage6_ALink;
732 : 0 : delete pPage6_DocColors;
733 : 0 : delete pPage6_Preview;
734 : 0 : }
735 : :
736 : : // Initialize dialog with default-values
737 : 0 : void SdPublishingDlg::SetDefaults()
738 : : {
739 : 0 : SdPublishingDesign aDefault;
740 : 0 : SetDesign(&aDefault);
741 : :
742 : 0 : pPage1_NewDesign->Check(sal_True);
743 : 0 : pPage1_OldDesign->Check(sal_False);
744 : 0 : UpdatePage();
745 : 0 : }
746 : :
747 : : // Feed the SfxItemSet with the settings of the dialog
748 : 0 : void SdPublishingDlg::GetParameterSequence( Sequence< PropertyValue >& rParams )
749 : : {
750 : 0 : std::vector< PropertyValue > aProps;
751 : :
752 : 0 : PropertyValue aValue;
753 : :
754 : :
755 : : // Page 2
756 : 0 : aValue.Name = "PublishMode";
757 : 0 : aValue.Value <<= (sal_Int32)(pPage2_Standard->IsChecked()?PUBLISH_HTML:
758 : 0 : pPage2_Frames->IsChecked()?PUBLISH_FRAMES:
759 : 0 : pPage2_Kiosk->IsChecked()?PUBLISH_KIOSK:PUBLISH_WEBCAST);
760 : 0 : aProps.push_back( aValue );
761 : :
762 : 0 : aValue.Name = "IsExportContentsPage";
763 : 0 : aValue.Value <<= (sal_Bool)pPage2_Content->IsChecked();
764 : 0 : aProps.push_back( aValue );
765 : :
766 : 0 : if(m_bImpress)
767 : : {
768 : 0 : aValue.Name = "IsExportNotes";
769 : 0 : aValue.Value <<= (sal_Bool)pPage2_Notes->IsChecked();
770 : 0 : aProps.push_back( aValue );
771 : : }
772 : :
773 : 0 : if( pPage2_WebCast->IsChecked() )
774 : : {
775 : 0 : aValue.Name = "WebCastScriptLanguage";
776 : 0 : if( pPage2_ASP->IsChecked() )
777 : 0 : aValue.Value <<= OUString( "asp" );
778 : : else
779 : 0 : aValue.Value <<= OUString( "perl" );
780 : 0 : aProps.push_back( aValue );
781 : :
782 : 0 : aValue.Name = "WebCastCGIURL";
783 : 0 : aValue.Value <<= OUString( pPage2_CGI->GetText() );
784 : 0 : aProps.push_back( aValue );
785 : :
786 : 0 : aValue.Name = "WebCastTargetURL";
787 : 0 : aValue.Value <<= OUString( pPage2_URL->GetText() );
788 : 0 : aProps.push_back( aValue );
789 : : }
790 : 0 : aValue.Name = "IndexURL";
791 : 0 : aValue.Value <<= OUString( pPage2_Index->GetText() );
792 : 0 : aProps.push_back( aValue );
793 : :
794 : :
795 : 0 : if( pPage2_Kiosk->IsChecked() && pPage2_ChgAuto->IsChecked() )
796 : : {
797 : 0 : aValue.Name = "KioskSlideDuration";
798 : 0 : aValue.Value <<= (sal_uInt32)pPage2_Duration->GetTime().GetMSFromTime() / 1000;
799 : 0 : aProps.push_back( aValue );
800 : :
801 : 0 : aValue.Name = "KioskEndless";
802 : 0 : aValue.Value <<= (sal_Bool)pPage2_Endless->IsChecked();
803 : 0 : aProps.push_back( aValue );
804 : : }
805 : :
806 : : // Page 3
807 : :
808 : 0 : aValue.Name = "Width";
809 : 0 : sal_Int32 nTmpWidth = 512;
810 : 0 : if( pPage3_Resolution_2->IsChecked() )
811 : 0 : nTmpWidth = 640;
812 : 0 : else if( pPage3_Resolution_3->IsChecked() )
813 : 0 : nTmpWidth = 800;
814 : :
815 : 0 : aValue.Value <<= nTmpWidth;
816 : 0 : aProps.push_back( aValue );
817 : :
818 : 0 : aValue.Name = "Compression";
819 : 0 : aValue.Value <<= OUString( pPage3_Quality->GetText() );
820 : 0 : aProps.push_back( aValue );
821 : :
822 : 0 : aValue.Name = "Format";
823 : : sal_Int32 nFormat;
824 : 0 : if( pPage3_Png->IsChecked() )
825 : 0 : nFormat = static_cast<sal_Int32>(FORMAT_PNG);
826 : 0 : else if( pPage3_Gif->IsChecked() )
827 : 0 : nFormat = static_cast<sal_Int32>(FORMAT_GIF);
828 : : else
829 : 0 : nFormat = static_cast<sal_Int32>(FORMAT_JPG);
830 : 0 : aValue.Value <<= nFormat;
831 : 0 : aProps.push_back( aValue );
832 : :
833 : 0 : aValue.Name = "SlideSound";
834 : 0 : aValue.Value <<= pPage3_SldSound->IsChecked() ? sal_True : sal_False;
835 : 0 : aProps.push_back( aValue );
836 : :
837 : 0 : aValue.Name = "HiddenSlides";
838 : 0 : aValue.Value <<= pPage3_HiddenSlides->IsChecked() ? sal_True : sal_False;
839 : 0 : aProps.push_back( aValue );
840 : :
841 : : // Page 4
842 : 0 : aValue.Name = "Author";
843 : 0 : aValue.Value <<= OUString( pPage4_Author->GetText() );
844 : 0 : aProps.push_back( aValue );
845 : :
846 : 0 : aValue.Name = "EMail";
847 : 0 : aValue.Value <<= OUString( pPage4_Email->GetText() );
848 : 0 : aProps.push_back( aValue );
849 : :
850 : : // try to guess protocol for user's homepage
851 : 0 : INetURLObject aHomeURL( pPage4_WWW->GetText(),
852 : : INET_PROT_HTTP, // default proto is HTTP
853 : 0 : INetURLObject::ENCODE_ALL );
854 : :
855 : 0 : aValue.Name = "HomepageURL";
856 : 0 : aValue.Value <<= OUString( aHomeURL.GetMainURL( INetURLObject::NO_DECODE ) );
857 : 0 : aProps.push_back( aValue );
858 : :
859 : 0 : aValue.Name = "UserText";
860 : 0 : aValue.Value <<= OUString( pPage4_Misc->GetText() );
861 : 0 : aProps.push_back( aValue );
862 : :
863 : 0 : if( m_bImpress )
864 : : {
865 : 0 : aValue.Name = "EnableDownload";
866 : 0 : aValue.Value <<= (sal_Bool)pPage4_Download->IsChecked();
867 : 0 : aProps.push_back( aValue );
868 : : }
869 : :
870 : : // Page 5
871 : 0 : if( !pPage5_TextOnly->IsChecked() )
872 : : {
873 : 0 : aValue.Name = "UseButtonSet";
874 : 0 : aValue.Value <<= (sal_Int32)(pPage5_Buttons->GetSelectItemId() - 1);
875 : 0 : aProps.push_back( aValue );
876 : : }
877 : :
878 : : // Page 6
879 : 0 : if( pPage6_User->IsChecked() )
880 : : {
881 : 0 : aValue.Name = "BackColor";
882 : 0 : aValue.Value <<= (sal_Int32)m_aBackColor.GetColor();
883 : 0 : aProps.push_back( aValue );
884 : :
885 : 0 : aValue.Name = "TextColor";
886 : 0 : aValue.Value <<= (sal_Int32)m_aTextColor.GetColor();
887 : 0 : aProps.push_back( aValue );
888 : :
889 : 0 : aValue.Name = "LinkColor";
890 : 0 : aValue.Value <<= (sal_Int32)m_aLinkColor.GetColor();
891 : 0 : aProps.push_back( aValue );
892 : :
893 : 0 : aValue.Name = "VLinkColor";
894 : 0 : aValue.Value <<= (sal_Int32)m_aVLinkColor.GetColor();
895 : 0 : aProps.push_back( aValue );
896 : :
897 : 0 : aValue.Name = "ALinkColor";
898 : 0 : aValue.Value <<= (sal_Int32)m_aALinkColor.GetColor();
899 : 0 : aProps.push_back( aValue );
900 : : }
901 : :
902 : 0 : if( pPage6_DocColors->IsChecked() )
903 : : {
904 : 0 : aValue.Name = "IsUseDocumentColors";
905 : 0 : aValue.Value <<= (sal_Bool)sal_True;
906 : 0 : aProps.push_back( aValue );
907 : : }
908 : :
909 : 0 : rParams.realloc( aProps.size() );
910 : 0 : PropertyValue* pParams = rParams.getArray();
911 : :
912 : 0 : for( std::vector< PropertyValue >::iterator i = aProps.begin(); i != aProps.end(); ++i )
913 : : {
914 : 0 : *pParams++ = (*i);
915 : 0 : }
916 : 0 : }
917 : :
918 : : // Clickhandler for the radiobuttons of the design-selection
919 : 0 : IMPL_LINK( SdPublishingDlg, DesignHdl, RadioButton *, pButton )
920 : : {
921 : 0 : if(pButton == pPage1_NewDesign)
922 : : {
923 : 0 : pPage1_NewDesign->Check(sal_True); // because of DesignDeleteHdl
924 : 0 : pPage1_OldDesign->Check(sal_False);
925 : 0 : pPage1_Designs->Disable();
926 : 0 : pPage1_DelDesign->Disable();
927 : 0 : m_pDesign = NULL;
928 : :
929 : 0 : SdPublishingDesign aDefault;
930 : 0 : SetDesign(&aDefault);
931 : : }
932 : : else
933 : : {
934 : 0 : pPage1_NewDesign->Check(sal_False);
935 : 0 : pPage1_Designs->Enable();
936 : 0 : pPage1_DelDesign->Enable();
937 : :
938 : 0 : if(pPage1_Designs->GetSelectEntryCount() == 0)
939 : 0 : pPage1_Designs->SelectEntryPos(0);
940 : :
941 : 0 : sal_uInt16 nPos = pPage1_Designs->GetSelectEntryPos();
942 : 0 : m_pDesign = &m_aDesignList[nPos];
943 : : DBG_ASSERT(m_pDesign, "No Design? That's not allowed (CL)");
944 : :
945 : 0 : if(m_pDesign)
946 : 0 : SetDesign(m_pDesign);
947 : : }
948 : :
949 : 0 : return 0;
950 : : }
951 : :
952 : : // Clickhandler for the choise of one design
953 : 0 : IMPL_LINK_NOARG(SdPublishingDlg, DesignSelectHdl)
954 : : {
955 : 0 : sal_uInt16 nPos = pPage1_Designs->GetSelectEntryPos();
956 : 0 : m_pDesign = &m_aDesignList[nPos];
957 : : DBG_ASSERT(m_pDesign, "No Design? That's not allowed (CL)");
958 : :
959 : 0 : if(m_pDesign)
960 : 0 : SetDesign(m_pDesign);
961 : :
962 : 0 : UpdatePage();
963 : :
964 : 0 : return 0;
965 : : }
966 : :
967 : : // Clickhandler for the delete of one design
968 : 0 : IMPL_LINK_NOARG(SdPublishingDlg, DesignDeleteHdl)
969 : : {
970 : 0 : sal_uInt16 nPos = pPage1_Designs->GetSelectEntryPos();
971 : :
972 : 0 : boost::ptr_vector<SdPublishingDesign>::iterator iter = m_aDesignList.begin()+nPos;
973 : :
974 : : DBG_ASSERT(iter != m_aDesignList.end(), "No Design? That's not allowed (CL)");
975 : :
976 : 0 : pPage1_Designs->RemoveEntry(nPos);
977 : :
978 : 0 : if(m_pDesign == &(*iter))
979 : 0 : DesignHdl( pPage1_NewDesign );
980 : :
981 : 0 : m_aDesignList.erase(iter);
982 : :
983 : 0 : m_bDesignListDirty = sal_True;
984 : :
985 : 0 : UpdatePage();
986 : :
987 : 0 : return 0;
988 : : }
989 : :
990 : : // Clickhandler for the other servertypess
991 : 0 : IMPL_LINK( SdPublishingDlg, WebServerHdl, RadioButton *, pButton )
992 : : {
993 : 0 : sal_Bool bASP = pButton == pPage2_ASP;
994 : :
995 : 0 : pPage2_ASP->Check( bASP );
996 : 0 : pPage2_PERL->Check( !bASP );
997 : 0 : UpdatePage();
998 : :
999 : 0 : return 0;
1000 : : }
1001 : :
1002 : : // Clickhandler for the Radiobuttons of the graphicformat choice
1003 : 0 : IMPL_LINK( SdPublishingDlg, GfxFormatHdl, RadioButton *, pButton )
1004 : : {
1005 : 0 : pPage3_Png->Check( pButton == pPage3_Png );
1006 : 0 : pPage3_Gif->Check( pButton == pPage3_Gif );
1007 : 0 : pPage3_Jpg->Check( pButton == pPage3_Jpg );
1008 : 0 : pPage3_Quality->Enable(pButton == pPage3_Jpg);
1009 : 0 : return 0;
1010 : : }
1011 : :
1012 : : // Clickhandler for the Radiobuttons Standard/Frames
1013 : 0 : IMPL_LINK_NOARG(SdPublishingDlg, BaseHdl)
1014 : : {
1015 : 0 : UpdatePage();
1016 : :
1017 : 0 : return 0;
1018 : : }
1019 : :
1020 : : // Clickhandler for the Checkbox of the Title page
1021 : 0 : IMPL_LINK_NOARG(SdPublishingDlg, ContentHdl)
1022 : : {
1023 : 0 : if(pPage2_Content->IsChecked())
1024 : : {
1025 : 0 : if(!aAssistentFunc.IsEnabled(4))
1026 : : {
1027 : 0 : aAssistentFunc.EnablePage(4);
1028 : 0 : UpdatePage();
1029 : : }
1030 : : }
1031 : : else
1032 : : {
1033 : 0 : if(aAssistentFunc.IsEnabled(4))
1034 : : {
1035 : 0 : aAssistentFunc.DisablePage(4);
1036 : 0 : UpdatePage();
1037 : : }
1038 : : }
1039 : 0 : return 0;
1040 : : }
1041 : :
1042 : : // Clickhandler for the Resolution Radiobuttons
1043 : 0 : IMPL_LINK( SdPublishingDlg, ResolutionHdl, RadioButton *, pButton )
1044 : : {
1045 : 0 : pPage3_Resolution_1->Check(pButton == pPage3_Resolution_1);
1046 : 0 : pPage3_Resolution_2->Check(pButton == pPage3_Resolution_2);
1047 : 0 : pPage3_Resolution_3->Check(pButton == pPage3_Resolution_3);
1048 : :
1049 : 0 : return 0;
1050 : : }
1051 : :
1052 : : // Clickhandler for the ValueSet with the bitmap-buttons
1053 : 0 : IMPL_LINK_NOARG(SdPublishingDlg, ButtonsHdl)
1054 : : {
1055 : : // if one bitmap-button is chosen, then disable TextOnly
1056 : 0 : pPage5_TextOnly->Check(sal_False);
1057 : 0 : return 0;
1058 : : }
1059 : :
1060 : : // Fill the SfxItemSet with the settings of the dialog
1061 : 0 : IMPL_LINK( SdPublishingDlg, ColorHdl, PushButton *, pButton)
1062 : : {
1063 : 0 : SvColorDialog aDlg(this);
1064 : :
1065 : 0 : if(pButton == pPage6_Back)
1066 : : {
1067 : 0 : aDlg.SetColor( m_aBackColor );
1068 : 0 : if(aDlg.Execute() == RET_OK )
1069 : 0 : m_aBackColor = aDlg.GetColor();
1070 : : }
1071 : 0 : else if(pButton == pPage6_Text)
1072 : : {
1073 : 0 : aDlg.SetColor( m_aTextColor );
1074 : 0 : if(aDlg.Execute() == RET_OK )
1075 : 0 : m_aTextColor = aDlg.GetColor();
1076 : : }
1077 : 0 : else if(pButton == pPage6_Link)
1078 : : {
1079 : 0 : aDlg.SetColor( m_aLinkColor );
1080 : 0 : if(aDlg.Execute() == RET_OK )
1081 : 0 : m_aLinkColor = aDlg.GetColor();
1082 : : }
1083 : 0 : else if(pButton == pPage6_VLink)
1084 : : {
1085 : 0 : aDlg.SetColor( m_aVLinkColor );
1086 : 0 : if(aDlg.Execute() == RET_OK )
1087 : 0 : m_aVLinkColor = aDlg.GetColor();
1088 : : }
1089 : 0 : else if(pButton == pPage6_ALink)
1090 : : {
1091 : 0 : aDlg.SetColor( m_aALinkColor );
1092 : 0 : if(aDlg.Execute() == RET_OK )
1093 : 0 : m_aALinkColor = aDlg.GetColor();
1094 : : }
1095 : :
1096 : 0 : pPage6_User->Check(sal_True);
1097 : : pPage6_Preview->SetColors( m_aBackColor, m_aTextColor, m_aLinkColor,
1098 : 0 : m_aVLinkColor, m_aALinkColor );
1099 : 0 : pPage6_Preview->Invalidate();
1100 : 0 : return 0;
1101 : : }
1102 : :
1103 : 0 : IMPL_LINK_NOARG(SdPublishingDlg, SlideChgHdl)
1104 : : {
1105 : 0 : UpdatePage();
1106 : 0 : return 0;
1107 : : }
1108 : :
1109 : : // Clickhandler for the Ok Button
1110 : 0 : IMPL_LINK_NOARG(SdPublishingDlg, FinishHdl)
1111 : : {
1112 : : //End
1113 : 0 : SdPublishingDesign* pDesign = new SdPublishingDesign();
1114 : 0 : GetDesign(pDesign);
1115 : :
1116 : 0 : sal_Bool bSave = sal_False;
1117 : :
1118 : 0 : if(pPage1_OldDesign->IsChecked() && m_pDesign)
1119 : : {
1120 : : // are there changes?
1121 : 0 : if(!(*pDesign == *m_pDesign))
1122 : 0 : bSave = sal_True;
1123 : : }
1124 : : else
1125 : : {
1126 : 0 : SdPublishingDesign aDefaultDesign;
1127 : 0 : if(!(aDefaultDesign == *pDesign))
1128 : 0 : bSave = sal_True;
1129 : : }
1130 : :
1131 : 0 : if(bSave)
1132 : : {
1133 : 0 : String aName;
1134 : 0 : if(m_pDesign)
1135 : 0 : aName = m_pDesign->m_aDesignName;
1136 : :
1137 : : sal_Bool bRetry;
1138 : 0 : do
1139 : : {
1140 : 0 : bRetry = sal_False;
1141 : :
1142 : 0 : SdDesignNameDlg aDlg(this, aName );
1143 : :
1144 : 0 : if ( aDlg.Execute() == RET_OK )
1145 : : {
1146 : 0 : pDesign->m_aDesignName = aDlg.GetDesignName();
1147 : :
1148 : 0 : boost::ptr_vector<SdPublishingDesign>::iterator iter;
1149 : 0 : for (iter = m_aDesignList.begin(); iter != m_aDesignList.end(); ++iter)
1150 : : {
1151 : 0 : if (iter->m_aDesignName == pDesign->m_aDesignName)
1152 : 0 : break;
1153 : : }
1154 : :
1155 : 0 : if (iter != m_aDesignList.end())
1156 : : {
1157 : : ErrorBox aErrorBox(this, WB_YES_NO,
1158 : 0 : String(SdResId(STR_PUBDLG_SAMENAME)));
1159 : 0 : bRetry = aErrorBox.Execute() == RET_NO;
1160 : :
1161 : 0 : if(!bRetry)
1162 : 0 : m_aDesignList.erase(iter);
1163 : : }
1164 : :
1165 : 0 : if(!bRetry)
1166 : : {
1167 : 0 : m_aDesignList.push_back(pDesign);
1168 : 0 : m_bDesignListDirty = sal_True;
1169 : 0 : pDesign = NULL;
1170 : : }
1171 : 0 : }
1172 : : }
1173 : 0 : while(bRetry);
1174 : : }
1175 : :
1176 : 0 : delete pDesign;
1177 : :
1178 : 0 : if(m_bDesignListDirty)
1179 : 0 : Save();
1180 : :
1181 : 0 : EndDialog(RET_OK);
1182 : 0 : return 0;
1183 : : }
1184 : :
1185 : : // Refresh the dialogs when changing from pages
1186 : 0 : void SdPublishingDlg::ChangePage()
1187 : : {
1188 : 0 : int nPage = aAssistentFunc.GetCurrentPage();
1189 : 0 : SetHelpId(aPageHelpIds[nPage-1]);
1190 : :
1191 : 0 : UpdatePage();
1192 : :
1193 : 0 : if( aNextPageButton.IsEnabled() )
1194 : 0 : aNextPageButton.GrabFocus();
1195 : : else
1196 : 0 : aFinishButton.GrabFocus();
1197 : 0 : }
1198 : :
1199 : 0 : void SdPublishingDlg::UpdatePage()
1200 : : {
1201 : 0 : aNextPageButton.Enable(!aAssistentFunc.IsLastPage());
1202 : 0 : aLastPageButton.Enable(!aAssistentFunc.IsFirstPage());
1203 : :
1204 : 0 : int nPage = aAssistentFunc.GetCurrentPage();
1205 : :
1206 : 0 : switch( nPage )
1207 : : {
1208 : : case 1:
1209 : 0 : if(pPage1_NewDesign->IsChecked())
1210 : : {
1211 : 0 : pPage1_Designs->Disable();
1212 : 0 : pPage1_DelDesign->Disable();
1213 : : }
1214 : :
1215 : 0 : if(m_aDesignList.empty())
1216 : 0 : pPage1_OldDesign->Disable();
1217 : 0 : break;
1218 : : case 2:
1219 : 0 : pPage2_Frames_FB->Show(pPage2_Frames->IsChecked());
1220 : 0 : pPage2_Standard_FB->Show(pPage2_Standard->IsChecked());
1221 : 0 : pPage2_Kiosk_FB->Show(pPage2_Kiosk->IsChecked());
1222 : 0 : pPage2_WebCast_FB->Show(pPage2_WebCast->IsChecked());
1223 : :
1224 : 0 : if( pPage2_WebCast->IsChecked() )
1225 : : {
1226 : 0 : pPage2_Titel_WebCast->Show();
1227 : 0 : pPage2_ASP->Show();
1228 : 0 : pPage2_PERL->Show();
1229 : 0 : pPage2_URL_txt->Show();
1230 : 0 : pPage2_URL->Show();
1231 : 0 : pPage2_CGI_txt->Show();
1232 : 0 : pPage2_CGI->Show();
1233 : 0 : pPage2_Index_txt->Show();
1234 : 0 : pPage2_Index->Show();
1235 : :
1236 : 0 : sal_Bool bPerl = pPage2_PERL->IsChecked();
1237 : 0 : pPage2_Index->Enable(bPerl);
1238 : 0 : pPage2_Index_txt->Enable(bPerl);
1239 : 0 : pPage2_URL_txt->Enable(bPerl);
1240 : 0 : pPage2_URL->Enable(bPerl);
1241 : 0 : pPage2_CGI_txt->Enable(bPerl);
1242 : 0 : pPage2_CGI->Enable(bPerl);
1243 : : }
1244 : : else
1245 : : {
1246 : 0 : pPage2_Titel_WebCast->Hide();
1247 : 0 : pPage2_ASP->Hide();
1248 : 0 : pPage2_PERL->Hide();
1249 : 0 : pPage2_URL_txt->Hide();
1250 : 0 : pPage2_URL->Hide();
1251 : 0 : pPage2_CGI_txt->Hide();
1252 : 0 : pPage2_CGI->Hide();
1253 : 0 : pPage2_Index->Hide();
1254 : 0 : pPage2_Index_txt->Hide();
1255 : : }
1256 : :
1257 : 0 : if( pPage2_Kiosk->IsChecked() )
1258 : : {
1259 : 0 : pPage2_Titel_Kiosk->Show();
1260 : 0 : pPage2_ChgDefault->Show();
1261 : 0 : pPage2_ChgAuto->Show();
1262 : 0 : pPage2_Duration_txt->Show();
1263 : 0 : pPage2_Duration->Show();
1264 : 0 : pPage2_Endless->Show();
1265 : 0 : sal_Bool bAuto = pPage2_ChgAuto->IsChecked();
1266 : 0 : pPage2_Duration->Enable(bAuto);
1267 : 0 : pPage2_Endless->Enable(bAuto);
1268 : : }
1269 : : else
1270 : : {
1271 : 0 : pPage2_Titel_Kiosk->Hide();
1272 : 0 : pPage2_ChgDefault->Hide();
1273 : 0 : pPage2_ChgAuto->Hide();
1274 : 0 : pPage2_Duration->Hide();
1275 : 0 : pPage2_Duration_txt->Hide();
1276 : 0 : pPage2_Endless->Hide();
1277 : : }
1278 : :
1279 : 0 : if( pPage2_Standard->IsChecked() || pPage2_Frames->IsChecked() )
1280 : : {
1281 : 0 : pPage2_Titel_Html->Show();
1282 : 0 : pPage2_Content->Show();
1283 : 0 : if(m_bImpress)
1284 : 0 : pPage2_Notes->Show();
1285 : : }
1286 : : else
1287 : : {
1288 : 0 : pPage2_Titel_Html->Hide();
1289 : 0 : pPage2_Content->Hide();
1290 : 0 : if(m_bImpress)
1291 : 0 : pPage2_Notes->Hide();
1292 : : }
1293 : 0 : break;
1294 : : case 3:
1295 : 0 : if( pPage2_Kiosk->IsChecked() || pPage2_WebCast->IsChecked() )
1296 : 0 : aNextPageButton.Disable();
1297 : :
1298 : 0 : if( pPage2_WebCast->IsChecked() )
1299 : 0 : pPage3_SldSound->Disable();
1300 : :
1301 : 0 : pPage3_Quality->Enable(pPage3_Jpg->IsChecked());
1302 : :
1303 : 0 : break;
1304 : : case 5:
1305 : 0 : if( m_bButtonsDirty )
1306 : 0 : LoadPreviewButtons();
1307 : 0 : break;
1308 : : }
1309 : 0 : }
1310 : :
1311 : : /** loads the html buttons from the button sets, creates a preview and fills the
1312 : : itemset for page 5
1313 : : */
1314 : 0 : void SdPublishingDlg::LoadPreviewButtons()
1315 : : {
1316 : 0 : if( mpButtonSet.get() )
1317 : : {
1318 : 0 : const int nButtonCount = 8;
1319 : : static const char *pButtonNames[nButtonCount] =
1320 : : {
1321 : : "first.png",
1322 : : "left.png",
1323 : : "right.png",
1324 : : "last.png",
1325 : : "home.png",
1326 : : "text.png",
1327 : : "expand.png",
1328 : : "collapse.png",
1329 : : };
1330 : :
1331 : 0 : std::vector< rtl::OUString > aButtonNames;
1332 : 0 : for( int i = 0; i < nButtonCount; ++i )
1333 : 0 : aButtonNames.push_back( rtl::OUString::createFromAscii( pButtonNames[i] ) );
1334 : :
1335 : 0 : int nSetCount = mpButtonSet->getCount();
1336 : :
1337 : 0 : int nHeight = 32;
1338 : 0 : Image aImage;
1339 : 0 : for( int nSet = 0; nSet < nSetCount; ++nSet )
1340 : : {
1341 : 0 : if( mpButtonSet->getPreview( nSet, aButtonNames, aImage ) )
1342 : : {
1343 : 0 : pPage5_Buttons->InsertItem( (sal_uInt16)nSet+1, aImage );
1344 : 0 : if( nHeight < aImage.GetSizePixel().Height() )
1345 : 0 : nHeight = aImage.GetSizePixel().Height();
1346 : : }
1347 : : }
1348 : :
1349 : 0 : pPage5_Buttons->SetItemHeight( nHeight );
1350 : 0 : m_bButtonsDirty = sal_False;
1351 : : }
1352 : 0 : }
1353 : :
1354 : : // Clickhandler for the Forward Button
1355 : 0 : IMPL_LINK_NOARG(SdPublishingDlg, NextPageHdl)
1356 : : {
1357 : 0 : aAssistentFunc.NextPage();
1358 : 0 : ChangePage();
1359 : 0 : return 0;
1360 : : }
1361 : :
1362 : : // Sets the Controlls in the dialog to the settings in the design
1363 : 0 : void SdPublishingDlg::SetDesign( SdPublishingDesign* pDesign )
1364 : : {
1365 : 0 : if(!pDesign)
1366 : 0 : return;
1367 : :
1368 : 0 : pPage2_Standard->Check(pDesign->m_eMode == PUBLISH_HTML);
1369 : 0 : pPage2_Frames->Check(pDesign->m_eMode == PUBLISH_FRAMES);
1370 : 0 : pPage2_Kiosk->Check(pDesign->m_eMode == PUBLISH_KIOSK );
1371 : 0 : pPage2_WebCast->Check(pDesign->m_eMode == PUBLISH_WEBCAST );
1372 : :
1373 : 0 : pPage2_Content->Check(pDesign->m_bContentPage);
1374 : 0 : if(pDesign->m_bContentPage)
1375 : 0 : aAssistentFunc.EnablePage(4);
1376 : : else
1377 : 0 : aAssistentFunc.DisablePage(4);
1378 : :
1379 : 0 : if(m_bImpress)
1380 : 0 : pPage2_Notes->Check(pDesign->m_bNotes);
1381 : :
1382 : 0 : pPage2_ASP->Check(pDesign->m_eScript == SCRIPT_ASP);
1383 : 0 : pPage2_PERL->Check(pDesign->m_eScript == SCRIPT_PERL);
1384 : 0 : pPage2_CGI->SetText(pDesign->m_aCGI);
1385 : 0 : pPage2_URL->SetText(pDesign->m_aURL);
1386 : :
1387 : 0 : pPage2_ChgDefault->Check( !pDesign->m_bAutoSlide );
1388 : 0 : pPage2_ChgAuto->Check( pDesign->m_bAutoSlide );
1389 : :
1390 : 0 : Time aTime( Time::EMPTY );
1391 : 0 : aTime.MakeTimeFromMS( pDesign->m_nSlideDuration * 1000 );
1392 : 0 : pPage2_Duration->SetTime( aTime );
1393 : :
1394 : 0 : pPage2_Endless->Check( pDesign->m_bEndless );
1395 : :
1396 : 0 : pPage3_Png->Check(pDesign->m_eFormat == FORMAT_PNG);
1397 : 0 : pPage3_Gif->Check(pDesign->m_eFormat == FORMAT_GIF);
1398 : 0 : pPage3_Jpg->Check(pDesign->m_eFormat == FORMAT_JPG);
1399 : 0 : pPage3_Quality->Enable(pDesign->m_eFormat == FORMAT_JPG);
1400 : :
1401 : 0 : pPage3_Quality->SetText(pDesign->m_aCompression);
1402 : 0 : pPage3_Resolution_1->Check(pDesign->m_nResolution == PUB_LOWRES_WIDTH);
1403 : 0 : pPage3_Resolution_2->Check(pDesign->m_nResolution == PUB_MEDRES_WIDTH);
1404 : 0 : pPage3_Resolution_3->Check(pDesign->m_nResolution == PUB_HIGHRES_WIDTH);
1405 : :
1406 : 0 : pPage3_SldSound->Check( pDesign->m_bSlideSound );
1407 : 0 : pPage3_HiddenSlides->Check( pDesign->m_bHiddenSlides );
1408 : :
1409 : 0 : pPage4_Author->SetText(pDesign->m_aAuthor);
1410 : 0 : pPage4_Email->SetText(pDesign->m_aEMail);
1411 : 0 : pPage4_WWW->SetText(pDesign->m_aWWW);
1412 : 0 : pPage4_Misc->SetText(pDesign->m_aMisc);
1413 : 0 : if(m_bImpress)
1414 : 0 : pPage4_Download->Check(pDesign->m_bDownload);
1415 : :
1416 : 0 : pPage5_TextOnly->Check(pDesign->m_nButtonThema == -1);
1417 : 0 : if(pDesign->m_nButtonThema != -1)
1418 : : {
1419 : 0 : if(m_bButtonsDirty)
1420 : 0 : LoadPreviewButtons();
1421 : 0 : pPage5_Buttons->SelectItem(pDesign->m_nButtonThema + 1);
1422 : : }
1423 : : else
1424 : 0 : pPage5_Buttons->SetNoSelection();
1425 : :
1426 : 0 : pPage6_User->Check(pDesign->m_bUserAttr);
1427 : 0 : m_aBackColor = pDesign->m_aBackColor;
1428 : 0 : m_aTextColor = pDesign->m_aTextColor;
1429 : 0 : m_aLinkColor = pDesign->m_aLinkColor;
1430 : 0 : m_aVLinkColor = pDesign->m_aVLinkColor;
1431 : 0 : m_aALinkColor = pDesign->m_aALinkColor;
1432 : :
1433 : 0 : pPage6_DocColors->Check(pDesign->m_bUseColor);
1434 : :
1435 : : pPage6_Preview->SetColors( m_aBackColor, m_aTextColor, m_aLinkColor,
1436 : 0 : m_aVLinkColor, m_aALinkColor );
1437 : 0 : pPage6_Preview->Invalidate();
1438 : :
1439 : 0 : UpdatePage();
1440 : : }
1441 : :
1442 : : // Transfer the status of the Design Dialog Controls
1443 : 0 : void SdPublishingDlg::GetDesign( SdPublishingDesign* pDesign )
1444 : : {
1445 : 0 : if(!pDesign)
1446 : 0 : return;
1447 : :
1448 : 0 : pDesign->m_eMode = pPage2_Standard->IsChecked()?PUBLISH_HTML:
1449 : 0 : pPage2_Frames->IsChecked()?PUBLISH_FRAMES:
1450 : 0 : pPage2_Kiosk->IsChecked()?PUBLISH_KIOSK:
1451 : 0 : PUBLISH_WEBCAST;
1452 : :
1453 : 0 : pDesign->m_bContentPage = pPage2_Content->IsChecked();
1454 : 0 : if(m_bImpress)
1455 : 0 : pDesign->m_bNotes = pPage2_Notes->IsChecked();
1456 : :
1457 : 0 : if( pPage3_Gif->IsChecked() )
1458 : 0 : pDesign->m_eFormat = FORMAT_GIF;
1459 : 0 : else if( pPage3_Jpg->IsChecked() )
1460 : 0 : pDesign->m_eFormat = FORMAT_JPG;
1461 : : else
1462 : 0 : pDesign->m_eFormat = FORMAT_PNG;
1463 : :
1464 : 0 : pDesign->m_aCompression = pPage3_Quality->GetText();
1465 : :
1466 : 0 : pDesign->m_nResolution = pPage3_Resolution_1->IsChecked()?PUB_LOWRES_WIDTH:
1467 : 0 : (pPage3_Resolution_2->IsChecked()?PUB_MEDRES_WIDTH:PUB_HIGHRES_WIDTH);
1468 : :
1469 : 0 : pDesign->m_bSlideSound = pPage3_SldSound->IsChecked();
1470 : 0 : pDesign->m_bHiddenSlides = pPage3_HiddenSlides->IsChecked();
1471 : :
1472 : 0 : pDesign->m_aAuthor = pPage4_Author->GetText();
1473 : 0 : pDesign->m_aEMail = pPage4_Email->GetText();
1474 : 0 : pDesign->m_aWWW = pPage4_WWW->GetText();
1475 : 0 : pDesign->m_aMisc = pPage4_Misc->GetText();
1476 : 0 : pDesign->m_bDownload = m_bImpress?pPage4_Download->IsChecked():sal_False;
1477 : :
1478 : 0 : if(pPage5_TextOnly->IsChecked())
1479 : 0 : pDesign->m_nButtonThema = -1;
1480 : : else
1481 : 0 : pDesign->m_nButtonThema = pPage5_Buttons->GetSelectItemId() - 1;
1482 : :
1483 : 0 : pDesign->m_bUserAttr = pPage6_User->IsChecked();
1484 : 0 : pDesign->m_aBackColor = m_aBackColor;
1485 : 0 : pDesign->m_aTextColor = m_aTextColor;
1486 : 0 : pDesign->m_aLinkColor = m_aLinkColor;
1487 : 0 : pDesign->m_aVLinkColor = m_aVLinkColor;
1488 : 0 : pDesign->m_aALinkColor = m_aALinkColor;
1489 : 0 : pDesign->m_bUseColor = pPage6_DocColors->IsChecked();
1490 : :
1491 : :
1492 : 0 : pDesign->m_eScript = pPage2_ASP->IsChecked()?SCRIPT_ASP:SCRIPT_PERL;
1493 : 0 : pDesign->m_aCGI = pPage2_CGI->GetText();
1494 : 0 : pDesign->m_aURL = pPage2_URL->GetText();
1495 : :
1496 : 0 : pDesign->m_bAutoSlide = pPage2_ChgAuto->IsChecked();
1497 : 0 : pDesign->m_nSlideDuration = (sal_uInt32)pPage2_Duration->GetTime().GetMSFromTime() / 1000;
1498 : 0 : pDesign->m_bEndless = pPage2_Endless->IsChecked();
1499 : : }
1500 : :
1501 : : // Clickhandler for the back Button
1502 : 0 : IMPL_LINK_NOARG(SdPublishingDlg, LastPageHdl)
1503 : : {
1504 : 0 : aAssistentFunc.PreviousPage();
1505 : 0 : ChangePage();
1506 : 0 : return 0;
1507 : : }
1508 : :
1509 : : // Load Designs
1510 : 0 : sal_Bool SdPublishingDlg::Load()
1511 : : {
1512 : 0 : m_bDesignListDirty = sal_False;
1513 : :
1514 : 0 : INetURLObject aURL( SvtPathOptions().GetUserConfigPath() );
1515 : 0 : aURL.Append( OUString( "designs.sod" ) );
1516 : :
1517 : : // check if file exists, SfxMedium shows an errorbox else
1518 : : {
1519 : 0 : com::sun::star::uno::Reference < com::sun::star::task::XInteractionHandler > xHandler;
1520 : 0 : SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ, xHandler );
1521 : :
1522 : 0 : sal_Bool bOk = pIStm && ( pIStm->GetError() == 0);
1523 : :
1524 : 0 : if( pIStm )
1525 : 0 : delete pIStm;
1526 : :
1527 : 0 : if( !bOk )
1528 : 0 : return sal_False;
1529 : : }
1530 : :
1531 : 0 : SfxMedium aMedium( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ | STREAM_NOCREATE );
1532 : :
1533 : 0 : SvStream* pStream = aMedium.GetInStream();
1534 : :
1535 : 0 : if( !pStream )
1536 : 0 : return( sal_False );
1537 : :
1538 : : sal_uInt16 aCheck;
1539 : 0 : *pStream >> aCheck;
1540 : :
1541 : 0 : if(aCheck != nMagic)
1542 : 0 : return sal_False;
1543 : :
1544 : 0 : SdIOCompat aIO(*pStream, STREAM_READ);
1545 : :
1546 : : sal_uInt16 nDesigns;
1547 : 0 : *pStream >> nDesigns;
1548 : :
1549 : 0 : for( sal_uInt16 nIndex = 0;
1550 : 0 : pStream->GetError() == SVSTREAM_OK && nIndex < nDesigns;
1551 : : nIndex++ )
1552 : : {
1553 : 0 : SdPublishingDesign* pDesign = new SdPublishingDesign();
1554 : 0 : *pStream >> *pDesign;
1555 : :
1556 : 0 : m_aDesignList.push_back(pDesign);
1557 : : }
1558 : :
1559 : 0 : return( pStream->GetError() == SVSTREAM_OK );
1560 : : }
1561 : :
1562 : : // Save Designs
1563 : 0 : sal_Bool SdPublishingDlg::Save()
1564 : : {
1565 : 0 : INetURLObject aURL( SvtPathOptions().GetUserConfigPath() );
1566 : 0 : aURL.Append( OUString( "designs.sod" ) );
1567 : 0 : SfxMedium aMedium( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE | STREAM_TRUNC );
1568 : 0 : aMedium.IsRemote();
1569 : :
1570 : 0 : SvStream* pStream = aMedium.GetOutStream();
1571 : :
1572 : 0 : if( !pStream )
1573 : 0 : return( sal_False );
1574 : :
1575 : 0 : sal_uInt16 aCheck = nMagic;
1576 : 0 : *pStream << aCheck;
1577 : :
1578 : : // Destroys the SdIOCompat before the Stream is being destributed
1579 : : {
1580 : 0 : SdIOCompat aIO(*pStream, STREAM_WRITE, 0);
1581 : :
1582 : 0 : sal_uInt16 nDesigns = (sal_uInt16) m_aDesignList.size();
1583 : 0 : *pStream << nDesigns;
1584 : :
1585 : 0 : for( sal_uInt16 nIndex = 0;
1586 : 0 : pStream->GetError() == SVSTREAM_OK && nIndex < nDesigns;
1587 : : nIndex++ )
1588 : 0 : *pStream << m_aDesignList[nIndex];
1589 : : }
1590 : :
1591 : 0 : aMedium.Close();
1592 : 0 : aMedium.Commit();
1593 : :
1594 : 0 : return( aMedium.GetError() == 0 );
1595 : : }
1596 : :
1597 : : // SdDesignNameDlg Methods
1598 : 0 : SdDesignNameDlg::SdDesignNameDlg(Window* pWindow, const String& aName):
1599 : : ModalDialog (pWindow, SdResId( DLG_DESIGNNAME )),
1600 : : m_aEdit (this, SdResId(EDT_NAME)),
1601 : : m_aBtnOK (this, SdResId(BTN_SAVE)),
1602 : 0 : m_aBtnCancel (this, SdResId(BTN_NOSAVE))
1603 : : {
1604 : 0 : FreeResource();
1605 : 0 : m_aEdit.SetModifyHdl(LINK(this, SdDesignNameDlg, ModifyHdl ));
1606 : 0 : m_aEdit.SetText(aName);
1607 : 0 : m_aBtnOK.Enable(aName.Len() != 0);
1608 : 0 : }
1609 : :
1610 : 0 : String SdDesignNameDlg::GetDesignName()
1611 : : {
1612 : 0 : return m_aEdit.GetText();
1613 : : }
1614 : :
1615 : 0 : IMPL_LINK_NOARG(SdDesignNameDlg, ModifyHdl)
1616 : : {
1617 : 0 : m_aBtnOK.Enable(m_aEdit.GetText().Len() != 0);
1618 : :
1619 : 0 : return 0;
1620 : : }
1621 : :
1622 : :
1623 : :
1624 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|