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 : #include <vcl/msgbox.hxx>
21 :
22 : #include <ids.hrc>
23 : #include <sslwarndlg.hrc>
24 : #include <sslwarndlg.hxx>
25 :
26 : #include <comphelper/processfactory.hxx>
27 : #include <com/sun/star/security/DocumentDigitalSignatures.hpp>
28 :
29 : // -----------------------------------------------------------------------
30 :
31 0 : IMPL_LINK_NOARG(SSLWarnDialog, OKHdl_Impl)
32 : {
33 0 : EndDialog( RET_OK );
34 0 : return 1;
35 : }
36 :
37 : // -----------------------------------------------------------------------
38 :
39 0 : IMPL_LINK_NOARG(SSLWarnDialog, ViewCertHdl_Impl)
40 : {
41 0 : uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures > xDocumentDigitalSignatures;
42 :
43 0 : xDocumentDigitalSignatures = ::com::sun::star::security::DocumentDigitalSignatures::createDefault( comphelper::getComponentContext(getServiceFactory()) );
44 :
45 0 : xDocumentDigitalSignatures.get()->showCertificate(getCert());
46 :
47 0 : return 0;
48 : }
49 :
50 : // -----------------------------------------------------------------------
51 :
52 0 : SSLWarnDialog::SSLWarnDialog
53 : (
54 : Window* pParent,
55 : const cssu::Reference< dcss::security::XCertificate >& rXCert,
56 : const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
57 : ResMgr* pResMgr
58 : ) :
59 :
60 : ModalDialog( pParent, ResId( DLG_UUI_SSLWARN, *pResMgr ) ),
61 : m_aLabel1 ( this, ResId( FT_LABEL_1, *pResMgr ) ),
62 : m_aOkButton ( this, ResId( PB_OK, *pResMgr ) ),
63 : m_aCancelButton ( this, ResId( PB_CANCEL, *pResMgr ) ),
64 : m_aCommandButtonViewCert ( this, ResId( PB_VIEW__CERTIFICATE, *pResMgr ) ),
65 : m_aLine ( this, ResId( FL_LINE, *pResMgr ) ),
66 : m_aWarnImage ( this, ResId( IMG_WARN, *pResMgr ) ),
67 : m_xServiceFactory ( xServiceFactory ),
68 0 : m_rXCert ( rXCert )
69 : {
70 0 : FreeResource();
71 0 : m_aWarnImage.SetImage( WarningBox::GetStandardImage() );
72 0 : m_pParent = pParent;
73 0 : m_aCommandButtonViewCert.SetClickHdl( LINK( this, SSLWarnDialog, ViewCertHdl_Impl ) );
74 0 : m_aOkButton.SetClickHdl( LINK( this, SSLWarnDialog, OKHdl_Impl ) );
75 0 : };
76 :
77 :
78 :
79 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|