Version 3.6.0.4, tag libreoffice-3.6.0.4
[LibreOffice.git] / uui / source / unknownauthdlg.cxx
blobb21377931c7f6be862ba8175084d1ca9771fccea
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #include <vcl/msgbox.hxx>
31 #include <ids.hrc>
32 #include <unknownauthdlg.hrc>
33 #include <unknownauthdlg.hxx>
35 #include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
37 // -----------------------------------------------------------------------
39 IMPL_LINK_NOARG(UnknownAuthDialog, OKHdl_Impl)
41 if ( m_aOptionButtonAccept.IsChecked() )
43 EndDialog( RET_OK );
44 } else
46 EndDialog( RET_CANCEL );
49 return 1;
52 // -----------------------------------------------------------------------
54 IMPL_LINK_NOARG(UnknownAuthDialog, ViewCertHdl_Impl)
56 uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures > xDocumentDigitalSignatures;
58 xDocumentDigitalSignatures = uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures >(
59 getServiceFactory().get()->createInstance( rtl::OUString( "com.sun.star.security.DocumentDigitalSignatures" )), uno::UNO_QUERY );
61 xDocumentDigitalSignatures.get()->showCertificate(getCert());
63 return 0;
66 // -----------------------------------------------------------------------
68 UnknownAuthDialog::UnknownAuthDialog
70 Window* pParent,
71 const cssu::Reference< dcss::security::XCertificate >& rXCert,
72 const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
73 ResMgr* pResMgr
74 ) :
75 ModalDialog( pParent, ResId( DLG_UUI_UNKNOWNAUTH, *pResMgr ) ),
77 m_aCommandButtonOK ( this, ResId( PB_OK, *pResMgr ) ),
78 m_aCommandButtonCancel ( this, ResId( PB_CANCEL, *pResMgr ) ),
79 m_aCommandButtonHelp ( this, ResId( PB_HELP, *pResMgr ) ),
80 m_aView_Certificate ( this, ResId( PB_VIEW__CERTIFICATE, *pResMgr ) ),
81 m_aOptionButtonAccept ( this, ResId( RB_ACCEPT_1, *pResMgr ) ),
82 m_aOptionButtonDontAccept ( this, ResId( RB_DONTACCEPT_2, *pResMgr ) ),
83 m_aLine ( this, ResId( FL_LINE, *pResMgr ) ),
84 m_aLabel1 ( this, ResId( FT_LABEL_1, *pResMgr ) ),
85 m_aWarnImage ( this, ResId( IMG_WARN, *pResMgr ) ),
86 m_xServiceFactory ( xServiceFactory ),
87 m_rXCert ( rXCert ),
88 pResourceMgr ( pResMgr )
90 FreeResource();
92 m_aWarnImage.SetImage( WarningBox::GetStandardImage() );
93 m_pParent = pParent;
94 m_aView_Certificate.SetClickHdl( LINK( this, UnknownAuthDialog, ViewCertHdl_Impl ) );
95 m_aCommandButtonOK.SetClickHdl( LINK( this, UnknownAuthDialog, OKHdl_Impl ) );
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */