tdf#104310: Accept also x14-style dataValidations
[LibreOffice.git] / xmlsecurity / inc / certificatechooser.hxx
blob45453b23b3ec4cc8e712cb2cc979c95a49a34d59
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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_CERTIFICATECHOOSER_HXX
21 #define INCLUDED_XMLSECURITY_INC_CERTIFICATECHOOSER_HXX
23 #include <svtools/simptabl.hxx>
24 #include <vcl/dialog.hxx>
25 #include <vcl/fixed.hxx>
26 #include <vcl/button.hxx>
27 #include <com/sun/star/uno/XComponentContext.hpp>
28 #include <com/sun/star/uno/Sequence.hxx>
29 #include <sigstruct.hxx>
32 namespace com {
33 namespace sun {
34 namespace star {
35 namespace security {
36 class XCertificate; }
37 namespace xml { namespace crypto {
38 class XSecurityEnvironment; }}
39 }}}
41 class HeaderBar;
43 class CertificateChooser : public ModalDialog
45 private:
46 css::uno::Reference< css::uno::XComponentContext > mxCtx;
47 css::uno::Reference< css::xml::crypto::XSecurityEnvironment > mxSecurityEnvironment;
48 css::uno::Sequence< css::uno::Reference< css::security::XCertificate > > maCerts;
50 VclPtr<SvSimpleTable> m_pCertLB;
51 VclPtr<PushButton> m_pViewBtn;
52 VclPtr<OKButton> m_pOKBtn;
53 VclPtr<Edit> m_pDescriptionED;
55 bool mbInitialized;
57 sal_uInt16 GetSelectedEntryPos() const;
59 DECL_LINK(ViewButtonHdl, Button*, void);
60 DECL_LINK(CertificateHighlightHdl, SvTreeListBox*, void );
61 DECL_LINK(CertificateSelectHdl, SvTreeListBox*, bool );
63 void ImplShowCertificateDetails();
64 void ImplInitialize();
66 void HandleOneUsageBit(OUString& string, int& bits, int bit, const char *name);
68 public:
69 CertificateChooser(vcl::Window* pParent, css::uno::Reference< css::uno::XComponentContext>& rxCtx, css::uno::Reference< css::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment);
70 virtual ~CertificateChooser() override;
71 virtual void dispose() override;
73 short Execute() override;
75 css::uno::Reference< css::security::XCertificate > GetSelectedCertificate();
76 /// Gets the description string provided when selecting the certificate.
77 OUString GetDescription();
79 OUString UsageInClearText(int bits);
82 #endif // INCLUDED_XMLSECURITY_INC_CERTIFICATECHOOSER_HXX
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */