Files
libreoffice/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx

152 lines
4.5 KiB
C++
Raw Normal View History

2010-10-27 12:45:03 +01:00
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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>
#include <svtools/simptabl.hxx>
2004-07-16 05:28:08 +00:00
#include <svtools/stdctrl.hxx>
#include <unotools/securityoptions.hxx>
2004-07-16 05:28:08 +00: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;
TabControl* m_pTabCtrl;
OKButton* m_pOkBtn;
PushButton* m_pResetBtn;
2004-07-16 05:28:08 +00: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
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:
MacroSecurity(Window* pParent,
const css::uno::Reference< css::uno::XComponentContext>& rxCtx,
const css::uno::Reference< css::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment);
virtual ~MacroSecurity();
2004-07-16 09:26:28 +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:
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:
RadioButton* m_pVeryHighRB;
RadioButton* m_pHighRB;
RadioButton* m_pMediumRB;
RadioButton* m_pLowRB;
sal_uInt16 mnCurLevel;
2004-08-04 05:13:56 +00:00
protected:
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 );
virtual void ClosePage( void ) SAL_OVERRIDE;
2004-07-16 05:28:08 +00:00
};
class MacroSecurityTrustedSourcesTP : public MacroSecurityTP
{
private:
FixedImage* m_pTrustCertROFI;
SvSimpleTable* m_pTrustCertLB;
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
css::uno::Sequence< SvtSecurityOptions::Certificate > maTrustedAuthors;
2004-07-26 11:13:29 +00: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:
MacroSecurityTrustedSourcesTP(Window* pParent, MacroSecurity* _pDlg);
virtual ~MacroSecurityTrustedSourcesTP();
2004-07-16 05:28:08 +00: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: */