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: dlgeps.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_goodies.hxx"
36 #include <tools/ref.hxx>
37 #include <vcl/msgbox.hxx>
38 #include <svtools/FilterConfigItem.hxx>
41 #include "strings.hrc"
43 /*************************************************************************
47 \************************************************************************/
49 DlgExportEPS::DlgExportEPS( FltCallDialogParameter
& rPara
) :
50 ModalDialog ( rPara
.pWindow
, ResId( DLG_EXPORT_EPS
, *rPara
.pResMgr
) ),
51 rFltCallPara ( rPara
),
52 aGrpPreview ( this, ResId( GRP_PREVIEW
, *rPara
.pResMgr
) ),
53 aCBPreviewTiff ( this, ResId( CB_PREVIEW_TIFF
, *rPara
.pResMgr
) ),
54 aCBPreviewEPSI ( this, ResId( CB_PREVIEW_EPSI
, *rPara
.pResMgr
) ),
55 aGrpVersion ( this, ResId( GRP_VERSION
, *rPara
.pResMgr
) ),
56 aRBLevel1 ( this, ResId( RB_LEVEL1
, *rPara
.pResMgr
) ),
57 aRBLevel2 ( this, ResId( RB_LEVEL2
, *rPara
.pResMgr
) ),
58 aGrpColor ( this, ResId( GRP_COLOR
, *rPara
.pResMgr
) ),
59 aRBColor ( this, ResId( RB_COLOR
, *rPara
.pResMgr
) ),
60 aRBGrayscale ( this, ResId( RB_GRAYSCALE
, *rPara
.pResMgr
) ),
61 aGrpCompression ( this, ResId( GRP_COMPRESSION
, *rPara
.pResMgr
) ),
62 aRBCompressionLZW ( this, ResId( RB_COMPRESSION_LZW
, *rPara
.pResMgr
) ),
63 aRBCompressionNone ( this, ResId( RB_COMPRESSION_NONE
, *rPara
.pResMgr
) ),
64 aBtnOK ( this, ResId( BTN_OK
, *rPara
.pResMgr
) ),
65 aBtnCancel ( this, ResId( BTN_CANCEL
, *rPara
.pResMgr
) ),
66 aBtnHelp ( this, ResId( BTN_HELP
, *rPara
.pResMgr
) ),
67 pMgr ( rPara
.pResMgr
)
71 String
aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/EPS" ) );
72 pConfigItem
= new FilterConfigItem( aFilterConfigPath
, &rPara
.aFilterData
);
74 // Config-Parameter lesen
75 String
sPreview( RTL_CONSTASCII_USTRINGPARAM( "Preview" ) );
76 String
sVersion( RTL_CONSTASCII_USTRINGPARAM( "Version" ) );
77 String
sColorFormat( RTL_CONSTASCII_USTRINGPARAM( "ColorFormat" ) );
78 String
sCompressionMode( RTL_CONSTASCII_USTRINGPARAM( "CompressionMode" ) );
79 String
sTextMode( RTL_CONSTASCII_USTRINGPARAM( "TextMode" ) );
81 sal_Int32 nPreview
= pConfigItem
->ReadInt32( sPreview
, 0 );
82 sal_Int32 nVersion
= pConfigItem
->ReadInt32( sVersion
, 2 );
83 sal_Int32 nColor
= pConfigItem
->ReadInt32( sColorFormat
, 0 );
84 sal_Int32 nCompr
= pConfigItem
->ReadInt32( sCompressionMode
, 2 );
86 /* SJ: The following line is not superfluous, reading the item will also #106652#
87 create the corresponding FilterData Property. Since all filter
88 are no longer accessing the configuration itself, we have fill the
89 FilterData sequence with all available configuration items */
90 pConfigItem
->ReadInt32( sTextMode
, 0 );
95 aCBPreviewTiff
.Check( bCheck
);
98 aCBPreviewEPSI
.Check( bCheck
);
103 aRBLevel1
.Check( bCheck
);
105 aRBLevel2
.Check( bCheck
);
110 aRBColor
.Check( bCheck
);
112 aRBGrayscale
.Check( bCheck
);
117 aRBCompressionLZW
.Check( bCheck
);
119 aRBCompressionNone
.Check( bCheck
);
121 if ( aRBLevel1
.IsChecked() )
124 aRBGrayscale
.Disable();
125 aRBCompressionNone
.Disable();
126 aRBCompressionLZW
.Disable();
127 aRBCompressionNone
.Disable();
130 aBtnOK
.SetClickHdl( LINK( this, DlgExportEPS
, OK
) );
131 aRBLevel1
.SetClickHdl( LINK( this, DlgExportEPS
, LEVEL1
) );
132 aRBLevel2
.SetClickHdl( LINK( this, DlgExportEPS
, LEVEL2
) );
135 DlgExportEPS::~DlgExportEPS()
140 /*************************************************************************
142 |* Speichert eingestellte Werte in ini-Datei
144 \************************************************************************/
146 IMPL_LINK( DlgExportEPS
, OK
, void *, EMPTYARG
)
149 // Config-Parameter schreiben
150 sal_Int32 nCheck
= 0;
151 if ( aCBPreviewTiff
.IsChecked() )
153 if ( aCBPreviewEPSI
.IsChecked() )
156 String
sPreview( RTL_CONSTASCII_USTRINGPARAM( "Preview" ) );
157 pConfigItem
->WriteInt32( sPreview
, nCheck
);
160 if ( aRBLevel2
.IsChecked() )
162 String
sVersion( RTL_CONSTASCII_USTRINGPARAM( "Version" ) );
163 pConfigItem
->WriteInt32( sVersion
, nCheck
);
166 if ( aRBGrayscale
.IsChecked() )
168 String
sColorFormat( RTL_CONSTASCII_USTRINGPARAM( "ColorFormat" ) );
169 pConfigItem
->WriteInt32( sColorFormat
, nCheck
);
172 if ( aRBCompressionNone
.IsChecked() )
174 String
sCompressionMode( RTL_CONSTASCII_USTRINGPARAM( "CompressionMode" ) );
175 pConfigItem
->WriteInt32( sCompressionMode
, nCheck
);
177 rFltCallPara
.aFilterData
= pConfigItem
->GetFilterData();
183 //------------------------------------------------------------------------
185 IMPL_LINK( DlgExportEPS
, LEVEL1
, void*, EMPTYARG
)
187 if ( aRBLevel1
.IsChecked() )
190 aRBGrayscale
.Disable();
191 aRBCompressionLZW
.Disable();
192 aRBCompressionNone
.Disable();
197 //------------------------------------------------------------------------
199 IMPL_LINK( DlgExportEPS
, LEVEL2
, void*, EMPTYARG
)
201 if ( aRBLevel2
.IsChecked() )
204 aRBGrayscale
.Enable();
205 aRBCompressionLZW
.Enable();
206 aRBCompressionNone
.Enable();