1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_cui.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir // include ---------------------------------------------------------------
32*cdf0e10cSrcweir 
33*cdf0e10cSrcweir #include <unotools/securityoptions.hxx>
34*cdf0e10cSrcweir #include <svtools/stdctrl.hxx>
35*cdf0e10cSrcweir #include <dialmgr.hxx>
36*cdf0e10cSrcweir #include <cuires.hrc>
37*cdf0e10cSrcweir #include "securityoptions.hxx"
38*cdf0e10cSrcweir #include "securityoptions.hrc"
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir namespace
41*cdf0e10cSrcweir {
42*cdf0e10cSrcweir     bool enableAndSet( const SvtSecurityOptions& rOptions,
43*cdf0e10cSrcweir                        SvtSecurityOptions::EOption eOption,
44*cdf0e10cSrcweir                        CheckBox& rCheckBox, FixedImage& rFixedImage )
45*cdf0e10cSrcweir     {
46*cdf0e10cSrcweir         bool bEnable = rOptions.IsOptionEnabled( eOption );
47*cdf0e10cSrcweir         rCheckBox.Enable( bEnable );
48*cdf0e10cSrcweir         rFixedImage.Show( !bEnable );
49*cdf0e10cSrcweir         rCheckBox.Check( rOptions.IsOptionSet( eOption ) );
50*cdf0e10cSrcweir         return bEnable;
51*cdf0e10cSrcweir     }
52*cdf0e10cSrcweir }
53*cdf0e10cSrcweir 
54*cdf0e10cSrcweir //........................................................................
55*cdf0e10cSrcweir namespace svx
56*cdf0e10cSrcweir {
57*cdf0e10cSrcweir //........................................................................
58*cdf0e10cSrcweir 
59*cdf0e10cSrcweir SecurityOptionsDialog::SecurityOptionsDialog( Window* pParent, SvtSecurityOptions* pOptions ) :
60*cdf0e10cSrcweir      ModalDialog( pParent, CUI_RES( RID_SVXDLG_SECURITY_OPTIONS ) )
61*cdf0e10cSrcweir     ,m_aWarningsFL      ( this, CUI_RES( FL_WARNINGS ) )
62*cdf0e10cSrcweir     ,m_aWarningsFI      ( this, CUI_RES( FI_WARNINGS ) )
63*cdf0e10cSrcweir     ,m_aSaveOrSendDocsFI( this, CUI_RES( FI_SAVESENDDOCS ) )
64*cdf0e10cSrcweir     ,m_aSaveOrSendDocsCB( this, CUI_RES( CB_SAVESENDDOCS ) )
65*cdf0e10cSrcweir     ,m_aSignDocsFI      ( this, CUI_RES( FI_SIGNDOCS ) )
66*cdf0e10cSrcweir     ,m_aSignDocsCB      ( this, CUI_RES( CB_SIGNDOCS ) )
67*cdf0e10cSrcweir     ,m_aPrintDocsFI     ( this, CUI_RES( FI_PRINTDOCS ) )
68*cdf0e10cSrcweir     ,m_aPrintDocsCB     ( this, CUI_RES( CB_PRINTDOCS ) )
69*cdf0e10cSrcweir     ,m_aCreatePdfFI     ( this, CUI_RES( FI_CREATEPDF ) )
70*cdf0e10cSrcweir     ,m_aCreatePdfCB     ( this, CUI_RES( CB_CREATEPDF ) )
71*cdf0e10cSrcweir     ,m_aOptionsFL       ( this, CUI_RES( FL_OPTIONS ) )
72*cdf0e10cSrcweir     ,m_aRemovePersInfoFI( this, CUI_RES( FI_REMOVEINFO ) )
73*cdf0e10cSrcweir     ,m_aRemovePersInfoCB( this, CUI_RES( CB_REMOVEINFO ) )
74*cdf0e10cSrcweir     ,m_aRecommPasswdFI  ( this, CUI_RES( FI_RECOMMENDPWD ) )
75*cdf0e10cSrcweir     ,m_aRecommPasswdCB  ( this, CUI_RES( CB_RECOMMENDPWD ) )
76*cdf0e10cSrcweir     ,m_aCtrlHyperlinkFI ( this, CUI_RES( FI_CTRLHYPERLINK ) )
77*cdf0e10cSrcweir     ,m_aCtrlHyperlinkCB ( this, CUI_RES( CB_CTRLHYPERLINK ) )
78*cdf0e10cSrcweir 
79*cdf0e10cSrcweir     ,m_aButtonsFL       ( this, CUI_RES( FL_BUTTONS ) )
80*cdf0e10cSrcweir     ,m_aOKBtn           ( this, CUI_RES( PB_OK ) )
81*cdf0e10cSrcweir     ,m_aCancelBtn       ( this, CUI_RES( PB_CANCEL ) )
82*cdf0e10cSrcweir     ,m_aHelpBtn         ( this, CUI_RES( PB_HELP ) )
83*cdf0e10cSrcweir 
84*cdf0e10cSrcweir {
85*cdf0e10cSrcweir     FreeResource();
86*cdf0e10cSrcweir 
87*cdf0e10cSrcweir     DBG_ASSERT( pOptions, "SecurityOptionsDialog::SecurityOptionsDialog(): invalid SvtSecurityOptions" );
88*cdf0e10cSrcweir     enableAndSet( *pOptions, SvtSecurityOptions::E_DOCWARN_SAVEORSEND, m_aSaveOrSendDocsCB, m_aSaveOrSendDocsFI );
89*cdf0e10cSrcweir     enableAndSet( *pOptions, SvtSecurityOptions::E_DOCWARN_SIGNING, m_aSignDocsCB, m_aSignDocsFI );
90*cdf0e10cSrcweir     enableAndSet( *pOptions, SvtSecurityOptions::E_DOCWARN_PRINT, m_aPrintDocsCB, m_aPrintDocsFI );
91*cdf0e10cSrcweir     enableAndSet( *pOptions, SvtSecurityOptions::E_DOCWARN_CREATEPDF, m_aCreatePdfCB, m_aCreatePdfFI );
92*cdf0e10cSrcweir     enableAndSet( *pOptions, SvtSecurityOptions::E_DOCWARN_REMOVEPERSONALINFO, m_aRemovePersInfoCB, m_aRemovePersInfoFI );
93*cdf0e10cSrcweir     enableAndSet( *pOptions, SvtSecurityOptions::E_DOCWARN_RECOMMENDPASSWORD, m_aRecommPasswdCB, m_aRecommPasswdFI );
94*cdf0e10cSrcweir     enableAndSet( *pOptions, SvtSecurityOptions::E_CTRLCLICK_HYPERLINK, m_aCtrlHyperlinkCB, m_aCtrlHyperlinkFI );
95*cdf0e10cSrcweir }
96*cdf0e10cSrcweir 
97*cdf0e10cSrcweir SecurityOptionsDialog::~SecurityOptionsDialog()
98*cdf0e10cSrcweir {
99*cdf0e10cSrcweir }
100*cdf0e10cSrcweir 
101*cdf0e10cSrcweir //........................................................................
102*cdf0e10cSrcweir }   // namespace svx
103*cdf0e10cSrcweir //........................................................................
104*cdf0e10cSrcweir 
105