LibreOffice Module xmlsecurity (master) 1
macrosecurity.hxx
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#pragma once
21
22#include <vcl/weld.hxx>
24
25namespace com::sun::star::xml::crypto { class XSecurityEnvironment; }
26class MacroSecurityTP;
27
29{
30private:
33
34 css::uno::Reference<css::xml::crypto::XSecurityEnvironment> m_xSecurityEnvironment;
35
36 std::unique_ptr<weld::Notebook> m_xTabCtrl;
37 std::unique_ptr<weld::Button> m_xOkBtn;
38 std::unique_ptr<weld::Button> m_xResetBtn;
39
40 std::unique_ptr<MacroSecurityTP> m_xLevelTP;
41 std::unique_ptr<MacroSecurityTP> m_xTrustSrcTP;
42
43 DECL_LINK(ActivatePageHdl, const OUString&, void);
44 DECL_LINK(OkBtnHdl, weld::Button&, void);
45public:
47 css::uno::Reference<css::xml::crypto::XSecurityEnvironment> xSecurityEnvironment);
48
49 void EnableReset(bool bEnable = true)
50 {
51 m_xResetBtn->set_sensitive(bEnable);
52 }
53};
54
56{
57protected:
58 std::unique_ptr<weld::Builder> m_xBuilder;
59 std::unique_ptr<weld::Container> m_xContainer;
60
62public:
63 MacroSecurityTP(weld::Container* pParent, const OUString& rUIXMLDescription,
64 const OUString& rID, MacroSecurity* pDlg);
65 virtual ~MacroSecurityTP();
66
67 virtual void ActivatePage();
68 virtual void ClosePage() = 0;
69};
70
72{
73private:
74 sal_uInt16 mnCurLevel;
75
76 std::unique_ptr<weld::RadioButton> m_xVeryHighRB;
77 std::unique_ptr<weld::RadioButton> m_xHighRB;
78 std::unique_ptr<weld::RadioButton> m_xMediumRB;
79 std::unique_ptr<weld::RadioButton> m_xLowRB;
80 std::unique_ptr<weld::Widget> m_xVHighImg;
81 std::unique_ptr<weld::Widget> m_xHighImg;
82 std::unique_ptr<weld::Widget> m_xMedImg;
83 std::unique_ptr<weld::Widget> m_xLowImg;
84
85 DECL_LINK(RadioButtonHdl, weld::Toggleable&, void);
86public:
88 virtual void ClosePage() override;
89};
90
92{
93private:
94 std::vector< SvtSecurityOptions::Certificate > m_aTrustedAuthors;
95
98
99 std::unique_ptr<weld::Image> m_xTrustCertROFI;
100 std::unique_ptr<weld::TreeView> m_xTrustCertLB;
101 std::unique_ptr<weld::Button> m_xViewCertPB;
102 std::unique_ptr<weld::Button> m_xRemoveCertPB;
103 std::unique_ptr<weld::Image> m_xTrustFileROFI;
104 std::unique_ptr<weld::TreeView> m_xTrustFileLocLB;
105 std::unique_ptr<weld::Button> m_xAddLocPB;
106 std::unique_ptr<weld::Button> m_xRemoveLocPB;
107
108 DECL_LINK(ViewCertPBHdl, weld::Button&, void);
109 DECL_LINK(RemoveCertPBHdl, weld::Button&, void);
110 DECL_LINK(AddLocPBHdl, weld::Button&, void);
111 DECL_LINK(RemoveLocPBHdl, weld::Button&, void);
112 DECL_LINK(TrustCertLBSelectHdl, weld::TreeView&, void);
113 DECL_LINK(TrustFileLocLBSelectHdl, weld::TreeView&, void);
114
115 void FillCertLB(const bool bShowWarnings = false);
116 void ImplCheckButtons();
117 void ShowBrokenCertificateError(std::u16string_view rData);
118
119public:
121
122 virtual void ActivatePage() override;
123 virtual void ClosePage() override;
124};
125
126/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::RadioButton > m_xHighRB
std::unique_ptr< weld::RadioButton > m_xLowRB
DECL_LINK(RadioButtonHdl, weld::Toggleable &, void)
MacroSecurityLevelTP(weld::Container *pParent, MacroSecurity *pDlg)
std::unique_ptr< weld::Widget > m_xVHighImg
std::unique_ptr< weld::Widget > m_xLowImg
virtual void ClosePage() override
std::unique_ptr< weld::RadioButton > m_xMediumRB
std::unique_ptr< weld::RadioButton > m_xVeryHighRB
std::unique_ptr< weld::Widget > m_xMedImg
std::unique_ptr< weld::Widget > m_xHighImg
virtual ~MacroSecurityTP()
virtual void ActivatePage()
MacroSecurity * m_pDlg
virtual void ClosePage()=0
MacroSecurityTP(weld::Container *pParent, const OUString &rUIXMLDescription, const OUString &rID, MacroSecurity *pDlg)
std::unique_ptr< weld::Builder > m_xBuilder
std::unique_ptr< weld::Container > m_xContainer
std::unique_ptr< weld::Button > m_xAddLocPB
std::unique_ptr< weld::TreeView > m_xTrustCertLB
std::unique_ptr< weld::Button > m_xRemoveCertPB
void FillCertLB(const bool bShowWarnings=false)
std::unique_ptr< weld::TreeView > m_xTrustFileLocLB
DECL_LINK(RemoveLocPBHdl, weld::Button &, void)
MacroSecurityTrustedSourcesTP(weld::Container *pParent, MacroSecurity *pDlg)
DECL_LINK(TrustFileLocLBSelectHdl, weld::TreeView &, void)
DECL_LINK(ViewCertPBHdl, weld::Button &, void)
std::unique_ptr< weld::Image > m_xTrustCertROFI
virtual void ActivatePage() override
virtual void ClosePage() override
std::vector< SvtSecurityOptions::Certificate > m_aTrustedAuthors
DECL_LINK(RemoveCertPBHdl, weld::Button &, void)
std::unique_ptr< weld::Button > m_xRemoveLocPB
std::unique_ptr< weld::Image > m_xTrustFileROFI
void ShowBrokenCertificateError(std::u16string_view rData)
std::unique_ptr< weld::Button > m_xViewCertPB
DECL_LINK(AddLocPBHdl, weld::Button &, void)
DECL_LINK(TrustCertLBSelectHdl, weld::TreeView &, void)
DECL_LINK(OkBtnHdl, weld::Button &, void)
MacroSecurity(weld::Window *pParent, css::uno::Reference< css::xml::crypto::XSecurityEnvironment > xSecurityEnvironment)
std::unique_ptr< weld::Notebook > m_xTabCtrl
DECL_LINK(ActivatePageHdl, const OUString &, void)
css::uno::Reference< css::xml::crypto::XSecurityEnvironment > m_xSecurityEnvironment
void EnableReset(bool bEnable=true)
std::unique_ptr< weld::Button > m_xOkBtn
std::unique_ptr< MacroSecurityTP > m_xLevelTP
std::unique_ptr< MacroSecurityTP > m_xTrustSrcTP
std::unique_ptr< weld::Button > m_xResetBtn