1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: sslwarndlg.cxx,v $
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>
36 #ifndef UUI_UNKNOWNAUTHDLG_HRC
37 #include <sslwarndlg.hrc>
39 #ifndef UUI_UNKNOWNAUTHDLG_HXX
40 #include <sslwarndlg.hxx>
43 #include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
45 // -----------------------------------------------------------------------
47 IMPL_LINK( SSLWarnDialog
, OKHdl_Impl
, PushButton
*, EMPTYARG
)
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());
67 // -----------------------------------------------------------------------
69 SSLWarnDialog::SSLWarnDialog
72 const cssu::Reference
< dcss::security::XCertificate
>& rXCert
,
73 const com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
>& xServiceFactory
,
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
),
86 pResourceMgr ( pResMgr
)
89 m_aWarnImage
.SetImage( WarningBox::GetStandardImage() );
91 m_aCommandButtonViewCert
.SetClickHdl( LINK( this, SSLWarnDialog
, ViewCertHdl_Impl
) );
92 m_aOkButton
.SetClickHdl( LINK( this, SSLWarnDialog
, OKHdl_Impl
) );