Files
libreoffice/cui/source/inc/treeopt.hxx

291 lines
9.9 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 -*- */
re-base on ALv2 code. Includes: clarify Option->Language UI option Patch contributed by Herbert Duerr http://svn.apache.org/viewvc?view=revision&revision=1173991 cws mba34issues01: #i117712#: fix several resource errors introduced by IAccessible2 implementation Patch contributed by Mathias Bauer http://svn.apache.org/viewvc?view=revision&revision=1173991 cws mba34issues01: #i117709#: add missing string resource Patch contributed by Mathias Bauer http://svn.apache.org/viewvc?view=revision&revision=1172348 cws mba34issues01: #i117716#: fix missing resources my removing unused code Patch contributed by Mathias Bauer http://svn.apache.org/viewvc?view=revision&revision=1172345 re-add Crystal, Tango, Oxygen icon theme listings. correct method signature Patch contributed by Jean-Louis 'Hans' Fuchs http://svn.apache.org/viewvc?view=revision&revision=1306725 i#119063 - correct serf integration Patch contributed by Oliver-Rainer Wittmann http://svn.apache.org/viewvc?view=revision&revision=1300521 i#119036 - adapt serf integration -- use transfer-encoding 'chunked' on HTTPS -- switch transfer-encoding between 'chunked' and none on 413 HTTP status code -- refactoring -- improve user experience of certification dialog - only shown once Patch contributed by Oliver-Rainer Wittmann http://svn.apache.org/viewvc?view=revision&revision=1299727 118569: Use whole certification chain for verification. Patch contributed by Andre Fischer http://svn.apache.org/viewvc?view=revision&revision=1295493 serf integration: improve credential input handling Patch contributed by Oliver-Rainer Wittmann http://svn.apache.org/viewvc?view=revision&revision=1294557 warning-free ucb/source/ucp/webdav Patch contributed by Pavel Janik http://svn.apache.org/viewvc?view=revision&revision=1294086 some refactoring to PROPPATCH and PROPFIND requests Patch contributed by Oliver-Rainer Wittmann http://svn.apache.org/viewvc?view=revision&revision=1293281 i#118569: Replace neon with serf Patch contributed by Oliver-Rainer Wittmann http://svn.apache.org/viewvc?view=revision&revision=1292832 http://svn.apache.org/viewvc?view=revision&revision=1292794 remove OS/2 conditionals for now. re-enable webdav unit tests.
2012-10-04 11:25:41 +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 .
*/
2009-10-31 00:36:06 +01:00
#ifndef INCLUDED_CUI_SOURCE_INC_TREEOPT_HXX
#define INCLUDED_CUI_SOURCE_INC_TREEOPT_HXX
2009-10-31 00:36:06 +01:00
#include <tools/resary.hxx>
#include <vcl/fixed.hxx>
2009-10-31 00:36:06 +01:00
2011-12-16 19:50:33 -05:00
class SfxModule;
class SfxShell;
2009-10-31 00:36:06 +01:00
// static ----------------------------------------------------------------
bool EnableSSO();
CreateTabPage GetSSOCreator();
2009-10-31 00:36:06 +01:00
// struct OrderedEntry ---------------------------------------------------
struct OrderedEntry
{
sal_Int32 m_nIndex;
OUString m_sId;
2009-10-31 00:36:06 +01:00
OrderedEntry( sal_Int32 nIndex, const OUString& rId ) :
2009-10-31 00:36:06 +01:00
m_nIndex( nIndex ), m_sId( rId ) {}
};
typedef std::vector< OrderedEntry* > VectorOfOrderedEntries;
// struct Module ---------------------------------------------------------
struct Module
{
OUString m_sName;
2009-10-31 00:36:06 +01:00
bool m_bActive;
VectorOfOrderedEntries m_aNodeList;
Module( const OUString& rName ) : m_sName( rName ), m_bActive( false ) {}
2009-10-31 00:36:06 +01:00
};
// struct OptionsLeaf ----------------------------------------------------
struct OptionsLeaf
{
OUString m_sId;
OUString m_sLabel;
OUString m_sPageURL;
OUString m_sEventHdl;
OUString m_sGroupId;
2009-10-31 00:36:06 +01:00
sal_Int32 m_nGroupIndex;
OptionsLeaf( const OUString& rId,
const OUString& rLabel,
const OUString& rPageURL,
const OUString& rEventHdl,
const OUString& rGroupId,
2009-10-31 00:36:06 +01:00
sal_Int32 nGroupIndex ) :
m_sId( rId ),
m_sLabel( rLabel ),
m_sPageURL( rPageURL ),
m_sEventHdl( rEventHdl ),
m_sGroupId( rGroupId ),
m_nGroupIndex( nGroupIndex ) {}
};
typedef ::std::vector< OptionsLeaf* > VectorOfLeaves;
typedef ::std::vector< VectorOfLeaves > VectorOfGroupedLeaves;
// struct OptionsNode ----------------------------------------------------
struct OptionsNode
{
OUString m_sId;
OUString m_sLabel;
OUString m_sPageURL;
2009-10-31 00:36:06 +01:00
bool m_bAllModules;
OUString m_sGroupId;
2009-10-31 00:36:06 +01:00
sal_Int32 m_nGroupIndex;
VectorOfLeaves m_aLeaves;
VectorOfGroupedLeaves m_aGroupedLeaves;
OptionsNode( const OUString& rId,
const OUString& rLabel,
const OUString& rPageURL,
2009-10-31 00:36:06 +01:00
bool bAllModules,
const OUString& rGroupId,
2009-10-31 00:36:06 +01:00
sal_Int32 nGroupIndex ) :
m_sId( rId ),
m_sLabel( rLabel ),
m_sPageURL( rPageURL ),
m_bAllModules( bAllModules ),
m_sGroupId( rGroupId ),
m_nGroupIndex( nGroupIndex ) {}
~OptionsNode()
{
for ( sal_uInt32 i = 0; i < m_aLeaves.size(); ++i )
delete m_aLeaves[i];
m_aLeaves.clear();
m_aGroupedLeaves.clear();
}
};
typedef ::std::vector< OptionsNode* > VectorOfNodes;
struct LastPageSaver
{
sal_uInt16 m_nLastPageId;
OUString m_sLastPageURL_Tools;
OUString m_sLastPageURL_ExtMgr;
2009-10-31 00:36:06 +01:00
LastPageSaver() : m_nLastPageId( USHRT_MAX ) {}
};
// class OfaTreeOptionsDialog --------------------------------------------
namespace com { namespace sun { namespace star { namespace frame { class XFrame; } } } }
namespace com { namespace sun { namespace star { namespace awt { class XContainerWindowProvider; } } } }
struct OptionsPageInfo;
struct Module;
class ExtensionsTabPage;
class SvxColorTabPage;
2009-10-31 00:36:06 +01:00
typedef std::vector< ExtensionsTabPage* > VectorOfPages;
class OfaTreeOptionsDialog : public SfxModalDialog
{
private:
SvTreeListEntry* pCurrentPageEntry;
bool hasTreePendingLayout() const;
OKButton* pOkPB;
PushButton* pBackPB;
2009-10-31 00:36:06 +01:00
SvTreeListBox* pTreeLB;
VclBox* pTabBox;
2009-10-31 00:36:06 +01:00
OUString sTitle;
OUString sNotLoadedError;
2009-10-31 00:36:06 +01:00
// for the ColorTabPage
SfxItemSet* pColorPageItemSet;
2011-12-14 14:43:58 -05:00
SvxColorTabPage *mpColorPage;
bool bForgetSelection;
2009-10-31 00:36:06 +01:00
bool bIsFromExtensionManager;
// check "for the current document only" and set focus to "Western" languages box
bool bIsForSetDocumentLanguage;
com::sun::star::uno::Reference < com::sun::star::awt::XContainerWindowProvider >
m_xContainerWinProvider;
static LastPageSaver* pLastPageSaver;
SfxItemSet* CreateItemSet( sal_uInt16 nId );
void ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet );
2009-10-31 00:36:06 +01:00
void InitTreeAndHandler();
void Initialize( const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& _xFrame );
void InitWidgets();
2009-10-31 00:36:06 +01:00
void LoadExtensionOptions( const OUString& rExtensionId );
OUString GetModuleIdentifier( const com::sun::star::uno::Reference<
2009-10-31 00:36:06 +01:00
com::sun::star::frame::XFrame >& xFrame );
Module* LoadModule( const OUString& rModuleIdentifier );
VectorOfNodes LoadNodes( Module* pModule, const OUString& rExtensionId );
2009-10-31 00:36:06 +01:00
void InsertNodes( const VectorOfNodes& rNodeList );
protected:
DECL_LINK(ExpandedHdl_Impl, SvTreeListBox* );
DECL_LINK(ShowPageHdl_Impl, void *);
DECL_LINK(BackHdl_Impl, void *);
DECL_LINK(OKHdl_Impl, void *);
2009-10-31 00:36:06 +01:00
DECL_LINK( HintHdl_Impl, Timer * );
void SelectHdl_Impl();
2009-10-31 00:36:06 +01:00
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
2009-10-31 00:36:06 +01:00
public:
OfaTreeOptionsDialog( vcl::Window* pParent,
2009-10-31 00:36:06 +01:00
const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& _xFrame,
bool bActivateLastSelection = true );
OfaTreeOptionsDialog( vcl::Window* pParent, const OUString& rExtensionId );
virtual ~OfaTreeOptionsDialog();
2009-10-31 00:36:06 +01:00
OptionsPageInfo* AddTabPage( sal_uInt16 nId, const OUString& rPageName, sal_uInt16 nGroup );
sal_uInt16 AddGroup( const OUString& rGroupName, SfxShell* pCreateShell,
SfxModule* pCreateModule, sal_uInt16 nDialogId );
2009-10-31 00:36:06 +01:00
void ActivateLastSelection();
void ActivatePage( sal_uInt16 nResId );
void ActivatePage( const OUString& rPageURL );
2009-10-31 00:36:06 +01:00
void ApplyItemSets();
// helper functions to call the language settings TabPage from the SpellDialog
static void ApplyLanguageOptions(const SfxItemSet& rSet);
};
// class OfaPageResource -------------------------------------------------
class OfaPageResource : public Resource
{
ResStringArray aGeneralDlgAry;
ResStringArray aInetDlgAry;
ResStringArray aLangDlgAry;
ResStringArray aTextDlgAry;
ResStringArray aHTMLDlgAry;
ResStringArray aCalcDlgAry;
ResStringArray aStarMathDlgAry;
ResStringArray aImpressDlgAry;
ResStringArray aDrawDlgAry;
ResStringArray aChartDlgAry;
ResStringArray aFilterDlgAry;
ResStringArray aDatasourcesDlgAry;
public:
OfaPageResource();
ResStringArray& GetGeneralArray() {return aGeneralDlgAry;}
ResStringArray& GetInetArray() {return aInetDlgAry;}
ResStringArray& GetLangArray() {return aLangDlgAry;}
ResStringArray& GetTextArray() {return aTextDlgAry;}
ResStringArray& GetHTMLArray() {return aHTMLDlgAry;}
ResStringArray& GetCalcArray() {return aCalcDlgAry;}
ResStringArray& GetStarMathArray() {return aStarMathDlgAry;}
ResStringArray& GetImpressArray() {return aImpressDlgAry;}
ResStringArray& GetDrawArray() {return aDrawDlgAry;}
ResStringArray& GetChartArray() {return aChartDlgAry;}
ResStringArray& GetFilterArray() {return aFilterDlgAry;}
ResStringArray& GetDatasourcesArray() {return aDatasourcesDlgAry;}
};
// class ExtensionsTabPage -----------------------------------------------
namespace com { namespace sun { namespace star { namespace awt { class XWindow; } } } }
namespace com { namespace sun { namespace star { namespace awt { class XContainerWindowEventHandler; } } } }
class ExtensionsTabPage : public TabPage
{
private:
OUString m_sPageURL;
2009-10-31 00:36:06 +01:00
com::sun::star::uno::Reference< com::sun::star::awt::XWindow >
m_xPage;
OUString m_sEventHdl;
2009-10-31 00:36:06 +01:00
com::sun::star::uno::Reference< com::sun::star::awt::XContainerWindowEventHandler >
m_xEventHdl;
com::sun::star::uno::Reference< com::sun::star::awt::XContainerWindowProvider >
m_xWinProvider;
bool m_bIsWindowHidden;
void CreateDialogWithHandler();
bool DispatchAction( const OUString& rAction );
2009-10-31 00:36:06 +01:00
public:
ExtensionsTabPage(
vcl::Window* pParent, WinBits nStyle,
const OUString& rPageURL, const OUString& rEvtHdl,
2009-10-31 00:36:06 +01:00
const com::sun::star::uno::Reference<
com::sun::star::awt::XContainerWindowProvider >& rProvider );
virtual ~ExtensionsTabPage();
virtual void ActivatePage() SAL_OVERRIDE;
virtual void DeactivatePage() SAL_OVERRIDE;
2009-10-31 00:36:06 +01:00
void ResetPage();
void SavePage();
};
#endif
2010-10-27 12:45:03 +01:00
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */