xref: /aoo42x/main/uui/source/sslwarndlg.cxx (revision 859212d1)
1*859212d1SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*859212d1SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*859212d1SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*859212d1SAndrew Rist  * distributed with this work for additional information
6*859212d1SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*859212d1SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*859212d1SAndrew Rist  * "License"); you may not use this file except in compliance
9*859212d1SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*859212d1SAndrew Rist  *
11*859212d1SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*859212d1SAndrew Rist  *
13*859212d1SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*859212d1SAndrew Rist  * software distributed under the License is distributed on an
15*859212d1SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*859212d1SAndrew Rist  * KIND, either express or implied.  See the License for the
17*859212d1SAndrew Rist  * specific language governing permissions and limitations
18*859212d1SAndrew Rist  * under the License.
19*859212d1SAndrew Rist  *
20*859212d1SAndrew Rist  *************************************************************/
21*859212d1SAndrew Rist 
22*859212d1SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #include <vcl/msgbox.hxx>
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #ifndef UUI_IDS_HRC
27cdf0e10cSrcweir #include <ids.hrc>
28cdf0e10cSrcweir #endif
29cdf0e10cSrcweir #ifndef UUI_UNKNOWNAUTHDLG_HRC
30cdf0e10cSrcweir #include <sslwarndlg.hrc>
31cdf0e10cSrcweir #endif
32cdf0e10cSrcweir #ifndef UUI_UNKNOWNAUTHDLG_HXX
33cdf0e10cSrcweir #include <sslwarndlg.hxx>
34cdf0e10cSrcweir #endif
35cdf0e10cSrcweir 
36cdf0e10cSrcweir #include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
37cdf0e10cSrcweir 
38cdf0e10cSrcweir // -----------------------------------------------------------------------
39cdf0e10cSrcweir 
IMPL_LINK(SSLWarnDialog,OKHdl_Impl,PushButton *,EMPTYARG)40cdf0e10cSrcweir IMPL_LINK( SSLWarnDialog, OKHdl_Impl, PushButton *, EMPTYARG )
41cdf0e10cSrcweir {
42cdf0e10cSrcweir 	EndDialog( RET_OK );
43cdf0e10cSrcweir 	return 1;
44cdf0e10cSrcweir }
45cdf0e10cSrcweir 
46cdf0e10cSrcweir // -----------------------------------------------------------------------
47cdf0e10cSrcweir 
IMPL_LINK(SSLWarnDialog,ViewCertHdl_Impl,PushButton *,EMPTYARG)48cdf0e10cSrcweir IMPL_LINK( SSLWarnDialog, ViewCertHdl_Impl, PushButton *, EMPTYARG )
49cdf0e10cSrcweir {
50cdf0e10cSrcweir 	uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures > xDocumentDigitalSignatures;
51cdf0e10cSrcweir 
52cdf0e10cSrcweir     xDocumentDigitalSignatures = uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures >(
53cdf0e10cSrcweir                     getServiceFactory().get()->createInstance( rtl::OUString::createFromAscii( "com.sun.star.security.DocumentDigitalSignatures" )), uno::UNO_QUERY );
54cdf0e10cSrcweir 
55cdf0e10cSrcweir 	xDocumentDigitalSignatures.get()->showCertificate(getCert());
56cdf0e10cSrcweir 
57cdf0e10cSrcweir 	return 0;
58cdf0e10cSrcweir }
59cdf0e10cSrcweir 
60cdf0e10cSrcweir // -----------------------------------------------------------------------
61cdf0e10cSrcweir 
SSLWarnDialog(Window * pParent,const cssu::Reference<dcss::security::XCertificate> & rXCert,const com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> & xServiceFactory,ResMgr * pResMgr)62cdf0e10cSrcweir SSLWarnDialog::SSLWarnDialog
63cdf0e10cSrcweir (
64cdf0e10cSrcweir 	Window*										pParent,
65cdf0e10cSrcweir 	const cssu::Reference< dcss::security::XCertificate >& rXCert,
66cdf0e10cSrcweir 	const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
67cdf0e10cSrcweir 	ResMgr*										pResMgr
68cdf0e10cSrcweir ) :
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 	ModalDialog( pParent, ResId( DLG_UUI_SSLWARN, *pResMgr ) ),
71cdf0e10cSrcweir 	m_aLabel1 ( this, ResId( FT_LABEL_1, *pResMgr ) ),
72cdf0e10cSrcweir 	m_aOkButton ( this, ResId( PB_OK, *pResMgr ) ),
73cdf0e10cSrcweir 	m_aCancelButton ( this, ResId( PB_CANCEL, *pResMgr ) ),
74cdf0e10cSrcweir     m_aCommandButtonViewCert ( this, ResId( PB_VIEW__CERTIFICATE, *pResMgr ) ),
75cdf0e10cSrcweir 	m_aLine ( this, ResId( FL_LINE, *pResMgr ) ),
76cdf0e10cSrcweir 	m_aWarnImage ( this, ResId( IMG_WARN, *pResMgr ) ),
77cdf0e10cSrcweir 	m_xServiceFactory ( xServiceFactory ),
78cdf0e10cSrcweir 	m_rXCert ( rXCert ),
79cdf0e10cSrcweir 	pResourceMgr	( pResMgr )
80cdf0e10cSrcweir {
81cdf0e10cSrcweir 	FreeResource();
82cdf0e10cSrcweir 	m_aWarnImage.SetImage( WarningBox::GetStandardImage() );
83cdf0e10cSrcweir 	m_pParent = pParent;
84cdf0e10cSrcweir 	m_aCommandButtonViewCert.SetClickHdl( LINK( this, SSLWarnDialog, ViewCertHdl_Impl ) );
85cdf0e10cSrcweir 	m_aOkButton.SetClickHdl( LINK( this, SSLWarnDialog, OKHdl_Impl ) );
86cdf0e10cSrcweir };
87cdf0e10cSrcweir 
88cdf0e10cSrcweir 
89cdf0e10cSrcweir 
90