update dev300-m58
[ooovba.git] / svtools / source / filter.vcl / filter / dlgepng.cxx
blob486aa13eb9dda4ae45cac77b59aa3c05022fab19
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dlgepng.cxx,v $
10 * $Revision: 1.10 $
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_svtools.hxx"
33 #include <tools/ref.hxx>
34 #include <vcl/msgbox.hxx>
35 #include "dlgepng.hxx"
36 #include "dlgepng.hrc"
38 using namespace ::rtl;
39 using namespace ::com::sun::star::uno;
41 /*************************************************************************
43 |* Ctor
45 \************************************************************************/
47 DlgExportEPNG::DlgExportEPNG( FltCallDialogParameter& rPara ) :
48 ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_EPNG, *rPara.pResMgr ) ),
49 FilterConfigItem ( OUString( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/PNG" ) ), &rPara.aFilterData ),
50 rFltCallPara ( rPara ),
51 aGrpCompression ( this, ResId( GRP_COMPRESSION, *rPara.pResMgr ) ),
52 aFiCompression ( this, ResId( FI_COMPRESSION, *rPara.pResMgr ) ),
53 aNumCompression ( this, ResId( NUM_COMPRESSION, *rPara.pResMgr ) ),
54 aCbxInterlaced ( this, ResId( CBX_INTERLACED, *rPara.pResMgr ) ),
55 aBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ),
56 aBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ),
57 aBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ),
58 pMgr ( rPara.pResMgr )
60 FreeResource();
62 // Config-Parameter lesen
63 sal_Int32 nCompression = ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Compression" ) ), 6 );
64 if ( ( nCompression < 0 ) || ( nCompression > 9 ) )
65 nCompression = 6;
66 aNumCompression.SetValue( nCompression );
68 sal_Int32 nInterlaced = ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), 0 );
69 sal_Bool bInterlaced = nInterlaced != 0;
70 aCbxInterlaced.Check( bInterlaced );
72 aBtnOK.SetClickHdl( LINK( this, DlgExportEPNG, OK ) );
75 /*************************************************************************
77 |* Speichert eingestellte Werte in ini-Datei
79 \************************************************************************/
81 IMPL_LINK( DlgExportEPNG, OK, void *, EMPTYARG )
83 // Config-Parameter schreiben
84 WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Compression" ) ), static_cast<sal_Int32>(aNumCompression.GetValue()) );
85 sal_Int32 nInterlace = 0;
86 if ( aCbxInterlaced.IsChecked() )
87 nInterlace++;
88 WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), nInterlace );
89 rFltCallPara.aFilterData = GetFilterData();
90 EndDialog( RET_OK );
92 return 0;