bump product version to 4.1.6.2
[LibreOffice.git] / uui / source / unknownauthdlg.cxx
blob9967261af6ce1aed9a992c54e31e2ed57c16b490
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <vcl/msgbox.hxx>
22 #include <ids.hrc>
23 #include <unknownauthdlg.hrc>
24 #include <unknownauthdlg.hxx>
25 #include <comphelper/processfactory.hxx>
27 #include <com/sun/star/security/DocumentDigitalSignatures.hpp>
29 using namespace css;
31 // -----------------------------------------------------------------------
33 IMPL_LINK_NOARG(UnknownAuthDialog, OKHdl_Impl)
35 if ( m_aOptionButtonAccept.IsChecked() )
37 EndDialog( RET_OK );
38 } else
40 EndDialog( RET_CANCEL );
43 return 1;
46 // -----------------------------------------------------------------------
48 IMPL_LINK_NOARG(UnknownAuthDialog, ViewCertHdl_Impl)
50 uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures > xDocumentDigitalSignatures;
52 xDocumentDigitalSignatures = uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures >(
53 ::com::sun::star::security::DocumentDigitalSignatures::createDefault(m_xContext) );
55 xDocumentDigitalSignatures.get()->showCertificate(getCert());
57 return 0;
60 // -----------------------------------------------------------------------
62 UnknownAuthDialog::UnknownAuthDialog
64 Window* pParent,
65 const css::uno::Reference< css::security::XCertificate >& rXCert,
66 const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& xContext,
67 ResMgr* pResMgr
68 ) :
69 ModalDialog( pParent, ResId( DLG_UUI_UNKNOWNAUTH, *pResMgr ) ),
71 m_aCommandButtonOK ( this, ResId( PB_OK, *pResMgr ) ),
72 m_aCommandButtonCancel ( this, ResId( PB_CANCEL, *pResMgr ) ),
73 m_aCommandButtonHelp ( this, ResId( PB_HELP, *pResMgr ) ),
74 m_aView_Certificate ( this, ResId( PB_VIEW__CERTIFICATE, *pResMgr ) ),
75 m_aOptionButtonAccept ( this, ResId( RB_ACCEPT_1, *pResMgr ) ),
76 m_aOptionButtonDontAccept ( this, ResId( RB_DONTACCEPT_2, *pResMgr ) ),
77 m_aLine ( this, ResId( FL_LINE, *pResMgr ) ),
78 m_aLabel1 ( this, ResId( FT_LABEL_1, *pResMgr ) ),
79 m_aWarnImage ( this, ResId( IMG_WARN, *pResMgr ) ),
80 m_xContext ( xContext ),
81 m_rXCert ( rXCert )
83 FreeResource();
85 m_aWarnImage.SetImage( WarningBox::GetStandardImage() );
86 m_pParent = pParent;
87 m_aView_Certificate.SetClickHdl( LINK( this, UnknownAuthDialog, ViewCertHdl_Impl ) );
88 m_aCommandButtonOK.SetClickHdl( LINK( this, UnknownAuthDialog, OKHdl_Impl ) );
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */