update dev300-m58
[ooovba.git] / uui / source / sslwarndlg.cxx
blob29f3cd2ce1fe46d18189abb56ee3f121c3ce52cb
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: sslwarndlg.cxx,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #include <vcl/msgbox.hxx>
33 #ifndef UUI_IDS_HRC
34 #include <ids.hrc>
35 #endif
36 #ifndef UUI_UNKNOWNAUTHDLG_HRC
37 #include <sslwarndlg.hrc>
38 #endif
39 #ifndef UUI_UNKNOWNAUTHDLG_HXX
40 #include <sslwarndlg.hxx>
41 #endif
43 #include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
45 // -----------------------------------------------------------------------
47 IMPL_LINK( SSLWarnDialog, OKHdl_Impl, PushButton *, EMPTYARG )
49 EndDialog( RET_OK );
50 return 1;
53 // -----------------------------------------------------------------------
55 IMPL_LINK( SSLWarnDialog, ViewCertHdl_Impl, PushButton *, EMPTYARG )
57 uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures > xDocumentDigitalSignatures;
59 xDocumentDigitalSignatures = uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures >(
60 getServiceFactory().get()->createInstance( rtl::OUString::createFromAscii( "com.sun.star.security.DocumentDigitalSignatures" )), uno::UNO_QUERY );
62 xDocumentDigitalSignatures.get()->showCertificate(getCert());
64 return 0;
67 // -----------------------------------------------------------------------
69 SSLWarnDialog::SSLWarnDialog
71 Window* pParent,
72 const cssu::Reference< dcss::security::XCertificate >& rXCert,
73 const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
74 ResMgr* pResMgr
75 ) :
77 ModalDialog( pParent, ResId( DLG_UUI_SSLWARN, *pResMgr ) ),
78 m_aLabel1 ( this, ResId( FT_LABEL_1, *pResMgr ) ),
79 m_aOkButton ( this, ResId( PB_OK, *pResMgr ) ),
80 m_aCancelButton ( this, ResId( PB_CANCEL, *pResMgr ) ),
81 m_aCommandButtonViewCert ( this, ResId( PB_VIEW__CERTIFICATE, *pResMgr ) ),
82 m_aLine ( this, ResId( FL_LINE, *pResMgr ) ),
83 m_aWarnImage ( this, ResId( IMG_WARN, *pResMgr ) ),
84 m_xServiceFactory ( xServiceFactory ),
85 m_rXCert ( rXCert ),
86 pResourceMgr ( pResMgr )
88 FreeResource();
89 m_aWarnImage.SetImage( WarningBox::GetStandardImage() );
90 m_pParent = pParent;
91 m_aCommandButtonViewCert.SetClickHdl( LINK( this, SSLWarnDialog, ViewCertHdl_Impl ) );
92 m_aOkButton.SetClickHdl( LINK( this, SSLWarnDialog, OKHdl_Impl ) );