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 : #ifndef _XMLSECURITY_MACROSECURITY_HXX
21 : #define _XMLSECURITY_MACROSECURITY_HXX
22 :
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/stdctrl.hxx>
30 : #include <svx/simptabl.hxx>
31 : #include <unotools/securityoptions.hxx>
32 :
33 : namespace com {
34 : namespace sun {
35 : namespace star {
36 : namespace xml { namespace crypto {
37 : class XSecurityEnvironment; }}
38 : }}}
39 :
40 : namespace cssu = com::sun::star::uno;
41 : namespace dcss = ::com::sun::star;
42 :
43 : class MacroSecurityTP;
44 :
45 : class ReadOnlyImage : public FixedImage
46 : {
47 : public:
48 : ReadOnlyImage(Window* pParent, const ResId rResId);
49 : ~ReadOnlyImage();
50 :
51 : virtual void RequestHelp( const HelpEvent& rHEvt );
52 : static const OUString& GetHelpTip();
53 : };
54 :
55 : class MacroSecurity : public TabDialog
56 : {
57 : private:
58 : friend class MacroSecurityLevelTP;
59 : friend class MacroSecurityTrustedSourcesTP;
60 :
61 : TabControl maTabCtrl;
62 : OKButton maOkBtn;
63 : CancelButton maCancelBtn;
64 : HelpButton maHelpBtn;
65 : PushButton maResetBtn;
66 :
67 : cssu::Reference< cssu::XComponentContext > mxCtx;
68 : cssu::Reference< dcss::xml::crypto::XSecurityEnvironment > mxSecurityEnvironment;
69 : SvtSecurityOptions maSecOptions;
70 :
71 : MacroSecurityTP* mpLevelTP;
72 : MacroSecurityTP* mpTrustSrcTP;
73 :
74 : DECL_LINK( OkBtnHdl, void* );
75 : public:
76 : MacroSecurity( Window* pParent, const cssu::Reference< cssu::XComponentContext>& rxCtx, const cssu::Reference< dcss::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment );
77 : virtual ~MacroSecurity();
78 :
79 : inline void EnableReset( bool _bEnable = true );
80 : };
81 :
82 0 : inline void MacroSecurity::EnableReset( bool _bEnable )
83 : {
84 0 : maResetBtn.Enable ( _bEnable );
85 0 : }
86 :
87 0 : class MacroSecurityTP : public TabPage
88 : {
89 : protected:
90 : MacroSecurity* mpDlg;
91 : public:
92 : MacroSecurityTP( Window* _pParent, const ResId& _rResId, MacroSecurity* _pDlg );
93 : inline void SetTabDlg( MacroSecurity* pTabDlg );
94 :
95 : virtual void ClosePage( void ) = 0;
96 : };
97 :
98 : inline void MacroSecurityTP::SetTabDlg( MacroSecurity* _pTabDlg )
99 : {
100 : mpDlg = _pTabDlg;
101 : }
102 :
103 :
104 0 : class MacroSecurityLevelTP : public MacroSecurityTP
105 : {
106 : private:
107 : FixedLine maSecLevelFL;
108 : ReadOnlyImage maSecReadonlyFI;
109 : RadioButton maVeryHighRB;
110 : RadioButton maHighRB;
111 : RadioButton maMediumRB;
112 : RadioButton maLowRB;
113 :
114 : sal_uInt16 mnCurLevel;
115 :
116 : protected:
117 : DECL_LINK(RadioButtonHdl, void *);
118 :
119 : public:
120 : MacroSecurityLevelTP( Window* pParent, MacroSecurity* _pDlg );
121 :
122 : virtual void ClosePage( void );
123 : };
124 :
125 :
126 0 : class MacroSecurityTrustedSourcesTP : public MacroSecurityTP
127 : {
128 : private:
129 : FixedLine maTrustCertFL;
130 : ReadOnlyImage maTrustCertROFI;
131 : SvxSimpleTableContainer m_aTrustCertLBContainer;
132 : SvxSimpleTable maTrustCertLB;
133 : PushButton maAddCertPB;
134 : PushButton maViewCertPB;
135 : PushButton maRemoveCertPB;
136 : FixedLine maTrustFileLocFL;
137 : ReadOnlyImage maTrustFileROFI;
138 : FixedInfo maTrustFileLocFI;
139 : ListBox maTrustFileLocLB;
140 : PushButton maAddLocPB;
141 : PushButton maRemoveLocPB;
142 :
143 : cssu::Sequence< SvtSecurityOptions::Certificate > maTrustedAuthors;
144 :
145 : bool mbAuthorsReadonly;
146 : bool mbURLsReadonly;
147 :
148 : DECL_LINK( ViewCertPBHdl, void* );
149 : DECL_LINK( RemoveCertPBHdl, void* );
150 : DECL_LINK( AddLocPBHdl, void* );
151 : DECL_LINK( RemoveLocPBHdl, void* );
152 : DECL_LINK( TrustCertLBSelectHdl, void* );
153 : DECL_LINK( TrustFileLocLBSelectHdl, void* );
154 :
155 : void FillCertLB( void );
156 : void ImplCheckButtons();
157 :
158 : public:
159 : MacroSecurityTrustedSourcesTP( Window* pParent, MacroSecurity* _pDlg );
160 :
161 : virtual void ActivatePage();
162 : virtual void ClosePage( void );
163 : };
164 :
165 :
166 : #endif // _XMLSECURITY_MACROSECURITY_HXX
167 :
168 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|