diff options
Diffstat (limited to 'xmlsecurity/inc/certificatechooser.hxx')
-rw-r--r-- | xmlsecurity/inc/certificatechooser.hxx | 42 |
1 files changed, 17 insertions, 25 deletions
diff --git a/xmlsecurity/inc/certificatechooser.hxx b/xmlsecurity/inc/certificatechooser.hxx index d01b95edda24..b98b30fdc6b3 100644 --- a/xmlsecurity/inc/certificatechooser.hxx +++ b/xmlsecurity/inc/certificatechooser.hxx @@ -20,16 +20,12 @@ #ifndef INCLUDED_XMLSECURITY_INC_CERTIFICATECHOOSER_HXX #define INCLUDED_XMLSECURITY_INC_CERTIFICATECHOOSER_HXX -#include <svtools/simptabl.hxx> -#include <vcl/dialog.hxx> -#include <vcl/fixed.hxx> -#include <vcl/button.hxx> #include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> #include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/uno/Sequence.hxx> #include <svl/sigstruct.hxx> - +#include <vcl/weld.hxx> namespace com { namespace sun { @@ -40,8 +36,6 @@ namespace xml { namespace crypto { class XSecurityEnvironment; }} }}} -class HeaderBar; - struct UserData { css::uno::Reference<css::security::XCertificate> xCertificate; @@ -56,45 +50,43 @@ enum class UserAction Encrypt }; -class CertificateChooser : public ModalDialog +class CertificateChooser : public weld::GenericDialogController { private: css::uno::Reference< css::uno::XComponentContext > mxCtx; std::vector< css::uno::Reference< css::xml::crypto::XXMLSecurityContext > > mxSecurityContexts; std::vector<std::shared_ptr<UserData>> mvUserData; - VclPtr<FixedText> m_pFTSign; - VclPtr<FixedText> m_pFTEncrypt; - - VclPtr<SvSimpleTable> m_pCertLB; - VclPtr<PushButton> m_pViewBtn; - VclPtr<OKButton> m_pOKBtn; - VclPtr<FixedText> m_pFTDescription; - VclPtr<Edit> m_pDescriptionED; - bool mbInitialized; UserAction const meAction; OUString msPreferredKey; css::uno::Reference<css::security::XCertificate> mxEncryptToSelf; - DECL_LINK(ViewButtonHdl, Button*, void); - DECL_LINK(CertificateHighlightHdl, SvTreeListBox*, void ); - DECL_LINK(CertificateSelectHdl, SvTreeListBox*, bool ); + std::unique_ptr<weld::Label> m_xFTSign; + std::unique_ptr<weld::Label> m_xFTEncrypt; + std::unique_ptr<weld::TreeView> m_xCertLB; + std::unique_ptr<weld::Button> m_xViewBtn; + std::unique_ptr<weld::Button> m_xOKBtn; + std::unique_ptr<weld::Label> m_xFTDescription; + std::unique_ptr<weld::Entry> m_xDescriptionED; + + DECL_LINK(ViewButtonHdl, weld::Button&, void); + DECL_LINK(CertificateHighlightHdl, weld::TreeView&, void); + DECL_LINK(CertificateSelectHdl, weld::TreeView&, void); void ImplShowCertificateDetails(); void ImplInitialize(); - void HandleOneUsageBit(OUString& string, int& bits, int bit, const char *name); + static void HandleOneUsageBit(OUString& string, int& bits, int bit, const char *name); public: - CertificateChooser(vcl::Window* pParent, + CertificateChooser(weld::Window* pParent, css::uno::Reference< css::uno::XComponentContext> const & rxCtx, std::vector< css::uno::Reference< css::xml::crypto::XXMLSecurityContext > > const & rxSecurityContexts, UserAction eAction); virtual ~CertificateChooser() override; - virtual void dispose() override; - short Execute() override; + short run() override; css::uno::Sequence<css::uno::Reference< css::security::XCertificate > > GetSelectedCertificates(); css::uno::Reference< css::xml::crypto::XXMLSecurityContext > GetSelectedSecurityContext(); @@ -104,7 +96,7 @@ public: /// Returns the usage string of the selected certificate, if any. OUString GetUsageText(); - OUString UsageInClearText(int bits); + static OUString UsageInClearText(int bits); }; #endif // INCLUDED_XMLSECURITY_INC_CERTIFICATECHOOSER_HXX |