Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 :
21 : #include "impswfdialog.hxx"
22 :
23 : using namespace com::sun::star::uno;
24 : using namespace com::sun::star::beans;
25 :
26 :
27 :
28 : // - ImpPDFDialog -
29 :
30 :
31 0 : ImpSWFDialog::ImpSWFDialog( vcl::Window* pParent, Sequence< PropertyValue >& rFilterData ) :
32 : ModalDialog( pParent, "ImpSWFDialog", "filter/ui/impswfdialog.ui" ),
33 :
34 0 : maConfigItem( "Office.Common/Filter/Flash/Export/", &rFilterData )
35 : {
36 0 : get(mpNumFldQuality,"quality");
37 0 : get(mpCheckExportAll,"exportall");
38 0 : get(mpCheckExportMultipleFiles,"exportmultiplefiles");
39 0 : get(mpCheckExportBackgrounds,"exportbackgrounds");
40 0 : get(mpCheckExportBackgroundObjects,"exportbackgroundobjects");
41 0 : get(mpCheckExportSlideContents,"exportslidecontents");
42 0 : get(mpCheckExportSound,"exportsound");
43 0 : get(mpCheckExportOLEAsJPEG,"exportoleasjpeg");
44 :
45 0 : const sal_uLong nCompressMode = maConfigItem.ReadInt32( "CompressMode", 75 );
46 0 : mpNumFldQuality->SetValue( nCompressMode );
47 :
48 0 : mpCheckExportAll->Check();
49 0 : mpCheckExportSlideContents->Check();
50 0 : mpCheckExportSound->Check();
51 :
52 0 : mpCheckExportAll->SetToggleHdl( LINK( this, ImpSWFDialog, OnToggleCheckbox ) );
53 :
54 0 : mpCheckExportBackgrounds->Disable();
55 0 : mpCheckExportBackgroundObjects->Disable();
56 0 : mpCheckExportSlideContents->Disable();
57 0 : }
58 :
59 :
60 :
61 0 : ImpSWFDialog::~ImpSWFDialog()
62 : {
63 0 : disposeOnce();
64 0 : }
65 :
66 0 : void ImpSWFDialog::dispose()
67 : {
68 0 : mpNumFldQuality.clear();
69 0 : mpCheckExportAll.clear();
70 0 : mpCheckExportBackgrounds.clear();
71 0 : mpCheckExportBackgroundObjects.clear();
72 0 : mpCheckExportSlideContents.clear();
73 0 : mpCheckExportSound.clear();
74 0 : mpCheckExportOLEAsJPEG.clear();
75 0 : mpCheckExportMultipleFiles.clear();
76 0 : maConfigItem.WriteModifiedConfig();
77 0 : ModalDialog::dispose();
78 0 : }
79 :
80 :
81 0 : Sequence< PropertyValue > ImpSWFDialog::GetFilterData()
82 : {
83 0 : sal_Int32 nCompressMode = (sal_Int32)mpNumFldQuality->GetValue();
84 0 : maConfigItem.WriteInt32( "CompressMode" , nCompressMode );
85 0 : maConfigItem.WriteBool( "ExportAll", mpCheckExportAll->IsChecked() );
86 0 : maConfigItem.WriteBool( "ExportBackgrounds", mpCheckExportBackgrounds->IsChecked() );
87 0 : maConfigItem.WriteBool( "ExportBackgroundObjects", mpCheckExportBackgroundObjects->IsChecked() );
88 0 : maConfigItem.WriteBool( "ExportSlideContents", mpCheckExportSlideContents->IsChecked() );
89 0 : maConfigItem.WriteBool( "ExportSound", mpCheckExportSound->IsChecked() );
90 0 : maConfigItem.WriteBool( "ExportOLEAsJPEG", mpCheckExportOLEAsJPEG->IsChecked() );
91 0 : maConfigItem.WriteBool( "ExportMultipleFiles", mpCheckExportMultipleFiles->IsChecked() );
92 :
93 0 : Sequence< PropertyValue > aRet( maConfigItem.GetFilterData() );
94 :
95 0 : return aRet;
96 : }
97 :
98 : // AS: This is called whenever the user toggles one of the checkboxes
99 0 : IMPL_LINK( ImpSWFDialog, OnToggleCheckbox, CheckBox*, pBox )
100 : {
101 0 : if (pBox == mpCheckExportAll)
102 : {
103 0 : mpCheckExportBackgrounds->Enable(!mpCheckExportBackgrounds->IsEnabled());
104 0 : mpCheckExportBackgroundObjects->Enable(!mpCheckExportBackgroundObjects->IsEnabled());
105 0 : mpCheckExportSlideContents->Enable(!mpCheckExportSlideContents->IsEnabled());
106 : }
107 :
108 0 : return 0;
109 3 : }
110 :
111 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|