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: dlgegif.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"
35 #include <tools/ref.hxx>
36 #include <svtools/FilterConfigItem.hxx>
37 #include <vcl/msgbox.hxx>
38 #include "dlgegif.hxx"
39 #include "dlgegif.hrc"
40 #include "strings.hrc"
42 /*************************************************************************
46 \************************************************************************/
48 DlgExportEGIF::DlgExportEGIF( FltCallDialogParameter
& rPara
) :
49 ModalDialog ( rPara
.pWindow
, ResId( DLG_EXPORT_GIF
, *rPara
.pResMgr
) ),
50 rFltCallPara ( rPara
),
51 aCbxInterlaced ( this, ResId( CBX_INTERLACED
, *rPara
.pResMgr
) ),
52 aCbxTranslucent ( this, ResId( CBX_TRANSLUCENT
, *rPara
.pResMgr
) ),
53 aGrpMode ( this, ResId( GRP_MODE
, *rPara
.pResMgr
) ),
54 aGrpDraw ( this, ResId( GRP_DRAW
, *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
)
62 String
aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/GIF" ) );
63 pConfigItem
= new FilterConfigItem( aFilterConfigPath
, &rPara
.aFilterData
);
65 String
aInterlaceStr( ResId( KEY_INTER
, *pMgr
) );
66 String
aTranslucentStr( ResId( KEY_TRANS
, *pMgr
) );
67 // Config-Parameter lesen
68 sal_Bool bInterlaced
= pConfigItem
->ReadInt32( aInterlaceStr
, 1 ) != 0;
69 sal_Bool bTranslucent
= pConfigItem
->ReadInt32( aTranslucentStr
, 1 ) != 0;
71 aCbxInterlaced
.Check( bInterlaced
);
72 aCbxTranslucent
.Check( bTranslucent
);
74 aBtnOK
.SetClickHdl( LINK( this, DlgExportEGIF
, OK
) );
77 DlgExportEGIF::~DlgExportEGIF()
82 /*************************************************************************
84 |* Speichert eingestellte Werte in ini-Datei
86 \************************************************************************/
88 IMPL_LINK( DlgExportEGIF
, OK
, void *, EMPTYARG
)
91 // Config-Parameter schreiben
92 String
aInterlaceStr( ResId( KEY_INTER
, *pMgr
) );
93 String
aTranslucentStr( ResId( KEY_TRANS
, *pMgr
) );
96 if ( aCbxInterlaced
.IsChecked() )
98 pConfigItem
->WriteInt32( aInterlaceStr
, nValue
);
101 if ( aCbxTranslucent
.IsChecked() )
103 pConfigItem
->WriteInt32( aTranslucentStr
, nValue
);
104 rFltCallPara
.aFilterData
= pConfigItem
->GetFilterData();