update dev300-m58
[ooovba.git] / filter / source / pdf / impdialog.hxx
blob0d19c7b93209a7f33cf3dc3d08bc202a38e0da59
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: impdialog.hxx,v $
10 * $Revision: 1.23.80.2 $
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 #ifndef IMPDIALOG_HXX
32 #define IMPDIALOG_HXX
34 #include "pdffilter.hxx"
36 #include "vcl/dialog.hxx"
37 #include "vcl/button.hxx"
38 #include "vcl/fixed.hxx"
39 #include "vcl/field.hxx"
40 #include "vcl/edit.hxx"
41 #include "vcl/lstbox.hxx"
42 #include "vcl/combobox.hxx"
43 #include "vcl/group.hxx"
44 #include "vcl/pdfwriter.hxx"
46 #include "svtools/FilterConfigItem.hxx"
48 #include "sfx2/tabdlg.hxx"
50 // ----------------
51 // - ImpPDFDialog -
52 // ----------------
54 class ResMgr;
55 class ImpPDFTabGeneralPage;
56 class ImpPDFTabViewerPage;
57 class ImpPDFTabOpnFtrPage;
58 class ImpPDFTabLinksPage;
60 class ImplErrorDialog : public ModalDialog
62 FixedImage maFI;
63 FixedText maProcessText;
64 ListBox maErrors;
65 FixedText maExplanation;
67 OKButton maButton;
69 DECL_LINK( SelectHdl, ListBox* );
70 public:
71 ImplErrorDialog( const std::set< vcl::PDFWriter::ErrorCode >&, ResMgr& rResMgr );
72 ~ImplErrorDialog();
75 ////////////////////////////////////////////////////////////////////////
76 //class tabbed dialog
77 class ImpPDFTabDialog : public SfxTabDialog
79 private:
80 com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > mxMSF;
81 FilterConfigItem maConfigItem;
82 FilterConfigItem maConfigI18N;
84 Any maSelection;
86 protected:
88 ResMgr* mprResMgr;
89 //the following data are the configuration used throughout the dialog and pages
90 sal_Bool mbIsPresentation;
91 sal_Bool mbIsWriter;
92 sal_Bool mbSelectionPresent;
93 sal_Bool mbUseCTLFont;
94 sal_Bool mbUseLosslessCompression;
95 sal_Int32 mnQuality;
96 sal_Bool mbReduceImageResolution;
97 sal_Int32 mnMaxImageResolution;
98 sal_Bool mbUseTaggedPDF;
99 sal_Int32 mnPDFTypeSelection;
100 sal_Bool mbExportNotesBoth;
101 sal_Bool mbUseTransitionEffects;
102 sal_Bool mbIsSkipEmptyPages;
103 sal_Bool mbAddStream;
104 sal_Int32 mnFormsType;
105 sal_Bool mbExportFormFields;
106 sal_Bool mbExportBookmarks;
107 sal_Int32 mnOpenBookmarkLevels;
109 sal_Bool mbHideViewerToolbar;
110 sal_Bool mbHideViewerMenubar;
111 sal_Bool mbHideViewerWindowControls;
112 sal_Bool mbResizeWinToInit;
113 sal_Bool mbCenterWindow;
114 sal_Bool mbOpenInFullScreenMode;
115 sal_Bool mbDisplayPDFDocumentTitle;
116 sal_Int32 mnMagnification;
117 sal_Int32 mnInitialView;
118 sal_Int32 mnZoom;
119 sal_Int32 mnInitialPage;
121 sal_Int32 mnPageLayout;
122 sal_Bool mbFirstPageLeft;
124 sal_Bool mbEncrypt;
125 String msUserPassword;
127 sal_Bool mbRestrictPermissions;
128 String msOwnerPassword;
129 sal_Int32 mnPrint;
130 sal_Int32 mnChangesAllowed;
131 sal_Bool mbCanCopyOrExtract;
132 sal_Bool mbCanExtractForAccessibility;
134 sal_Bool mbIsRangeChecked;
135 String msPageRange;
136 sal_Bool mbSelectionIsChecked;
138 sal_Bool mbExportRelativeFsysLinks;
139 sal_Int32 mnViewPDFMode;
140 sal_Bool mbConvertOOoTargets;
141 sal_Bool mbExportBmkToPDFDestination;
143 public:
145 friend class ImpPDFTabGeneralPage;
146 friend class ImpPDFTabViewerPage;
147 friend class ImpPDFTabOpnFtrPage;
148 friend class ImpPDFTabSecurityPage;
149 friend class ImpPDFTabLinksPage;
151 ImpPDFTabDialog( Window* pParent, ResMgr& rResMgr,
152 Sequence< PropertyValue >& rFilterData,
153 const Reference< XComponent >& rDoc,
154 const Reference< lang::XMultiServiceFactory >& xFact
156 ~ImpPDFTabDialog();
158 Sequence< PropertyValue > GetFilterData();
159 const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& getServiceFactory() const { return mxMSF; }
161 protected:
162 virtual void PageCreated( USHORT _nId,
163 SfxTabPage& _rPage );
164 virtual short Ok();
167 //class tab page general
168 class ImpPDFTabGeneralPage : public SfxTabPage
170 friend class ImpPDFTabLinksPage;
172 FixedLine maFlPages;
173 RadioButton maRbAll;
174 RadioButton maRbRange;
175 RadioButton maRbSelection;
176 Edit maEdPages;
178 FixedLine maFlCompression;
179 RadioButton maRbLosslessCompression;
180 RadioButton maRbJPEGCompression;
181 FixedText maFtQuality;
182 MetricField maNfQuality;
183 CheckBox maCbReduceImageResolution;
184 ComboBox maCoReduceImageResolution;
186 FixedLine maFlGeneral;
187 CheckBox maCbPDFA1b;
188 CheckBox maCbTaggedPDF;
189 sal_Bool mbTaggedPDFUserSelection;
191 CheckBox maCbExportFormFields;
192 sal_Bool mbExportFormFieldsUserSelection;
193 FixedText maFtFormsFormat;
194 ListBox maLbFormsFormat;
196 CheckBox maCbExportBookmarks;
197 CheckBox maCbExportNotes;
199 CheckBox maCbExportEmptyPages;
200 CheckBox maCbAddStream;
202 sal_Bool mbIsPresentation;
203 sal_Bool mbIsWriter;
205 ResMgr* mpaResMgr;
207 const ImpPDFTabDialog* mpaParent;
209 DECL_LINK( TogglePagesHdl, void* );
210 DECL_LINK( ToggleCompressionHdl, void* );
211 DECL_LINK( ToggleReduceImageResolutionHdl, void* );
212 DECL_LINK( ToggleAddStreamHdl, void* );
213 DECL_LINK( ToggleExportFormFieldsHdl, void* );
215 public:
216 DECL_LINK( ToggleExportPDFAHdl, void* );
218 ImpPDFTabGeneralPage( Window* pParent,
219 const SfxItemSet& rSet,
220 ResMgr* paResMgr );
222 ~ImpPDFTabGeneralPage();
223 static SfxTabPage* Create( Window* pParent,
224 const SfxItemSet& rAttrSet);
226 void GetFilterConfigItem( ImpPDFTabDialog* paParent );
227 void SetFilterConfigItem( const ImpPDFTabDialog* paParent );
228 sal_Bool IsPdfaSelected() { return maCbPDFA1b.IsChecked(); };
231 //class tab page viewer
232 class ImpPDFTabOpnFtrPage : public SfxTabPage
234 FixedLine maFlInitialView;
235 RadioButton maRbOpnPageOnly;
236 RadioButton maRbOpnOutline;
237 RadioButton maRbOpnThumbs;
238 FixedText maFtInitialPage;
239 NumericField maNumInitialPage;
241 FixedLine maFlMagnification;
242 RadioButton maRbMagnDefault;
243 RadioButton maRbMagnFitWin;
244 RadioButton maRbMagnFitWidth;
245 RadioButton maRbMagnFitVisible;
246 RadioButton maRbMagnZoom;
247 MetricField maNumZoom;
249 FixedLine maFlPageLayout;
250 RadioButton maRbPgLyDefault;
251 RadioButton maRbPgLySinglePage;
252 RadioButton maRbPgLyContinue;
253 RadioButton maRbPgLyContinueFacing;
254 CheckBox maCbPgLyFirstOnLeft;
256 sal_Bool mbUseCTLFont;
257 ResMgr* mpaResMgr;
259 DECL_LINK( ToggleRbPgLyContinueFacingHdl, void* );
260 DECL_LINK( ToggleRbMagnHdl, void* );
262 public:
263 ImpPDFTabOpnFtrPage( Window* pParent,
264 const SfxItemSet& rSet,
265 ResMgr* paResMgr );
267 ~ImpPDFTabOpnFtrPage();
268 static SfxTabPage* Create( Window* pParent,
269 const SfxItemSet& rAttrSet );
271 void GetFilterConfigItem( ImpPDFTabDialog* paParent);
272 void SetFilterConfigItem( const ImpPDFTabDialog* paParent );
275 //class tab page viewer
276 class ImpPDFTabViewerPage : public SfxTabPage
278 FixedLine maFlWindowOptions;
279 CheckBox maCbResWinInit;
280 CheckBox maCbCenterWindow;
281 CheckBox maCbOpenFullScreen;
282 CheckBox maCbDispDocTitle;
284 FixedLine maFlUIOptions;
285 CheckBox maCbHideViewerMenubar;
286 CheckBox maCbHideViewerToolbar;
287 CheckBox maCbHideViewerWindowControls;
289 FixedLine maFlTransitions;
290 CheckBox maCbTransitionEffects;
291 sal_Bool mbIsPresentation;
293 FixedLine maFlBookmarks;
294 RadioButton maRbAllBookmarkLevels;
295 RadioButton maRbVisibleBookmarkLevels;
296 NumericField maNumBookmarkLevels;
298 ResMgr* mpaResMgr;
300 DECL_LINK( ToggleRbBookmarksHdl, void* );
301 public:
302 ImpPDFTabViewerPage( Window* pParent,
303 const SfxItemSet& rSet,
304 ResMgr* paResMgr );
306 ~ImpPDFTabViewerPage();
307 static SfxTabPage* Create( Window* pParent,
308 const SfxItemSet& rAttrSet );
310 void GetFilterConfigItem( ImpPDFTabDialog* paParent);
311 void SetFilterConfigItem( const ImpPDFTabDialog* paParent );
314 //class security tab page
315 class ImpPDFTabSecurityPage : public SfxTabPage
317 PushButton maPbUserPwd;
318 FixedText maFtUserPwd;
319 String maUserPwdSet;
320 String maUserPwdUnset;
322 PushButton maPbOwnerPwd;
323 FixedText maFtOwnerPwd;
324 String maOwnerPwdSet;
325 String maOwnerPwdUnset;
327 FixedLine maFlPrintPermissions;
328 RadioButton maRbPrintNone;
329 RadioButton maRbPrintLowRes;
330 RadioButton maRbPrintHighRes;
332 FixedLine maFlChangesAllowed;
333 RadioButton maRbChangesNone;
334 RadioButton maRbChangesInsDel;
335 RadioButton maRbChangesFillForm;
336 RadioButton maRbChangesComment;
337 RadioButton maRbChangesAnyNoCopy;
339 CheckBox maCbEnableCopy;
340 CheckBox maCbEnableAccessibility;
342 String msUserPassword;
343 String msUserPwdTitle;
345 String msOwnerPassword;
346 String msOwnerPwdTitle;
348 ResMgr* mpaResMgr;
350 long nWidth;
352 DECL_LINK( ClickmaPbUserPwdHdl, void* );
353 DECL_LINK( ClickmaPbOwnerPwdHdl, void* );
355 void enablePermissionControls();
357 void ImplPwdPushButton( const String &, String & );
359 public:
360 ImpPDFTabSecurityPage( Window* pParent,
361 const SfxItemSet& rSet,
362 ResMgr* paResMgr );
364 ~ImpPDFTabSecurityPage();
365 static SfxTabPage* Create( Window* pParent,
366 const SfxItemSet& rAttrSet );
368 void GetFilterConfigItem( ImpPDFTabDialog* paParent);
369 void SetFilterConfigItem( const ImpPDFTabDialog* paParent );
370 void ImplPDFASecurityControl( sal_Bool bEnableSecurity );
373 //class to implement the relative link stuff
374 class ImpPDFTabLinksPage : public SfxTabPage
376 CheckBox maCbExprtBmkrToNmDst;
377 CheckBox maCbOOoToPDFTargets;
378 CheckBox maCbExportRelativeFsysLinks;
380 FixedLine maFlDefaultTitle;
381 RadioButton maRbOpnLnksDefault;
382 sal_Bool mbOpnLnksDefaultUserState;
383 RadioButton maRbOpnLnksLaunch;
384 sal_Bool mbOpnLnksLaunchUserState;
385 RadioButton maRbOpnLnksBrowser;
386 sal_Bool mbOpnLnksBrowserUserState;
388 ResMgr* mpaResMgr;
390 long nWidth;
392 DECL_LINK( ClickRbOpnLnksDefaultHdl, void* );
393 DECL_LINK( ClickRbOpnLnksBrowserHdl, void* );
395 public:
396 ImpPDFTabLinksPage( Window* pParent,
397 const SfxItemSet& rSet,
398 ResMgr& rResMgr );
400 ~ImpPDFTabLinksPage();
401 static SfxTabPage* Create( Window* pParent,
402 const SfxItemSet& rAttrSet );
404 void GetFilterConfigItem( ImpPDFTabDialog* paParent);
405 void SetFilterConfigItem( const ImpPDFTabDialog* paParent );
407 void ImplPDFALinkControl( sal_Bool bEnableLaunch );
410 #endif // IMPDIALOG_HXX