Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / uui / source / sslwarndlg.cxx
blobb00ca79fa1607f010672482546ccb2378451d945
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 #include <vcl/msgbox.hxx>
22 #include <ids.hrc>
23 #include <sslwarndlg.hrc>
24 #include <sslwarndlg.hxx>
26 #include <comphelper/processfactory.hxx>
27 #include <com/sun/star/security/DocumentDigitalSignatures.hpp>
29 // -----------------------------------------------------------------------
31 IMPL_LINK_NOARG(SSLWarnDialog, OKHdl_Impl)
33 EndDialog( RET_OK );
34 return 1;
37 // -----------------------------------------------------------------------
39 IMPL_LINK_NOARG(SSLWarnDialog, ViewCertHdl_Impl)
41 uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures > xDocumentDigitalSignatures;
43 xDocumentDigitalSignatures = ::com::sun::star::security::DocumentDigitalSignatures::createDefault( comphelper::getComponentContext(getServiceFactory()) );
45 xDocumentDigitalSignatures.get()->showCertificate(getCert());
47 return 0;
50 // -----------------------------------------------------------------------
52 SSLWarnDialog::SSLWarnDialog
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 ) :
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 m_rXCert ( rXCert )
70 FreeResource();
71 m_aWarnImage.SetImage( WarningBox::GetStandardImage() );
72 m_pParent = pParent;
73 m_aCommandButtonViewCert.SetClickHdl( LINK( this, SSLWarnDialog, ViewCertHdl_Impl ) );
74 m_aOkButton.SetClickHdl( LINK( this, SSLWarnDialog, OKHdl_Impl ) );
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */