2010-10-27 12:45:03 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-07-16 17:32:30 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2004-07-16 05:28:08 +00:00
|
|
|
|
2014-04-18 18:50:28 +02:00
|
|
|
#ifndef INCLUDED_XMLSECURITY_INC_XMLSECURITY_MACROSECURITY_HXX
|
|
|
|
#define INCLUDED_XMLSECURITY_INC_XMLSECURITY_MACROSECURITY_HXX
|
2004-07-16 05:28:08 +00:00
|
|
|
|
|
|
|
#include <vcl/fixed.hxx>
|
|
|
|
#include <vcl/button.hxx>
|
|
|
|
#include <vcl/lstbox.hxx>
|
|
|
|
#include <vcl/tabdlg.hxx>
|
|
|
|
#include <vcl/tabctrl.hxx>
|
|
|
|
#include <vcl/tabpage.hxx>
|
2013-07-16 09:12:42 +01:00
|
|
|
#include <svtools/simptabl.hxx>
|
2004-07-16 05:28:08 +00:00
|
|
|
#include <svtools/stdctrl.hxx>
|
2009-10-06 07:38:24 +02:00
|
|
|
#include <unotools/securityoptions.hxx>
|
2004-07-16 05:28:08 +00:00
|
|
|
|
2014-01-02 23:52:37 +01:00
|
|
|
#include <com/sun/star/uno/XComponentContext.hpp>
|
|
|
|
|
2004-07-16 05:28:08 +00:00
|
|
|
namespace com {
|
|
|
|
namespace sun {
|
|
|
|
namespace star {
|
|
|
|
namespace xml { namespace crypto {
|
|
|
|
class XSecurityEnvironment; }}
|
|
|
|
}}}
|
|
|
|
|
2004-07-20 14:43:12 +00:00
|
|
|
class MacroSecurityTP;
|
|
|
|
|
2004-07-16 05:28:08 +00:00
|
|
|
class MacroSecurity : public TabDialog
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
friend class MacroSecurityLevelTP;
|
|
|
|
friend class MacroSecurityTrustedSourcesTP;
|
|
|
|
|
2013-02-14 23:04:56 +00:00
|
|
|
TabControl* m_pTabCtrl;
|
|
|
|
OKButton* m_pOkBtn;
|
|
|
|
PushButton* m_pResetBtn;
|
2004-07-16 05:28:08 +00:00
|
|
|
|
2013-03-30 00:32:52 +01:00
|
|
|
css::uno::Reference< css::uno::XComponentContext > mxCtx;
|
|
|
|
css::uno::Reference< css::xml::crypto::XSecurityEnvironment > mxSecurityEnvironment;
|
2004-07-20 14:43:12 +00:00
|
|
|
SvtSecurityOptions maSecOptions;
|
2004-07-26 11:13:29 +00:00
|
|
|
|
2013-02-14 23:04:56 +00:00
|
|
|
sal_uInt16 m_nSecLevelId;
|
|
|
|
sal_uInt16 m_nSecTrustId;
|
|
|
|
|
2004-07-20 14:43:12 +00:00
|
|
|
MacroSecurityTP* mpLevelTP;
|
|
|
|
MacroSecurityTP* mpTrustSrcTP;
|
|
|
|
|
|
|
|
DECL_LINK( OkBtnHdl, void* );
|
2004-07-16 05:28:08 +00:00
|
|
|
public:
|
2013-02-14 23:04:56 +00:00
|
|
|
MacroSecurity(Window* pParent,
|
2013-03-30 00:32:52 +01:00
|
|
|
const css::uno::Reference< css::uno::XComponentContext>& rxCtx,
|
|
|
|
const css::uno::Reference< css::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment);
|
2013-02-14 23:04:56 +00:00
|
|
|
virtual ~MacroSecurity();
|
2004-07-16 09:26:28 +00:00
|
|
|
|
2013-02-14 23:04:56 +00:00
|
|
|
inline void EnableReset(bool _bEnable = true)
|
|
|
|
{
|
|
|
|
m_pResetBtn->Enable ( _bEnable );
|
|
|
|
}
|
2004-07-16 05:28:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class MacroSecurityTP : public TabPage
|
|
|
|
{
|
|
|
|
protected:
|
2004-07-16 06:52:00 +00:00
|
|
|
MacroSecurity* mpDlg;
|
2004-07-16 05:28:08 +00:00
|
|
|
public:
|
2013-02-13 23:43:32 +00:00
|
|
|
MacroSecurityTP(Window* _pParent, const OString& rID,
|
|
|
|
const OUString& rUIXMLDescription, MacroSecurity* _pDlg);
|
|
|
|
|
|
|
|
void SetTabDlg(MacroSecurity* pTabDlg)
|
|
|
|
{
|
|
|
|
mpDlg = pTabDlg;
|
|
|
|
}
|
2004-07-20 14:43:12 +00:00
|
|
|
|
|
|
|
virtual void ClosePage( void ) = 0;
|
2004-07-16 05:28:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class MacroSecurityLevelTP : public MacroSecurityTP
|
|
|
|
{
|
|
|
|
private:
|
2013-02-13 23:43:32 +00:00
|
|
|
RadioButton* m_pVeryHighRB;
|
|
|
|
RadioButton* m_pHighRB;
|
|
|
|
RadioButton* m_pMediumRB;
|
|
|
|
RadioButton* m_pLowRB;
|
|
|
|
|
|
|
|
sal_uInt16 mnCurLevel;
|
2004-08-04 05:13:56 +00:00
|
|
|
|
|
|
|
protected:
|
2012-03-01 18:00:32 +01:00
|
|
|
DECL_LINK(RadioButtonHdl, void *);
|
2004-08-04 05:13:56 +00:00
|
|
|
|
2004-07-16 05:28:08 +00:00
|
|
|
public:
|
|
|
|
MacroSecurityLevelTP( Window* pParent, MacroSecurity* _pDlg );
|
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual void ClosePage( void ) SAL_OVERRIDE;
|
2004-07-16 05:28:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class MacroSecurityTrustedSourcesTP : public MacroSecurityTP
|
|
|
|
{
|
|
|
|
private:
|
2013-02-14 15:16:13 +00:00
|
|
|
FixedImage* m_pTrustCertROFI;
|
2013-07-16 09:12:42 +01:00
|
|
|
SvSimpleTable* m_pTrustCertLB;
|
2013-02-14 15:16:13 +00:00
|
|
|
PushButton* m_pViewCertPB;
|
|
|
|
PushButton* m_pRemoveCertPB;
|
|
|
|
FixedImage* m_pTrustFileROFI;
|
|
|
|
ListBox* m_pTrustFileLocLB;
|
|
|
|
PushButton* m_pAddLocPB;
|
|
|
|
PushButton* m_pRemoveLocPB;
|
2004-07-16 05:28:08 +00:00
|
|
|
|
2013-03-30 00:32:52 +01:00
|
|
|
css::uno::Sequence< SvtSecurityOptions::Certificate > maTrustedAuthors;
|
2004-07-26 11:13:29 +00:00
|
|
|
|
2012-09-25 17:28:22 +02:00
|
|
|
bool mbAuthorsReadonly;
|
|
|
|
bool mbURLsReadonly;
|
2004-07-26 11:13:29 +00:00
|
|
|
|
2004-07-16 05:28:08 +00:00
|
|
|
DECL_LINK( ViewCertPBHdl, void* );
|
|
|
|
DECL_LINK( RemoveCertPBHdl, void* );
|
|
|
|
DECL_LINK( AddLocPBHdl, void* );
|
|
|
|
DECL_LINK( RemoveLocPBHdl, void* );
|
2004-07-16 06:52:00 +00:00
|
|
|
DECL_LINK( TrustCertLBSelectHdl, void* );
|
|
|
|
DECL_LINK( TrustFileLocLBSelectHdl, void* );
|
|
|
|
|
|
|
|
void FillCertLB( void );
|
2004-07-26 11:13:29 +00:00
|
|
|
void ImplCheckButtons();
|
|
|
|
|
2004-07-16 05:28:08 +00:00
|
|
|
public:
|
2013-02-14 15:16:13 +00:00
|
|
|
MacroSecurityTrustedSourcesTP(Window* pParent, MacroSecurity* _pDlg);
|
2014-04-01 19:18:35 +02:00
|
|
|
virtual ~MacroSecurityTrustedSourcesTP();
|
2004-07-16 05:28:08 +00:00
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual void ActivatePage() SAL_OVERRIDE;
|
|
|
|
virtual void ClosePage( void ) SAL_OVERRIDE;
|
2004-07-16 05:28:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2014-04-18 18:50:28 +02:00
|
|
|
#endif // INCLUDED_XMLSECURITY_INC_XMLSECURITY_MACROSECURITY_HXX
|
2004-07-16 05:28:08 +00:00
|
|
|
|
2010-10-27 12:45:03 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|