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 <unknownauthdlg.hrc>
31cdf0e10cSrcweir #endif
32cdf0e10cSrcweir #ifndef UUI_UNKNOWNAUTHDLG_HXX
33cdf0e10cSrcweir #include <unknownauthdlg.hxx>
34cdf0e10cSrcweir #endif
35cdf0e10cSrcweir
36cdf0e10cSrcweir #include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
37cdf0e10cSrcweir
38cdf0e10cSrcweir // -----------------------------------------------------------------------
39cdf0e10cSrcweir
IMPL_LINK(UnknownAuthDialog,OKHdl_Impl,PushButton *,EMPTYARG)40cdf0e10cSrcweir IMPL_LINK( UnknownAuthDialog, OKHdl_Impl, PushButton *, EMPTYARG )
41cdf0e10cSrcweir {
42cdf0e10cSrcweir if ( m_aOptionButtonAccept.IsChecked() )
43cdf0e10cSrcweir {
44cdf0e10cSrcweir EndDialog( RET_OK );
45cdf0e10cSrcweir } else
46cdf0e10cSrcweir {
47cdf0e10cSrcweir EndDialog( RET_CANCEL );
48cdf0e10cSrcweir }
49cdf0e10cSrcweir
50cdf0e10cSrcweir return 1;
51cdf0e10cSrcweir }
52cdf0e10cSrcweir
53cdf0e10cSrcweir // -----------------------------------------------------------------------
54cdf0e10cSrcweir
IMPL_LINK(UnknownAuthDialog,ViewCertHdl_Impl,PushButton *,EMPTYARG)55cdf0e10cSrcweir IMPL_LINK( UnknownAuthDialog, ViewCertHdl_Impl, PushButton *, EMPTYARG )
56cdf0e10cSrcweir {
57cdf0e10cSrcweir uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures > xDocumentDigitalSignatures;
58cdf0e10cSrcweir
59cdf0e10cSrcweir xDocumentDigitalSignatures = uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures >(
60cdf0e10cSrcweir getServiceFactory().get()->createInstance( rtl::OUString::createFromAscii( "com.sun.star.security.DocumentDigitalSignatures" )), uno::UNO_QUERY );
61cdf0e10cSrcweir
62cdf0e10cSrcweir xDocumentDigitalSignatures.get()->showCertificate(getCert());
63cdf0e10cSrcweir
64cdf0e10cSrcweir return 0;
65cdf0e10cSrcweir }
66cdf0e10cSrcweir
67cdf0e10cSrcweir // -----------------------------------------------------------------------
68cdf0e10cSrcweir
UnknownAuthDialog(Window * pParent,const cssu::Reference<dcss::security::XCertificate> & rXCert,const com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> & xServiceFactory,ResMgr * pResMgr)69cdf0e10cSrcweir UnknownAuthDialog::UnknownAuthDialog
70cdf0e10cSrcweir (
71cdf0e10cSrcweir Window* pParent,
72cdf0e10cSrcweir const cssu::Reference< dcss::security::XCertificate >& rXCert,
73cdf0e10cSrcweir const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
74cdf0e10cSrcweir ResMgr* pResMgr
75cdf0e10cSrcweir ) :
76cdf0e10cSrcweir ModalDialog( pParent, ResId( DLG_UUI_UNKNOWNAUTH, *pResMgr ) ),
77cdf0e10cSrcweir
78cdf0e10cSrcweir m_aCommandButtonOK ( this, ResId( PB_OK, *pResMgr ) ),
79cdf0e10cSrcweir m_aCommandButtonCancel ( this, ResId( PB_CANCEL, *pResMgr ) ),
80cdf0e10cSrcweir m_aCommandButtonHelp ( this, ResId( PB_HELP, *pResMgr ) ),
81cdf0e10cSrcweir m_aView_Certificate ( this, ResId( PB_VIEW__CERTIFICATE, *pResMgr ) ),
82cdf0e10cSrcweir m_aOptionButtonAccept ( this, ResId( RB_ACCEPT_1, *pResMgr ) ),
83cdf0e10cSrcweir m_aOptionButtonDontAccept ( this, ResId( RB_DONTACCEPT_2, *pResMgr ) ),
84cdf0e10cSrcweir m_aLine ( this, ResId( FL_LINE, *pResMgr ) ),
85cdf0e10cSrcweir m_aLabel1 ( this, ResId( FT_LABEL_1, *pResMgr ) ),
86cdf0e10cSrcweir m_aWarnImage ( this, ResId( IMG_WARN, *pResMgr ) ),
87cdf0e10cSrcweir m_xServiceFactory ( xServiceFactory ),
88cdf0e10cSrcweir m_rXCert ( rXCert ),
89cdf0e10cSrcweir pResourceMgr ( pResMgr )
90cdf0e10cSrcweir {
91cdf0e10cSrcweir //SetMapMode( MapMode( MAP_APPFONT ) );
92cdf0e10cSrcweir FreeResource();
93cdf0e10cSrcweir
94cdf0e10cSrcweir m_aWarnImage.SetImage( WarningBox::GetStandardImage() );
95cdf0e10cSrcweir m_pParent = pParent;
96cdf0e10cSrcweir m_aView_Certificate.SetClickHdl( LINK( this, UnknownAuthDialog, ViewCertHdl_Impl ) );
97cdf0e10cSrcweir m_aCommandButtonOK.SetClickHdl( LINK( this, UnknownAuthDialog, OKHdl_Impl ) );
98cdf0e10cSrcweir };
99cdf0e10cSrcweir
100