bump product version to 5.0.4.1
[LibreOffice.git] / cui / source / options / securityoptions.cxx
bloba7b7881208495302e68889c6e39ca87fc832f936
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <unotools/securityoptions.hxx>
21 #include <svtools/stdctrl.hxx>
22 #include <dialmgr.hxx>
23 #include <cuires.hrc>
24 #include "securityoptions.hxx"
26 namespace
28 bool enableAndSet( const SvtSecurityOptions& rOptions,
29 SvtSecurityOptions::EOption eOption,
30 CheckBox& rCheckBox, FixedImage& rFixedImage )
32 bool bEnable = rOptions.IsOptionEnabled( eOption );
33 rCheckBox.Enable( bEnable );
34 rFixedImage.Show( !bEnable );
35 rCheckBox.Check( rOptions.IsOptionSet( eOption ) );
36 return bEnable;
41 namespace svx
45 SecurityOptionsDialog::SecurityOptionsDialog(vcl::Window* pParent, SvtSecurityOptions* pOptions)
46 : ModalDialog(pParent, "SecurityOptionsDialog", "cui/ui/securityoptionsdialog.ui")
48 DBG_ASSERT( pOptions, "SecurityOptionsDialog::SecurityOptionsDialog(): invalid SvtSecurityOptions" );
49 get(m_pSaveOrSendDocsCB, "savesenddocs");
50 enableAndSet(*pOptions, SvtSecurityOptions::E_DOCWARN_SAVEORSEND, *m_pSaveOrSendDocsCB,
51 *get<FixedImage>("locksavesenddocs"));
52 get(m_pSignDocsCB, "whensigning");
53 enableAndSet(*pOptions, SvtSecurityOptions::E_DOCWARN_SIGNING, *m_pSignDocsCB,
54 *get<FixedImage>("lockwhensigning"));
55 get(m_pPrintDocsCB, "whenprinting");
56 enableAndSet(*pOptions, SvtSecurityOptions::E_DOCWARN_PRINT, *m_pPrintDocsCB,
57 *get<FixedImage>("lockwhenprinting"));
58 get(m_pCreatePdfCB, "whenpdf");
59 enableAndSet(*pOptions, SvtSecurityOptions::E_DOCWARN_CREATEPDF, *m_pCreatePdfCB,
60 *get<FixedImage>("lockwhenpdf"));
61 get(m_pRemovePersInfoCB, "removepersonal");
62 enableAndSet(*pOptions, SvtSecurityOptions::E_DOCWARN_REMOVEPERSONALINFO, *m_pRemovePersInfoCB,
63 *get<FixedImage>("lockremovepersonal"));
64 get(m_pRecommPasswdCB, "password");
65 enableAndSet(*pOptions, SvtSecurityOptions::E_DOCWARN_RECOMMENDPASSWORD, *m_pRecommPasswdCB,
66 *get<FixedImage>("lockpassword"));
67 get(m_pCtrlHyperlinkCB, "ctrlclick");
68 enableAndSet(*pOptions, SvtSecurityOptions::E_CTRLCLICK_HYPERLINK, *m_pCtrlHyperlinkCB,
69 *get<FixedImage>("lockctrlclick"));
70 get(m_pBlockUntrustedRefererLinksCB, "blockuntrusted");
71 enableAndSet(*pOptions, SvtSecurityOptions::E_BLOCKUNTRUSTEDREFERERLINKS, *m_pBlockUntrustedRefererLinksCB,
72 *get<FixedImage>("lockblockuntrusted"));
75 SecurityOptionsDialog::~SecurityOptionsDialog()
77 disposeOnce();
80 void SecurityOptionsDialog::dispose()
82 m_pSaveOrSendDocsCB.clear();
83 m_pSignDocsCB.clear();
84 m_pPrintDocsCB.clear();
85 m_pCreatePdfCB.clear();
86 m_pRemovePersInfoCB.clear();
87 m_pRecommPasswdCB.clear();
88 m_pCtrlHyperlinkCB.clear();
89 m_pBlockUntrustedRefererLinksCB.clear();
90 ModalDialog::dispose();
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */