LibreOffice Module cui (master)  1
securityoptions.cxx
Go to the documentation of this file.
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 <tools/debug.hxx>
22 #include "securityoptions.hxx"
23 
24 namespace
25 {
26  bool enableAndSet(const SvtSecurityOptions& rOptions,
28  weld::CheckButton& rCheckBox, weld::Widget& rFixedImage)
29  {
30  bool bEnable = rOptions.IsOptionEnabled(eOption);
31  rCheckBox.set_sensitive(bEnable);
32  rFixedImage.set_visible(!bEnable);
33  rCheckBox.set_active(rOptions.IsOptionSet(eOption));
34  return bEnable;
35  }
36 }
37 
38 namespace svx
39 {
40 
42  : GenericDialogController(pParent, "cui/ui/securityoptionsdialog.ui", "SecurityOptionsDialog")
43  , m_xSaveOrSendDocsCB(m_xBuilder->weld_check_button("savesenddocs"))
44  , m_xSaveOrSendDocsImg(m_xBuilder->weld_widget("locksavesenddocs"))
45  , m_xSignDocsCB(m_xBuilder->weld_check_button("whensigning"))
46  , m_xSignDocsImg(m_xBuilder->weld_widget("lockwhensigning"))
47  , m_xPrintDocsCB(m_xBuilder->weld_check_button("whenprinting"))
48  , m_xPrintDocsImg(m_xBuilder->weld_widget("lockwhenprinting"))
49  , m_xCreatePdfCB(m_xBuilder->weld_check_button("whenpdf"))
50  , m_xCreatePdfImg(m_xBuilder->weld_widget("lockwhenpdf"))
51  , m_xRemovePersInfoCB(m_xBuilder->weld_check_button("removepersonal"))
52  , m_xRemovePersInfoImg(m_xBuilder->weld_widget("lockremovepersonal"))
53  , m_xRecommPasswdCB(m_xBuilder->weld_check_button("password"))
54  , m_xRecommPasswdImg(m_xBuilder->weld_widget("lockpassword"))
55  , m_xCtrlHyperlinkCB(m_xBuilder->weld_check_button("ctrlclick"))
56  , m_xCtrlHyperlinkImg(m_xBuilder->weld_widget("lockctrlclick"))
57  , m_xBlockUntrustedRefererLinksCB(m_xBuilder->weld_check_button("blockuntrusted"))
58  , m_xBlockUntrustedRefererLinksImg(m_xBuilder->weld_widget("lockblockuntrusted"))
59 {
60  DBG_ASSERT( pOptions, "SecurityOptionsDialog::SecurityOptionsDialog(): invalid SvtSecurityOptions" );
77 }
78 
79 }
80 
81 
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool IsOptionSet(EOption eOption) const
std::unique_ptr< weld::CheckButton > m_xSaveOrSendDocsCB
std::unique_ptr< weld::Widget > m_xSaveOrSendDocsImg
std::unique_ptr< weld::Widget > m_xPrintDocsImg
std::unique_ptr< weld::CheckButton > m_xRemovePersInfoCB
std::unique_ptr< weld::CheckButton > m_xPrintDocsCB
std::unique_ptr< weld::Widget > m_xSignDocsImg
std::unique_ptr< weld::CheckButton > m_xRecommPasswdCB
virtual void set_active(bool active)=0
#define DBG_ASSERT(sCon, aError)
std::unique_ptr< weld::Widget > m_xRecommPasswdImg
std::unique_ptr< weld::CheckButton > m_xCtrlHyperlinkCB
std::unique_ptr< weld::CheckButton > m_xCreatePdfCB
std::unique_ptr< weld::Widget > m_xBlockUntrustedRefererLinksImg
SecurityOptionsDialog(weld::Window *pParent, SvtSecurityOptions const *pOptions)
std::unique_ptr< weld::CheckButton > m_xSignDocsCB
bool IsOptionEnabled(EOption eOption) const
std::unique_ptr< weld::Widget > m_xCtrlHyperlinkImg
std::unique_ptr< weld::Widget > m_xCreatePdfImg
virtual void set_visible(bool visible)
virtual void set_sensitive(bool sensitive)=0
std::unique_ptr< weld::Widget > m_xRemovePersInfoImg
std::unique_ptr< weld::CheckButton > m_xBlockUntrustedRefererLinksCB