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: unknownauthdlg.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 <unknownauthdlg.hrc>
39 #ifndef UUI_UNKNOWNAUTHDLG_HXX
40 #include <unknownauthdlg.hxx>
43 #include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
45 // -----------------------------------------------------------------------
47 IMPL_LINK( UnknownAuthDialog
, OKHdl_Impl
, PushButton
*, EMPTYARG
)
49 if ( m_aOptionButtonAccept
.IsChecked() )
54 EndDialog( RET_CANCEL
);
60 // -----------------------------------------------------------------------
62 IMPL_LINK( UnknownAuthDialog
, ViewCertHdl_Impl
, PushButton
*, EMPTYARG
)
64 uno::Reference
< ::com::sun::star::security::XDocumentDigitalSignatures
> xDocumentDigitalSignatures
;
66 xDocumentDigitalSignatures
= uno::Reference
< ::com::sun::star::security::XDocumentDigitalSignatures
>(
67 getServiceFactory().get()->createInstance( rtl::OUString::createFromAscii( "com.sun.star.security.DocumentDigitalSignatures" )), uno::UNO_QUERY
);
69 xDocumentDigitalSignatures
.get()->showCertificate(getCert());
74 // -----------------------------------------------------------------------
76 UnknownAuthDialog::UnknownAuthDialog
79 const cssu::Reference
< dcss::security::XCertificate
>& rXCert
,
80 const com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
>& xServiceFactory
,
83 ModalDialog( pParent
, ResId( DLG_UUI_UNKNOWNAUTH
, *pResMgr
) ),
85 m_aCommandButtonOK ( this, ResId( PB_OK
, *pResMgr
) ),
86 m_aCommandButtonCancel ( this, ResId( PB_CANCEL
, *pResMgr
) ),
87 m_aCommandButtonHelp ( this, ResId( PB_HELP
, *pResMgr
) ),
88 m_aView_Certificate ( this, ResId( PB_VIEW__CERTIFICATE
, *pResMgr
) ),
89 m_aOptionButtonAccept ( this, ResId( RB_ACCEPT_1
, *pResMgr
) ),
90 m_aOptionButtonDontAccept ( this, ResId( RB_DONTACCEPT_2
, *pResMgr
) ),
91 m_aLine ( this, ResId( FL_LINE
, *pResMgr
) ),
92 m_aLabel1 ( this, ResId( FT_LABEL_1
, *pResMgr
) ),
93 m_aWarnImage ( this, ResId( IMG_WARN
, *pResMgr
) ),
94 m_xServiceFactory ( xServiceFactory
),
96 pResourceMgr ( pResMgr
)
98 //SetMapMode( MapMode( MAP_APPFONT ) );
101 m_aWarnImage
.SetImage( WarningBox::GetStandardImage() );
103 m_aView_Certificate
.SetClickHdl( LINK( this, UnknownAuthDialog
, ViewCertHdl_Impl
) );
104 m_aCommandButtonOK
.SetClickHdl( LINK( this, UnknownAuthDialog
, OKHdl_Impl
) );