2004-07-16 05:28:08 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 23:07:54 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2004-07-16 05:28:08 +00:00
|
|
|
*
|
2008-04-10 23:07:54 +00:00
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2004-07-16 05:28:08 +00:00
|
|
|
*
|
2008-04-10 23:07:54 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2004-07-16 05:28:08 +00:00
|
|
|
*
|
2008-04-10 23:07:54 +00:00
|
|
|
* $RCSfile: macrosecurity.hxx,v $
|
2008-08-18 12:12:09 +00:00
|
|
|
* $Revision: 1.15 $
|
2004-07-16 05:28:08 +00:00
|
|
|
*
|
2008-04-10 23:07:54 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2004-07-16 05:28:08 +00:00
|
|
|
*
|
2008-04-10 23:07:54 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2004-07-16 05:28:08 +00:00
|
|
|
*
|
2008-04-10 23:07:54 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2004-07-16 05:28:08 +00:00
|
|
|
*
|
2008-04-10 23:07:54 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2004-07-16 05:28:08 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _XMLSECURITY_MACROSECURITY_HXX
|
|
|
|
#define _XMLSECURITY_MACROSECURITY_HXX
|
|
|
|
|
|
|
|
#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/stdctrl.hxx>
|
|
|
|
#include <svx/simptabl.hxx>
|
2004-07-20 14:43:12 +00:00
|
|
|
#include <svtools/securityoptions.hxx>
|
2004-07-16 05:28:08 +00:00
|
|
|
|
|
|
|
namespace com {
|
|
|
|
namespace sun {
|
|
|
|
namespace star {
|
|
|
|
namespace xml { namespace crypto {
|
|
|
|
class XSecurityEnvironment; }}
|
|
|
|
}}}
|
|
|
|
|
|
|
|
namespace css = com::sun::star;
|
|
|
|
namespace cssu = com::sun::star::uno;
|
|
|
|
namespace dcss = ::com::sun::star;
|
|
|
|
|
2004-07-20 14:43:12 +00:00
|
|
|
class MacroSecurityTP;
|
|
|
|
|
2005-01-28 14:21:52 +00:00
|
|
|
class ReadOnlyImage : public FixedImage
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ReadOnlyImage(Window* pParent, const ResId rResId);
|
|
|
|
~ReadOnlyImage();
|
|
|
|
|
|
|
|
virtual void RequestHelp( const HelpEvent& rHEvt );
|
|
|
|
static const String& GetHelpTip();
|
|
|
|
};
|
|
|
|
|
2004-07-16 05:28:08 +00:00
|
|
|
class MacroSecurity : public TabDialog
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
friend class MacroSecurityLevelTP;
|
|
|
|
friend class MacroSecurityTrustedSourcesTP;
|
|
|
|
|
|
|
|
TabControl maTabCtrl;
|
|
|
|
OKButton maOkBtn;
|
|
|
|
CancelButton maCancelBtn;
|
|
|
|
HelpButton maHelpBtn;
|
|
|
|
PushButton maResetBtn;
|
|
|
|
|
2008-08-18 12:12:09 +00:00
|
|
|
cssu::Reference< cssu::XComponentContext > mxCtx;
|
2004-07-20 14:43:12 +00:00
|
|
|
cssu::Reference< dcss::xml::crypto::XSecurityEnvironment > mxSecurityEnvironment;
|
|
|
|
SvtSecurityOptions maSecOptions;
|
2004-07-26 11:13:29 +00:00
|
|
|
|
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:
|
2008-08-18 12:12:09 +00:00
|
|
|
MacroSecurity( Window* pParent, const cssu::Reference< cssu::XComponentContext>& rxCtx, const cssu::Reference< dcss::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment );
|
2004-07-16 05:28:08 +00:00
|
|
|
virtual ~MacroSecurity();
|
2004-07-16 09:26:28 +00:00
|
|
|
|
|
|
|
inline void EnableReset( bool _bEnable = true );
|
2004-07-16 05:28:08 +00:00
|
|
|
};
|
|
|
|
|
2004-07-16 09:26:28 +00:00
|
|
|
inline void MacroSecurity::EnableReset( bool _bEnable )
|
|
|
|
{
|
|
|
|
maResetBtn.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 ResId& _rResId, MacroSecurity* _pDlg );
|
|
|
|
inline void SetTabDlg( MacroSecurity* pTabDlg );
|
2004-07-20 14:43:12 +00:00
|
|
|
|
|
|
|
virtual void ClosePage( void ) = 0;
|
2004-07-16 05:28:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
inline void MacroSecurityTP::SetTabDlg( MacroSecurity* _pTabDlg )
|
|
|
|
{
|
|
|
|
mpDlg = _pTabDlg;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class MacroSecurityLevelTP : public MacroSecurityTP
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
FixedLine maSecLevelFL;
|
2005-01-28 14:21:52 +00:00
|
|
|
ReadOnlyImage maSecReadonlyFI;
|
2004-07-16 05:28:08 +00:00
|
|
|
RadioButton maVeryHighRB;
|
|
|
|
RadioButton maHighRB;
|
|
|
|
RadioButton maMediumRB;
|
|
|
|
RadioButton maLowRB;
|
2004-07-20 14:43:12 +00:00
|
|
|
|
2004-08-04 05:13:56 +00:00
|
|
|
USHORT mnCurLevel;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
DECL_LINK( RadioButtonHdl, RadioButton* );
|
|
|
|
|
2004-07-16 05:28:08 +00:00
|
|
|
public:
|
|
|
|
MacroSecurityLevelTP( Window* pParent, MacroSecurity* _pDlg );
|
|
|
|
|
2004-07-20 14:43:12 +00:00
|
|
|
virtual void ClosePage( void );
|
2004-07-16 05:28:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class MacroSecurityTrustedSourcesTP : public MacroSecurityTP
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
FixedLine maTrustCertFL;
|
2005-01-28 14:21:52 +00:00
|
|
|
ReadOnlyImage maTrustCertROFI;
|
2006-02-06 11:59:11 +00:00
|
|
|
SvxSimpleTable maTrustCertLB; // PB 2006/02/02 #i48648 now SvHeaderTabListBox
|
2004-07-16 05:28:08 +00:00
|
|
|
PushButton maAddCertPB;
|
|
|
|
PushButton maViewCertPB;
|
|
|
|
PushButton maRemoveCertPB;
|
|
|
|
FixedLine maTrustFileLocFL;
|
2005-01-28 14:21:52 +00:00
|
|
|
ReadOnlyImage maTrustFileROFI;
|
2004-07-16 05:28:08 +00:00
|
|
|
FixedInfo maTrustFileLocFI;
|
|
|
|
ListBox maTrustFileLocLB;
|
|
|
|
PushButton maAddLocPB;
|
|
|
|
PushButton maRemoveLocPB;
|
|
|
|
|
2004-07-26 11:13:29 +00:00
|
|
|
cssu::Sequence< SvtSecurityOptions::Certificate > maTrustedAuthors;
|
|
|
|
|
2005-01-28 14:21:52 +00:00
|
|
|
sal_Bool mbAuthorsReadonly;
|
|
|
|
sal_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 void ActivatePage();
|
2004-07-20 14:43:12 +00:00
|
|
|
virtual void ClosePage( void );
|
2004-07-16 05:28:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // _XMLSECURITY_MACROSECURITY_HXX
|
|
|
|
|