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 : #include <unotools/securityoptions.hxx>
21 : #include <svtools/stdctrl.hxx>
22 : #include <dialmgr.hxx>
23 : #include <cuires.hrc>
24 : #include "securityoptions.hxx"
25 : #include "securityoptions.hrc"
26 :
27 : namespace
28 : {
29 0 : bool enableAndSet( const SvtSecurityOptions& rOptions,
30 : SvtSecurityOptions::EOption eOption,
31 : CheckBox& rCheckBox, FixedImage& rFixedImage )
32 : {
33 0 : bool bEnable = rOptions.IsOptionEnabled( eOption );
34 0 : rCheckBox.Enable( bEnable );
35 0 : rFixedImage.Show( !bEnable );
36 0 : rCheckBox.Check( rOptions.IsOptionSet( eOption ) );
37 0 : return bEnable;
38 : }
39 : }
40 :
41 : //........................................................................
42 : namespace svx
43 : {
44 : //........................................................................
45 :
46 0 : SecurityOptionsDialog::SecurityOptionsDialog( Window* pParent, SvtSecurityOptions* pOptions ) :
47 0 : ModalDialog( pParent, CUI_RES( RID_SVXDLG_SECURITY_OPTIONS ) )
48 0 : ,m_aWarningsFL ( this, CUI_RES( FL_WARNINGS ) )
49 0 : ,m_aWarningsFI ( this, CUI_RES( FI_WARNINGS ) )
50 0 : ,m_aSaveOrSendDocsFI( this, CUI_RES( FI_SAVESENDDOCS ) )
51 0 : ,m_aSaveOrSendDocsCB( this, CUI_RES( CB_SAVESENDDOCS ) )
52 0 : ,m_aSignDocsFI ( this, CUI_RES( FI_SIGNDOCS ) )
53 0 : ,m_aSignDocsCB ( this, CUI_RES( CB_SIGNDOCS ) )
54 0 : ,m_aPrintDocsFI ( this, CUI_RES( FI_PRINTDOCS ) )
55 0 : ,m_aPrintDocsCB ( this, CUI_RES( CB_PRINTDOCS ) )
56 0 : ,m_aCreatePdfFI ( this, CUI_RES( FI_CREATEPDF ) )
57 0 : ,m_aCreatePdfCB ( this, CUI_RES( CB_CREATEPDF ) )
58 0 : ,m_aOptionsFL ( this, CUI_RES( FL_OPTIONS ) )
59 0 : ,m_aRemovePersInfoFI( this, CUI_RES( FI_REMOVEINFO ) )
60 0 : ,m_aRemovePersInfoCB( this, CUI_RES( CB_REMOVEINFO ) )
61 0 : ,m_aRecommPasswdFI ( this, CUI_RES( FI_RECOMMENDPWD ) )
62 0 : ,m_aRecommPasswdCB ( this, CUI_RES( CB_RECOMMENDPWD ) )
63 0 : ,m_aCtrlHyperlinkFI ( this, CUI_RES( FI_CTRLHYPERLINK ) )
64 0 : ,m_aCtrlHyperlinkCB ( this, CUI_RES( CB_CTRLHYPERLINK ) )
65 :
66 0 : ,m_aButtonsFL ( this, CUI_RES( FL_BUTTONS ) )
67 0 : ,m_aOKBtn ( this, CUI_RES( PB_OK ) )
68 0 : ,m_aCancelBtn ( this, CUI_RES( PB_CANCEL ) )
69 0 : ,m_aHelpBtn ( this, CUI_RES( PB_HELP ) )
70 :
71 : {
72 0 : FreeResource();
73 :
74 : DBG_ASSERT( pOptions, "SecurityOptionsDialog::SecurityOptionsDialog(): invalid SvtSecurityOptions" );
75 0 : enableAndSet( *pOptions, SvtSecurityOptions::E_DOCWARN_SAVEORSEND, m_aSaveOrSendDocsCB, m_aSaveOrSendDocsFI );
76 0 : enableAndSet( *pOptions, SvtSecurityOptions::E_DOCWARN_SIGNING, m_aSignDocsCB, m_aSignDocsFI );
77 0 : enableAndSet( *pOptions, SvtSecurityOptions::E_DOCWARN_PRINT, m_aPrintDocsCB, m_aPrintDocsFI );
78 0 : enableAndSet( *pOptions, SvtSecurityOptions::E_DOCWARN_CREATEPDF, m_aCreatePdfCB, m_aCreatePdfFI );
79 0 : enableAndSet( *pOptions, SvtSecurityOptions::E_DOCWARN_REMOVEPERSONALINFO, m_aRemovePersInfoCB, m_aRemovePersInfoFI );
80 0 : enableAndSet( *pOptions, SvtSecurityOptions::E_DOCWARN_RECOMMENDPASSWORD, m_aRecommPasswdCB, m_aRecommPasswdFI );
81 0 : enableAndSet( *pOptions, SvtSecurityOptions::E_CTRLCLICK_HYPERLINK, m_aCtrlHyperlinkCB, m_aCtrlHyperlinkFI );
82 0 : }
83 :
84 0 : SecurityOptionsDialog::~SecurityOptionsDialog()
85 : {
86 0 : }
87 :
88 : //........................................................................
89 : } // namespace svx
90 : //........................................................................
91 :
92 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|