xref: /AOO41X/main/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx (revision ec61c6ed669d81c7df08233ccc38d0040f129ece)
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 _XMLSECURITY_CERTIFICATECHOOSER_HXX
25 #define _XMLSECURITY_CERTIFICATECHOOSER_HXX
26 
27 #include <vcl/dialog.hxx>
28 #include <vcl/fixed.hxx>
29 #include <vcl/button.hxx>
30 #include <svx/simptabl.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 #include <xmlsecurity/sigstruct.hxx>
43 
44 namespace css = com::sun::star;
45 namespace cssu = com::sun::star::uno;
46 namespace dcss = ::com::sun::star;
47 
48 class HeaderBar;
49 
50 class CertificateChooser : public ModalDialog
51 {
52 private:
53     cssu::Reference< cssu::XComponentContext > mxCtx;
54     cssu::Reference< dcss::xml::crypto::XSecurityEnvironment > mxSecurityEnvironment;
55     cssu::Sequence< cssu::Reference< dcss::security::XCertificate > > maCerts;
56     SignatureInformations maCertsToIgnore;
57 
58     FixedText           maHintFT;
59     SvxSimpleTable      maCertLB;   // PB 2006/02/02 #i48648 now SvHeaderTabListBox
60 
61     PushButton          maViewBtn;
62 
63     FixedLine           maBottomSepFL;
64     OKButton            maOKBtn;
65     CancelButton        maCancelBtn;
66     HelpButton          maHelpBtn;
67 
68     sal_Bool                mbInitialized;
69 
70     sal_uInt16              GetSelectedEntryPos( void ) const;
71 //  DECL_LINK(          Initialize, void* );
72     DECL_LINK(          ViewButtonHdl, Button* );
73     DECL_LINK(          CertificateHighlightHdl, void* );
74     DECL_LINK(          CertificateSelectHdl, void* );
75 
76     void ImplShowCertificateDetails();
77     void ImplInitialize();
78 
79 public:
80     CertificateChooser( Window* pParent, cssu::Reference< cssu::XComponentContext>& rxCtx, cssu::Reference< dcss::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment, const SignatureInformations& rCertsToIgnore );
81     ~CertificateChooser();
82 
83     short Execute();
84 
85     cssu::Reference< dcss::security::XCertificate > GetSelectedCertificate();
86 
87 };
88 
89 #endif // _XMLSECURITY_CERTIFICATECHOOSER_HXX
90 
91