1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: impswfdialog.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_filter.hxx"
34 #include "impswfdialog.hxx"
35 #include "impswfdialog.hrc"
38 using namespace com::sun::star::uno
;
39 using namespace com::sun::star::beans
;
45 ImpSWFDialog::ImpSWFDialog( Window
* pParent
, ResMgr
& rResMgr
, Sequence
< PropertyValue
>& rFilterData
) :
46 ModalDialog( pParent
, ResId( DLG_OPTIONS
, rResMgr
) ),
47 maFiDescr( this, ResId( FI_DESCR
, rResMgr
) ),
48 maNumFldQuality( this, ResId( NUM_FLD_QUALITY
, rResMgr
) ),
49 maFiExportAllDescr( this, ResId( FI_EXPORT_ALL_DESCR
, rResMgr
) ),
50 maCheckExportAll( this, ResId( BOOL_EXPORT_ALL
, rResMgr
) ),
51 maFiExportBackgroundsDescr( this, ResId( FI_EXPORT_BACKGROUNDS_DESCR
, rResMgr
) ),
52 maCheckExportBackgrounds( this, ResId( BOOL_EXPORT_BACKGROUNDS
, rResMgr
) ),
53 maFiExportBackgroundObjectsDescr( this, ResId( FI_EXPORT_BACKGROUND_OBJECTS_DESCR
, rResMgr
) ),
54 maCheckExportBackgroundObjects( this, ResId( BOOL_EXPORT_BACKGROUND_OBJECTS
, rResMgr
) ),
55 maFiExportSlideContentsDescr( this, ResId( FI_EXPORT_SLIDE_CONTENTS_DESCR
, rResMgr
) ),
56 maCheckExportSlideContents( this, ResId( BOOL_EXPORT_SLIDE_CONTENTS
, rResMgr
) ),
57 maFiExportSoundDescr( this, ResId( FI_EXPORT_SOUND_DESCR
, rResMgr
) ),
58 maCheckExportSound( this, ResId( BOOL_EXPORT_SOUND
, rResMgr
) ),
59 maFiExportOLEAsJPEGDescr( this, ResId( FI_EXPORT_OLE_AS_JPEG_DESCR
, rResMgr
) ),
60 maCheckExportOLEAsJPEG( this, ResId( BOOL_EXPORT_OLE_AS_JPEG
, rResMgr
) ),
61 maFiExportMultipleFilesDescr( this, ResId( FI_EXPORT_MULTIPLE_FILES_DESCR
, rResMgr
) ),
62 maCheckExportMultipleFiles( this, ResId( BOOL_EXPORT_MULTIPLE_FILES
, rResMgr
) ),
64 maBtnOK( this, ResId( BTN_OK
, rResMgr
) ),
65 maBtnCancel( this, ResId( BTN_CANCEL
, rResMgr
) ),
66 maBtnHelp( this, ResId( BTN_HELP
, rResMgr
) ),
67 maConfigItem( String( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Flash/Export/" ) ), &rFilterData
)
69 const ULONG nCompressMode
= maConfigItem
.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "CompressMode" ) ), 75 );
70 maNumFldQuality
.SetValue( nCompressMode
);
72 maCheckExportAll
.Check();
73 maCheckExportSlideContents
.Check();
74 maCheckExportSound
.Check();
76 maCheckExportAll
.SetToggleHdl( LINK( this, ImpSWFDialog
, OnToggleCheckbox
) );
78 maCheckExportBackgrounds
.Disable(); maFiExportBackgroundsDescr
.Disable();
79 maCheckExportBackgroundObjects
.Disable(); maFiExportBackgroundObjectsDescr
.Disable();
80 maCheckExportSlideContents
.Disable(); maFiExportSlideContentsDescr
.Disable();
83 maCheckExportMultipleFiles
.Check();
89 // -----------------------------------------------------------------------------
91 ImpSWFDialog::~ImpSWFDialog()
95 // -----------------------------------------------------------------------------
97 Sequence
< PropertyValue
> ImpSWFDialog::GetFilterData()
99 sal_Int32 nCompressMode
= (sal_Int32
)maNumFldQuality
.GetValue();
100 maConfigItem
.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "CompressMode" ) ), nCompressMode
);
101 maConfigItem
.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportAll" ) ), maCheckExportAll
.IsChecked() );
102 maConfigItem
.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportBackgrounds" ) ), maCheckExportBackgrounds
.IsChecked() );
103 maConfigItem
.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportBackgroundObjects" ) ), maCheckExportBackgroundObjects
.IsChecked() );
104 maConfigItem
.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportSlideContents" ) ), maCheckExportSlideContents
.IsChecked() );
105 maConfigItem
.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportSound" ) ), maCheckExportSound
.IsChecked() );
106 maConfigItem
.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportOLEAsJPEG" ) ), maCheckExportOLEAsJPEG
.IsChecked() );
107 maConfigItem
.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportMultipleFiles" ) ), maCheckExportMultipleFiles
.IsChecked() );
109 Sequence
< PropertyValue
> aRet( maConfigItem
.GetFilterData() );
114 // AS: This is called whenever the user toggles one of the checkboxes
115 IMPL_LINK( ImpSWFDialog
, OnToggleCheckbox
, CheckBox
*, pBox
)
117 if (pBox
== &maCheckExportAll
)
119 maCheckExportBackgrounds
.Enable(!maCheckExportBackgrounds
.IsEnabled());
120 maFiExportBackgroundsDescr
.Enable(!maFiExportBackgroundsDescr
.IsEnabled());
121 maCheckExportBackgroundObjects
.Enable(!maCheckExportBackgroundObjects
.IsEnabled());
122 maFiExportBackgroundObjectsDescr
.Enable(!maFiExportBackgroundObjectsDescr
.IsEnabled());
123 maCheckExportSlideContents
.Enable(!maCheckExportSlideContents
.IsEnabled());
124 maFiExportSlideContentsDescr
.Enable(!maFiExportSlideContentsDescr
.IsEnabled());