merged tag ooo/DEV300_m102
[LibreOffice.git] / uui / source / sslwarndlg.cxx
blobbed776e7f3de51a120b92860d6f6b00f2b087d07
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #include <vcl/msgbox.hxx>
30 #ifndef UUI_IDS_HRC
31 #include <ids.hrc>
32 #endif
33 #ifndef UUI_UNKNOWNAUTHDLG_HRC
34 #include <sslwarndlg.hrc>
35 #endif
36 #ifndef UUI_UNKNOWNAUTHDLG_HXX
37 #include <sslwarndlg.hxx>
38 #endif
40 #include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
42 // -----------------------------------------------------------------------
44 IMPL_LINK( SSLWarnDialog, OKHdl_Impl, PushButton *, EMPTYARG )
46 EndDialog( RET_OK );
47 return 1;
50 // -----------------------------------------------------------------------
52 IMPL_LINK( SSLWarnDialog, ViewCertHdl_Impl, PushButton *, EMPTYARG )
54 uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures > xDocumentDigitalSignatures;
56 xDocumentDigitalSignatures = uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures >(
57 getServiceFactory().get()->createInstance( rtl::OUString::createFromAscii( "com.sun.star.security.DocumentDigitalSignatures" )), uno::UNO_QUERY );
59 xDocumentDigitalSignatures.get()->showCertificate(getCert());
61 return 0;
64 // -----------------------------------------------------------------------
66 SSLWarnDialog::SSLWarnDialog
68 Window* pParent,
69 const cssu::Reference< dcss::security::XCertificate >& rXCert,
70 const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
71 ResMgr* pResMgr
72 ) :
74 ModalDialog( pParent, ResId( DLG_UUI_SSLWARN, *pResMgr ) ),
75 m_aLabel1 ( this, ResId( FT_LABEL_1, *pResMgr ) ),
76 m_aOkButton ( this, ResId( PB_OK, *pResMgr ) ),
77 m_aCancelButton ( this, ResId( PB_CANCEL, *pResMgr ) ),
78 m_aCommandButtonViewCert ( this, ResId( PB_VIEW__CERTIFICATE, *pResMgr ) ),
79 m_aLine ( this, ResId( FL_LINE, *pResMgr ) ),
80 m_aWarnImage ( this, ResId( IMG_WARN, *pResMgr ) ),
81 m_xServiceFactory ( xServiceFactory ),
82 m_rXCert ( rXCert ),
83 pResourceMgr ( pResMgr )
85 FreeResource();
86 m_aWarnImage.SetImage( WarningBox::GetStandardImage() );
87 m_pParent = pParent;
88 m_aCommandButtonViewCert.SetClickHdl( LINK( this, SSLWarnDialog, ViewCertHdl_Impl ) );
89 m_aOkButton.SetClickHdl( LINK( this, SSLWarnDialog, OKHdl_Impl ) );