1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #ifndef INCLUDED_XMLSECURITY_INC_MACROSECURITY_HXX
21 #define INCLUDED_XMLSECURITY_INC_MACROSECURITY_HXX
23 #include <vcl/fixed.hxx>
24 #include <vcl/button.hxx>
25 #include <vcl/lstbox.hxx>
26 #include <vcl/tabdlg.hxx>
27 #include <vcl/tabctrl.hxx>
28 #include <vcl/tabpage.hxx>
29 #include <svtools/simptabl.hxx>
30 #include <unotools/securityoptions.hxx>
32 #include <com/sun/star/uno/XComponentContext.hpp>
37 namespace xml
{ namespace crypto
{
38 class XSecurityEnvironment
; }}
41 class MacroSecurityTP
;
43 class MacroSecurity
: public TabDialog
46 friend class MacroSecurityLevelTP
;
47 friend class MacroSecurityTrustedSourcesTP
;
49 VclPtr
<TabControl
> m_pTabCtrl
;
50 VclPtr
<OKButton
> m_pOkBtn
;
51 VclPtr
<PushButton
> m_pResetBtn
;
53 css::uno::Reference
< css::xml::crypto::XSecurityEnvironment
> mxSecurityEnvironment
;
54 SvtSecurityOptions maSecOptions
;
56 sal_uInt16 m_nSecLevelId
;
57 sal_uInt16 m_nSecTrustId
;
59 VclPtr
<MacroSecurityTP
> mpLevelTP
;
60 VclPtr
<MacroSecurityTP
> mpTrustSrcTP
;
62 DECL_LINK( OkBtnHdl
, Button
*, void );
64 MacroSecurity(vcl::Window
* pParent
,
65 const css::uno::Reference
< css::xml::crypto::XSecurityEnvironment
>& rxSecurityEnvironment
);
66 virtual ~MacroSecurity() override
;
67 virtual void dispose() override
;
69 void EnableReset(bool _bEnable
= true)
71 m_pResetBtn
->Enable ( _bEnable
);
75 class MacroSecurityTP
: public TabPage
78 VclPtr
<MacroSecurity
> mpDlg
;
80 MacroSecurityTP(vcl::Window
* _pParent
, const OString
& rID
,
81 const OUString
& rUIXMLDescription
, MacroSecurity
* _pDlg
);
82 virtual ~MacroSecurityTP() override
;
83 virtual void dispose() override
;
85 virtual void ClosePage() = 0;
88 class MacroSecurityLevelTP
: public MacroSecurityTP
91 VclPtr
<RadioButton
> m_pVeryHighRB
;
92 VclPtr
<RadioButton
> m_pHighRB
;
93 VclPtr
<RadioButton
> m_pMediumRB
;
94 VclPtr
<RadioButton
> m_pLowRB
;
96 sal_uInt16 mnCurLevel
;
98 DECL_LINK(RadioButtonHdl
, Button
*, void);
101 MacroSecurityLevelTP( vcl::Window
* pParent
, MacroSecurity
* _pDlg
);
102 virtual ~MacroSecurityLevelTP() override
;
103 virtual void dispose() override
;
105 virtual void ClosePage() override
;
109 class MacroSecurityTrustedSourcesTP
: public MacroSecurityTP
112 VclPtr
<FixedImage
> m_pTrustCertROFI
;
113 VclPtr
<SvSimpleTable
> m_pTrustCertLB
;
114 VclPtr
<PushButton
> m_pViewCertPB
;
115 VclPtr
<PushButton
> m_pRemoveCertPB
;
116 VclPtr
<FixedImage
> m_pTrustFileROFI
;
117 VclPtr
<ListBox
> m_pTrustFileLocLB
;
118 VclPtr
<PushButton
> m_pAddLocPB
;
119 VclPtr
<PushButton
> m_pRemoveLocPB
;
121 css::uno::Sequence
< SvtSecurityOptions::Certificate
> maTrustedAuthors
;
123 bool mbAuthorsReadonly
;
126 DECL_LINK( ViewCertPBHdl
, Button
*, void );
127 DECL_LINK( RemoveCertPBHdl
, Button
*, void );
128 DECL_LINK( AddLocPBHdl
, Button
*, void );
129 DECL_LINK( RemoveLocPBHdl
, Button
*, void );
130 DECL_LINK( TrustCertLBSelectHdl
, SvTreeListBox
*, void );
131 DECL_LINK( TrustFileLocLBSelectHdl
, ListBox
&, void );
134 void ImplCheckButtons();
137 MacroSecurityTrustedSourcesTP(vcl::Window
* pParent
, MacroSecurity
* _pDlg
);
138 virtual ~MacroSecurityTrustedSourcesTP() override
;
139 virtual void dispose() override
;
141 virtual void ActivatePage() override
;
142 virtual void ClosePage() override
;
146 #endif // INCLUDED_XMLSECURITY_INC_MACROSECURITY_HXX
148 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */