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( 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 : }
64 :
65 :
66 :
67 0 : Sequence< PropertyValue > ImpSWFDialog::GetFilterData()
68 : {
69 0 : sal_Int32 nCompressMode = (sal_Int32)mpNumFldQuality->GetValue();
70 0 : maConfigItem.WriteInt32( "CompressMode" , nCompressMode );
71 0 : maConfigItem.WriteBool( "ExportAll", mpCheckExportAll->IsChecked() );
72 0 : maConfigItem.WriteBool( "ExportBackgrounds", mpCheckExportBackgrounds->IsChecked() );
73 0 : maConfigItem.WriteBool( "ExportBackgroundObjects", mpCheckExportBackgroundObjects->IsChecked() );
74 0 : maConfigItem.WriteBool( "ExportSlideContents", mpCheckExportSlideContents->IsChecked() );
75 0 : maConfigItem.WriteBool( "ExportSound", mpCheckExportSound->IsChecked() );
76 0 : maConfigItem.WriteBool( "ExportOLEAsJPEG", mpCheckExportOLEAsJPEG->IsChecked() );
77 0 : maConfigItem.WriteBool( "ExportMultipleFiles", mpCheckExportMultipleFiles->IsChecked() );
78 :
79 0 : Sequence< PropertyValue > aRet( maConfigItem.GetFilterData() );
80 :
81 0 : return aRet;
82 : }
83 :
84 : // AS: This is called whenever the user toggles one of the checkboxes
85 0 : IMPL_LINK( ImpSWFDialog, OnToggleCheckbox, CheckBox*, pBox )
86 : {
87 0 : if (pBox == mpCheckExportAll)
88 : {
89 0 : mpCheckExportBackgrounds->Enable(!mpCheckExportBackgrounds->IsEnabled());
90 0 : mpCheckExportBackgroundObjects->Enable(!mpCheckExportBackgroundObjects->IsEnabled());
91 0 : mpCheckExportSlideContents->Enable(!mpCheckExportSlideContents->IsEnabled());
92 : }
93 :
94 0 : return 0;
95 : }
96 :
97 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|