xref: /AOO41X/main/uui/source/secmacrowarnings.hxx (revision b16fc3498419feb37efe0fd01e69061f1560d17c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SECMACROWARNINGS_HXX
25 #define _SECMACROWARNINGS_HXX
26 
27 #include <vcl/dialog.hxx>
28 #include <svtools/stdctrl.hxx>
29 #include <unotools/securityoptions.hxx>
30 #include <vcl/button.hxx>
31 
32 namespace com {
33 namespace sun {
34 namespace star {
35 namespace security {
36     class XCertificate; }
37 namespace xml { namespace crypto {
38     class XSecurityEnvironment; }}
39 }}}
40 
41 #include <com/sun/star/uno/Sequence.hxx>
42 
43 
44 namespace css = com::sun::star;
45 namespace cssu = com::sun::star::uno;
46 namespace css = ::com::sun::star;
47 
48 class HeaderBar;
49 
50 class MacroWarning : public ModalDialog
51 {
52 private:
53 
54     cssu::Reference< css::security::XCertificate >  mxCert;
55     cssu::Reference< css::embed::XStorage >         mxStore;
56     ::rtl::OUString                                 maODFVersion;
57     const cssu::Sequence< css::security::DocumentSignatureInformation >*    mpInfos;
58 
59     FixedImage          maSymbolImg;
60     FixedInfo           maDocNameFI;
61     FixedInfo           maDescr1aFI;
62     FixedInfo           maDescr1bFI;
63     FixedInfo           maSignsFI;
64     PushButton          maViewSignsBtn;
65     FixedInfo           maDescr2FI;
66     CheckBox            maAlwaysTrustCB;
67     FixedLine           maBottomSepFL;
68     OKButton            maEnableBtn;
69     CancelButton        maDisableBtn;
70     HelpButton          maHelpBtn;
71 
72     const bool          mbSignedMode;           // modus of dialog (signed / unsigned macros)
73     const bool          mbShowSignatures;
74     sal_Int32           mnActSecLevel;
75 
76     DECL_LINK(          ViewSignsBtnHdl, void* );
77     DECL_LINK(          EnableBtnHdl, void* );
78     DECL_LINK(          DisableBtnHdl, void* );
79     DECL_LINK(          AlwaysTrustCheckHdl, void* );
80 
81     void                InitControls();
82     void                FitControls();
83 
84 public:
85     MacroWarning( Window* pParent, bool _bShowSignatures, ResMgr& rResMgr );
86     ~MacroWarning();
87 
88     virtual short   Execute();
89 
90     void    SetDocumentURL( const String& rDocURL );
91 
92     void    SetStorage( const cssu::Reference < css::embed::XStorage >& rxStore,
93                         const ::rtl::OUString& aODFVersion,
94                         const cssu::Sequence< css::security::DocumentSignatureInformation >& _rInfos );
95     void    SetCertificate( const cssu::Reference< css::security::XCertificate >& _rxCert );
96 };
97 
98 #endif
99 
100