Version 3.6.0.4, tag libreoffice-3.6.0.4
[LibreOffice.git] / uui / source / sslwarndlg.cxx
blob7a94b7cbd4d180e306974b2a3da7e76fb71339f5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #include <vcl/msgbox.hxx>
31 #include <ids.hrc>
32 #include <sslwarndlg.hrc>
33 #include <sslwarndlg.hxx>
35 #include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
37 // -----------------------------------------------------------------------
39 IMPL_LINK_NOARG(SSLWarnDialog, OKHdl_Impl)
41 EndDialog( RET_OK );
42 return 1;
45 // -----------------------------------------------------------------------
47 IMPL_LINK_NOARG(SSLWarnDialog, ViewCertHdl_Impl)
49 uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures > xDocumentDigitalSignatures;
51 xDocumentDigitalSignatures = uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures >(
52 getServiceFactory().get()->createInstance( rtl::OUString( "com.sun.star.security.DocumentDigitalSignatures" )), uno::UNO_QUERY );
54 xDocumentDigitalSignatures.get()->showCertificate(getCert());
56 return 0;
59 // -----------------------------------------------------------------------
61 SSLWarnDialog::SSLWarnDialog
63 Window* pParent,
64 const cssu::Reference< dcss::security::XCertificate >& rXCert,
65 const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
66 ResMgr* pResMgr
67 ) :
69 ModalDialog( pParent, ResId( DLG_UUI_SSLWARN, *pResMgr ) ),
70 m_aLabel1 ( this, ResId( FT_LABEL_1, *pResMgr ) ),
71 m_aOkButton ( this, ResId( PB_OK, *pResMgr ) ),
72 m_aCancelButton ( this, ResId( PB_CANCEL, *pResMgr ) ),
73 m_aCommandButtonViewCert ( this, ResId( PB_VIEW__CERTIFICATE, *pResMgr ) ),
74 m_aLine ( this, ResId( FL_LINE, *pResMgr ) ),
75 m_aWarnImage ( this, ResId( IMG_WARN, *pResMgr ) ),
76 m_xServiceFactory ( xServiceFactory ),
77 m_rXCert ( rXCert ),
78 pResourceMgr ( pResMgr )
80 FreeResource();
81 m_aWarnImage.SetImage( WarningBox::GetStandardImage() );
82 m_pParent = pParent;
83 m_aCommandButtonViewCert.SetClickHdl( LINK( this, SSLWarnDialog, ViewCertHdl_Impl ) );
84 m_aOkButton.SetClickHdl( LINK( this, SSLWarnDialog, OKHdl_Impl ) );
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */