xref: /trunk/main/uui/source/sslwarndlg.cxx (revision cdf0e10c)
1 /*************************************************************************
2 *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
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.
14  *
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).
20  *
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.
25  *
26 ************************************************************************/
27 
28 #include <vcl/msgbox.hxx>
29 
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
39 
40 #include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
41 
42 // -----------------------------------------------------------------------
43 
44 IMPL_LINK( SSLWarnDialog, OKHdl_Impl, PushButton *, EMPTYARG )
45 {
46 	EndDialog( RET_OK );
47 	return 1;
48 }
49 
50 // -----------------------------------------------------------------------
51 
52 IMPL_LINK( SSLWarnDialog, ViewCertHdl_Impl, PushButton *, EMPTYARG )
53 {
54 	uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures > xDocumentDigitalSignatures;
55 
56     xDocumentDigitalSignatures = uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures >(
57                     getServiceFactory().get()->createInstance( rtl::OUString::createFromAscii( "com.sun.star.security.DocumentDigitalSignatures" )), uno::UNO_QUERY );
58 
59 	xDocumentDigitalSignatures.get()->showCertificate(getCert());
60 
61 	return 0;
62 }
63 
64 // -----------------------------------------------------------------------
65 
66 SSLWarnDialog::SSLWarnDialog
67 (
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 ) :
73 
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 )
84 {
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 ) );
90 };
91 
92 
93 
94