Lines 36-41
Link Here
|
36 |
#include "impdialog.hxx" |
36 |
#include "impdialog.hxx" |
37 |
#include "impdialog.hrc" |
37 |
#include "impdialog.hrc" |
38 |
|
38 |
|
|
|
39 |
#ifndef _SV_SVAPP_HXX |
40 |
#include <vcl/svapp.hxx> |
41 |
#endif |
42 |
|
43 |
#ifndef _SV_MSGBOX_HXX |
44 |
#include <vcl/msgbox.hxx> |
45 |
#endif |
46 |
|
39 |
#ifndef _COM_SUN_STAR_UNO_SEQUENCE_H_ |
47 |
#ifndef _COM_SUN_STAR_UNO_SEQUENCE_H_ |
40 |
#include <com/sun/star/uno/Sequence.h> |
48 |
#include <com/sun/star/uno/Sequence.h> |
41 |
#endif |
49 |
#endif |
Lines 61-237
Link Here
|
61 |
|
69 |
|
62 |
using namespace ::com::sun::star; |
70 |
using namespace ::com::sun::star; |
63 |
|
71 |
|
64 |
ImpPDFDialog::ImpPDFDialog( Window* pParent, ResMgr& rResMgr, Sequence< PropertyValue >& rFilterData, const Reference< XComponent >& rxDoc ) : |
72 |
////////////////////////////////////////////////////////////////////////////////////////////////////// |
65 |
ModalDialog( pParent, ResId( RID_PDF_EXPORT_DLG, &rResMgr ) ), |
73 |
// tabbed PDF dialog implementation |
66 |
maBtnOK( this, ResId( BT_OK ) ), |
74 |
// ----------------------------------------------------------------------------- |
67 |
maBtnCancel( this, ResId( BT_CANCEL ) ), |
75 |
ImpPDFTabDialog::ImpPDFTabDialog( Window* pParent, |
68 |
maBtnHelp( this, ResId( BT_HELP ) ), |
76 |
ResMgr& rResMgr, |
69 |
maFlPages( this, ResId( FL_PAGES ) ), |
77 |
Sequence< PropertyValue >& rFilterData, |
70 |
maRbAll( this, ResId( RB_ALL ) ), |
78 |
const Reference< XComponent >& rxDoc ) : |
71 |
maRbRange( this, ResId( RB_RANGE ) ), |
79 |
SfxTabDialog( pParent, ResId( RID_PDF_EXPORT_DLG, &rResMgr ), 0, FALSE, 0 ), |
72 |
maRbSelection( this, ResId( RB_SELECTION ) ), |
80 |
|
73 |
maEdPages( this, ResId( ED_PAGES ) ), |
81 |
maFlPages( this, ResId( 1 ) ), |
74 |
maFlCompression( this, ResId( FL_IMAGES ) ), |
82 |
|
75 |
maRbLosslessCompression( this, ResId( RB_LOSSLESSCOMPRESSION ) ), |
|
|
76 |
maRbJPEGCompression( this, ResId( RB_JPEGCOMPRESSION ) ), |
77 |
maFtQuality( this, ResId( FT_QUALITY ) ), |
78 |
maNfQuality( this, ResId( NF_QUALITY ) ), |
79 |
maCbReduceImageResolution( this, ResId( CB_REDUCEIMAGERESOLUTION ) ), |
80 |
maCoReduceImageResolution( this, ResId( CO_REDUCEIMAGERESOLUTION ) ), |
81 |
maFlGeneral( this, ResId( FL_GENERAL ) ), |
82 |
maCbTaggedPDF( this, ResId( CB_TAGGEDPDF ) ), |
83 |
maCbExportNotes( this, ResId( CB_EXPORTNOTES ) ), |
84 |
maCbTransitionEffects( this, ResId( CB_TRANSITIONEFFECTS ) ), |
85 |
maFtFormsFormat( this, ResId( FT_FORMSFORMAT ) ), |
86 |
maLbFormsFormat( this, ResId( LB_FORMSFORMAT ) ), |
87 |
maCbExportEmptyPages( this, ResId( CB_EXPORTEMPTYPAGES ) ), |
88 |
maConfigItem( String( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/PDF/Export/" ) ), &rFilterData ), |
83 |
maConfigItem( String( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/PDF/Export/" ) ), &rFilterData ), |
89 |
mbIsPresentation( sal_False ), |
84 |
mbIsPresentation( sal_False ), |
90 |
mbIsWriter( sal_False ) |
85 |
mbIsWriter( sal_False ), |
91 |
{ |
|
|
92 |
FreeResource(); |
93 |
maRbRange.SetToggleHdl( LINK( this, ImpPDFDialog, TogglePagesHdl ) ); |
94 |
|
86 |
|
95 |
maRbAll.Check(); |
87 |
mbSelectionPresent( sal_False ), |
96 |
TogglePagesHdl( NULL ); |
88 |
mbUseLosslessCompression( sal_True ), |
|
|
89 |
mnQuality( 90 ), |
90 |
mbReduceImageResolution( sal_False ), |
91 |
mnMaxImageResolution( 300 ), |
92 |
mbUseTaggedPDF( sal_False ), |
93 |
mbExportNotesBoth( sal_True ), |
94 |
mbUseTransitionEffects( sal_False ), |
95 |
mbIsSkipEmptyPages( sal_False ), |
96 |
mnFormsType( 0 ), |
97 |
|
98 |
mbHideViewerToolbar( sal_False ), |
99 |
mbHideViewerMenubar( sal_False ), |
100 |
mbHideViewerWindowControls( sal_False ), |
101 |
mbFitWindow( sal_False ), |
102 |
mbCenterWindow( sal_False ), |
103 |
mbDisplayPDFDocumentTitle( sal_False ), |
104 |
mbDirectionR2L( sal_False ), |
105 |
mnOpenPDFDocumentMode( 0 ), |
106 |
mnOpenPDFDocumentAction( 0 ), |
107 |
mnNonFullScreenPageMode( 0 ), |
97 |
|
108 |
|
98 |
maNfQuality.SetUnit( FUNIT_PERCENT ); |
109 |
mbIsRangeChecked( sal_False ), |
99 |
maNfQuality.SetMin( 1, FUNIT_PERCENT ); |
110 |
msPageRange( ' ' ), |
100 |
maNfQuality.SetMax( 100, FUNIT_PERCENT ); |
|
|
101 |
|
111 |
|
102 |
// check for selection |
112 |
mbSelectionIsChecked( sal_False ) |
|
|
113 |
{ |
114 |
FreeResource(); |
115 |
mprResMgr = &rResMgr; |
116 |
// check for selection |
103 |
try |
117 |
try |
104 |
{ |
118 |
{ |
105 |
Reference< frame::XController > xController( Reference< frame::XModel >( rxDoc, UNO_QUERY )->getCurrentController() ); |
119 |
Reference< frame::XController > xController( Reference< frame::XModel >( rxDoc, UNO_QUERY )->getCurrentController() ); |
106 |
if( xController.is() ) |
120 |
if( xController.is() ) |
107 |
{ |
121 |
{ |
108 |
Reference< view::XSelectionSupplier > xView( xController, UNO_QUERY ); |
122 |
Reference< view::XSelectionSupplier > xView( xController, UNO_QUERY ); |
109 |
if( xView.is() ) |
123 |
if( xView.is() ) |
110 |
xView->getSelection() >>= maSelection; |
124 |
xView->getSelection() >>= maSelection; |
111 |
} |
125 |
} |
112 |
} |
126 |
} |
113 |
catch( RuntimeException ) |
127 |
catch( RuntimeException ) |
114 |
{ |
128 |
{ |
115 |
} |
129 |
} |
116 |
sal_Bool bHasSelection = maSelection.hasValue(); |
130 |
mbSelectionPresent = maSelection.hasValue(); |
117 |
if ( bHasSelection ) |
131 |
if ( mbSelectionPresent ) |
118 |
{ |
132 |
{ |
119 |
Reference< drawing::XShapes > xShapes; |
133 |
Reference< drawing::XShapes > xShapes; |
120 |
if ( ( maSelection >>= xShapes ) == sal_False ) // XShapes is always a selection |
134 |
if ( ( maSelection >>= xShapes ) == sal_False ) // XShapes is always a selection |
121 |
{ |
135 |
{ |
122 |
// even if nothing is selected in writer the selection is not empty |
136 |
// even if nothing is selected in writer the selection is not empty |
123 |
Reference< container::XIndexAccess > xIndexAccess; |
137 |
Reference< container::XIndexAccess > xIndexAccess; |
124 |
if ( maSelection >>= xIndexAccess ) |
138 |
if ( maSelection >>= xIndexAccess ) |
125 |
{ |
139 |
{ |
126 |
sal_Int32 nLen = xIndexAccess->getCount(); |
140 |
sal_Int32 nLen = xIndexAccess->getCount(); |
127 |
if ( !nLen ) |
141 |
if ( !nLen ) |
128 |
bHasSelection = sal_False; |
142 |
mbSelectionPresent = sal_False; |
129 |
else if ( nLen == 1 ) |
143 |
else if ( nLen == 1 ) |
130 |
{ |
144 |
{ |
131 |
Reference< text::XTextRange > xTextRange( xIndexAccess->getByIndex( 0 ), UNO_QUERY ); |
145 |
Reference< text::XTextRange > xTextRange( xIndexAccess->getByIndex( 0 ), UNO_QUERY ); |
132 |
if ( xTextRange.is() && ( xTextRange->getString().getLength() == 0 ) ) |
146 |
if ( xTextRange.is() && ( xTextRange->getString().getLength() == 0 ) ) |
133 |
bHasSelection = sal_False; |
147 |
mbSelectionPresent = sal_False; |
134 |
} |
148 |
} |
135 |
} |
149 |
} |
136 |
} |
150 |
} |
137 |
} |
151 |
} |
138 |
maRbSelection.Enable( bHasSelection ); |
152 |
|
139 |
|
153 |
// check if source document is a presentation |
140 |
|
154 |
try |
141 |
// check if source document is a presentation |
155 |
{ |
142 |
try |
156 |
Reference< XServiceInfo > xInfo( rxDoc, UNO_QUERY ); |
143 |
{ |
157 |
if ( xInfo.is() ) |
144 |
Reference< XServiceInfo > xInfo( rxDoc, UNO_QUERY ); |
158 |
{ |
145 |
if ( xInfo.is() ) |
159 |
if ( xInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.PresentationDocument" ) ) ) ) |
146 |
{ |
160 |
mbIsPresentation = sal_True; |
147 |
if ( xInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.PresentationDocument" ) ) ) ) |
|
|
148 |
mbIsPresentation = sal_True; |
149 |
if ( xInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.TextDocument" ) ) ) ) |
161 |
if ( xInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.TextDocument" ) ) ) ) |
150 |
mbIsWriter = sal_True; |
162 |
mbIsWriter = sal_True; |
151 |
} |
163 |
} |
152 |
} |
164 |
} |
153 |
catch( RuntimeException ) |
165 |
catch( RuntimeException ) |
154 |
{ |
166 |
{ |
155 |
} |
167 |
} |
156 |
maCbTransitionEffects.Enable( mbIsPresentation ); |
|
|
157 |
maCbExportEmptyPages.Enable( mbIsWriter ); |
158 |
|
159 |
// SJ: Dont know if there are Notes available also for writer. |
160 |
// maCbExportNotes.Enable( bIsPresentation ); |
161 |
|
162 |
|
163 |
maRbLosslessCompression.SetToggleHdl( LINK( this, ImpPDFDialog, ToggleCompressionHdl ) ); |
164 |
const sal_Bool bUseLosslessCompression = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "UseLosslessCompression" ) ), sal_False ); |
165 |
if ( bUseLosslessCompression ) |
166 |
maRbLosslessCompression.Check(); |
167 |
else |
168 |
maRbJPEGCompression.Check(); |
169 |
maNfQuality.SetValue( maConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), 90 ), FUNIT_PERCENT ); |
170 |
maNfQuality.Enable( bUseLosslessCompression == sal_False ); |
171 |
|
172 |
maCbReduceImageResolution.SetToggleHdl( LINK( this, ImpPDFDialog, ToggleReduceImageResolutionHdl ) ); |
173 |
const sal_Bool bReduceImageResolution = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "ReduceImageResolution" ) ), sal_False ); |
174 |
maCbReduceImageResolution.Check( bReduceImageResolution ); |
175 |
String aStrRes( String::CreateFromInt32( maConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "MaxImageResolution" ) ), 300 ) ) ); |
176 |
aStrRes.Append( String( RTL_CONSTASCII_USTRINGPARAM( " DPI" ) ) ); |
177 |
maCoReduceImageResolution.SetText( aStrRes ); |
178 |
maCoReduceImageResolution.Enable( bReduceImageResolution ); |
179 |
|
180 |
maCbTaggedPDF.Check( maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "UseTaggedPDF" ) ), sal_False ) ); |
181 |
|
182 |
if ( mbIsPresentation ) |
183 |
maCbExportNotes.Check( maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) ), sal_False ) ); |
184 |
else |
185 |
maCbExportNotes.Check( maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" ) ), sal_True ) ); |
186 |
|
187 |
maCbTransitionEffects.Check( maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "UseTransitionEffects" ) ), sal_True ) ); |
188 |
maCbExportEmptyPages.Check( !maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) ), sal_False ) ); |
189 |
|
168 |
|
190 |
sal_Int32 nFormsType = maConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "FormsType" ) ), 0 ); |
169 |
mbUseLosslessCompression = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseLosslessCompression" ) ), sal_False ); |
191 |
if ( ( nFormsType < 0 ) || ( nFormsType > 3 ) ) |
170 |
mnQuality = maConfigItem.ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), 90 ); |
192 |
nFormsType = 0; |
171 |
mbReduceImageResolution = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ReduceImageResolution" ) ), sal_False ); |
193 |
maLbFormsFormat.SelectEntryPos( (sal_uInt16)nFormsType ); |
172 |
mnMaxImageResolution = maConfigItem.ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxImageResolution" ) ), 300 ); |
|
|
173 |
|
174 |
mbUseTaggedPDF = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "UseTaggedPDF" ) ), sal_False ); |
175 |
if ( mbIsPresentation ) |
176 |
mbExportNotesBoth = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) ), sal_False ); |
177 |
else |
178 |
mbExportNotesBoth = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" ) ), sal_True ); |
179 |
|
180 |
mbUseTransitionEffects = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "UseTransitionEffects" ) ), sal_True ); |
181 |
mbIsSkipEmptyPages = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) ), sal_False ); |
182 |
|
183 |
mnFormsType = maConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "FormsType" ) ), 0 ); |
184 |
if ( ( mnFormsType < 0 ) || ( mnFormsType > 3 ) ) |
185 |
mnFormsType = 0; |
186 |
|
187 |
//prepare values for the Viewer tab page |
188 |
mbHideViewerToolbar = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerToolbar" ) ), sal_False ); |
189 |
mbHideViewerMenubar = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerMenubar" ) ), sal_False ); |
190 |
mbHideViewerWindowControls = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerWindowControls" ) ), sal_False ); |
191 |
mbFitWindow = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "FitWindow" ) ), sal_False ); |
192 |
mbCenterWindow = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "CenterWindow" ) ), sal_False ); |
193 |
mbDisplayPDFDocumentTitle = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "DisplayPDFDocumentTitle" ) ), sal_False ); |
194 |
mbDirectionR2L = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "DirectionR2L" ) ), sal_False ); |
195 |
|
196 |
mnOpenPDFDocumentMode = maConfigItem.ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenPDFDocumentMode" ) ), 0 ); |
197 |
mnOpenPDFDocumentAction = maConfigItem.ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenPDFDocumentAction" ) ), 0 ); |
198 |
mnNonFullScreenPageMode = maConfigItem.ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "NonFullScreenPageMode" ) ), 0 ); |
199 |
|
200 |
//queue the tab pages for later creation (created when first shown) |
201 |
AddTabPage( RID_PDF_TAB_VPREFER, ImpPDFTabViewerPage::Create, 0 ); |
202 |
AddTabPage( RID_PDF_TAB_OPNFTR, ImpPDFTabOpnFtrPage::Create, 0 ); |
203 |
|
204 |
//last queued is the first to be displayed (or so it seems..) |
205 |
AddTabPage( RID_PDF_TAB_GENER, ImpPDFTabGeneralPage::Create, 0 ); |
206 |
|
207 |
//change test on the Ok button: get the relevant string from resources, update it on the button |
208 |
GetOKButton().SetText( OUString( String( ResId( STR_PDF_EXPORT, &rResMgr ) ) ) ); |
209 |
|
210 |
//FIXME |
211 |
//very, very ugly hack: I don't know how to have the tab pages displayed correctly without this... |
212 |
maFlPages.Hide(); |
213 |
///////////////// |
194 |
} |
214 |
} |
195 |
|
215 |
|
196 |
// ----------------------------------------------------------------------------- |
216 |
// ----------------------------------------------------------------------------- |
|
|
217 |
ImpPDFTabDialog::~ImpPDFTabDialog() |
218 |
{ |
219 |
//delete the pages, needed because otherwise the child tab pages |
220 |
//don't get destroyed |
221 |
RemoveTabPage( RID_PDF_TAB_GENER ); |
222 |
RemoveTabPage( RID_PDF_TAB_VPREFER ); |
223 |
RemoveTabPage( RID_PDF_TAB_OPNFTR ); |
224 |
} |
197 |
|
225 |
|
198 |
ImpPDFDialog::~ImpPDFDialog() |
226 |
// ----------------------------------------------------------------------------- |
|
|
227 |
void ImpPDFTabDialog::PageCreated( USHORT _nId, |
228 |
SfxTabPage& _rPage ) |
199 |
{ |
229 |
{ |
|
|
230 |
switch( _nId ) |
231 |
{ |
232 |
case RID_PDF_TAB_GENER: |
233 |
( ( ImpPDFTabGeneralPage* )&_rPage )->SetFilterConfigItem( this ); |
234 |
break; |
235 |
case RID_PDF_TAB_VPREFER: |
236 |
( ( ImpPDFTabViewerPage* )&_rPage )->SetFilterConfigItem( this ); |
237 |
break; |
238 |
case RID_PDF_TAB_OPNFTR: |
239 |
( ( ImpPDFTabOpnFtrPage* )&_rPage )->SetFilterConfigItem( this ); |
240 |
break; |
241 |
} |
200 |
} |
242 |
} |
201 |
|
243 |
|
202 |
// ----------------------------------------------------------------------------- |
244 |
// ----------------------------------------------------------------------------- |
|
|
245 |
short ImpPDFTabDialog::Ok( ) |
246 |
{ |
247 |
//here the whole mechanism of the base class is not used |
248 |
//when Ok is hit, the user means 'convert to PDF', so simply close with ok |
249 |
return RET_OK; |
250 |
} |
203 |
|
251 |
|
204 |
Sequence< PropertyValue > ImpPDFDialog::GetFilterData() |
252 |
// ----------------------------------------------------------------------------- |
|
|
253 |
Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData() |
205 |
{ |
254 |
{ |
206 |
// updating the FilterData sequence and storing FilterData to configuration |
255 |
// updating the FilterData sequence and storing FilterData to configuration |
207 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseLosslessCompression" ) ), maRbLosslessCompression.IsChecked() ); |
256 |
if( GetTabPage( RID_PDF_TAB_GENER ) ) |
208 |
maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), maNfQuality.GetValue() ); |
257 |
( ( ImpPDFTabGeneralPage* )GetTabPage( RID_PDF_TAB_GENER ) )->GetFilterConfigItem( this ); |
209 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ReduceImageResolution" ) ), maCbReduceImageResolution.IsChecked() ); |
258 |
|
210 |
maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxImageResolution" ) ), maCoReduceImageResolution.GetText().ToInt32() ); |
259 |
//prepare the items to be returned |
211 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseTaggedPDF" ) ), maCbTaggedPDF.IsChecked() ); |
260 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseLosslessCompression" ) ), mbUseLosslessCompression ); |
212 |
if ( mbIsPresentation ) |
261 |
maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), mnQuality ); |
213 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) ), maCbExportNotes.IsChecked() ); |
262 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ReduceImageResolution" ) ), mbReduceImageResolution ); |
214 |
else |
263 |
maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxImageResolution" ) ), mnMaxImageResolution ); |
215 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" ) ), maCbExportNotes.IsChecked() ); |
264 |
|
216 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseTransitionEffects" ) ), maCbTransitionEffects.IsChecked() ); |
265 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseTaggedPDF" ) ), mbUseTaggedPDF ); |
217 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) ), !maCbExportEmptyPages.IsChecked() ); |
266 |
if ( mbIsPresentation ) |
|
|
267 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) ), mbExportNotesBoth ); |
268 |
else |
269 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" ) ), mbExportNotesBoth ); |
270 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseTransitionEffects" ) ), mbUseTransitionEffects ); |
271 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) ), mbIsSkipEmptyPages ); |
218 |
|
272 |
|
219 |
/* |
273 |
/* |
220 |
* FIXME: the entries are only implicitly defined by the resource file. Should there |
274 |
* FIXME: the entries are only implicitly defined by the resource file. Should there |
221 |
* ever be an additional form submit format this could get invalid. |
275 |
* ever be an additional form submit format this could get invalid. |
222 |
*/ |
276 |
*/ |
223 |
maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "FormsType" ) ), maLbFormsFormat.GetSelectEntryPos() ); |
277 |
maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "FormsType" ) ), mnFormsType ); |
|
|
278 |
|
279 |
if( GetTabPage( RID_PDF_TAB_VPREFER ) ) |
280 |
( ( ImpPDFTabViewerPage* )GetTabPage( RID_PDF_TAB_VPREFER ) )->GetFilterConfigItem( this ); |
281 |
|
282 |
if( GetTabPage( RID_PDF_TAB_OPNFTR ) ) |
283 |
( ( ImpPDFTabOpnFtrPage* )GetTabPage( RID_PDF_TAB_OPNFTR ) )->GetFilterConfigItem( this ); |
284 |
|
285 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerToolbar" ) ), mbHideViewerToolbar ); |
286 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerMenubar" ) ), mbHideViewerMenubar ); |
287 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerWindowControls" ) ), mbHideViewerWindowControls ); |
288 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "FitWindow" ) ), mbFitWindow ); |
289 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "CenterWindow" ) ), mbCenterWindow ); |
290 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "DisplayPDFDocumentTitle" ) ), mbDisplayPDFDocumentTitle ); |
291 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "DirectionR2L" ) ), mbDirectionR2L ); |
292 |
maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenPDFDocumentMode" ) ), mnOpenPDFDocumentMode ); |
293 |
maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenPDFDocumentAction" ) ), mnOpenPDFDocumentAction ); |
294 |
maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "NonFullScreenPageMode" ) ), mnNonFullScreenPageMode ); |
224 |
|
295 |
|
225 |
Sequence< PropertyValue > aRet( maConfigItem.GetFilterData() ); |
296 |
Sequence< PropertyValue > aRet( maConfigItem.GetFilterData() ); |
226 |
|
297 |
|
227 |
aRet.realloc( aRet.getLength() + 1 ); |
298 |
aRet.realloc( aRet.getLength() + 1 ); |
228 |
|
299 |
|
229 |
if( maRbRange.IsChecked() ) |
300 |
if( mbIsRangeChecked ) |
230 |
{ |
301 |
{ |
231 |
aRet[ aRet.getLength() - 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ); |
302 |
aRet[ aRet.getLength() - 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ); |
232 |
aRet[ aRet.getLength() - 1 ].Value <<= OUString( maEdPages.GetText() ); |
303 |
aRet[ aRet.getLength() - 1 ].Value <<= OUString( msPageRange ); |
233 |
} |
304 |
} |
234 |
else if( maRbSelection.IsChecked() ) |
305 |
else if( mbSelectionIsChecked ) |
235 |
{ |
306 |
{ |
236 |
aRet[ aRet.getLength() - 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Selection" ) ); |
307 |
aRet[ aRet.getLength() - 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Selection" ) ); |
237 |
aRet[ aRet.getLength() - 1 ].Value <<= maSelection; |
308 |
aRet[ aRet.getLength() - 1 ].Value <<= maSelection; |
Lines 240-266
Sequence< PropertyValue > ImpPDFDialog::
Link Here
|
240 |
} |
311 |
} |
241 |
|
312 |
|
242 |
// ----------------------------------------------------------------------------- |
313 |
// ----------------------------------------------------------------------------- |
|
|
314 |
ImpPDFTabGeneralPage::ImpPDFTabGeneralPage( Window* pParent, |
315 |
const SfxItemSet& rCoreSet, |
316 |
ResMgr* paResMgr ) : |
317 |
SfxTabPage( pParent, ResId( RID_PDF_TAB_GENER, paResMgr ), rCoreSet ), |
318 |
|
319 |
maFlPages( this, ResId( FL_PAGES, paResMgr ) ), |
320 |
maRbAll( this, ResId( RB_ALL, paResMgr) ), |
321 |
maRbRange( this, ResId( RB_RANGE, paResMgr ) ), |
322 |
maRbSelection( this, ResId( RB_SELECTION, paResMgr ) ), |
323 |
maEdPages( this, ResId( ED_PAGES, paResMgr ) ), |
324 |
|
325 |
maFlCompression( this, ResId( FL_IMAGES, paResMgr ) ), |
326 |
maRbLosslessCompression( this, ResId( RB_LOSSLESSCOMPRESSION, paResMgr ) ), |
327 |
maRbJPEGCompression( this, ResId( RB_JPEGCOMPRESSION, paResMgr ) ), |
328 |
maFtQuality( this, ResId( FT_QUALITY, paResMgr ) ), |
329 |
maNfQuality( this, ResId( NF_QUALITY, paResMgr ) ), |
330 |
maCbReduceImageResolution( this, ResId( CB_REDUCEIMAGERESOLUTION, paResMgr ) ), |
331 |
maCoReduceImageResolution( this, ResId( CO_REDUCEIMAGERESOLUTION, paResMgr ) ), |
332 |
|
333 |
maFlGeneral( this, ResId( FL_GENERAL, paResMgr ) ), |
334 |
maCbTaggedPDF( this, ResId( CB_TAGGEDPDF, paResMgr ) ), |
335 |
maCbExportNotes( this, ResId( CB_EXPORTNOTES, paResMgr ) ), |
336 |
maCbTransitionEffects( this, ResId( CB_TRANSITIONEFFECTS, paResMgr ) ), |
337 |
|
338 |
maFtFormsFormat( this, ResId( FT_FORMSFORMAT, paResMgr ) ), |
339 |
maLbFormsFormat( this, ResId( LB_FORMSFORMAT, paResMgr ) ), |
340 |
maCbExportEmptyPages( this, ResId( CB_EXPORTEMPTYPAGES, paResMgr ) ), |
341 |
mbIsPresentation( sal_False ), |
342 |
|
343 |
mbResetAlreadyCalled( sal_False ) |
344 |
{ |
345 |
mpaResMgr = paResMgr; |
346 |
FreeResource(); |
347 |
} |
348 |
|
349 |
// ----------------------------------------------------------------------------- |
350 |
ImpPDFTabGeneralPage::~ImpPDFTabGeneralPage() |
351 |
{ |
352 |
delete mpaResMgr; |
353 |
} |
354 |
|
355 |
// ----------------------------------------------------------------------------- |
356 |
void ImpPDFTabGeneralPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent ) |
357 |
{ |
358 |
//init this class data |
359 |
maRbRange.SetToggleHdl( LINK( this, ImpPDFTabGeneralPage, TogglePagesHdl ) ); |
360 |
|
361 |
maRbAll.Check(); |
362 |
TogglePagesHdl( NULL ); |
363 |
|
364 |
maNfQuality.SetUnit( FUNIT_PERCENT ); |
365 |
maNfQuality.SetMin( 1, FUNIT_PERCENT ); |
366 |
maNfQuality.SetMax( 100, FUNIT_PERCENT ); |
367 |
|
368 |
maRbSelection.Enable( paParent->mbSelectionPresent ); |
369 |
mbIsPresentation = paParent->mbIsPresentation; |
370 |
mbIsWriter = paParent->mbIsWriter; |
371 |
|
372 |
maCbTransitionEffects.Enable( mbIsPresentation ); |
373 |
maCbExportEmptyPages.Enable( mbIsWriter ); |
374 |
|
375 |
// SJ: Dont know if there are Notes available also for writer. |
376 |
// maCbExportNotes.Enable( paParent->mbIsPresentation ); |
377 |
|
378 |
maRbLosslessCompression.SetToggleHdl( LINK( this, ImpPDFTabGeneralPage, ToggleCompressionHdl ) ); |
379 |
const sal_Bool bUseLosslessCompression = paParent->mbUseLosslessCompression; |
380 |
if ( bUseLosslessCompression ) |
381 |
maRbLosslessCompression.Check(); |
382 |
else |
383 |
maRbJPEGCompression.Check(); |
384 |
|
385 |
maNfQuality.SetValue( paParent->mnQuality, FUNIT_PERCENT ); |
386 |
maNfQuality.Enable( bUseLosslessCompression == sal_False ); |
387 |
|
388 |
maCbReduceImageResolution.SetToggleHdl( LINK( this, ImpPDFTabGeneralPage, ToggleReduceImageResolutionHdl ) ); |
389 |
const sal_Bool bReduceImageResolution = paParent->mbReduceImageResolution; |
390 |
maCbReduceImageResolution.Check( bReduceImageResolution ); |
391 |
String aStrRes( String::CreateFromInt32( paParent->mnMaxImageResolution ) ); |
392 |
aStrRes.Append( String( RTL_CONSTASCII_USTRINGPARAM( " DPI" ) ) ); |
393 |
maCoReduceImageResolution.SetText( aStrRes ); |
394 |
maCoReduceImageResolution.Enable( bReduceImageResolution ); |
395 |
|
396 |
maCbTaggedPDF.Check( paParent->mbUseTaggedPDF ); |
397 |
|
398 |
if ( mbIsPresentation ) |
399 |
maCbExportNotes.Check( paParent->mbExportNotesBoth ); |
400 |
else |
401 |
maCbExportNotes.Check( paParent->mbExportNotesBoth ); |
402 |
|
403 |
maCbTransitionEffects.Check( paParent->mbUseTransitionEffects ); |
404 |
maCbExportEmptyPages.Check( !paParent->mbIsSkipEmptyPages ); |
405 |
|
406 |
maLbFormsFormat.SelectEntryPos( (sal_uInt16)paParent->mnFormsType ); |
407 |
} |
408 |
|
409 |
// ----------------------------------------------------------------------------- |
410 |
void ImpPDFTabGeneralPage::GetFilterConfigItem( ImpPDFTabDialog* paParent ) |
411 |
{ |
412 |
// updating the FilterData sequence and storing FilterData to configuration |
413 |
paParent->mbUseLosslessCompression = maRbLosslessCompression.IsChecked(); |
414 |
paParent->mnQuality = maNfQuality.GetValue(); |
415 |
paParent->mbReduceImageResolution = maCbReduceImageResolution.IsChecked(); |
416 |
paParent->mnMaxImageResolution = maCoReduceImageResolution.GetText().ToInt32(); |
417 |
paParent->mbUseTaggedPDF = maCbTaggedPDF.IsChecked(); |
418 |
paParent->mbExportNotesBoth = maCbExportNotes.IsChecked(); |
419 |
|
420 |
paParent->mbUseTransitionEffects = maCbTransitionEffects.IsChecked(); |
421 |
paParent->mbIsSkipEmptyPages = !maCbExportEmptyPages.IsChecked(); |
422 |
|
423 |
paParent->mbIsRangeChecked = sal_False; |
424 |
if( maRbRange.IsChecked() ) |
425 |
{ |
426 |
paParent->mbIsRangeChecked = sal_True; |
427 |
paParent->msPageRange = String( maEdPages.GetText() ); //FIXME all right on other languages ? |
428 |
} |
429 |
else if( maRbSelection.IsChecked() ) |
430 |
{ |
431 |
paParent->mbSelectionIsChecked = maRbSelection.IsChecked(); |
432 |
} |
433 |
/* |
434 |
* FIXME: the entries are only implicitly defined by the resource file. Should there |
435 |
* ever be an additional form submit format this could get invalid. |
436 |
*/ |
437 |
paParent->mnFormsType = (sal_Int32) maLbFormsFormat.GetSelectEntryPos(); |
438 |
} |
439 |
|
440 |
// ----------------------------------------------------------------------------- |
441 |
SfxTabPage* ImpPDFTabGeneralPage::Create( Window* pParent, |
442 |
const SfxItemSet& rAttrSet) |
443 |
{ |
444 |
ByteString aResMgrName( "pdffilter" ); |
445 |
aResMgrName.Append( ByteString::CreateFromInt32( SOLARUPD ) ); |
446 |
ResMgr* paResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() ); |
447 |
return ( new ImpPDFTabGeneralPage( pParent, rAttrSet, paResMgr ) ); |
448 |
} |
243 |
|
449 |
|
244 |
IMPL_LINK( ImpPDFDialog, TogglePagesHdl, void*, p ) |
450 |
// ----------------------------------------------------------------------------- |
|
|
451 |
void ImpPDFTabGeneralPage::Reset( const SfxItemSet& ignored) |
452 |
{ |
453 |
//set the controls to default values |
454 |
//since this is called just after the data are set from the parent tab dialog |
455 |
//a bool is needed to enable reset only the second time (while user presses it) |
456 |
if( mbResetAlreadyCalled ) |
457 |
{ |
458 |
maCbTransitionEffects.Enable( mbIsPresentation ); |
459 |
maCbExportEmptyPages.Enable( mbIsWriter ); |
460 |
maRbAll.Check(); |
461 |
TogglePagesHdl( NULL ); |
462 |
maRbLosslessCompression.Check( FALSE ); |
463 |
maRbJPEGCompression.Check(); |
464 |
maNfQuality.SetValue( 90 , FUNIT_PERCENT ); |
465 |
maNfQuality.Enable(); |
466 |
maCbReduceImageResolution.Check( FALSE ); |
467 |
maCbTaggedPDF.Check( FALSE ); |
468 |
if ( mbIsPresentation ) |
469 |
maCbExportNotes.Check( FALSE ); |
470 |
else |
471 |
maCbExportNotes.Check(); |
472 |
maCbTransitionEffects.Check(); |
473 |
maCbExportEmptyPages.Check(); |
474 |
|
475 |
maLbFormsFormat.SelectEntryPos( 0 ); |
476 |
} |
477 |
mbResetAlreadyCalled = sal_True; |
478 |
} |
479 |
|
480 |
// ----------------------------------------------------------------------------- |
481 |
IMPL_LINK( ImpPDFTabGeneralPage, TogglePagesHdl, void*, p ) |
245 |
{ |
482 |
{ |
246 |
maEdPages.Enable( maRbRange.IsChecked() ); |
483 |
maEdPages.Enable( maRbRange.IsChecked() ); |
247 |
maEdPages.SetReadOnly( !maRbRange.IsChecked() ); |
484 |
maEdPages.SetReadOnly( !maRbRange.IsChecked() ); |
248 |
|
|
|
249 |
return 0; |
485 |
return 0; |
250 |
} |
486 |
} |
251 |
|
487 |
|
252 |
// ----------------------------------------------------------------------------- |
488 |
// ----------------------------------------------------------------------------- |
253 |
|
489 |
IMPL_LINK( ImpPDFTabGeneralPage, ToggleCompressionHdl, void*, p ) |
254 |
IMPL_LINK( ImpPDFDialog, ToggleCompressionHdl, void*, p ) |
|
|
255 |
{ |
490 |
{ |
256 |
maNfQuality.Enable( maRbJPEGCompression.IsChecked() ); |
491 |
maNfQuality.Enable( maRbJPEGCompression.IsChecked() ); |
257 |
return 0; |
492 |
return 0; |
258 |
} |
493 |
} |
259 |
|
494 |
|
260 |
// ----------------------------------------------------------------------------- |
495 |
// ----------------------------------------------------------------------------- |
261 |
|
496 |
IMPL_LINK( ImpPDFTabGeneralPage, ToggleReduceImageResolutionHdl, void*, p ) |
262 |
IMPL_LINK( ImpPDFDialog, ToggleReduceImageResolutionHdl, void*, p ) |
|
|
263 |
{ |
497 |
{ |
264 |
maCoReduceImageResolution.Enable( maCbReduceImageResolution.IsChecked() ); |
498 |
maCoReduceImageResolution.Enable( maCbReduceImageResolution.IsChecked() ); |
265 |
return 0; |
499 |
return 0; |
266 |
} |
500 |
} |
|
|
501 |
|
502 |
//////////////////////////////////////////////////////// |
503 |
// The Viewer preferences tab page |
504 |
// ----------------------------------------------------------------------------- |
505 |
ImpPDFTabViewerPage::ImpPDFTabViewerPage( Window* pParent, |
506 |
const SfxItemSet& rCoreSet, |
507 |
ResMgr* paResMgr ) : |
508 |
SfxTabPage( pParent, ResId( RID_PDF_TAB_VPREFER, paResMgr ), rCoreSet ), |
509 |
|
510 |
maFlViewWinCtrl( this, ResId( FL_VIEWWINCTRL, paResMgr ) ), |
511 |
maCbHideViewerMenubar( this, ResId( CB_HIDEVMENUBAR, paResMgr ) ), |
512 |
maCbHideViewerToolbar( this, ResId( CB_HIDEVTOOLBAR, paResMgr ) ), |
513 |
maCbHideViewerWindowControls( this, ResId( CB_HIDEVWINCTRL, paResMgr ) ), |
514 |
maCbFitWindow( this, ResId( CB_FITWINDOW, paResMgr ) ), |
515 |
maCbCenterWindow( this, ResId( CB_CENTWINDOW, paResMgr ) ), |
516 |
maCbDispDocTitle( this, ResId( CB_DISPDOCTITLE, paResMgr ) ), |
517 |
|
518 |
maFlDirContrl( this, ResId( FL_DIRCONTR, paResMgr ) ), |
519 |
maRbL2R( this, ResId( RB_LEFTRIGHT, paResMgr ) ), |
520 |
maRbR2L( this, ResId( RB_RIGHTLEFT, paResMgr ) ), |
521 |
|
522 |
mbResetAlreadyCalled( sal_False ) |
523 |
{ |
524 |
mpaResMgr = paResMgr; |
525 |
FreeResource(); |
526 |
} |
527 |
|
528 |
// ----------------------------------------------------------------------------- |
529 |
ImpPDFTabViewerPage::~ImpPDFTabViewerPage() |
530 |
{ |
531 |
delete mpaResMgr; |
532 |
} |
533 |
|
534 |
// ----------------------------------------------------------------------------- |
535 |
SfxTabPage* ImpPDFTabViewerPage::Create( Window* pParent, |
536 |
const SfxItemSet& rAttrSet) |
537 |
{ |
538 |
ByteString aResMgrName( "pdffilter" ); |
539 |
aResMgrName.Append( ByteString::CreateFromInt32( SOLARUPD ) ); |
540 |
ResMgr* paResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() ); |
541 |
return ( new ImpPDFTabViewerPage( pParent, rAttrSet, paResMgr ) ); |
542 |
} |
543 |
|
544 |
// ----------------------------------------------------------------------------- |
545 |
void ImpPDFTabViewerPage::GetFilterConfigItem( ImpPDFTabDialog* paParent ) |
546 |
{ |
547 |
paParent->mbHideViewerMenubar = maCbHideViewerMenubar.IsChecked(); |
548 |
paParent->mbHideViewerToolbar = maCbHideViewerToolbar.IsChecked( ); |
549 |
paParent->mbHideViewerWindowControls = maCbHideViewerWindowControls.IsChecked(); |
550 |
paParent->mbFitWindow = maCbFitWindow.IsChecked(); |
551 |
paParent->mbCenterWindow = maCbCenterWindow.IsChecked(); |
552 |
paParent->mbDisplayPDFDocumentTitle = maCbDispDocTitle.IsChecked(); |
553 |
paParent->mbDirectionR2L = maRbR2L.IsChecked(); |
554 |
} |
555 |
|
556 |
// ----------------------------------------------------------------------------- |
557 |
void ImpPDFTabViewerPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent ) |
558 |
{ |
559 |
maCbHideViewerMenubar.Check( paParent->mbHideViewerMenubar ); |
560 |
maCbHideViewerToolbar.Check( paParent->mbHideViewerToolbar ); |
561 |
maCbHideViewerWindowControls.Check( paParent->mbHideViewerWindowControls ); |
562 |
maCbFitWindow.Check( paParent->mbFitWindow ); |
563 |
maCbCenterWindow.Check( paParent->mbCenterWindow ); |
564 |
maCbDispDocTitle.Check( paParent->mbDisplayPDFDocumentTitle ); |
565 |
|
566 |
maRbR2L.Check( paParent->mbDirectionR2L ); |
567 |
maRbL2R.Check( !paParent->mbDirectionR2L ); |
568 |
} |
569 |
|
570 |
// ----------------------------------------------------------------------------- |
571 |
void ImpPDFTabViewerPage::Reset( const SfxItemSet& ignored ) |
572 |
{ |
573 |
//set the controls to default values |
574 |
// since this is called just after the data are set from the parent tab dialog |
575 |
// a bool is needed to enable reset only the second time (user pressing it) |
576 |
if( mbResetAlreadyCalled ) |
577 |
{ |
578 |
maRbL2R.Check(); |
579 |
maRbR2L.Check(FALSE); |
580 |
|
581 |
maCbHideViewerMenubar.Check( FALSE ); |
582 |
maCbHideViewerToolbar.Check( FALSE ); |
583 |
maCbHideViewerWindowControls.Check( FALSE ); |
584 |
maCbFitWindow.Check( FALSE ); |
585 |
maCbCenterWindow.Check( FALSE ); |
586 |
maCbDispDocTitle.Check(); |
587 |
} |
588 |
mbResetAlreadyCalled = sal_True; |
589 |
} |
590 |
|
591 |
///////////////////////////////////////////////////////////////// |
592 |
// the option features tab page |
593 |
// ----------------------------------------------------------------------------- |
594 |
ImpPDFTabOpnFtrPage::ImpPDFTabOpnFtrPage( Window* pParent, |
595 |
const SfxItemSet& rCoreSet, |
596 |
ResMgr* paResMgr ) : |
597 |
SfxTabPage( pParent, ResId( RID_PDF_TAB_OPNFTR, paResMgr ), rCoreSet ), |
598 |
maFlOpenMode( this, ResId( FL_OPENMODE, paResMgr ) ), |
599 |
|
600 |
maRbOpnDefault( this, ResId( RB_OPNMODE_DEFAULT, paResMgr ) ), |
601 |
maRbOpnOutline( this, ResId( RB_OPNMODE_OUTLINE, paResMgr ) ), |
602 |
maRbOpnThumbs( this, ResId( RB_OPNMODE_THUMBS, paResMgr ) ), |
603 |
maRbOpnFull( this, ResId( RB_OPNMODE_FULL, paResMgr ) ), |
604 |
|
605 |
maFlFullScreen( this, ResId( FL_FULLSCREEN, paResMgr ) ), |
606 |
maRbNFSDefault( this, ResId( RB_NFULLS_DEFAULT, paResMgr ) ), |
607 |
maRbNFSOutline( this, ResId( RB_NFULLS_OUTLINE, paResMgr ) ), |
608 |
maRbNFSThumbs( this, ResId( RB_NFULLS_THUMBS, paResMgr ) ), |
609 |
|
610 |
maFlOpenAction( this, ResId( FL_OPENACTION, paResMgr ) ), |
611 |
maRbOActDefault( this, ResId( RB_OPNACTION_DEFAULT, paResMgr ) ), |
612 |
maRbOActPage( this, ResId( RB_OPNACTION_PAGE, paResMgr ) ), |
613 |
maRbOActWidth( this, ResId( RB_OPNACTION_WIDTH, paResMgr ) ), |
614 |
maRbOActVisible( this, ResId( RB_OPNACTION_VISIBLE, paResMgr ) ), |
615 |
|
616 |
mbResetAlreadyCalled( sal_False ) |
617 |
{ |
618 |
mpaResMgr = paResMgr; |
619 |
FreeResource(); |
620 |
} |
621 |
|
622 |
// ----------------------------------------------------------------------------- |
623 |
ImpPDFTabOpnFtrPage::~ImpPDFTabOpnFtrPage() |
624 |
{ |
625 |
delete mpaResMgr; |
626 |
} |
627 |
|
628 |
// ----------------------------------------------------------------------------- |
629 |
SfxTabPage* ImpPDFTabOpnFtrPage::Create( Window* pParent, |
630 |
const SfxItemSet& rAttrSet) |
631 |
{ |
632 |
ByteString aResMgrName( "pdffilter" ); |
633 |
aResMgrName.Append( ByteString::CreateFromInt32( SOLARUPD ) ); |
634 |
ResMgr* paResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() ); |
635 |
return ( new ImpPDFTabOpnFtrPage( pParent, rAttrSet, paResMgr ) ); |
636 |
} |
637 |
|
638 |
// ----------------------------------------------------------------------------- |
639 |
void ImpPDFTabOpnFtrPage::GetFilterConfigItem( ImpPDFTabDialog* paParent ) |
640 |
{ |
641 |
paParent->mnNonFullScreenPageMode = 0; |
642 |
if( maRbNFSOutline.IsChecked() ) |
643 |
paParent->mnNonFullScreenPageMode = 1; |
644 |
else if( maRbNFSThumbs.IsChecked() ) |
645 |
paParent->mnNonFullScreenPageMode = 2; |
646 |
|
647 |
paParent->mnOpenPDFDocumentMode = 0; |
648 |
if( maRbOpnOutline.IsChecked() ) |
649 |
paParent->mnOpenPDFDocumentMode = 1; |
650 |
else if( maRbOpnThumbs.IsChecked() ) |
651 |
paParent->mnOpenPDFDocumentMode = 2; |
652 |
else if( maRbOpnFull.IsChecked() ) |
653 |
paParent->mnOpenPDFDocumentMode = 3; |
654 |
|
655 |
paParent->mnOpenPDFDocumentAction = 0; |
656 |
if( maRbOActPage.IsChecked() ) |
657 |
paParent->mnOpenPDFDocumentAction = 1; |
658 |
else if( maRbOActWidth.IsChecked() ) |
659 |
paParent->mnOpenPDFDocumentAction = 2; |
660 |
else if( maRbOActVisible.IsChecked() ) |
661 |
paParent->mnOpenPDFDocumentAction = 3; |
662 |
} |
663 |
|
664 |
// ----------------------------------------------------------------------------- |
665 |
void ImpPDFTabOpnFtrPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent ) |
666 |
{ |
667 |
switch( paParent->mnNonFullScreenPageMode ) |
668 |
{ |
669 |
default: |
670 |
case 0: |
671 |
maRbNFSDefault.Check( ); |
672 |
break; |
673 |
case 1: |
674 |
maRbNFSOutline.Check( ); |
675 |
break; |
676 |
case 2: |
677 |
maRbNFSThumbs.Check( ); |
678 |
break; |
679 |
} |
680 |
|
681 |
maRbOpnFull.SetToggleHdl( LINK( this, ImpPDFTabOpnFtrPage, ToggleFullScreenHdl ) ); |
682 |
|
683 |
switch( paParent->mnOpenPDFDocumentMode ) |
684 |
{ |
685 |
default: |
686 |
case 0: |
687 |
maRbOpnDefault.Check(); |
688 |
break; |
689 |
case 1: |
690 |
maRbOpnOutline.Check(); |
691 |
break; |
692 |
case 2: |
693 |
maRbOpnThumbs.Check(); |
694 |
break; |
695 |
case 3: |
696 |
maRbOpnFull.Check(); |
697 |
break; |
698 |
}; |
699 |
ToggleFullScreenHdl( NULL ); |
700 |
|
701 |
switch( paParent->mnOpenPDFDocumentAction ) |
702 |
{ |
703 |
default: |
704 |
case 0: |
705 |
maRbOActDefault.Check(); |
706 |
break; |
707 |
case 1: |
708 |
maRbOActPage.Check(); |
709 |
break; |
710 |
case 2: |
711 |
maRbOActWidth.Check(); |
712 |
break; |
713 |
case 3: |
714 |
maRbOActVisible.Check(); |
715 |
break; |
716 |
}; |
717 |
} |
718 |
|
719 |
// ----------------------------------------------------------------------------- |
720 |
void ImpPDFTabOpnFtrPage::Reset( const SfxItemSet& ignored) |
721 |
{ |
722 |
//set the controls to default values |
723 |
//since this is called just after the data are set from the parent tab dialog |
724 |
//a bool is needed to enable reset only the second time (user pressing it) |
725 |
if( mbResetAlreadyCalled ) |
726 |
{ |
727 |
maRbOpnDefault.Check(); |
728 |
maRbOpnOutline.Check(FALSE); |
729 |
maRbOpnThumbs.Check(FALSE); |
730 |
maRbOpnFull.Check(FALSE); |
731 |
|
732 |
maRbOActDefault.Check(); |
733 |
maRbOActPage.Check(FALSE); |
734 |
maRbOActWidth.Check(FALSE); |
735 |
maRbOActVisible.Check(FALSE); |
736 |
|
737 |
ToggleFullScreenHdl( NULL ); |
738 |
|
739 |
maRbNFSDefault.Check(); |
740 |
maRbNFSOutline.Check(FALSE); |
741 |
maRbNFSThumbs.Check(FALSE); |
742 |
} |
743 |
mbResetAlreadyCalled = sal_True; |
744 |
} |
745 |
|
746 |
// ----------------------------------------------------------------------------- |
747 |
IMPL_LINK( ImpPDFTabOpnFtrPage, ToggleFullScreenHdl, void*, p ) |
748 |
{ |
749 |
maRbNFSDefault.Enable( maRbOpnFull.IsChecked() ); |
750 |
maRbNFSOutline.Enable( maRbOpnFull.IsChecked() ); |
751 |
maRbNFSThumbs.Enable( maRbOpnFull.IsChecked() ); |
752 |
return 0; |
753 |
} |