summaryrefslogtreecommitdiff
path: root/svtools/inc/svtools
diff options
context:
space:
mode:
Diffstat (limited to 'svtools/inc/svtools')
-rw-r--r--svtools/inc/svtools/AccessibleBrowseBoxObjType.hxx59
-rw-r--r--svtools/inc/svtools/FilterConfigItem.hxx100
-rw-r--r--svtools/inc/svtools/accessibilityoptions.hxx82
-rwxr-xr-xsvtools/inc/svtools/accessiblefactory.hxx187
-rwxr-xr-xsvtools/inc/svtools/accessibletable.hxx183
-rw-r--r--svtools/inc/svtools/accessibletableprovider.hxx252
-rw-r--r--svtools/inc/svtools/brwbox.hxx877
-rw-r--r--svtools/inc/svtools/brwhead.hxx53
-rw-r--r--svtools/inc/svtools/chartprettypainter.hxx71
-rw-r--r--svtools/inc/svtools/colctrl.hxx202
-rw-r--r--svtools/inc/svtools/colorcfg.hxx152
-rw-r--r--svtools/inc/svtools/colrdlg.hxx107
-rw-r--r--svtools/inc/svtools/editbrowsebox.hxx696
-rw-r--r--svtools/inc/svtools/editimplementation.hxx151
-rw-r--r--svtools/inc/svtools/editsyntaxhighlighter.hxx64
-rw-r--r--svtools/inc/svtools/ehdl.hxx88
-rw-r--r--svtools/inc/svtools/embedhlp.hxx142
-rw-r--r--svtools/inc/svtools/embedtransfer.hxx64
-rw-r--r--svtools/inc/svtools/extensionlistbox.hxx105
-rw-r--r--svtools/inc/svtools/fileurlbox.hxx77
-rw-r--r--svtools/inc/svtools/filter.hxx427
-rw-r--r--svtools/inc/svtools/fixedhyper.hxx231
-rw-r--r--svtools/inc/svtools/fltcall.hxx74
-rw-r--r--svtools/inc/svtools/fmtfield.hxx350
-rw-r--r--svtools/inc/svtools/generictoolboxcontroller.hxx71
-rw-r--r--svtools/inc/svtools/genericunodialog.hxx194
-rw-r--r--svtools/inc/svtools/grfmgr.hxx571
-rw-r--r--svtools/inc/svtools/headbar.hxx395
-rw-r--r--svtools/inc/svtools/helpid.hrc117
-rw-r--r--svtools/inc/svtools/helpopt.hxx96
-rw-r--r--svtools/inc/svtools/htmlcfg.hxx107
-rw-r--r--svtools/inc/svtools/htmlout.hxx125
-rw-r--r--svtools/inc/svtools/hyperlabel.hxx98
-rw-r--r--svtools/inc/svtools/imap.hxx171
-rw-r--r--svtools/inc/svtools/imapcirc.hxx87
-rw-r--r--svtools/inc/svtools/imapobj.hxx163
-rw-r--r--svtools/inc/svtools/imappoly.hxx93
-rw-r--r--svtools/inc/svtools/imaprect.hxx85
-rw-r--r--svtools/inc/svtools/inettbc.hxx111
-rw-r--r--svtools/inc/svtools/insdlg.hxx74
-rw-r--r--svtools/inc/svtools/javacontext.hxx91
-rw-r--r--svtools/inc/svtools/javainteractionhandler.hxx82
-rw-r--r--svtools/inc/svtools/langtab.hxx58
-rw-r--r--svtools/inc/svtools/menuoptions.hxx169
-rw-r--r--svtools/inc/svtools/miscopt.hxx180
-rw-r--r--svtools/inc/svtools/optionsdrawinglayer.hxx238
-rw-r--r--svtools/inc/svtools/parhtml.hxx297
-rw-r--r--svtools/inc/svtools/parrtf.hxx91
-rw-r--r--svtools/inc/svtools/popupmenucontrollerbase.hxx141
-rw-r--r--svtools/inc/svtools/popupwindowcontroller.hxx85
-rw-r--r--svtools/inc/svtools/printdlg.hxx297
-rw-r--r--svtools/inc/svtools/printoptions.hxx124
-rw-r--r--svtools/inc/svtools/prnsetup.hxx122
-rw-r--r--svtools/inc/svtools/roadmapwizard.hxx257
-rw-r--r--svtools/inc/svtools/stdctrl.hxx73
-rw-r--r--svtools/inc/svtools/stringtransfer.hxx83
-rw-r--r--svtools/inc/svtools/svicnvw.hxx291
-rw-r--r--svtools/inc/svtools/svlbitm.hxx297
-rw-r--r--svtools/inc/svtools/svlbox.hxx664
-rw-r--r--svtools/inc/svtools/svmedit.hxx154
-rw-r--r--svtools/inc/svtools/svmedit2.hxx54
-rw-r--r--svtools/inc/svtools/svparser.hxx285
-rw-r--r--svtools/inc/svtools/svtabbx.hxx268
-rw-r--r--svtools/inc/svtools/svtdata.hxx85
-rw-r--r--svtools/inc/svtools/svtdllapi.h41
-rw-r--r--svtools/inc/svtools/svtools.hrc400
-rw-r--r--svtools/inc/svtools/svtreebx.hxx421
-rw-r--r--svtools/inc/svtools/svxbox.hxx193
-rw-r--r--svtools/inc/svtools/syntaxhighlight.hxx191
-rw-r--r--svtools/inc/svtools/table/abstracttablecontrol.hxx134
-rw-r--r--svtools/inc/svtools/table/defaultinputhandler.hxx69
-rw-r--r--svtools/inc/svtools/table/gridtablerenderer.hxx108
-rw-r--r--svtools/inc/svtools/table/tablecontrol.hxx243
-rw-r--r--svtools/inc/svtools/table/tabledatawindow.hxx87
-rw-r--r--svtools/inc/svtools/table/tableinputhandler.hxx78
-rw-r--r--svtools/inc/svtools/table/tablemodel.hxx483
-rw-r--r--svtools/inc/svtools/table/tablerenderer.hxx274
-rw-r--r--svtools/inc/svtools/table/tabletypes.hxx76
-rw-r--r--svtools/inc/svtools/textdata.hxx205
-rw-r--r--svtools/inc/svtools/texteng.hxx329
-rw-r--r--svtools/inc/svtools/textview.hxx224
-rw-r--r--svtools/inc/svtools/textwindowpeer.hxx71
-rw-r--r--svtools/inc/svtools/toolbarmenu.hxx155
-rw-r--r--svtools/inc/svtools/toolboxcontroller.hxx175
-rwxr-xr-xsvtools/inc/svtools/toolpanel/decklayouter.hxx104
-rw-r--r--svtools/inc/svtools/toolpanel/drawerlayouter.hxx102
-rw-r--r--svtools/inc/svtools/toolpanel/paneltabbar.hxx102
-rw-r--r--svtools/inc/svtools/toolpanel/refbase.hxx80
-rw-r--r--svtools/inc/svtools/toolpanel/tabalignment.hxx47
-rw-r--r--svtools/inc/svtools/toolpanel/tabitemcontent.hxx48
-rwxr-xr-xsvtools/inc/svtools/toolpanel/tablayouter.hxx112
-rw-r--r--svtools/inc/svtools/toolpanel/toolpanel.hxx147
-rwxr-xr-xsvtools/inc/svtools/toolpanel/toolpaneldeck.hxx193
-rw-r--r--svtools/inc/svtools/transfer.hxx591
-rw-r--r--svtools/inc/svtools/treelist.hxx514
-rw-r--r--svtools/inc/svtools/ttprops.hxx106
-rw-r--r--svtools/inc/svtools/unitconv.hxx113
-rw-r--r--svtools/inc/svtools/urlcontrol.hxx61
-rw-r--r--svtools/inc/svtools/valueset.hxx445
-rw-r--r--svtools/inc/svtools/wizardmachine.hxx394
-rw-r--r--svtools/inc/svtools/wizdlg.hxx311
-rw-r--r--svtools/inc/svtools/wmf.hxx46
-rw-r--r--svtools/inc/svtools/xtextedt.hxx79
-rwxr-xr-xsvtools/inc/svtools/xwindowitem.hxx70
104 files changed, 19460 insertions, 0 deletions
diff --git a/svtools/inc/svtools/AccessibleBrowseBoxObjType.hxx b/svtools/inc/svtools/AccessibleBrowseBoxObjType.hxx
new file mode 100644
index 000000000000..fdca9a80af13
--- /dev/null
+++ b/svtools/inc/svtools/AccessibleBrowseBoxObjType.hxx
@@ -0,0 +1,59 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+
+#ifndef _SVTOOLS_ACCESSIBLEBROWSEBOXOBJTYPE_HXX
+#define _SVTOOLS_ACCESSIBLEBROWSEBOXOBJTYPE_HXX
+
+// ============================================================================
+
+namespace svt {
+
+// ============================================================================
+
+/** This enumeration contains a constant for each kind of accessible object of
+ a BrowseBox. */
+enum AccessibleBrowseBoxObjType
+{
+ BBTYPE_BROWSEBOX, /// The BrowseBox itself.
+ BBTYPE_TABLE, /// The data table.
+ BBTYPE_ROWHEADERBAR, /// The row header bar ("handle column").
+ BBTYPE_COLUMNHEADERBAR, /// The horizontal column header bar.
+ BBTYPE_TABLECELL, /// A cell of the data table.
+ BBTYPE_ROWHEADERCELL, /// A cell of the row header bar.
+ BBTYPE_COLUMNHEADERCELL, /// A cell of the column header bar.
+ BBTYPE_CHECKBOXCELL /// A cell with a checkbox.
+};
+
+// ============================================================================
+
+} // namespace svt
+
+// ============================================================================
+
+#endif
+
diff --git a/svtools/inc/svtools/FilterConfigItem.hxx b/svtools/inc/svtools/FilterConfigItem.hxx
new file mode 100644
index 000000000000..bdae8dabb1c3
--- /dev/null
+++ b/svtools/inc/svtools/FilterConfigItem.hxx
@@ -0,0 +1,100 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+
+#ifndef _FILTER_CONFIG_ITEM_HXX_
+#define _FILTER_CONFIG_ITEM_HXX_
+
+#include "svtools/svtdllapi.h"
+#include <tools/string.hxx>
+#include <com/sun/star/awt/Size.hpp>
+#include <com/sun/star/uno/Any.h>
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/uno/XInterface.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/XPropertyAccess.hpp>
+#include <com/sun/star/task/XStatusIndicator.hpp>
+
+class SVT_DLLPUBLIC FilterConfigItem
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xUpdatableView;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xPropSet;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aFilterData;
+
+ sal_Bool bModified;
+
+ SVT_DLLPRIVATE sal_Bool ImplGetPropertyValue( ::com::sun::star::uno::Any& rAny,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rXPropSet,
+ const ::rtl::OUString& rPropName,
+ sal_Bool bTestPropertyAvailability );
+
+ SVT_DLLPRIVATE void ImpInitTree( const String& rTree );
+
+
+ SVT_DLLPRIVATE static ::com::sun::star::beans::PropertyValue* GetPropertyValue(
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rPropSeq,
+ const ::rtl::OUString& rName );
+ SVT_DLLPRIVATE static sal_Bool WritePropertyValue(
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rPropSeq,
+ const ::com::sun::star::beans::PropertyValue& rPropValue );
+
+ public :
+
+ FilterConfigItem( const ::rtl::OUString& rSubTree );
+ FilterConfigItem( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData );
+ FilterConfigItem( const ::rtl::OUString& rSubTree, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData );
+ ~FilterConfigItem();
+
+ // all read methods are trying to return values in following order:
+ // 1. FilterData PropertySequence
+ // 2. configuration
+ // 3. given default
+ sal_Bool ReadBool( const ::rtl::OUString& rKey, sal_Bool bDefault );
+ sal_Int32 ReadInt32( const ::rtl::OUString& rKey, sal_Int32 nDefault );
+ ::com::sun::star::awt::Size
+ ReadSize( const ::rtl::OUString& rKey, const ::com::sun::star::awt::Size& rDefault );
+ ::rtl::OUString
+ ReadString( const ::rtl::OUString& rKey, const ::rtl::OUString& rDefault );
+ ::com::sun::star::uno::Any
+ ReadAny( const ::rtl::OUString& rKey, const ::com::sun::star::uno::Any& rDefault );
+
+ // try to store to configuration
+ // and always stores into the FilterData sequence
+ void WriteBool( const ::rtl::OUString& rKey, sal_Bool bValue );
+ void WriteInt32( const ::rtl::OUString& rKey, sal_Int32 nValue );
+ void WriteSize( const ::rtl::OUString& rKey, const ::com::sun::star::awt::Size& rSize );
+ void WriteString( const ::rtl::OUString& rKey, const ::rtl::OUString& rString );
+ void WriteAny( const rtl::OUString& rKey, const ::com::sun::star::uno::Any& rAny );
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > GetFilterData() const;
+
+ // GetStatusIndicator is returning the "StatusIndicator" property of the FilterData sequence
+ ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > GetStatusIndicator() const;
+};
+
+#endif // _FILTER_CONFIG_ITEM_HXX_
+
diff --git a/svtools/inc/svtools/accessibilityoptions.hxx b/svtools/inc/svtools/accessibilityoptions.hxx
new file mode 100644
index 000000000000..784f570825fb
--- /dev/null
+++ b/svtools/inc/svtools/accessibilityoptions.hxx
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_SVTOOLS_ACCESSIBILITYOPTIONS_HXX
+#define INCLUDED_SVTOOLS_ACCESSIBILITYOPTIONS_HXX
+
+#include "svtools/svtdllapi.h"
+#include <unotools/configitem.hxx>
+#include <tools/string.hxx>
+#include <svl/brdcst.hxx>
+#include <svl/lstner.hxx>
+#include <unotools/options.hxx>
+
+class SvtAccessibilityOptions_Impl;
+
+class SVT_DLLPUBLIC SvtAccessibilityOptions:
+ public utl::detail::Options, private SfxListener
+{
+private:
+ static SvtAccessibilityOptions_Impl* volatile sm_pSingleImplConfig;
+ static sal_Int32 volatile sm_nAccessibilityRefCount;
+
+public:
+ SvtAccessibilityOptions();
+ virtual ~SvtAccessibilityOptions();
+
+ // get & set config entries
+ sal_Bool GetIsForDrawings() const; // obsolete!
+ sal_Bool GetIsForBorders() const; // obsolete!
+ sal_Bool GetIsForPagePreviews() const;
+ sal_Bool GetIsHelpTipsDisappear() const;
+ sal_Bool GetIsAllowAnimatedGraphics() const;
+ sal_Bool GetIsAllowAnimatedText() const;
+ sal_Bool GetIsAutomaticFontColor() const;
+ sal_Bool GetIsSystemFont() const;
+ sal_Int16 GetHelpTipSeconds() const;
+ sal_Bool IsSelectionInReadonly() const;
+ sal_Bool GetAutoDetectSystemHC() const;
+
+ void SetIsForPagePreviews(sal_Bool bSet);
+ void SetIsHelpTipsDisappear(sal_Bool bSet);
+ void SetIsAllowAnimatedGraphics(sal_Bool bSet);
+ void SetIsAllowAnimatedText(sal_Bool bSet);
+ void SetIsAutomaticFontColor(sal_Bool bSet);
+ void SetIsSystemFont(sal_Bool bSet);
+ void SetHelpTipSeconds(sal_Int16 nSet);
+ void SetSelectionInReadonly(sal_Bool bSet);
+ void SetAutoDetectSystemHC(sal_Bool bSet);
+
+ sal_Bool IsModified() const;
+ void Commit();
+
+ //SfxListener:
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+ void SetVCLSettings();
+};
+
+#endif // #ifndef INCLUDED_SVTOOLS_ACCESSIBILITYOPTIONS_HXX
+
diff --git a/svtools/inc/svtools/accessiblefactory.hxx b/svtools/inc/svtools/accessiblefactory.hxx
new file mode 100755
index 000000000000..9606e93a2fa0
--- /dev/null
+++ b/svtools/inc/svtools/accessiblefactory.hxx
@@ -0,0 +1,187 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef SVTOOLS_ACCESSIBLE_FACTORY_HXX
+#define SVTOOLS_ACCESSIBLE_FACTORY_HXX
+
+#ifndef _COM_SUN_STAR_UNO_REFERENCE_HXX
+#include <com/sun/star/uno/Reference.hxx>
+#endif
+
+#ifndef _RTL_REF_HXX
+#include <rtl/ref.hxx>
+#endif
+#include "AccessibleBrowseBoxObjType.hxx"
+#include "accessibletableprovider.hxx"
+#include "accessibletable.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace accessibility {
+ class XAccessible;
+ class XAccessibleContext;
+ }
+ namespace awt {
+ class XWindow;
+ }
+} } }
+class SvHeaderTabListBox;
+class SvtIconChoiceCtrl;
+class TabBar;
+class SvTreeListBox;
+class VCLXWindow;
+class TextEngine;
+class TextView;
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ class ToolPanelDeck;
+ class IToolPanelDeck;
+ class PanelTabBar;
+
+ /** a function which is able to create a factory for the standard Accessible/Context
+ components needed for standard toolkit controls
+
+ The returned pointer denotes an instance of the IAccessibleFactory, which has been acquired
+ <em>once</em>. The caller is responsible for holding this reference as long as it needs the
+ factory, and release it afterwards.
+ */
+ typedef void* (SAL_CALL * GetSvtAccessibilityComponentFactory)( );
+
+ //================================================================
+ //= IAccessibleFactory
+ //================================================================
+ class IAccessibleFactory : public ::rtl::IReference
+ {
+ public:
+ virtual IAccessibleTabListBox*
+ createAccessibleTabListBox(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxParent,
+ SvHeaderTabListBox& rBox
+ ) const = 0;
+
+ virtual IAccessibleBrowseBox*
+ createAccessibleBrowseBox(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParent,
+ IAccessibleTableProvider& _rBrowseBox
+ ) const = 0;
+ virtual table::IAccessibleTableControl*
+ createAccessibleTableControl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParent,
+ table::IAccessibleTable& _rTable
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ createAccessibleIconChoiceCtrl(
+ SvtIconChoiceCtrl& _rIconCtrl,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _xParent
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ createAccessibleTabBar(
+ TabBar& _rTabBar
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ createAccessibleTextWindowContext(
+ VCLXWindow* pVclXWindow, TextEngine& rEngine, TextView& rView, bool bCompoundControlChild
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ createAccessibleTreeListBox(
+ SvTreeListBox& _rListBox,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _xParent
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ createAccessibleBrowseBoxHeaderBar(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxParent,
+ IAccessibleTableProvider& _rOwningTable,
+ AccessibleBrowseBoxObjType _eObjType
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ createAccessibleBrowseBoxTableCell(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParent,
+ IAccessibleTableProvider& _rBrowseBox,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& _xFocusWindow,
+ sal_Int32 _nRowId,
+ sal_uInt16 _nColId,
+ sal_Int32 _nOffset
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ createAccessibleBrowseBoxHeaderCell(
+ sal_Int32 _nColumnRowId,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxParent,
+ IAccessibleTableProvider& _rBrowseBox,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& _xFocusWindow,
+ AccessibleBrowseBoxObjType _eObjType
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ createAccessibleCheckBoxCell(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParent,
+ IAccessibleTableProvider& _rBrowseBox,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& _xFocusWindow,
+ sal_Int32 _nRowPos,
+ sal_uInt16 _nColPos,
+ const TriState& _eState,
+ sal_Bool _bEnabled,
+ sal_Bool _bIsTriState
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ createEditBrowseBoxTableCellAccess(
+ const ::com::sun::star::uno::Reference< com::sun::star::accessibility::XAccessible >& _rxParent,
+ const ::com::sun::star::uno::Reference< com::sun::star::accessibility::XAccessible >& _rxControlAccessible,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& _rxFocusWindow,
+ IAccessibleTableProvider& _rBrowseBox,
+ sal_Int32 _nRowPos,
+ sal_uInt16 _nColPos
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ createAccessibleToolPanelDeck(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rAccessibleParent,
+ ::svt::ToolPanelDeck& i_rPanelDeck
+ ) = 0;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ createAccessibleToolPanelTabBar(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rAccessibleParent,
+ ::svt::IToolPanelDeck& i_rPanelDeck,
+ ::svt::PanelTabBar& i_rTabBar
+ ) = 0;
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVTOOLS_ACCESSIBLE_FACTORY_HXX
diff --git a/svtools/inc/svtools/accessibletable.hxx b/svtools/inc/svtools/accessibletable.hxx
new file mode 100755
index 000000000000..8ff17a2b71c7
--- /dev/null
+++ b/svtools/inc/svtools/accessibletable.hxx
@@ -0,0 +1,183 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _SVTOOLS_ACCESSIBLETABLE_HXX
+#define _SVTOOLS_ACCESSIBLETABLE_HXX
+
+#include <vcl/window.hxx>
+#include <unotools/accessiblestatesethelper.hxx>
+#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
+
+// ============================================================================
+
+namespace svt{ namespace table
+{
+
+typedef sal_Int32 RowPos;
+
+// ============================================================================
+
+enum AccessibleTableType
+{
+ /** Child index of the column header bar (first row). */
+ TCINDEX_COLUMNHEADERBAR = 0,
+ /** Child index of the row header bar ("handle column"). */
+ TCINDEX_ROWHEADERBAR = 1,
+ /** Child index of the data table. */
+ TCINDEX_TABLE = 2
+};
+
+enum AccessibleTableControlObjType
+{
+ TCTYPE_GRIDCONTROL, /// The GridControl itself.
+ TCTYPE_TABLE, /// The data table.
+ TCTYPE_ROWHEADERBAR, /// The row header bar.
+ TCTYPE_COLUMNHEADERBAR, /// The horizontal column header bar.
+ TCTYPE_TABLECELL, /// A cell of the data table.
+ TCTYPE_ROWHEADERCELL, /// A cell of the row header bar.
+ TCTYPE_COLUMNHEADERCELL, /// A cell of the column header bar.
+};
+
+// ============================================================================
+
+#define XACC ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+
+/** This abstract class provides methods to implement an accessible table object.
+*/
+class IAccessibleTable
+{
+public:
+ /** @return The position of the current row. */
+ virtual sal_Int32 GetCurrentRow() const = 0;
+ /** @return The position of the current column. */
+ virtual sal_Int32 GetCurrentColumn() const = 0;
+ /** Creates and returns the accessible object of the whole GridControl. */
+ virtual XACC CreateAccessible()= 0;
+ virtual XACC CreateAccessibleControl( sal_Int32 _nIndex )= 0;
+ virtual ::rtl::OUString GetAccessibleObjectName(AccessibleTableControlObjType eObjType, sal_Int32 _nRow, sal_Int32 _nCol) const= 0;
+ virtual sal_Bool GoToCell( sal_Int32 _nColumnPos, sal_Int32 _nRow )= 0;
+ virtual sal_Bool HasColHeader() = 0;
+ virtual sal_Bool HasRowHeader() = 0;
+
+ /** return the description of the specified object.
+ @param eObjType
+ The type to ask for
+ @param _nPosition
+ The position of a tablecell (index position), header bar colum/row cell
+ @return
+ The description of the specified object.
+ */
+ virtual ::rtl::OUString GetAccessibleObjectDescription(AccessibleTableControlObjType eObjType, sal_Int32 _nPosition = -1) const= 0;
+
+ /** Fills the StateSet with all states (except DEFUNC and SHOWING, done by
+ the accessible object), depending on the specified object type. */
+ virtual void FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& rStateSet,
+ AccessibleTableControlObjType eObjType ) const= 0;
+
+ // Window
+ virtual Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) const = 0;
+ virtual void GrabFocus()= 0;
+ virtual XACC GetAccessible( BOOL bCreate = TRUE )= 0;
+ virtual Window* GetAccessibleParentWindow() const= 0;
+ virtual Window* GetWindowInstance()= 0;
+ virtual sal_Int32 GetAccessibleControlCount() const = 0;
+ virtual sal_Bool ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint )= 0;
+ virtual long GetRowCount() const= 0;
+ virtual long GetColumnCount() const= 0;
+ virtual sal_Bool HasRowHeader() const= 0;
+ virtual sal_Int32 GetSelectedRowCount() const= 0;
+ virtual bool IsRowSelected( long _nRow ) const= 0;
+ virtual sal_Bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint )= 0;
+ virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, BOOL _bOnScreen = TRUE ) = 0;
+ virtual Rectangle calcTableRect( BOOL _bOnScreen = TRUE ) = 0;
+ virtual Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex)= 0;
+ virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint)= 0;
+ virtual void FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const= 0;
+ virtual ::rtl::OUString GetRowDescription( sal_Int32 _nRow ) const = 0;
+ virtual ::rtl::OUString GetRowName(sal_Int32 _nIndex) const = 0;
+ virtual ::rtl::OUString GetColumnDescription( sal_uInt16 _nColumnPos ) const = 0;
+ virtual ::rtl::OUString GetColumnName( sal_Int32 _nIndex ) const = 0;
+ virtual ::com::sun::star::uno::Any GetCellContent( sal_Int32 _nRowPos, sal_Int32 _nColPos) const = 0;
+ virtual std::vector<sal_Int32>& GetSelectedRows() = 0;
+ virtual void RemoveSelectedRow(sal_Int32 _nRowPos) = 0;
+ virtual ::rtl::OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos) const = 0;
+};
+
+// ----------------------------------------------------------------------------
+
+/** interface for an implementation of a table control's Accesible component
+*/
+class IAccessibleTableControl
+{
+public:
+ /** returns the XAccessible object itself
+
+ The reference returned here can be used to control the life time of the
+ IAccessibleTableImplementation object.
+
+ The returned reference is guaranteed to not be <NULL/>.
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ getMyself() = 0;
+
+ /** disposes the accessible implementation, so that it becomes defunc
+ */
+ virtual void dispose() = 0;
+
+ /** checks whether the accessible implementation, and its context, are still alive
+ @return <TRUE/>, if the object is not disposed or disposing.
+ */
+ virtual sal_Bool isAlive() const = 0;
+
+ /** returns the accessible object for the row or the column header bar
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ getTableHeader( ::svt::table::AccessibleTableControlObjType _eObjType ) = 0;
+
+ /** returns the accessible object for the table representation
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ getTable() = 0;
+
+ ///** Commits an event to all listeners. */
+ virtual void commitEvent(
+ sal_Int16 nEventId,
+ const ::com::sun::star::uno::Any& rNewValue,
+ const ::com::sun::star::uno::Any& rOldValue
+ ) = 0;
+};
+
+// ----------------------------------------------------------------------------
+
+// ============================================================================
+} // namespace table
+} // namespace svt
+
+// ============================================================================
+
+#endif // _SVTOOLS_ACCESSIBLETABLE_HXX
+
diff --git a/svtools/inc/svtools/accessibletableprovider.hxx b/svtools/inc/svtools/accessibletableprovider.hxx
new file mode 100644
index 000000000000..d14aecce9f58
--- /dev/null
+++ b/svtools/inc/svtools/accessibletableprovider.hxx
@@ -0,0 +1,252 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _SVTOOLS_ACCESSIBLETABLEPROVIDER_HXX
+#define _SVTOOLS_ACCESSIBLETABLEPROVIDER_HXX
+
+#include <vcl/window.hxx>
+#include <unotools/accessiblestatesethelper.hxx>
+#include <svtools/AccessibleBrowseBoxObjType.hxx>
+#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
+
+// ============================================================================
+
+namespace svt
+{
+
+// ============================================================================
+
+#define OFFSET_DEFAULT ((sal_Int32)-1)
+#define OFFSET_NONE ((sal_Int32)0)
+
+// ============================================================================
+
+enum AccessibleTableChildIndex
+{
+ /** Child index of the column header bar (first row). Exists always. */
+ BBINDEX_COLUMNHEADERBAR = 0,
+ /** Child index of the row header bar ("handle column"). Exists always. */
+ BBINDEX_ROWHEADERBAR = 1,
+ /** Child index of the data table. */
+ BBINDEX_TABLE = 2,
+ /** Child index of the first additional control. */
+ BBINDEX_FIRSTCONTROL = 3
+};
+
+// ============================================================================
+
+#define XACC ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+
+/** This abstract class provides methods to implement an accessible table object.
+*/
+class IAccessibleTableProvider
+{
+public:
+ /** @return The count of the rows. */
+ virtual long GetRowCount() const = 0;
+ /** @return The count of the columns. */
+ virtual sal_uInt16 GetColumnCount() const = 0;
+
+ /** @return The position of the current row. */
+ virtual sal_Int32 GetCurrRow() const = 0;
+ /** @return The position of the current column. */
+ virtual sal_uInt16 GetCurrColumn() const = 0;
+
+ /** @return The description of a row.
+ @param _nRow The row which description is in demand. */
+ virtual ::rtl::OUString GetRowDescription( sal_Int32 _nRow ) const = 0;
+ /** @return The description of a column.
+ @param _nColumn The column which description is in demand. */
+ virtual ::rtl::OUString GetColumnDescription( sal_uInt16 _nColumnPos ) const = 0;
+
+ /** @return <TRUE/>, if the object has a row header. */
+ virtual sal_Bool HasRowHeader() const = 0; //GetColumnId
+ /** @return <TRUE/>, if the object can focus a cell. */
+ virtual sal_Bool IsCellFocusable() const = 0;
+ virtual sal_Bool GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) = 0;
+
+ virtual void SetNoSelection() = 0;
+ virtual void SelectAll() = 0;
+ virtual void SelectRow( long _nRow, BOOL _bSelect = TRUE, BOOL bExpand = TRUE ) = 0;
+ virtual void SelectColumn( sal_uInt16 _nColumnPos, sal_Bool _bSelect = sal_True ) = 0;
+ virtual sal_Int32 GetSelectedRowCount() const = 0;
+ virtual sal_Int32 GetSelectedColumnCount() const = 0;
+ /** @return <TRUE/>, if the row is selected. */
+ virtual bool IsRowSelected( long _nRow ) const = 0;
+ virtual sal_Bool IsColumnSelected( long _nColumnPos ) const = 0;
+ virtual void GetAllSelectedRows( ::com::sun::star::uno::Sequence< sal_Int32 >& _rRows ) const = 0;
+ virtual void GetAllSelectedColumns( ::com::sun::star::uno::Sequence< sal_Int32 >& _rColumns ) const = 0;
+
+ /** @return <TRUE/>, if the cell is visible. */
+ virtual sal_Bool IsCellVisible( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const = 0;
+ virtual String GetAccessibleCellText( long _nRow, USHORT _nColumnPos ) const = 0;
+
+ virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, BOOL _bOnScreen = TRUE ) = 0;
+ virtual Rectangle calcTableRect( BOOL _bOnScreen = TRUE ) = 0;
+ virtual Rectangle GetFieldRectPixelAbs( sal_Int32 _nRow, sal_uInt16 _nColumnPos, BOOL _bIsHeader, BOOL _bOnScreen = TRUE ) = 0;
+
+ virtual XACC CreateAccessibleCell( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) = 0;
+ virtual XACC CreateAccessibleRowHeader( sal_Int32 _nRow ) = 0;
+ virtual XACC CreateAccessibleColumnHeader( sal_uInt16 _nColumnPos ) = 0;
+
+ virtual sal_Int32 GetAccessibleControlCount() const = 0;
+ virtual XACC CreateAccessibleControl( sal_Int32 _nIndex ) = 0;
+ virtual sal_Bool ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint ) = 0;
+
+ virtual sal_Bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_uInt16& _rnColPos, const Point& _rPoint ) = 0;
+ virtual sal_Bool ConvertPointToRowHeader( sal_Int32& _rnRow, const Point& _rPoint ) = 0;
+ virtual sal_Bool ConvertPointToColumnHeader( sal_uInt16& _rnColPos, const Point& _rPoint ) = 0;
+
+ virtual ::rtl::OUString GetAccessibleObjectName( ::svt::AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos = -1 ) const = 0;
+ virtual ::rtl::OUString GetAccessibleObjectDescription( ::svt::AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos = -1 ) const = 0;
+
+ virtual void FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& _rStateSet, ::svt::AccessibleBrowseBoxObjType _eType ) const = 0;
+ virtual void FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const = 0;
+ virtual void GrabTableFocus() = 0;
+
+ // OutputDevice
+ virtual BOOL GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector ) = 0;
+
+ // Window
+ virtual Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) const = 0;
+ virtual void GrabFocus() = 0;
+ virtual XACC GetAccessible( BOOL bCreate = TRUE ) = 0;
+ virtual Window* GetAccessibleParentWindow() const = 0;
+ virtual Window* GetWindowInstance() = 0;
+
+ virtual Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex) = 0;
+ virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint) = 0;
+};
+
+// ----------------------------------------------------------------------------
+
+/** interface for an implementation of a table control's Accesible component
+*/
+class IAccessibleTabListBox
+{
+public:
+ /** returns the XAccessible object itself
+
+ The reference returned here can be used to control the life time of the
+ IAccessibleTableImplementation object.
+
+ The returned reference is guaranteed to not be <NULL/>.
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ getMyself() = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ SAL_CALL getAccessibleChild( sal_Int32 nChildIndex )
+ throw ( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ) = 0;
+
+ /** returns the accessible object for the row or the column header bar
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ getHeaderBar( ::svt::AccessibleBrowseBoxObjType _eObjType ) = 0;
+};
+
+/** interface for an implementation of a browse box's Accesible component
+*/
+class IAccessibleBrowseBox
+{
+public:
+ /** returns the XAccessible object itself
+
+ The reference returned here can be used to control the life time of the
+ IAccessibleTableImplementation object.
+
+ The returned reference is guaranteed to not be <NULL/>.
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ getMyself() = 0;
+
+ /** disposes the accessible implementation, so that it becomes defunc
+ */
+ virtual void dispose() = 0;
+
+ /** checks whether the accessible implementation, and its context, are still alive
+ @return <TRUE/>, if the object is not disposed or disposing.
+ */
+ virtual sal_Bool isAlive() const = 0;
+
+ /** returns the accessible object for the row or the column header bar
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ getHeaderBar( ::svt::AccessibleBrowseBoxObjType _eObjType ) = 0;
+
+ /** returns the accessible object for the table representation
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ getTable() = 0;
+
+ /** commits the event at all listeners of the column/row header bar
+ @param nEventId
+ the event id
+ @param rNewValue
+ the new value
+ @param rOldValue
+ the old value
+ */
+ virtual void commitHeaderBarEvent(
+ sal_Int16 nEventId,
+ const ::com::sun::star::uno::Any& rNewValue,
+ const ::com::sun::star::uno::Any& rOldValue,
+ sal_Bool _bColumnHeaderBar
+ ) = 0;
+
+ /** commits the event at all listeners of the table
+ @param nEventId
+ the event id
+ @param rNewValue
+ the new value
+ @param rOldValue
+ the old value
+ */
+ virtual void commitTableEvent(
+ sal_Int16 nEventId,
+ const ::com::sun::star::uno::Any& rNewValue,
+ const ::com::sun::star::uno::Any& rOldValue
+ ) = 0;
+
+ /** Commits an event to all listeners. */
+ virtual void commitEvent(
+ sal_Int16 nEventId,
+ const ::com::sun::star::uno::Any& rNewValue,
+ const ::com::sun::star::uno::Any& rOldValue
+ ) = 0;
+};
+
+// ----------------------------------------------------------------------------
+
+// ============================================================================
+
+} // namespace svt
+
+// ============================================================================
+
+#endif // _SVTOOLS_ACCESSIBLETABLEPROVIDER_HXX
+
diff --git a/svtools/inc/svtools/brwbox.hxx b/svtools/inc/svtools/brwbox.hxx
new file mode 100644
index 000000000000..42fb4b4d36ac
--- /dev/null
+++ b/svtools/inc/svtools/brwbox.hxx
@@ -0,0 +1,877 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+#ifndef _SVX_BRWBOX_HXX
+#define _SVX_BRWBOX_HXX
+
+#include "svtools/svtdllapi.h"
+#include <vcl/scrbar.hxx>
+#include <vcl/ctrl.hxx>
+#include <tools/multisel.hxx>
+#include <svtools/headbar.hxx>
+#include <svtools/transfer.hxx>
+#include <svtools/AccessibleBrowseBoxObjType.hxx>
+#include <svtools/accessibletableprovider.hxx>
+
+#ifndef INCLUDED_LIMITS_H
+#include <limits.h>
+#define INCLUDED_LIMITS_H
+#endif
+
+#ifndef INCLUDED_MEMORY
+#include <memory>
+#define INCLUDED_MEMORY
+#endif
+
+class BrowserColumn;
+class BrowserColumns;
+class BrowserDataWin;
+class MultiSelection;
+class BrowserHeader;
+
+namespace svt {
+ class BrowseBoxImpl;
+ class IAccessibleFactory;
+}
+namespace utl {
+ class AccessibleStateSetHelper;
+}
+
+// -------------------
+// - BrowseBox-Types -
+// -------------------
+
+#define BROWSER_INVALIDID USHRT_MAX
+#define BROWSER_ENDOFSELECTION (long)(SFX_ENDOFSELECTION)
+
+typedef ULONG BrowserMode;
+
+#define BROWSER_COLUMNSELECTION 0x0001
+#define BROWSER_MULTISELECTION 0x0002
+#define BROWSER_THUMBDRAGGING 0x0004
+#define BROWSER_KEEPHIGHLIGHT 0x0008
+#define BROWSER_KEEPSELECTION BROWSER_KEEPHIGHLIGHT // old, dont use!
+#define BROWSER_HLINES 0x0010
+#define BROWSER_VLINES 0x0020
+#define BROWSER_HLINESFULL BROWSER_HLINES // old, dont use!
+#define BROWSER_VLINESFULL BROWSER_VLINES // old, dont use!
+#define BROWSER_HLINESDOTS 0x0000 // old => dont use!
+#define BROWSER_VLINESDOTS 0x0000 // old => dont use!
+
+#define BROWSER_HIDESELECT 0x0100 // old => dont use!
+#define BROWSER_HIDECURSOR 0x0200
+
+#define BROWSER_NO_HSCROLL 0x0400
+#define BROWSER_NO_SCROLLBACK 0x0800
+
+#define BROWSER_AUTO_VSCROLL 0x1000
+#define BROWSER_AUTO_HSCROLL 0x2000
+
+#define BROWSER_TRACKING_TIPS 0x4000
+
+#define BROWSER_NO_VSCROLL 0x8000
+
+#define BROWSER_HIGHLIGHT_NONE 0x0100 // == BROWSER_HIDESELECT
+#define BROWSER_HIGHLIGHT_TOGGLE 0x00000000 // old default => NULL, dont use!
+
+#define BROWSER_HEADERBAR_NEW 0x00040000
+#define BROWSER_AUTOSIZE_LASTCOL 0x00080000
+#define BROWSER_OWN_DATACHANGED 0x00100000
+
+#define BROWSER_CURSOR_WO_FOCUS 0x00200000
+ // Allows a cursor which is shown even if the control does not have the focus. This does not affect other
+ // situations which require to temporarily hide the cursor (such as scrolling).
+
+#define BROWSER_SMART_HIDECURSOR 0x00400000
+ // is an enhanced version of BROWSER_HIDECURSOR.
+ // When set, BROWSER_HIDECURSOR is overruled, and the cursor is hidden as long as no selection exists,
+ // but shown otherwise. This does not affect other situations which require to temporarily hide the
+ // cursor (such as scrolling).
+
+typedef int BrowserColumnMode;
+#define BROWSER_COLUMN_TITLEABBREVATION 1
+#define BROWSER_COLUMN_STANDARD BROWSER_COLUMN_TITLEABBREVATION
+
+#define BROWSER_NONE 0
+#define BROWSER_SELECT 720
+#define BROWSER_EXPANDSELECTION 721
+#define BROWSER_ENHANCESELECTION 722
+#define BROWSER_SELECTALL 723
+#define BROWSER_SELECTDOWN 724
+#define BROWSER_SELECTUP 725
+#define BROWSER_CURSORDOWN 731
+#define BROWSER_CURSORUP 732
+#define BROWSER_CURSORLEFT 733
+#define BROWSER_CURSORRIGHT 734
+#define BROWSER_CURSORPAGEDOWN 735
+#define BROWSER_CURSORPAGEUP 736
+#define BROWSER_CURSORPAGERIGHT 735
+#define BROWSER_CURSORPAGELEFT 736
+#define BROWSER_CURSORENDOFFILE 741
+#define BROWSER_CURSORTOPOFFILE 742
+#define BROWSER_CURSORENDOFSCREEN 743
+#define BROWSER_CURSORTOPOFSCREEN 744
+#define BROWSER_CURSORHOME 745
+#define BROWSER_CURSOREND 746
+#define BROWSER_SCROLLDOWN 751
+#define BROWSER_SCROLLUP 752
+#define BROWSER_SELECTHOME 753
+#define BROWSER_SELECTEND 754
+#define BROWSER_SELECTCOLUMN 755
+#define BROWSER_MOVECOLUMNLEFT 756
+#define BROWSER_MOVECOLUMNRIGHT 757
+
+// ---------------
+// - BrowseEvent -
+// ---------------
+
+class BrowseEvent
+{
+ Window* pWin;
+ long nRow;
+ Rectangle aRect;
+ USHORT nCol;
+ USHORT nColId;
+
+public:
+ BrowseEvent();
+ BrowseEvent( Window* pWindow,
+ long nAbsRow,
+ USHORT nColumn, USHORT nColumnId,
+ const Rectangle& rRect );
+
+ Window* GetWindow() const { return pWin; }
+ long GetRow() const { return nRow; }
+ USHORT GetColumn() const { return nCol; }
+ USHORT GetColumnId() const { return nColId; }
+ const Rectangle& GetRect() const { return aRect; }
+};
+
+// ---------------------
+// - BrowserMouseEvent -
+// ---------------------
+
+class BrowserMouseEvent: public MouseEvent, public BrowseEvent
+{
+public:
+ BrowserMouseEvent();
+ BrowserMouseEvent( BrowserDataWin* pWin, const MouseEvent& rEvt );
+ BrowserMouseEvent( Window* pWin, const MouseEvent& rEvt,
+ long nAbsRow, USHORT nColumn, USHORT nColumnId,
+ const Rectangle& rRect );
+};
+
+// --------------------------
+// - BrowserAcceptDropEvent -
+// --------------------------
+
+class BrowserAcceptDropEvent : public AcceptDropEvent, public BrowseEvent
+{
+public:
+ BrowserAcceptDropEvent();
+ BrowserAcceptDropEvent( BrowserDataWin* pWin, const AcceptDropEvent& rEvt );
+};
+
+// ---------------------------
+// - BrowserExecuteDropEvent -
+// ---------------------------
+
+class BrowserExecuteDropEvent : public ExecuteDropEvent, public BrowseEvent
+{
+public:
+ BrowserExecuteDropEvent();
+ BrowserExecuteDropEvent( BrowserDataWin* pWin, const ExecuteDropEvent& rEvt );
+};
+
+// -------------
+// - BrowseBox -
+// -------------
+
+// TODO
+// The whole selection thingie in this class is somewhat .... suspicious to me.
+// some oddities:
+// * method parameters named like members (and used in both semantics within the method!)
+// * the multi selection flag is sometimes used as if it is for row selection, sometimes as if
+// it's for column selection, too (and sometimes in an even stranger way :)
+// * it is not really defined like all these hundreds selection related flags/methods work together
+// and influence each other. I do not understand it very well, but this may be my fault :)
+// * There is a GetColumnSelection, but it can't be used to determine the selected columns (at least
+// not without a const_cast)
+//
+// We should clearly define this somewhere in the future. Or, even better, we should re-implement this
+// whole class, which is planned for a long time :)
+//
+// sorry for the ranting. could not resist
+// 98483 - 11.04.2002 - fs@openoffice.org
+
+class SVT_DLLPUBLIC BrowseBox
+ :public Control
+ ,public DragSourceHelper
+ ,public DropTargetHelper
+ ,public svt::IAccessibleTableProvider
+{
+ #define NO_CURSOR_HIDE 0
+ #define HARD_CURSOR_HIDE 1
+ #define SMART_CURSOR_HIDE 2
+
+ friend class BrowserDataWin;
+ friend class ::svt::BrowseBoxImpl;
+
+#ifdef DBG_MI
+ friend void DoLog_Impl( const BrowseBox *pThis, const char *pWhat, const char *pWho );
+#endif
+
+#ifdef DBG_UTIL
+ friend const char* BrowseBoxCheckInvariants( const void * pVoid );
+#endif
+
+ Window* pDataWin; // window to display data rows
+ ScrollBar* pVScroll; // vertical scrollbar
+ ScrollBar aHScroll; // horizontal scrollbar
+
+ long nDataRowHeight; // height of a single data-row
+ USHORT nTitleLines; // number of lines in title row
+ ULONG nControlAreaWidth; // width of fixed area beneeth hscroll
+ BOOL bThumbDragging; // handle thumb dragging
+ BOOL bColumnCursor; // single columns and fields selectable
+ BOOL bMultiSelection;// allow multiple selected rows
+ BOOL bKeepHighlight; // don't hide selection on LoseFocus
+
+ BOOL bHLines; // draw lines between rows
+ BOOL bVLines; // draw lines between columns
+ BOOL bHDots; // draw lines between rows dotted
+ BOOL bVDots; // draw lines between columns dotted
+ Color aGridLineColor; // color for lines, default dark grey
+ BOOL bBootstrapped; // child windows resized etc.
+ long nTopRow; // no. of first visible row (0...)
+ long nCurRow; // no. of row with cursor
+ long nRowCount; // total number of rows in model
+ USHORT nFirstCol; // no. of first visible scrollable column
+ USHORT nCurColId; // column id of cursor
+
+ BOOL bSelecting;
+ BOOL bRowDividerDrag;
+ BOOL bHit;
+ BOOL mbInteractiveRowHeight;
+ Point a1stPoint;
+ Point a2ndPoint;
+
+ long nResizeX; // mouse position at start of resizing
+ long nMinResizeX; // never drag more left
+ long nDragX; // last dragged column (MouseMove)
+ USHORT nResizeCol; // resize this column in MouseMove
+ BOOL bResizing; // mouse captured for column resizing
+
+ BOOL bSelect; // select or deselect
+ BOOL bSelectionIsVisible; // depending on focus
+ BOOL bScrolling; // hidden cursor while scrolling
+ BOOL bNotToggleSel; // set while in ToggleSelection() etc.
+ BOOL bHasFocus; // set/unset in Get/LoseFocus
+ BOOL bHideSelect; // hide selection (highlight)
+ BOOL bHideCursor; // hide cursor (frame)
+ Range aSelRange; // for selection expansion
+
+ BrowserColumns* pCols; // array of column-descriptions
+ union
+ {
+ MultiSelection* pSel; // selected rows for multi-selection
+ long nSel; // selected row for single-selection
+ } uRow;
+ MultiSelection* pColSel; // selected column-ids
+
+ ::std::auto_ptr< ::svt::BrowseBoxImpl > m_pImpl; // impl structure of the BrowseBox object
+
+ BOOL m_bFocusOnlyCursor; // hide cursor if we don't have the focus
+ Color m_aCursorColor; // special color for cursor, COL_TRANSPARENT for usual (VCL-painted) "inverted" cursor
+ BrowserMode m_nCurrentMode; // last argument of SetMode (redundant, as our other members represent the current settings, too)
+
+private:
+//#if 0 // _SOLAR__PRIVATE
+ SVT_DLLPRIVATE void ConstructImpl(BrowserMode nMode);
+ SVT_DLLPRIVATE void ExpandRowSelection( const BrowserMouseEvent& rEvt );
+ SVT_DLLPRIVATE void ToggleSelection( BOOL bForce = FALSE );
+
+ SVT_DLLPRIVATE void UpdateScrollbars();
+ SVT_DLLPRIVATE void AutoSizeLastColumn();
+
+ SVT_DLLPRIVATE long ImpGetDataRowHeight() const;
+ SVT_DLLPRIVATE Rectangle ImplFieldRectPixel( long nRow, USHORT nColId ) const;
+ SVT_DLLPRIVATE USHORT FrozenColCount() const;
+
+ SVT_DLLPRIVATE void ColumnInserted( USHORT nPos );
+
+ DECL_DLLPRIVATE_LINK( ScrollHdl, ScrollBar * );
+ DECL_DLLPRIVATE_LINK( EndScrollHdl, ScrollBar * );
+ DECL_DLLPRIVATE_LINK( StartDragHdl, HeaderBar * );
+
+ SVT_DLLPRIVATE long GetFrozenWidth() const;
+//#endif
+
+ BOOL GoToRow(long nRow, BOOL bRowColMove, BOOL bDoNotModifySelection = FALSE );
+
+ BOOL GoToColumnId( USHORT nColId, BOOL bMakeVisible, BOOL bRowColMove = FALSE);
+ void SelectColumnPos( USHORT nCol, BOOL _bSelect, BOOL bMakeVisible);
+ void SelectColumnId( USHORT nColId, BOOL _bSelect, BOOL bMakeVisible)
+ { SelectColumnPos( GetColumnPos(nColId), _bSelect, bMakeVisible); }
+
+ void ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, BOOL _bForeignDevice, BOOL _bDrawSelections);
+
+ BOOL PaintCursorIfHiddenOnce() const { return !m_bFocusOnlyCursor && !HasFocus(); }
+
+ USHORT ToggleSelectedColumn();
+ void SetToggledSelectedColumn(USHORT _nSelectedColumnId);
+
+protected:
+ /// retrieves the XAccessible implementation associated with the BrowseBox instance
+ ::svt::IAccessibleFactory& getAccessibleFactory();
+
+protected:
+ USHORT ColCount() const;
+
+ // software plug for database access
+ // Der RowCount wird jetzt intern automatisch gezaehlt
+ // (ueber RowInserted und RowRemoved), daher ist das Ueberladen
+ // dieser Methode ueberfluessig!
+public:
+ virtual long GetRowCount() const;
+
+protected:
+ // fuer Anzeige im VScrollBar z.B. auf "?" oder setzen
+ void SetRealRowCount( const String &rRealRowCount );
+
+ // Return Value muss immer TRUE sein - SeekRow *muss* klappen!
+ // (sonst ASSERT) MI: wer hat das eingebaut? Das darf nicht so sein!
+
+ /** seeks for the given row position
+ @param nRow
+ nRow starts at 0
+ */
+ virtual BOOL SeekRow( long nRow ) = 0;
+ virtual void DrawCursor();
+ virtual void PaintRow( OutputDevice &rDev, const Rectangle &rRect );
+ virtual void PaintData( Window& rWin, const Rectangle& rRect );
+ virtual void PaintField( OutputDevice& rDev, const Rectangle& rRect,
+ USHORT nColumnId ) const = 0;
+ // Benachrichtigung an die abgeleitete Klasse, dass sich der sichtbare
+ // Bereich von Rows geaendert hat. Aus dieser Methode heraus darf
+ // die abgeleitete Klasse Aenderungen des Model mit Hilfe der Methoden
+ // RowInserted und RowRemoved bekanntgeben. Mit sich daraus ergebenden
+ // neuen Zustand wird anschliessend ein Paint veranlasst (und entsprechend
+ // SeekRow etc. gerufen).
+ //
+ // Parameter: nNewTopRow: Nr. der neuen TopRow (kann von VisibleRowsChanged
+ // durch Aufruf von RowInserted und RowDeleted noch veraendert werden).
+ // nNumRows: Anzahl der sichtbaren Rows (auch eine teilweise sichtbare Row
+ // wird mitgezaehlt).
+ //
+ // Moegliche Ursachen fuer die Aenderung des sichtbaren Bereiches:
+ // - Vor dem sichtbaren Bereich sind Rows eingefuegt oder geloescht worden,
+ // dadurch aendert sich nur die Numerierung der sichtbaren Rows
+ // - Scrollen (und daraus resultierend eine andere erste sichtbare Row)
+ // - Resize des Fensters
+ virtual void VisibleRowsChanged( long nNewTopRow, USHORT nNumRows);
+
+ // Anzahl sichtbarer Rows in dem Fenster (inkl. "angeschnittener" Rows)
+ USHORT GetVisibleRows()
+ { return (USHORT)((pDataWin->GetOutputSizePixel().Height() - 1 )/ GetDataRowHeight() + 1); }
+ long GetTopRow() { return nTopRow; }
+ USHORT GetFirstVisibleColNumber() const { return nFirstCol; }
+
+ // Focus-Rect ein-/ausschalten
+ void DoShowCursor( const char *pWhoLog );
+ void DoHideCursor( const char *pWhoLog );
+ short GetCursorHideCount() const;
+
+ virtual BrowserHeader* CreateHeaderBar( BrowseBox* pParent );
+
+ // HACK(virtuelles Create wird im Ctor nicht gerufen)
+ void SetHeaderBar( BrowserHeader* );
+
+ long CalcReverseZoom(long nVal);
+
+ HeaderBar* GetHeaderBar() const;
+ // header bar access for derived classes
+
+ inline const DataFlavorExVector&
+ GetDataFlavors() const;
+
+ sal_Bool IsDropFormatSupported( SotFormatStringId nFormat ); // need this because the base class' IsDropFormatSupported is not const ...
+ sal_Bool IsDropFormatSupported( SotFormatStringId nFormat ) const;
+
+ sal_Bool IsDropFormatSupported( const ::com::sun::star::datatransfer::DataFlavor& _rFlavor ); // need this because the base class' IsDropFormatSupported is not const ...
+ sal_Bool IsDropFormatSupported( const ::com::sun::star::datatransfer::DataFlavor& _rFlavor ) const;
+
+private:
+ void* implGetDataFlavors() const;
+ // with this we can make GetDataFlavors() inline, which is strongly needed as SVTOOLS does not export
+ // any sysbols containing an "_STL", so a non-inlined method would not be exported ....
+
+protected:
+ // callbacks for the data window
+ virtual void ImplStartTracking();
+ virtual void ImplTracking();
+ virtual void ImplEndTracking();
+
+public:
+ BrowseBox( Window* pParent, WinBits nBits = 0,
+ BrowserMode nMode = 0 );
+ BrowseBox( Window* pParent, const ResId& rId,
+ BrowserMode nMode = 0 );
+ ~BrowseBox();
+
+ // ererbte ueberladene Handler
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void MouseButtonDown( const MouseEvent& rEvt );
+ virtual void MouseMove( const MouseEvent& rEvt );
+ virtual void MouseButtonUp( const MouseEvent& rEvt );
+ virtual void KeyInput( const KeyEvent& rEvt );
+ virtual void LoseFocus();
+ virtual void GetFocus();
+ virtual void Resize();
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Command( const CommandEvent& rEvt );
+ virtual void StartDrag( sal_Int8 _nAction, const Point& _rPosPixel );
+
+ virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ); // will forward everything got to the second AcceptDrop method
+ virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ); // will forward everything got to the second ExecuteDrop method
+
+ virtual sal_Int8 AcceptDrop( const BrowserAcceptDropEvent& rEvt );
+ virtual sal_Int8 ExecuteDrop( const BrowserExecuteDropEvent& rEvt );
+
+ // neue Handler
+ virtual void MouseButtonDown( const BrowserMouseEvent& rEvt );
+ virtual void MouseMove( const BrowserMouseEvent& rEvt );
+ virtual void MouseButtonUp( const BrowserMouseEvent& rEvt );
+ virtual void StartScroll();
+ virtual void EndScroll();
+ virtual void Select();
+ virtual void DoubleClick( const BrowserMouseEvent& rEvt );
+ virtual BOOL IsCursorMoveAllowed( long nNewRow, USHORT nNewColId ) const;
+ virtual void CursorMoved();
+ virtual void ColumnMoved( USHORT nColId );
+ virtual void ColumnResized( USHORT nColId );
+ virtual long QueryColumnResize( USHORT nColId, long nWidth );
+ /// called when the row height has been changed interactively
+ virtual void RowHeightChanged();
+ virtual long QueryMinimumRowHeight();
+
+ // Window-Control (pass to DataWindow)
+ void SetUpdateMode( BOOL bUpdate );
+ BOOL GetUpdateMode() const;
+
+ // map-mode and font control
+ void SetFont( const Font& rNewFont );
+ const Font& GetFont() const { return pDataWin->GetFont(); }
+ void SetTitleFont( const Font& rNewFont )
+ { Control::SetFont( rNewFont ); }
+ const Font& GetTitleFont() const { return Control::GetFont(); }
+
+ // color for line painting
+ void SetGridLineColor(const Color& rColor) {aGridLineColor = rColor;}
+ const Color& GetGridLineColor() const {return aGridLineColor;}
+
+ // inserting, changing, removing and freezing of columns
+ void InsertHandleColumn( ULONG nWidth );
+ void InsertDataColumn( USHORT nItemId, const Image& rImage,
+ long nSize, HeaderBarItemBits nBits = HIB_STDSTYLE,
+ USHORT nPos = HEADERBAR_APPEND );
+ void InsertDataColumn( USHORT nItemId, const XubString& rText,
+ long nSize, HeaderBarItemBits nBits = HIB_STDSTYLE,
+ USHORT nPos = HEADERBAR_APPEND );
+ void InsertDataColumn( USHORT nItemId,
+ const Image& rImage, const XubString& rText,
+ long nSize, HeaderBarItemBits nBits = HIB_STDSTYLE,
+ USHORT nPos = HEADERBAR_APPEND,
+ // Hilfstext bei leerem rText
+ const String* pHelpText = 0 );
+ void SetColumnTitle( USHORT nColumnId, const String &rTitle );
+ void SetColumnMode( USHORT nColumnId, BrowserColumnMode nFlags );
+ void SetColumnWidth( USHORT nColumnId, ULONG nWidth );
+ void SetColumnPos( USHORT nColumnId, USHORT nPos );
+ void FreezeColumn( USHORT nColumnId, BOOL bFreeze = TRUE );
+ void UnfreezeColumns();
+ void RemoveColumn( USHORT nColumnId );
+ void RemoveColumns();
+
+ // control of title and data row height
+ void SetDataRowHeight( long nPixel );
+ long GetDataRowHeight() const;
+ void SetTitleLines( USHORT nLines );
+ USHORT GetTitleLines() const { return nTitleLines; }
+ virtual long GetTitleHeight() const;
+
+ // access to dynamic values of cursor row
+ String GetColumnTitle( USHORT nColumnId ) const;
+ BrowserColumnMode GetColumnMode( USHORT nColumnId ) const;
+ Rectangle GetFieldRect( USHORT nColumnId ) const;
+ ULONG GetColumnWidth( USHORT nColumnId ) const;
+ USHORT GetColumnId( USHORT nPos ) const;
+ USHORT GetColumnPos( USHORT nColumnId ) const;
+ BOOL IsFrozen( USHORT nColumnId ) const;
+
+ // movement of visible area
+ void ResetScroll();
+ long ScrollColumns( long nColumns );
+ long ScrollRows( long nRows );
+ long ScrollPages( long nPagesY );
+ BOOL MakeFieldVisible( long nRow, USHORT nColId, BOOL bComplete = FALSE );
+
+ // access and movement of cursor
+ long GetCurRow() const { return nCurRow; }
+ USHORT GetCurColumnId() const { return nCurColId; }
+ BOOL GoToRow( long nRow );
+ BOOL GoToRowAndDoNotModifySelection( long nRow );
+ BOOL GoToColumnId( USHORT nColId );
+ BOOL GoToRowColumnId( long nRow, USHORT nColId );
+
+ // selections
+ virtual void SetNoSelection();
+ virtual void SelectAll();
+ virtual void SelectRow( long nRow, BOOL _bSelect = TRUE, BOOL bExpand = TRUE );
+ void SelectColumnPos( USHORT nCol, BOOL _bSelect = TRUE )
+ { SelectColumnPos( nCol, _bSelect, TRUE); }
+ void SelectColumnId( USHORT nColId, BOOL _bSelect = TRUE )
+ { SelectColumnPos( GetColumnPos(nColId), _bSelect, TRUE); }
+ long GetSelectRowCount() const;
+ USHORT GetSelectColumnCount() const;
+ virtual bool IsRowSelected( long nRow ) const;
+ bool IsColumnSelected( USHORT nColumnId ) const;
+ sal_Bool IsAllSelected() const;
+ long FirstSelectedRow( BOOL bInverse = FALSE );
+ long LastSelectedRow();
+ long PrevSelectedRow();
+ long NextSelectedRow();
+ const MultiSelection* GetColumnSelection() const { return pColSel; }
+ const MultiSelection* GetSelection() const
+ { return bMultiSelection ? uRow.pSel : 0; }
+ void SetSelection( const MultiSelection &rSelection );
+
+ long FirstSelectedColumn( ) const;
+ long NextSelectedColumn( ) const;
+
+ BOOL IsResizing() const { return bResizing; }
+
+ // access to positions of fields, column and rows
+ Window& GetEventWindow() const;
+ Window& GetDataWindow() const { return *pDataWin; }
+ Rectangle GetRowRectPixel( long nRow,
+ BOOL bRelToBrowser = TRUE ) const;
+ Rectangle GetFieldRectPixel( long nRow, USHORT nColId,
+ BOOL bRelToBrowser = TRUE) const;
+ BOOL IsFieldVisible( long nRow, USHORT nColId,
+ BOOL bComplete = FALSE ) const;
+ long GetRowAtYPosPixel( long nY,
+ BOOL bRelToBrowser = TRUE ) const;
+ USHORT GetColumnAtXPosPixel( long nX,
+ BOOL bRelToBrowser = TRUE ) const;
+
+ // invalidations
+ void Clear();
+ void RowRemoved( long nRow, long nNumRows = 1, BOOL bDoPaint = TRUE );
+ void RowModified( long nRow, USHORT nColId = USHRT_MAX );
+ void RowInserted( long nRow, long nNumRows = 1, BOOL bDoPaint = TRUE, BOOL bKeepSelection = FALSE );
+
+ // miscellanous
+ void ReserveControlArea( USHORT nWidth = USHRT_MAX );
+ Rectangle GetControlArea() const;
+ BOOL ProcessKey( const KeyEvent& rEvt );
+ void Dispatch( USHORT nId );
+ void SetMode( BrowserMode nMode = 0 );
+ BrowserMode GetMode( ) const { return m_nCurrentMode; }
+ bool IsInCommandEvent() const;
+
+ void SetCursorColor(const Color& _rCol);
+ Color GetCursorColor() const { return m_aCursorColor; }
+ void ResetSelecting() { bSelecting = FALSE; }
+
+ /** specifies that the user is allowed to interactively change the height of a row,
+ by simply dragging an arbitrary row separator.
+
+ Note that this works only if there's a handle column, since only in this case,
+ there *is* something for the user to click onto
+ */
+ void EnableInteractiveRowHeight( BOOL _bEnable = TRUE ) { mbInteractiveRowHeight = _bEnable; }
+ BOOL IsInteractiveRowHeightEnabled( ) const { return mbInteractiveRowHeight; }
+
+ /// access to selected methods, to be granted to the BrowserColumn
+ struct BrowserColumnAccess { friend class BrowserColumn; private: BrowserColumnAccess() { } };
+ /** public version of PaintField, with selected access rights for the BrowserColumn
+ */
+ void DoPaintField( OutputDevice& rDev, const Rectangle& rRect, USHORT nColumnId, BrowserColumnAccess ) const
+ { PaintField( rDev, rRect, nColumnId ); }
+
+ /** suggests a default width for a column containing a given text
+
+ The width is calculated so that the text fits completely, plus som margin.
+ */
+ ULONG GetDefaultColumnWidth( const String& _rText ) const;
+
+ /** GetCellText returns the text at the given position
+ @param _nRow
+ the number of the row
+ @param _nColId
+ the ID of the column
+ @return
+ the text out of the cell
+ */
+ virtual String GetCellText(long _nRow, USHORT _nColId) const;
+
+ /** @return
+ the current column count
+ */
+ USHORT GetColumnCount() const { return ColCount(); }
+
+ /** commitBrowseBoxEvent commit the event at all listeners of the browsebox
+ @param nEventId
+ the event id
+ @param rNewValue
+ the new value
+ @param rOldValue
+ the old value
+ */
+ void commitBrowseBoxEvent(sal_Int16 nEventId,
+ const ::com::sun::star::uno::Any& rNewValue,
+ const ::com::sun::star::uno::Any& rOldValue);
+
+ /** commitTableEvent commit the event at all listeners of the table
+ @param nEventId
+ the event id
+ @param rNewValue
+ the new value
+ @param rOldValue
+ the old value
+ */
+ void commitTableEvent(sal_Int16 nEventId,
+ const ::com::sun::star::uno::Any& rNewValue,
+ const ::com::sun::star::uno::Any& rOldValue);
+
+ /** fires an AccessibleEvent relative to a header bar AccessibleContext
+
+ @param nEventId
+ the event id
+ @param rNewValue
+ the new value
+ @param rOldValue
+ the old value
+ */
+ void commitHeaderBarEvent(sal_Int16 nEventId,
+ const ::com::sun::star::uno::Any& rNewValue,
+ const ::com::sun::star::uno::Any& rOldValue,
+ sal_Bool _bColumnHeaderBar
+ );
+
+ /** returns the Rectangle for either the column header bar ot the row header bar
+ @param _bIsColumnBar
+ <TRUE/> when column header bar is used
+ @param _bOnScreen
+ <TRUE/> when the rectangle should be calculated OnScreen
+ @return
+ the Rectangle
+ */
+ virtual Rectangle calcHeaderRect(sal_Bool _bIsColumnBar,BOOL _bOnScreen = TRUE);
+
+ /** calculates the Rectangle of the table
+ @param _bOnScreen
+ <TRUE/> when the rectangle should be calculated OnScreen
+ @return
+ the Rectangle
+ */
+ virtual Rectangle calcTableRect(BOOL _bOnScreen = TRUE);
+
+ /**
+ @param _nRowId
+ the current row
+ @param _nColId
+ teh column id
+ @param _bOnScreen
+ <TRUE/> when the rectangle should be calculated OnScreen
+ @return
+ the Rectangle
+ */
+ virtual Rectangle GetFieldRectPixelAbs(sal_Int32 _nRowId,sal_uInt16 _nColId, BOOL _bIsHeader, BOOL _bOnScreen = TRUE);
+
+ /// return <TRUE/> if and only if the accessible object for this instance has been created and is alive
+ sal_Bool isAccessibleAlive( ) const;
+
+ // ACCESSIBILITY ==========================================================
+public:
+ /** Creates and returns the accessible object of the whole BrowseBox. */
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible > CreateAccessible();
+
+ // Children ---------------------------------------------------------------
+
+ /** Creates the accessible object of a data table cell.
+ @param nRow The row index of the cell.
+ @param nColumnId The column pos of the cell.
+ @return The XAccessible interface of the specified cell. */
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible >
+ CreateAccessibleCell( sal_Int32 nRow, sal_uInt16 nColumnPos );
+
+ /** Creates the accessible object of a row header.
+ @param nRow The row index of the header.
+ @return The XAccessible interface of the specified row header. */
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible >
+ CreateAccessibleRowHeader( sal_Int32 nRow );
+
+ /** Creates the accessible object of a column header.
+ @param nColumnId The column ID of the header.
+ @return The XAccessible interface of the specified column header. */
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible >
+ CreateAccessibleColumnHeader( sal_uInt16 nColumnPos );
+
+ /** @return The count of additional controls of the control area. */
+ virtual sal_Int32 GetAccessibleControlCount() const;
+
+ /** Creates the accessible object of an additional control.
+ @param nIndex The 0-based index of the control.
+ @return The XAccessible interface of the specified control. */
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible >
+ CreateAccessibleControl( sal_Int32 nIndex );
+
+ // Conversions ------------------------------------------------------------
+
+ /** Converts a point relative to the data window origin to a cell address.
+ @param rnRow Out-paramater that takes the row index.
+ @param rnColumnId Out-paramater that takes the column ID.
+ @param rPoint The position in pixels relative to the data window.
+ @return <TRUE/>, if the point could be converted to a valid address. */
+ virtual sal_Bool ConvertPointToCellAddress(
+ sal_Int32& rnRow, sal_uInt16& rnColumnId, const Point& rPoint );
+
+ /** Converts a point relative to the row header bar origin to a row header
+ index.
+ @param rnRow Out-paramater that takes the row index.
+ @param rPoint The position in pixels relative to the header bar.
+ @return <TRUE/>, if the point could be converted to a valid index. */
+ virtual sal_Bool ConvertPointToRowHeader( sal_Int32& rnRow, const Point& rPoint );
+
+ /** Converts a point relative to the column header bar origin to a column
+ header index.
+ @param rnColumnId Out-paramater that takes the column ID.
+ @param rPoint The position in pixels relative to the header bar.
+ @return <TRUE/>, if the point could be converted to a valid index. */
+ virtual sal_Bool ConvertPointToColumnHeader( sal_uInt16& rnColumnPos, const Point& rPoint );
+
+ /** Converts a point relative to the BrowseBox origin to the index of an
+ existing control.
+ @param rnRow Out-paramater that takes the 0-based control index.
+ @param rPoint The position in pixels relative to the BrowseBox.
+ @return <TRUE/>, if the point could be converted to a valid index. */
+ virtual sal_Bool ConvertPointToControlIndex( sal_Int32& rnIndex, const Point& rPoint );
+
+ // Object data and state --------------------------------------------------
+
+ /** return the name of the specified object.
+ @param eObjType
+ The type to ask for
+ @param _nPosition
+ The position of a tablecell (index position), header bar colum/row cell
+ @return
+ The name of the specified object.
+ */
+ virtual ::rtl::OUString GetAccessibleObjectName( ::svt::AccessibleBrowseBoxObjType eObjType,sal_Int32 _nPosition = -1) const;
+
+ /** return the description of the specified object.
+ @param eObjType
+ The type to ask for
+ @param _nPosition
+ The position of a tablecell (index position), header bar colum/row cell
+ @return
+ The description of the specified object.
+ */
+ virtual ::rtl::OUString GetAccessibleObjectDescription( ::svt::AccessibleBrowseBoxObjType eObjType,sal_Int32 _nPosition = -1) const;
+
+ /** @return The header text of the specified row. */
+ virtual ::rtl::OUString GetRowDescription( sal_Int32 nRow ) const;
+
+ /** @return The header text of the specified column. */
+ virtual ::rtl::OUString GetColumnDescription( sal_uInt16 _nColumn ) const;
+
+ /** Fills the StateSet with all states (except DEFUNC and SHOWING, done by
+ the accessible object), depending on the specified object type. */
+ virtual void FillAccessibleStateSet(
+ ::utl::AccessibleStateSetHelper& rStateSet,
+ ::svt::AccessibleBrowseBoxObjType eObjType ) const;
+
+ /** Fills the StateSet with all states for one cell (except DEFUNC and SHOWING, done by
+ the accessible object). */
+ virtual void FillAccessibleStateSetForCell(
+ ::utl::AccessibleStateSetHelper& _rStateSet,
+ sal_Int32 _nRow, sal_uInt16 _nColumn ) const;
+
+ /** Sets focus to current cell of the data table. */
+ virtual void GrabTableFocus();
+
+ // IAccessibleTableProvider
+ virtual sal_Int32 GetCurrRow() const;
+ virtual sal_uInt16 GetCurrColumn() const;
+ virtual sal_Bool HasRowHeader() const;
+ virtual sal_Bool IsCellFocusable() const;
+ virtual BOOL GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn );
+ virtual void SelectColumn( sal_uInt16 _nColumn, sal_Bool _bSelect = sal_True );
+ virtual sal_Bool IsColumnSelected( long _nColumn ) const;
+ virtual sal_Int32 GetSelectedRowCount() const;
+ virtual sal_Int32 GetSelectedColumnCount() const;
+ virtual void GetAllSelectedRows( ::com::sun::star::uno::Sequence< sal_Int32 >& _rRows ) const;
+ virtual void GetAllSelectedColumns( ::com::sun::star::uno::Sequence< sal_Int32 >& _rColumns ) const;
+ virtual sal_Bool IsCellVisible( sal_Int32 _nRow, sal_uInt16 _nColumn ) const;
+ virtual String GetAccessibleCellText(long _nRow, USHORT _nColPos) const;
+ virtual BOOL GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector );
+ virtual Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) const;
+ virtual void GrabFocus();
+ virtual XACC GetAccessible( BOOL bCreate = TRUE );
+ virtual Window* GetAccessibleParentWindow() const;
+ virtual Window* GetWindowInstance();
+
+private:
+ // the following declares some Window/OutputDevice methods private. This happened in the course
+ // of CWS warnings01, which pointed out nameclashs in those methods. If the build breaks in some
+ // upper module, you should investigate whether you really wanted to call base class methods,
+ // or the versions at this class. In the latter case, use the renamed versions above.
+
+ // Set/GetLineColor - superseded by Set/GetGridLineColor
+ using OutputDevice::SetLineColor;
+ using OutputDevice::GetLineColor;
+
+ // ToTop/ToBottom were never property implemented. If you currently call it, this is most probably wrong
+ // and not doing as intended
+ using Window::ToTop;
+};
+
+//-------------------------------------------------------------------
+inline const DataFlavorExVector& BrowseBox::GetDataFlavors() const
+{
+ return *reinterpret_cast<DataFlavorExVector*>(implGetDataFlavors());
+}
+
+#endif
+
diff --git a/svtools/inc/svtools/brwhead.hxx b/svtools/inc/svtools/brwhead.hxx
new file mode 100644
index 000000000000..3ed431a09efe
--- /dev/null
+++ b/svtools/inc/svtools/brwhead.hxx
@@ -0,0 +1,53 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _BRWHEAD_HXX
+#define _BRWHEAD_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/headbar.hxx>
+
+class BrowseBox;
+
+//===================================================================
+
+class SVT_DLLPUBLIC BrowserHeader: public HeaderBar
+{
+ BrowseBox* _pBrowseBox;
+
+protected:
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void Select();
+ virtual void EndDrag();
+
+public:
+ BrowserHeader( BrowseBox* pParent, WinBits nWinBits = WB_STDHEADERBAR | WB_DRAG );
+
+};
+
+#endif
+
diff --git a/svtools/inc/svtools/chartprettypainter.hxx b/svtools/inc/svtools/chartprettypainter.hxx
new file mode 100644
index 000000000000..200951d5c5e8
--- /dev/null
+++ b/svtools/inc/svtools/chartprettypainter.hxx
@@ -0,0 +1,71 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef CHARTPRETTYPAINTER_HXX
+#define CHARTPRETTYPAINTER_HXX
+
+#ifndef INCLUDED_SVTDLLAPI_H
+#include "svtools/svtdllapi.h"
+#endif
+
+//#include <svtools/embedhlp.hxx>
+#include <vcl/outdev.hxx>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+
+// predeclarations
+namespace svt { class EmbeddedObjectRef; }
+
+/** use this class for a correct view representation of charts
+see issues #i82893#, #i75867#: charts must be painted resolution dependent!!
+
+example usage when painting ole objects:
+if( ChartPrettyPainter::IsChart(xObjRef) && ChartPrettyPainter::ShouldPrettyPaintChartOnThisDevice( pOutDev )
+ && ChartPrettyPainter::DoPrettyPaintChart( get/loadChartModel(), pOutDev, rLogicObjectRect ) )
+ return;
+else
+ use any other painting method for charts or paint other ole objects
+
+this way of usage ensures that ole objects are only loaded if necessary
+*/
+
+class SVT_DLLPUBLIC ChartPrettyPainter
+{
+public:
+ static bool IsChart( const svt::EmbeddedObjectRef& xObjRef );
+ static bool ShouldPrettyPaintChartOnThisDevice( OutputDevice* pOutDev );
+ static bool DoPrettyPaintChart( ::com::sun::star::uno::Reference<
+ ::com::sun::star::frame::XModel > xChartModel,
+ OutputDevice* pOutDev, const Rectangle& rLogicObjectRect );
+
+ ChartPrettyPainter();
+ virtual ~ChartPrettyPainter();
+ virtual bool DoPaint( OutputDevice* pOutDev, const Rectangle& rLogicObjectRect ) const;
+ static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
+};
+
+#endif
diff --git a/svtools/inc/svtools/colctrl.hxx b/svtools/inc/svtools/colctrl.hxx
new file mode 100644
index 000000000000..d76f8e881269
--- /dev/null
+++ b/svtools/inc/svtools/colctrl.hxx
@@ -0,0 +1,202 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _SV_COLCTRL_HXX
+#define _SV_COLCTRL_HXX
+
+#include <tools/color.hxx>
+#include <vcl/ctrl.hxx>
+#include <svtools/valueset.hxx>
+
+// ----------------
+// - ColorControl -
+// ----------------
+
+class Bitmap;
+class BitmapReadAccess;
+class ColorHSB;
+
+class SvColorControl : public Control
+{
+private:
+ Bitmap* mpBitmap;
+ BitmapReadAccess* mpReadAccess;
+ Color maColor;
+ short mnLuminance;
+ Point maPosition;
+ Link maModifyHdl;
+
+ void Initialize();
+ void CreateBitmap();
+ void ShowPosition( const Point& aPos );
+
+public:
+ SvColorControl( Window* pParent, WinBits nStyle = 0 );
+ SvColorControl( Window* pParent, const ResId& rResId );
+ ~SvColorControl();
+
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+// virtual void KeyInput( const KeyEvent& rKEvent );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Resize();
+// virtual void GetFocus();
+// virtual void LoseFocus();
+
+ virtual void Modify();
+
+ Color GetColor() const { return maColor; };
+ void SetColor( const Color& rCol );
+ void SetColor( const ColorHSB& rCol, BOOL bSetColor = TRUE );
+
+ short GetLuminance() const { return mnLuminance; };
+ void SetLuminance( short nLum );
+
+ void SetModifyHdl( const Link& rLink ) { maModifyHdl = rLink; }
+ const Link& GetModifyHdl() const { return maModifyHdl; }
+
+};
+
+// -----------------------
+// - ColorPreviewControl -
+// -----------------------
+
+class ColorPreviewControl : public Control
+{
+private:
+ Color maColor;
+
+public:
+ ColorPreviewControl( Window* pParent, WinBits nStyle = 0 );
+ ColorPreviewControl( Window* pParent, const ResId& rResId );
+ ~ColorPreviewControl();
+
+ virtual void Paint( const Rectangle& rRect );
+
+ Color GetColor() const { return maColor; };
+ void SetColor( const Color& rCol );
+};
+
+// -----------------------
+// - ColorMixingControl -
+// -----------------------
+
+enum CMCPosition { CMC_TOPLEFT, CMC_TOPRIGHT, CMC_BOTTOMLEFT, CMC_BOTTOMRIGHT, CMC_OTHER };
+
+class ColorMixingControl : public ValueSet
+{
+private:
+ USHORT mnRows;
+ USHORT mnColumns;
+ Color maColor[4];
+
+ void Initialize();
+
+ Color CalcDifferenceColor( USHORT nCol1, USHORT nCol2, USHORT nSteps );
+ void FillRow( USHORT nRow );
+ void FillColumn( USHORT nColumn );
+
+public:
+ ColorMixingControl( Window* pParent, WinBits nStyle = 0,
+ USHORT nRows = 4, USHORT nColumns = 4 );
+ ColorMixingControl( Window* pParent, const ResId& rResId,
+ USHORT nRows = 4, USHORT nColumns = 4 );
+ ~ColorMixingControl();
+
+ USHORT GetRows() const { return mnRows; };
+ void SetRows( USHORT nRows );
+ USHORT GetColumns() const { return mnColumns; };
+ void SetColumns( USHORT nColumns );
+
+ using ValueSet::GetColor;
+ Color GetColor( CMCPosition ePos ) const { return maColor[ ePos ]; };
+ using ValueSet::SetColor;
+ void SetColor( CMCPosition ePos, const Color& rCol );
+
+ String GetRGBString( const Color& rColor );
+ CMCPosition GetCMCPosition() const;
+};
+
+// ------------
+// - ColorHSB -
+// ------------
+
+class ColorHSB
+{
+private:
+ USHORT mnHue; // Farbwinkel, 360 Grad
+ USHORT mnSat; // Saturation, 100 %
+ USHORT mnBri; // Brightness, 100 %
+
+public:
+ ColorHSB()
+ { mnHue=0; mnSat=0; mnBri=0; }
+ ColorHSB( USHORT nH, USHORT nS, USHORT nB )
+ { mnHue=nH; mnSat=nS; mnBri=nB; }
+ ColorHSB( const Color& rColor );
+
+ void SetHue( USHORT nH ) { mnHue=nH; }
+ void SetSat( USHORT nS ) { mnSat=nS; }
+ void SetBri( USHORT nB ) { mnBri=nB; }
+ USHORT GetHue() const { return mnHue; }
+ USHORT GetSat() const { return mnSat; }
+ USHORT GetBri() const { return mnBri; }
+ Color GetRGB() const;
+};
+
+// -------------
+// - ColorCMYK -
+// -------------
+
+class ColorCMYK
+{
+private:
+ USHORT mnCyan;
+ USHORT mnMagenta;
+ USHORT mnYellow;
+ USHORT mnKey;
+
+public:
+ ColorCMYK()
+ { mnCyan=0; mnMagenta=0; mnYellow=0; mnKey=100; }
+ ColorCMYK( USHORT nC, USHORT nM, USHORT nY, USHORT nK )
+ { mnCyan=nC; mnMagenta=nM; mnYellow=nY; mnKey=nK; }
+ ColorCMYK( const Color& rColor );
+
+ void SetCyan( USHORT nC ) { mnCyan=nC; }
+ void SetMagenta( USHORT nM ) { mnMagenta=nM; }
+ void SetYellow( USHORT nY ) { mnYellow=nY; }
+ void SetKey( USHORT nK ) { mnKey=nK; }
+ USHORT GetCyan() const { return mnCyan; }
+ USHORT GetMagenta() const { return mnMagenta; }
+ USHORT GetYellow() const { return mnYellow; }
+ USHORT GetKey() const { return mnKey; }
+ Color GetRGB() const;
+};
+
+#endif // _SV_COLCTRL_HXX
diff --git a/svtools/inc/svtools/colorcfg.hxx b/svtools/inc/svtools/colorcfg.hxx
new file mode 100644
index 000000000000..ac78afe59034
--- /dev/null
+++ b/svtools/inc/svtools/colorcfg.hxx
@@ -0,0 +1,152 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_SVTOOLS_COLORCFG_HXX
+#define INCLUDED_SVTOOLS_COLORCFG_HXX
+
+#include "svtools/svtdllapi.h"
+#include <rtl/ustring.hxx>
+#include <tools/color.hxx>
+#include <com/sun/star/uno/Sequence.h>
+#include <svl/brdcst.hxx>
+#include <svl/lstner.hxx>
+#include <unotools/options.hxx>
+
+//-----------------------------------------------------------------------------
+namespace svtools{
+enum ColorConfigEntry
+{
+ DOCCOLOR ,
+ DOCBOUNDARIES ,
+ APPBACKGROUND ,
+ OBJECTBOUNDARIES ,
+ TABLEBOUNDARIES ,
+ FONTCOLOR ,
+ LINKS ,
+ LINKSVISITED ,
+ ANCHOR ,
+ SPELL ,
+ SMARTTAGS ,
+ WRITERTEXTGRID ,
+ WRITERFIELDSHADINGS ,
+ WRITERIDXSHADINGS ,
+ WRITERDIRECTCURSOR ,
+ WRITERSCRIPTINDICATOR,
+ WRITERSECTIONBOUNDARIES,
+ WRITERPAGEBREAKS,
+ HTMLSGML ,
+ HTMLCOMMENT ,
+ HTMLKEYWORD ,
+ HTMLUNKNOWN ,
+ CALCGRID ,
+ CALCPAGEBREAK ,
+ CALCPAGEBREAKMANUAL,
+ CALCPAGEBREAKAUTOMATIC,
+ CALCDETECTIVE ,
+ CALCDETECTIVEERROR ,
+ CALCREFERENCE ,
+ CALCNOTESBACKGROUND ,
+ DRAWGRID ,
+ DRAWDRAWING ,
+ DRAWFILL ,
+ BASICIDENTIFIER,
+ BASICCOMMENT ,
+ BASICNUMBER ,
+ BASICSTRING ,
+ BASICOPERATOR ,
+ BASICKEYWORD ,
+ BASICERROR ,
+ SQLIDENTIFIER,
+ SQLNUMBER,
+ SQLSTRING,
+ SQLOPERATOR,
+ SQLKEYWORD,
+ SQLPARAMETER,
+ SQLCOMMENT,
+ ColorConfigEntryCount
+};
+/* -----------------------------22.03.2002 15:36------------------------------
+
+ ---------------------------------------------------------------------------*/
+class ColorConfig_Impl;
+struct ColorConfigValue
+{
+
+ sal_Bool bIsVisible; //validity depends on the element type
+ sal_Int32 nColor;
+ ColorConfigValue() : bIsVisible(sal_False), nColor(0) {}
+ sal_Bool operator !=(const ColorConfigValue& rCmp) const
+ { return nColor != rCmp.nColor || bIsVisible != rCmp.bIsVisible;}
+};
+/* -----------------------------22.03.2002 15:36------------------------------
+
+ ---------------------------------------------------------------------------*/
+class SVT_DLLPUBLIC ColorConfig:
+ public utl::detail::Options
+{
+ friend class ColorConfig_Impl;
+private:
+ static ColorConfig_Impl* m_pImpl;
+public:
+ ColorConfig();
+ virtual ~ColorConfig();
+
+ // get the configured value - if bSmart is set the default color setting is provided
+ // instead of the automatic color
+ ColorConfigValue GetColorValue(ColorConfigEntry eEntry, sal_Bool bSmart = sal_True)const;
+ static Color GetDefaultColor(ColorConfigEntry eEntry);
+};
+/* -----------------------------22.03.2002 15:31------------------------------
+
+ ---------------------------------------------------------------------------*/
+class SVT_DLLPUBLIC EditableColorConfig
+{
+ ColorConfig_Impl* m_pImpl;
+ sal_Bool m_bModified;
+public:
+ EditableColorConfig();
+ ~EditableColorConfig();
+
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > GetSchemeNames() const;
+ void DeleteScheme(const ::rtl::OUString& rScheme );
+ void AddScheme(const ::rtl::OUString& rScheme );
+ sal_Bool LoadScheme(const ::rtl::OUString& rScheme );
+ const ::rtl::OUString& GetCurrentSchemeName()const;
+ void SetCurrentSchemeName(const ::rtl::OUString& rScheme);
+
+ const ColorConfigValue& GetColorValue(ColorConfigEntry eEntry)const;
+ void SetColorValue(ColorConfigEntry eEntry, const ColorConfigValue& rValue);
+ void SetModified();
+ void ClearModified(){m_bModified = sal_False;}
+ sal_Bool IsModified()const{return m_bModified;}
+ void Commit();
+
+ void DisableBroadcast();
+ void EnableBroadcast();
+};
+}//namespace svtools
+#endif
+
diff --git a/svtools/inc/svtools/colrdlg.hxx b/svtools/inc/svtools/colrdlg.hxx
new file mode 100644
index 000000000000..00ec9647aa7a
--- /dev/null
+++ b/svtools/inc/svtools/colrdlg.hxx
@@ -0,0 +1,107 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _SV_COLRDLG_HXX
+#define _SV_COLRDLG_HXX
+
+#include "svtools/svtdllapi.h"
+#include <vcl/dialog.hxx>
+#ifndef _SV_BUTTON_HXX //autogen
+#include <vcl/button.hxx>
+#endif
+#include <vcl/fixed.hxx>
+#include <vcl/field.hxx>
+#include <svtools/colctrl.hxx>
+
+// ---------------
+// - ColorDialog -
+// ---------------
+
+class SVT_DLLPUBLIC SvColorDialog : public ModalDialog
+{
+private:
+ ColorMixingControl maColMixCtrl;
+ PushButton maBtn1;
+ PushButton maBtn2;
+ //PushButton maBtn3;
+ //PushButton maBtn4;
+ //FixedText maFtRGB;
+ SvColorControl maCtlColor;
+
+ // CMYK controls.
+ FixedText maFtCyan;
+ MetricField maNumCyan;
+ FixedText maFtMagenta;
+ MetricField maNumMagenta;
+ FixedText maFtYellow;
+ MetricField maNumYellow;
+ FixedText maFtKey;
+ MetricField maNumKey;
+
+ // RGB controls.
+ FixedText maFtRed;
+ NumericField maNumRed;
+ FixedText maFtGreen;
+ NumericField maNumGreen;
+ FixedText maFtBlue;
+ NumericField maNumBlue;
+
+ // HSL controls.
+ FixedText maFtHue;
+ NumericField maNumHue;
+ FixedText maFtSaturation;
+ NumericField maNumSaturation;
+ FixedText maFtLuminance;
+ NumericField maNumLuminance;
+
+ ColorPreviewControl maCtlPreview;
+ ColorPreviewControl maCtlPreviewOld;
+
+ OKButton maBtnOK;
+ CancelButton maBtnCancel;
+ HelpButton maBtnHelp;
+
+ Color maColor;
+
+ SVT_DLLPRIVATE void Initialize();
+
+ DECL_DLLPRIVATE_LINK( ColorModifyHdl, void * );
+ DECL_DLLPRIVATE_LINK( ClickBtnHdl, void * );
+ DECL_DLLPRIVATE_LINK( ClickMixCtrlHdl, void * );
+ DECL_DLLPRIVATE_LINK( SelectMixCtrlHdl, void * );
+
+public:
+ SvColorDialog( Window* pParent );
+ ~SvColorDialog();
+
+ void SetColor( const Color& rColor );
+ const Color& GetColor() const;
+
+ virtual short Execute();
+};
+
+#endif // _SV_COLRDLG_HXX
diff --git a/svtools/inc/svtools/editbrowsebox.hxx b/svtools/inc/svtools/editbrowsebox.hxx
new file mode 100644
index 000000000000..f97449e1880c
--- /dev/null
+++ b/svtools/inc/svtools/editbrowsebox.hxx
@@ -0,0 +1,696 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _SVTOOLS_EDITBROWSEBOX_HXX_
+#define _SVTOOLS_EDITBROWSEBOX_HXX_
+#define SVTOOLS_IN_EDITBROWSEBOX_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/ref.hxx>
+#include <tools/rtti.hxx>
+#include <vcl/window.hxx>
+#include <vcl/combobox.hxx>
+#include <vcl/lstbox.hxx>
+
+#ifndef _IMAGEBTN_HXX
+#include <vcl/imagebtn.hxx>
+#endif
+#include <svtools/brwbox.hxx>
+#include <vcl/timer.hxx>
+#include <svtools/brwhead.hxx>
+#include <svtools/svmedit.hxx>
+#include <vcl/svapp.hxx>
+
+//==================================================================
+// EditBrowseBoxFlags (EBBF)
+
+#define EBBF_NONE ((sal_Int32)0x0000)
+/** if this bit is _not_ set, the handle column will be invalidated upon
+ changing the row in the browse box. This is for forcing the row picture to
+ be repainted. If you do not have row pictures or text, you don't need this
+ invalidation, then you would specify this bit to prevent flicker
+*/
+#define EBBF_NO_HANDLE_COLUMN_CONTENT ((sal_Int32)0x0001)
+/** set this bit to activate the cell on a MouseButtonDown, not a MouseButtonUp event
+ */
+#define EBBF_ACTIVATE_ON_BUTTONDOWN ((sal_Int32)0x0002)
+/** if this bit is set and EBBF_NO_HANDLE_COLUMN_CONTENT is _not_ set, the handle
+ column is drawn with the text contained in column 0 instead of an image
+*/
+#define EBBF_HANDLE_COLUMN_TEXT ((sal_Int32)0x0004)
+
+/** If this bit is set, tab traveling is somewhat modified<br/>
+ If the control gets the focus because the user pressed the TAB key, then the
+ first or last cell (depending on whether the traveling was cycling forward or backward)
+ gets activated.
+ @see Window::GetGetFocusFlags
+ @see GETFOCUS_*
+*/
+#define EBBF_SMART_TAB_TRAVEL ((sal_Int32)0x0008)
+
+/// @deprecated
+#define EBBF_NOROWPICTURE EBBF_NO_HANDLE_COLUMN_CONTENT
+
+//==================================================================
+
+class Edit;
+class ListBoxFrame;
+class ButtonCtrl;
+class SpinField;
+class FormattedField;
+
+// .......................................................................
+namespace svt
+{
+// .......................................................................
+
+ class CellControllerRef;
+
+ //==================================================================
+ //= CellController
+ //==================================================================
+ class SVT_DLLPUBLIC CellController : public SvRefBase
+ {
+ friend class EditBrowseBox;
+
+ protected:
+ Control* pWindow;
+ sal_Bool bSuspended; // <TRUE> if the window is hidden and disabled
+
+ public:
+ TYPEINFO();
+
+ CellController(Control* pW);
+ virtual ~CellController();
+
+ Control& GetWindow() const { return *const_cast< CellController* >( this )->pWindow; }
+
+ virtual void SetModified();
+ virtual void ClearModified() = 0;
+ virtual sal_Bool IsModified() const = 0;
+
+ // commit any current changes. Especially, do any reformatting you need (from input formatting
+ // to output formatting) here
+ // 95826 - 2002-10-14 - fs@openoffice.org
+ virtual void CommitModifications();
+
+ // suspending the controller is not culmulative!
+ void suspend( );
+ void resume( );
+ inline sal_Bool isSuspended( ) const { return bSuspended; }
+
+ protected:
+ virtual sal_Bool MoveAllowed(const KeyEvent& rEvt) const;
+ virtual void SetModifyHdl(const Link& rLink) = 0;
+ virtual sal_Bool WantMouseEvent() const;
+ };
+
+ SV_DECL_IMPL_REF(CellController);
+
+ //==================================================================
+ //= IEditImplementation
+ //==================================================================
+ class IEditImplementation
+ {
+ public:
+ virtual Control& GetControl() = 0;
+
+ virtual String GetText( LineEnd aSeparator ) const = 0;
+ virtual void SetText( const String& _rStr ) = 0;
+
+ virtual BOOL IsReadOnly() const = 0;
+ virtual void SetReadOnly( BOOL bReadOnly ) = 0;
+
+ virtual xub_StrLen GetMaxTextLen() const = 0;
+ virtual void SetMaxTextLen( xub_StrLen _nMaxLen ) = 0;
+
+ virtual Selection GetSelection() const = 0;
+ virtual void SetSelection( const Selection& _rSelection ) = 0;
+
+ virtual void ReplaceSelected( const String& _rStr ) = 0;
+ virtual void DeleteSelected() = 0;
+ virtual String GetSelected( LineEnd aSeparator ) const = 0;
+
+ virtual void SetModified() = 0;
+ virtual sal_Bool IsModified() const = 0;
+ virtual void ClearModified() = 0;
+ virtual void SetModifyHdl( const Link& _rLink ) = 0;
+ };
+
+ //==================================================================
+ //= GenericEditImplementation
+ //==================================================================
+ template <class EDIT>
+ class GenericEditImplementation : public IEditImplementation
+ {
+ EDIT& m_rEdit;
+ public:
+ GenericEditImplementation( EDIT& _rEdit );
+
+ EDIT& GetEditWindow() { return static_cast< EDIT& >( GetControl() ); }
+
+ virtual Control& GetControl();
+
+ virtual String GetText( LineEnd aSeparator ) const;
+ virtual void SetText( const String& _rStr );
+
+ virtual BOOL IsReadOnly() const;
+ virtual void SetReadOnly( BOOL bReadOnly );
+
+ virtual xub_StrLen GetMaxTextLen() const;
+ virtual void SetMaxTextLen( xub_StrLen _nMaxLen );
+
+ virtual Selection GetSelection() const;
+ virtual void SetSelection( const Selection& _rSelection );
+
+ virtual void ReplaceSelected( const String& _rStr );
+ virtual void DeleteSelected();
+ virtual String GetSelected( LineEnd aSeparator ) const;
+
+ virtual void SetModified();
+ virtual sal_Bool IsModified() const;
+ virtual void ClearModified();
+ virtual void SetModifyHdl( const Link& _rLink );
+ };
+
+ #include <svtools/editimplementation.hxx>
+
+ //==================================================================
+ //= MultiLineTextCell
+ //==================================================================
+ /** a multi line edit which can be used in a cell of a EditBrowseBox
+ */
+ class SVT_DLLPUBLIC MultiLineTextCell : public MultiLineEdit
+ {
+ public:
+ MultiLineTextCell( Window* _pParent, WinBits _nStyle )
+ :MultiLineEdit( _pParent, _nStyle )
+ {
+ }
+
+ protected:
+ // Window overridables
+ virtual long PreNotify( NotifyEvent& rNEvt );
+
+ // MultiLineEdit overridables
+ virtual void Modify();
+
+ private:
+ BOOL dispatchKeyEvent( const KeyEvent& _rEvent );
+ };
+
+ //==================================================================
+ //= concrete edit implementations
+ //==================================================================
+ typedef GenericEditImplementation< Edit > EditImplementation;
+
+ typedef GenericEditImplementation< MultiLineTextCell > MultiLineEditImplementation_Base;
+ class SVT_DLLPUBLIC MultiLineEditImplementation : public MultiLineEditImplementation_Base
+ {
+ public:
+ MultiLineEditImplementation( MultiLineTextCell& _rEdit ) : MultiLineEditImplementation_Base( _rEdit )
+ {
+ }
+
+ virtual String GetText( LineEnd aSeparator ) const;
+ virtual String GetSelected( LineEnd aSeparator ) const;
+ };
+
+ //==================================================================
+ //= EditCellController
+ //==================================================================
+ class SVT_DLLPUBLIC EditCellController : public CellController
+ {
+ IEditImplementation* m_pEditImplementation;
+ BOOL m_bOwnImplementation; // did we create m_pEditImplementation?
+
+ public:
+ TYPEINFO();
+ EditCellController( Edit* _pEdit );
+ EditCellController( MultiLineTextCell* _pEdit );
+ EditCellController( IEditImplementation* _pImplementation );
+ ~EditCellController( );
+
+ const IEditImplementation* GetEditImplementation( ) const { return m_pEditImplementation; }
+ IEditImplementation* GetEditImplementation( ) { return m_pEditImplementation; }
+
+ virtual void SetModified();
+ virtual sal_Bool IsModified() const;
+ virtual void ClearModified();
+
+ protected:
+ virtual sal_Bool MoveAllowed(const KeyEvent& rEvt) const;
+ virtual void SetModifyHdl(const Link& rLink);
+ };
+
+ //==================================================================
+ //= SpinCellController
+ //==================================================================
+ class SVT_DLLPUBLIC SpinCellController : public CellController
+ {
+ public:
+ TYPEINFO();
+ SpinCellController(SpinField* pSpinField);
+ SpinField& GetSpinWindow() const {return (SpinField &)GetWindow();}
+
+ virtual void SetModified();
+ virtual sal_Bool IsModified() const;
+ virtual void ClearModified();
+
+ protected:
+ virtual sal_Bool MoveAllowed(const KeyEvent& rEvt) const;
+ virtual void SetModifyHdl(const Link& rLink);
+ };
+
+ //==================================================================
+ //= CheckBoxControl
+ //==================================================================
+ class SVT_DLLPUBLIC CheckBoxControl : public Control
+ {
+ CheckBox* pBox;
+ Rectangle aFocusRect;
+ Link m_aClickLink,m_aModifyLink;
+
+ public:
+ CheckBoxControl(Window* pParent, WinBits nWinStyle = 0);
+ ~CheckBoxControl();
+
+ virtual void GetFocus();
+ virtual long PreNotify(NotifyEvent& rEvt);
+ virtual void Paint(const Rectangle& rClientRect);
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& _rEvent );
+ virtual void Resize();
+
+ void SetClickHdl(const Link& rHdl) {m_aClickLink = rHdl;}
+ const Link& GetClickHdl() const {return m_aClickLink;}
+
+ void SetModifyHdl(const Link& rHdl) {m_aModifyLink = rHdl;}
+ const Link& GetModifyHdl() const {return m_aModifyLink;}
+
+ CheckBox& GetBox() {return *pBox;};
+
+ private:
+ DECL_LINK( OnClick, void* );
+ };
+
+ //==================================================================
+ //= CheckBoxCellController
+ //==================================================================
+ class SVT_DLLPUBLIC CheckBoxCellController : public CellController
+ {
+ public:
+ TYPEINFO();
+
+ CheckBoxCellController(CheckBoxControl* pWin):CellController(pWin){}
+ CheckBox& GetCheckBox() const;
+
+ virtual sal_Bool IsModified() const;
+ virtual void ClearModified();
+
+ protected:
+ virtual void SetModifyHdl(const Link& rLink);
+ virtual sal_Bool WantMouseEvent() const;
+ };
+
+ //==================================================================
+ //= ComboBoxControl
+ //==================================================================
+ class SVT_DLLPUBLIC ComboBoxControl : public ComboBox
+ {
+ friend class ComboBoxCellController;
+
+ public:
+ ComboBoxControl(Window* pParent, WinBits nWinStyle = 0);
+
+ protected:
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ };
+
+ //==================================================================
+ //= ComboBoxCellController
+ //==================================================================
+ class SVT_DLLPUBLIC ComboBoxCellController : public CellController
+ {
+ public:
+ TYPEINFO();
+
+ ComboBoxCellController(ComboBoxControl* pParent);
+ ComboBoxControl& GetComboBox() const {return (ComboBoxControl &)GetWindow();}
+
+ virtual sal_Bool IsModified() const;
+ virtual void ClearModified();
+
+ protected:
+ virtual sal_Bool MoveAllowed(const KeyEvent& rEvt) const;
+ virtual void SetModifyHdl(const Link& rLink);
+ };
+
+ //==================================================================
+ //= ListBoxControl
+ //==================================================================
+ class SVT_DLLPUBLIC ListBoxControl : public ListBox
+ {
+ friend class ListBoxCellController;
+
+ public:
+ ListBoxControl(Window* pParent, WinBits nWinStyle = 0);
+
+ protected:
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ };
+
+ //==================================================================
+ //= ListBoxCellController
+ //==================================================================
+ class SVT_DLLPUBLIC ListBoxCellController : public CellController
+ {
+ public:
+ TYPEINFO();
+
+ ListBoxCellController(ListBoxControl* pParent);
+ ListBoxControl& GetListBox() const {return (ListBoxControl &)GetWindow();}
+
+ virtual sal_Bool IsModified() const;
+ virtual void ClearModified();
+
+ protected:
+ virtual sal_Bool MoveAllowed(const KeyEvent& rEvt) const;
+ virtual void SetModifyHdl(const Link& rLink);
+ };
+
+ //==================================================================
+ //= FormattedFieldCellController
+ //==================================================================
+ class SVT_DLLPUBLIC FormattedFieldCellController : public EditCellController
+ {
+ public:
+ TYPEINFO();
+ FormattedFieldCellController( FormattedField* _pFormatted );
+
+ virtual void CommitModifications();
+ };
+
+ //==================================================================
+ //= EditBrowserHeader
+ //==================================================================
+ class SVT_DLLPUBLIC EditBrowserHeader : public BrowserHeader
+ {
+ public:
+ EditBrowserHeader( BrowseBox* pParent, WinBits nWinBits = WB_BUTTONSTYLE )
+ :BrowserHeader(pParent, nWinBits){}
+
+ protected:
+ virtual void DoubleClick();
+ };
+
+ //==================================================================
+ //= EditBrowseBox
+ //==================================================================
+ class EditBrowseBoxImpl;
+ class SVT_DLLPUBLIC EditBrowseBox: public BrowseBox
+ {
+ friend class EditBrowserHeader;
+
+ enum BrowseInfo
+ {
+ COLSELECT = 1,
+ ROWSELECT = 2,
+ ROWCHANGE = 4,
+ COLCHANGE = 8
+ };
+
+ public:
+ enum RowStatus
+ {
+ CLEAN = 0,
+ CURRENT = 1,
+ CURRENTNEW = 2,
+ MODIFIED = 3,
+ NEW = 4,
+ DELETED = 5,
+ PRIMARYKEY = 6,
+ CURRENT_PRIMARYKEY = 7,
+ FILTER = 8,
+ HEADERFOOTER = 9
+ };
+
+ private:
+ // forbid these ones
+ EditBrowseBox(EditBrowseBox&);
+ EditBrowseBox& operator=(EditBrowseBox&);
+
+ class BrowserMouseEventPtr
+ {
+ BrowserMouseEvent* pEvent;
+ sal_Bool bDown;
+
+ public:
+ BrowserMouseEventPtr():pEvent(NULL){}
+ ~BrowserMouseEventPtr(){Clear();}
+
+ sal_Bool Is() const {return pEvent != NULL;}
+ sal_Bool IsDown() const {return bDown;}
+ const BrowserMouseEvent* operator->() const {return pEvent;}
+ const BrowserMouseEvent& operator*() const {return *pEvent;}
+
+ SVT_DLLPUBLIC void Clear();
+ void Set(const BrowserMouseEvent* pEvt, sal_Bool bIsDown);
+ } aMouseEvent;
+
+ const BrowserMouseEvent* pMouseEvent; // is set during a mouse event
+ CellControllerRef aController,
+ aOldController;
+
+ ULONG nStartEvent, nEndEvent, nCellModifiedEvent; // event ids
+ Window* m_pFocusWhileRequest;
+ // In ActivateCell, we grab the focus asynchronously, but if between requesting activation
+ // and the asynchornous event the focus has changed, we won't grab it for ourself.
+
+ long nPaintRow; // row beeing painted
+ long nEditRow, nOldEditRow;
+ sal_uInt16 nEditCol, nOldEditCol;
+
+ sal_Bool bHasFocus : 1;
+ mutable sal_Bool bPaintStatus : 1; // paint a status (image) in the handle column
+ sal_Bool bActiveBeforeTracking;
+
+ CheckBoxControl* pCheckBoxPaint;
+
+ sal_Int32 m_nBrowserFlags;
+ ImageList m_aStatusImages;
+ ::std::auto_ptr< EditBrowseBoxImpl> m_aImpl;
+
+ protected:
+ BrowserHeader* pHeader;
+
+ sal_Bool isGetCellFocusPending() const { return nStartEvent != 0; }
+ void cancelGetCellFocus() { if (nStartEvent) Application::RemoveUserEvent(nStartEvent); nStartEvent = 0; }
+ void forceGetCellFocus() { cancelGetCellFocus(); LINK(this, EditBrowseBox, StartEditHdl).Call((void*)NULL); }
+
+ BrowserMouseEventPtr& getMouseEvent() { return aMouseEvent; }
+
+ protected:
+ BrowserHeader* GetHeaderBar() const {return pHeader;}
+
+ virtual BrowserHeader* CreateHeaderBar(BrowseBox* pParent);
+
+ // if you want to have an own header ...
+ virtual BrowserHeader* imp_CreateHeaderBar(BrowseBox* pParent);
+
+ virtual void ColumnMoved(sal_uInt16 nId);
+ virtual void ColumnResized(sal_uInt16 nColId);
+ virtual void Resize();
+ virtual void ArrangeControls(sal_uInt16& nX, sal_uInt16 nY);
+ virtual sal_Bool SeekRow(long nRow);
+
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual void KeyInput(const KeyEvent& rEvt);
+ virtual void MouseButtonDown(const BrowserMouseEvent& rEvt);
+ virtual void MouseButtonUp(const BrowserMouseEvent& rEvt);
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ using BrowseBox::MouseButtonUp;
+ using BrowseBox::MouseButtonDown;
+
+ virtual long PreNotify(NotifyEvent& rNEvt );
+ virtual long Notify(NotifyEvent& rNEvt);
+
+ virtual void EndScroll();
+
+ // should be used instead of GetFieldRectPixel, 'cause this method here takes into account the borders
+ Rectangle GetCellRect(long nRow, sal_uInt16 nColId, sal_Bool bRelToBrowser = sal_True) const;
+ virtual sal_uInt32 GetTotalCellWidth(long nRow, sal_uInt16 nColId);
+ virtual sal_uInt32 GetAutoColumnWidth(sal_uInt16 nColId);
+
+ virtual void PaintStatusCell(OutputDevice& rDev, const Rectangle& rRect) const;
+ virtual void PaintCell(OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColId) const = 0;
+
+ virtual RowStatus GetRowStatus(long nRow) const;
+
+ virtual void RowHeightChanged();
+
+ // callbacks for the data window
+ virtual void ImplStartTracking();
+ virtual void ImplTracking();
+ virtual void ImplEndTracking();
+
+ // when changing a row:
+ // CursorMoving: cursor is beeing moved, but GetCurRow() still provides the old row
+ virtual sal_Bool CursorMoving(long nNewRow, sal_uInt16 nNewCol);
+
+ // cursor has been moved
+ virtual void CursorMoved();
+
+ virtual void CellModified(); // called whenever a cell has been modified
+ virtual sal_Bool SaveModified(); // called whenever a cell should be left, and it's content should be saved
+ // return sal_False prevents leaving the cell
+ virtual sal_Bool SaveRow(); // commit the current row
+
+ virtual sal_Bool IsModified() const {return aController.Is() && aController->IsModified();}
+
+ virtual CellController* GetController(long nRow, sal_uInt16 nCol);
+ virtual void InitController(CellControllerRef& rController, long nRow, sal_uInt16 nCol);
+ virtual void ResizeController(CellControllerRef& rController, const Rectangle&);
+ virtual void ReleaseController(CellControllerRef& pController, long nRow, sal_uInt16 nCol);
+ virtual void DoubleClick(const BrowserMouseEvent&);
+
+ void ActivateCell() { ActivateCell(GetCurRow(), GetCurColumnId()); }
+
+ // retrieve the image for the row status
+ virtual Image GetImage(RowStatus) const;
+
+ // inserting columns
+ // if you don't set a width, this will be calculated automatically
+ // if the id isn't set the smallest unused will do it ...
+ virtual sal_uInt16 AppendColumn(const String& rName, sal_uInt16 nWidth = 0, sal_uInt16 nPos = HEADERBAR_APPEND, sal_uInt16 nId = (sal_uInt16)-1);
+
+ // called whenever (Shift)Tab or Enter is pressed. If true is returned, these keys
+ // result in traveling to the next or to th previous cell
+ virtual sal_Bool IsTabAllowed(sal_Bool bForward) const;
+
+ virtual sal_Bool IsCursorMoveAllowed(long nNewRow, sal_uInt16 nNewColId) const;
+
+ void PaintTristate(OutputDevice& rDev, const Rectangle& rRect,const TriState& eState,sal_Bool _bEnabled=sal_True) const;
+
+ void AsynchGetFocus();
+ // secure starting of StartEditHdl
+
+ public:
+ EditBrowseBox(Window* pParent, sal_Int32 nBrowserFlags = EBBF_NONE, WinBits nBits = WB_TABSTOP, BrowserMode nMode = 0 );
+ EditBrowseBox(Window* pParent, const ResId& rId, sal_Int32 nBrowserFlags = EBBF_NONE, BrowserMode nMode = 0 );
+ ~EditBrowseBox();
+
+ sal_Bool IsEditing() const {return aController.Is();}
+ void InvalidateStatusCell(long nRow) {RowModified(nRow, 0);}
+ void InvalidateHandleColumn();
+
+ // late construction
+ virtual void Init();
+ virtual void RemoveRows();
+ virtual void Dispatch(sal_uInt16 nId);
+
+ CellControllerRef Controller() const { return aController; }
+ sal_Int32 GetBrowserFlags() const { return m_nBrowserFlags; }
+ void SetBrowserFlags(sal_Int32 nFlags);
+
+ virtual void ActivateCell(long nRow, sal_uInt16 nCol, sal_Bool bSetCellFocus = sal_True);
+ virtual void DeactivateCell(sal_Bool bUpdate = sal_True);
+ // Children ---------------------------------------------------------------
+
+ /** Creates the accessible object of a data table cell.
+ @param nRow
+ The row index of the cell.
+ @param nColumnId
+ The column ID of the cell.
+ @return
+ The XAccessible interface of the specified cell. */
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible >
+ CreateAccessibleCell( sal_Int32 nRow, sal_uInt16 nColumnPos );
+
+ /** @return The count of additional controls of the control area. */
+ virtual sal_Int32 GetAccessibleControlCount() const;
+
+ /** Creates the accessible object of an additional control.
+ @param nIndex
+ The 0-based index of the control.
+ @return
+ The XAccessible interface of the specified control. */
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible >
+ CreateAccessibleControl( sal_Int32 nIndex );
+
+ /** Creates the accessible object of a column header.
+ @param nColumnId
+ The column ID of the header.
+ @return
+ The XAccessible interface of the specified column header. */
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible >
+ CreateAccessibleRowHeader( sal_Int32 _nRow );
+
+ /** Sets focus to current cell of the data table. */
+ virtual void GrabTableFocus();
+
+ virtual Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex);
+ virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint);
+
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible > CreateAccessibleCheckBoxCell(long _nRow, USHORT _nColumnPos,const TriState& eState,sal_Bool _bEnabled=sal_True);
+ protected:
+ // creates the accessible which wraps the active cell
+ void implCreateActiveAccessible( );
+
+ private:
+ virtual void PaintField(OutputDevice& rDev, const Rectangle& rRect,
+ sal_uInt16 nColumnId ) const;
+ using Control::ImplInitSettings;
+ SVT_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SVT_DLLPRIVATE void DetermineFocus( const sal_uInt16 _nGetFocusFlags = 0);
+ inline void HideAndDisable(CellControllerRef& rController);
+ inline void EnableAndShow() const;
+
+ SVT_DLLPRIVATE void implActivateCellOnMouseEvent(const BrowserMouseEvent& _rEvt, sal_Bool _bUp);
+ SVT_DLLPRIVATE void impl_construct();
+
+ DECL_DLLPRIVATE_LINK(ModifyHdl, void* );
+ DECL_DLLPRIVATE_LINK(StartEditHdl, void* );
+ DECL_DLLPRIVATE_LINK(EndEditHdl, void* );
+ DECL_DLLPRIVATE_LINK(CellModifiedHdl, void* );
+ };
+
+// .......................................................................
+} // namespace svt
+// .......................................................................
+
+#undef SVTOOLS_IN_EDITBROWSEBOX_HXX
+#endif // _SVTOOLS_EDITBROWSEBOX_HXX_
+
diff --git a/svtools/inc/svtools/editimplementation.hxx b/svtools/inc/svtools/editimplementation.hxx
new file mode 100644
index 000000000000..987d94c7bcee
--- /dev/null
+++ b/svtools/inc/svtools/editimplementation.hxx
@@ -0,0 +1,151 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef SVTOOLS_IN_EDITBROWSEBOX_HXX
+#error "not to be included directly!"
+#endif
+
+//----------------------------------------------------------------------
+template <class EDIT>
+GenericEditImplementation< EDIT >::GenericEditImplementation( EDIT& _rEdit )
+ :m_rEdit( _rEdit )
+{
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+Control& GenericEditImplementation< EDIT >::GetControl()
+{
+ return m_rEdit;
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+String GenericEditImplementation< EDIT >::GetText( LineEnd ) const
+{
+ // ignore the line end - this base implementation does not support it
+ return m_rEdit.GetText( );
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+void GenericEditImplementation< EDIT >::SetText( const String& _rStr )
+{
+ m_rEdit.SetText( _rStr );
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+Selection GenericEditImplementation< EDIT >::GetSelection() const
+{
+ return m_rEdit.GetSelection( );
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+void GenericEditImplementation< EDIT >::SetSelection( const Selection& _rSelection )
+{
+ m_rEdit.SetSelection( _rSelection );
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+void GenericEditImplementation< EDIT >::SetReadOnly( BOOL bReadOnly )
+{
+ m_rEdit.SetReadOnly( bReadOnly );
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+BOOL GenericEditImplementation< EDIT >::IsReadOnly() const
+{
+ return m_rEdit.IsReadOnly();
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+void GenericEditImplementation< EDIT >::ReplaceSelected( const String& _rStr )
+{
+ m_rEdit.ReplaceSelected( _rStr );
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+void GenericEditImplementation< EDIT >::DeleteSelected()
+{
+ m_rEdit.DeleteSelected();
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+String GenericEditImplementation< EDIT >::GetSelected( LineEnd ) const
+{
+ return m_rEdit.GetSelected( );
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+void GenericEditImplementation< EDIT >::SetMaxTextLen( xub_StrLen _nMaxLen )
+{
+ m_rEdit.SetMaxTextLen( _nMaxLen );
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+xub_StrLen GenericEditImplementation< EDIT >::GetMaxTextLen() const
+{
+ return (xub_StrLen)m_rEdit.GetMaxTextLen( );
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+void GenericEditImplementation< EDIT >::SetModified()
+{
+ m_rEdit.SetModifyFlag();
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+sal_Bool GenericEditImplementation< EDIT >::IsModified() const
+{
+ return m_rEdit.IsModified();
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+void GenericEditImplementation< EDIT >::ClearModified()
+{
+ m_rEdit.ClearModifyFlag();
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+void GenericEditImplementation< EDIT >::SetModifyHdl( const Link& _rLink )
+{
+ m_rEdit.SetModifyHdl( _rLink );
+}
+
diff --git a/svtools/inc/svtools/editsyntaxhighlighter.hxx b/svtools/inc/svtools/editsyntaxhighlighter.hxx
new file mode 100644
index 000000000000..01add0c4ce1d
--- /dev/null
+++ b/svtools/inc/svtools/editsyntaxhighlighter.hxx
@@ -0,0 +1,64 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _EDITSYNTAXHIGHLIGHTER_HXX
+#define _EDITSYNTAXHIGHLIGHTER_HXX
+
+#include <svtools/svmedit.hxx>
+#include <svtools/syntaxhighlight.hxx>
+#include <svtools/svtdllapi.h>
+#include <svtools/colorcfg.hxx>
+
+class SVT_DLLPUBLIC MultiLineEditSyntaxHighlight : public MultiLineEdit
+{
+ private:
+ bool mbDoBracketHilight;
+ SyntaxHighlighter aHighlighter;
+ svtools::ColorConfig m_aColorConfig;
+
+ private:
+ virtual void DoBracketHilight(USHORT aKey);
+
+ protected:
+ virtual long PreNotify( NotifyEvent& rNEvt );
+
+ public:
+ MultiLineEditSyntaxHighlight( Window* pParent, WinBits nWinStyle = WB_LEFT | WB_BORDER , HighlighterLanguage aLanguage = HIGHLIGHT_SQL);
+ MultiLineEditSyntaxHighlight( Window* pParent, const ResId& rResId , HighlighterLanguage aLanguage = HIGHLIGHT_SQL);
+ ~MultiLineEditSyntaxHighlight();
+
+ void EnableBracketHilight(bool aHilight = true);
+ bool IsBracketHilight();
+ virtual void UpdateData();
+ virtual void SetText(const String& rNewText);
+ virtual void SetText( const XubString& rStr, const Selection& rNewSelection )
+ { SetText( rStr ); SetSelection( rNewSelection ); }
+
+ Color GetColorValue(TokenTypes aToken);
+};
+
+#endif
diff --git a/svtools/inc/svtools/ehdl.hxx b/svtools/inc/svtools/ehdl.hxx
new file mode 100644
index 000000000000..967c41636ea3
--- /dev/null
+++ b/svtools/inc/svtools/ehdl.hxx
@@ -0,0 +1,88 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _EHDL_HXX
+#define _EHDL_HXX
+
+#ifndef __RSC
+
+#include "svtools/svtdllapi.h"
+
+#ifndef _EINF_HXX
+#include <tools/errinf.hxx>
+#endif
+
+class Window;
+class ResMgr;
+
+class SVT_DLLPUBLIC SfxErrorContext : private ErrorContext
+{
+public:
+ SfxErrorContext(
+ USHORT nCtxIdP, Window *pWin=0,
+ USHORT nResIdP=USHRT_MAX, ResMgr *pMgrP=0);
+ SfxErrorContext(
+ USHORT nCtxIdP, const String &aArg1, Window *pWin=0,
+ USHORT nResIdP=USHRT_MAX, ResMgr *pMgrP=0);
+ virtual BOOL GetString(ULONG nErrId, String &rStr);
+
+private:
+ USHORT nCtxId;
+ USHORT nResId;
+ ResMgr *pMgr;
+ String aArg1;
+};
+
+class SVT_DLLPUBLIC SfxErrorHandler : private ErrorHandler
+{
+public:
+ SfxErrorHandler(USHORT nId, ULONG lStart, ULONG lEnd, ResMgr *pMgr=0);
+ ~SfxErrorHandler();
+
+protected:
+ virtual BOOL GetErrorString(ULONG lErrId, String &, USHORT&) const;
+ virtual BOOL GetMessageString(ULONG lErrId, String &, USHORT&) const;
+
+private:
+
+ ULONG lStart;
+ ULONG lEnd;
+ USHORT nId;
+ ResMgr *pMgr;
+ ResMgr *pFreeMgr;
+
+//#if 0 // _SOLAR__PRIVATE
+ SVT_DLLPRIVATE BOOL GetClassString(ULONG lErrId, String &) const;
+//#endif
+ virtual BOOL CreateString(
+ const ErrorInfo *, String &, USHORT &) const;
+};
+
+#endif
+
+#endif
+
diff --git a/svtools/inc/svtools/embedhlp.hxx b/svtools/inc/svtools/embedhlp.hxx
new file mode 100644
index 000000000000..098b565385ec
--- /dev/null
+++ b/svtools/inc/svtools/embedhlp.hxx
@@ -0,0 +1,142 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _SVTOOLS_EMBEDHLP_HXX
+#define _SVTOOLS_EMBEDHLP_HXX
+
+#include "svtools/svtdllapi.h"
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
+#include <com/sun/star/embed/Aspects.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <vcl/graph.hxx>
+#ifndef _SV_MAPUNIT_HXX
+#include <vcl/mapunit.hxx>
+#endif
+#include <rtl/ustring.hxx>
+
+#define NS_UNO ::com::sun::star::uno
+#define NS_EMBED ::com::sun::star::embed
+#define NS_IO ::com::sun::star::io
+
+namespace comphelper
+{
+ class EmbeddedObjectContainer;
+}
+
+class Rectangle;
+class OutputDevice;
+class String;
+namespace svt
+{
+ struct EmbeddedObjectRef_Impl;
+ class SVT_DLLPUBLIC EmbeddedObjectRef
+ {
+ EmbeddedObjectRef_Impl* mpImp;
+ NS_UNO::Reference < NS_EMBED::XEmbeddedObject > mxObj;
+
+ SVT_DLLPRIVATE SvStream* GetGraphicStream( BOOL bUpdate ) const;
+ /* SVT_DLLPRIVATE */ void GetReplacement( BOOL bUpdate );
+ SVT_DLLPRIVATE void Construct_Impl();
+
+ EmbeddedObjectRef& operator = ( const EmbeddedObjectRef& );
+
+ public:
+ const NS_UNO::Reference < NS_EMBED::XEmbeddedObject >& operator ->() const { return mxObj; }
+ const NS_UNO::Reference < NS_EMBED::XEmbeddedObject >& GetObject() const { return mxObj; }
+
+ static void DrawPaintReplacement( const Rectangle &rRect, const String &rText, OutputDevice *pOut );
+ static void DrawShading( const Rectangle &rRect, OutputDevice *pOut );
+ static BOOL TryRunningState( const NS_UNO::Reference < NS_EMBED::XEmbeddedObject >& );
+ static void SetGraphicToContainer( const Graphic& rGraphic,
+ comphelper::EmbeddedObjectContainer& aContainer,
+ const ::rtl::OUString& aName,
+ const ::rtl::OUString& aMediaType );
+
+ static sal_Bool ObjectIsModified( const NS_UNO::Reference < NS_EMBED::XEmbeddedObject >& )
+ throw( NS_UNO::Exception );
+ static NS_UNO::Reference< NS_IO::XInputStream > GetGraphicReplacementStream(
+ sal_Int64 nViewAspect,
+ const NS_UNO::Reference < NS_EMBED::XEmbeddedObject >&,
+ ::rtl::OUString* pMediaType )
+ throw();
+
+ // default constructed object; needs further assignment before it can be used
+ EmbeddedObjectRef();
+
+ // assign a previously default constructed object
+ void Assign( const NS_UNO::Reference < NS_EMBED::XEmbeddedObject >& xObj, sal_Int64 nAspect );
+
+ // create object for a certain view aspect
+ EmbeddedObjectRef( const NS_UNO::Reference < NS_EMBED::XEmbeddedObject >& xObj, sal_Int64 nAspect );
+
+ ~EmbeddedObjectRef();
+ EmbeddedObjectRef( const EmbeddedObjectRef& );
+ BOOL TryRunningState();
+
+ // assigning to a container enables the object to exchange graphical representations with a storage
+ void AssignToContainer( comphelper::EmbeddedObjectContainer* pContainer, const ::rtl::OUString& rPersistName );
+ comphelper::EmbeddedObjectContainer* GetContainer() const;
+
+ ::rtl::OUString GetPersistName() const;
+ sal_Int64 GetViewAspect() const;
+ void SetViewAspect( sal_Int64 nAspect );
+ Graphic* GetGraphic( ::rtl::OUString* pMediaType=0 ) const;
+
+ // the original size of the object ( size of the icon for iconified object )
+ // no conversion is done if no target mode is provided
+ Size GetSize( MapMode* pTargetMapMode = NULL ) const;
+
+ // the following method tries to get the HC graphic if it is possible, otherwise returns NULL
+ Graphic* GetHCGraphic() const;
+
+ void SetGraphic( const Graphic& rGraphic, const ::rtl::OUString& rMediaType );
+ void SetGraphicStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInGrStream,
+ const ::rtl::OUString& rMediaType );
+
+ void UpdateReplacement() { GetReplacement( TRUE ); }
+ void UpdateReplacementOnDemand();
+ MapUnit GetMapUnit() const;
+ void Lock( BOOL bLock = TRUE );
+ BOOL IsLocked() const;
+ void Clear();
+ BOOL is() const { return mxObj.is(); }
+
+ BOOL IsChart() const;
+
+ // #i104867#
+ // Provides a graphic version number for the fetchable Graphic during this object's lifetime. Internally,
+ // that number is incremented at each change of the Graphic. This mechanism is needed to identify if a
+ // remembered Graphic (e.g. primitives) has changed compared to the current one, but without actively
+ // fetching the Graphic what would be too expensive e.g. for charts
+ sal_uInt32 getGraphicVersion() const;
+ void SetDefaultSizeForChart( const Size& rSizeIn_100TH_MM );//#i103460# charts do not necessaryly have an own size within ODF files, in this case they need to use the size settings from the surrounding frame, which is made available with this method
+ };
+}
+
+#endif
diff --git a/svtools/inc/svtools/embedtransfer.hxx b/svtools/inc/svtools/embedtransfer.hxx
new file mode 100644
index 000000000000..6b3896ceb1aa
--- /dev/null
+++ b/svtools/inc/svtools/embedtransfer.hxx
@@ -0,0 +1,64 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _EMBEDTRANSFER_HXX
+#define _EMBEDTRANSFER_HXX
+
+#include "svtools/svtdllapi.h"
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
+#include <svtools/transfer.hxx>
+
+class Graphic;
+class SVT_DLLPUBLIC SvEmbedTransferHelper : public TransferableHelper
+{
+private:
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedObject > m_xObj;
+ Graphic* m_pGraphic;
+ sal_Int64 m_nAspect;
+
+protected:
+
+ virtual void AddSupportedFormats();
+ virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ virtual void ObjectReleased();
+
+public:
+ // object, replacement image, and the aspect
+ SvEmbedTransferHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedObject >& xObj,
+ Graphic* pGraphic,
+ sal_Int64 nAspect );
+ ~SvEmbedTransferHelper();
+
+ static void FillTransferableObjectDescriptor( TransferableObjectDescriptor& rDesc,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedObject >& xObj,
+ Graphic* pGraphic,
+ sal_Int64 nAspect );
+};
+
+#endif
+
diff --git a/svtools/inc/svtools/extensionlistbox.hxx b/svtools/inc/svtools/extensionlistbox.hxx
new file mode 100644
index 000000000000..532d3822c555
--- /dev/null
+++ b/svtools/inc/svtools/extensionlistbox.hxx
@@ -0,0 +1,105 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _SVTOOLS_EXTENSIONLISTBOX_HXX
+#define _SVTOOLS_EXTENSIONLISTBOX_HXX
+
+#include <vcl/ctrl.hxx>
+#include <rtl/ustring.hxx>
+
+// ============================================================================
+
+namespace svt
+{
+
+#define EXTENSION_LISTBOX_ENTRY_NOTFOUND (sal_Int32) 0xFFFFFFFF
+
+// ============================================================================
+
+/** This abstract class provides methods to implement an extension list box.
+ This header is needed for the automatic test tool
+*/
+class IExtensionListBox: public Control
+{
+public:
+ IExtensionListBox( Window* pParent, WinBits nWinStyle = 0 ): Control( pParent, nWinStyle ){}
+
+ /** @return The count of the entries in the list box. */
+ virtual sal_Int32 getItemCount() const = 0;
+
+ /** @return The index of the first selected entry in the list box.
+ When nothing is selected, which is the case when getItemCount returns '0',
+ then this function returns EXTENSION_LISTBOX_ENTRY_NOTFOUND */
+ virtual sal_Int32 getSelIndex() const = 0;
+
+ /** @return The item name of the entry with the given index
+ The index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual ::rtl::OUString getItemName( sal_Int32 index ) const = 0;
+
+ /** @return The version string of the entry with the given index
+ The index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual ::rtl::OUString getItemVersion( sal_Int32 index ) const = 0;
+
+ /** @return The description string of the entry with the given index
+ The index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual ::rtl::OUString getItemDescription( sal_Int32 index ) const = 0;
+
+ /** @return The publisher string of the entry with the given index
+ The index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual ::rtl::OUString getItemPublisher( sal_Int32 index ) const = 0;
+
+ /** @return The link behind the publisher text of the entry with the given index
+ The index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual ::rtl::OUString getItemPublisherLink( sal_Int32 index ) const = 0;
+
+ /** The entry at the given position will be selected
+ Index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual void select( sal_Int32 index ) = 0;
+
+ /** The first found entry with the given name will be selected
+ When there was no entry found with the name, the selection doesn't change.
+ Please note that there might be more than one entry with the same
+ name, because:
+ 1. the name is not unique
+ 2. one extension can be installed as user and shared extension.
+ */
+ virtual void select( const ::rtl::OUString & sName ) = 0;
+};
+// ============================================================================
+
+} // namespace svt
+
+// ============================================================================
+
+#endif // _SVTOOLS_EXTENSIONLISTBOX_HXX
+
diff --git a/svtools/inc/svtools/fileurlbox.hxx b/svtools/inc/svtools/fileurlbox.hxx
new file mode 100644
index 000000000000..6d2f6e2b9041
--- /dev/null
+++ b/svtools/inc/svtools/fileurlbox.hxx
@@ -0,0 +1,77 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef SVTOOLS_FILEURLBOX_HXX
+#define SVTOOLS_FILEURLBOX_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/inettbc.hxx>
+
+//.........................................................................
+namespace svt
+{
+//.........................................................................
+
+ //=====================================================================
+ //= FileURLBox
+ //=====================================================================
+ class SVT_DLLPUBLIC FileURLBox : public SvtURLBox
+ {
+ protected:
+ String m_sPreservedText;
+
+ public:
+ FileURLBox( Window* _pParent );
+ FileURLBox( Window* _pParent, WinBits _nStyle );
+ FileURLBox( Window* _pParent, const ResId& _rId );
+
+ protected:
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+
+ public:
+ /** transforms the given URL content into a system-dependent notation, if possible, and
+ sets it as current display text
+
+ <p>If the user enters an URL such as "file:///c:/some%20directory", then this will be converted
+ to "c:\some directory" for better readability.</p>
+
+ @param _rURL
+ denotes the URL to set. Note that no check is made whether it is a valid URL - this
+ is the responsibility of the caller.
+
+ @see SvtURLBox::GetURL
+ */
+ void DisplayURL( const String& _rURL );
+ };
+
+//.........................................................................
+} // namespace svt
+//.........................................................................
+
+#endif // SVTOOLS_FILEURLBOX_HXX
+
diff --git a/svtools/inc/svtools/filter.hxx b/svtools/inc/svtools/filter.hxx
new file mode 100644
index 000000000000..49ec77adfea5
--- /dev/null
+++ b/svtools/inc/svtools/filter.hxx
@@ -0,0 +1,427 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _FILTER_HXX
+#define _FILTER_HXX
+
+#include <svtools/fltcall.hxx>
+#include "svtools/svtdllapi.h"
+#include <tools/stream.hxx>
+#include <vcl/graph.hxx>
+#include <tools/gen.hxx>
+#include <tools/urlobj.hxx>
+#include <vcl/field.hxx>
+#include <com/sun/star/uno/Sequence.h>
+#include <com/sun/star/beans/PropertyValue.hpp>
+
+// -----------------------
+// - GraphicFilter-Types -
+// -----------------------
+
+struct ImplDirEntryHelper
+{
+ static BOOL Exists( const INetURLObject& rObj );
+ static void Kill( const String& rStr );
+};
+
+class Window;
+class Graphic;
+
+#define OPT_FILTERSECTION "Graphic"
+
+#define GRFILTER_OK 0
+#define GRFILTER_OPENERROR 1
+#define GRFILTER_IOERROR 2
+#define GRFILTER_FORMATERROR 3
+#define GRFILTER_VERSIONERROR 4
+#define GRFILTER_FILTERERROR 5
+#define GRFILTER_ABORT 6
+#define GRFILTER_TOOBIG 7
+
+#define GRFILTER_OUTHINT_GREY 1
+
+#define GRFILTER_FORMAT_NOTFOUND ((USHORT)0xFFFF)
+#define GRFILTER_FORMAT_DONTKNOW ((USHORT)0xFFFF)
+
+#define GRFILTER_I_FLAGS_SET_LOGSIZE_FOR_JPEG 00000001
+#define GRFILTER_I_FLAGS_DONT_SET_LOGSIZE_FOR_JPEG 00000002
+#define GRFILTER_I_FLAGS_FOR_PREVIEW 00000004
+#define GRFILTER_I_FLAGS_ALLOW_PARTIAL_STREAMREAD 00000010
+
+#define IMP_BMP "SVBMP"
+#define IMP_SVMETAFILE "SVMETAFILE"
+#define IMP_WMF "SVWMF"
+#define IMP_EMF "SVEMF"
+#define IMP_SVSGF "SVSGF"
+#define IMP_SVSGV "SVSGV"
+#define IMP_GIF "SVIGIF"
+#define IMP_PNG "SVIPNG"
+#define IMP_JPEG "SVIJPEG"
+#define IMP_XBM "SVIXBM"
+#define IMP_XPM "SVIXPM"
+#define EXP_BMP "SVBMP"
+#define EXP_SVMETAFILE "SVMETAFILE"
+#define EXP_WMF "SVWMF"
+#define EXP_EMF "SVEMF"
+#define EXP_JPEG "SVEJPEG"
+#define EXP_SVG "SVESVG"
+#define EXP_PNG "SVEPNG"
+
+#define BMP_SHORTNAME "BMP"
+#define GIF_SHORTNAME "GIF"
+#define JPG_SHORTNAME "JPG"
+#define MET_SHORTNAME "MET"
+#define PCT_SHORTNAME "PCT"
+#define PNG_SHORTNAME "PNG"
+#define SVM_SHORTNAME "SVM"
+#define TIF_SHORTNAME "TIF"
+#define WMF_SHORTNAME "WMF"
+#define EMF_SHORTNAME "EMF"
+
+// ------------------------------------
+// - Info-Klasse fuer alle von uns
+// unterstuetzten Grafik-Fileformate
+// ------------------------------------
+
+#define GFF_NOT ( (USHORT)0x0000 )
+#define GFF_BMP ( (USHORT)0x0001 )
+#define GFF_GIF ( (USHORT)0x0002 )
+#define GFF_JPG ( (USHORT)0x0003 )
+#define GFF_PCD ( (USHORT)0x0004 )
+#define GFF_PCX ( (USHORT)0x0005 )
+#define GFF_PNG ( (USHORT)0x0006 )
+#define GFF_TIF ( (USHORT)0x0007 )
+#define GFF_XBM ( (USHORT)0x0008 )
+#define GFF_XPM ( (USHORT)0x0009 )
+#define GFF_PBM ( (USHORT)0x000a )
+#define GFF_PGM ( (USHORT)0x000b )
+#define GFF_PPM ( (USHORT)0x000c )
+#define GFF_RAS ( (USHORT)0x000d )
+#define GFF_TGA ( (USHORT)0x000e )
+#define GFF_PSD ( (USHORT)0x000f )
+#define GFF_EPS ( (USHORT)0x0010 )
+#define GFF_DXF ( (USHORT)0x00f1 )
+#define GFF_MET ( (USHORT)0x00f2 )
+#define GFF_PCT ( (USHORT)0x00f3 )
+#define GFF_SGF ( (USHORT)0x00f4 )
+#define GFF_SVM ( (USHORT)0x00f5 )
+#define GFF_WMF ( (USHORT)0x00f6 )
+#define GFF_SGV ( (USHORT)0x00f7 )
+#define GFF_EMF ( (USHORT)0x00f8 )
+#define GFF_XXX ( (USHORT)0xffff )
+
+// ---------------
+// - RequestInfo -
+// ---------------
+
+struct RequestInfo
+{
+ BYTE* pBuffer;
+ ULONG nRealBufferSize;
+};
+
+// ---------------------
+// - GraphicDescriptor -
+// ---------------------
+
+class SVT_DLLPUBLIC GraphicDescriptor
+{
+ SvStream* pFileStm;
+ Link aReqLink;
+ String aPathExt;
+ Size aPixSize;
+ Size aLogSize;
+ SvStream* pMemStm;
+ SvStream* pBaseStm;
+ ULONG nStmPos;
+ USHORT nBitsPerPixel;
+ USHORT nPlanes;
+ USHORT nFormat;
+ BOOL bCompressed;
+ BOOL bDataReady;
+ BOOL bLinked;
+ BOOL bLinkChanged;
+ BOOL bWideSearch;
+ BOOL bBaseStm;
+ long nExtra1;
+ long nExtra2;
+
+ void ImpConstruct();
+
+//#if 0 // _SOLAR__PRIVATE
+
+ BOOL ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo );
+ BOOL ImpDetectGIF( SvStream& rStm, BOOL bExtendedInfo );
+ BOOL ImpDetectJPG( SvStream& rStm, BOOL bExtendedInfo );
+ BOOL ImpDetectPCD( SvStream& rStm, BOOL bExtendedInfo );
+ BOOL ImpDetectPCX( SvStream& rStm, BOOL bExtendedInfo );
+ BOOL ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo );
+ BOOL ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo );
+ BOOL ImpDetectXBM( SvStream& rStm, BOOL bExtendedInfo );
+ BOOL ImpDetectXPM( SvStream& rStm, BOOL bExtendedInfo );
+ BOOL ImpDetectPBM( SvStream& rStm, BOOL bExtendedInfo );
+ BOOL ImpDetectPGM( SvStream& rStm, BOOL bExtendedInfo );
+ BOOL ImpDetectPPM( SvStream& rStm, BOOL bExtendedInfo );
+ BOOL ImpDetectRAS( SvStream& rStm, BOOL bExtendedInfo );
+ BOOL ImpDetectTGA( SvStream& rStm, BOOL bExtendedInfo );
+ BOOL ImpDetectPSD( SvStream& rStm, BOOL bExtendedInfo );
+ BOOL ImpDetectEPS( SvStream& rStm, BOOL bExtendedInfo );
+ BOOL ImpDetectDXF( SvStream& rStm, BOOL bExtendedInfo );
+ BOOL ImpDetectMET( SvStream& rStm, BOOL bExtendedInfo );
+ BOOL ImpDetectPCT( SvStream& rStm, BOOL bExtendedInfo );
+ BOOL ImpDetectSGF( SvStream& rStm, BOOL bExtendedInfo );
+ BOOL ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo );
+ BOOL ImpDetectWMF( SvStream& rStm, BOOL bExtendedInfo );
+ BOOL ImpDetectSGV( SvStream& rStm, BOOL bExtendedInfo );
+ BOOL ImpDetectEMF( SvStream& rStm, BOOL bExtendedInfo );
+
+//#endif
+
+ GraphicDescriptor( const GraphicDescriptor& );
+ GraphicDescriptor& operator=( const GraphicDescriptor& );
+
+protected:
+
+ BOOL IsDataReady() const;
+ BOOL IsWideSearch() const;
+ SvStream& GetSearchStream() const;
+ const String& GetPathExtension() const;
+
+public:
+
+ // Default-Ctor, um anschliessend einen Link zu setzen, mit dem
+ // die Daten vom Aufrufer im ::Detect() angefordert werden.
+ // da einige Formate ( Mtf's ) keinen eindeutigen Header besitzen,
+ // ist es sinnvoll den vollen Filenamen (inkl. Ext. ) mitanzugeben,
+ // da so das Format ueber die Extension ermittelt werden kann
+ GraphicDescriptor( const String* pPath = NULL );
+
+ // Ctor, um einen Filenamen zu setzen. Es muss ::Detect() gerufen werden,
+ // um das File zu identifizieren;
+ // wenn das File keinen eindeutigen Header besitzt ( Mtf's ) wird das
+ // Format anhand der Extension bestimmt
+ GraphicDescriptor( const INetURLObject& rPath );
+
+ // Ctor, um einen Stream zu setzen. Es muss ::Detect() gerufen werden,
+ // um das File zu identifizieren;
+ // da einige Formate ( Mtf's ) keinen eindeutigen Header besitzen,
+ // ist es sinnvoll den Filenamen (inkl. Ext. ) mitanzugeben,
+ // da so das Format ueber die Extension ermittelt werden kann
+ GraphicDescriptor( SvStream& rInStream, const String* pPath = NULL );
+
+ // Dtor
+ virtual ~GraphicDescriptor();
+
+ // Startet die Detektion;
+ // bei bExtendedInfo == TRUE werden soweit wie moeglich
+ // Daten aus dem jeweiligen FileHeader ermittelt
+ // ( Groesse, Farbtiefe usw. )
+ virtual BOOL Detect( BOOL bExtendedInfo = FALSE );
+
+ // liefert das Fileformat nach erfolgreicher Detektion zurueck;
+ // wenn kein Format erkannt wurde, ist das Formart GFF_NOT
+ USHORT GetFileFormat() const { return nFormat; }
+
+ // liefert die Pixel-Bildgroesse oder 0-Size zurueck
+ const Size& GetSizePixel() const { return (Size&) aPixSize; }
+
+ // liefert die logische Bildgroesse in 1/100mm oder 0-Size zurueck
+ const Size& GetSize_100TH_MM() const { return (Size&) aLogSize; }
+
+ // liefert die Bits/Pixel oder 0 zurueck
+ USHORT GetBitsPerPixel() const { return nBitsPerPixel; }
+
+ // liefert die Anzahl der Planes oder 0 zurueck
+ USHORT GetPlanes() const { return nPlanes; }
+
+ // zeigt an, ob das Bild evtl. komprimiert (wie auch immer) ist
+ BOOL IsCompressed() const { return bCompressed; }
+
+ // setzt den LinkHdl zum Setzen der Bytes;
+ // der Handler muss einen Pointer auf die RequestInfo-Struktur
+ // zurueckgeben; die Anzahl der minimal zur Verfuegung zu stellenden
+ // Daten muss im Handler ueber ::GetRequestedByteCount() erfragt werden;
+ // die tatsaechlich zur Verfuegung gestellte BYTE-Anzahl
+ // wird in der RequestInfo-Struktur gesetzt
+ void SetRequestHdl( const Link& rRequestHdl );
+
+ // gibt den LinkHdl zum Setzen der Bytes zurueck
+ const Link& GetRequestHdl() const { return aReqLink; }
+
+ // muss im ReqHdl gerufen werden, um zu erfahren, wieviele
+ // Bytes _mindestens_ bereitgestellt werden muessen
+ ULONG GetRequestedByteCount() const;
+
+ // gibt die Filternummer des Filters zurueck,
+ // der im GraphicFilter zum Lesen dieses Formats
+ // benoetigt wird
+ static String GetImportFormatShortName( sal_uInt16 nFormat );
+};
+
+// -----------------
+// - GraphicFilter -
+// -----------------
+
+struct FilterErrorEx
+{
+ ULONG nFilterError;
+ ULONG nStreamError;
+ long nDummy1;
+ long nDummy2;
+ long nDummy3;
+ long nDummy4;
+
+ FilterErrorEx() : nFilterError( 0UL ), nStreamError( 0UL ) {}
+};
+
+// -----------------------------------------------------------------------------
+
+struct ConvertData;
+class FilterConfigCache;
+class SVT_DLLPUBLIC GraphicFilter
+{
+ friend class SvFilterOptionsDialog;
+
+private:
+
+ void ImplInit();
+ ULONG ImplSetError( ULONG nError, const SvStream* pStm = NULL );
+ sal_uInt16 ImpTestOrFindFormat( const String& rPath, SvStream& rStream, sal_uInt16& rFormat );
+
+ DECL_LINK( FilterCallback, ConvertData* pData );
+
+protected:
+
+ String aFilterPath;
+ FilterConfigCache* pConfig;
+ FilterErrorEx* pErrorEx;
+ sal_Bool bAbort;
+ sal_Bool bUseConfig;
+ sal_Bool bDummy1;
+ sal_Bool bDummy2;
+ sal_Bool bDummy3;
+ sal_Bool bDummy4;
+ long nExpGraphHint;
+ long nDummy2;
+ void* pDummy1;
+ void* pDummy2;
+
+public:
+
+ GraphicFilter( sal_Bool bUseConfig = sal_True );
+ ~GraphicFilter();
+
+ void SetFilterPath( const String& rFilterPath ) { aFilterPath = rFilterPath; };
+
+ USHORT GetImportFormatCount();
+ USHORT GetImportFormatNumber( const String& rFormatName );
+ USHORT GetImportFormatNumberForMediaType( const String& rMediaType );
+ USHORT GetImportFormatNumberForShortName( const String& rShortName );
+ sal_uInt16 GetImportFormatNumberForTypeName( const String& rType );
+ String GetImportFormatName( USHORT nFormat );
+ String GetImportFormatTypeName( USHORT nFormat );
+ String GetImportFormatMediaType( USHORT nFormat );
+ String GetImportFormatShortName( USHORT nFormat );
+ String GetImportOSFileType( USHORT nFormat );
+ String GetImportWildcard( USHORT nFormat, sal_Int32 nEntry = 0 );
+ BOOL IsImportPixelFormat( USHORT nFormat );
+
+ USHORT GetExportFormatCount();
+ USHORT GetExportFormatNumber( const String& rFormatName );
+ USHORT GetExportFormatNumberForMediaType( const String& rShortName );
+ USHORT GetExportFormatNumberForShortName( const String& rShortName );
+ sal_uInt16 GetExportFormatNumberForTypeName( const String& rType );
+ String GetExportFormatName( USHORT nFormat );
+ String GetExportFormatTypeName( USHORT nFormat );
+ String GetExportFormatMediaType( USHORT nFormat );
+ String GetExportFormatShortName( USHORT nFormat );
+ String GetExportOSFileType( USHORT nFormat );
+ String GetExportWildcard( USHORT nFormat, sal_Int32 nEntry = 0 );
+ BOOL IsExportPixelFormat( USHORT nFormat );
+
+ BOOL HasImportDialog( USHORT nFormat );
+ BOOL DoImportDialog( Window* pWindow, USHORT nFormat );
+
+ BOOL HasExportDialog( USHORT nFormat );
+ BOOL DoExportDialog( Window* pWindow, USHORT nFormat );
+ BOOL DoExportDialog( Window* pWindow, USHORT nFormat, FieldUnit eFieldUnit );
+
+ USHORT ExportGraphic( const Graphic& rGraphic, const INetURLObject& rPath,
+ USHORT nFormat = GRFILTER_FORMAT_DONTKNOW,
+ const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >* pFilterData = NULL );
+ USHORT ExportGraphic( const Graphic& rGraphic, const String& rPath,
+ SvStream& rOStm, USHORT nFormat = GRFILTER_FORMAT_DONTKNOW,
+ const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >* pFilterData = NULL );
+ long GetExportGraphicHint() const { return nExpGraphHint; }
+
+ USHORT CanImportGraphic( const INetURLObject& rPath,
+ USHORT nFormat = GRFILTER_FORMAT_DONTKNOW,
+ USHORT * pDeterminedFormat = NULL);
+
+ USHORT ImportGraphic( Graphic& rGraphic, const INetURLObject& rPath,
+ USHORT nFormat = GRFILTER_FORMAT_DONTKNOW,
+ USHORT * pDeterminedFormat = NULL, sal_uInt32 nImportFlags = 0 );
+
+ USHORT CanImportGraphic( const String& rPath, SvStream& rStream,
+ USHORT nFormat = GRFILTER_FORMAT_DONTKNOW,
+ USHORT * pDeterminedFormat = NULL);
+
+ USHORT ImportGraphic( Graphic& rGraphic, const String& rPath,
+ SvStream& rStream,
+ USHORT nFormat = GRFILTER_FORMAT_DONTKNOW,
+ USHORT * pDeterminedFormat = NULL, sal_uInt32 nImportFlags = 0 );
+
+ USHORT ImportGraphic( Graphic& rGraphic, const String& rPath,
+ SvStream& rStream,
+ USHORT nFormat,
+ USHORT * pDeterminedFormat, sal_uInt32 nImportFlags,
+ com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >* pFilterData );
+
+ BOOL Setup( USHORT nFormat );
+
+ void Abort() { bAbort = TRUE; }
+
+ const FilterErrorEx& GetLastError() const;
+ void ResetLastError();
+
+ const Link GetFilterCallback() const;
+ static GraphicFilter* GetGraphicFilter();
+ static int LoadGraphic( const String& rPath, const String& rFilter,
+ Graphic& rGraphic,
+ GraphicFilter* pFilter = NULL,
+ USHORT* pDeterminedFormat = NULL );
+};
+
+// ------------------------------------
+// - Windows Metafile Lesen/Schreiben -
+// ------------------------------------
+
+SVT_DLLPUBLIC BOOL ReadWindowMetafile( SvStream& rStream, GDIMetaFile& rMTF, FilterConfigItem* pConfigItem );
+SVT_DLLPUBLIC BOOL WriteWindowMetafile( SvStream& rStream, const GDIMetaFile& rMTF );
+SVT_DLLPUBLIC BOOL WriteWindowMetafileBits( SvStream& rStream, const GDIMetaFile& rMTF );
+
+#endif //_FILTER_HXX
diff --git a/svtools/inc/svtools/fixedhyper.hxx b/svtools/inc/svtools/fixedhyper.hxx
new file mode 100644
index 000000000000..290b53c7d841
--- /dev/null
+++ b/svtools/inc/svtools/fixedhyper.hxx
@@ -0,0 +1,231 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+#ifndef SVTOOLS_FIXEDHYPER_HXX
+#define SVTOOLS_FIXEDHYPER_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <toolkit/helper/fixedhyperbase.hxx>
+
+//.........................................................................
+namespace svt
+{
+//.........................................................................
+
+ //=====================================================================
+ //= FixedHyperlink
+ //=====================================================================
+ class SVT_DLLPUBLIC FixedHyperlink : public ::toolkit::FixedHyperlinkBase
+ {
+ private:
+ long m_nTextLen;
+ Pointer m_aOldPointer;
+ Link m_aClickHdl;
+ String m_sURL;
+
+ /** initializes the font (link color and underline).
+
+ Called by the Ctors.
+ */
+ void Initialize();
+
+ protected:
+ /** overwrites Window::MouseMove().
+
+ Changes the pointer only over the text.
+ */
+ virtual void MouseMove( const MouseEvent& rMEvt );
+
+ /** overwrites Window::MouseButtonUp().
+
+ Calls the set link if the mouse is over the text.
+ */
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+
+ /** overwrites Window::RequestHelp().
+
+ Shows tooltip only if the mouse is over the text.
+ */
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+
+ public:
+ /** ctors
+
+ With ResId or WinBits.
+ */
+ FixedHyperlink( Window* pParent, const ResId& rId );
+ FixedHyperlink( Window* pParent, WinBits nWinStyle = 0 );
+
+ /** dtor
+
+ */
+ virtual ~FixedHyperlink();
+
+ /** overwrites Window::GetFocus().
+
+ Changes the color of the text and shows a focus rectangle.
+ */
+ virtual void GetFocus();
+
+ /** overwrites Window::LoseFocus().
+
+ Changes the color of the text and hides the focus rectangle.
+ */
+ virtual void LoseFocus();
+
+ /** overwrites Window::KeyInput().
+
+ KEY_RETURN and KEY_SPACE calls the link handler.
+ */
+ virtual void KeyInput( const KeyEvent& rKEvt );
+
+ /** sets <member>m_aClickHdl</member> with <arg>rLink</arg>.
+
+ <member>m_aClickHdl</member> is called if the text is clicked.
+ */
+ inline void SetClickHdl( const Link& rLink ) { m_aClickHdl = rLink; }
+
+ /** returns <member>m_aClickHdl</member>.
+
+ @return
+ <member>m_aClickHdl</member>
+ */
+ inline const Link& GetClickHdl() const { return m_aClickHdl; }
+
+ // ::toolkit::FixedHyperbaseLink
+
+ /** sets the URL of the hyperlink and uses it as tooltip. */
+ virtual void SetURL( const String& rNewURL );
+
+ /** returns the URL of the hyperlink.
+
+ @return
+ <member>m_sURL</member>
+ */
+ virtual String GetURL() const;
+
+ /** sets new text and recalculates the text length. */
+ virtual void SetDescription( const String& rNewDescription );
+ };
+
+ //=====================================================================
+ //= FixedHyperlinkImage
+ //=====================================================================
+ class SVT_DLLPUBLIC FixedHyperlinkImage : public FixedImage
+ {
+ private:
+ Pointer m_aOldPointer;
+ Link m_aClickHdl;
+ String m_sURL;
+
+ /** initializes the font (link color and underline).
+
+ Called by the Ctors.
+ */
+ void Initialize();
+
+ protected:
+ /** overwrites Window::MouseMove().
+
+ Changes the pointer only over the text.
+ */
+ virtual void MouseMove( const MouseEvent& rMEvt );
+
+ /** overwrites Window::MouseButtonUp().
+
+ Calls the set link if the mouse is over the text.
+ */
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+
+ /** overwrites Window::RequestHelp().
+
+ Shows tooltip only if the mouse is over the text.
+ */
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+
+ public:
+ /** ctors
+
+ With ResId or WinBits.
+ */
+ FixedHyperlinkImage( Window* pParent, const ResId& rId );
+ FixedHyperlinkImage( Window* pParent, WinBits nWinStyle = 0 );
+
+ /** dtor
+
+ */
+ virtual ~FixedHyperlinkImage();
+
+ /** overwrites Window::GetFocus().
+
+ Changes the color of the text and shows a focus rectangle.
+ */
+ virtual void GetFocus();
+
+ /** overwrites Window::LoseFocus().
+
+ Changes the color of the text and hides the focus rectangle.
+ */
+ virtual void LoseFocus();
+
+ /** overwrites Window::KeyInput().
+
+ KEY_RETURN and KEY_SPACE calls the link handler.
+ */
+ virtual void KeyInput( const KeyEvent& rKEvt );
+
+ /** sets <member>m_aClickHdl</member> with <arg>rLink</arg>.
+
+ <member>m_aClickHdl</member> is called if the text is clicked.
+ */
+ inline void SetClickHdl( const Link& rLink ) { m_aClickHdl = rLink; }
+
+ /** returns <member>m_aClickHdl</member>.
+
+ @return
+ <member>m_aClickHdl</member>
+ */
+ inline const Link& GetClickHdl() const { return m_aClickHdl; }
+
+ // ::toolkit::FixedHyperbaseLink
+
+ /** sets the URL of the hyperlink and uses it as tooltip. */
+ virtual void SetURL( const String& rNewURL );
+
+ /** returns the URL of the hyperlink.
+
+ @return
+ <member>m_sURL</member>
+ */
+ virtual String GetURL() const;
+ };
+//.........................................................................
+} // namespace svt
+//.........................................................................
+
+#endif
+
diff --git a/svtools/inc/svtools/fltcall.hxx b/svtools/inc/svtools/fltcall.hxx
new file mode 100644
index 000000000000..d0bf054d724e
--- /dev/null
+++ b/svtools/inc/svtools/fltcall.hxx
@@ -0,0 +1,74 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _FLTCALL_HXX
+#define _FLTCALL_HXX
+#include <tools/gen.hxx>
+#include <vcl/field.hxx>
+#include <com/sun/star/uno/Sequence.h>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <svtools/FilterConfigItem.hxx>
+
+class FilterConfigItem;
+class SvStream;
+class Graphic;
+class Window;
+
+struct FltCallDialogParameter
+{
+
+ Window* pWindow;
+ ResMgr* pResMgr;
+ FieldUnit eFieldUnit;
+ String aFilterExt;
+
+ // In and Out PropertySequence for all filter dialogs
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aFilterData;
+
+ FltCallDialogParameter( Window* pW, ResMgr* pRsMgr, FieldUnit eFiUni ) :
+ pWindow ( pW ),
+ pResMgr ( pRsMgr ),
+ eFieldUnit ( eFiUni ) {};
+};
+
+typedef BOOL (*PFilterCall)(SvStream & rStream, Graphic & rGraphic,
+ FilterConfigItem* pConfigItem, sal_Bool bPrefDialog);
+ // Von diesem Typ sind sowohl Export-Filter-Funktionen als auch Import-Filter-Funktionen.
+ // rFileName ist der komplette Pfadname der zu importierenden bzw. zu exportierenden Datei.
+ // pCallBack darf auch NULL sein. pCallerData wird der Callback-Funktion uebergeben.
+ // pOptionsConfig darf NULL sein. Anderenfalls ist die Gruppe des Config schon gesetzt
+ // und darf von dem Filter nicht geaendert werden!
+ // Wenn bPrefDialog==TRUE gilt, wird ggf. ein Preferences-Dialog durchgefuehrt.
+
+typedef BOOL ( *PFilterDlgCall )( FltCallDialogParameter& );
+ // Von diesem Typ sind sowohl Export-Filter-Funktionen als auch Import-Filter-Funktionen.
+ // Uebergeben wird ein Pointer auf ein Parent-Fenster und auf die Options-Config.
+ // pOptions und pWindow duerfen NULL sein, in diesem Fall wird FALSE zurueckgeliefert.
+ // Anderenfalls ist die Gruppe der Config schon gesetzt
+ // und darf von dem Filter nicht geaendert werden!
+
+#endif
diff --git a/svtools/inc/svtools/fmtfield.hxx b/svtools/inc/svtools/fmtfield.hxx
new file mode 100644
index 000000000000..9226f78b77fc
--- /dev/null
+++ b/svtools/inc/svtools/fmtfield.hxx
@@ -0,0 +1,350 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _FMTFIELD_HXX_
+#define _FMTFIELD_HXX_
+
+#include "svtools/svtdllapi.h"
+#include <vcl/spinfld.hxx>
+#include <svl/zforlist.hxx>
+
+//#define REGEXP_SUPPORT
+
+#ifdef REGEXP_SUPPORT
+ #ifndef _UNOTOOLS_TEXTSEARCH_HXX
+ #include <unotools/textsearch.hxx>
+ #endif
+#else
+ // use a hand-made regular expression parsing for the small expression we're interested in
+ // as soon as OOo does have regular expression support, we can switch on the REGEXP_SUPPORT define
+ namespace validation { class NumberValidator; }
+#endif
+
+typedef USHORT FORMAT_CHANGE_TYPE;
+#define FCT_KEYONLY 0x00 // only a new key was set
+#define FCT_FORMATTER 0x01 // a new formatter weas set, usually implies a change of the key, too
+#define FCT_PRECISION 0x02 // a new precision was set
+#define FCT_THOUSANDSSEP 0x03 // the thousands separator setting changed
+
+//------------------------------------------------------------------------------
+class SVT_DLLPUBLIC FormattedField : public SpinField
+{
+private:
+ // Da ein SvNumberFormatter eine ziemlich teure (sowohl zeit- als auch platz-maessig) Angelegenheit ist,
+ // haelt sich nicht jedes Field, an dem kein Formatter gesetzt wurde, eine eigenen Instanz, sondern es gibt nur eine
+ // einzige statische.
+ class StaticFormatter
+ {
+ static SvNumberFormatter* s_cFormatter;
+ static ULONG s_nReferences;
+ public:
+ StaticFormatter();
+ ~StaticFormatter();
+
+ operator SvNumberFormatter* () { return GetFormatter(); }
+ SVT_DLLPUBLIC SvNumberFormatter* GetFormatter();
+ };
+
+protected:
+ String m_sLastValidText;
+ // hat nichts mit dem current value zu tun, ist der letzte Text, der waehrend einer Eingabe als gueltig erkannt
+ // wurde (also durch CheckText geprueft, nicht durch den Formatter gejagt)
+ Selection m_aLastSelection;
+
+ double m_dMinValue;
+ double m_dMaxValue;
+ BOOL m_bHasMin : 1;
+ BOOL m_bHasMax : 1;
+
+ BOOL m_bStrictFormat : 1;
+
+ BOOL m_bValueDirty : 1;
+ BOOL m_bEnableEmptyField : 1;
+ BOOL m_bAutoColor : 1;
+ BOOL m_bEnableNaN : 1;
+ double m_dCurrentValue;
+ double m_dDefaultValue;
+
+ ULONG m_nFormatKey;
+ SvNumberFormatter* m_pFormatter;
+ StaticFormatter m_aStaticFormatter;
+
+ double m_dSpinSize;
+ double m_dSpinFirst;
+ double m_dSpinLast;
+
+ // es macht einen Unterschied, ob man bei eingestellter Textformatierung beim LostFocus den aktuellen String durch
+ // den Formatter jagt und das Ergebnis anzeigt oder erst aus dem String ein double macht, das formatiert und dann
+ // ausgibt
+ BOOL m_bTreatAsNumber;
+ // und mit den folgenden Members koennen wir das Ganze hier auch zur formatierten Text-Ausgabe benutzen ...
+ String m_sCurrentTextValue;
+ String m_sDefaultText;
+
+ // die bei der letzten Ausgabe-Operation vom Formatter gelieferte Farbe (nicht dass wir sie beachten wuerden, aber
+ // man kann sie von aussen abfragen)
+ Color* m_pLastOutputColor;
+
+ bool m_bUseInputStringForFormatting;
+
+public:
+ FormattedField(Window* pParent, WinBits nStyle = 0, SvNumberFormatter* pInitialFormatter = NULL, INT32 nFormatKey = 0);
+ FormattedField(Window* pParent, const ResId& rResId, SvNumberFormatter* pInitialFormatter = NULL, INT32 nFormatKey = 0);
+ virtual ~FormattedField();
+
+ // Min-/Max-Verwaltung
+ BOOL HasMinValue() const { return m_bHasMin; }
+ void ClearMinValue() { m_bHasMin = FALSE; }
+ void SetMinValue(double dMin);
+ double GetMinValue() const { return m_dMinValue; }
+
+ BOOL HasMaxValue() const { return m_bHasMax; }
+ void ClearMaxValue() { m_bHasMax = FALSE; }
+ void SetMaxValue(double dMax);
+ double GetMaxValue() const { return m_dMaxValue; }
+
+ // aktueller Wert
+ virtual void SetValue(double dVal);
+ virtual double GetValue();
+ // die Standard-Implementierung jagt die Eingabe jeweils durch den Formatter, so einer vorhanden ist
+
+ void GetColor() const;
+
+ void SetTextValue(const XubString& rText);
+ // der String wird in ein double umgewandelt (durch den Formatter) und anschliessen in SetValue gesteckt
+
+ BOOL IsEmptyFieldEnabled() const { return m_bEnableEmptyField; }
+ void EnableEmptyField(BOOL bEnable);
+ // wenn nicht enabled, wird beim Verlassen des Feldes der Text auf den letzten gueltigen zurueckgesetzt
+
+ void SetDefaultValue(double dDefault) { m_dDefaultValue = dDefault; m_bValueDirty = TRUE; }
+ // wenn der aktuelle String ungueltig ist, liefert GetValue() diesen Default-Wert
+ double GetDefaultValue() const { return m_dDefaultValue; }
+
+ // Einstellungen fuer das Format
+ ULONG GetFormatKey() const { return m_nFormatKey; }
+ void SetFormatKey(ULONG nFormatKey);
+
+ SvNumberFormatter* GetFormatter() const { return m_pFormatter; }
+ void SetFormatter(SvNumberFormatter* pFormatter, BOOL bResetFormat = TRUE);
+ // wenn bResetFormat FALSE ist, wird versucht, das alte eingestellte Format mit 'hinueberzuretten' (teuer, wenn es sich nicht
+ // um eines der Standard-Formate handelt, die in allen Formattern gleich sind)
+ // wenn TRUE, wird als neuer FormatKey 0 gesetzt
+
+ BOOL GetThousandsSep() const;
+ void SetThousandsSep(BOOL _bUseSeparator);
+ // the is no check if the current format is numeric, so be cautious when calling these functions
+
+ USHORT GetDecimalDigits() const;
+ void SetDecimalDigits(USHORT _nPrecision);
+ // the is no check if the current format is numeric, so be cautious when calling these functions
+
+ SvNumberFormatter* StandardFormatter() { return m_aStaticFormatter; }
+ // Wenn man keinen eigenen Formatter explizit anlegen will, kann man diesen hier in SetFormatter stecken ...
+ // Das hier gelieferte Objekt wird allerdings zwischen allen Instanzen der Klasse geteilt (aus Zeit- und Platzgruenden),
+ // also ist etwas Vorsicht angebracht ...
+
+ void GetFormat(XubString& rFormatString, LanguageType& eLang) const;
+ BOOL SetFormat(const XubString& rFormatString, LanguageType eLang);
+ // FALSE, wenn der FormatString nicht gesetzt werden konnte (also wahrscheinlich ungueltig ist)
+
+ BOOL IsStrictFormat() const { return m_bStrictFormat; }
+ void SetStrictFormat(BOOL bEnable) { m_bStrictFormat = bEnable; }
+ // Formatueberpruefung waehrend der Eingabe ?
+
+ // Spin-Handling
+ virtual void Up();
+ virtual void Down();
+ // Standard-Implementierung : hoch- oder runterzaehlen des aktuellen double einfach um die gesetzte SpinSize
+ virtual void First();
+ virtual void Last();
+ // Standard-Implementierung : aktuelles double setzen auf eingestellten first respektive last value
+
+ void SetSpinSize(double dStep) { m_dSpinSize = dStep; }
+ double GetSpinSize() const { return m_dSpinSize; }
+
+ void SetSpinFirst(double dFirst) { m_dSpinFirst = dFirst; }
+ double GetSpinFirst() const { return m_dSpinFirst; }
+
+ void SetSpinLast(double dLast) { m_dSpinLast = dLast; }
+ double GetSpinLast() const { return m_dSpinLast; }
+
+ BOOL TreatingAsNumber() const { return m_bTreatAsNumber; }
+ void TreatAsNumber(BOOL bDoSo) { m_bTreatAsNumber = bDoSo; }
+
+public:
+ virtual void SetText( const XubString& rStr );
+ virtual void SetText( const XubString& rStr, const Selection& rNewSelection );
+ void SetValidateText(const XubString& rText, const String* pErrorText = NULL);
+
+ // die folgenden Methoden sind interesant, wenn m_bTreatAsNumber auf FALSE sitzt
+ /** nehmen wir mal an, irgendjemand will das ganze schoene double-Handling gar nicht haben, sondern
+ einfach den Text formatiert ausgeben ...
+ (der Text wird einfach nur durch den Formatter gejagt und dann gesetzt)
+ */
+ void SetTextFormatted(const XubString& rText);
+ String GetTextValue() const;
+
+ void SetDefaultText(const XubString& rDefault) { m_sDefaultText = rDefault; }
+ String GetDefaultText() const { return m_sDefaultText; }
+
+ // die bei der letzten Ausgabe-Operation vom Formatter gelieferte Farbe (Ausgabe-Operationen werden getriggert durch
+ // SetValue, SetTextValue, SetTextFormatted, also indirekt eventuell auch durch SetMin-/-MaxValue)
+ Color* GetLastOutputColor() const { return m_pLastOutputColor; }
+
+ /** reformats the current text. Interesting if the user entered some text in an "input format", and
+ this should be formatted in the "output format" (which may differ, e.g. by additional numeric
+ digits or such).
+ */
+ void Commit();
+
+ // enable automatic coloring. if set to TRUE, and the format the field is working with for any current value
+ // says that it has to be painted in a special color (e.g. a format where negative numbers should be printed
+ // red), the text is painted with that color automatically.
+ // The color used is the same as returned by GetLastOutputColor()
+ void SetAutoColor(BOOL _bAutomatic);
+ BOOL GetAutoColor() const { return m_bAutoColor; }
+
+ /** enables handling of not-a-number value.
+
+ When this is set to <FALSE/> (the default), then invalid inputs (i.e. text which cannot be
+ intepreted, according to the current formatting) will be handled as if the default value
+ has been entered. GetValue the will return this default value.
+
+ When set to <TRUE/>, then GetValue will return NaN (not a number, see <method scope="rtl::math">isNan</method>)
+ when the current input is invalid.
+
+ Note that setting this to <TRUE/> implies that upon leaving the control, the input
+ will *not* be corrected to a valid value. For example, if the user enters "foo" in the
+ control, and then tabs out of it, the text "foo" will persist, and GetValue will
+ return NaN in subsequent calls.
+ */
+ void EnableNotANumber( BOOL _bEnable );
+ BOOL IsNotANumberEnabled( ) const { return m_bEnableNaN; }
+
+ /** When being set to true, the strings in the field are formatted using the
+ InputLine format. That's also what you get in Calc when you edit a cell
+ using F2
+ */
+ void UseInputStringForFormatting( bool bUseInputStr = true );
+ bool IsUsingInputStringForFormatting() const;
+
+protected:
+ virtual long Notify(NotifyEvent& rNEvt);
+ virtual void Modify();
+
+ // CheckText ueberschreiben fuer Ueberpruefung zur Eingabezeit
+ virtual BOOL CheckText(const XubString&) const { return TRUE; }
+
+ // any aspect of the current format has changed
+ virtual void FormatChanged(FORMAT_CHANGE_TYPE nWhat);
+
+ void ImplSetTextImpl(const XubString& rNew, Selection* pNewSel);
+ void ImplSetValue(double dValue, BOOL bForce);
+ BOOL ImplGetValue(double& dNewVal);
+
+ void ImplSetFormatKey(ULONG nFormatKey);
+ // SetFormatKey without FormatChanged notification
+
+ virtual SvNumberFormatter* CreateFormatter() { SetFormatter(StandardFormatter()); return m_pFormatter; }
+ SvNumberFormatter* ImplGetFormatter() const { return m_pFormatter ? m_pFormatter : ((FormattedField*)this)->CreateFormatter(); }
+
+ long PreNotify(NotifyEvent& rNEvt);
+
+ virtual void ReFormat();
+};
+
+//------------------------------------------------------------------------------
+class SVT_DLLPUBLIC DoubleNumericField : public FormattedField
+{
+protected:
+#ifdef REGEXP_SUPPORT
+ ::utl::TextSearch* m_pConformanceTester;
+#else
+ validation::NumberValidator* m_pNumberValidator;
+#endif
+
+public:
+ DoubleNumericField(Window* pParent, WinBits nStyle = 0)
+ :FormattedField(pParent, nStyle)
+#ifdef REGEXP_SUPPORT
+ ,m_pConformanceTester( NULL )
+#else
+ ,m_pNumberValidator( NULL )
+#endif
+ {
+ ResetConformanceTester();
+ }
+
+ DoubleNumericField(Window* pParent, const ResId& rResId)
+ :FormattedField(pParent, rResId)
+#ifdef REGEXP_SUPPORT
+ ,m_pConformanceTester( NULL )
+#else
+ ,m_pNumberValidator( NULL )
+#endif
+ {
+ ResetConformanceTester();
+ }
+ virtual ~DoubleNumericField();
+
+protected:
+ virtual BOOL CheckText(const XubString& sText) const;
+
+ virtual void FormatChanged(FORMAT_CHANGE_TYPE nWhat);
+ void ResetConformanceTester();
+};
+
+//==============================================================================
+#define FCT_CURRENCY_SYMBOL 0x10
+#define FCT_CURRSYM_POSITION 0x20
+
+//------------------------------------------------------------------------------
+class DoubleCurrencyField : public FormattedField
+{
+ XubString m_sCurrencySymbol;
+ BOOL m_bPrependCurrSym;
+ BOOL m_bChangingFormat;
+
+public:
+ DoubleCurrencyField(Window* pParent, WinBits nStyle = 0);
+ DoubleCurrencyField(Window* pParent, const ResId& rResId);
+
+ XubString getCurrencySymbol() const { return m_sCurrencySymbol; }
+ void setCurrencySymbol(const XubString& _sSymbol);
+
+ BOOL getPrependCurrSym() const { return m_bPrependCurrSym; }
+ void setPrependCurrSym(BOOL _bPrepend);
+
+protected:
+ virtual void FormatChanged(FORMAT_CHANGE_TYPE nWhat);
+
+ void UpdateCurrencyFormat();
+};
+
+#endif // _FMTFIELD_HXX_
+
diff --git a/svtools/inc/svtools/generictoolboxcontroller.hxx b/svtools/inc/svtools/generictoolboxcontroller.hxx
new file mode 100644
index 000000000000..0e9dc73a6882
--- /dev/null
+++ b/svtools/inc/svtools/generictoolboxcontroller.hxx
@@ -0,0 +1,71 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef __SVTOOLS_GENERICTOOLBOXCONTROLLER_HXX_
+#define __SVTOOLS_GENERICTOOLBOXCONTROLLER_HXX_
+
+//_________________________________________________________________________________________________________________
+// includes of other projects
+//_________________________________________________________________________________________________________________
+
+#include "svtools/svtdllapi.h"
+#include <svtools/toolboxcontroller.hxx>
+#include <vcl/toolbox.hxx>
+
+namespace svt
+{
+
+struct ExecuteInfo;
+class SVT_DLLPUBLIC GenericToolboxController : public svt::ToolboxController
+{
+ public:
+ GenericToolboxController( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager,
+ const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame,
+ ToolBox* pToolBox,
+ USHORT nID,
+ const rtl::OUString& aCommand );
+ virtual ~GenericToolboxController();
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw ( ::com::sun::star::uno::RuntimeException );
+
+ // XToolbarController
+ virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ DECL_STATIC_LINK( GenericToolboxController, ExecuteHdl_Impl, ExecuteInfo* );
+
+ private:
+ ToolBox* m_pToolbox;
+ sal_uInt16 m_nID;
+};
+
+}
+
+#endif // __SVTOOLS_GENERICTOOLBOXCONTROLLER_HXX_
diff --git a/svtools/inc/svtools/genericunodialog.hxx b/svtools/inc/svtools/genericunodialog.hxx
new file mode 100644
index 000000000000..c5fbe5b840e4
--- /dev/null
+++ b/svtools/inc/svtools/genericunodialog.hxx
@@ -0,0 +1,194 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _SVT_GENERICUNODIALOG_HXX_
+#define _SVT_GENERICUNODIALOG_HXX_
+
+#include "svtools/svtdllapi.h"
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/awt/XWindow.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/lang/NotInitializedException.hpp>
+
+#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/propshlp.hxx>
+#include <comphelper/proparrhlp.hxx>
+#include <comphelper/uno3.hxx>
+#include <comphelper/propertycontainer.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <comphelper/componentcontext.hxx>
+#include <tools/link.hxx>
+
+class Dialog;
+class Window;
+class VclWindowEvent;
+
+//.........................................................................
+namespace svt
+{
+//.........................................................................
+
+ //=========================================================================
+#define UNODIALOG_PROPERTY_ID_TITLE 1
+#define UNODIALOG_PROPERTY_ID_PARENT 2
+
+#define UNODIALOG_PROPERTY_TITLE "Title"
+#define UNODIALOG_PROPERTY_PARENT "ParentWindow"
+
+
+ //=========================================================================
+ typedef ::cppu::WeakImplHelper3 < com::sun::star::ui::dialogs::XExecutableDialog
+ , com::sun::star::lang::XServiceInfo
+ , com::sun::star::lang::XInitialization
+ > OGenericUnoDialogBase;
+
+ /** abstract base class for implementing UNO objects representing dialogs (<type scope="com.sun.star.awt">XDialog</type>)
+ */
+ class SVT_DLLPUBLIC OGenericUnoDialog
+ :public OGenericUnoDialogBase
+ ,public ::comphelper::OMutexAndBroadcastHelper
+ ,public ::comphelper::OPropertyContainer
+ {
+ private:
+ ::osl::Mutex m_aExecutionMutex; /// acess safety for execute/cancel
+
+ protected:
+ Dialog* m_pDialog; /// the dialog to execute
+ sal_Bool m_bExecuting : 1; /// we're currently executing the dialog
+ sal_Bool m_bCanceled : 1; /// endDialog was called while we were executing
+ sal_Bool m_bTitleAmbiguous : 1; /// m_sTitle has not been set yet
+ bool m_bInitialized : 1; /// has "initialize" been called?
+ bool m_bNeedInitialization : 1; /// do we need to be initialized before any other API call is allowed?
+
+ // <properties>
+ ::rtl::OUString m_sTitle; /// title of the dialog
+ com::sun::star::uno::Reference<com::sun::star::awt::XWindow> m_xParent; /// parent window
+ // </properties>
+
+ ::comphelper::ComponentContext m_aContext;
+
+ public:
+ inline bool needInitialization() const { return m_bNeedInitialization && !m_bInitialized; }
+
+ protected:
+ OGenericUnoDialog(const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& _rxORB);
+ OGenericUnoDialog(const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& _rxContext);
+ virtual ~OGenericUnoDialog();
+
+ public:
+ // UNO
+ DECLARE_UNO3_DEFAULTS(OGenericUnoDialog, OGenericUnoDialogBase);
+ virtual com::sun::star::uno::Any SAL_CALL queryInterface(const com::sun::star::uno::Type& _rType) throw (com::sun::star::uno::RuntimeException);
+
+ // XTypeProvider
+ virtual com::sun::star::uno::Sequence<com::sun::star::uno::Type> SAL_CALL getTypes( ) throw(com::sun::star::uno::RuntimeException);
+ virtual com::sun::star::uno::Sequence<sal_Int8> SAL_CALL getImplementationId( ) throw(com::sun::star::uno::RuntimeException) = 0;
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName() throw(com::sun::star::uno::RuntimeException) = 0;
+ virtual sal_Bool SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw(com::sun::star::uno::RuntimeException);
+ virtual ::comphelper::StringSequence SAL_CALL getSupportedServiceNames() throw(com::sun::star::uno::RuntimeException) = 0;
+
+ // OPropertySetHelper
+ virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const com::sun::star::uno::Any& rValue ) throw(com::sun::star::uno::Exception);
+ virtual sal_Bool SAL_CALL convertFastPropertyValue( com::sun::star::uno::Any& rConvertedValue, com::sun::star::uno::Any& rOldValue, sal_Int32 nHandle, const com::sun::star::uno::Any& rValue) throw(com::sun::star::lang::IllegalArgumentException);
+
+ // XExecutableDialog
+ virtual void SAL_CALL setTitle( const ::rtl::OUString& aTitle ) throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Int16 SAL_CALL execute( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments ) throw(com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
+
+ protected:
+ /** create the concret dialog instance. note that m_aMutex is not locked when this method get's called,
+ but the application-wide solar mutex is (to guard the not thread-safe ctor of the dialog).
+ @param pParent the parent window for the new dialog
+ */
+ virtual Dialog* createDialog(Window* _pParent) = 0;
+
+ /// called to destroy the dialog used. the default implementation just deletes m_pDialog and resets it to NULL
+ virtual void destroyDialog();
+
+ /** called after the dialog has been executed
+ @param _nExecutionResult the execution result as returned by Dialog::Execute
+ */
+ virtual void executedDialog(sal_Int16 /*_nExecutionResult*/) { }
+
+ /** smaller form of <method>initialize</method>.<p/>
+ The <method>initialize</method> method is called with a sequence of <type scope="com.sun.star.uno">Any</type>'s,
+ which is split up into the single elements, which are passed to implInitialize. The default implementation
+ tries to exract an <type scope="com.sun.star.beans">PropertyValue</type> from the value an pass it to the
+ <type scope="com.sun.star.beans">XPropertySet</type> interface of the object.
+ */
+ virtual void implInitialize(const com::sun::star::uno::Any& _rValue);
+
+ private:
+ DECL_LINK( OnDialogDying, VclWindowEvent* );
+
+ /** ensures that m_pDialog is not <NULL/>
+
+ This method does nothing if m_pDialog is already non-<NULL/>. Else, it calls createDialog and does
+ all necessary initializations of the new dialog instance.
+
+ @precond
+ m_aMutex is locked
+
+ @return
+ <TRUE/> if and only if m_pDialog is non-<NULL/> upon returning from the method. Note that the only
+ case where m_pDialog is <NULL/> is when createDialog returned <NULL/>, which is will fire an assertion
+ in non-product builds.
+ */
+ bool impl_ensureDialog_lck();
+ };
+
+ /// helper class for guarding access to methods of a OGenericUnoDialog
+ class UnoDialogEntryGuard
+ {
+ public:
+ UnoDialogEntryGuard( OGenericUnoDialog& _rDialog )
+ :m_aGuard( _rDialog.GetMutex() )
+ {
+ if ( _rDialog.needInitialization() )
+ throw ::com::sun::star::lang::NotInitializedException();
+ }
+
+ private:
+ ::osl::MutexGuard m_aGuard;
+ };
+
+//.........................................................................
+} // namespace svt
+//.........................................................................
+
+#endif // _SVT_GENERICUNODIALOG_HXX_
+
diff --git a/svtools/inc/svtools/grfmgr.hxx b/svtools/inc/svtools/grfmgr.hxx
new file mode 100644
index 000000000000..3ed608c1525d
--- /dev/null
+++ b/svtools/inc/svtools/grfmgr.hxx
@@ -0,0 +1,571 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _GRFMGR_HXX
+#define _GRFMGR_HXX
+
+#include <vcl/graph.hxx>
+#include <svtools/svtdllapi.h>
+
+// -----------
+// - Defines -
+// -----------
+
+#define GRFMGR_DRAW_NOTCACHED 0x00000000UL
+#define GRFMGR_DRAW_CACHED 0x00000001UL
+#define GRFMGR_DRAW_BILINEAR 0x00000002UL
+#define GRFMGR_DRAW_USE_DRAWMODE_SETTINGS 0x00000004UL
+#define GRFMGR_DRAW_SUBSTITUTE 0x00000008UL
+#define GRFMGR_DRAW_NO_SUBSTITUTE 0x00000010UL
+#define GRFMGR_DRAW_STANDARD (GRFMGR_DRAW_CACHED|GRFMGR_DRAW_BILINEAR)
+
+// --------------------
+// - AutoSwap Defines -
+// --------------------
+
+#define GRFMGR_AUTOSWAPSTREAM_LINK ((SvStream*)0x00000000UL)
+#define GRFMGR_AUTOSWAPSTREAM_LOADED ((SvStream*)0xfffffffdUL)
+#define GRFMGR_AUTOSWAPSTREAM_TEMP ((SvStream*)0xfffffffeUL)
+#define GRFMGR_AUTOSWAPSTREAM_NONE ((SvStream*)0xffffffffUL)
+
+// ----------------------
+// - Adjustment Defines -
+// ----------------------
+
+#define ADJUSTMENT_NONE 0x00000000UL
+#define ADJUSTMENT_DRAWMODE 0x00000001UL
+#define ADJUSTMENT_COLORS 0x00000002UL
+#define ADJUSTMENT_MIRROR 0x00000004UL
+#define ADJUSTMENT_ROTATE 0x00000008UL
+#define ADJUSTMENT_TRANSPARENCY 0x00000010UL
+#define ADJUSTMENT_ALL 0xFFFFFFFFUL
+
+// ---------
+// - Enums -
+// ---------
+
+enum GraphicDrawMode
+{
+ GRAPHICDRAWMODE_STANDARD = 0,
+ GRAPHICDRAWMODE_GREYS = 1,
+ GRAPHICDRAWMODE_MONO = 2,
+ GRAPHICDRAWMODE_WATERMARK = 3
+};
+
+// ------------
+// - Forwards -
+// ------------
+
+class GraphicManager;
+class SvStream;
+class BitmapWriteAccess;
+class GraphicCache;
+class VirtualDevice;
+struct GrfSimpleCacheObj;
+struct ImplTileInfo;
+
+// ---------------
+// - GraphicAttr -
+// ---------------
+
+class SVT_DLLPUBLIC GraphicAttr
+{
+private:
+
+ long mnDummy1;
+ long mnDummy2;
+ double mfGamma;
+ sal_uInt32 mnMirrFlags;
+ long mnLeftCrop;
+ long mnTopCrop;
+ long mnRightCrop;
+ long mnBottomCrop;
+ USHORT mnRotate10;
+ short mnContPercent;
+ short mnLumPercent;
+ short mnRPercent;
+ short mnGPercent;
+ short mnBPercent;
+ BOOL mbInvert;
+ BYTE mcTransparency;
+ GraphicDrawMode meDrawMode;
+
+ void* mpDummy;
+
+public:
+
+ GraphicAttr();
+ ~GraphicAttr();
+
+ BOOL operator==( const GraphicAttr& rAttr ) const;
+ BOOL operator!=( const GraphicAttr& rAttr ) const { return !( *this == rAttr ); }
+
+ void SetDrawMode( GraphicDrawMode eDrawMode ) { meDrawMode = eDrawMode; }
+ GraphicDrawMode GetDrawMode() const { return meDrawMode; }
+
+ void SetMirrorFlags( ULONG nMirrFlags ) { mnMirrFlags = nMirrFlags; }
+ ULONG GetMirrorFlags() const { return mnMirrFlags; }
+
+ void SetCrop( long nLeft_100TH_MM, long nTop_100TH_MM, long nRight_100TH_MM, long nBottom_100TH_MM )
+ {
+ mnLeftCrop = nLeft_100TH_MM; mnTopCrop = nTop_100TH_MM;
+ mnRightCrop = nRight_100TH_MM; mnBottomCrop = nBottom_100TH_MM;
+ }
+ long GetLeftCrop() const { return mnLeftCrop; }
+ long GetTopCrop() const { return mnTopCrop; }
+ long GetRightCrop() const { return mnRightCrop; }
+ long GetBottomCrop() const { return mnBottomCrop; }
+
+ void SetRotation( USHORT nRotate10 ) { mnRotate10 = nRotate10; }
+ USHORT GetRotation() const { return mnRotate10; }
+
+ void SetLuminance( short nLuminancePercent ) { mnLumPercent = nLuminancePercent; }
+ short GetLuminance() const { return mnLumPercent; }
+
+ void SetContrast( short nContrastPercent ) { mnContPercent = nContrastPercent; }
+ short GetContrast() const { return mnContPercent; }
+
+ void SetChannelR( short nChannelRPercent ) { mnRPercent = nChannelRPercent; }
+ short GetChannelR() const { return mnRPercent; }
+
+ void SetChannelG( short nChannelGPercent ) { mnGPercent = nChannelGPercent; }
+ short GetChannelG() const { return mnGPercent; }
+
+ void SetChannelB( short nChannelBPercent ) { mnBPercent = nChannelBPercent; }
+ short GetChannelB() const { return mnBPercent; }
+
+ void SetGamma( double fGamma ) { mfGamma = fGamma; }
+ double GetGamma() const { return mfGamma; }
+
+ void SetInvert( BOOL bInvert ) { mbInvert = bInvert; }
+ BOOL IsInvert() const { return mbInvert; }
+
+ void SetTransparency( BYTE cTransparency ) { mcTransparency = cTransparency; }
+ BYTE GetTransparency() const { return mcTransparency; }
+
+ BOOL IsSpecialDrawMode() const { return( meDrawMode != GRAPHICDRAWMODE_STANDARD ); }
+ BOOL IsMirrored() const { return( mnMirrFlags != 0UL ); }
+ BOOL IsCropped() const
+ {
+ return( mnLeftCrop != 0 || mnTopCrop != 0 ||
+ mnRightCrop != 0 || mnBottomCrop != 0 );
+ }
+ BOOL IsRotated() const { return( ( mnRotate10 % 3600 ) != 0 ); }
+ BOOL IsTransparent() const { return( mcTransparency > 0 ); }
+ BOOL IsAdjusted() const
+ {
+ return( mnLumPercent != 0 || mnContPercent != 0 || mnRPercent != 0 ||
+ mnGPercent != 0 || mnBPercent != 0 || mfGamma != 1.0 || mbInvert );
+ }
+
+ friend SvStream& operator<<( SvStream& rOStm, const GraphicAttr& rAttr );
+ friend SvStream& operator>>( SvStream& rIStm, GraphicAttr& rAttr );
+};
+
+// -----------------
+// - GraphicObject -
+// -----------------
+
+class SVT_DLLPUBLIC GraphicObject : public SvDataCopyStream
+{
+ friend class GraphicManager;
+
+private:
+
+ static GraphicManager* mpGlobalMgr;
+
+ Graphic maGraphic;
+ GraphicAttr maAttr;
+ Size maPrefSize;
+ MapMode maPrefMapMode;
+ ULONG mnSizeBytes;
+ GraphicType meType;
+ GraphicManager* mpMgr;
+ String* mpLink;
+ Link* mpSwapStreamHdl;
+ String* mpUserData;
+ Timer* mpSwapOutTimer;
+ GrfSimpleCacheObj* mpSimpleCache;
+ ULONG mnAnimationLoopCount;
+ void* mpDummy1;
+ void* mpDummy2;
+ BOOL mbAutoSwapped : 1;
+ BOOL mbTransparent : 1;
+ BOOL mbAnimated : 1;
+ BOOL mbEPS : 1;
+ BOOL mbIsInSwapIn : 1;
+ BOOL mbIsInSwapOut : 1;
+ BOOL mbAlpha : 1;
+ BOOL mbDummyFlag8 : 1;
+
+ void SVT_DLLPRIVATE ImplConstruct();
+ void SVT_DLLPRIVATE ImplAssignGraphicData();
+ void SVT_DLLPRIVATE ImplSetGraphicManager( const GraphicManager* pMgr,
+ const ByteString* pID = NULL,
+ const GraphicObject* pCopyObj = NULL );
+ void SVT_DLLPRIVATE ImplAutoSwapIn();
+ BOOL SVT_DLLPRIVATE ImplIsAutoSwapped() const { return mbAutoSwapped; }
+ BOOL SVT_DLLPRIVATE ImplGetCropParams( OutputDevice* pOut, Point& rPt, Size& rSz, const GraphicAttr* pAttr,
+ PolyPolygon& rClipPolyPoly, BOOL& bRectClipRegion ) const;
+
+ /** Render a given number of tiles in an optimized way
+
+ This method recursively subdivides the tile rendering problem
+ in smaller parts, i.e. rendering output size x with few tiles
+ of size y, which in turn are generated from the original
+ bitmap in a recursive fashion. The subdivision size can be
+ controlled by the exponent argument, which specifies the
+ minimal number of smaller tiles used in one recursion
+ step. The resulting tile size is given as the integer number
+ of repetitions of the original bitmap along x and y. As the
+ exponent need not necessarily divide these numbers without
+ remainder, the repetition counts are effectively converted to
+ base-exponent numbers, where each place denotes the number of
+ times the corresponding tile size is rendered.
+
+ @param rVDev
+ Virtual device to render everything into
+
+ @param nExponent
+ Number of repetitions per subdivision step, _must_ be greater than 1
+
+ @param nNumTilesX
+ Number of original tiles to generate in x direction
+
+ @param nNumTilesY
+ Number of original tiles to generate in y direction
+
+ @param rTileSizePixel
+ Size in pixel of the original tile bitmap to render it in
+
+ @param pAttr
+ Graphic attributes to be used for rendering
+
+ @param nFlags
+ Graphic flags to be used for rendering
+
+ @param rCurrPos
+ Current output point for this recursion level (should start with (0,0))
+
+ @return true, if everything was successfully rendered.
+ */
+ bool SVT_DLLPRIVATE ImplRenderTempTile( VirtualDevice& rVDev, int nExponent,
+ int nNumTilesX, int nNumTilesY,
+ const Size& rTileSizePixel,
+ const GraphicAttr* pAttr, ULONG nFlags );
+
+ /// internally called by ImplRenderTempTile()
+ bool SVT_DLLPRIVATE ImplRenderTileRecursive( VirtualDevice& rVDev, int nExponent, int nMSBFactor,
+ int nNumOrigTilesX, int nNumOrigTilesY,
+ int nRemainderTilesX, int nRemainderTilesY,
+ const Size& rTileSizePixel, const GraphicAttr* pAttr,
+ ULONG nFlags, ImplTileInfo& rTileInfo );
+
+ bool SVT_DLLPRIVATE ImplDrawTiled( OutputDevice* pOut, const Rectangle& rArea, const Size& rSizePixel,
+ const Size& rOffset, const GraphicAttr* pAttr, ULONG nFlags, int nTileCacheSize1D );
+
+ bool SVT_DLLPRIVATE ImplDrawTiled( OutputDevice& rOut, const Point& rPos,
+ int nNumTilesX, int nNumTilesY,
+ const Size& rTileSize,
+ const GraphicAttr* pAttr, ULONG nFlags );
+
+ void SVT_DLLPRIVATE ImplTransformBitmap( BitmapEx& rBmpEx,
+ const GraphicAttr& rAttr,
+ const Size& rCropLeftTop,
+ const Size& rCropRightBottom,
+ const Rectangle& rCropRect,
+ const Size& rDstSize,
+ BOOL bEnlarge ) const;
+
+ DECL_LINK( ImplAutoSwapOutHdl, void* );
+
+protected:
+
+ virtual void GraphicManagerDestroyed();
+ virtual SvStream* GetSwapStream() const;
+
+ // !!! to be removed
+ virtual ULONG GetReleaseFromCache() const;
+
+ virtual void Load( SvStream& );
+ virtual void Save( SvStream& );
+ virtual void Assign( const SvDataCopyStream& );
+
+public:
+
+ TYPEINFO();
+
+ GraphicObject( const GraphicManager* pMgr = NULL );
+ GraphicObject( const Graphic& rGraphic, const GraphicManager* pMgr = NULL );
+ GraphicObject( const Graphic& rGraphic, const String& rLink, const GraphicManager* pMgr = NULL );
+ GraphicObject( const GraphicObject& rCacheObj, const GraphicManager* pMgr = NULL );
+ GraphicObject( const ByteString& rUniqueID, const GraphicManager* pMgr = NULL );
+ ~GraphicObject();
+
+ GraphicObject& operator=( const GraphicObject& rCacheObj );
+ BOOL operator==( const GraphicObject& rCacheObj ) const;
+ BOOL operator!=( const GraphicObject& rCacheObj ) const { return !( *this == rCacheObj ); }
+
+ BOOL HasSwapStreamHdl() const { return( mpSwapStreamHdl != NULL && mpSwapStreamHdl->IsSet() ); }
+ void SetSwapStreamHdl();
+ void SetSwapStreamHdl( const Link& rHdl, const ULONG nSwapOutTimeout = 0UL );
+ Link GetSwapStreamHdl() const;
+ ULONG GetSwapOutTimeout() const { return( mpSwapOutTimer ? mpSwapOutTimer->GetTimeout() : 0 ); }
+
+ void FireSwapInRequest();
+ void FireSwapOutRequest();
+
+ void SetGraphicManager( const GraphicManager& rMgr );
+ GraphicManager& GetGraphicManager() const { return *mpMgr; }
+
+ BOOL IsCached( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ const GraphicAttr* pAttr = NULL, ULONG nFlags = GRFMGR_DRAW_STANDARD) const;
+ void ReleaseFromCache();
+
+ const Graphic& GetGraphic() const;
+ void SetGraphic( const Graphic& rGraphic, const GraphicObject* pCopyObj = 0);
+ void SetGraphic( const Graphic& rGraphic, const String& rLink );
+
+ /** Get graphic transformed according to given attributes
+
+ This method returns a Graphic transformed, cropped and scaled
+ to the given parameters, ready to be rendered to printer or
+ display. The returned graphic has the same visual appearance
+ as if it had been drawn via GraphicObject::Draw() to a
+ specific output device.
+
+ @param rDestSize
+ Desired output size in logical coordinates. The mapmode to
+ interpret these logical coordinates in is given by the second
+ parameter, rDestMap.
+
+ @param rDestMap
+ Mapmode the output should be interpreted in. This is used to
+ interpret rDestSize, to set the appropriate PrefMapMode on the
+ returned Graphic, and to deal correctly with metafile graphics.
+
+ @param rAttr
+ Graphic attributes used to transform the graphic. This
+ includes cropping, rotation, mirroring, and various color
+ adjustment parameters.
+
+ @return the readily transformed Graphic
+ */
+ Graphic GetTransformedGraphic( const Size& rDestSize, const MapMode& rDestMap, const GraphicAttr& rAttr ) const;
+ Graphic GetTransformedGraphic( const GraphicAttr* pAttr = NULL ) const; // TODO: Change to Impl
+
+ void SetAttr( const GraphicAttr& rAttr );
+ const GraphicAttr& GetAttr() const { return maAttr; }
+
+ BOOL HasLink() const { return( mpLink != NULL && mpLink->Len() > 0 ); }
+ void SetLink();
+ void SetLink( const String& rLink );
+ String GetLink() const;
+
+ BOOL HasUserData() const { return( mpUserData != NULL && mpUserData->Len() > 0 ); }
+ void SetUserData();
+ void SetUserData( const String& rUserData );
+ String GetUserData() const;
+
+ ByteString GetUniqueID() const;
+
+ GraphicType GetType() const { return meType; }
+ const Size& GetPrefSize() const { return maPrefSize; }
+ const MapMode& GetPrefMapMode() const { return maPrefMapMode; }
+ ULONG GetSizeBytes() const { return mnSizeBytes; }
+ ULONG GetChecksum() const;
+ BOOL IsTransparent() const { return mbTransparent; }
+ BOOL IsAlpha() const { return mbAlpha; }
+ BOOL IsAnimated() const { return mbAnimated; }
+ BOOL IsEPS() const { return mbEPS; }
+
+ void ResetAnimationLoopCount();
+ List* GetAnimationInfoList() const;
+ Link GetAnimationNotifyHdl() const { return maGraphic.GetAnimationNotifyHdl(); }
+ void SetAnimationNotifyHdl( const Link& rLink );
+
+ BOOL SwapOut();
+ BOOL SwapOut( SvStream* pOStm );
+ BOOL SwapIn();
+ BOOL SwapIn( SvStream* pIStm );
+
+ BOOL IsInSwapIn() const { return mbIsInSwapIn; }
+ BOOL IsInSwapOut() const { return mbIsInSwapOut; }
+ BOOL IsInSwap() const { return( mbIsInSwapOut || mbIsInSwapOut ); }
+ BOOL IsSwappedOut() const { return( mbAutoSwapped || maGraphic.IsSwapOut() ); }
+ void SetSwapState();
+
+ BOOL Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ const GraphicAttr* pAttr = NULL, ULONG nFlags = GRFMGR_DRAW_STANDARD );
+
+ BOOL DrawWithPDFHandling( OutputDevice& rOutDev,
+ const Point& rPt, const Size& rSz,
+ const GraphicAttr* pGrfAttr = NULL,
+ const ULONG nFlags = GRFMGR_DRAW_STANDARD );
+
+ /** Draw the graphic repeatedly into the given output rectangle
+
+ @param pOut
+ OutputDevice where the rendering should take place
+
+ @param rArea
+ The output area that is filled with tiled instances of this graphic
+
+ @param rSize
+ The actual size of a single tile
+
+ @param rOffset
+ Offset from the left, top position of rArea, where to start
+ the tiling. The upper left corner of the graphic tilings will
+ virtually start at this position. Concretely, only that many
+ tiles are drawn to completely fill the given output area.
+
+ @param pAttr
+ Optional GraphicAttr
+
+ @param nFlags
+ Optional rendering flags
+
+ @param nTileCacheSize1D
+ Optional dimension of the generated cache tiles. The pOut sees
+ a number of tile draws, which have approximately
+ nTileCacheSize1D times nTileCacheSize1D bitmap sizes if the
+ tile bitmap is smaller. Otherwise, the tile is drawn as
+ is. This is useful if e.g. you want only a few, very large
+ bitmap drawings appear on the outdev.
+
+ @return TRUE, if drawing completed successfully
+ */
+ BOOL DrawTiled( OutputDevice* pOut, const Rectangle& rArea, const Size& rSize,
+ const Size& rOffset, const GraphicAttr* pAttr = NULL,
+ ULONG nFlags = GRFMGR_DRAW_STANDARD, int nTileCacheSize1D=128 );
+
+ BOOL StartAnimation( OutputDevice* pOut, const Point& rPt, const Size& rSz, long nExtraData = 0L,
+ const GraphicAttr* pAttr = NULL, ULONG nFlags = GRFMGR_DRAW_STANDARD,
+ OutputDevice* pFirstFrameOutDev = NULL );
+
+ void StopAnimation( OutputDevice* pOut = NULL, long nExtraData = 0L );
+
+ friend SvStream& operator<<( SvStream& rOStm, const GraphicObject& rGraphicObj );
+ friend SvStream& operator>>( SvStream& rIStm, GraphicObject& rGraphicObj );
+
+ static GraphicObject CreateGraphicObjectFromURL( const ::rtl::OUString &rURL );
+};
+
+// ------------------
+// - GraphicManager -
+// ------------------
+
+class SVT_DLLPUBLIC GraphicManager
+{
+ friend class GraphicObject;
+ friend class GraphicDisplayCacheEntry;
+
+private:
+
+ List maObjList;
+ GraphicCache* mpCache;
+
+ GraphicManager( const GraphicManager& ) {}
+ GraphicManager& operator=( const GraphicManager& ) { return *this; }
+
+ BOOL SVT_DLLPRIVATE ImplDraw( OutputDevice* pOut, const Point& rPt,
+ const Size& rSz, GraphicObject& rObj,
+ const GraphicAttr& rAttr,
+ const ULONG nFlags, BOOL& rCached );
+
+ BOOL SVT_DLLPRIVATE ImplCreateOutput( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ const BitmapEx& rBmpEx, const GraphicAttr& rAttr,
+ const ULONG nFlags, BitmapEx* pBmpEx = NULL );
+ BOOL SVT_DLLPRIVATE ImplCreateOutput( OutputDevice* pOut,
+ const Point& rPt, const Size& rSz,
+ const GDIMetaFile& rMtf, const GraphicAttr& rAttr,
+ const ULONG nFlags, GDIMetaFile& rOutMtf, BitmapEx& rOutBmpEx );
+
+ BOOL SVT_DLLPRIVATE ImplCreateScaled( const BitmapEx& rBmpEx,
+ long* pMapIX, long* pMapFX, long* pMapIY, long* pMapFY,
+ long nStartX, long nEndX, long nStartY, long nEndY,
+ BitmapEx& rOutBmpEx );
+
+ BOOL SVT_DLLPRIVATE ImplCreateRotatedScaled( const BitmapEx& rBmpEx,
+ USHORT nRot10, const Size& rOutSzPix, const Size& rUntSzPix,
+ long* pMapIX, long* pMapFX, long* pMapIY, long* pMapFY,
+ long nStartX, long nEndX, long nStartY, long nEndY,
+ BitmapEx& rOutBmpEx );
+
+ static void SVT_DLLPRIVATE ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, ULONG nAdjustmentFlags );
+ static void SVT_DLLPRIVATE ImplAdjust( GDIMetaFile& rMtf, const GraphicAttr& rAttr, ULONG nAdjustmentFlags );
+ static void SVT_DLLPRIVATE ImplAdjust( Animation& rAnimation, const GraphicAttr& rAttr, ULONG nAdjustmentFlags );
+
+ static void SVT_DLLPRIVATE ImplDraw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ const GDIMetaFile& rMtf, const GraphicAttr& rAttr );
+
+ // Only used by GraphicObject's Ctor's and Dtor's
+ void SVT_DLLPRIVATE ImplRegisterObj( const GraphicObject& rObj, Graphic& rSubstitute,
+ const ByteString* pID = NULL,
+ const GraphicObject* pCopyObj = NULL );
+ void SVT_DLLPRIVATE ImplUnregisterObj( const GraphicObject& rObj );
+ inline BOOL SVT_DLLPRIVATE ImplHasObjects() const { return( maObjList.Count() > 0UL ); }
+
+ // Only used in swap case by GraphicObject
+ void SVT_DLLPRIVATE ImplGraphicObjectWasSwappedOut( const GraphicObject& rObj );
+ BOOL SVT_DLLPRIVATE ImplFillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute );
+ void SVT_DLLPRIVATE ImplGraphicObjectWasSwappedIn( const GraphicObject& rObj );
+
+ ByteString SVT_DLLPRIVATE ImplGetUniqueID( const GraphicObject& rObj ) const;
+
+public:
+
+ GraphicManager( ULONG nCacheSize = 10000000UL, ULONG nMaxObjCacheSize = 2400000UL );
+ ~GraphicManager();
+
+ void SetMaxCacheSize( ULONG nNewCacheSize );
+ ULONG GetMaxCacheSize() const;
+
+ void SetMaxObjCacheSize( ULONG nNewMaxObjSize, BOOL bDestroyGreaterCached = FALSE );
+ ULONG GetMaxObjCacheSize() const;
+
+ ULONG GetUsedCacheSize() const;
+ ULONG GetFreeCacheSize() const;
+
+ void SetCacheTimeout( ULONG nTimeoutSeconds );
+ ULONG GetCacheTimeout() const;
+
+ void ClearCache();
+
+ void ReleaseFromCache( const GraphicObject& rObj );
+
+ BOOL IsInCache( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ const GraphicObject& rObj, const GraphicAttr& rAttr ) const;
+
+ BOOL DrawObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ GraphicObject& rObj, const GraphicAttr& rAttr,
+ const ULONG nFlags, BOOL& rCached );
+};
+
+#endif // _GRFMGR_HXX
+
diff --git a/svtools/inc/svtools/headbar.hxx b/svtools/inc/svtools/headbar.hxx
new file mode 100644
index 000000000000..1ef7687cfb1d
--- /dev/null
+++ b/svtools/inc/svtools/headbar.hxx
@@ -0,0 +1,395 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _HEADBAR_HXX
+#define _HEADBAR_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/link.hxx>
+#include <vcl/window.hxx>
+
+/*************************************************************************
+
+Beschreibung
+============
+
+class HeaderBar
+
+Diese Klasse dient zur Anzeige einer Ueberschiftszeile. Diese kann Texte,
+Images oder beides anzeigen. Man kann die Items in der Groesse aendern,
+verschieben oder anklicken. In vielen Faellen macht es zum Beispiel Sinn,
+dieses Control mit einer SvTabListBox zu verbinden.
+
+--------------------------------------------------------------------------
+
+WinBits
+
+WB_BORDER Oben und unten wird ein Border gezeichnet
+WB_BOTTOMBORDER Unten wird ein Border gezeichnet
+WB_BUTTONSTYLE Die Items sehen aus wie Buttons, ansonsten sind sie flach
+WB_3DLOOK 3D-Darstellung
+WB_DRAG Items koennen verschoben werden
+WB_STDHEADERBAR WB_BUTTONSTYLE | WB_BOTTOMBORDER
+
+--------------------------------------------------------------------------
+
+ItemBits
+
+HIB_LEFT Inhalt wird im Item linksbuendig ausgegeben
+HIB_CENTER Inhalt wird im Item zentriert ausgegeben
+HIB_RIGHT Inhalt wird im Item rechtsbuendig ausgegeben
+HIB_TOP Inhalt wird im Item an der oberen Kante ausgegeben
+HIB_VCENTER Inhalt wird im Item vertikal zentiert ausgegeben
+HIB_BOTTOM Inhalt wird im Item an der unteren Kante ausgegeben
+HIB_LEFTIMAGE Bei Text und Image, wird Image links vom Text ausgegeben
+HIB_RIGHTIMAGE Bei Text und Image, wird Image rechts vom Text ausgegeben
+HIB_FIXED Item laesst sich nicht in der Groesse aendern
+HIB_FIXEDPOS Item laesst sich nicht verschieben
+HIB_CLICKABLE Item laesst sich anklicken
+ (Select-Handler wird erst bei MouseButtonUp gerufen)
+HIB_FLAT Item wird flach dargestellt, auch wenn WB_BUTTONSTYLE gesetzt ist
+HIB_DOWNARROW Es wird ein Pfeil nach unter hinter dem Text ausgegeben,
+ welcher zum Beispiel angezeigt werden sollte, wenn nach
+ diesem Item eine dazugehoerende Liste absteigend sortiert
+ ist. Der Status des Pfeils kann mit SetItemBits()
+ gesetzt/zurueckgesetzt werden.
+HIB_UPARROW Es wird ein Pfeil nach oben hinter dem Text ausgegeben,
+ welcher zum Beispiel angezeigt werden sollte, wenn nach
+ diesem Item eine dazugehoerende Liste aufsteigend sortiert
+ ist.Der Status des Pfeils kann mit SetItemBits()
+ gesetzt/zurueckgesetzt werden.
+HIB_USERDRAW Zu diesem Item wird auch der UserDraw-Handler gerufen.
+HIB_STDSTYLE (HIB_LEFT | HIB_LEFTIMAGE | HIB_VCENTER | HIB_CLICKABLE)
+
+--------------------------------------------------------------------------
+
+Handler
+
+Select() Wird gerufen, wenn Item angeklickt wird. Wenn
+ HIB_CLICKABLE beim Item gesetzt ist und nicht HIB_FLAT,
+ wird der Handler erst im MouseButtonUp-Handler gerufen,
+ wenn die Maus ueber dem Item losgelassen wurde. Dann
+ verhaellt sich der Select-Handler wie bei einem
+ ToolBox-Button.
+DoubleClick() Dieser Handler wird gerufen, wenn ein Item
+ doppelt geklickt wird. Ob das Item oder der
+ Trenner angeklickt wurden, kann mit IsItemMode()
+ abgefragt werden. Wenn ein Trenner doppelt angeklickt
+ wird, sollte normalerweise die optimale Spaltenbreite
+ berechnet werden und diese gesetzt werden.
+StartDrag() Dieser Handler wird gerufen, wenn Draggen gestartet
+ wird, bzw. wenn ein Item angeklickt wurde.
+ In diesem Handler sollte spaetestens mit SetDragSize()
+ die Groesse der Size-Linie gesetzt werden, wenn
+ IsItemMode() FALSE zurueckliefert.
+Drag() Dieser Handler wird gerufen, wenn gedraggt wird. Wenn
+ mit SetDragSize() keine Groesse gesetzt wird, kann
+ dieser Handler dafuer benutzt werden, um die
+ Linie im angrenzenden Fenster selber zu zeichnen. Mit
+ GetDragPos() kann die aktuelle Drag-Position abgefragt
+ werden. Mit IsItemMode() sollte in diesem Fall
+ abgefragt werden, ob auch ein Trenner gedraggt wird.
+EndDrag() Dieser Handler wird gerufen, wenn ein Drag-Vorgang
+ beendet wurde. Wenn im EndDrag-Handler GetCurItemId()
+ 0 zurueckliefert, wurde der Drag-Vorgang abgebrochen.
+ Wenn dies nicht der Fall ist und IsItemMode() FALSE
+ zurueckliefert, sollte von dem gedraggten Item
+ die neue Groesse mit GetItemSize() abgefragt werden
+ und entsprechend im dazugehoerigem Control uebernommen
+ werden. Wenn IsItemMode() TRUE, GetCurItemId() eine Id
+ und IsItemDrag() TRUE zurueckliefert, wurde dieses
+ Item verschoben. Es sollte dann mit GetItemPos() die
+ neue Position abgefragt werden und auch die Daten
+ im dazugehoerigem Control angepasst werden. Ansonsten
+ koennte auch mit GetItemDragPos() die Position abgefragt
+ werden, an welche Stelle das Item verschoben wurde.
+
+
+Weitere Methoden, die fuer die Handler wichtig sind.
+
+GetCurItemId() Liefert die Id vom Item zurueck, fuer welches gerade
+ der Handler gerufen wurde. Liefert nur eine gueltige
+ Id in den Handlern Select(), DoubleClick(), StartDrag(),
+ Drag() und EndDrag(). Im EndDrag-Handler leifert
+ diese Methode die Id vom gedraggten Item zurueck oder
+ 0, wenn der Drag-Vorgang abgebrochen wurde.
+GetItemDragPos() Liefert die Position zurueck, an der ein Item verschoben
+ wird bzw. wurde. HEADERBAR_ITEM_NOTFOUND wird
+ zurueckgeliefert, wenn der Vorgang abgebrochen wurde
+ oder wenn kein ItemDrag aktiv ist.
+IsItemMode() Mit dieser Methode kann abgefragt werden, ob fuer ein
+ Item oder einen Trenner der Handler gerufen wurde.
+ TRUE - Handler wurde fuer das Item gerufen
+ FALSE - Handler wurde fuer den Trenner gerufen
+IsItemDrag() Mit dieser Methode kann abgefragt werden, ob ein
+ Item gedragt oder selektiert wurde.
+ TRUE - Item wird verschoben
+ FALSE - Item wird selektiert
+SetDragSize() Mit dieser Methode wird gesetzt, wir gross der
+ Trennstrich sein soll, der vom Control gemalt wird.
+ Dies sollte so gross sein, wie das angrenzende Fenster
+ hoch ist. Die Hoehe vom HeaderBar wird automatisch
+ dazugerechnet.
+
+--------------------------------------------------------------------------
+
+Weitere Methoden
+
+SetOffset() Mit dieser Methode wird der Offset gesetzt, ab dem
+ die Items ausgegeben werden. Dies wird benoetigt,
+ wenn das dazugehoerige Fenster gescrollt wird.
+CalcWindowSizePixel() Mit dieser Methode kann man die Hoehe des Fensters
+ berechnen, damit der Inhalt der Items ausgegeben
+ werden kann.
+
+--------------------------------------------------------------------------
+
+Tips und Tricks:
+
+1) KontextMenu
+Wenn ein kontextsensitives PopupMenu anzeigt werden soll, muss der
+Command-Handler ueberlagert werden. Mit GetItemId() und bei
+Uebergabe der Mausposition kann ermittelt werden, ob der Mausclick
+ueber einem bzw. ueber welchem Item durchgefuehrt wurde.
+
+2) Letztes Item
+Wenn man ButtonStyle gesetzt hat, sieht es besser aus, wenn man am
+Ende noch ein leeres Item setzt, was den restlichen Platz einnimmt.
+Dazu fuegt man ein Item mit einem leeren String ein und uebergibt als
+Groesse HEADERBAR_FULLSIZE. Bei diesem Item sollte man dann auch
+nicht HIB_CLICKABLE setzen und dafuer HIB_FIXEDPOS.
+
+*************************************************************************/
+
+class Accelerator;
+class ImplHeadItemList;
+
+// -----------
+// - WinBits -
+// -----------
+
+#define WB_BOTTOMBORDER ((WinBits)0x0400)
+#define WB_BUTTONSTYLE ((WinBits)0x0800)
+#define WB_STDHEADERBAR (WB_BUTTONSTYLE | WB_BOTTOMBORDER)
+
+// ---------------------
+// - HeaderBarItemBits -
+// ---------------------
+
+typedef USHORT HeaderBarItemBits;
+
+// ----------------------------
+// - Bits fuer HeaderBarItems -
+// ----------------------------
+
+#define HIB_LEFT ((HeaderBarItemBits)0x0001)
+#define HIB_CENTER ((HeaderBarItemBits)0x0002)
+#define HIB_RIGHT ((HeaderBarItemBits)0x0004)
+#define HIB_TOP ((HeaderBarItemBits)0x0008)
+#define HIB_VCENTER ((HeaderBarItemBits)0x0010)
+#define HIB_BOTTOM ((HeaderBarItemBits)0x0020)
+#define HIB_LEFTIMAGE ((HeaderBarItemBits)0x0040)
+#define HIB_RIGHTIMAGE ((HeaderBarItemBits)0x0080)
+#define HIB_FIXED ((HeaderBarItemBits)0x0100)
+#define HIB_FIXEDPOS ((HeaderBarItemBits)0x0200)
+#define HIB_CLICKABLE ((HeaderBarItemBits)0x0400)
+#define HIB_FLAT ((HeaderBarItemBits)0x0800)
+#define HIB_DOWNARROW ((HeaderBarItemBits)0x1000)
+#define HIB_UPARROW ((HeaderBarItemBits)0x2000)
+#define HIB_USERDRAW ((HeaderBarItemBits)0x4000)
+#define HIB_STDSTYLE (HIB_LEFT | HIB_LEFTIMAGE | HIB_VCENTER | HIB_CLICKABLE)
+
+// -------------------
+// - HeaderBar-Types -
+// -------------------
+
+#define HEADERBAR_APPEND ((USHORT)0xFFFF)
+#define HEADERBAR_ITEM_NOTFOUND ((USHORT)0xFFFF)
+#define HEADERBAR_FULLSIZE ((long)1000000000)
+
+#define HEADERBAR_TEXTOFF 2
+
+// -------------
+// - HeaderBar -
+// -------------
+
+class SVT_DLLPUBLIC HeaderBar : public Window
+{
+private:
+ ImplHeadItemList* mpItemList;
+ long mnBorderOff1;
+ long mnBorderOff2;
+ long mnOffset;
+ long mnDX;
+ long mnDY;
+ long mnDragSize;
+ long mnStartPos;
+ long mnDragPos;
+ long mnMouseOff;
+ USHORT mnCurItemId;
+ USHORT mnItemDragPos;
+ BOOL mbDragable;
+ BOOL mbDrag;
+ BOOL mbItemDrag;
+ BOOL mbOutDrag;
+ BOOL mbButtonStyle;
+ BOOL mbItemMode;
+ Link maStartDragHdl;
+ Link maDragHdl;
+ Link maEndDragHdl;
+ Link maSelectHdl;
+ Link maDoubleClickHdl;
+ Link maCreateAccessibleHdl;
+
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible >
+ mxAccessible;
+
+#ifdef _SV_HEADBAR_CXX
+ using Window::ImplInit;
+ SVT_DLLPRIVATE void ImplInit( WinBits nWinStyle );
+ SVT_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
+ SVT_DLLPRIVATE long ImplGetItemPos( USHORT nPos ) const;
+ SVT_DLLPRIVATE Rectangle ImplGetItemRect( USHORT nPos ) const;
+ using Window::ImplHitTest;
+ SVT_DLLPRIVATE USHORT ImplHitTest( const Point& rPos, long& nMouseOff, USHORT& nPos ) const;
+ SVT_DLLPRIVATE void ImplInvertDrag( USHORT nStartPos, USHORT nEndPos );
+ SVT_DLLPRIVATE void ImplDrawItem( OutputDevice* pDev,
+ USHORT nPos, BOOL bHigh, BOOL bDrag,
+ const Rectangle& rItemRect,
+ const Rectangle* pRect,
+ ULONG nFlags );
+ SVT_DLLPRIVATE void ImplDrawItem( USHORT nPos, BOOL bHigh = FALSE,
+ BOOL bDrag = FALSE,
+ const Rectangle* pRect = NULL );
+ SVT_DLLPRIVATE void ImplUpdate( USHORT nPos,
+ BOOL bEnd = FALSE, BOOL bDirect = FALSE );
+ SVT_DLLPRIVATE void ImplStartDrag( const Point& rPos, BOOL bCommand );
+ SVT_DLLPRIVATE void ImplDrag( const Point& rPos );
+ SVT_DLLPRIVATE void ImplEndDrag( BOOL bCancel );
+#endif
+
+public:
+ HeaderBar( Window* pParent, WinBits nWinBits = WB_STDHEADERBAR );
+ HeaderBar( Window* pParent, const ResId& rResId );
+ ~HeaderBar();
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void Tracking( const TrackingEvent& rTEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Resize();
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual void UserDraw( const UserDrawEvent& rUDEvt );
+ virtual void StartDrag();
+ virtual void Drag();
+ virtual void EndDrag();
+ virtual void Select();
+ virtual void DoubleClick();
+
+ void InsertItem( USHORT nItemId, const Image& rImage,
+ long nSize, HeaderBarItemBits nBits = HIB_STDSTYLE,
+ USHORT nPos = HEADERBAR_APPEND );
+ void InsertItem( USHORT nItemId, const XubString& rText,
+ long nSize, HeaderBarItemBits nBits = HIB_STDSTYLE,
+ USHORT nPos = HEADERBAR_APPEND );
+ void InsertItem( USHORT nItemId,
+ const Image& rImage, const XubString& rText,
+ long nSize, HeaderBarItemBits nBits = HIB_STDSTYLE,
+ USHORT nPos = HEADERBAR_APPEND );
+ void RemoveItem( USHORT nItemId );
+ void MoveItem( USHORT nItemId, USHORT nNewPos );
+ void Clear();
+
+ void SetOffset( long nNewOffset = 0 );
+ long GetOffset() const { return mnOffset; }
+ inline void SetDragSize( long nNewSize = 0 ) { mnDragSize = nNewSize; }
+ long GetDragSize() const { return mnDragSize; }
+
+ USHORT GetItemCount() const;
+ USHORT GetItemPos( USHORT nItemId ) const;
+ USHORT GetItemId( USHORT nPos ) const;
+ USHORT GetItemId( const Point& rPos ) const;
+ Rectangle GetItemRect( USHORT nItemId ) const;
+ USHORT GetCurItemId() const { return mnCurItemId; }
+ long GetDragPos() const { return mnDragPos; }
+ USHORT GetItemDragPos() const { return mnItemDragPos; }
+ BOOL IsItemMode() const { return mbItemMode; }
+ BOOL IsItemDrag() const { return mbItemDrag; }
+
+ void SetItemSize( USHORT nItemId, long nNewSize );
+ long GetItemSize( USHORT nItemId ) const;
+ void SetItemBits( USHORT nItemId, HeaderBarItemBits nNewBits );
+ HeaderBarItemBits GetItemBits( USHORT nItemId ) const;
+ void SetItemData( USHORT nItemId, void* pNewData );
+ void* GetItemData( USHORT nItemId ) const;
+
+ void SetItemImage( USHORT nItemId, const Image& rImage );
+ Image GetItemImage( USHORT nItemId ) const;
+ void SetItemText( USHORT nItemId, const XubString& rText );
+ XubString GetItemText( USHORT nItemId ) const;
+
+ void SetHelpText( USHORT nItemId, const XubString& rText );
+ XubString GetHelpText( USHORT nItemId ) const;
+ void SetHelpId( USHORT nItemId, ULONG nHelpId );
+ ULONG GetHelpId( USHORT nItemId ) const;
+
+ Size CalcWindowSizePixel() const;
+
+ inline void SetHelpText( const String& rText ) { Window::SetHelpText( rText ); }
+ inline const String& GetHelpText() const { return Window::GetHelpText(); }
+ inline void SetHelpId( ULONG nId ) { Window::SetHelpId( nId ); }
+ inline ULONG GetHelpId() const { return Window::GetHelpId(); }
+
+ inline void SetStartDragHdl( const Link& rLink ) { maStartDragHdl = rLink; }
+ inline const Link& GetStartDragHdl() const { return maStartDragHdl; }
+ inline void SetDragHdl( const Link& rLink ) { maDragHdl = rLink; }
+ inline const Link& GetDragHdl() const { return maDragHdl; }
+ inline void SetEndDragHdl( const Link& rLink ) { maEndDragHdl = rLink; }
+ inline const Link& GetEndDragHdl() const { return maEndDragHdl; }
+ inline void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ inline const Link& GetSelectHdl() const { return maSelectHdl; }
+ inline void SetDoubleClickHdl( const Link& rLink ) { maDoubleClickHdl = rLink; }
+ inline const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
+ inline void SetCreateAccessibleHdl( const Link& rLink ) { maCreateAccessibleHdl = rLink; }
+ inline const Link& GetCreateAccessibleHdl() const { return maCreateAccessibleHdl; }
+
+ inline BOOL IsDragable() const { return mbDragable; }
+
+ /** Creates and returns the accessible object of the header bar. */
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible > CreateAccessible();
+ void SetAccessible( ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > );
+};
+
+#endif // _HEADBAR_HXX
+
diff --git a/svtools/inc/svtools/helpid.hrc b/svtools/inc/svtools/helpid.hrc
new file mode 100644
index 000000000000..1ffb7a99fb32
--- /dev/null
+++ b/svtools/inc/svtools/helpid.hrc
@@ -0,0 +1,117 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _SVT_HELPID_HRC
+#define _SVT_HELPID_HRC
+
+// include ---------------------------------------------------------------
+
+#include <svl/solar.hrc>
+
+// Help-Ids --------------------------------------------------------------
+
+#define HID_FILEDLG_OPENDLG (HID_SVTOOLS_START + 0)
+#define HID_FILEDLG_PATHDLG (HID_SVTOOLS_START + 1)
+#define HID_FILEDLG_DIR (HID_SVTOOLS_START + 2)
+#define HID_FILEDLG_EDIT (HID_SVTOOLS_START + 3)
+#define HID_FILEDLG_DIRS (HID_SVTOOLS_START + 4)
+#define HID_FILEDLG_DRIVE (HID_SVTOOLS_START + 5)
+#define HID_FILEDLG_DRIVES (HID_SVTOOLS_START + 6)
+#define HID_FILEDLG_NEWDIR (HID_SVTOOLS_START + 7)
+#define HID_FILEDLG_HOME (HID_SVTOOLS_START + 8)
+#define HID_FILEDLG_FILE (HID_SVTOOLS_START + 9)
+#define HID_FILEDLG_FILES (HID_SVTOOLS_START + 10)
+#define HID_FILEDLG_PATH (HID_SVTOOLS_START + 11)
+#define HID_FILEDLG_TYPE (HID_SVTOOLS_START + 12)
+#define HID_FILEDLG_TYPES (HID_SVTOOLS_START + 13)
+
+// HelpID's fuer die Textkomponente
+#define HID_TEXTCPNT_OPEN_LINK (HID_SVTOOLS_START + 14)
+#define HID_TEXTCPNT_OPEN_LINK_NEW (HID_SVTOOLS_START + 15)
+#define HID_TEXTCPNT_DOWNLOAD (HID_SVTOOLS_START + 16)
+#define HID_TEXTCPNT_ADD_BOOKMARK (HID_SVTOOLS_START + 17)
+#define HID_TEXTCPNT_COPY_LINK (HID_SVTOOLS_START + 18)
+
+// HelpID's fuer RegisterDialog
+#define HID_LIMITED_DIALOG (HID_SVTOOLS_START + 20)
+
+// Help ids of template dialog
+#define HID_TEMPLATEDLG_DIALOG (HID_SVTOOLS_START + 21)
+#define HID_TEMPLATEDLG_ICONCTRL (HID_SVTOOLS_START + 22)
+#define HID_TEMPLATEDLG_FILEVIEW (HID_SVTOOLS_START + 23)
+#define HID_TEMPLATEDLG_TB_BACK (HID_SVTOOLS_START + 24)
+#define HID_TEMPLATEDLG_TB_PREV (HID_SVTOOLS_START + 25)
+#define HID_TEMPLATEDLG_TB_PRINT (HID_SVTOOLS_START + 26)
+#define HID_TEMPLATEDLG_TB_DOCINFO (HID_SVTOOLS_START + 27)
+#define HID_TEMPLATEDLG_TB_PREVIEW (HID_SVTOOLS_START + 28)
+
+#define HID_ADDRTEMPL_FIELD_ASSIGNMENT (HID_SVTOOLS_START + 29)
+
+// Help ids for the filepicker dialogs
+#define HID_EXPLORERDLG_FILE (HID_SVTOOLS_START + 30)
+
+// help ids for fileview contextmenu
+#define HID_FILEVIEW_MENU_DELETE (HID_SVTOOLS_START + 31)
+#define HID_FILEVIEW_MENU_RENAME (HID_SVTOOLS_START + 32)
+
+// help ids for the different modi of the file picker dialog
+ // FREE
+#define HID_FILESAVE_LEVELUP (HID_SVTOOLS_START + 34)
+#define HID_FILESAVE_CREATEDIRECTORY (HID_SVTOOLS_START + 35)
+#define HID_FILESAVE_DEFAULTDIRECTORY (HID_SVTOOLS_START + 36)
+#define HID_FILESAVE_FILEVIEW (HID_SVTOOLS_START + 37)
+#define HID_FILESAVE_TEMPLATE (HID_SVTOOLS_START + 38)
+#define HID_FILESAVE_FILEURL (HID_SVTOOLS_START + 39)
+#define HID_FILESAVE_FILETYPE (HID_SVTOOLS_START + 40)
+#define HID_FILESAVE_DOSAVE (HID_SVTOOLS_START + 41)
+#define HID_FILESAVE_AUTOEXTENSION (HID_SVTOOLS_START + 42)
+#define HID_FILESAVE_SAVEWITHPASSWORD (HID_SVTOOLS_START + 43)
+#define HID_FILESAVE_CUSTOMIZEFILTER (HID_SVTOOLS_START + 44)
+#define HID_FILESAVE_SELECTION (HID_SVTOOLS_START + 45)
+#define HID_FILESAVE_DIALOG (HID_SVTOOLS_START + 46)
+#define HID_FILESAVE_DOPLAY (HID_SVTOOLS_START + 47)
+
+#define HID_FILEOPEN_READONLY (HID_SVTOOLS_START + 48)
+#define HID_FILEOPEN_VERSION (HID_SVTOOLS_START + 49)
+#define HID_FILEOPEN_IMAGE_TEMPLATE (HID_SVTOOLS_START + 50)
+
+#define HID_FILEDLG_LINK_CB (HID_SFX_START + 276)
+#define HID_FILEDLG_PREVIEW_CB (HID_SFX_START + 277)
+
+// uniqueid for the helpagent window (testtool)
+#define HID_HELPAGENT_WINDOW (HID_SVTOOLS_START + 51)
+
+// registration dialog
+#define HID_REGISTRATION_DIALOG (HID_SVTOOLS_START + 52)
+
+#define HID_PRINTDIALOG_TOFILE (HID_SVTOOLS_START + 53)
+
+#define HID_WIZARD_NEXT (HID_SVTOOLS_START + 54)
+#define HID_WIZARD_PREVIOUS (HID_SVTOOLS_START + 55)
+
+#endif
+
diff --git a/svtools/inc/svtools/helpopt.hxx b/svtools/inc/svtools/helpopt.hxx
new file mode 100644
index 000000000000..974c6c85fa38
--- /dev/null
+++ b/svtools/inc/svtools/helpopt.hxx
@@ -0,0 +1,96 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_SVTOOLS_HELPOPT_HXX
+#define INCLUDED_SVTOOLS_HELPOPT_HXX
+
+#include "svtools/svtdllapi.h"
+
+#ifndef INCLUDED_LIST
+#include <list>
+#define INCLUDED_LIST
+#endif
+#include <tools/string.hxx>
+#include <unotools/options.hxx>
+
+typedef std::list< sal_Int32 > IdList;
+
+class SvtHelpOptions_Impl;
+
+class SVT_DLLPUBLIC SvtHelpOptions: public utl::detail::Options
+{
+ SvtHelpOptions_Impl* pImp;
+
+public:
+ SvtHelpOptions();
+ virtual ~SvtHelpOptions();
+
+ void SetExtendedHelp( sal_Bool b );
+ sal_Bool IsExtendedHelp() const;
+ void SetHelpTips( sal_Bool b );
+ sal_Bool IsHelpTips() const;
+
+ void SetHelpAgentAutoStartMode( sal_Bool b );
+ sal_Bool IsHelpAgentAutoStartMode() const;
+ void SetHelpAgentTimeoutPeriod( sal_Int32 _nSeconds );
+ sal_Int32 GetHelpAgentTimeoutPeriod( ) const;
+ void SetHelpAgentRetryLimit( sal_Int32 _nTrials );
+ sal_Int32 GetHelpAgentRetryLimit( ) const;
+
+ const String& GetHelpStyleSheet()const;
+ void SetHelpStyleSheet(const String& rStyleSheet);
+
+ /** retrieves the help agent's ignore counter for the given URL.
+ <p> If the counter returned 0, the agent should silently drop any requests for this URL.<br/>
+ If the counter is greater 0, the agent should display the URL and, if the user ignores it,
+ decrement the counter by 1.
+ </p>
+ */
+ sal_Int32 getAgentIgnoreURLCounter( const ::rtl::OUString& _rURL );
+ /** decrements the help agent's ignore counter for the given URL
+ @see getAgentIgnoreURLCounter
+ */
+ void decAgentIgnoreURLCounter( const ::rtl::OUString& _rURL );
+ /** resets the help agent's ignore counter for the given URL
+ */
+ void resetAgentIgnoreURLCounter( const ::rtl::OUString& _rURL );
+ /** resets the help agent's ignore counter for all URL's
+ */
+ void resetAgentIgnoreURLCounter();
+
+ void SetWelcomeScreen( sal_Bool b );
+ sal_Bool IsWelcomeScreen() const;
+
+ IdList* GetPIStarterList();
+ void AddToPIStarterList( sal_Int32 nId );
+ void RemoveFromPIStarterList( sal_Int32 nId );
+
+ String GetLocale() const;
+ String GetSystem() const;
+};
+
+#endif
+
diff --git a/svtools/inc/svtools/htmlcfg.hxx b/svtools/inc/svtools/htmlcfg.hxx
new file mode 100644
index 000000000000..c27df0a9a67f
--- /dev/null
+++ b/svtools/inc/svtools/htmlcfg.hxx
@@ -0,0 +1,107 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+#ifndef _SVX_HTMLCFG_HXX
+#define _SVX_HTMLCFG_HXX
+
+// -----------------------------------------------------------------------
+
+#include <tools/solar.h>
+#include <unotools/configitem.hxx>
+#include <svtools/svtdllapi.h>
+
+#define HTML_FONT_COUNT 7
+
+// !!!be aware!!!: the following defines are _not_ used as values in the configuration file
+// this is because of compatibility reasons
+#define HTML_CFG_HTML32 0 // Html 3.2
+#define HTML_CFG_MSIE_40 1 // Internet Explorer 4.0
+#define HTML_CFG_MSIE HTML_CFG_MSIE_40
+#define HTML_CFG_WRITER 2 // Writer
+#define HTML_CFG_NS40 3 // Netscape 4.0
+#define HTML_CFG_MSIE_40_OLD 4 // Internet Explorer 4.0 - alter Wert
+
+#define HTML_CFG_MAX HTML_CFG_NS40
+
+class Link;
+struct HtmlOptions_Impl;
+// -----------------------------------------------------------------------
+
+class SVT_DLLPUBLIC SvxHtmlOptions : public utl::ConfigItem
+{
+ HtmlOptions_Impl*pImp;
+ const com::sun::star::uno::Sequence<rtl::OUString>& GetPropertyNames();
+ void Load( const com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames );
+ void CallListeners();
+
+public:
+ SvxHtmlOptions();
+ ~SvxHtmlOptions();
+
+ virtual void Commit();
+ virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& _rPropertyNames);
+
+ USHORT GetFontSize(USHORT nPos) const;
+ void SetFontSize(USHORT nPos, USHORT nSize);
+
+ BOOL IsImportUnknown() const;
+ void SetImportUnknown(BOOL bSet);
+
+ USHORT GetExportMode() const;
+ void SetExportMode(USHORT nSet);
+
+ BOOL IsStarBasic() const;
+ void SetStarBasic(BOOL bSet);
+
+ BOOL IsStarBasicWarning() const;
+ void SetStarBasicWarning(BOOL bSet);
+
+ BOOL IsSaveGraphicsLocal() const;
+ void SetSaveGraphicsLocal(BOOL bSet);
+
+ BOOL IsPrintLayoutExtension() const;
+ void SetPrintLayoutExtension(BOOL bSet);
+
+ BOOL IsIgnoreFontFamily() const;
+ void SetIgnoreFontFamily(BOOL bSet);
+
+ sal_Bool IsDefaultTextEncoding() const;
+ rtl_TextEncoding GetTextEncoding() const;
+ void SetTextEncoding( rtl_TextEncoding );
+ static SvxHtmlOptions* Get();
+
+ BOOL IsNumbersEnglishUS() const;
+ void SetNumbersEnglishUS(BOOL bSet);
+
+ void AddListenerLink( const Link& rLink );
+ void RemoveListenerLink( const Link& rLink );
+};
+
+#endif
+
+
+
+
diff --git a/svtools/inc/svtools/htmlout.hxx b/svtools/inc/svtools/htmlout.hxx
new file mode 100644
index 000000000000..888286b231ee
--- /dev/null
+++ b/svtools/inc/svtools/htmlout.hxx
@@ -0,0 +1,125 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _HTMLOUT_HXX
+#define _HTMLOUT_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/solar.h>
+#include <rtl/textenc.h>
+#include <svl/macitem.hxx>
+
+class Color;
+class ImageMap;
+class String;
+class SvStream;
+class SvxMacroTableDtor;
+class SvNumberFormatter;
+class SvDataObject;
+
+struct HTMLOutEvent
+{
+ const sal_Char *pBasicName;
+ const sal_Char *pJavaName;
+ USHORT nEvent;
+};
+
+struct SVT_DLLPUBLIC HTMLOutContext
+{
+ rtl_TextEncoding m_eDestEnc;
+ rtl_TextToUnicodeConverter m_hConv;
+ rtl_TextToUnicodeContext m_hContext;
+
+ HTMLOutContext( rtl_TextEncoding eDestEnc );
+ ~HTMLOutContext();
+};
+
+struct HTMLOutFuncs
+{
+#if defined(MAC) || defined(UNX)
+ static const sal_Char sNewLine; // nur \012 oder \015
+#else
+ static const sal_Char __FAR_DATA sNewLine[]; // \015\012
+#endif
+
+ SVT_DLLPUBLIC static void ConvertStringToHTML( const String& sSrc, ByteString& rDest,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+ String *pNonConvertableChars = 0);
+
+ SVT_DLLPUBLIC static SvStream& Out_AsciiTag( SvStream&, const sal_Char* pStr,
+ BOOL bOn = TRUE,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252);
+ SVT_DLLPUBLIC static SvStream& Out_Char( SvStream&, sal_Unicode cChar,
+ HTMLOutContext& rContext,
+ String *pNonConvertableChars = 0 );
+ SVT_DLLPUBLIC static SvStream& Out_String( SvStream&, const String&,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+ String *pNonConvertableChars = 0 );
+ SVT_DLLPUBLIC static SvStream& Out_Hex( SvStream&, ULONG nHex, BYTE nLen,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252 );
+ SVT_DLLPUBLIC static SvStream& Out_Color( SvStream&, const Color&,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252 );
+ SVT_DLLPUBLIC static SvStream& Out_ImageMap( SvStream&, const String&, const ImageMap&, const String&,
+ const HTMLOutEvent *pEventTable,
+ BOOL bOutStarBasic,
+ const sal_Char *pDelim = 0,
+ const sal_Char *pIndentArea = 0,
+ const sal_Char *pIndentMap = 0,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+ String *pNonConvertableChars = 0 );
+ SVT_DLLPUBLIC static SvStream& FlushToAscii( SvStream&, HTMLOutContext& rContext );
+
+ SVT_DLLPUBLIC static SvStream& OutScript( SvStream& rStrm,
+ const String& rBaseURL,
+ const String& rSource,
+ const String& rLanguage,
+ ScriptType eScriptType,
+ const String& rSrc,
+ const String *pSBLibrary = 0,
+ const String *pSBModule = 0,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+ String *pNonConvertableChars = 0 );
+
+ // der 3. Parameter ist ein Array von HTMLOutEvents, das mit einem
+ // nur aus 0 bestehen Eintrag terminiert ist.
+ SVT_DLLPUBLIC static SvStream& Out_Events( SvStream&, const SvxMacroTableDtor&,
+ const HTMLOutEvent*, BOOL bOutStarBasic,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+ String *pNonConvertableChars = 0 );
+
+ // <TD SDVAL="..." SDNUM="...">
+ SVT_DLLPUBLIC static ByteString& CreateTableDataOptionsValNum( ByteString& aStrTD,
+ BOOL bValue, double fVal, ULONG nFormat,
+ SvNumberFormatter& rFormatter,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+ String *pNonConvertableChars = 0 );
+
+ SVT_DLLPUBLIC static BOOL PrivateURLToInternalImg( String& rURL );
+};
+
+#endif
+
diff --git a/svtools/inc/svtools/hyperlabel.hxx b/svtools/inc/svtools/hyperlabel.hxx
new file mode 100644
index 000000000000..926b11c5537c
--- /dev/null
+++ b/svtools/inc/svtools/hyperlabel.hxx
@@ -0,0 +1,98 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+#ifndef SVTOOLS_HYPERLABEL_HXX
+#define SVTOOLS_HYPERLABEL_HXX
+
+#include <vcl/event.hxx>
+
+
+#include <vcl/fixed.hxx>
+
+#define LABELBASEMAPHEIGHT 8
+
+
+//.........................................................................
+namespace svt
+{
+//.........................................................................
+
+ class HyperLabelImpl;
+
+ class HyperLabel : public FixedText
+ {
+ protected:
+ HyperLabelImpl* m_pImpl;
+ Link maClickHdl;
+
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void GetFocus();
+ virtual void LoseFocus();
+
+ void DeactivateHyperMode(Font aFont, const Color aColor);
+ void ActivateHyperMode(Font aFont, const Color aColor);
+
+ protected:
+ void implInit();
+
+ public:
+ HyperLabel( Window* _pParent, const ResId& _rId );
+ HyperLabel( Window* _pParent, WinBits _nWinStyle = 0 );
+ ~HyperLabel( );
+
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ void SetID( sal_Int16 _ID );
+ sal_Int16 GetID() const;
+
+ void SetIndex( sal_Int32 _Index );
+ sal_Int32 GetIndex() const;
+
+ void SetLabel( const ::rtl::OUString& _rText );
+ sal_Int32 GetLogicWidth();
+
+ ::rtl::OUString GetLabel( );
+
+ void ToggleBackgroundColor( const Color& _rGBColor );
+ void SetInteractive( sal_Bool _bInteractive );
+
+ void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
+ const Link& GetClickHdl() const { return maClickHdl; }
+
+ Size CalcMinimumSize( long nMaxWidth = 0 ) const;
+
+ private:
+
+ DECL_LINK(ImplClickHdl, HyperLabel*);
+
+ private:
+ using FixedText::CalcMinimumSize;
+ };
+}
+
+#endif
+
diff --git a/svtools/inc/svtools/imap.hxx b/svtools/inc/svtools/imap.hxx
new file mode 100644
index 000000000000..52212e365c87
--- /dev/null
+++ b/svtools/inc/svtools/imap.hxx
@@ -0,0 +1,171 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _IMAP_HXX
+#define _IMAP_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/string.hxx>
+#include <tools/stream.hxx>
+
+class Point;
+class Rectangle;
+class Size;
+class Fraction;
+class IMapObject;
+
+/******************************************************************************
+|*
+|*
+|*
+\******************************************************************************/
+
+class SVT_DLLPUBLIC ImageMap
+{
+ List maList;
+ String aName;
+
+protected:
+
+ // Binaer laden/speichern
+ void ImpWriteImageMap( SvStream& rOStm, const String& ) const ;
+ void ImpReadImageMap( SvStream& rIStm, USHORT nCount, const String& );
+
+ // Im-/Export
+ void ImpWriteCERN( SvStream& rOStm, const String& rBaseURL ) const;
+ void ImpWriteNCSA( SvStream& rOStm, const String& rBaseURL ) const;
+ ULONG ImpReadCERN( SvStream& rOStm, const String& rBaseURL );
+ ULONG ImpReadNCSA( SvStream& rOStm, const String& rBaseURL );
+
+ void ImpReadCERNLine( const ByteString& rLine, const String& rBaseURL );
+ Point ImpReadCERNCoords( const char** ppStr );
+ long ImpReadCERNRadius( const char** ppStr );
+ String ImpReadCERNURL( const char** ppStr, const String& rBaseURL );
+
+ void ImpReadNCSALine( const ByteString& rLine, const String& rBaseURL );
+ String ImpReadNCSAURL( const char** ppStr, const String& rBaseURL );
+ Point ImpReadNCSACoords( const char** ppStr );
+
+ ULONG ImpDetectFormat( SvStream& rIStm );
+
+public:
+
+ TYPEINFO();
+
+ ImageMap() {};
+ ImageMap( const String& rName );
+ ImageMap( const ImageMap& rImageMap );
+
+ // Der Dtor gibt den intern belegten
+ // Speicher wieder frei;
+ // alle IMapObjekte werden im Dtor zerstoert;
+ virtual ~ImageMap();
+
+ // Zuweisungsoperator
+ ImageMap& operator=( const ImageMap& rImageMap );
+
+ // Vergleichsoperator (es wird alles auf Gleichheit geprueft)
+ BOOL operator==( const ImageMap& rImageMap );
+ BOOL operator!=( const ImageMap& rImageMap );
+
+ // In die Map wird ein neues IMap-Obkekt ans Ende eingefuegt
+ void InsertIMapObject( const IMapObject& rIMapObject );
+
+ // Zugriff auf einzelne IMapObjekte; die Objekte
+ // duerfen von aussen _nicht_ zerstoert werden
+ IMapObject* GetFirstIMapObject() { return (IMapObject*) maList.First(); }
+ IMapObject* GetNextIMapObject() { return (IMapObject*) maList.Next(); }
+ IMapObject* GetLastIMapObject() { return (IMapObject*) maList.Last(); }
+ IMapObject* GetPrevIMapObject() { return (IMapObject*) maList.Prev(); }
+ IMapObject* GetIMapObject( USHORT nPos ) const { return (IMapObject*) maList.GetObject( nPos ); }
+
+ // Gibt das Objekt zurueck, das zuerst getroffen wurde oder NULL;
+ // Groessen- und Positionsangaben sind in 1/100mm;
+ // rTotalSize ist die Originalgroesse des Bildes;
+ // rDisplaySize die aktuelle Darstellungsgroesse;
+ // rRelPoint bezieht sich auf die Darstellungsgroesse
+ // und die linke oebere Ecke des Bildes
+ IMapObject* GetHitIMapObject( const Size& rOriginalSize,
+ const Size& rDisplaySize,
+ const Point& rRelHitPoint,
+ ULONG nFlags = 0 );
+
+ // Gibt die Gesamtanzahl der IMap-Objekte zurueck
+ UINT16 GetIMapObjectCount() const { return (UINT16) maList.Count(); }
+
+ // Loescht alle internen Objekte
+ void ClearImageMap();
+
+ // liefert die aktuelle Versionsnummer
+ UINT16 GetVersion() const;
+
+ // liefert / setzt den Namen der ImageMap
+ const String& GetName() const { return aName; }
+ void SetName( const String& rName ) { aName = rName; }
+
+ // gibt das BoundRect aller IMap-Objekte in 1/100mm zurueck
+ Rectangle GetBoundRect() const;
+
+ // skaliert alle Objekte der ImageMap entpr. dem uebergebenen Faktor
+ void Scale( const Fraction& rFractX, const Fraction& rFracY );
+
+ // Im-/Export
+ void Write ( SvStream& rOStm, const String& rBaseURL ) const;
+ void Read( SvStream& rIStm, const String& rBaseURL );
+
+ void Write( SvStream& rOStm, ULONG nFormat, const String& rBaseURL ) const;
+ ULONG Read( SvStream& rIStm, ULONG nFormat, const String& rBaseURL );
+};
+
+/******************************************************************************
+|*
+|*
+|*
+\******************************************************************************/
+
+//#if 0 // _SOLAR__PRIVATE
+
+class IMapCompat
+{
+ SvStream* pRWStm;
+ ULONG nCompatPos;
+ ULONG nTotalSize;
+ USHORT nStmMode;
+
+ IMapCompat() {}
+ IMapCompat( const IMapCompat& ) {}
+ IMapCompat& operator=( const IMapCompat& ) { return *this; }
+ BOOL operator==( const IMapCompat& ) { return FALSE; }
+
+public:
+
+ IMapCompat( SvStream& rStm, const USHORT nStreamMode );
+ ~IMapCompat();
+};
+
+//#endif // __PRIVATE
+#endif // _IMAP_HXX
diff --git a/svtools/inc/svtools/imapcirc.hxx b/svtools/inc/svtools/imapcirc.hxx
new file mode 100644
index 000000000000..e3ea5349d376
--- /dev/null
+++ b/svtools/inc/svtools/imapcirc.hxx
@@ -0,0 +1,87 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+#ifndef _GOODIES_IMAPCIRC_HXX
+#define _GOODIES_IMAPCIRC_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/gen.hxx>
+#include <svtools/imapobj.hxx>
+
+class Fraction;
+
+/******************************************************************************
+|*
+|*
+|*
+\******************************************************************************/
+
+class SVT_DLLPUBLIC IMapCircleObject : public IMapObject
+{
+ Point aCenter;
+ ULONG nRadius;
+
+ void ImpConstruct( const Point& rCenter, ULONG nRad, BOOL bPixel );
+
+protected:
+
+ // Binaer-Im-/Export
+ virtual void WriteIMapObject( SvStream& rOStm ) const;
+ virtual void ReadIMapObject( SvStream& rIStm );
+
+public:
+
+ IMapCircleObject() {};
+ IMapCircleObject( const Point& rCenter, ULONG nRad,
+ const String& rURL,
+ const String& rAltText,
+ const String& rDesc,
+ const String& rTarget,
+ const String& rName,
+ BOOL bActive = TRUE,
+ BOOL bPixelCoords = TRUE );
+ virtual ~IMapCircleObject() {};
+
+ virtual UINT16 GetType() const;
+ virtual BOOL IsHit( const Point& rPoint ) const;
+
+ Point GetCenter( BOOL bPixelCoords = TRUE ) const;
+ ULONG GetRadius( BOOL bPixelCoords = TRUE ) const;
+
+ // liefert das BoundRect des Kreis-Objektes in 1/100mm
+ virtual Rectangle GetBoundRect() const;
+
+ void Scale( const Fraction& rFractX, const Fraction& rFracY );
+
+ using IMapObject::IsEqual;
+ BOOL IsEqual( const IMapCircleObject& rEqObj );
+
+ // Im-/Export
+ void WriteCERN( SvStream& rOStm, const String& rBaseURL ) const;
+ void WriteNCSA( SvStream& rOStm, const String& rBaseURL ) const;
+};
+
+#endif
diff --git a/svtools/inc/svtools/imapobj.hxx b/svtools/inc/svtools/imapobj.hxx
new file mode 100644
index 000000000000..c557727124cc
--- /dev/null
+++ b/svtools/inc/svtools/imapobj.hxx
@@ -0,0 +1,163 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _GOODIES_IMAPOBJ_HXX
+#define _GOODIES_IMAPOBJ_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/string.hxx>
+#include <svl/macitem.hxx>
+
+class Point;
+class Rectangle;
+class SvStream;
+
+#define IMAP_OBJ_NONE ((UINT16)0x0000)
+#define IMAP_OBJ_RECTANGLE ((UINT16)0x0001)
+#define IMAP_OBJ_CIRCLE ((UINT16)0x0002)
+#define IMAP_OBJ_POLYGON ((UINT16)0x0003)
+#define IMAP_OBJ_VERSION ((UINT16)0x0005)
+
+#define IMAGE_MAP_VERSION ((UINT16)0x0001)
+
+#define IMAPMAGIC "SDIMAP"
+
+#define IMAP_MIRROR_HORZ 0x00000001L
+#define IMAP_MIRROR_VERT 0x00000002L
+
+#define IMAP_FORMAT_BIN 0x00000001L
+#define IMAP_FORMAT_CERN 0x00000002L
+#define IMAP_FORMAT_NCSA 0x00000004L
+#define IMAP_FORMAT_DETECT 0xffffffffL
+
+#define IMAP_ERR_OK 0x00000000L
+#define IMAP_ERR_FORMAT 0x00000001L
+
+/******************************************************************************
+|*
+|*
+|*
+\******************************************************************************/
+
+class SVT_DLLPUBLIC IMapObject
+{
+ friend class ImageMap;
+
+ String aURL;
+ String aAltText;
+ String aDesc;
+ String aTarget;
+ String aName;
+ SvxMacroTableDtor aEventList;
+ BOOL bActive;
+
+protected:
+
+ UINT16 nReadVersion;
+
+ // Binaer-Im-/Export
+ virtual void WriteIMapObject( SvStream& rOStm ) const = 0;
+ virtual void ReadIMapObject( SvStream& rIStm ) = 0;
+
+ // Hilfsmethoden
+ void AppendCERNCoords( const Point& rPoint100, ByteString& rStr ) const;
+ void AppendCERNURL( ByteString& rStr, const String& rBaseURL ) const;
+ void AppendNCSACoords( const Point& rPoint100, ByteString& rStr ) const;
+ void AppendNCSAURL( ByteString& rStr, const String& rBaseURL ) const;
+
+public:
+
+ static rtl_TextEncoding nActualTextEncoding;
+
+ IMapObject();
+ IMapObject( const String& rURL,
+ const String& rAltText,
+ const String& rDesc,
+ const String& rTarget,
+ const String& rName,
+ BOOL bActive );
+ virtual ~IMapObject() {};
+
+ virtual UINT16 GetVersion() const;
+ virtual UINT16 GetType() const = 0;
+ virtual BOOL IsHit( const Point& rPoint ) const = 0;
+
+ void Write ( SvStream& rOStm, const String& rBaseURL ) const;
+ void Read( SvStream& rIStm, const String& rBaseURL );
+
+ virtual Rectangle GetBoundRect() const = 0;
+
+ const String& GetURL() const { return aURL; }
+ void SetURL( const String& rURL ) { aURL = rURL; }
+
+ const String& GetAltText() const { return aAltText; }
+ void SetAltText( const String& rAltText) { aAltText = rAltText; }
+
+ const String& GetDesc() const { return aDesc; }
+ void SetDesc( const String& rDesc ) { aDesc = rDesc; }
+
+ const String& GetTarget() const { return aTarget; }
+ void SetTarget( const String& rTarget ) { aTarget = rTarget; }
+
+ const String& GetName() const { return aName; }
+ void SetName( const String& rName ) { aName = rName; }
+
+ BOOL IsActive() const { return bActive; }
+ void SetActive( BOOL bSetActive = TRUE ) { bActive = bSetActive; }
+
+ static Point GetPixelPoint( const Point& rLogPoint );
+ static Point GetLogPoint( const Point& rPixelPoint );
+
+ BOOL IsEqual( const IMapObject& rEqObj );
+
+ // IMap-Events
+ inline const SvxMacroTableDtor& GetMacroTable() const { return aEventList;}
+ inline void SetMacroTable( const SvxMacroTableDtor& rTbl ) { aEventList = rTbl; }
+
+ inline const SvxMacro& GetEvent( USHORT nEvent ) const;
+ inline BOOL HasEvent( USHORT nEvent ) const;
+ void SetEvent( USHORT nEvent, const SvxMacro& );
+ inline BOOL DelEvent( USHORT nEvent );
+};
+
+inline BOOL IMapObject::HasEvent( USHORT nEvent ) const
+{
+ return aEventList.IsKeyValid( nEvent );
+}
+inline const SvxMacro& IMapObject::GetEvent( USHORT nEvent ) const
+{
+ return *(aEventList.Get( nEvent ));
+}
+inline BOOL IMapObject::DelEvent( USHORT nEvent )
+{
+ SvxMacro *pMacro = aEventList.Remove( nEvent );
+ delete pMacro;
+ return ( pMacro != 0 );
+}
+
+#endif
+
diff --git a/svtools/inc/svtools/imappoly.hxx b/svtools/inc/svtools/imappoly.hxx
new file mode 100644
index 000000000000..00d22cbe2de0
--- /dev/null
+++ b/svtools/inc/svtools/imappoly.hxx
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _GOODIES_IMAPPOLY_HXX
+#define _GOODIES_IMAPPOLY_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/imapobj.hxx>
+#include <tools/poly.hxx>
+
+class Fraction;
+
+/******************************************************************************
+|*
+|*
+|*
+\******************************************************************************/
+
+class SVT_DLLPUBLIC IMapPolygonObject : public IMapObject
+{
+ Polygon aPoly;
+ Rectangle aEllipse;
+ BOOL bEllipse;
+
+ SVT_DLLPRIVATE void ImpConstruct( const Polygon& rPoly, BOOL bPixel );
+
+protected:
+
+ // Binaer-Im-/Export
+ virtual void WriteIMapObject( SvStream& rOStm ) const;
+ virtual void ReadIMapObject( SvStream& rIStm );
+
+ BOOL ReadPreProLine( SvStream& rIStm, String& rStr );
+
+public:
+ IMapPolygonObject() {};
+ IMapPolygonObject( const Polygon& rPoly,
+ const String& rURL,
+ const String& rAltText,
+ const String& rDesc,
+ const String& rTarget,
+ const String& rName,
+ BOOL bActive = TRUE,
+ BOOL bPixelCoords = TRUE );
+ virtual ~IMapPolygonObject() {};
+
+ virtual UINT16 GetType() const;
+ virtual BOOL IsHit( const Point& rPoint ) const;
+
+ Polygon GetPolygon( BOOL bPixelCoords = TRUE ) const;
+
+ // liefert das BoundRect des Polygon-Objektes in 1/100mm
+ virtual Rectangle GetBoundRect() const { return aPoly.GetBoundRect(); }
+
+ BOOL HasExtraEllipse() const { return bEllipse; }
+ const Rectangle& GetExtraEllipse() const { return aEllipse; }
+ void SetExtraEllipse( const Rectangle& rEllipse );
+
+ void Scale( const Fraction& rFractX, const Fraction& rFracY );
+
+ using IMapObject::IsEqual;
+ BOOL IsEqual( const IMapPolygonObject& rEqObj );
+
+ // Im-/Export
+ void WriteCERN( SvStream& rOStm, const String& rBaseURL ) const;
+ void WriteNCSA( SvStream& rOStm, const String& rBaseURL ) const;
+};
+
+#endif
diff --git a/svtools/inc/svtools/imaprect.hxx b/svtools/inc/svtools/imaprect.hxx
new file mode 100644
index 000000000000..8eacaaaf3531
--- /dev/null
+++ b/svtools/inc/svtools/imaprect.hxx
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+#ifndef _GOODIES_IMAPRECT_HXX
+#define _GOODIES_IMAPRECT_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/imapobj.hxx>
+#include <tools/gen.hxx>
+
+class Fraction;
+
+/******************************************************************************
+|*
+|*
+|*
+\******************************************************************************/
+
+class SVT_DLLPUBLIC IMapRectangleObject : public IMapObject
+{
+ Rectangle aRect;
+
+ SVT_DLLPRIVATE void ImpConstruct( const Rectangle& rRect, BOOL bPixel );
+
+protected:
+
+ // Binaer-Im-/Export
+ virtual void WriteIMapObject( SvStream& rOStm ) const;
+ virtual void ReadIMapObject( SvStream& rIStm );
+
+public:
+
+ IMapRectangleObject() {};
+ IMapRectangleObject( const Rectangle& rRect,
+ const String& rURL,
+ const String& rAltText,
+ const String& rDesc,
+ const String& rTarget,
+ const String& rName,
+ BOOL bActive = TRUE,
+ BOOL bPixelCoords = TRUE );
+ virtual ~IMapRectangleObject() {};
+
+ virtual UINT16 GetType() const;
+ virtual BOOL IsHit( const Point& rPoint ) const;
+
+ Rectangle GetRectangle( BOOL bPixelCoords = TRUE ) const;
+
+ // liefert das BoundRect des Rechteck-Objektes in 1/100mm
+ virtual Rectangle GetBoundRect() const { return aRect; }
+
+ void Scale( const Fraction& rFractX, const Fraction& rFracY );
+
+ using IMapObject::IsEqual;
+ BOOL IsEqual( const IMapRectangleObject& rEqObj );
+
+ // Im-/Export
+ void WriteCERN( SvStream& rOStm, const String& rBaseURL ) const;
+ void WriteNCSA( SvStream& rOStm, const String& rBaseURL ) const;
+};
+
+#endif
diff --git a/svtools/inc/svtools/inettbc.hxx b/svtools/inc/svtools/inettbc.hxx
new file mode 100644
index 000000000000..9394f1ba5ccd
--- /dev/null
+++ b/svtools/inc/svtools/inettbc.hxx
@@ -0,0 +1,111 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _SVTOOLS_INETTBC_HXX
+#define _SVTOOLS_INETTBC_HXX
+
+// includes *****************************************************************
+
+#include "svtools/svtdllapi.h"
+#include <tools/string.hxx>
+#include <tools/urlobj.hxx>
+
+#ifndef _COMBOBOX_HXX //autogen
+#include <vcl/combobox.hxx>
+#endif
+
+class IUrlFilter;
+class SvtMatchContext_Impl;
+class SvtURLBox_Impl;
+class SVT_DLLPUBLIC SvtURLBox : public ComboBox
+{
+friend class SvtMatchContext_Impl;
+friend class SvtURLBox_Impl;
+ Link aOpenHdl;
+ String aBaseURL;
+ String aPlaceHolder;
+ SvtMatchContext_Impl* pCtx;
+ SvtURLBox_Impl* pImp;
+ INetProtocol eSmartProtocol;
+ BOOL bAutoCompleteMode : 1;
+ BOOL bOnlyDirectories : 1;
+ BOOL bModified : 1;
+ BOOL bTryAutoComplete : 1;
+ BOOL bCtrlClick : 1;
+ BOOL bHistoryDisabled : 1;
+ BOOL bNoSelection : 1;
+ BOOL bIsAutoCompleteEnabled : 1;
+
+ SVT_DLLPRIVATE BOOL ProcessKey( const KeyCode& rCode );
+ SVT_DLLPRIVATE void TryAutoComplete( BOOL bForce );
+ SVT_DLLPRIVATE void UpdatePicklistForSmartProtocol_Impl();
+ DECL_DLLPRIVATE_LINK( AutoCompleteHdl_Impl, void* );
+ using Window::ImplInit;
+ SVT_DLLPRIVATE void ImplInit();
+
+protected:
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void Select();
+ virtual void Modify();
+ virtual long PreNotify( NotifyEvent& rNEvt );
+
+public:
+ SvtURLBox( Window* pParent, INetProtocol eSmart = INET_PROT_NOT_VALID );
+ SvtURLBox( Window* pParent, WinBits _nStyle, INetProtocol eSmart = INET_PROT_NOT_VALID );
+ SvtURLBox( Window* pParent, const ResId& _rResId, INetProtocol eSmart = INET_PROT_NOT_VALID );
+ ~SvtURLBox();
+
+ void SetBaseURL( const String& rURL );
+ const String& GetBaseURL() const { return aBaseURL; }
+ void SetOpenHdl( const Link& rLink ) { aOpenHdl = rLink; }
+ const Link& GetOpenHdl() const { return aOpenHdl; }
+ void SetOnlyDirectories( BOOL bDir = TRUE );
+ void SetNoURLSelection( BOOL bSet = TRUE );
+ INetProtocol GetSmartProtocol() const { return eSmartProtocol; }
+ void SetSmartProtocol( INetProtocol eProt );
+ BOOL IsCtrlOpen()
+ { return bCtrlClick; }
+ String GetURL();
+ void DisableHistory();
+
+ void UpdatePickList( );
+
+ static String ParseSmart( String aText, String aBaseURL, String aWorkDir );
+
+ void SetFilter(const String& _sFilter);
+ void SetUrlFilter( const IUrlFilter* _pFilter );
+ const IUrlFilter* GetUrlFilter( ) const;
+
+ inline void EnableAutocompletion( BOOL _bEnable = TRUE )
+ { bIsAutoCompleteEnabled = _bEnable; }
+ void SetPlaceHolder( const String& sPlaceHolder ) { aPlaceHolder = sPlaceHolder; }
+ String GetPlaceHolder() { return aPlaceHolder; }
+ bool MatchesPlaceHolder( const String& sToMatch ) { return ( ( aPlaceHolder.Len() > 0 ) && ( aPlaceHolder == sToMatch ) ); }
+};
+
+#endif
+
diff --git a/svtools/inc/svtools/insdlg.hxx b/svtools/inc/svtools/insdlg.hxx
new file mode 100644
index 000000000000..afbbc2509011
--- /dev/null
+++ b/svtools/inc/svtools/insdlg.hxx
@@ -0,0 +1,74 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+#ifndef _SVTOOLS_INSDLG_HXX
+#define _SVTOOLS_INSDLG_HXX
+
+#include "svtools/svtdllapi.h"
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
+#include <com/sun/star/embed/XStorage.hpp>
+#include <tools/globname.hxx>
+#include <sot/formats.hxx>
+
+#ifndef _OWNCONT_HXX
+#include <svl/ownlist.hxx>
+#endif
+#include <svtools/transfer.hxx>
+
+class SvObjectServer
+{
+private:
+ SvGlobalName aClassName;
+ String aHumanName;
+
+public:
+ SvObjectServer( const SvGlobalName & rClassP, const String & rHumanP ) :
+ aClassName( rClassP ),
+ aHumanName( rHumanP ) {}
+
+ const SvGlobalName & GetClassName() const { return aClassName; }
+ const String & GetHumanName() const { return aHumanName; }
+};
+
+class SVT_DLLPUBLIC SvObjectServerList
+{
+ PRV_SV_DECL_OWNER_LIST(SvObjectServerList,SvObjectServer)
+ const SvObjectServer * Get( const String & rHumanName ) const;
+ const SvObjectServer * Get( const SvGlobalName & ) const;
+ void Remove( const SvGlobalName & );
+ void FillInsertObjects();
+};
+
+class SVT_DLLPUBLIC SvPasteObjectHelper
+{
+public:
+ static String GetSotFormatUIName( SotFormatStringId nId );
+ static sal_Bool GetEmbeddedName(const TransferableDataHelper& rData, String& _rName, String& _rSource, SotFormatStringId& _nFormat);
+};
+
+#endif // _SVTOOLS_INSDLG_HXX
+
diff --git a/svtools/inc/svtools/javacontext.hxx b/svtools/inc/svtools/javacontext.hxx
new file mode 100644
index 000000000000..54ef70975ae0
--- /dev/null
+++ b/svtools/inc/svtools/javacontext.hxx
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _SVTOOLS_JAVACONTEXT_HXX_
+#define _SVTOOLS_JAVACONTEXT_HXX_
+
+#include "svtools/svtdllapi.h"
+#include <osl/mutex.hxx>
+
+#include <com/sun/star/task/XInteractionHandler.hpp>
+#include <com/sun/star/task/XInteractionRequest.hpp>
+#include <com/sun/star/uno/XCurrentContext.hpp>
+
+
+namespace svt
+{
+// We cannot derive from cppu::WeakImplHelper because we would export the inline
+//generated class. This conflicts with other libraries if they use the same inline
+//class.
+ class SVT_DLLPUBLIC JavaContext :
+ public com::sun::star::uno::XCurrentContext
+ {
+
+ public:
+ JavaContext( const com::sun::star::uno::Reference<
+ com::sun::star::uno::XCurrentContext> & ctx);
+
+ /** The parameter bShowErrorsOnce controls whether a message box is
+ only displayed once for a reocurring Java error. That is only
+ the first time JavaInteractionHandler.handle is called with a
+ particular Request then the message box is shown. Afterwards
+ nothing happens.
+ */
+ JavaContext( const com::sun::star::uno::Reference<
+ com::sun::star::uno::XCurrentContext> & ctx,
+ bool bReportErrorOnce);
+ virtual ~JavaContext();
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
+ const ::com::sun::star::uno::Type& aType )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL acquire() throw ();
+
+ virtual void SAL_CALL release() throw ();
+
+ // XCurrentContext
+ virtual com::sun::star::uno::Any SAL_CALL getValueByName( const rtl::OUString& Name )
+ throw (com::sun::star::uno::RuntimeException);
+
+ private:
+ SVT_DLLPRIVATE JavaContext(); //not implemented
+ SVT_DLLPRIVATE JavaContext(JavaContext&); //not implemented
+ SVT_DLLPRIVATE JavaContext& operator = (JavaContext&); //not implemented
+
+ oslInterlockedCount m_aRefCount;
+
+ com::sun::star::uno::Reference<
+ com::sun::star::uno::XCurrentContext > m_xNextContext;
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionHandler> m_xHandler;
+ bool m_bShowErrorsOnce;
+ };
+}
+
+#endif
diff --git a/svtools/inc/svtools/javainteractionhandler.hxx b/svtools/inc/svtools/javainteractionhandler.hxx
new file mode 100644
index 000000000000..87ed9da0fc3d
--- /dev/null
+++ b/svtools/inc/svtools/javainteractionhandler.hxx
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _SVTOOLS_JAVAINTERACTION_HXX_
+#define _SVTOOLS_JAVAINTERACTION_HXX_
+
+#include "svtools/svtdllapi.h"
+#include <osl/mutex.hxx>
+#include <tools/gen.hxx>
+
+#include <com/sun/star/task/XInteractionRequest.hpp>
+#include <svtools/javacontext.hxx>
+
+#define JAVA_INTERACTION_HANDLER_NAME "java-vm.interaction-handler"
+
+namespace svt
+{
+// We cannot derive from cppu::WeakImplHelper because we would export the inline
+//generated class. This conflicts with other libraries if they use the same inline
+//class.
+
+class SVT_DLLPUBLIC JavaInteractionHandler:
+ public com::sun::star::task::XInteractionHandler
+{
+public:
+ JavaInteractionHandler();
+ JavaInteractionHandler(bool bReportErrorOnce);
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
+ const ::com::sun::star::uno::Type& aType )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL acquire() throw();
+
+ virtual void SAL_CALL release() throw();
+
+ // XCurrentContext
+ virtual void SAL_CALL handle( const com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionRequest >& Request )
+ throw (com::sun::star::uno::RuntimeException);
+
+private:
+ oslInterlockedCount m_aRefCount;
+ SVT_DLLPRIVATE JavaInteractionHandler(JavaInteractionHandler const&); //not implemented
+ SVT_DLLPRIVATE JavaInteractionHandler& operator = (JavaInteractionHandler const &); //not implemented
+ SVT_DLLPRIVATE virtual ~JavaInteractionHandler();
+ bool m_bShowErrorsOnce;
+ bool m_bJavaDisabled_Handled;
+ bool m_bInvalidSettings_Handled;
+ bool m_bJavaNotFound_Handled;
+ bool m_bVMCreationFailure_Handled;
+ bool m_bRestartRequired_Handled;
+ USHORT m_nResult_JavaDisabled;
+};
+}
+
+#endif // _DESKTOP_JAVAINTERACTION_HXX_
diff --git a/svtools/inc/svtools/langtab.hxx b/svtools/inc/svtools/langtab.hxx
new file mode 100644
index 000000000000..e5600413091b
--- /dev/null
+++ b/svtools/inc/svtools/langtab.hxx
@@ -0,0 +1,58 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+#ifndef _SVTOOLS_LANGTAB_HXX_
+#define _SVTOOLS_LANGTAB_HXX_
+
+
+#include <tools/resary.hxx>
+#include <i18npool/lang.h>
+#include <svtools/svtdllapi.h>
+
+//========================================================================
+// class SvtLanguageTable
+//========================================================================
+
+class SVT_DLLPUBLIC SvtLanguageTable : public ResStringArray
+{
+public:
+ SvtLanguageTable();
+ ~SvtLanguageTable();
+
+ const String& GetString( const LanguageType eType ) const;
+ LanguageType GetType( const String& rStr ) const;
+
+ sal_uInt32 GetEntryCount() const;
+ LanguageType GetTypeAtIndex( sal_uInt32 nIndex ) const;
+ static String GetLanguageString( const LanguageType eType );
+};
+
+// Add LRE or RLE embedding characters to the string based on the
+// String content (see #i78466#, #i32179#)
+SVT_DLLPUBLIC const String ApplyLreOrRleEmbedding( const String &rText );
+
+#endif
+
diff --git a/svtools/inc/svtools/menuoptions.hxx b/svtools/inc/svtools/menuoptions.hxx
new file mode 100644
index 000000000000..6de173f40c3a
--- /dev/null
+++ b/svtools/inc/svtools/menuoptions.hxx
@@ -0,0 +1,169 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_SVTOOLS_MENUOPTIONS_HXX
+#define INCLUDED_SVTOOLS_MENUOPTIONS_HXX
+
+//_________________________________________________________________________________________________________________
+// includes
+//_________________________________________________________________________________________________________________
+
+#include "svtools/svtdllapi.h"
+#include <sal/types.h>
+#include <osl/mutex.hxx>
+#include <unotools/options.hxx>
+
+//_________________________________________________________________________________________________________________
+// forward declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class Link;
+class SvtMenuOptions_Impl;
+
+//_________________________________________________________________________________________________________________
+// declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short collect informations about menu features
+ @descr -
+
+ @implements -
+ @base -
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class SVT_DLLPUBLIC SvtMenuOptions: public utl::detail::Options
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ public:
+
+ //---------------------------------------------------------------------------------------------------------
+ // constructor / destructor
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtMenuOptions();
+ virtual ~SvtMenuOptions();
+
+ void AddListenerLink( const Link& rLink );
+ void RemoveListenerLink( const Link& rLink );
+ //---------------------------------------------------------------------------------------------------------
+ // interface
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short interface methods to get and set value of config key "org.openoffice.Office.Common/View/Menu/..."
+ @descr These options describe internal states to enable/disable features of installed office.
+
+ IsEntryHidingEnabled()
+ SetEntryHidingState() => Activate this field for viewing all deactivated menu entries.
+ Menu commands that are normally not necessary are hidden by default.
+ Default=false
+
+ IsFollowMouseEnabled()
+ SetFollowMouseState() => Automatic selection while moving the mouse on a menu.
+ Default=true
+
+ @seealso configuration package "org.openoffice.Office.Common/View/Menu"
+ *//*-*****************************************************************************************************/
+
+ sal_Bool IsEntryHidingEnabled() const;
+ sal_Bool IsFollowMouseEnabled() const;
+ sal_Int16 GetMenuIconsState() const;
+
+ void SetEntryHidingState( sal_Bool bState );
+ void SetFollowMouseState( sal_Bool bState );
+ void SetMenuIconsState( sal_Int16 bState );
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class is partially threadsafe (for de-/initialization only).
+ All access methods are'nt safe!
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SVT_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtMenuOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtMenuOptions
+
+#endif // #ifndef INCLUDED_SVTOOLS_MENUOPTIONS_HXX
diff --git a/svtools/inc/svtools/miscopt.hxx b/svtools/inc/svtools/miscopt.hxx
new file mode 100644
index 000000000000..ecd2574c1943
--- /dev/null
+++ b/svtools/inc/svtools/miscopt.hxx
@@ -0,0 +1,180 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_SVTOOLS_MISCOPT_HXX
+#define INCLUDED_SVTOOLS_MISCOPT_HXX
+
+//_________________________________________________________________________________________________________________
+// includes
+//_________________________________________________________________________________________________________________
+
+#include "svtools/svtdllapi.h"
+#include <sal/types.h>
+#include <osl/mutex.hxx>
+#include <com/sun/star/uno/Sequence.h>
+#include <rtl/ustring.hxx>
+#include <unotools/options.hxx>
+
+//_________________________________________________________________________________________________________________
+// forward declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class SvtMiscOptions_Impl;
+class Link;
+
+//_________________________________________________________________________________________________________________
+// declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short collect informations about misc group
+ @descr -
+
+ @implements -
+ @base -
+
+ @ATTENTION This class is partially threadsafe.
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class SVT_DLLPUBLIC SvtMiscOptions: public utl::detail::Options
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ public:
+
+ //---------------------------------------------------------------------------------------------------------
+ // constructor / destructor
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtMiscOptions();
+ virtual ~SvtMiscOptions();
+
+ void AddListenerLink( const Link& rLink );
+ void RemoveListenerLink( const Link& rLink );
+
+ //---------------------------------------------------------------------------------------------------------
+ // interface
+ //---------------------------------------------------------------------------------------------------------
+
+ sal_Bool UseSystemFileDialog() const;
+ void SetUseSystemFileDialog( sal_Bool bSet );
+ sal_Bool IsUseSystemFileDialogReadOnly() const;
+
+ sal_Bool IsPluginsEnabled() const;
+ void SetPluginsEnabled( sal_Bool bEnable );
+ sal_Bool IsPluginsEnabledReadOnly() const;
+
+ sal_Int16 GetSymbolsSize() const;
+ void SetSymbolsSize( sal_Int16 eSet );
+ sal_Int16 GetCurrentSymbolsSize() const;
+ bool AreCurrentSymbolsLarge() const;
+ sal_Bool IsGetSymbolsSizeReadOnly() const;
+
+ sal_Int16 GetSymbolsStyle() const;
+ void SetSymbolsStyle( sal_Int16 eSet );
+ sal_Int16 GetCurrentSymbolsStyle() const;
+ ::rtl::OUString GetCurrentSymbolsStyleName() const;
+ sal_Bool IsGetSymbolsStyleReadOnly() const;
+
+ sal_Int16 GetToolboxStyle() const;
+ void SetToolboxStyle( sal_Int16 nStyle );
+ sal_Bool IsGetToolboxStyleReadOnly() const;
+
+ sal_Bool IsModifyByPrinting() const;
+ void SetModifyByPrinting(sal_Bool bSet );
+
+ sal_Bool UseSystemPrintDialog() const;
+ void SetUseSystemPrintDialog( sal_Bool bSet );
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class is partially threadsafe (for de-/initialization only).
+ All access methods are'nt safe!
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SVT_DLLPRIVATE static ::osl::Mutex& GetInitMutex();
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtMiscOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtMiscOptions
+
+#endif // #ifndef INCLUDED_SVTOOLS_MISCOPT_HXX
diff --git a/svtools/inc/svtools/optionsdrawinglayer.hxx b/svtools/inc/svtools/optionsdrawinglayer.hxx
new file mode 100644
index 000000000000..bd3114b4e871
--- /dev/null
+++ b/svtools/inc/svtools/optionsdrawinglayer.hxx
@@ -0,0 +1,238 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_SVTOOLS_OPTIONSDRAWINGLAYER_HXX
+#define INCLUDED_SVTOOLS_OPTIONSDRAWINGLAYER_HXX
+
+//_________________________________________________________________________________________________________________
+// includes
+//_________________________________________________________________________________________________________________
+
+#include "svtools/svtdllapi.h"
+#include <sal/types.h>
+#include <osl/mutex.hxx>
+#include <rtl/ustring.hxx>
+#include <tools/color.hxx>
+
+//_________________________________________________________________________________________________________________
+// forward declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class SvtOptionsDrawinglayer_Impl;
+
+//_________________________________________________________________________________________________________________
+// declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short collect informations about startup features
+ @descr -
+
+ @implements -
+ @base -
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class SVT_DLLPUBLIC SvtOptionsDrawinglayer
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ public:
+
+ //---------------------------------------------------------------------------------------------------------
+ // constructor / destructor
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtOptionsDrawinglayer();
+ ~SvtOptionsDrawinglayer();
+
+ //---------------------------------------------------------------------------------------------------------
+ // interface
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short interface methods to get and set value of config key "org.openoffice.Office.Common/Drawinglayer/..."
+ @descr These options describe internal states to enable/disable features of installed office.
+
+ IsOverlayBuffer()
+ SetOverlayBuffer() => Activate this field for letting Overlay use a buffer
+
+ IsPaintBuffer()
+ SetPaintBuffer() => Activate this field for letting Paint use a prerender buffer
+
+ GetStripeColorA()
+ SetStripeColorA() => Set first of two colors which overlay uses to draw stripes
+
+ GetStripeColorB()
+ SetStripeColorB() => Set second of two colors which overlay uses to draw stripes
+
+ GetStripeLength()
+ SetStripeLength() => Set length of a single stripe in pixels
+
+ @seealso configuration package "org.openoffice.Office.Common/Drawinglayer"
+ *//*-*****************************************************************************************************/
+
+ sal_Bool IsOverlayBuffer() const;
+ sal_Bool IsPaintBuffer() const;
+ Color GetStripeColorA() const;
+ Color GetStripeColorB() const;
+ sal_uInt16 GetStripeLength() const;
+
+ void SetOverlayBuffer( sal_Bool bState );
+ void SetPaintBuffer( sal_Bool bState );
+ void SetStripeColorA( Color aColor );
+ void SetStripeColorB( Color aColor );
+ void SetStripeLength( sal_uInt16 nLength );
+
+ // #i73602#
+ sal_Bool IsOverlayBuffer_Calc() const;
+ sal_Bool IsOverlayBuffer_Writer() const;
+ sal_Bool IsOverlayBuffer_DrawImpress() const;
+ void SetOverlayBuffer_Calc( sal_Bool bState );
+ void SetOverlayBuffer_Writer( sal_Bool bState );
+ void SetOverlayBuffer_DrawImpress( sal_Bool bState );
+
+ // #i74769#, #i75172#
+ sal_Bool IsPaintBuffer_Calc() const;
+ sal_Bool IsPaintBuffer_Writer() const;
+ sal_Bool IsPaintBuffer_DrawImpress() const;
+ void SetPaintBuffer_Calc( sal_Bool bState );
+ void SetPaintBuffer_Writer( sal_Bool bState );
+ void SetPaintBuffer_DrawImpress( sal_Bool bState );
+
+ // #i4219#
+ sal_uInt32 GetMaximumPaperWidth() const;
+ sal_uInt32 GetMaximumPaperHeight() const;
+ sal_uInt32 GetMaximumPaperLeftMargin() const;
+ sal_uInt32 GetMaximumPaperRightMargin() const;
+ sal_uInt32 GetMaximumPaperTopMargin() const;
+ sal_uInt32 GetMaximumPaperBottomMargin() const;
+
+ void SetMaximumPaperWidth(sal_uInt32 nNew);
+ void SetMaximumPaperHeight(sal_uInt32 nNew);
+ void SetMaximumPaperLeftMargin(sal_uInt32 nNew);
+ void SetMaximumPaperRightMargin(sal_uInt32 nNew);
+ void SetMaximumPaperTopMargin(sal_uInt32 nNew);
+ void SetMaximumPaperBottomMargin(sal_uInt32 nNew);
+
+ // #i95644# helper to check if AA is allowed on this system. Currently, for WIN its disabled
+ // and OutDevSupport_TransparentRect is checked (this hits XRenderExtension, e.g.
+ // currently for SunRay as long as not supported there)
+ sal_Bool IsAAPossibleOnThisSystem() const;
+
+ // primitives
+ sal_Bool IsAntiAliasing() const;
+ sal_Bool IsSnapHorVerLinesToDiscrete() const;
+ sal_Bool IsSolidDragCreate() const;
+ sal_Bool IsRenderDecoratedTextDirect() const;
+ sal_Bool IsRenderSimpleTextDirect() const;
+ sal_uInt32 GetQuadratic3DRenderLimit() const;
+ sal_uInt32 GetQuadraticFormControlRenderLimit() const;
+
+ void SetAntiAliasing( sal_Bool bState );
+ void SetSnapHorVerLinesToDiscrete( sal_Bool bState );
+ void SetSolidDragCreate( sal_Bool bState );
+ void SetRenderDecoratedTextDirect( sal_Bool bState );
+ void SetRenderSimpleTextDirect( sal_Bool bState );
+ void SetQuadratic3DRenderLimit(sal_uInt32 nNew);
+ void SetQuadraticFormControlRenderLimit(sal_uInt32 nNew);
+
+ // #i97672# selection settings
+ sal_Bool IsTransparentSelection() const;
+ sal_uInt16 GetTransparentSelectionPercent() const;
+ sal_uInt16 GetSelectionMaximumLuminancePercent() const;
+
+ void SetTransparentSelection( sal_Bool bState );
+ void SetTransparentSelectionPercent( sal_uInt16 nPercent );
+ void SetSelectionMaximumLuminancePercent( sal_uInt16 nPercent );
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class use his own static mutex to be threadsafe.
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+ SVT_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtOptionsDrawinglayer_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtOptionsDrawinglayer
+
+#endif // #ifndef INCLUDED_SVTOOLS_OPTIONSDRAWINGLAYER_HXX
diff --git a/svtools/inc/svtools/parhtml.hxx b/svtools/inc/svtools/parhtml.hxx
new file mode 100644
index 000000000000..a302b40d9d4b
--- /dev/null
+++ b/svtools/inc/svtools/parhtml.hxx
@@ -0,0 +1,297 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _PARHTML_HXX
+#define _PARHTML_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/solar.h>
+#include <tools/string.hxx>
+#include <svl/svarray.hxx>
+#include <svtools/svparser.hxx>
+
+
+namespace com { namespace sun { namespace star {
+ namespace document {
+ class XDocumentProperties;
+ }
+} } }
+
+class Color;
+class SvNumberFormatter;
+class SvULongs;
+class SvKeyValueIterator;
+
+#define HTMLFONTSZ1_DFLT 7
+#define HTMLFONTSZ2_DFLT 10
+#define HTMLFONTSZ3_DFLT 12
+#define HTMLFONTSZ4_DFLT 14
+#define HTMLFONTSZ5_DFLT 18
+#define HTMLFONTSZ6_DFLT 24
+#define HTMLFONTSZ7_DFLT 36
+
+enum HTMLTableFrame { HTML_TF_VOID, HTML_TF_ABOVE, HTML_TF_BELOW,
+ HTML_TF_HSIDES, HTML_TF_LHS, HTML_TF_RHS, HTML_TF_VSIDES, HTML_TF_BOX };
+
+enum HTMLTableRules { HTML_TR_NONE, HTML_TR_GROUPS, HTML_TR_ROWS,
+ HTML_TR_COLS, HTML_TR_ALL };
+
+enum HTMLInputType
+{
+ HTML_IT_TEXT = 0x01,
+ HTML_IT_PASSWORD = 0x02,
+ HTML_IT_CHECKBOX = 0x03,
+ HTML_IT_RADIO = 0x04,
+ HTML_IT_RANGE = 0x05,
+ HTML_IT_SCRIBBLE = 0x06,
+ HTML_IT_FILE = 0x07,
+ HTML_IT_HIDDEN = 0x08,
+ HTML_IT_SUBMIT = 0x09,
+ HTML_IT_IMAGE = 0x0a,
+ HTML_IT_RESET = 0x0b,
+ HTML_IT_BUTTON = 0x0c
+};
+
+enum HTMLScriptLanguage
+{
+ HTML_SL_STARBASIC,
+ HTML_SL_JAVASCRIPT,
+ HTML_SL_UNKNOWN
+};
+
+struct HTMLOptionEnum
+{
+ const sal_Char *pName; // Wert einer HTML-Option
+ sal_uInt16 nValue; // und der dazugehoerige Wert eines Enums
+};
+
+// Repraesentation einer HTML-Option (=Atrribut in einem Start-Tag)
+// Die Werte der Optionen werden immer als String gespeichert.
+// Die Methoden GetNumber, ... duerfen nur aufgerufen werden, wenn
+// die Option auch numerisch, ... ist.
+
+class SVT_DLLPUBLIC HTMLOption
+{
+ String aValue; // der Wert der Option (immer als String)
+ String aToken; // der Name der Option als String
+ sal_uInt16 nToken; // und das entsprechende Token
+
+public:
+
+ HTMLOption( sal_uInt16 nTyp, const String& rToken, const String& rValue );
+
+ // der Name der Option ...
+ sal_uInt16 GetToken() const { return nToken; } // ... als Enum
+ const String& GetTokenString() const { return aToken; } // ... als String
+
+ // der Wert der Option ...
+ const String& GetString() const { return aValue; } // ... als String
+
+ sal_uInt32 GetNumber() const; // ... als Zahl
+ sal_Int32 GetSNumber() const; // ... als Zahl
+ void GetNumbers( SvULongs &rLongs, // ... als Zahlen
+ sal_Bool bSpaceDelim=sal_False ) const;
+ void GetColor( Color& ) const; // ... als Farbe
+
+ // ... als Enum pOptEnums ist ein HTMLOptionEnum-Array
+ sal_uInt16 GetEnum( const HTMLOptionEnum *pOptEnums,
+ sal_uInt16 nDflt=0 ) const;
+ BOOL GetEnum( sal_uInt16 &rEnum, const HTMLOptionEnum *pOptEnums ) const;
+
+ // ... und als ein par spezielle Enums
+ HTMLInputType GetInputType() const; // <INPUT TYPE=...>
+ HTMLTableFrame GetTableFrame() const; // <TABLE FRAME=...>
+ HTMLTableRules GetTableRules() const; // <TABLE RULES=...>
+ //SvxAdjust GetAdjust() const; // <P,TH,TD ALIGN=>
+};
+
+typedef HTMLOption* HTMLOptionPtr;
+SV_DECL_PTRARR(HTMLOptions,HTMLOptionPtr,16,16)
+
+class SVT_DLLPUBLIC HTMLParser : public SvParser
+{
+ BOOL bNewDoc : 1; // neues Doc lesen ?
+ BOOL bIsInHeader : 1; // scanne Header-Bereich
+ BOOL bIsInBody : 1; // scanne Body-Bereich
+ BOOL bReadListing : 1; // Lese Listings
+ BOOL bReadXMP : 1; // Lese XMP
+ BOOL bReadPRE : 1; // Lese preformatted Text
+ BOOL bReadTextArea : 1; // Lese TEXTAREA
+ BOOL bReadScript : 1; // Lesen von <SCRIPT>
+ BOOL bReadStyle : 1; // Lesen von <STYLE>
+ BOOL bEndTokenFound : 1; // </SCRIPT> oder </STYLE> gefunden
+
+ BOOL bPre_IgnoreNewPara : 1; // Flags fuers lesen von PRE-Absaetzen
+ BOOL bReadNextChar : 1; // TRUE: NextChar nochmals lesen (JavaScript!)
+ BOOL bReadComment : 1; // TRUE: NextChar nochmals lesen (JavaScript!)
+
+ sal_uInt32 nPre_LinePos; // Pos in der Line im PRE-Tag
+
+ HTMLOptions *pOptions; // die Optionen des Start-Tags
+ String aEndToken;
+
+protected:
+ String sSaveToken; // das gelesene Tag als String
+
+ int ScanText( const sal_Unicode cBreak = 0U );
+
+ int _GetNextRawToken();
+
+ // scanne das naechste Token,
+ virtual int _GetNextToken();
+
+ virtual ~HTMLParser();
+
+ void FinishHeader( BOOL bBody ) { bIsInHeader = FALSE; bIsInBody = bBody; }
+
+public:
+ HTMLParser( SvStream& rIn, int bReadNewDoc = TRUE );
+
+ virtual SvParserState CallParser(); // Aufruf des Parsers
+
+ BOOL IsNewDoc() const { return bNewDoc; }
+ BOOL IsInHeader() const { return bIsInHeader; }
+ BOOL IsInBody() const { return bIsInBody; }
+ BOOL IsValidSyntax() const { return TRUE; }
+ BOOL IsReadListing() const { return bReadListing; }
+ BOOL IsReadXMP() const { return bReadXMP; }
+ BOOL IsReadPRE() const { return bReadPRE; }
+ BOOL IsReadScript() const { return bReadScript; }
+ BOOL IsReadStyle() const { return bReadStyle; }
+
+ void SetReadNextChar() { bReadNextChar = TRUE; }
+
+ // PRE-/LISTING oder XMP-Modus starten/beenden oder Tags entsprechend
+ // filtern
+ inline void StartPRE( BOOL bRestart=FALSE );
+ void FinishPRE() { bReadPRE = FALSE; }
+ int FilterPRE( int nToken );
+
+ inline void StartListing( BOOL bRestart=FALSE );
+ void FinishListing() { bReadListing = FALSE; }
+ int FilterListing( int nToken );
+
+ inline void StartXMP( BOOL bRestart=FALSE );
+ void FinishXMP() { bReadXMP = FALSE; }
+ int FilterXMP( int nToken );
+
+ void FinishTextArea() { bReadTextArea = FALSE; }
+
+ // PRE-/LSITING- und XMP-Modus beenden
+ void FinishPREListingXMP() { bReadPRE = bReadListing = bReadXMP = FALSE; }
+
+ // Das aktuelle Token dem aktuellen Modus (PRE, XMP, ...) entsprechend
+ // Filtern und die Flags setzen. Wird von Continue aufgerufen, bevor
+ // NextToken gerufen wird. Wer eigene Schleifen implementiert bzw.
+ // selbst NextToken aufruft, sollte diese Methode vorher rufen.
+ int FilterToken( int nToken );
+
+ // Scannen eines Scripts beenden (sollte nur unmittelbar nach dem
+ // Lesen eines <SCRIPT> aufgerufen werden
+ void EndScanScript() { bReadScript = FALSE; }
+
+ void ReadRawData( const sal_Char *pEndToken ) { aEndToken.AssignAscii(pEndToken); }
+
+ // Token ohne \-Sequenzen
+ void UnescapeToken();
+
+ // Ermitteln der Optionen. pNoConvertToken ist das optionale Token
+ // einer Option, fuer die CR/LFs nicht aus dem Wert der Option
+ // geloescht werden.
+ const HTMLOptions *GetOptions( sal_uInt16 *pNoConvertToken=0 ) const;
+
+ // fuers asynchrone lesen aus dem SvStream
+// virtual void SaveState( int nToken );
+// virtual void RestoreState();
+ virtual void Continue( int nToken );
+
+
+protected:
+
+ static rtl_TextEncoding GetEncodingByMIME( const String& rMime );
+
+ /// template method: called when ParseMetaOptions adds a user-defined meta
+ virtual void AddMetaUserDefined( ::rtl::OUString const & i_rMetaName );
+
+private:
+ /// parse meta options into XDocumentProperties and encoding
+ bool ParseMetaOptionsImpl( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XDocumentProperties>&,
+ SvKeyValueIterator*,
+ const HTMLOptions*,
+ rtl_TextEncoding& rEnc );
+
+public:
+ /// overriding method must call this implementation!
+ virtual bool ParseMetaOptions( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XDocumentProperties>&,
+ SvKeyValueIterator* );
+
+ // Ist der uebergebene 0-terminierte String (vermutlich) der Anfang
+ // eines HTML-Files? Er sollte mind. 80 Zeichen lang sein.
+ // Mit Ausnahme des Falls, dass SwitchToUCS2==FALSE und
+ // SVPAR_CS_DONTKNOW uebergeben wird muss der String mit zwei(!)
+ // 0-Bytes an einer geraden(!) Position terminiert sein.
+ static FASTBOOL IsHTMLFormat( const sal_Char* pHeader,
+ BOOL bSwitchToUCS2 = FALSE,
+ rtl_TextEncoding eEnc=RTL_TEXTENCODING_DONTKNOW );
+
+ BOOL ParseScriptOptions( String& rLangString, const String&, HTMLScriptLanguage& rLang,
+ String& rSrc, String& rLibrary, String& rModule );
+
+ // Einen Kommentar um den Inhalt von <SCRIPT> oder <STYLE> entfernen
+ // Bei 'bFull' wird ggf. die gesammte Zeile hinter einem "<!--"
+ // entfernt (fuer JavaSript)
+ static void RemoveSGMLComment( String &rString, BOOL bFull );
+
+ static BOOL InternalImgToPrivateURL( String& rURL );
+ static rtl_TextEncoding GetEncodingByHttpHeader( SvKeyValueIterator *pHTTPHeader );
+ BOOL SetEncodingByHTTPHeader( SvKeyValueIterator *pHTTPHeader );
+};
+
+inline void HTMLParser::StartPRE( BOOL bRestart )
+{
+ bReadPRE = TRUE;
+ bPre_IgnoreNewPara = !bRestart;
+ nPre_LinePos = 0UL;
+}
+
+inline void HTMLParser::StartListing( BOOL bRestart )
+{
+ bReadListing = TRUE;
+ bPre_IgnoreNewPara = !bRestart;
+ nPre_LinePos = 0UL;
+}
+
+inline void HTMLParser::StartXMP( BOOL bRestart )
+{
+ bReadXMP = TRUE;
+ bPre_IgnoreNewPara = !bRestart;
+ nPre_LinePos = 0UL;
+}
+
+#endif
diff --git a/svtools/inc/svtools/parrtf.hxx b/svtools/inc/svtools/parrtf.hxx
new file mode 100644
index 000000000000..179f5a28259a
--- /dev/null
+++ b/svtools/inc/svtools/parrtf.hxx
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _PARRTF_HXX
+#define _PARRTF_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/svparser.hxx>
+#include <svl/svarray.hxx>
+
+struct RtfParserState_Impl
+{
+ rtl_TextEncoding eCodeSet;
+ BYTE nUCharOverread;
+
+ RtfParserState_Impl( BYTE nUOverread, rtl_TextEncoding eCdSt )
+ : eCodeSet( eCdSt ), nUCharOverread( nUOverread )
+ {}
+};
+
+SV_DECL_VARARR( RtfParserStates_Impl, RtfParserState_Impl, 16, 16 )
+
+class SVT_DLLPUBLIC SvRTFParser : public SvParser
+{
+ RtfParserStates_Impl aParserStates;
+
+ int nOpenBrakets;
+ rtl_TextEncoding eCodeSet, eUNICodeSet;
+ BYTE nUCharOverread;
+
+private:
+ static short _inSkipGroup;
+
+protected:
+ sal_Unicode GetHexValue();
+ void ScanText( const sal_Unicode = 0 );
+ void SkipGroup();
+
+ // scanne das naechste Token,
+ virtual int _GetNextToken();
+
+ virtual void ReadUnknownData();
+ virtual void ReadBitmapData();
+ virtual void ReadOLEData();
+
+ virtual ~SvRTFParser();
+
+ rtl_TextEncoding GetCodeSet() const { return eCodeSet; }
+ void SetEncoding( rtl_TextEncoding eEnc );
+
+ rtl_TextEncoding GetUNICodeSet() const { return eUNICodeSet; }
+ void SetUNICodeSet( rtl_TextEncoding eSet ) { eUNICodeSet = eSet; }
+
+public:
+ SvRTFParser( SvStream& rIn, BYTE nStackSize = 3 );
+
+ virtual SvParserState CallParser(); // Aufruf des Parsers
+
+ int GetOpenBrakets() const { return nOpenBrakets; }
+
+ // fuers asynchrone lesen aus dem SvStream
+// virtual void SaveState( int nToken );
+// virtual void RestoreState();
+ virtual void Continue( int nToken );
+};
+
+#endif //_PARRTF_HXX
diff --git a/svtools/inc/svtools/popupmenucontrollerbase.hxx b/svtools/inc/svtools/popupmenucontrollerbase.hxx
new file mode 100644
index 000000000000..b062234a512e
--- /dev/null
+++ b/svtools/inc/svtools/popupmenucontrollerbase.hxx
@@ -0,0 +1,141 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef __SVTOOLS_POPUPMENUCONTROLLERBASE_HXX_
+#define __SVTOOLS_POPUPMENUCONTROLLERBASE_HXX_
+
+#include "svtools/svtdllapi.h"
+
+//_________________________________________________________________________________________________________________
+// interface includes
+//_________________________________________________________________________________________________________________
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XDispatchProvider.hpp>
+#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/frame/XStatusListener.hpp>
+#include <com/sun/star/frame/XPopupMenuController.hpp>
+#include <com/sun/star/uri/XUriReferenceFactory.hpp>
+#include <com/sun/star/uri/XUriReference.hpp>
+#include <com/sun/star/util/XURLTransformer.hpp>
+//_________________________________________________________________________________________________________________
+// includes of other projects
+//_________________________________________________________________________________________________________________
+#include <toolkit/awt/vclxmenu.hxx>
+#include <cppuhelper/compbase7.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <cppuhelper/weak.hxx>
+#include <rtl/ustring.hxx>
+
+namespace svt
+{
+ struct PopupMenuControllerBaseDispatchInfo;
+
+ typedef ::cppu::WeakComponentImplHelper7<
+ com::sun::star::lang::XServiceInfo ,
+ com::sun::star::frame::XPopupMenuController ,
+ com::sun::star::lang::XInitialization ,
+ com::sun::star::frame::XStatusListener ,
+ com::sun::star::awt::XMenuListener ,
+ com::sun::star::frame::XDispatchProvider ,
+ com::sun::star::frame::XDispatch > PopupMenuControllerBaseType;
+
+ class SVT_DLLPUBLIC PopupMenuControllerBase : protected ::comphelper::OBaseMutex, // Struct for right initalization of mutex member! Must be first of baseclasses.
+ public PopupMenuControllerBaseType
+ {
+ public:
+ PopupMenuControllerBase( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
+ virtual ~PopupMenuControllerBase();
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException) = 0;
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException) = 0;
+
+ // XPopupMenuController
+ virtual void SAL_CALL setPopupMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu >& PopupMenu ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updatePopupMenu() throw (::com::sun::star::uno::RuntimeException);
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException ) = 0;
+
+ // XMenuListener
+ virtual void SAL_CALL highlight( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL select( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL activate( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL deactivate( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XDispatchProvider
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > SAL_CALL queryDispatch( const ::com::sun::star::util::URL& aURL, const ::rtl::OUString& sTarget, sal_Int32 nFlags ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > > SAL_CALL queryDispatches( const ::com::sun::star::uno::Sequence< ::com::sun::star::frame::DispatchDescriptor >& lDescriptor ) throw( ::com::sun::star::uno::RuntimeException );
+
+ // XDispatch
+ virtual void SAL_CALL dispatch( const ::com::sun::star::util::URL& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& seqProperties ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL addStatusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >& xControl, const ::com::sun::star::util::URL& aURL ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL removeStatusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >& xControl, const ::com::sun::star::util::URL& aURL ) throw( ::com::sun::star::uno::RuntimeException );
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ void dispatchCommand( const ::rtl::OUString& sCommandURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArgs );
+
+ protected:
+ void throwIfDisposed() throw ( ::com::sun::star::uno::RuntimeException );
+
+ /** helper method to cause statusChanged is called once for the given command url */
+ void SAL_CALL updateCommand( const rtl::OUString& rCommandURL );
+
+ /** this function is called upon disposing the component
+ */
+ virtual void SAL_CALL disposing();
+
+ virtual void resetPopupMenu( com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu >& rPopupMenu );
+ virtual void impl_setPopupMenu();
+ virtual void impl_select(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >& _xDispatch,const ::com::sun::star::util::URL& aURL);
+ ::rtl::OUString determineBaseURL( const ::rtl::OUString& aURL );
+
+ DECL_STATIC_LINK( PopupMenuControllerBase, ExecuteHdl_Impl, PopupMenuControllerBaseDispatchInfo* );
+
+
+ bool m_bInitialized;
+ rtl::OUString m_aCommandURL;
+ rtl::OUString m_aBaseURL;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > m_xDispatch;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu > m_xPopupMenu;
+ };
+}
+
+#endif // __SVTOOLS_POPUPMENUCONTROLLERBASE_HXX_
diff --git a/svtools/inc/svtools/popupwindowcontroller.hxx b/svtools/inc/svtools/popupwindowcontroller.hxx
new file mode 100644
index 000000000000..4877d0184318
--- /dev/null
+++ b/svtools/inc/svtools/popupwindowcontroller.hxx
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef __SVTOOLS_POPUPWINDOWCONTROLLER_HXX_
+#define __SVTOOLS_POPUPWINDOWCONTROLLER_HXX_
+
+#include "svtools/svtdllapi.h"
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+
+#include "svtools/toolboxcontroller.hxx"
+#include "boost/scoped_ptr.hpp"
+
+class Window;
+
+namespace svt
+{
+class PopupWindowControllerImpl;
+
+class SVT_DLLPUBLIC PopupWindowController : public svt::ToolboxController, public ::com::sun::star::lang::XServiceInfo
+{
+public:
+ PopupWindowController( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame,
+ const rtl::OUString& aCommandURL );
+ ~PopupWindowController();
+
+ virtual ::Window* createPopupWindow( ::Window* pParent ) = 0;
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw ();
+ virtual void SAL_CALL release() throw ();
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) = 0;
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ) = 0;
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ // XToolbarController
+ virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL click() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createPopupWindow() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createItemWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& Parent ) throw (::com::sun::star::uno::RuntimeException);
+private:
+ boost::scoped_ptr< PopupWindowControllerImpl > mpImpl;
+};
+
+} // namespace svt
+
+#endif // __SVTOOLS_POPUPWINDOWCONTROLLER_HXX_
diff --git a/svtools/inc/svtools/printdlg.hxx b/svtools/inc/svtools/printdlg.hxx
new file mode 100644
index 000000000000..8c455b910b41
--- /dev/null
+++ b/svtools/inc/svtools/printdlg.hxx
@@ -0,0 +1,297 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _SV_PRINTDLG_HXX_
+#define _SV_PRINTDLG_HXX_
+
+#include "svtools/svtdllapi.h"
+
+#ifndef _VCL_DIALOG_HXX
+#include <vcl/dialog.hxx>
+#endif
+#ifndef _VCL_FIXED_HXX
+#include <vcl/fixed.hxx>
+#endif
+#ifndef _VCL_BUTTON_HXX
+#include <vcl/button.hxx>
+#endif
+#ifndef _VCL_GROUP_HXX
+#include <vcl/group.hxx>
+#endif
+#ifndef _VCL_FIELD_HXX
+#include <vcl/field.hxx>
+#endif
+#ifndef _VCL_EDIT_HXX
+#include <vcl/edit.hxx>
+#endif
+#ifndef _VCL_LSTBOX_HXX
+#include <vcl/lstbox.hxx>
+#endif
+#include <svtools/stdctrl.hxx>
+
+class Printer;
+class QueueInfo;
+struct SvtPrinterImpl;
+
+// ---------------------
+// - PrintDialog-Types -
+// ---------------------
+
+enum PrintDialogRange{
+ PRINTDIALOG_ALL, PRINTDIALOG_SELECTION, PRINTDIALOG_FROMTO, PRINTDIALOG_RANGE };
+
+enum PrintSheetRange
+{
+ PRINTSHEETS_ALL,
+ PRINTSHEETS_SELECTED_SHEETS,
+ PRINTSHEETS_SELECTED_CELLS
+};
+
+
+// ---------------
+// - PrintDialog -
+// ---------------
+
+class SVT_DLLPUBLIC PrintDialog : public ModalDialog
+{
+private:
+ FixedLine maFlPrinter;
+ FixedText maFtName;
+ ListBox maLbName;
+ PushButton maBtnProperties;
+ FixedText maFtStatus;
+ FixedInfo maFiStatus;
+ FixedText maFtType;
+ FixedInfo maFiType;
+ FixedText maFtLocation;
+ FixedInfo maFiLocation;
+ FixedText maFtComment;
+ FixedInfo maFiComment;
+
+ // "Print to file" or "Fax number"
+ CheckBox maCbxFilePrint;
+ FixedInfo maFiPrintFile;
+ FixedText maFiFaxNo;
+ Edit maEdtFaxNo;
+ //PushButton maBtnBrowse_nomore;
+
+ // "Print"
+ FixedLine maFlPrint;
+ RadioButton maRbtAllSheets;
+ RadioButton maRbtSelectedSheets;
+ RadioButton maRbtSelectedCells;
+
+ // "Print range"
+ FixedLine maFlPrintRange;
+ RadioButton maRbtAll;
+ RadioButton maRbtPages;
+ RadioButton maRbtSelection;
+ Edit maEdtPages;
+
+ FixedLine maFlSepCopiesRange;
+
+ // "Copies"
+ FixedLine maFlCopies;
+ FixedText maFtCopies;
+ NumericField maNumCopies;
+ FixedImage maImgCollate;
+ FixedImage maImgNotCollate;
+ CheckBox maCbxCollate;
+
+ FixedLine maFlSepButtonLine;
+ PushButton maBtnOptions;
+ OKButton maBtnOK;
+ CancelButton maBtnCancel;
+ HelpButton maBtnHelp;
+
+ AutoTimer maStatusTimer;
+ Printer* mpPrinter;
+ SvtPrinterImpl* mpPrinterImpl;
+
+ XubString maRangeText;
+ USHORT mnCopyCount;
+ USHORT mnFirstPage;
+ USHORT mnLastPage;
+ USHORT mnMinPage;
+ USHORT mnMaxPage;
+ PrintDialogRange meCheckRange;
+ BOOL mbAll;
+ BOOL mbSelection;
+ BOOL mbFromTo;
+ BOOL mbRange;
+ BOOL mbCollate;
+ BOOL mbCollateCheck;
+ BOOL mbOptions;
+ bool mbWithSheetsAndCells;
+ Link maOptionsHdlLink; // Link zum Options-Handler
+ Link maOKHdlLink; // Link zum OK-Handler
+
+ String maAllFilterStr;
+
+ SVT_DLLPRIVATE void ImplCheckOK();
+ SVT_DLLPRIVATE void ImplInitControls();
+ SVT_DLLPRIVATE void ImplFillDialogData();
+ SVT_DLLPRIVATE void ImplSetInfo();
+ SVT_DLLPRIVATE void ImplSetImages();
+ SVT_DLLPRIVATE bool ImplGetFilename();
+
+ DECL_DLLPRIVATE_LINK( ImplPropertiesHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplChangePrinterHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplModifyControlHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplStatusHdl, Timer* );
+
+public:
+ PrintDialog( Window* pWindow, bool bWithSheetsAndCells );
+ ~PrintDialog();
+
+ virtual long OK();
+ virtual long ClickOptionsHdl();
+
+ void SetPrinter( Printer* pNewPrinter ) { mpPrinter = pNewPrinter; }
+ Printer* GetPrinter() const { return mpPrinter; }
+
+ inline bool IsSheetRangeAvailable() const { return mbWithSheetsAndCells; }
+ void EnableSheetRange( bool bEnable, PrintSheetRange eRange );
+ bool IsSheetRangeEnabled( PrintSheetRange eRange ) const;
+ void CheckSheetRange( PrintSheetRange eRange );
+ PrintSheetRange GetCheckedSheetRange() const;
+ bool IsSheetRangeChecked( PrintSheetRange eRange ) const;
+
+ void EnableRange( PrintDialogRange eRange );
+ void DisableRange( PrintDialogRange eRange );
+ BOOL IsRangeEnabled( PrintDialogRange eRange ) const;
+
+ void CheckRange( PrintDialogRange eRange = PRINTDIALOG_ALL )
+ { meCheckRange = eRange; }
+ PrintDialogRange GetCheckedRange() const { return meCheckRange; }
+ BOOL IsRangeChecked( PrintDialogRange eRange ) const;
+
+ void SetRangeText( const XubString& rRange ) { maRangeText = rRange; }
+ const XubString& GetRangeText() const { return maRangeText; }
+
+ void SetFirstPage( USHORT nPage = 0 );
+ USHORT GetFirstPage() const { return mnFirstPage; }
+ void SetLastPage( USHORT nPage = 0 );
+ USHORT GetLastPage() const { return mnLastPage; }
+
+ void SetMinPage( USHORT nPage = 1 ) { mnMinPage = nPage; }
+ USHORT GetMinPage() const { return mnMinPage; }
+ void SetMaxPage( USHORT nPage = 65535 ) { mnMaxPage = nPage; }
+ USHORT GetMaxPage() const { return mnMaxPage; }
+
+ void SetCopyCount( USHORT nCopies = 1 ) { mnCopyCount = nCopies; }
+ USHORT GetCopyCount() const { return mnCopyCount; }
+
+ void EnableCollate( BOOL bEnable = TRUE )
+ { mbCollate = bEnable; }
+ BOOL IsCollateEnabled() const { return mbCollate; }
+ void CheckCollate( BOOL bCheck = TRUE )
+ { mbCollateCheck = bCheck; }
+ BOOL IsCollateChecked() const { return mbCollateCheck; }
+
+ void ShowOptionsButton( BOOL bShow = TRUE )
+ { mbOptions = bShow; }
+ BOOL IsOptionsButtonVisible() const { return mbOptions; }
+
+ void SetOptionsHdl( const Link& rLink ) { maOptionsHdlLink = rLink; }
+ const Link& GetOptionsHdl() const { return maOptionsHdlLink; }
+
+ void SetOKHdl( const Link& rLink ) { maOKHdlLink = rLink; }
+ const Link& GetOKHdl() const { return maOKHdlLink; }
+
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+
+ virtual short Execute();
+
+ void DisableHelp();
+};
+
+inline void PrintDialog::EnableRange( PrintDialogRange eRange )
+{
+ if ( eRange == PRINTDIALOG_ALL )
+ mbAll = TRUE;
+ else if ( eRange == PRINTDIALOG_SELECTION )
+ mbSelection = TRUE;
+ else if ( eRange == PRINTDIALOG_FROMTO )
+ mbFromTo = TRUE;
+ else
+ mbRange = TRUE;
+}
+
+inline void PrintDialog::DisableRange( PrintDialogRange eRange )
+{
+ if ( eRange == PRINTDIALOG_ALL )
+ mbAll = FALSE;
+ else if ( eRange == PRINTDIALOG_SELECTION )
+ mbSelection = FALSE;
+ else if ( eRange == PRINTDIALOG_FROMTO )
+ mbFromTo = FALSE;
+ else
+ mbRange = FALSE;
+}
+
+inline BOOL PrintDialog::IsRangeEnabled( PrintDialogRange eRange ) const
+{
+ BOOL bRet;
+
+ if ( eRange == PRINTDIALOG_ALL )
+ bRet = mbAll;
+ else if ( eRange == PRINTDIALOG_SELECTION )
+ bRet = mbSelection;
+ else if ( eRange == PRINTDIALOG_FROMTO )
+ bRet = mbFromTo;
+ else
+ bRet = mbRange;
+
+ return bRet;
+}
+
+inline BOOL PrintDialog::IsRangeChecked( PrintDialogRange eRange ) const
+{
+ if ( eRange == meCheckRange )
+ return TRUE;
+ else
+ return FALSE;
+}
+
+inline void PrintDialog::SetFirstPage( USHORT nPage )
+{
+ mnFirstPage = nPage;
+ if ( nPage && (nPage < mnMinPage) )
+ mnMinPage = nPage;
+}
+
+inline void PrintDialog::SetLastPage( USHORT nPage )
+{
+ mnLastPage = nPage;
+ if ( nPage && (nPage > mnMaxPage) )
+ mnMaxPage = nPage;
+}
+
+#endif // _SV_PRINTDLG_HXX_
+
diff --git a/svtools/inc/svtools/printoptions.hxx b/svtools/inc/svtools/printoptions.hxx
new file mode 100644
index 000000000000..5d95eb27949f
--- /dev/null
+++ b/svtools/inc/svtools/printoptions.hxx
@@ -0,0 +1,124 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_SVTOOLS_PRINTOPTIONS_HXX
+#define INCLUDED_SVTOOLS_PRINTOPTIONS_HXX
+
+#include "svtools/svtdllapi.h"
+#include <sal/types.h>
+#include <osl/mutex.hxx>
+#include <rtl/ustring.hxx>
+#include <unotools/options.hxx>
+
+class SvtPrintOptions_Impl;
+
+// -----------------------
+// - SvtBasePrintOptions -
+// -----------------------
+
+class PrinterOptions;
+
+class SVT_DLLPUBLIC SvtBasePrintOptions: public utl::detail::Options
+{
+protected:
+
+ SvtPrintOptions_Impl* m_pDataContainer;
+
+ void SetDataContainer( SvtPrintOptions_Impl* pDataContainer ) { m_pDataContainer = pDataContainer; }
+
+public:
+
+ static ::osl::Mutex& GetOwnStaticMutex();
+
+public:
+
+ SvtBasePrintOptions();
+ virtual ~SvtBasePrintOptions();
+
+ sal_Bool IsReduceTransparency() const;
+ sal_Int16 GetReducedTransparencyMode() const;
+ sal_Bool IsReduceGradients() const;
+ sal_Int16 GetReducedGradientMode() const;
+ sal_Int16 GetReducedGradientStepCount() const;
+ sal_Bool IsReduceBitmaps() const;
+ sal_Int16 GetReducedBitmapMode() const;
+ sal_Int16 GetReducedBitmapResolution() const;
+ sal_Bool IsReducedBitmapIncludesTransparency() const;
+ sal_Bool IsConvertToGreyscales() const;
+
+ void SetReduceTransparency( sal_Bool bState );
+ void SetReducedTransparencyMode( sal_Int16 nMode );
+ void SetReduceGradients( sal_Bool bState );
+ void SetReducedGradientMode( sal_Int16 nMode );
+ void SetReducedGradientStepCount( sal_Int16 nStepCount );
+ void SetReduceBitmaps( sal_Bool bState );
+ void SetReducedBitmapMode( sal_Int16 bState );
+ void SetReducedBitmapResolution( sal_Int16 nResolution );
+ void SetReducedBitmapIncludesTransparency( sal_Bool bState );
+ void SetConvertToGreyscales( sal_Bool bState );
+
+public:
+
+ void GetPrinterOptions( PrinterOptions& rOptions ) const;
+ void SetPrinterOptions( const PrinterOptions& rOptions );
+};
+
+// ---------------------
+// - SvtPrinterOptions -
+// ---------------------
+
+class SVT_DLLPUBLIC SvtPrinterOptions : public SvtBasePrintOptions
+{
+private:
+
+ static SvtPrintOptions_Impl* m_pStaticDataContainer; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount; /// internal ref count mechanism
+
+public:
+
+ SvtPrinterOptions();
+ virtual ~SvtPrinterOptions();
+};
+
+// -----------------------
+// - SvtPrintFileOptions -
+// -----------------------
+
+class SVT_DLLPUBLIC SvtPrintFileOptions : public SvtBasePrintOptions
+{
+private:
+
+ static SvtPrintOptions_Impl* m_pStaticDataContainer; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount; /// internal ref count mechanism
+
+public:
+
+ SvtPrintFileOptions();
+ virtual ~SvtPrintFileOptions();
+};
+
+#endif // INCLUDED_SVTOOLS_PRINTOPTIONS_HXX
diff --git a/svtools/inc/svtools/prnsetup.hxx b/svtools/inc/svtools/prnsetup.hxx
new file mode 100644
index 000000000000..8e1ced9ed1a0
--- /dev/null
+++ b/svtools/inc/svtools/prnsetup.hxx
@@ -0,0 +1,122 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _SV_PRNSETUP_HXX_
+#define _SV_PRNSETUP_HXX_
+
+#include "svtools/svtdllapi.h"
+
+#ifndef _VCL_DIALOG_HXX
+#include <vcl/dialog.hxx>
+#endif
+#ifndef _VCL_FIXED_HXX
+#include <vcl/fixed.hxx>
+#endif
+#ifndef _VCL_BUTTON_HXX
+#include <vcl/button.hxx>
+#endif
+#ifndef _VCL_GROUP_HXX
+#include <vcl/group.hxx>
+#endif
+#ifndef _VCL_LSTBOX_HXX
+#include <vcl/lstbox.hxx>
+#endif
+#ifndef _VCL_TIMER_HXX
+#include <vcl/timer.hxx>
+#endif
+#include <svtools/stdctrl.hxx>
+
+class Printer;
+class QueueInfo;
+
+// ----------------------
+// - PrinterSetupDialog -
+// ----------------------
+
+class SVT_DLLPUBLIC PrinterSetupDialog : public ModalDialog
+{
+private:
+ FixedLine maFlPrinter;
+ FixedText maFtName;
+ ListBox maLbName;
+ PushButton maBtnProperties;
+ PushButton maBtnOptions;
+ FixedText maFtStatus;
+ FixedInfo maFiStatus;
+ FixedText maFtType;
+ FixedInfo maFiType;
+ FixedText maFtLocation;
+ FixedInfo maFiLocation;
+ FixedText maFtComment;
+ FixedInfo maFiComment;
+ FixedLine maFlSepButton;
+ OKButton maBtnOK;
+ CancelButton maBtnCancel;
+ HelpButton maBtnHelp;
+ AutoTimer maStatusTimer;
+ Printer* mpPrinter;
+ Printer* mpTempPrinter;
+
+ SVT_DLLPRIVATE void ImplSetInfo();
+
+ DECL_DLLPRIVATE_LINK( ImplPropertiesHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplOptionsHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplChangePrinterHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplStatusHdl, Timer* );
+
+public:
+ PrinterSetupDialog( Window* pWindow );
+ ~PrinterSetupDialog();
+
+ void SetPrinter( Printer* pNewPrinter ) { mpPrinter = pNewPrinter; }
+ Printer* GetPrinter() const { return mpPrinter; }
+
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+
+ virtual short Execute();
+
+ void SetOptionsHdl( const Link& rLink );
+ const Link& GetOptionsHdl() const;
+};
+
+// --------------------------------------
+// - Hilfsfunktionen fuer Print-Dialoge -
+// --------------------------------------
+
+#define IMPL_PRINTDLG_STATUS_UPDATE 15000
+
+void ImplFillPrnDlgListBox( const Printer* pPrinter,
+ ListBox* pBox, PushButton* pPropBtn );
+void ImplFreePrnDlgListBox( ListBox* pBox, BOOL bClear = TRUE );
+Printer* ImplPrnDlgListBoxSelect( ListBox* pBox, PushButton* pPropBtn,
+ Printer* pPrinter, Printer* pTempPrinter );
+Printer* ImplPrnDlgUpdatePrinter( Printer* pPrinter, Printer* pTempPrinter );
+void ImplPrnDlgUpdateQueueInfo( ListBox* pBox, QueueInfo& rInfo );
+XubString ImplPrnDlgGetStatusText( const QueueInfo& rInfo );
+
+#endif // _SV_PRNSETUP_HXX_
diff --git a/svtools/inc/svtools/roadmapwizard.hxx b/svtools/inc/svtools/roadmapwizard.hxx
new file mode 100644
index 000000000000..5d8e0d9b01bb
--- /dev/null
+++ b/svtools/inc/svtools/roadmapwizard.hxx
@@ -0,0 +1,257 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef SVTOOLS_INC_ROADMAPWIZARD_HXX
+#define SVTOOLS_INC_ROADMAPWIZARD_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/wizardmachine.hxx>
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ struct RoadmapWizardImpl;
+ class RoadmapWizard;
+
+ struct RoadmapWizardTypes
+ {
+ public:
+ typedef sal_Int16 PathId;
+ typedef ::std::vector< WizardTypes::WizardState > WizardPath;
+ typedef TabPage* (* RoadmapPageFactory)( RoadmapWizard& );
+ };
+
+ //====================================================================
+ //= RoadmapWizard
+ //====================================================================
+ /** is - no, not a wizard for a raodmap, but the base class for wizards
+ <em>supporting</em> a roadmap.
+
+ The basic new concept introduced is a <em>path</em>:<br/>
+ A <em>path</em> is a sequence of states, which are to be executed in a linear order.
+ Elements in the path can be skipped, depending on choices the user makes.
+
+ In the most simple wizards, you will have only one path consisting of <code>n</code> elements,
+ which are to be visited successively.
+
+ In a slightly more complex wizard, you will have one linear path, were certain
+ steps might be skipped due to user input. For instance, the user may decide to not specify
+ certain aspects of the to-be-created object (e.g. by unchecking a check box),
+ and the wizard then will simply disable the step which corresponds to this step.
+
+ In a yet more advanced wizards, you will have several paths of length <code>n1</code> and
+ <code>n2</code>, which share at least the first <code>k</code> states (where <code>k</code>
+ is at least 1), and an arbitrary number of other states.
+ */
+ class SVT_DLLPUBLIC RoadmapWizard : public OWizardMachine, public RoadmapWizardTypes
+ {
+ private:
+ RoadmapWizardImpl* m_pImpl;
+
+ public:
+ RoadmapWizard(
+ Window* _pParent,
+ const ResId& _rRes,
+ sal_uInt32 _nButtonFlags = WZB_NEXT | WZB_PREVIOUS | WZB_FINISH | WZB_CANCEL | WZB_HELP
+ );
+ RoadmapWizard(
+ Window* _pParent,
+ const WinBits i_nStyle,
+ sal_uInt32 _nButtonFlags = WZB_NEXT | WZB_PREVIOUS | WZB_FINISH | WZB_CANCEL | WZB_HELP
+ );
+ ~RoadmapWizard( );
+
+ void SetRoadmapBitmap( const BitmapEx& _rBitmap );
+ const BitmapEx& GetRoadmapBitmap( ) const;
+
+ void SetRoadmapSmartHelpId( const SmartId& _rId, SmartIdUpdateMode _aMode = SMART_SET_SMART );
+ SmartId GetRoadmapSmartHelpId() const;
+
+ void SetRoadmapInteractive( sal_Bool _bInteractive );
+ sal_Bool IsRoadmapInteractive();
+ virtual void Resize();
+ virtual void StateChanged( StateChangedType nStateChange );
+
+ // returns whether a given state is enabled
+ bool isStateEnabled( WizardState _nState ) const;
+
+ // WizardDialog overridables
+ virtual bool canAdvance() const;
+ virtual void updateTravelUI();
+
+protected:
+ /** declares a valid path in the wizard
+
+ The very first path which is declared is automatically activated.
+
+ Note that all paths which are declared must have the very first state in
+ common. Also note that due to a restriction of the very base class (<type>WizardDialog</type>),
+ this common first state must be 0.
+
+ You cannot declare new paths once the wizard started, so it's recommended that
+ you do all declarations within your derivee's constructor.
+
+ @see activatePath
+
+ @param _nId
+ the unique id you wish to give this path. This id can later on be used
+ to refer to the path which you just declared
+
+ @param _nFirstState
+ the first state in this path. Must not be WZS_INVALID_STATE.<br/>
+ Declare an arbitrary number of states after this one, and terminate the sequence
+ with a WZS_INVALID_STATE.
+ */
+ void declarePath( PathId _nPathId, WizardState _nFirstState, ... );
+ void declarePath( PathId _nPathId, const WizardPath& _lWizardStates);
+
+ /** provides basic information about a state
+
+ The given display name is used in the default implementation of getStateDisplayName,
+ and the given factory is used in the default implementation of createPage.
+ */
+ void describeState( WizardState _nState, const String& _rStateDisplayName, RoadmapPageFactory _pPageFactory );
+
+ /** activates a path which has previously been declared with <member>declarePath</member>
+
+ You can only activate paths which share the first <code>k</code> states with the path
+ which is previously active (if any), where <code>k</code> is the index of the
+ current state within the current path.
+
+ <example>
+ Say you have paths, <code>(0,1,2,5)</code> and <code>(0,1,4,5)</code>. This means that after
+ step <code>1</code>, you either continue with state <code>2</code> or state <code>4</code>,
+ and after this, you finish in state <code>5</code>.<br/>
+ Now if the first path is active, and your current state is <code>1</code>, then you can
+ easily switch to the second path, since both paths start with <code>(0,1)</code>.<br/>
+ However, if your current state is <code>2</code>, then you can not switch to the second
+ path anymore.
+ </example>
+
+ @param _nPathId
+ the id of the path. The path must have been declared (under this id) with
+ <member>declarePath</member> before it can be activated.
+
+ @param _bDecideForIt
+ If <TRUE/>, the path will be completely activated, even if it is a conflicting path
+ (i.e. there is another path which shares the first <code>k</code> states with
+ the to-be-activated path.)<br/>
+ If <FALSE/>, then the new path is checked for conflicts with other paths. If such
+ conflicts exists, the path is not completely activated, but only up to the point
+ where it does <em>not</em> conflict.<br/>
+ With the paths in the example above, if you activate the second path (when both are
+ already declared), then only steps <code>0</code> and <code>1</code> are activated,
+ since they are common to both paths.
+ */
+ void activatePath( PathId _nPathId, bool _bDecideForIt = false );
+
+ /** determine the next state to travel from the given one
+
+ This method (which is declared in <type>OWizardMachine</type> and overwritten here)
+ ensures that traveling happens along the active path.
+
+ @see activatePath
+ */
+ virtual WizardState determineNextState( WizardState _nCurrentState ) const;
+
+ /** en- or disables a state
+
+ In the wizard's roadmap, states to travel to can be freely chosen. To prevent
+ users from selecting a state which is currently not available, you can declare this
+ state as being disabled.
+
+ A situation where you need this may be when you have a checkbox which, when checked
+ by the user, enables a page with additional settings. As long as this checkbox is
+ not checked, the respective state would be disabled.
+
+ Note that in theory, you can declare multiple paths, instead of disabling states.
+ For instance, if you have a path where one state can be potentially disabled, then
+ you could declare a second path, which does not contain this state. However, the
+ disadvantage is that then, not the complete path would be visible in the roadmap,
+ but only all steps up to the point where the both paths diverge.<br/>
+ Another disadvantage is that the number of needed paths grows exponentially with
+ the number of states which can be potentially disabled.
+
+ @see declarePath
+ */
+ void enableState( WizardState _nState, bool _bEnable = true );
+
+ /** returns true if and only if the given state is known in at least one declared path
+ */
+ bool knowsState( WizardState _nState ) const;
+
+ // OWizardMachine overriables
+ virtual void enterState( WizardState _nState );
+
+ /** returns a human readable name for a given state
+
+ There is a default implementation for this method, which returns the display name
+ as given in a call to describeState. If there is no description for the given state,
+ this is worth an assertion in a non-product build, and then an empty string is
+ returned.
+ */
+ virtual String getStateDisplayName( WizardState _nState ) const;
+
+ /** creates a page for a given state
+
+ This member is inherited from OWizardMachine, and default-implemented in this class
+ for all states which have been described using describeState.
+ */
+ virtual TabPage* createPage( WizardState _nState );
+
+ /** asks for a new label of the wizard page
+
+ */
+ void updateRoadmapItemLabel( WizardState _nState );
+
+ protected:
+#if OSL_DEBUG_LEVEL > 0
+ const sal_Char* checkInvariants() const;
+ friend const char* CheckInvariants( const void* pVoid );
+#endif
+
+ private:
+ SVT_DLLPRIVATE void ResizeFixedLine();
+
+ DECL_DLLPRIVATE_LINK( OnRoadmapItemSelected, void* );
+
+ /** updates the roadmap control to show the given path, as far as possible
+ (modulo conflicts with other paths)
+ */
+ SVT_DLLPRIVATE void implUpdateRoadmap( );
+
+ private:
+ SVT_DLLPRIVATE void impl_construct();
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // OOO_SVTOOLS_INC_ROADMAPWIZARD_HXX
diff --git a/svtools/inc/svtools/stdctrl.hxx b/svtools/inc/svtools/stdctrl.hxx
new file mode 100644
index 000000000000..4c0b794f78e3
--- /dev/null
+++ b/svtools/inc/svtools/stdctrl.hxx
@@ -0,0 +1,73 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _STDCTRL_HXX
+#define _STDCTRL_HXX
+
+#include "svtools/svtdllapi.h"
+
+#ifndef _EDIT_HXX
+#include <vcl/edit.hxx>
+#endif
+#ifndef _FIXED_HXX
+#include <vcl/fixed.hxx>
+#endif
+
+// -------------
+// - FixedInfo -
+// -------------
+
+class SVT_DLLPUBLIC FixedInfo : public FixedText
+{
+public:
+ FixedInfo( Window* pParent, WinBits nWinStyle = WB_LEFT );
+ FixedInfo( Window* pParent, const ResId& rResId );
+};
+
+namespace svt
+{
+ // ----------------------------
+ // - svt::SelectableFixedText -
+ // ----------------------------
+
+ class SVT_DLLPUBLIC SelectableFixedText : public Edit
+ {
+ private:
+ void Init();
+
+ public:
+ SelectableFixedText( Window* pParent, WinBits nWinStyle );
+ SelectableFixedText( Window* pParent, const ResId& rResId );
+ virtual ~SelectableFixedText();
+
+ virtual void LoseFocus();
+ };
+
+} // namespace svt
+
+#endif // _STDCTRL_HXX
+
diff --git a/svtools/inc/svtools/stringtransfer.hxx b/svtools/inc/svtools/stringtransfer.hxx
new file mode 100644
index 000000000000..9cfe75418a12
--- /dev/null
+++ b/svtools/inc/svtools/stringtransfer.hxx
@@ -0,0 +1,83 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _SVTOOLS_STRINGTRANSFER_HXX_
+#define _SVTOOLS_STRINGTRANSFER_HXX_
+
+#include "svtools/svtdllapi.h"
+#include <svtools/transfer.hxx>
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ //====================================================================
+ //= OStringTransferable
+ //====================================================================
+ class SVT_DLLPUBLIC OStringTransferable : public TransferableHelper
+ {
+ protected:
+ ::rtl::OUString m_sContent;
+
+ public:
+ OStringTransferable(const ::rtl::OUString& _rContent);
+
+ protected:
+ // TransferableHelper overridables
+ virtual void AddSupportedFormats();
+ virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& _rFlavor );
+ };
+
+ //====================================================================
+ //= OStringTransfer
+ //====================================================================
+ class OStringTransfer
+ {
+ public:
+ /** copies the string given into the system clipboard
+ <p>Beware: In opposite to the old DragServer::CopyString, this method does not <em>add</em> the string
+ to the clipboard, instead the old clipboard content is <em>replaced</em>!</p>
+ */
+ SVT_DLLPUBLIC static void CopyString( const ::rtl::OUString& _rContent, Window* _pWindow = NULL );
+
+ /** extracts a string from the system clipboard given
+ @return <TRUE/> if the extraction was successfull, i.e. if the clipboard contained a string content
+ */
+ SVT_DLLPUBLIC static sal_Bool PasteString( ::rtl::OUString& _rContent, Window* _pWindow = NULL );
+
+ /** starts dragging a simple string
+ */
+ SVT_DLLPUBLIC static void StartStringDrag( const ::rtl::OUString& _rContent, Window* _pWindow, sal_Int8 _nDragSourceActions );
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // _SVTOOLS_STRINGTRANSFER_HXX_
+
diff --git a/svtools/inc/svtools/svicnvw.hxx b/svtools/inc/svtools/svicnvw.hxx
new file mode 100644
index 000000000000..ac15f0b55be6
--- /dev/null
+++ b/svtools/inc/svtools/svicnvw.hxx
@@ -0,0 +1,291 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _SVICNVW_HXX
+#define _SVICNVW_HXX
+
+#ifndef _IMAGE_HXX
+#include <vcl/image.hxx>
+#endif
+#include <svtools/svlbox.hxx>
+
+class SvImpIconView;
+class SvLBoxEntry;
+class SvLBoxItem;
+class SvLBoxString;
+class SvLBoxContextBmp;
+class SvPtrarr;
+
+#define WB_ICON 0x0001
+#define WB_NAME 0x0002
+#define WB_TEXT 0x0004
+#define WB_FLOW 0x0008
+
+#define ICNVW_FLAG_POS_LOCKED 0x0001
+#define ICNVW_FLAG_USER1 0x1000
+#define ICNVW_FLAG_USER2 0x2000
+#define ICNVW_FLAG_USER3 0x4000
+#define ICNVW_FLAG_USER4 0x8000
+
+enum SvIconViewTextMode
+{
+ ShowTextFull = 1,
+ ShowTextShort,
+ ShowTextSmart, // not implemented
+ ShowTextDontKnow // nur fuer Eintraege (->Einstellung der View
+ // wird genommen)
+};
+
+class SvIcnVwDataEntry : public SvViewDataEntry
+{
+friend class SvImpIconView;
+ USHORT nIcnVwFlags;
+ SvIconViewTextMode eTextMode;
+public:
+ Rectangle aRect; // Bounding-Rect des Entries
+ Rectangle aGridRect; // gesetzt im Grid-Modus
+ Size aTextSize; // nur gesetzt im Grid-Modus
+ USHORT nX,nY; // fuer Tastatursteuerung
+ SvIcnVwDataEntry();
+ virtual ~SvIcnVwDataEntry();
+
+ BOOL IsEntryPosLocked() const { return (BOOL)((nIcnVwFlags & ICNVW_FLAG_POS_LOCKED) !=0); }
+ void ClearVwFlags( USHORT nMask ) { nIcnVwFlags &= (~nMask); }
+ void SetVwFlags( USHORT nMask ) { nIcnVwFlags |= nMask; }
+ USHORT GetVwFlags() const { return nIcnVwFlags; }
+ SvIconViewTextMode GetTextMode() const { return eTextMode; }
+};
+
+#define SV_LISTBOX_ID_ICONVIEW 2
+
+class SvIconView : public SvLBox
+{
+ friend class SvImpIconView;
+
+ SvImpIconView* pImp;
+ Image aCollapsedEntryBmp;
+ Image aExpandedEntryBmp;
+ WinBits nWinBits;
+ USHORT nIcnVwFlags;
+ void SetModel( SvLBoxTreeList* );
+
+protected:
+
+ using SvLBox::CreateEntry;
+ SvLBoxEntry* CreateEntry( const XubString&, const Image&, const Image&);
+ void ViewDataInitialized( SvLBoxEntry* );
+ virtual SvViewData* CreateViewData( SvListEntry* );
+ virtual void InitViewData( SvViewData* pData, SvListEntry* pEntry );
+
+ void EditingRequest(SvLBoxEntry*,SvLBoxItem*,const Point& );
+ void EditedText( const XubString& );
+ void EditItemText( SvLBoxEntry*,SvLBoxItem*,const Selection& );
+ SvLBoxEntry* pCurEdEntry;
+ SvLBoxItem* pCurEdItem;
+
+ virtual void WriteDragServerInfo( const Point&, SvLBoxDDInfo* );
+ virtual void ReadDragServerInfo( const Point&, SvLBoxDDInfo* );
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void PreparePaint( SvLBoxEntry* );
+
+public:
+
+ SvIconView( Window* pParent,WinBits nWinStyle=0 );
+ SvIconView( Window* pParent,const ResId& rResId );
+ ~SvIconView();
+
+ void DisconnectFromModel();
+
+ SvLBoxEntry* InsertEntry( const XubString& rText, SvLBoxEntry* pParent = 0,
+ BOOL bChildsOnDemand = FALSE,
+ ULONG nPos=LIST_APPEND );
+
+ SvLBoxEntry* InsertEntry( const XubString& rText,
+ const Image& rExpandedEntryBmp,
+ const Image& rCollapsedEntryBmp,
+ SvLBoxEntry* pParent = 0,
+ BOOL bChildsOnDemand = FALSE,
+ ULONG nPos = LIST_APPEND );
+
+ const Image& GetDefaultExpandedEntryBmp() const { return aExpandedEntryBmp;}
+ const Image& GetDefaultCollapsedEntryBmp() const { return aCollapsedEntryBmp;}
+ void SetDefaultExpandedEntryBmp( const Image& rBmp) { aExpandedEntryBmp=rBmp;}
+ void SetDefaultCollapsedEntryBmp( const Image& rBmp ) { aCollapsedEntryBmp=rBmp;}
+
+ void SetEntryText(SvLBoxEntry*, const XubString& );
+ void SetExpandedEntryBmp(SvLBoxEntry*, const Image& );
+ void SetCollapsedEntryBmp(SvLBoxEntry*, const Image& );
+
+ XubString GetEntryText(SvLBoxEntry*) const;
+ Image GetExpandedEntryBmp(SvLBoxEntry*) const;
+ Image GetCollapsedEntryBmp(SvLBoxEntry*) const;
+
+ virtual SvLBoxEntry* CloneEntry( SvLBoxEntry* pSource );
+
+ virtual USHORT IsA();
+
+ virtual void RequestingChilds( SvLBoxEntry* pParent );
+
+ virtual void Paint( const Rectangle& rRect );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void Resize();
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ void SetUpdateMode( BOOL );
+
+ using SvListView::SetModel;
+ virtual void SetModel( SvLBoxTreeList*, SvLBoxEntry* pParent );
+ virtual void ModelHasCleared();
+ virtual void ModelHasInserted( SvListEntry* pEntry );
+ virtual void ModelHasInsertedTree( SvListEntry* pEntry );
+ virtual void ModelIsMoving(SvListEntry* pSource,
+ SvListEntry* pTargetParent, ULONG nChildPos );
+ virtual void ModelHasMoved(SvListEntry* pSource );
+ virtual void ModelIsRemoving( SvListEntry* pEntry );
+ virtual void ModelHasRemoved( SvListEntry* pEntry );
+ virtual void ModelHasEntryInvalidated( SvListEntry* pEntry );
+
+ virtual void ShowTargetEmphasis( SvLBoxEntry*, BOOL bShow );
+ using Window::GetDropTarget;
+ virtual SvLBoxEntry* GetDropTarget( const Point& );
+ virtual Region GetDragRegion() const;
+ // NotifyMoving/Copying ueberladen, da wir bei GetDropTarget
+ // einen "magic pointer" zurueckgeben, falls in einen leeren
+ // Bereich auf der IconView gedroppt wird.
+ virtual BOOL NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
+ SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos);
+ virtual BOOL NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
+ SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos);
+
+ // gibt TopLeft des BoundingRects zurueck
+ // Konvertierung in Fensterposition: MapMode.Origin addieren
+ Point GetEntryPosition( SvLBoxEntry* ) const;
+ void SetEntryPosition( SvLBoxEntry*, const Point& rDocPos);
+ void SetEntryPosition( SvLBoxEntry*, const Point& rDocPos,
+ BOOL bAdjustAtGrid );
+
+ void SetFont( const Font& rFont );
+ void SetDefaultFont();
+
+ using SvLBox::GetEntry;
+ SvLBoxEntry* GetEntry( const Point& rPixPos, BOOL ) const;
+ // Gibt den naechsten ueber pCurEntry liegenden Eintrag (ZOrder)
+ SvLBoxEntry* GetNextEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, BOOL ) const;
+ // Gibt den naechsten unter pCurEntry liegenden Eintrag (ZOrder)
+ SvLBoxEntry* GetPrevEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, BOOL ) const;
+
+ SvLBoxEntry* GetEntryFromLogicPos( const Point& rDocPos ) const;
+
+ void SetWindowBits( WinBits nWinStyle );
+ virtual void PaintEntry( SvLBoxEntry* );
+ virtual void PaintEntry( SvLBoxEntry*, const Point& rDocPos );
+ Rectangle GetFocusRect( SvLBoxEntry* );
+ void InvalidateEntry( SvLBoxEntry* );
+ void MakeVisible( SvLBoxEntry* );
+
+ void SetDragDropMode( DragDropMode );
+ void SetSelectionMode( SelectionMode );
+
+ using SvListView::Select;
+ BOOL Select( SvLBoxEntry* pEntry, BOOL bSelect=TRUE );
+ void SelectAll( BOOL bSelect, BOOL bPaint=TRUE );
+ virtual void SetCurEntry( SvLBoxEntry* _pEntry );
+ virtual SvLBoxEntry*
+ GetCurEntry() const;
+
+ // logische Koordinaten
+ void SelectRect(
+ const Rectangle& rRect,
+ BOOL bAdd = FALSE,
+ // die Schnittmenge mit rRect wird invertiert
+ // wird bei bAdd == FALSE ignoriert
+ SvPtrarr* pOtherRects = 0,
+ short nBorderOffs = -5 );
+ ULONG GetSelectionCount() const;
+
+ virtual void Arrange();
+ void SetSpaceBetweenEntries( long nHor, long Ver );
+ long GetHorSpaceBetweenEntries();
+ long GetVerSpaceBetweenEntries();
+
+ void EnableInplaceEditing( BOOL bEnable );
+ void EditEntry( SvLBoxEntry* pEntry = 0 );
+ virtual BOOL EditingEntry( SvLBoxEntry* pEntry, Selection& );
+ virtual BOOL EditedEntry( SvLBoxEntry*, const XubString& rNewText );
+
+ void SetCurParent( SvLBoxEntry* pNewParent );
+ SvLBoxEntry* GetCurParent() const;
+
+ virtual void ModelNotification( USHORT nActionId, SvListEntry* pEntry1,
+ SvListEntry* pEntry2, ULONG nPos );
+
+ // 0,0: Grid-Modus ausschalten
+ void SetGrid( long nDX, long nDY );
+
+ // nDeltaY < 0 : View bewegt sich auf dem Doc nach oben
+ // nDeltaY > 0 : View bewegt sich auf dem Doc nach unten
+ // nDeltaX < 0 : View bewegt sich auf dem Doc nach links
+ // nDeltaX > 0 : View bewegt sich auf dem Doc nach rechts
+ using Window::Scroll;
+ virtual void Scroll( long nDeltaX, long nDeltaY, USHORT nFlags = 0 );
+
+ virtual void PrepareCommandEvent( const CommandEvent& );
+ virtual void StartDrag( sal_Int8 nAction, const Point& );
+ virtual void DragFinished( sal_Int8 );
+ virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
+ using SvLBox::ExecuteDrop;
+ virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
+
+ void ShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPos );
+ void HideDDIcon();
+ void HideShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPos );
+
+ // fuers Scrollen beim D&D
+ void CalcScrollOffsets(
+ const Point& rRefPosPixel,
+ long& rScrollX,
+ long& rScrollY,
+ BOOL bInDragDrop = FALSE,
+ USHORT nBorderWidth = 10 );
+
+ using Window::EndTracking;
+ void EndTracking();
+ void AdjustAtGrid( SvLBoxEntry* pEntry = 0 );
+ void LockEntryPos( SvLBoxEntry* pEntry, BOOL bLock = TRUE );
+ BOOL IsEntryPosLocked( const SvLBoxEntry* pEntry ) const;
+
+ void SetTextMode( SvIconViewTextMode, SvLBoxEntry* pEntry = 0 );
+ SvIconViewTextMode GetTextMode( const SvLBoxEntry* pEntry = 0 ) const;
+
+ void ShowFocusRect( const SvLBoxEntry* pEntry );
+};
+
+#endif
+
diff --git a/svtools/inc/svtools/svlbitm.hxx b/svtools/inc/svtools/svlbitm.hxx
new file mode 100644
index 000000000000..c28b8d5db10c
--- /dev/null
+++ b/svtools/inc/svtools/svlbitm.hxx
@@ -0,0 +1,297 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+
+#ifndef _SVLBOXITM_HXX
+#define _SVLBOXITM_HXX
+
+#include "svtools/svtdllapi.h"
+
+#ifndef LINK_HXX
+#include <tools/link.hxx>
+#endif
+
+#ifndef _IMAGE_HXX
+#include <vcl/image.hxx>
+#endif
+#include <svtools/svlbox.hxx>
+
+class SvLBoxEntry;
+
+#define SV_ITEM_ID_LBOXSTRING 1
+#define SV_ITEM_ID_LBOXBMP 2
+#define SV_ITEM_ID_LBOXBUTTON 3
+#define SV_ITEM_ID_LBOXCONTEXTBMP 4
+
+enum SvButtonState { SV_BUTTON_UNCHECKED, SV_BUTTON_CHECKED, SV_BUTTON_TRISTATE };
+
+#define SV_BMP_UNCHECKED 0
+#define SV_BMP_CHECKED 1
+#define SV_BMP_TRISTATE 2
+#define SV_BMP_HIUNCHECKED 3
+#define SV_BMP_HICHECKED 4
+#define SV_BMP_HITRISTATE 5
+#define SV_BMP_STATICIMAGE 6
+
+struct SvLBoxButtonData_Impl;
+
+class SVT_DLLPUBLIC SvLBoxButtonData
+{
+private:
+ Link aLink;
+ long nWidth;
+ long nHeight;
+ SvLBoxButtonData_Impl* pImpl;
+ BOOL bDataOk;
+ SvButtonState eState;
+
+ SVT_DLLPRIVATE void SetWidthAndHeight();
+ SVT_DLLPRIVATE void InitData( BOOL bImagesFromDefault,
+ bool _bRadioBtn, const Control* pControlForSettings = NULL );
+public:
+ // include creating default images (CheckBox or RadioButton)
+ SvLBoxButtonData( const Control* pControlForSettings );
+ SvLBoxButtonData( const Control* pControlForSettings, bool _bRadioBtn );
+
+ SvLBoxButtonData();
+ ~SvLBoxButtonData();
+
+ USHORT GetIndex( USHORT nItemState );
+ inline long Width();
+ inline long Height();
+ void SetLink( const Link& rLink) { aLink=rLink; }
+ const Link& GetLink() const { return aLink; }
+ BOOL IsRadio();
+ // weil Buttons nicht von LinkHdl abgeleitet sind
+ void CallLink();
+
+ void StoreButtonState( SvLBoxEntry* pEntry, USHORT nItemFlags );
+ SvButtonState ConvertToButtonState( USHORT nItemFlags ) const;
+
+ inline SvButtonState GetActButtonState() const;
+ SvLBoxEntry* GetActEntry() const;
+
+ Image aBmps[24]; // Indizes siehe Konstanten BMP_ ....
+
+ void SetDefaultImages( const Control* pControlForSettings = NULL );
+ // set images acording to the color scheeme of the Control
+ // pControlForSettings == NULL: settings are taken from Application
+ BOOL HasDefaultImages( void ) const;
+};
+
+inline long SvLBoxButtonData::Width()
+{
+ if ( !bDataOk )
+ SetWidthAndHeight();
+ return nWidth;
+}
+
+inline long SvLBoxButtonData::Height()
+{
+ if ( !bDataOk )
+ SetWidthAndHeight();
+ return nHeight;
+}
+
+inline SvButtonState SvLBoxButtonData::GetActButtonState() const
+{
+ return eState;
+}
+
+// **********************************************************************
+
+class SVT_DLLPUBLIC SvLBoxString : public SvLBoxItem
+{
+ XubString aStr;
+public:
+ SvLBoxString( SvLBoxEntry*,USHORT nFlags,const XubString& rStr);
+ SvLBoxString();
+ virtual ~SvLBoxString();
+ virtual USHORT IsA();
+ void InitViewData( SvLBox*,SvLBoxEntry*,SvViewDataItem* );
+ XubString GetText() const { return aStr; }
+ void SetText( SvLBoxEntry*, const XubString& rStr );
+ void Paint( const Point&, SvLBox& rDev, USHORT nFlags,SvLBoxEntry* );
+ SvLBoxItem* Create() const;
+ void Clone( SvLBoxItem* pSource );
+};
+
+class SvLBoxBmp : public SvLBoxItem
+{
+ Image aBmp;
+public:
+ SvLBoxBmp( SvLBoxEntry*, USHORT nFlags, Image );
+ SvLBoxBmp();
+ virtual ~SvLBoxBmp();
+ virtual USHORT IsA();
+ void InitViewData( SvLBox*,SvLBoxEntry*,SvViewDataItem* );
+ void SetBitmap( SvLBoxEntry*, Image );
+ void Paint( const Point&, SvLBox& rView, USHORT nFlags,SvLBoxEntry* );
+ SvLBoxItem* Create() const;
+ void Clone( SvLBoxItem* pSource );
+};
+
+
+#define SV_ITEMSTATE_UNCHECKED 0x0001
+#define SV_ITEMSTATE_CHECKED 0x0002
+#define SV_ITEMSTATE_TRISTATE 0x0004
+#define SV_ITEMSTATE_HILIGHTED 0x0008
+#define SV_STATE_MASK 0xFFF8 // zum Loeschen von UNCHECKED,CHECKED,TRISTATE
+
+enum SvLBoxButtonKind
+{
+ SvLBoxButtonKind_enabledCheckbox,
+ SvLBoxButtonKind_disabledCheckbox,
+ SvLBoxButtonKind_staticImage
+};
+
+class SVT_DLLPUBLIC SvLBoxButton : public SvLBoxItem
+{
+ SvLBoxButtonData* pData;
+ SvLBoxButtonKind eKind;
+ USHORT nItemFlags;
+ USHORT nImgArrOffs;
+ USHORT nBaseOffs;
+public:
+ // An SvLBoxButton can be of three different kinds: an
+ // enabled checkbox (the normal kind), a disabled checkbox
+ // (which cannot be modified via UI), or a static image
+ // (see SV_BMP_STATICIMAGE; nFlags are effectively ignored
+ // for that kind).
+ SvLBoxButton( SvLBoxEntry* pEntry,
+ SvLBoxButtonKind eTheKind, USHORT nFlags,
+ SvLBoxButtonData* pBData );
+ SvLBoxButton();
+ virtual ~SvLBoxButton();
+ void InitViewData( SvLBox*,SvLBoxEntry*,SvViewDataItem* );
+ virtual USHORT IsA();
+ void Check( SvLBox* pView, SvLBoxEntry*, BOOL bCheck );
+ virtual BOOL ClickHdl(SvLBox* pView, SvLBoxEntry* );
+ void Paint( const Point&, SvLBox& rView, USHORT nFlags,SvLBoxEntry* );
+ SvLBoxItem* Create() const;
+ void Clone( SvLBoxItem* pSource );
+ USHORT GetButtonFlags() const { return nItemFlags; }
+ BOOL IsStateChecked() const { return (BOOL)(nItemFlags & SV_ITEMSTATE_CHECKED)!=0; }
+ BOOL IsStateUnchecked() const { return (BOOL)(nItemFlags & SV_ITEMSTATE_UNCHECKED)!=0; }
+ BOOL IsStateTristate() const { return (BOOL)(nItemFlags & SV_ITEMSTATE_TRISTATE)!=0; }
+ BOOL IsStateHilighted() const { return (BOOL)(nItemFlags & SV_ITEMSTATE_HILIGHTED)!=0; }
+ void SetStateChecked();
+ void SetStateUnchecked();
+ void SetStateTristate();
+ void SetStateHilighted( BOOL bHilight );
+
+ SvLBoxButtonKind GetKind() const { return eKind; }
+
+ void SetBaseOffs( USHORT nOffs ) { nBaseOffs = nOffs; }
+ USHORT GetBaseOffs() const { return nBaseOffs; }
+
+ // Check whether this button can be modified via UI, sounding a beep if it
+ // cannot be modified:
+ bool CheckModification() const;
+};
+
+inline void SvLBoxButton::SetStateChecked()
+{
+ nItemFlags &= SV_STATE_MASK;
+ nItemFlags |= SV_ITEMSTATE_CHECKED;
+}
+inline void SvLBoxButton::SetStateUnchecked()
+{
+ nItemFlags &= SV_STATE_MASK;
+ nItemFlags |= SV_ITEMSTATE_UNCHECKED;
+}
+inline void SvLBoxButton::SetStateTristate()
+{
+ nItemFlags &= SV_STATE_MASK;
+ nItemFlags |= SV_ITEMSTATE_TRISTATE;
+}
+inline void SvLBoxButton::SetStateHilighted( BOOL bHilight )
+{
+ if ( bHilight )
+ nItemFlags |= SV_ITEMSTATE_HILIGHTED;
+ else
+ nItemFlags &= ~SV_ITEMSTATE_HILIGHTED;
+}
+
+
+struct SvLBoxContextBmp_Impl;
+class SVT_DLLPUBLIC SvLBoxContextBmp : public SvLBoxItem
+{
+ SvLBoxContextBmp_Impl* m_pImpl;
+public:
+ SvLBoxContextBmp( SvLBoxEntry*,USHORT nFlags,Image,Image,
+ USHORT nEntryFlagsBmp1);
+ SvLBoxContextBmp();
+ virtual ~SvLBoxContextBmp();
+ virtual USHORT IsA();
+ void InitViewData( SvLBox*,SvLBoxEntry*,SvViewDataItem* );
+ void Paint( const Point&, SvLBox& rView, USHORT nFlags,SvLBoxEntry* );
+ SvLBoxItem* Create() const;
+ void Clone( SvLBoxItem* pSource );
+
+
+ BOOL SetModeImages( const Image& _rBitmap1, const Image& _rBitmap2, BmpColorMode _eMode = BMP_COLOR_NORMAL );
+ void GetModeImages( Image& _rBitmap1, Image& _rBitmap2, BmpColorMode _eMode = BMP_COLOR_NORMAL ) const;
+
+ inline void SetBitmap1( const Image& _rImage, BmpColorMode _eMode = BMP_COLOR_NORMAL );
+ inline void SetBitmap2( const Image& _rImage, BmpColorMode _eMode = BMP_COLOR_NORMAL );
+ inline const Image& GetBitmap1( BmpColorMode _eMode = BMP_COLOR_NORMAL ) const;
+ inline const Image& GetBitmap2( BmpColorMode _eMode = BMP_COLOR_NORMAL ) const;
+
+private:
+ Image& implGetImageStore( sal_Bool _bFirst, BmpColorMode _eMode );
+};
+
+inline void SvLBoxContextBmp::SetBitmap1( const Image& _rImage, BmpColorMode _eMode )
+{
+ implGetImageStore( sal_True, _eMode ) = _rImage;
+}
+
+inline void SvLBoxContextBmp::SetBitmap2( const Image& _rImage, BmpColorMode _eMode )
+{
+ implGetImageStore( sal_False, _eMode ) = _rImage;
+}
+
+inline const Image& SvLBoxContextBmp::GetBitmap1( BmpColorMode _eMode ) const
+{
+ Image& rImage = const_cast< SvLBoxContextBmp* >( this )->implGetImageStore( sal_True, _eMode );
+ if ( !rImage )
+ // fallback to the "normal" image
+ rImage = const_cast< SvLBoxContextBmp* >( this )->implGetImageStore( sal_True, BMP_COLOR_NORMAL );
+ return rImage;
+}
+
+inline const Image& SvLBoxContextBmp::GetBitmap2( BmpColorMode _eMode ) const
+{
+ Image& rImage = const_cast< SvLBoxContextBmp* >( this )->implGetImageStore( sal_False, _eMode );
+ if ( !rImage )
+ // fallback to the "normal" image
+ rImage = const_cast< SvLBoxContextBmp* >( this )->implGetImageStore( sal_True, BMP_COLOR_NORMAL );
+ return rImage;
+}
+
+#endif
diff --git a/svtools/inc/svtools/svlbox.hxx b/svtools/inc/svtools/svlbox.hxx
new file mode 100644
index 000000000000..f33784f45397
--- /dev/null
+++ b/svtools/inc/svtools/svlbox.hxx
@@ -0,0 +1,664 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _SVLBOX_HXX
+#define _SVLBOX_HXX
+
+#include "svtools/svtdllapi.h"
+
+#ifndef INCLUDED_DEQUE
+#include <deque>
+#define INCLUDED_DEQUE
+#endif
+
+#ifndef _CTRL_HXX
+#include <vcl/ctrl.hxx>
+#endif
+#include <vcl/seleng.hxx>
+#ifndef _EDIT_HXX
+#include <vcl/edit.hxx>
+#endif
+#include <vcl/timer.hxx>
+#ifndef _ACCEL_HXX
+#include <vcl/accel.hxx>
+#endif
+#include <vcl/mnemonicengine.hxx>
+#include <tools/gen.hxx>
+#include <svtools/treelist.hxx>
+#include <svl/svarray.hxx>
+#include <svtools/transfer.hxx>
+
+class Application;
+class SvLBox;
+class SvLBoxEntry;
+class SvViewDataItem;
+class SvViewDataEntry;
+class SvInplaceEdit;
+class SvInplaceEdit2;
+class SvLBoxString;
+class SvLBoxButton;
+class SvLBoxContextBmp;
+class SvLBoxBmp;
+struct SvLBoxDDInfo;
+
+namespace utl {
+ class AccessibleStateSetHelper;
+}
+
+// *********************************************************************
+// *************************** Tabulatoren *****************************
+// *********************************************************************
+
+#define SV_LBOXTAB_DYNAMIC 0x0001 // Ausgabespalte des Items verschiebt
+ // sich entsprechend Child-Tiefe
+#define SV_LBOXTAB_ADJUST_RIGHT 0x0002 // rechter Rand des Items am Tabulator
+#define SV_LBOXTAB_ADJUST_LEFT 0x0004 // linker Rand ...
+#define SV_LBOXTAB_ADJUST_CENTER 0x0008 // Item am Tabulator zentrieren
+#define SV_LBOXTAB_ADJUST_NUMERIC 0x0010 // Dezimalpunkt am Tabulator (Strings)
+
+// wird nicht mehr unterstuetzt! Fokus richtet sich jetzt nach Selektion!
+#define SV_LBOXTAB_SHOW_FOCUS 0x0020 // Fokus visualisieren
+
+#define SV_LBOXTAB_SHOW_SELECTION 0x0040 // Selektionszustand visualisieren
+ // Item muss umschliessendes Polygon
+ // zurueckgeben koennen (D&D-Cursor)
+#define SV_LBOXTAB_EDITABLE 0x0100 // Item an Tabulator editierbar
+#define SV_LBOXTAB_PUSHABLE 0x0200 // Item verhaelt sich wie ein Button
+#define SV_LBOXTAB_INV_ALWAYS 0x0400 // Hintergrund immer loeschen
+#define SV_LBOXTAB_FORCE 0x0800 // Default-Berechnung des ersten Tabulators
+ // (auf die sich Abo-Tabpage, Extras/Optionen/Anpassen,
+ // etc. verlassen) ausschalten. Die Position des ersten
+ // Tabs entspricht jetzt exakt den eingestellten Flags &
+ // Spaltenbreiten.
+
+class SvLBoxTab
+{
+ long nPos;
+ void* pUserData;
+public:
+ SvLBoxTab();
+ SvLBoxTab( long nPos, USHORT nFlags=SV_LBOXTAB_ADJUST_LEFT );
+ SvLBoxTab( const SvLBoxTab& );
+ ~SvLBoxTab();
+
+ USHORT nFlags;
+
+ void SetUserData( void* pPtr ) { pUserData = pPtr; }
+ void* GetUserData() const { return pUserData; }
+ BOOL IsDynamic() const { return (BOOL)((nFlags & SV_LBOXTAB_DYNAMIC)!=0); }
+ void SetPos( long nNewPos) { nPos = nNewPos; }
+ long GetPos() const { return nPos; }
+ long CalcOffset( long nItemLength, long nTabWidth );
+ // long CalcOffset( const String&, const OutputDevice& );
+ BOOL IsEditable() const { return (BOOL)((nFlags & SV_LBOXTAB_EDITABLE)!=0); }
+ BOOL IsPushable() const { return (BOOL)((nFlags & SV_LBOXTAB_PUSHABLE)!=0); }
+};
+
+// *********************************************************************
+// *********************** View-abhaengige Daten ***********************
+// *********************************************************************
+
+class SvViewDataItem
+{
+public:
+ Size aSize;
+ SvViewDataItem();
+ ~SvViewDataItem();
+};
+
+// View-abhaengige Daten fuer einen Entry werden in virtueller Fkt.
+// SvLBox::CreateViewData erzeugt. Die ViewDaten-Erzeugung von
+// Items kann nicht veraendert werden (wg. Array)
+class SvViewDataEntry : public SvViewData
+{
+public:
+ SvViewDataItem* pItemData; // ein Array von SvViewDataItems
+ USHORT nItmCnt; // Anzahl Items fuer delete-operator
+
+ SvViewDataEntry();
+ virtual ~SvViewDataEntry();
+};
+
+// *********************************************************************
+// ****************************** Items ********************************
+// *********************************************************************
+
+class SVT_DLLPUBLIC SvLBoxItem
+{
+public:
+ SvLBoxItem( SvLBoxEntry*, USHORT nFlags );
+ SvLBoxItem();
+ virtual ~SvLBoxItem();
+ virtual USHORT IsA() = 0;
+ const Size& GetSize( SvLBox* pView, SvLBoxEntry* pEntry );
+ const Size& GetSize( SvLBoxEntry*, SvViewDataEntry* );
+ const Size& GetSize( SvViewDataEntry* pData, USHORT nItemPos )
+ {
+ SvViewDataItem* pIData=pData->pItemData+nItemPos;
+ return pIData->aSize;
+ }
+
+ virtual void Paint( const Point& rPos, SvLBox& rOutDev,
+ USHORT nViewDataEntryFlags,
+ SvLBoxEntry* pEntry ) = 0;
+
+ virtual void InitViewData( SvLBox* pView, SvLBoxEntry* pEntry,
+ // wenn != 0 muss dieser Pointer benutzt werden!
+ // wenn == 0 muss er ueber die View geholt werden
+ SvViewDataItem* pViewData = 0) = 0;
+ virtual SvLBoxItem* Create() const = 0;
+ // view-abhaengige Daten werden nicht geklont
+ virtual void Clone( SvLBoxItem* pSource ) = 0;
+};
+
+// Flags, die am Model haengen
+#define SV_ENTRYFLAG_CHILDS_ON_DEMAND 0x0001
+#define SV_ENTRYFLAG_DISABLE_DROP 0x0002
+#define SV_ENTRYFLAG_IN_USE 0x0004
+// wird gesetzt, wenn RequestingChilds keine Childs gestzt hat
+#define SV_ENTRYFLAG_NO_NODEBMP 0x0008
+// Eintrag hatte oder hat Kinder
+#define SV_ENTRYFLAG_HAD_CHILDREN 0x0010
+
+#define SV_ENTRYFLAG_USER_FLAGS 0xF000
+#define SV_ENTRYFLAG_SEMITRANSPARENT 0x8000 // draw semi-transparent entry bitmaps
+
+class SVT_DLLPUBLIC SvLBoxEntry : public SvListEntry
+{
+ friend class SvLBox;
+
+ SvPtrarr aItems;
+ void* pUserData;
+ USHORT nEntryFlags;
+//#if 0 // _SOLAR__PRIVATE
+ SVT_DLLPRIVATE void DeleteItems_Impl();
+//#endif
+public:
+
+ SvLBoxEntry();
+ virtual ~SvLBoxEntry();
+
+ USHORT ItemCount() const { return (USHORT)aItems.Count(); }
+ // DARF NUR GERUFEN WERDEN, WENN DER EINTRAG NOCH NICHT IM MODEL
+ // EINGEFUEGT IST, DA SONST FUER DAS ITEM KEINE VIEW-ABHAENGIGEN
+ // DATEN ALLOZIERT WERDEN!
+ void AddItem( SvLBoxItem* pItem );
+ void ReplaceItem( SvLBoxItem* pNewItem, USHORT nPos );
+ SvLBoxItem* GetItem( USHORT nPos ) const { return (SvLBoxItem*)aItems.GetObject(nPos ); }
+ SvLBoxItem* GetFirstItem( USHORT nId );
+ USHORT GetPos( SvLBoxItem* pItem ) const { return aItems.GetPos( pItem ); }
+ void* GetUserData() const { return pUserData; }
+ void SetUserData( void* pPtr ) { pUserData = pPtr; }
+ virtual void Clone( SvListEntry* pSource );
+ void EnableChildsOnDemand( BOOL bEnable=TRUE );
+ BOOL HasChildsOnDemand() const { return (BOOL)((nEntryFlags & SV_ENTRYFLAG_CHILDS_ON_DEMAND)!=0); }
+ BOOL HasInUseEmphasis() const { return (BOOL)((nEntryFlags & SV_ENTRYFLAG_IN_USE)!=0); }
+
+ USHORT GetFlags() const { return nEntryFlags; }
+ void SetFlags( USHORT nFlags ) { nEntryFlags = nFlags; }
+};
+
+// *********************************************************************
+// ****************************** SvLBox *******************************
+// *********************************************************************
+
+#define WB_FORCE_SELECTION ((WinBits)0x8000)
+
+#define DragDropMode USHORT
+#define SV_DRAGDROP_NONE (DragDropMode)0x0000
+#define SV_DRAGDROP_CTRL_MOVE (DragDropMode)0x0001
+#define SV_DRAGDROP_CTRL_COPY (DragDropMode)0x0002
+#define SV_DRAGDROP_APP_MOVE (DragDropMode)0x0004
+#define SV_DRAGDROP_APP_COPY (DragDropMode)0x0008
+#define SV_DRAGDROP_APP_DROP (DragDropMode)0x0010
+// Entries duerfen ueber den obersten Eintrag gedroppt werden.
+// Das Drop-Target ist in diesem Fall 0
+#define SV_DRAGDROP_ENABLE_TOP (DragDropMode)0x0020
+
+DECLARE_SVTREELIST(SvLBoxTreeList, SvLBoxEntry*)
+
+#define SVLISTBOX_ID_LBOX 0 // fuer SvLBox::IsA()
+
+#define SVLBOX_IN_EDT 0x0001
+#define SVLBOX_EDT_ENABLED 0x0002
+#define SVLBOX_IS_EXPANDING 0x0004
+#define SVLBOX_IS_TRAVELSELECT 0x0008
+#define SVLBOX_TARGEMPH_VIS 0x0010
+#define SVLBOX_EDTEND_CALLED 0x0020
+
+class SvLBox;
+struct SvLBox_Impl
+{
+ bool m_bIsEmptyTextAllowed;
+ bool m_bEntryMnemonicsEnabled;
+ Link* m_pLink;
+ ::vcl::MnemonicEngine m_aMnemonicEngine;
+
+ SvLBox_Impl( SvLBox& _rBox );
+};
+
+class SVT_DLLPUBLIC SvLBox
+ :public Control
+ ,public SvListView
+ ,public DropTargetHelper
+ ,public DragSourceHelper
+ ,public ::vcl::IMnemonicEntryList
+{
+ friend class SvLBoxEntry;
+
+//#if 0 // _SOLAR__PRIVATE
+ DECL_DLLPRIVATE_LINK( TextEditEndedHdl_Impl, SvInplaceEdit2 * );
+ // Handler, der von TreeList zum Clonen eines Entries aufgerufen wird
+ DECL_DLLPRIVATE_LINK( CloneHdl_Impl, SvListEntry* );
+
+ // handler and methods for Drag - finished handler.
+ // The with get GetDragFinishedHdl() get link can set on the
+ // TransferDataContainer. This link is a callback for the DragFinished
+ // call. AddBox method is called from the GetDragFinishedHdl() and the
+ // remove is called in link callback and in the destructor. So it can't
+ // called to a deleted object.
+ SVT_DLLPRIVATE static void AddBoxToDDList_Impl( const SvLBox& rB );
+ SVT_DLLPRIVATE static void RemoveBoxFromDDList_Impl( const SvLBox& rB );
+ DECL_DLLPRIVATE_STATIC_LINK( SvLBox, DragFinishHdl_Impl, sal_Int8* );
+//#endif
+
+ DragDropMode nOldDragMode;
+
+protected:
+
+ WinBits nWindowStyle;
+ Link aExpandedHdl;
+ Link aExpandingHdl;
+ Link aSelectHdl;
+ Link aDeselectHdl;
+ Link aDoubleClickHdl;
+ SvLBoxEntry* pHdlEntry;
+ SvLBoxItem* pHdlItem;
+ SvLBoxEntry* pTargetEntry;
+
+ SvLBox_Impl* pLBoxImpl;
+
+ USHORT nImpFlags;
+ // Move/CopySelection: Position des aktuellen Eintrags in Selektionsliste
+ USHORT nCurEntrySelPos;
+
+ DragDropMode nDragDropMode;
+ SelectionMode eSelMode;
+ sal_Int8 nDragOptions;
+
+ BOOL CheckDragAndDropMode( SvLBox* pSource, sal_Int8 );
+ void ImplShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL bShow);
+ void EnableSelectionAsDropTarget( BOOL bEnable = TRUE,
+ BOOL bWithChilds = TRUE );
+ // standard impl gibt 0 zurueck; muss von abgeleiteten Klassen, die
+ // D&D unterstuetzen, ueberladen werden
+ using Window::GetDropTarget;
+ virtual SvLBoxEntry* GetDropTarget( const Point& );
+
+ // view-spezifische Daten in den Dragserver stellen
+ // wird an der Source-View aufgerufen (im BeginDrag-Handler)
+ virtual void WriteDragServerInfo( const Point&, SvLBoxDDInfo* );
+ // wird an der Target-View aufgerufen (im Drop-Handler)
+ virtual void ReadDragServerInfo( const Point&,SvLBoxDDInfo* );
+
+ // invalidate children on enable/disable
+ virtual void StateChanged( StateChangedType );
+
+ virtual ULONG Insert( SvLBoxEntry* pEnt,SvLBoxEntry* pPar,ULONG nPos=LIST_APPEND);
+ virtual ULONG Insert( SvLBoxEntry* pEntry,ULONG nRootPos = LIST_APPEND );
+ void InsertTree( SvLBoxEntry* pTree, SvLBoxEntry* pTarget) {pModel->InsertTree( pTree, pTarget ); }
+
+ // Inplace-Editing
+ SvInplaceEdit2* pEdCtrl;
+ void EnableInplaceEditing( BOOL bEnable){if(bEnable)nImpFlags|=SVLBOX_EDT_ENABLED; else nImpFlags&=~SVLBOX_EDT_ENABLED;}
+ BOOL IsInplaceEditingEnabled() const { return (BOOL)((nImpFlags&SVLBOX_EDT_ENABLED)!=0); }
+ virtual void EditingRequest( SvLBoxEntry* pEntry, SvLBoxItem* pItem,
+ const Point& rMousePos );
+ void EditText( const String&, const Rectangle&,const Selection&);
+ void EditText( const String&, const Rectangle&,const Selection&, BOOL bMulti);
+ void EditTextMultiLine( const String&, const Rectangle&,const Selection&);
+ void CancelTextEditing();
+ BOOL IsEditingActive() const { return (BOOL)((nImpFlags & SVLBOX_IN_EDT)!=0); }
+ BOOL EditingCanceled() const;
+ void EndEditing( BOOL bCancel = FALSE );
+ bool IsEmptyTextAllowed() const;
+ void ForbidEmptyText();
+ // Callback EditText
+ virtual void EditedText( const String& );
+
+ // Rueckgabewert muss von SvViewDataEntry abgeleitet sein!
+ virtual SvViewData* CreateViewData( SvListEntry* );
+ // InitViewData wird direkt nach CreateViewData aufgerufen
+ // In InitViewData ist der Entry noch nicht in die View eingefuegt!
+ virtual void InitViewData( SvViewData*, SvListEntry* pEntry );
+ // ruft fuer Items aller Entries InitViewData auf
+ void RecalcViewData();
+ // Callback von RecalcViewData
+ virtual void ViewDataInitialized( SvLBoxEntry* );
+
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual SvLBoxEntry* GetEntry( const Point& rPos, BOOL bHit=FALSE ) const;
+ virtual void ModelHasEntryInvalidated( SvListEntry* pEntry );
+
+ // handler and methods for Drag - finished handler. This link can be set
+ // to the TransferDataContainer. The AddBox/RemoveBox methods must be
+ // called before the StartDrag call.
+ // The Remove will be called from the handler, which then called
+ // DragFinish method. The Remove also called in the DTOR of the SvLBox -
+ // so it can't called to a deleted object.
+ Link GetDragFinishedHdl() const;
+
+ // for asynchronous D&D
+ sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt, SvLBox* pSourceView );
+
+ // IMnemonicEntryList
+ virtual const void* FirstSearchEntry( String& _rEntryText );
+ virtual const void* NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText );
+ virtual void SelectSearchEntry( const void* _pEntry );
+ virtual void ExecuteSearchEntry( const void* _pEntry );
+
+public:
+
+ SvLBox( Window* pParent, WinBits nWinStyle=0 );
+ SvLBox( Window* pParent, const ResId& rResId );
+ ~SvLBox();
+
+ SvLBoxTreeList* GetModel() const { return (SvLBoxTreeList*)pModel; }
+ using SvListView::SetModel;
+ void SetModel( SvLBoxTreeList* );
+ void DisconnectFromModel();
+
+ virtual USHORT IsA();
+ ULONG GetEntryCount() const {return pModel->GetEntryCount();}
+ SvLBoxEntry* First() const { return (SvLBoxEntry*)(pModel->First()); }
+ SvLBoxEntry* Next( SvLBoxEntry* pEntry, USHORT* pDepth=0 ) const { return (SvLBoxEntry*)(pModel->Next(pEntry,pDepth));}
+ SvLBoxEntry* Prev( SvLBoxEntry* pEntry, USHORT* pDepth=0 ) const { return (SvLBoxEntry*)(pModel->Prev(pEntry,pDepth));}
+ SvLBoxEntry* Last( USHORT* pDepth=0 ) const { return (SvLBoxEntry*)(pModel->Last(pDepth));}
+
+ SvLBoxEntry* FirstChild(SvLBoxEntry* pParent ) const { return (SvLBoxEntry*)(pModel->FirstChild(pParent)); }
+ SvLBoxEntry* NextSibling(SvLBoxEntry* pEntry ) const { return (SvLBoxEntry*)(pModel->NextSibling( pEntry )); }
+ SvLBoxEntry* PrevSibling(SvLBoxEntry* pEntry ) const { return (SvLBoxEntry*)(pModel->PrevSibling( pEntry )); }
+
+ SvLBoxEntry* FirstSelected() const { return (SvLBoxEntry*)SvListView::FirstSelected(); }
+ using SvListView::NextSelected;
+ SvLBoxEntry* NextSelected( SvLBoxEntry* pEntry ) const { return (SvLBoxEntry*)(SvListView::NextSelected(pEntry)); }
+ using SvListView::PrevSelected;
+ SvLBoxEntry* PrevSelected( SvLBoxEntry* pEntry ) const { return (SvLBoxEntry*)(SvListView::PrevSelected(pEntry)); }
+ SvLBoxEntry* LastSelected() const { return (SvLBoxEntry*)(SvListView::LastSelected()); }
+
+ BOOL CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget );
+ BOOL MoveSelection( SvLBox* pSource, SvLBoxEntry* pTarget );
+ BOOL MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pTarget, sal_Bool bAllowCopyFallback );
+ void RemoveSelection();
+
+ DragDropMode GetDragDropMode() const { return nDragDropMode; }
+ virtual void SetDragDropMode( DragDropMode );
+ SelectionMode GetSelectionMode() const { return eSelMode; }
+ virtual void SetSelectionMode( SelectionMode );
+
+ // pParent==0 -> Root-Ebene
+ SvLBoxEntry* GetEntry( SvLBoxEntry* pParent, ULONG nPos ) const { return (SvLBoxEntry*)(pModel->GetEntry(pParent,nPos)); }
+ SvLBoxEntry* GetEntry( ULONG nRootPos ) const { return (SvLBoxEntry*)(pModel->GetEntry(nRootPos)); }
+
+ SvLBoxEntry* GetEntryFromPath( const ::std::deque< sal_Int32 >& _rPath ) const;
+ void FillEntryPath( SvLBoxEntry* pEntry, ::std::deque< sal_Int32 >& _rPath ) const;
+ virtual String GetEntryText( SvLBoxEntry* pEntry ) const;
+
+ using Window::GetParent;
+ SvLBoxEntry* GetParent( SvLBoxEntry* pEntry ) const { return (SvLBoxEntry*)(pModel->GetParent(pEntry)); }
+ SvLBoxEntry* GetRootLevelParent(SvLBoxEntry* pEntry ) const { return (SvLBoxEntry*)(pModel->GetRootLevelParent( pEntry ));}
+
+ using Window::GetChildCount;
+ ULONG GetChildCount( SvLBoxEntry* pParent ) const { return pModel->GetChildCount(pParent); }
+ ULONG GetLevelChildCount( SvLBoxEntry* pParent ) const;
+
+ SvViewDataEntry* GetViewDataEntry( SvListEntry* pEntry ) const { return (SvViewDataEntry*)SvListView::GetViewData(pEntry); }
+ SvViewDataItem* GetViewDataItem( SvListEntry*, SvLBoxItem* ) const;
+
+ virtual void MakeVisible( SvLBoxEntry* pEntry );
+ void Clear();
+
+ /** enables or disables mnemonic characters in the entry texts.
+
+ If mnemonics are enabled, then entries are selected and made current when
+ there mnemonic character is pressed. If there are multiple entries with the
+ same mnemonic, the selection cycles between them.
+
+ Entries with an collapsed ancestor are not included in the calculation of
+ mnemonics. That is, if you press the accelerator key of an invisible
+ entry, then this entry is *not* selected.
+
+ Be aware that enabling mnemonics is the more expensive the more
+ entries you have in your list.
+ */
+ void EnableEntryMnemonics( bool _bEnable = true );
+ bool IsEntryMnemonicsEnabled() const;
+
+ /** handles the given key event.
+
+ At the moment, this merely checks for accelerator keys, if entry mnemonics
+ are enabled.
+
+ The method might come handy when you want to use keyboard acceleration
+ while the control does not have the focus.
+
+ When the key event describes the pressing of a shortcut for an entry,
+ then SelectSearchEntry resp. ExecuteSearchEntry are called.
+
+ @see IMnemonicEntryList
+ @see MnemonicEngine
+
+ @return
+ <TRUE/> if the event has been consumed, <FALSE/> otherwise.
+ */
+ bool HandleKeyInput( const KeyEvent& rKEvt );
+
+ virtual BOOL Expand( SvLBoxEntry* pParent );
+ virtual BOOL Collapse( SvLBoxEntry* pParent );
+ virtual BOOL Select( SvLBoxEntry* pEntry, BOOL bSelect=TRUE );
+ virtual ULONG SelectChilds( SvLBoxEntry* pParent, BOOL bSelect );
+ virtual void SelectAll( BOOL bSelect, BOOL bPaint=TRUE );
+
+ virtual void SetCurEntry( SvLBoxEntry* _pEntry ) = 0;
+ virtual SvLBoxEntry*
+ GetCurEntry() const = 0;
+
+ // Model
+ void SetInUseEmphasis( SvLBoxEntry* pEntry, BOOL bInUse=TRUE);
+ // View
+ void SetCursorEmphasis( SvLBoxEntry* pEntry, BOOL bCursored=TRUE);
+ BOOL HasCursorEmphasis( SvLBoxEntry* pEntry ) const;
+
+ void SetSelectHdl( const Link& rNewHdl ) {aSelectHdl=rNewHdl; }
+ void SetDeselectHdl( const Link& rNewHdl ) {aDeselectHdl=rNewHdl; }
+ void SetDoubleClickHdl(const Link& rNewHdl) {aDoubleClickHdl=rNewHdl;}
+ const Link& GetSelectHdl() const { return aSelectHdl; }
+ const Link& GetDeselectHdl() const { return aDeselectHdl; }
+ const Link& GetDoubleClickHdl() const { return aDoubleClickHdl; }
+ void SetExpandingHdl(const Link& rNewHdl){aExpandingHdl=rNewHdl;}
+ void SetExpandedHdl(const Link& rNewHdl){aExpandedHdl=rNewHdl;}
+ const Link& GetExpandingHdl() const { return aExpandingHdl; }
+
+ virtual void ExpandedHdl();
+ virtual long ExpandingHdl();
+ virtual void SelectHdl();
+ virtual void DeselectHdl();
+ virtual BOOL DoubleClickHdl();
+ BOOL IsTravelSelect() const { return (BOOL)((nImpFlags&SVLBOX_IS_TRAVELSELECT)!=0);}
+ SvLBoxEntry* GetHdlEntry() const { return pHdlEntry; }
+ SvLBoxItem* GetHdlItem() const;
+
+ // wird aufgerufen, wenn ein Eintrag mit gesetztem
+ // ENTRYFLAG_CHILDS_ON_DEMAND expandiert wird.
+ virtual void RequestingChilds( SvLBoxEntry* pParent );
+
+ // Drag & Drop
+
+ //JP 28.3.2001: new Drag & Drop API
+ virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
+ virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
+ virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
+ virtual DragDropMode NotifyStartDrag( TransferDataContainer& rData,
+ SvLBoxEntry* );
+ virtual void DragFinished( sal_Int8 nDropAction );
+ virtual BOOL NotifyAcceptDrop( SvLBoxEntry* );
+
+ void SetDragOptions( sal_Int8 nOptions ) { nDragOptions = nOptions; }
+ sal_Int8 GetDragOptions() const { return nDragOptions; }
+
+ SvLBox* GetSourceView() const;
+ SvLBox* GetTargetView() const;
+
+ virtual void NotifyRemoving( SvLBoxEntry* );
+ virtual void ShowTargetEmphasis( SvLBoxEntry*, BOOL bShow );
+ virtual SvLBoxEntry* CloneEntry( SvLBoxEntry* pSource );
+ virtual SvLBoxEntry* CreateEntry() const; // zum 'new'en von Entries
+
+ // Rueckgabe: TRUE==Ok, FALSE==Abbrechen
+ virtual BOOL NotifyMoving(
+ SvLBoxEntry* pTarget, // D&D-Drop-Position in this->GetModel()
+ SvLBoxEntry* pEntry, // Zu verschiebender Entry aus
+ // GetSourceListBox()->GetModel()
+ SvLBoxEntry*& rpNewParent, // Neuer Target-Parent
+ ULONG& rNewChildPos); // Position in Childlist des Target-Parents
+
+ // Rueckgabe: TRUE==Ok, FALSE==Abbrechen
+ virtual BOOL NotifyCopying(
+ SvLBoxEntry* pTarget, // D&D-Drop-Position in this->GetModel()
+ SvLBoxEntry* pEntry, // Zu kopierender Entry aus
+ // GetSourceListBox()->GetModel()
+ SvLBoxEntry*& rpNewParent, // Neuer Target-Parent
+ ULONG& rNewChildPos); // Position in Childlist des Target-Parents
+
+ // ACCESSIBILITY ==========================================================
+
+ /** Creates and returns the accessible object of the Box. */
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible > CreateAccessible();
+
+ /** Fills the StateSet with all states (except DEFUNC, done by the accessible object). */
+ virtual void FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& rStateSet ) const;
+
+ /** Calculate and returns the bounding rectangle of an entry.
+ @param pEntry
+ The entry.
+ @return The bounding rectangle of an entry. */
+ virtual Rectangle GetBoundingRect( SvLBoxEntry* pEntry );
+
+protected:
+ using SvListView::Expand;
+ using SvListView::Collapse;
+ using SvListView::Select;
+ using SvListView::SelectChilds;
+ using SvListView::SelectAll;
+};
+
+#define SV_LBOX_DD_FORMAT "SV_LBOX_DD_FORMAT"
+struct SvLBoxDDInfo
+{
+ Application* pApp;
+ SvLBox* pSource;
+ SvLBoxEntry* pDDStartEntry;
+ // relative Position im Eintrag bei Drag-Beginn (IconView)
+ long nMouseRelX,nMouseRelY;
+ ULONG nRes1,nRes2,nRes3,nRes4;
+};
+
+class SvInplaceEdit : public Edit
+{
+ Link aCallBackHdl;
+ Accelerator aAccReturn;
+ Accelerator aAccEscape;
+ Timer aTimer;
+ BOOL bCanceled;
+ BOOL bAlreadyInCallBack;
+
+//#if 0 // _SOLAR__PRIVATE
+ void CallCallBackHdl_Impl();
+ DECL_LINK( Timeout_Impl, Timer * );
+ DECL_LINK( ReturnHdl_Impl, Accelerator * );
+ DECL_LINK( EscapeHdl_Impl, Accelerator * );
+//#endif
+
+public:
+ SvInplaceEdit( Window* pParent, const Point& rPos, const Size& rSize,
+ const String& rData, const Link& rNotifyEditEnd,
+ const Selection& );
+ ~SvInplaceEdit();
+
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void LoseFocus();
+ BOOL EditingCanceled() const { return bCanceled; }
+ String GetText() const { return Edit::GetText(); }
+ void StopEditing( BOOL bCancel = FALSE );
+};
+
+class SvInplaceEdit2
+{
+ Link aCallBackHdl;
+ Accelerator aAccReturn;
+ Accelerator aAccEscape;
+ Timer aTimer;
+ Edit* pEdit;
+ BOOL bCanceled;
+ BOOL bAlreadyInCallBack;
+ BOOL bMultiLine;
+
+//#if 0 // _SOLAR__PRIVATE
+ void CallCallBackHdl_Impl();
+ DECL_LINK( Timeout_Impl, Timer * );
+ DECL_LINK( ReturnHdl_Impl, Accelerator * );
+ DECL_LINK( EscapeHdl_Impl, Accelerator * );
+//#endif
+
+public:
+ SvInplaceEdit2( Window* pParent, const Point& rPos, const Size& rSize,
+ const String& rData, const Link& rNotifyEditEnd,
+ const Selection&, BOOL bMultiLine = FALSE );
+ ~SvInplaceEdit2();
+ BOOL KeyInput( const KeyEvent& rKEvt );
+ void LoseFocus();
+ BOOL EditingCanceled() const { return bCanceled; }
+ String GetText() const;
+ String GetSavedValue() const;
+ void StopEditing( BOOL bCancel = FALSE );
+ void Hide();
+};
+
+inline SvViewDataItem* SvLBox::GetViewDataItem( SvListEntry* pEntry,
+ SvLBoxItem* pItem) const
+{
+ SvViewDataEntry* pEntryData =
+ (SvViewDataEntry*)SvListView::GetViewData(pEntry);
+ DBG_ASSERT(pEntryData,"Entry not in View");
+ DBG_ASSERT(pEntryData->pItemData,"No ItemData");
+ USHORT nItemPos = ((SvLBoxEntry*)pEntry)->GetPos( pItem );
+ return (pEntryData->pItemData+nItemPos);
+}
+
+#endif
diff --git a/svtools/inc/svtools/svmedit.hxx b/svtools/inc/svtools/svmedit.hxx
new file mode 100644
index 000000000000..3bdfdc44e8e9
--- /dev/null
+++ b/svtools/inc/svtools/svmedit.hxx
@@ -0,0 +1,154 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _SVEDIT_HXX
+#define _SVEDIT_HXX
+
+#include <vcl/wintypes.hxx>
+#include <vcl/edit.hxx>
+
+#include <svtools/syntaxhighlight.hxx>
+#include <svtools/svtdllapi.h>
+#include <svtools/colorcfg.hxx>
+
+class ImpSvMEdit;
+class Timer;
+class ExtTextEngine;
+class ExtTextView;
+
+class SVT_DLLPUBLIC MultiLineEdit : public Edit
+{
+private:
+ ImpSvMEdit* pImpSvMEdit;
+
+ XubString aSaveValue;
+ Link aModifyHdlLink;
+
+ Timer* pUpdateDataTimer;
+ Link aUpdateDataHdlLink;
+
+protected:
+
+ DECL_LINK( ImpUpdateDataHdl, Timer* );
+ void StateChanged( StateChangedType nType );
+ void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ long Notify( NotifyEvent& rNEvt );
+ using Control::ImplInitSettings;
+ void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
+ WinBits ImplInitStyle( WinBits nStyle );
+
+ ExtTextEngine* GetTextEngine() const;
+ ExtTextView* GetTextView() const;
+ ScrollBar* GetHScrollBar() const;
+ ScrollBar* GetVScrollBar() const;
+
+public:
+ MultiLineEdit( Window* pParent, WinBits nWinStyle = WB_LEFT | WB_BORDER );
+ MultiLineEdit( Window* pParent, const ResId& rResId );
+ ~MultiLineEdit();
+
+
+ virtual void Modify();
+ virtual void UpdateData();
+
+ virtual void SetModifyFlag();
+ virtual void ClearModifyFlag();
+ virtual BOOL IsModified() const;
+
+ virtual void EnableUpdateData( ULONG nTimeout = EDIT_UPDATEDATA_TIMEOUT );
+ virtual void DisableUpdateData() { delete pUpdateDataTimer; pUpdateDataTimer = NULL; }
+ virtual ULONG IsUpdateDataEnabled() const;
+
+ virtual void SetReadOnly( BOOL bReadOnly = TRUE );
+ virtual BOOL IsReadOnly() const;
+
+ void EnableFocusSelectionHide( BOOL bHide );
+ BOOL IsFocusSelectionHideEnabled() const;
+
+ virtual void SetMaxTextLen( xub_StrLen nMaxLen = 0 );
+ virtual xub_StrLen GetMaxTextLen() const;
+
+ virtual void SetSelection( const Selection& rSelection );
+ virtual const Selection& GetSelection() const;
+
+ virtual void ReplaceSelected( const XubString& rStr );
+ virtual void DeleteSelected();
+ virtual XubString GetSelected() const;
+ virtual XubString GetSelected( LineEnd aSeparator ) const;
+
+ virtual void Cut();
+ virtual void Copy();
+ virtual void Paste();
+
+ virtual void SetText( const XubString& rStr );
+ virtual void SetText( const XubString& rStr, const Selection& rNewSelection )
+ { SetText( rStr ); SetSelection( rNewSelection ); }
+ String GetText() const;
+ String GetText( LineEnd aSeparator ) const;
+ String GetTextLines() const;
+ String GetTextLines( LineEnd aSeparator ) const;
+
+ void SetRightToLeft( BOOL bRightToLeft );
+ BOOL IsRightToLeft() const;
+
+ void SaveValue() { aSaveValue = GetText(); }
+ const XubString& GetSavedValue() const { return aSaveValue; }
+
+ void SetModifyHdl( const Link& rLink ) { aModifyHdlLink = rLink; }
+ const Link& GetModifyHdl() const { return aModifyHdlLink; }
+
+ void SetUpdateDataHdl( const Link& rLink ) { aUpdateDataHdlLink = rLink; }
+ const Link& GetUpdateDataHdl() const { return aUpdateDataHdlLink; }
+
+ virtual void Resize();
+ virtual void GetFocus();
+
+ Size CalcMinimumSize() const;
+ Size CalcAdjustedSize( const Size& rPrefSize ) const;
+ using Edit::CalcSize;
+ Size CalcSize( USHORT nColumns, USHORT nLines ) const;
+ void GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const;
+
+ void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+
+ void SetLeftMargin( USHORT n );
+ USHORT GetLeftMargin() const;
+
+ virtual
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >
+ GetComponentInterface(BOOL bCreate = TRUE);
+
+ void DisableSelectionOnFocus();
+};
+
+inline ULONG MultiLineEdit::IsUpdateDataEnabled() const
+{
+ return pUpdateDataTimer ? pUpdateDataTimer->GetTimeout() : 0;
+}
+
+#endif
diff --git a/svtools/inc/svtools/svmedit2.hxx b/svtools/inc/svtools/svmedit2.hxx
new file mode 100644
index 000000000000..e09592cfc172
--- /dev/null
+++ b/svtools/inc/svtools/svmedit2.hxx
@@ -0,0 +1,54 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+#ifndef _SVTOOLS_SVMEDIT2_HXX
+#define _SVTOOLS_SVMEDIT2_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/svmedit.hxx>
+
+class TextAttrib;
+
+class SVT_DLLPUBLIC ExtMultiLineEdit : public MultiLineEdit
+{
+public:
+ ExtMultiLineEdit( Window* pParent, WinBits nWinStyle = WB_LEFT | WB_BORDER );
+ ExtMultiLineEdit( Window* pParent, const ResId& rResId );
+ ~ExtMultiLineEdit();
+
+ // methods of TextView
+ void InsertText( const String& rNew, BOOL bSelect = FALSE );
+ void SetAutoScroll( BOOL bAutoScroll );
+ void EnableCursor( BOOL bEnable );
+
+ // methods of TextEngine
+ void SetAttrib( const TextAttrib& rAttr, ULONG nPara, USHORT nStart, USHORT nEnd );
+ void SetLeftMargin( USHORT nLeftMargin );
+ ULONG GetParagraphCount() const;
+};
+
+#endif
+
diff --git a/svtools/inc/svtools/svparser.hxx b/svtools/inc/svtools/svparser.hxx
new file mode 100644
index 000000000000..bd24298011e2
--- /dev/null
+++ b/svtools/inc/svtools/svparser.hxx
@@ -0,0 +1,285 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
+
+#ifndef _SVPARSER_HXX
+#define _SVPARSER_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/string.hxx>
+#include <tools/ref.hxx>
+#include <rtl/textenc.h>
+#include <boost/utility.hpp>
+
+
+struct SvParser_Impl;
+class SvStream;
+class SvUShorts;
+
+enum SvParserState
+{
+ SVPAR_ACCEPTED = 0,
+ SVPAR_NOTSTARTED,
+ SVPAR_WORKING,
+ SVPAR_PENDING,
+ SVPAR_WAITFORDATA,
+ SVPAR_ERROR
+};
+
+class SVT_DLLPUBLIC SvParser : public SvRefBase
+{
+ DECL_STATIC_LINK( SvParser, NewDataRead, void* );
+
+protected:
+ SvStream& rInput;
+ String aToken; // gescanntes Token
+ ULONG nlLineNr; // akt. Zeilen Nummer
+ ULONG nlLinePos; // akt. Spalten Nummer
+
+ SvParser_Impl *pImplData; // interne Daten
+ long nTokenValue; // zusaetzlicher Wert (RTF)
+ BOOL bTokenHasValue; // indicates whether nTokenValue is valid
+ SvParserState eState; // Status auch in abgl. Klassen
+
+ rtl_TextEncoding eSrcEnc; // Source encoding
+
+ ULONG nNextChPos;
+ sal_Unicode nNextCh; // Akt. Zeichen fuer die "lex"
+
+
+ BOOL bDownloadingFile : 1;// TRUE: Es wird gerade ein externes
+ // File geladen. d.h. alle
+ // DataAvailable Links muessen
+ // ignoriert werden.
+ // Wenn keibes der folgenden
+ // Flags gesetzt ist, wird der
+ // Stream als ANSI gelesen,
+ // aber als CharSet DONTKNOW
+ // zurueckgegeben.
+ BOOL bUCS2BSrcEnc : 1; // oder als big-endian UCS2
+ BOOL bSwitchToUCS2 : 1; // Umschalten des ist erlaubt
+
+ BOOL bRTF_InTextRead : 1; // only for RTF-Parser!!!
+
+ struct TokenStackType
+ {
+ String sToken;
+ long nTokenValue;
+ BOOL bTokenHasValue;
+ int nTokenId;
+
+ inline TokenStackType() { nTokenId = 0; }
+ inline ~TokenStackType() { }
+ };
+
+ // Methoden fuer Token-Stack
+ int SkipToken( short nCnt = -1 ); // n Tokens zurueck "skippen"
+ TokenStackType* GetStackPtr( short nCnt );
+ inline BYTE GetStackPos() const;
+
+ // scanne das naechste Token:
+ // Tokenstack abarbeiten und ggfs. _GetNextToken() rufen. Diese
+ // ist fuers erkennen von neuen Token verantwortlich
+ int GetNextToken();
+ virtual int _GetNextToken() = 0;
+
+ // wird fuer jedes Token gerufen, das in CallParser erkannt wird
+ virtual void NextToken( int nToken );
+
+ // zu Zeiten der SvRefBase-Ableitung darf nicht jeder loeschen
+ virtual ~SvParser();
+
+ void ClearTxtConvContext();
+
+private:
+ TokenStackType* pTokenStack;
+ TokenStackType *pTokenStackPos;
+ BYTE nTokenStackSize, nTokenStackPos;
+
+public:
+ // Konstruktor
+ SvParser( SvStream& rIn, BYTE nStackSize = 3 );
+
+ virtual SvParserState CallParser() = 0; // Aufruf des Parsers
+
+ inline SvParserState GetStatus() const { return eState; } // StatusInfo
+
+ inline ULONG GetLineNr() const { return nlLineNr; }
+ inline ULONG GetLinePos() const { return nlLinePos; }
+ inline ULONG IncLineNr() { return ++nlLineNr; }
+ inline ULONG IncLinePos() { return ++nlLinePos; }
+ inline ULONG SetLineNr( ULONG nlNum ); // inline unten
+ inline ULONG SetLinePos( ULONG nlPos ); // inline unten
+
+ sal_Unicode GetNextChar();
+ void RereadLookahead();
+
+ inline int IsParserWorking() const { return SVPAR_WORKING == eState; }
+
+ Link GetAsynchCallLink() const
+ { return STATIC_LINK( this, SvParser, NewDataRead ); }
+
+ long CallAsyncCallLink() { return NewDataRead( this, 0 ); }
+
+ // fuers asynchrone lesen aus dem SvStream
+ /*virtual*/ void SaveState( int nToken );
+ /*virtual*/ void RestoreState();
+ virtual void Continue( int nToken );
+
+ inline void SetDownloadingFile( BOOL bSet ) { bDownloadingFile = bSet; }
+ inline BOOL IsDownloadingFile() const { return bDownloadingFile; }
+
+ // Set/get source encoding. The UCS2BEncoding flag is valid if source
+ // encoding is UCS2. It specifies a big endian encoding.
+ void SetSrcEncoding( rtl_TextEncoding eSrcEnc );
+ rtl_TextEncoding GetSrcEncoding() const { return eSrcEnc; }
+
+ void SetSrcUCS2BEncoding( BOOL bSet ) { bUCS2BSrcEnc = bSet; }
+ BOOL IsSrcUCS2BEncoding() const { return bUCS2BSrcEnc; }
+
+ // Darf der Zeichensatz auf UCS/2 umgeschaltet werden, wenn
+ // in den ersten beiden Zeichen im Stream eine BOM steht?
+ void SetSwitchToUCS2( BOOL bSet ) { bSwitchToUCS2 = bSet; }
+ BOOL IsSwitchToUCS2() const { return bSwitchToUCS2; }
+
+ // Aus wie vielen Bytes betseht ein Zeichen
+ inline USHORT GetCharSize() const;
+
+ int GetSaveToken() const;
+
+ // Aufbau einer Which-Map 'rWhichMap' aus einem Array von
+ // 'pWhichIds' von Which-Ids. Es hat die Lange 'nWhichIds'.
+ // Die Which-Map wird nicht geloescht.
+ static void BuildWhichTbl( SvUShorts &rWhichMap,
+ USHORT *pWhichIds,
+ USHORT nWhichIds );
+};
+
+
+#ifndef GOODIES_DECL_SVPARSER_DEFINED
+#define GOODIES_DECL_SVPARSER_DEFINED
+SV_DECL_REF(SvParser)
+#endif
+SV_IMPL_REF(SvParser)
+
+
+
+inline ULONG SvParser::SetLineNr( ULONG nlNum )
+{ ULONG nlOld = nlLineNr; nlLineNr = nlNum; return nlOld; }
+
+inline ULONG SvParser::SetLinePos( ULONG nlPos )
+{ ULONG nlOld = nlLinePos; nlLinePos = nlPos; return nlOld; }
+
+inline BYTE SvParser::GetStackPos() const
+{ return nTokenStackPos; }
+
+inline USHORT SvParser::GetCharSize() const
+{
+ return (RTL_TEXTENCODING_UCS2 == eSrcEnc) ? 2 : 1;
+}
+
+
+/*========================================================================
+ *
+ * SvKeyValue.
+ *
+ *======================================================================*/
+
+SV_DECL_REF(SvKeyValueIterator)
+
+class SvKeyValue
+{
+ /** Representation.
+ */
+ String m_aKey;
+ String m_aValue;
+
+public:
+ /** Construction.
+ */
+ SvKeyValue (void)
+ {}
+
+ SvKeyValue (const String &rKey, const String &rValue)
+ : m_aKey (rKey), m_aValue (rValue)
+ {}
+
+ SvKeyValue (const SvKeyValue &rOther)
+ : m_aKey (rOther.m_aKey), m_aValue (rOther.m_aValue)
+ {}
+
+ /** Assignment.
+ */
+ SvKeyValue& operator= (SvKeyValue &rOther)
+ {
+ m_aKey = rOther.m_aKey;
+ m_aValue = rOther.m_aValue;
+ return *this;
+ }
+
+ /** Operation.
+ */
+ const String& GetKey (void) const { return m_aKey; }
+ const String& GetValue (void) const { return m_aValue; }
+
+ void SetKey (const String &rKey ) { m_aKey = rKey; }
+ void SetValue (const String &rValue) { m_aValue = rValue; }
+};
+
+/*========================================================================
+ *
+ * SvKeyValueIterator.
+ *
+ *======================================================================*/
+class SvKeyValueList_Impl;
+class SVT_DLLPUBLIC SvKeyValueIterator : public SvRefBase,
+ private boost::noncopyable
+{
+ /** Representation.
+ */
+ SvKeyValueList_Impl* m_pList;
+ USHORT m_nPos;
+
+public:
+ /** Construction/Destruction.
+ */
+ SvKeyValueIterator (void);
+ virtual ~SvKeyValueIterator (void);
+
+ /** Operation.
+ */
+ virtual BOOL GetFirst (SvKeyValue &rKeyVal);
+ virtual BOOL GetNext (SvKeyValue &rKeyVal);
+ virtual void Append (const SvKeyValue &rKeyVal);
+};
+
+SV_IMPL_REF(SvKeyValueIterator);
+
+#endif //_SVPARSER_HXX
+
+/* vi:set tabstop=4 shiftwidth=4 expandtab: */
diff --git a/svtools/inc/svtools/svtabbx.hxx b/svtools/inc/svtools/svtabbx.hxx
new file mode 100644
index 000000000000..89fd92a4fc09
--- /dev/null
+++ b/svtools/inc/svtools/svtabbx.hxx
@@ -0,0 +1,268 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+#ifndef _SVTABBX_HXX
+#define _SVTABBX_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/svtreebx.hxx>
+#include <svtools/accessibletableprovider.hxx>
+
+#ifndef INCLUDED_VECTOR
+#include <vector>
+#define INCLUDED_VECTOR
+#endif
+
+enum SvTabJustify
+{
+ AdjustRight = SV_LBOXTAB_ADJUST_RIGHT,
+ AdjustLeft = SV_LBOXTAB_ADJUST_LEFT,
+ AdjustCenter = SV_LBOXTAB_ADJUST_CENTER,
+ AdjustNumeric = SV_LBOXTAB_ADJUST_NUMERIC
+};
+
+struct TabListBoxEventData
+{
+ SvLBoxEntry* m_pEntry;
+ USHORT m_nColumn;
+ String m_sOldText;
+
+ TabListBoxEventData( SvLBoxEntry* pEntry, USHORT nColumn, const String& rOldText ) :
+ m_pEntry( pEntry ), m_nColumn( nColumn ), m_sOldText( rOldText ) {}
+};
+
+class SVT_DLLPUBLIC SvTabListBox : public SvTreeListBox
+{
+private:
+ SvLBoxTab* pTabList;
+ USHORT nTabCount;
+ XubString aCurEntry;
+ ULONG nDummy1;
+ ULONG nDummy2;
+
+protected:
+ SvLBoxEntry* pViewParent;
+
+ static const xub_Unicode* GetToken( const xub_Unicode* pPtr, USHORT& rLen );
+
+ virtual void SetTabs();
+ virtual void InitEntry( SvLBoxEntry*, const XubString&, const Image&, const Image&, SvLBoxButtonKind );
+
+ String GetTabEntryText( ULONG nPos, USHORT nCol ) const;
+ SvLBoxEntry* GetEntryOnPos( ULONG _nEntryPos ) const;
+ SvLBoxEntry* GetChildOnPos( SvLBoxEntry* _pParent, ULONG _nEntryPos, ULONG& _rPos ) const;
+
+public:
+ SvTabListBox( Window* pParent, WinBits = WB_BORDER );
+ SvTabListBox( Window* pParent, const ResId& );
+ ~SvTabListBox();
+ void SetTabs( long* pTabs, MapUnit = MAP_APPFONT );
+ USHORT TabCount() const { return (USHORT)nTabCount; }
+ using SvTreeListBox::GetTab;
+ long GetTab( USHORT nTab ) const;
+ void SetTab( USHORT nTab, long nValue, MapUnit = MAP_APPFONT );
+ long GetLogicTab( USHORT nTab );
+
+ virtual SvLBoxEntry* InsertEntry( const XubString& rText, SvLBoxEntry* pParent = 0,
+ BOOL bChildsOnDemand = FALSE,
+ ULONG nPos=LIST_APPEND, void* pUserData = 0,
+ SvLBoxButtonKind eButtonKind = SvLBoxButtonKind_enabledCheckbox );
+
+ virtual SvLBoxEntry* InsertEntry( const XubString& rText,
+ const Image& rExpandedEntryBmp,
+ const Image& rCollapsedEntryBmp,
+ SvLBoxEntry* pParent = 0,
+ BOOL bChildsOnDemand = FALSE,
+ ULONG nPos = LIST_APPEND, void* pUserData = 0,
+ SvLBoxButtonKind eButtonKind = SvLBoxButtonKind_enabledCheckbox );
+
+ virtual SvLBoxEntry* InsertEntryToColumn( const XubString&, ULONG nPos = LIST_APPEND,
+ USHORT nCol = 0xffff, void* pUserData = NULL );
+ virtual SvLBoxEntry* InsertEntryToColumn( const XubString&, SvLBoxEntry* pParent,
+ ULONG nPos, USHORT nCol, void* pUserData = NULL );
+ virtual SvLBoxEntry* InsertEntryToColumn( const XubString&, const Image& rExpandedEntryBmp,
+ const Image& rCollapsedEntryBmp, SvLBoxEntry* pParent = NULL,
+ ULONG nPos = LIST_APPEND, USHORT nCol = 0xffff, void* pUserData = NULL );
+
+ virtual String GetEntryText( SvLBoxEntry* pEntry ) const;
+ String GetEntryText( SvLBoxEntry*, USHORT nCol ) const;
+ String GetEntryText( ULONG nPos, USHORT nCol = 0xffff ) const;
+ using SvTreeListBox::SetEntryText;
+ void SetEntryText( const XubString&, ULONG, USHORT nCol=0xffff );
+ void SetEntryText(const XubString&,SvLBoxEntry*,USHORT nCol=0xffff);
+ String GetCellText( ULONG nPos, USHORT nCol ) const;
+ ULONG GetEntryPos( const XubString&, USHORT nCol = 0xffff );
+ ULONG GetEntryPos( const SvLBoxEntry* pEntry ) const;
+
+ virtual void Resize();
+ void SetTabJustify( USHORT nTab, SvTabJustify );
+ SvTabJustify GetTabJustify( USHORT nTab ) const;
+};
+
+inline long SvTabListBox::GetTab( USHORT nTab ) const
+{
+ DBG_ASSERT( nTab < nTabCount, "GetTabPos:Invalid Tab" );
+ return pTabList[nTab].GetPos();
+}
+
+// class SvHeaderTabListBox ---------------------------------------------------
+
+class HeaderBar;
+namespace svt {
+ class AccessibleTabListBox;
+ class IAccessibleTabListBox;
+ struct SvHeaderTabListBoxImpl;
+}
+
+class SVT_DLLPUBLIC SvHeaderTabListBox : public SvTabListBox, public svt::IAccessibleTableProvider
+{
+private:
+ typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > > AccessibleChildren;
+
+ sal_Bool m_bFirstPaint;
+ ::svt::SvHeaderTabListBoxImpl* m_pImpl;
+ ::svt::IAccessibleTabListBox* m_pAccessible;
+ AccessibleChildren m_aAccessibleChildren;
+
+ DECL_DLLPRIVATE_LINK( ScrollHdl_Impl, SvTabListBox* );
+ DECL_DLLPRIVATE_LINK( CreateAccessibleHdl_Impl, HeaderBar* );
+
+ void RecalculateAccessibleChildren();
+
+public:
+ SvHeaderTabListBox( Window* pParent, WinBits nBits );
+ SvHeaderTabListBox( Window* pParent, const ResId& );
+ ~SvHeaderTabListBox();
+
+ virtual void Paint( const Rectangle& );
+
+ void InitHeaderBar( HeaderBar* pHeaderBar );
+ sal_Bool IsItemChecked( SvLBoxEntry* pEntry, USHORT nCol ) const;
+
+ virtual SvLBoxEntry* InsertEntryToColumn( const XubString&, ULONG nPos = LIST_APPEND,
+ USHORT nCol = 0xffff, void* pUserData = NULL );
+ virtual SvLBoxEntry* InsertEntryToColumn( const XubString&, SvLBoxEntry* pParent,
+ ULONG nPos, USHORT nCol, void* pUserData = NULL );
+ virtual SvLBoxEntry* InsertEntryToColumn( const XubString&, const Image& rExpandedEntryBmp,
+ const Image& rCollapsedEntryBmp, SvLBoxEntry* pParent = NULL,
+ ULONG nPos = LIST_APPEND, USHORT nCol = 0xffff, void* pUserData = NULL );
+ virtual ULONG Insert( SvLBoxEntry* pEnt,SvLBoxEntry* pPar,ULONG nPos=LIST_APPEND);
+ virtual ULONG Insert( SvLBoxEntry* pEntry, ULONG nRootPos = LIST_APPEND );
+ void RemoveEntry( SvLBoxEntry* _pEntry );
+ void Clear();
+
+ // Accessible -------------------------------------------------------------
+
+ inline void DisableTransientChildren() { SetChildrenNotTransient(); }
+ inline sal_Bool IsTransientChildrenDisabled() const { return !AreChildrenTransient(); }
+
+ sal_Bool IsCellCheckBox( long _nRow, sal_uInt16 _nColumn, TriState& _rState );
+
+ /** @return The count of the rows. */
+ virtual long GetRowCount() const;
+ /** @return The count of the columns. */
+ virtual sal_uInt16 GetColumnCount() const;
+
+ /** @return The position of the current row. */
+ virtual sal_Int32 GetCurrRow() const;
+ /** @return The position of the current column. */
+ virtual sal_uInt16 GetCurrColumn() const;
+
+ /** @return The description of a row.
+ @param _nRow The row which description is in demand. */
+ virtual ::rtl::OUString GetRowDescription( sal_Int32 _nRow ) const;
+ /** @return The description of a column.
+ @param _nColumn The column which description is in demand. */
+ virtual ::rtl::OUString GetColumnDescription( sal_uInt16 _nColumn ) const;
+
+ /** @return <TRUE/>, if the object has a row header. */
+ virtual sal_Bool HasRowHeader() const; //GetColumnId
+ /** @return <TRUE/>, if the object can focus a cell. */
+ virtual sal_Bool IsCellFocusable() const;
+ virtual sal_Bool GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn );
+
+ virtual void SetNoSelection();
+ using SvListView::SelectAll;
+ virtual void SelectAll();
+ virtual void SelectAll( BOOL bSelect, BOOL bPaint = TRUE );
+ virtual void SelectRow( long _nRow, BOOL _bSelect = TRUE, BOOL bExpand = TRUE );
+ virtual void SelectColumn( sal_uInt16 _nColumn, sal_Bool _bSelect = sal_True );
+ virtual sal_Int32 GetSelectedRowCount() const;
+ virtual sal_Int32 GetSelectedColumnCount() const;
+ /** @return <TRUE/>, if the row is selected. */
+ virtual bool IsRowSelected( long _nRow ) const;
+ virtual sal_Bool IsColumnSelected( long _nColumn ) const;
+ virtual void GetAllSelectedRows( ::com::sun::star::uno::Sequence< sal_Int32 >& _rRows ) const;
+ virtual void GetAllSelectedColumns( ::com::sun::star::uno::Sequence< sal_Int32 >& _rColumns ) const;
+
+ /** @return <TRUE/>, if the cell is visible. */
+ virtual sal_Bool IsCellVisible( sal_Int32 _nRow, sal_uInt16 _nColumn ) const;
+ virtual String GetAccessibleCellText( long _nRow, USHORT _nColumnPos ) const;
+
+ virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, BOOL _bOnScreen = TRUE );
+ virtual Rectangle calcTableRect( BOOL _bOnScreen = TRUE );
+ virtual Rectangle GetFieldRectPixelAbs( sal_Int32 _nRow, sal_uInt16 _nColumn, BOOL _bIsHeader, BOOL _bOnScreen = TRUE );
+
+ virtual XACC CreateAccessibleCell( sal_Int32 _nRow, sal_uInt16 _nColumn );
+ virtual XACC CreateAccessibleRowHeader( sal_Int32 _nRow );
+ virtual XACC CreateAccessibleColumnHeader( sal_uInt16 _nColumnPos );
+
+ virtual sal_Int32 GetAccessibleControlCount() const;
+ virtual XACC CreateAccessibleControl( sal_Int32 _nIndex );
+ virtual sal_Bool ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint );
+
+ virtual sal_Bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_uInt16& _rnColPos, const Point& _rPoint );
+ virtual sal_Bool ConvertPointToRowHeader( sal_Int32& _rnRow, const Point& _rPoint );
+ virtual sal_Bool ConvertPointToColumnHeader( sal_uInt16& _rnColPos, const Point& _rPoint );
+
+ virtual ::rtl::OUString GetAccessibleObjectName( ::svt::AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos = -1 ) const;
+ virtual ::rtl::OUString GetAccessibleObjectDescription( ::svt::AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos = -1 ) const;
+ virtual Window* GetWindowInstance();
+
+ using SvTreeListBox::FillAccessibleStateSet;
+ virtual void FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& _rStateSet, ::svt::AccessibleBrowseBoxObjType _eType ) const;
+ virtual void FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumn ) const;
+ virtual void GrabTableFocus();
+
+ // OutputDevice
+ virtual BOOL GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector );
+
+ // Window
+ virtual Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) const;
+ virtual void GrabFocus();
+ virtual XACC GetAccessible( BOOL bCreate = TRUE );
+ virtual Window* GetAccessibleParentWindow() const;
+
+ /** Creates and returns the accessible object of the whole BrowseBox. */
+ virtual XACC CreateAccessible();
+
+ virtual Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex);
+ virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint);
+};
+
+#endif // #ifndef _SVTABBX_HXX
+
+
diff --git a/svtools/inc/svtools/svtdata.hxx b/svtools/inc/svtools/svtdata.hxx
new file mode 100644
index 000000000000..9faadaff7305
--- /dev/null
+++ b/svtools/inc/svtools/svtdata.hxx
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _SVTOOLS_SVTDATA_HXX
+#define _SVTOOLS_SVTDATA_HXX
+
+#include <tools/resid.hxx>
+#include <com/sun/star/lang/Locale.hpp>
+
+class ResMgr;
+class SfxItemDesruptorList_Impl;
+
+//============================================================================
+class ImpSvtData
+{
+public:
+ SfxItemDesruptorList_Impl * pItemDesruptList;
+ ResMgr * pResMgr;
+ ResMgr * pPatchResMgr;
+
+private:
+ ImpSvtData():
+ pItemDesruptList(0), pResMgr(0), pPatchResMgr(0)
+ {}
+
+ ~ImpSvtData();
+
+public:
+ ResMgr * GetResMgr(const ::com::sun::star::lang::Locale aLocale);
+ ResMgr * GetResMgr(); // VCL dependant, only available in SVT, not in SVL!
+ ResMgr * GetPatchResMgr();
+ ResMgr * GetPatchResMgr(const ::com::sun::star::lang::Locale& aLocale);
+
+ static ImpSvtData & GetSvtData();
+};
+
+//============================================================================
+
+class SvpResId: public ResId
+{
+public:
+ SvpResId( USHORT nId, const ::com::sun::star::lang::Locale aLocale ):
+ ResId( nId, *ImpSvtData::GetSvtData().GetResMgr( aLocale ) ) {}
+
+ // VCL dependant, only available in SVT, not in SVL!
+ SvpResId( USHORT nId );
+};
+
+
+class SvtResId: public ResId
+{
+public:
+ SvtResId(USHORT nId, const ::com::sun::star::lang::Locale aLocale):
+ ResId(nId, *ImpSvtData::GetSvtData().GetResMgr(aLocale)) {}
+
+ SvtResId(USHORT nId): ResId(nId, *ImpSvtData::GetSvtData().GetResMgr()) {}
+ // VCL dependant, only available in SVT, not in SVL!
+};
+
+#endif // _SVTOOLS_SVTDATA_HXX
+
diff --git a/svtools/inc/svtools/svtdllapi.h b/svtools/inc/svtools/svtdllapi.h
new file mode 100644
index 000000000000..d230d7e76d0c
--- /dev/null
+++ b/svtools/inc/svtools/svtdllapi.h
@@ -0,0 +1,41 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_SVTDLLAPI_H
+#define INCLUDED_SVTDLLAPI_H
+
+#include "sal/types.h"
+
+#if defined(SVT_DLLIMPLEMENTATION)
+#define SVT_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define SVT_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define SVT_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif /* INCLUDED_SVTDLLAPI_H */
+
diff --git a/svtools/inc/svtools/svtools.hrc b/svtools/inc/svtools/svtools.hrc
new file mode 100644
index 000000000000..a57a0f5bb0fe
--- /dev/null
+++ b/svtools/inc/svtools/svtools.hrc
@@ -0,0 +1,400 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: svtools.hrc,v $
+ * $Revision: 1.7 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+#ifndef _SVTOOLS_HRC
+#define _SVTOOLS_HRC "$Revision: 1.0"
+
+#include <svl/solar.hrc>
+
+#define RID_SVTOOLS_BITMAP_START (RID_SVTOOLS_START + 0)
+#define RID_SVTOOLS_IMAGELIST_START (RID_SVTOOLS_START + 0)
+
+//.............................................................................
+// various unsorted stuff
+
+#define DLG_EXPORT_PIX (RID_SVTOOLS_START+1)
+#define DLG_EXPORT_VEC (RID_SVTOOLS_START+2)
+#define DLG_TWAIN_SOURCE (RID_SVTOOLS_START+3)
+
+#define DLG_SVT_EXPLORERFILE (RID_SVTOOLS_START+4)
+#define DLG_SVT_QUERYFOLDERNAME (RID_SVTOOLS_START+5)
+#define DLG_SVT_QUERYDELETE (RID_SVTOOLS_START+6)
+
+#define EXPORT_DIALOG_TITLE (RID_SVTOOLS_START+4)
+#define KEY_MODE (RID_SVTOOLS_START+5)
+#define KEY_RES (RID_SVTOOLS_START+6)
+#define KEY_SIZE (RID_SVTOOLS_START+7)
+
+#define KEY_COLORS (RID_SVTOOLS_START+9)
+#define KEY_RLE_CODING (RID_SVTOOLS_START+10)
+
+#define STR_SVT_AUTOMATIC_COLOR (RID_SVTOOLS_START+16)
+
+#define STR_SVT_FILEVIEW_COLUMN_TITLE (RID_SVTOOLS_START + 20)
+#define STR_SVT_FILEVIEW_COLUMN_SIZE (RID_SVTOOLS_START + 21)
+#define STR_SVT_FILEVIEW_COLUMN_DATE (RID_SVTOOLS_START + 22)
+#define STR_SVT_FOLDER (RID_SVTOOLS_START + 23)
+#define STR_SVT_FILEVIEW_ERR_MAKEFOLDER (RID_SVTOOLS_START + 24)
+#define STR_SVT_BYTES (RID_SVTOOLS_START + 25)
+#define STR_SVT_KB (RID_SVTOOLS_START + 26)
+#define STR_SVT_MB (RID_SVTOOLS_START + 27)
+#define STR_SVT_GB (RID_SVTOOLS_START + 28)
+#define STR_FILTERNAME_ALL (RID_SVTOOLS_START + 29)
+#define STR_SVT_NEW_FOLDER (RID_SVTOOLS_START + 30)
+#define STR_SVT_ALREADYEXISTOVERWRITE (RID_SVTOOLS_START + 31)
+#define STR_SVT_FILEVIEW_COLUMN_TYPE (RID_SVTOOLS_START + 32)
+#define RID_FILEVIEW_CONTEXTMENU (RID_SVTOOLS_START + 33)
+#define RID_FILEOPEN_INVALIDFOLDER (RID_SVTOOLS_START + 34)
+#define RID_FILEOPEN_NOTEXISTENTFILE (RID_SVTOOLS_START + 35)
+#define STR_SVT_NOREMOVABLEDEVICE (RID_SVTOOLS_START + 36)
+
+// doc template dialog
+#define DLG_DOCTEMPLATE (RID_SVTOOLS_START+50)
+#define CTRL_FILEVIEW (RID_SVTOOLS_START+51)
+#define STR_SVT_NEWDOC (RID_SVTOOLS_START+52)
+#define STR_SVT_MYDOCS (RID_SVTOOLS_START+53)
+#define STR_SVT_TEMPLATES (RID_SVTOOLS_START+54)
+#define STR_SVT_SAMPLES (RID_SVTOOLS_START+55)
+#define TB_SVT_FILEVIEW (RID_SVTOOLS_START+56)
+#define TB_SVT_FRAMEWIN (RID_SVTOOLS_START+57)
+#define STRARY_SVT_DOCINFO (RID_SVTOOLS_START+58)
+#define STR_SVT_NEWDOC_HELP (RID_SVTOOLS_START+63)
+#define STR_SVT_MYDOCS_HELP (RID_SVTOOLS_START+64)
+#define STR_SVT_TEMPLATES_HELP (RID_SVTOOLS_START+65)
+#define STR_SVT_SAMPLES_HELP (RID_SVTOOLS_START+66)
+
+#define STR_WARNING_ITEM (RID_SVTOOLS_START+90)
+
+#define CONFIG_BASIC_FORMAT_START (RID_SVTOOLS_START+102)
+#define STR_BASICKEY_FORMAT_ON (RID_SVTOOLS_START+103)
+#define STR_BASICKEY_FORMAT_OFF (RID_SVTOOLS_START+104)
+#define STR_BASICKEY_FORMAT_YES (RID_SVTOOLS_START+105)
+#define STR_BASICKEY_FORMAT_NO (RID_SVTOOLS_START+106)
+#define STR_BASICKEY_FORMAT_TRUE (RID_SVTOOLS_START+107)
+#define STR_BASICKEY_FORMAT_FALSE (RID_SVTOOLS_START+108)
+#define CONFIG_BASIC_FORMAT_END (RID_SVTOOLS_START+109)
+
+#define STR_INVALIDTRYBUY (RID_SVTOOLS_START+120)
+#define STR_OLDTRYBUY (RID_SVTOOLS_START+121)
+#define STR_TRYBUY (RID_SVTOOLS_START+122)
+#define STR_PVER_LANGUAGECODE (RID_SVTOOLS_START+124)
+#define STR_PVER_LONG_LANGUAGECODE (RID_SVTOOLS_START+125)
+#define STR_INVALIDPUFF (RID_SVTOOLS_START+126)
+#define STR_LIMITEDPUFF (RID_SVTOOLS_START+127)
+#define STR_OLDLIMITEDPUFF (RID_SVTOOLS_START+128)
+#define RID_REGISTER_DIALOG (RID_SVTOOLS_START+129)
+#define STR_BASICKEY_FORMAT_CURRENCY (RID_SVTOOLS_START+130)
+#define STR_KEYERR_GENERAL_HELP (RID_SVTOOLS_START+131)
+#define STR_KEYERR_INVALID_KEY (RID_SVTOOLS_START+132)
+#define STR_KEYERR_INVALID_USERDATA (RID_SVTOOLS_START+133)
+#define STR_KEYERR_INVALID_ADDRESSDATA (RID_SVTOOLS_START+134)
+#define STR_KEYERR_INVALID_LICENSE (RID_SVTOOLS_START+135)
+#define STR_KEYERR_INVALID_LANGUAGE (RID_SVTOOLS_START+136)
+#define STR_KEYERR_INVALID_OS (RID_SVTOOLS_START+137)
+#define STR_KEYERR_INVALID_NO_CNR (RID_SVTOOLS_START+138)
+#define STR_KEYERR_INVALID_CNR (RID_SVTOOLS_START+139)
+#define RID_LIMITED_DIALOG (RID_SVTOOLS_START+140)
+
+#define STR_SVT_PRNDLG_START (RID_SVTOOLS_START+141)
+#define DLG_SVT_PRNDLG_PRNSETUPDLG (STR_SVT_PRNDLG_START+0)
+#define DLG_SVT_PRNDLG_PRINTDLG (STR_SVT_PRNDLG_START+1)
+#define STR_SVT_PRNDLG_READY (STR_SVT_PRNDLG_START+2)
+#define STR_SVT_PRNDLG_PAUSED (STR_SVT_PRNDLG_START+3)
+#define STR_SVT_PRNDLG_PENDING (STR_SVT_PRNDLG_START+4)
+#define STR_SVT_PRNDLG_BUSY (STR_SVT_PRNDLG_START+5)
+#define STR_SVT_PRNDLG_INITIALIZING (STR_SVT_PRNDLG_START+6)
+#define STR_SVT_PRNDLG_WAITING (STR_SVT_PRNDLG_START+7)
+#define STR_SVT_PRNDLG_WARMING_UP (STR_SVT_PRNDLG_START+8)
+#define STR_SVT_PRNDLG_PROCESSING (STR_SVT_PRNDLG_START+9)
+#define STR_SVT_PRNDLG_PRINTING (STR_SVT_PRNDLG_START+10)
+#define STR_SVT_PRNDLG_OFFLINE (STR_SVT_PRNDLG_START+11)
+#define STR_SVT_PRNDLG_ERROR (STR_SVT_PRNDLG_START+12)
+#define STR_SVT_PRNDLG_SERVER_UNKNOWN (STR_SVT_PRNDLG_START+13)
+#define STR_SVT_PRNDLG_PAPER_JAM (STR_SVT_PRNDLG_START+14)
+#define STR_SVT_PRNDLG_PAPER_OUT (STR_SVT_PRNDLG_START+15)
+#define STR_SVT_PRNDLG_MANUAL_FEED (STR_SVT_PRNDLG_START+16)
+#define STR_SVT_PRNDLG_PAPER_PROBLEM (STR_SVT_PRNDLG_START+17)
+#define STR_SVT_PRNDLG_IO_ACTIVE (STR_SVT_PRNDLG_START+18)
+#define STR_SVT_PRNDLG_OUTPUT_BIN_FULL (STR_SVT_PRNDLG_START+19)
+#define STR_SVT_PRNDLG_TONER_LOW (STR_SVT_PRNDLG_START+20)
+#define STR_SVT_PRNDLG_NO_TONER (STR_SVT_PRNDLG_START+21)
+#define STR_SVT_PRNDLG_PAGE_PUNT (STR_SVT_PRNDLG_START+22)
+#define STR_SVT_PRNDLG_USER_INTERVENTION (STR_SVT_PRNDLG_START+23)
+#define STR_SVT_PRNDLG_OUT_OF_MEMORY (STR_SVT_PRNDLG_START+24)
+#define STR_SVT_PRNDLG_DOOR_OPEN (STR_SVT_PRNDLG_START+25)
+#define STR_SVT_PRNDLG_POWER_SAVE (STR_SVT_PRNDLG_START+26)
+#define STR_SVT_PRNDLG_DEFPRINTER (STR_SVT_PRNDLG_START+27)
+#define STR_SVT_PRNDLG_JOBCOUNT (STR_SVT_PRNDLG_START+28)
+#define STR_SVT_PRNDLG_END (RID_IMG_PRNDLG_NOCOLLATE_HC)
+
+#define STR_SVT_CALENDAR_START (STR_SVT_PRNDLG_END+1)
+#define STR_SVT_CALENDAR_DAY (STR_SVT_CALENDAR_START+0)
+#define STR_SVT_CALENDAR_WEEK (STR_SVT_CALENDAR_START+1)
+#define STR_SVT_CALENDAR_TODAY (STR_SVT_CALENDAR_START+2)
+#define STR_SVT_CALENDAR_NONE (STR_SVT_CALENDAR_START+3)
+#define STR_SVT_CALENDAR_END (STR_SVT_CALENDAR_NONE)
+
+#define STR_SVT_PVER_START (STR_SVT_CALENDAR_END+1)
+#define STR_SVT_PVER_INTERNAL (STR_SVT_PVER_START+0)
+#define STR_SVT_PVER_PERSONAL_DELUXE (STR_SVT_PVER_START+1)
+#define STR_SVT_PVER_PERSONAL (STR_SVT_PVER_START+2)
+#define STR_SVT_PVER_PROFESSIONAL (STR_SVT_PVER_START+3)
+#define STR_SVT_PVER_BUSINESS (STR_SVT_PVER_START+4)
+#define STR_SVT_PVER_ENTERPRICE (STR_SVT_PVER_START+5)
+#define STR_SVT_PVER_EDUCATION (STR_SVT_PVER_START+6)
+#define STR_SVT_PVER_DEMO (STR_SVT_PVER_START+7)
+#define STR_SVT_PVER_BETA (STR_SVT_PVER_START+8)
+#define STR_SVT_PVER_OEM (STR_SVT_PVER_START+9)
+#define STR_SVT_PVER_NOT_REGISTERED (STR_SVT_PVER_START+10)
+#define STR_SVT_PVER_PILOT (STR_SVT_PVER_START+11)
+#define STR_SVT_PVER_CAMPUS (STR_SVT_PVER_START+12)
+#define STR_SVT_PVER_EVALUATION (STR_SVT_PVER_START+13)
+#define STR_SVT_PVER_PARTNER (STR_SVT_PVER_START+14)
+#define STR_SVT_PVER_SMALLBUSINESS (STR_SVT_PVER_START+15)
+#define STR_SVT_PVER_OEM_PROFESSIONAL (STR_SVT_PVER_START+16)
+#define STR_SVT_PVER_END (STR_SVT_PVER_OEM_PROFESSIONAL)
+
+#define STR_SVT_STYLE_START (STR_SVT_PVER_END+1)
+#define STR_SVT_STYLE_LIGHT (STR_SVT_STYLE_START+0)
+#define STR_SVT_STYLE_LIGHT_ITALIC (STR_SVT_STYLE_START+1)
+#define STR_SVT_STYLE_NORMAL (STR_SVT_STYLE_START+2)
+#define STR_SVT_STYLE_NORMAL_ITALIC (STR_SVT_STYLE_START+3)
+#define STR_SVT_STYLE_BOLD (STR_SVT_STYLE_START+4)
+#define STR_SVT_STYLE_BOLD_ITALIC (STR_SVT_STYLE_START+5)
+#define STR_SVT_STYLE_BLACK (STR_SVT_STYLE_START+6)
+#define STR_SVT_STYLE_BLACK_ITALIC (STR_SVT_STYLE_START+7)
+#define STR_SVT_STYLE_END (STR_SVT_STYLE_BLACK_ITALIC)
+
+#define STR_SVT_FONTMAP_START (STR_SVT_STYLE_END+1)
+#define STR_SVT_FONTMAP_BOTH (STR_SVT_FONTMAP_START+0)
+#define STR_SVT_FONTMAP_PRINTERONLY (STR_SVT_FONTMAP_START+1)
+#define STR_SVT_FONTMAP_SCREENONLY (STR_SVT_FONTMAP_START+2)
+#define STR_SVT_FONTMAP_SIZENOTAVAILABLE (STR_SVT_FONTMAP_START+3)
+#define STR_SVT_FONTMAP_STYLENOTAVAILABLE (STR_SVT_FONTMAP_START+4)
+#define STR_SVT_FONTMAP_NOTAVAILABLE (STR_SVT_FONTMAP_START+5)
+#define STR_SVT_FONTMAP_END (STR_SVT_FONTMAP_NOTAVAILABLE)
+
+#define STR_SVT_ERRORCONTEXT_START (STR_SVT_FONTMAP_END+1)
+#define STR_ERR_HDLMESS (STR_SVT_ERRORCONTEXT_START+0)
+#define RID_ERRHDL_CLASS (STR_SVT_ERRORCONTEXT_START+1)
+#define RID_ERRCTX (STR_SVT_ERRORCONTEXT_START+2)
+#define RID_ERRHDL (STR_SVT_ERRORCONTEXT_START+3)
+#define STR_SVT_ERRORCONTEXT_END (RID_ERRHDL)
+
+#define STR_WIZARDDIALOG_START (STR_SVT_ERRORCONTEXT_END + 1)
+#define STR_WIZDLG_FINISH (STR_WIZARDDIALOG_START + 0)
+#define STR_WIZDLG_NEXT (STR_WIZARDDIALOG_START + 1)
+#define STR_WIZDLG_PREVIOUS (STR_WIZARDDIALOG_START + 2)
+#define STR_WIZDLG_ROADMAP_TITLE (STR_WIZARDDIALOG_START + 3)
+#define STR_WIZARDDIALOG_END (STR_WIZDLG_ROADMAP_TITLE)
+
+#define STR_SVT_COLLATE_START (STR_WIZARDDIALOG_END+1)
+#define STR_SVT_COLLATE_NORMAL (STR_SVT_COLLATE_START+0)
+#define STR_SVT_COLLATE_DICTIONARY (STR_SVT_COLLATE_START+1)
+#define STR_SVT_COLLATE_PINYIN (STR_SVT_COLLATE_START+2)
+#define STR_SVT_COLLATE_STROKE (STR_SVT_COLLATE_START+3)
+#define STR_SVT_COLLATE_RADICAL (STR_SVT_COLLATE_START+4)
+#define STR_SVT_COLLATE_CHARSET (STR_SVT_COLLATE_START+5)
+#define STR_SVT_COLLATE_ZHUYIN (STR_SVT_COLLATE_START+6)
+#define STR_SVT_COLLATE_ALPHANUMERIC (STR_SVT_COLLATE_START+7)
+#define STR_SVT_COLLATE_UNICODE (STR_SVT_COLLATE_START+8)
+#define STR_SVT_COLLATE_PHONEBOOK (STR_SVT_COLLATE_START+9)
+#define STR_SVT_COLLATE_PHONETIC_F (STR_SVT_COLLATE_START+10)
+#define STR_SVT_COLLATE_PHONETIC_L (STR_SVT_COLLATE_START+11)
+#define STR_SVT_COLLATE_END (STR_SVT_COLLATE_PHONETIC_L)
+
+#define STR_SVT_FILEPICKER_START (STR_SVT_COLLATE_END+1)
+#define STR_SVT_FILEPICKER_AUTO_EXTENSION (STR_SVT_FILEPICKER_START+ 0)
+#define STR_SVT_FILEPICKER_PASSWORD (STR_SVT_FILEPICKER_START+ 1)
+#define STR_SVT_FILEPICKER_FILTER_OPTIONS (STR_SVT_FILEPICKER_START+ 2)
+#define STR_SVT_FILEPICKER_READONLY (STR_SVT_FILEPICKER_START+ 3)
+#define STR_SVT_FILEPICKER_INSERT_AS_LINK (STR_SVT_FILEPICKER_START+ 4)
+#define STR_SVT_FILEPICKER_SHOW_PREVIEW (STR_SVT_FILEPICKER_START+ 5)
+#define STR_SVT_FILEPICKER_PLAY (STR_SVT_FILEPICKER_START+ 6)
+#define STR_SVT_FILEPICKER_VERSION (STR_SVT_FILEPICKER_START+ 7)
+#define STR_SVT_FILEPICKER_TEMPLATES (STR_SVT_FILEPICKER_START+ 8)
+#define STR_SVT_FILEPICKER_IMAGE_TEMPLATE (STR_SVT_FILEPICKER_START+ 9)
+#define STR_SVT_FILEPICKER_SELECTION (STR_SVT_FILEPICKER_START+10)
+#define STR_SVT_FILEPICKER_FILTER_TITLE (STR_SVT_FILEPICKER_START+11)
+#define STR_SVT_FOLDERPICKER_DEFAULT_TITLE (STR_SVT_FILEPICKER_START+12)
+#define STR_SVT_FOLDERPICKER_DEFAULT_DESCRIPTION (STR_SVT_FILEPICKER_START+13)
+#define STR_SVT_FILEPICKER_END (STR_SVT_FOLDERPICKER_DEFAULT_DESCRIPTION)
+
+// String-Ids for accessibility
+#define STR_SVT_ACC_BEGIN (STR_SVT_FILEPICKER_END+1)
+#define STR_SVT_TOOL_PANEL_BUTTON_FWD (STR_SVT_ACC_BEGIN+0)
+#define STR_SVT_TOOL_PANEL_BUTTON_BACK (STR_SVT_ACC_BEGIN+1)
+#define STR_SVT_ACC_DESC_TABLISTBOX (STR_SVT_ACC_BEGIN+2)
+#define STR_SVT_ACC_DESC_FILEVIEW (STR_SVT_ACC_BEGIN+3)
+#define STR_SVT_ACC_DESC_FOLDER (STR_SVT_ACC_BEGIN+4)
+#define STR_SVT_ACC_DESC_FILE (STR_SVT_ACC_BEGIN+5)
+#define STR_SVT_ACC_EMPTY_FIELD (STR_SVT_ACC_BEGIN+6)
+#define STR_SVT_ACC_END (STR_SVT_ACC_EMPTY_FIELD)
+
+#define STR_SVT_INDEXENTRY_START (STR_SVT_ACC_END + 1)
+#define STR_SVT_INDEXENTRY_ALPHANUMERIC (STR_SVT_INDEXENTRY_START+0)
+#define STR_SVT_INDEXENTRY_DICTIONARY (STR_SVT_INDEXENTRY_START+1)
+#define STR_SVT_INDEXENTRY_PINYIN (STR_SVT_INDEXENTRY_START+2)
+#define STR_SVT_INDEXENTRY_RADICAL (STR_SVT_INDEXENTRY_START+3)
+#define STR_SVT_INDEXENTRY_STROKE (STR_SVT_INDEXENTRY_START+4)
+#define STR_SVT_INDEXENTRY_ZHUYIN (STR_SVT_INDEXENTRY_START+5)
+#define STR_SVT_INDEXENTRY_PHONETIC_FS (STR_SVT_INDEXENTRY_START+6)
+#define STR_SVT_INDEXENTRY_PHONETIC_FC (STR_SVT_INDEXENTRY_START+7)
+#define STR_SVT_INDEXENTRY_PHONETIC_LS (STR_SVT_INDEXENTRY_START+8)
+#define STR_SVT_INDEXENTRY_PHONETIC_LC (STR_SVT_INDEXENTRY_START+9)
+#define STR_SVT_INDEXENTRY_END (STR_SVT_INDEXENTRY_PHONETIC_LC)
+
+//String - Ids for Java errors, messages
+//These strings come from project desktop
+//There was no time for translation, therefore the defines needed to
+//remain the same.
+#define STR_SVT_JAVAERROR_START (STR_SVT_INDEXENTRY_END + 1)
+#define STR_QUESTION_JAVADISABLED (STR_SVT_JAVAERROR_START+0)
+#define STR_ERROR_JVMCREATIONFAILED (STR_SVT_JAVAERROR_START+1)
+#define STR_WARNING_JAVANOTFOUND (STR_SVT_JAVAERROR_START+2)
+#define STR_WARNING_INVALIDJAVASETTINGS (STR_SVT_JAVAERROR_START+3)
+#define STR_ERROR_RESTARTREQUIRED (STR_SVT_JAVAERROR_START+4)
+#define STR_SVT_JAVAERROR_END (STR_ERROR_RESTARTREQUIRED)
+
+// String array to match UI language names to LanguageType values and vice versa
+#define STR_ARR_SVT_LANGUAGE_TABLE_START (STR_SVT_JAVAERROR_END + 1)
+#define STR_ARR_SVT_LANGUAGE_TABLE (STR_ARR_SVT_LANGUAGE_TABLE_START + 0)
+#define STR_ARR_SVT_LANGUAGE_TABLE_END (STR_ARR_SVT_LANGUAGE_TABLE)
+
+//.............................................................................
+// dialogs
+
+#define DLG_EXPORT_JPG_START (RID_SVTOOLS_START+110)
+#define DLG_EXPORT_JPG (RID_SVTOOLS_START+111)
+#define DLG_EXPORT_JPG_END (RID_SVTOOLS_START+112)
+
+#define DLG_LOGIN (RID_SVTOOLS_START+113)
+#define DLG_ADDRESSBOOKSOURCE (RID_SVTOOLS_START+114)
+
+#define DLG_REGISTRATION_REQUEST (RID_SVTOOLS_START+115)
+
+#define DLG_EXPORT_EPNG (RID_SVTOOLS_START+116)
+//.............................................................................
+// bitmaps
+
+#define BMP_DEMO_FINGER (RID_SVTOOLS_BITMAP_START + 0)
+#define BMP_HELP_AGENT_IMAGE (RID_SVTOOLS_BITMAP_START + 1)
+#define BMP_HELP_AGENT_CLOSER (RID_SVTOOLS_BITMAP_START + 2)
+#define BMP_PLUGIN (RID_SVTOOLS_BITMAP_START + 3)
+
+//.............................................................................
+// image lists
+
+#define RID_IMG_EXPANDER (RID_SVTOOLS_IMAGELIST_START + 0)
+#define RID_SVTOOLS_IMAGELIST_BIG (RID_SVTOOLS_IMAGELIST_START + 1)
+#define RID_SVTOOLS_IMAGELIST_SMALL (RID_SVTOOLS_IMAGELIST_START + 2)
+#define RID_SVTOOLS_IMAGELIST_EDITBROWSEBOX (RID_SVTOOLS_IMAGELIST_START + 3)
+#define RID_SVTOOLS_IMAGELIST_BIG_HIGHCONTRAST (RID_SVTOOLS_IMAGELIST_START + 4)
+#define RID_SVTOOLS_IMAGELIST_SMALL_HIGHCONTRAST (RID_SVTOOLS_IMAGELIST_START + 5)
+#define RID_SVTOOLS_IMAGELIST_EDITBWSEBOX_H (RID_SVTOOLS_IMAGELIST_START + 6)
+#define RID_FILEPICKER_IMAGES (RID_SVTOOLS_IMAGELIST_START + 7)
+#define RID_FILEPICKER_IMAGES_HC (RID_SVTOOLS_IMAGELIST_START + 8)
+
+//.............................................................................
+// error boxes
+#define ERRBOX_REG_NOSYSBROWSER ( RID_SVTOOLS_START + 0 )
+#define ERRBOX_CHECK_PLZ ( RID_SVTOOLS_START + 11 )
+
+// Java message boxes
+//These strings come from project desktop
+//There was no time for translation, therefore the defines needed to
+//remain the same.
+#define QBX_JAVADISABLED (RID_SVTOOLS_START+20)
+#define ERRORBOX_JVMCREATIONFAILED (RID_SVTOOLS_START+21)
+#define WARNINGBOX_JAVANOTFOUND (RID_SVTOOLS_START+22)
+#define WARNINGBOX_INVALIDJAVASETTINGS (RID_SVTOOLS_START+23)
+#define ERRORBOX_RESTARTREQUIRED (RID_SVTOOLS_START+24)
+
+//.............................................................................
+// images
+#define RID_IMG_TREENODE_COLLAPSED (RID_SVTOOLS_START + 0)
+#define RID_IMG_TREENODE_EXPANDED (RID_SVTOOLS_START + 1)
+#define RID_IMG_TREENODE_COLLAPSED_HC (RID_SVTOOLS_START + 2)
+#define RID_IMG_TREENODE_EXPANDED_HC (RID_SVTOOLS_START + 3)
+
+#define RID_IMG_PRINTERFONT (RID_SVTOOLS_START + 12)
+#define RID_IMG_BITMAPFONT (RID_SVTOOLS_START + 13)
+#define RID_IMG_SCALABLEFONT (RID_SVTOOLS_START + 14)
+#define RID_IMG_PRINTERFONT_HC (RID_SVTOOLS_START + 15)
+#define RID_IMG_BITMAPFONT_HC (RID_SVTOOLS_START + 16)
+#define RID_IMG_SCALABLEFONT_HC (RID_SVTOOLS_START + 17)
+
+#define IMG_TRIANGLE_RIGHT (RID_SVTOOLS_START + 18)
+#define IMG_TRIANGLE_RIGHT_HC (RID_SVTOOLS_START + 19)
+#define IMG_TRIANGLE_DOWN (RID_SVTOOLS_START + 20)
+#define IMG_TRIANGLE_DOWN_HC (RID_SVTOOLS_START + 21)
+
+#define IMG_SVT_FOLDER (RID_SVTOOLS_START + 40)
+
+#define IMG_SVT_NEWDOC (RID_SVTOOLS_START + 52)
+#define IMG_SVT_MYDOCS (RID_SVTOOLS_START + 53)
+#define IMG_SVT_TEMPLATES (RID_SVTOOLS_START + 54)
+#define IMG_SVT_SAMPLES (RID_SVTOOLS_START + 55)
+
+#define IMG_SVT_NEWDOC_HC (RID_SVTOOLS_START + 59)
+#define IMG_SVT_MYDOCS_HC (RID_SVTOOLS_START + 60)
+#define IMG_SVT_TEMPLATES_HC (RID_SVTOOLS_START + 61)
+#define IMG_SVT_SAMPLES_HC (RID_SVTOOLS_START + 62)
+
+#define IMG_SVT_DOCTEMPLATE_BACK_SMALL (RID_SVTOOLS_START + 70)
+#define IMG_SVT_DOCTEMPLATE_BACK_LARGE (RID_SVTOOLS_START + 71)
+#define IMG_SVT_DOCTEMPLATE_PREV_SMALL (RID_SVTOOLS_START + 72)
+#define IMG_SVT_DOCTEMPLATE_PREV_LARGE (RID_SVTOOLS_START + 73)
+#define IMG_SVT_DOCTEMPLATE_PRINT_SMALL (RID_SVTOOLS_START + 74)
+#define IMG_SVT_DOCTEMPLATE_PRINT_LARGE (RID_SVTOOLS_START + 75)
+#define IMG_SVT_DOCTEMPLATE_DOCINFO_SMALL (RID_SVTOOLS_START + 76)
+#define IMG_SVT_DOCTEMPLATE_DOCINFO_LARGE (RID_SVTOOLS_START + 77)
+#define IMG_SVT_DOCTEMPLATE_PREVIEW_SMALL (RID_SVTOOLS_START + 78)
+#define IMG_SVT_DOCTEMPLATE_PREVIEW_LARGE (RID_SVTOOLS_START + 79)
+
+#define IMG_SVT_DOCTEMPL_HC_BACK_SMALL (RID_SVTOOLS_START + 80)
+#define IMG_SVT_DOCTEMPL_HC_BACK_LARGE (RID_SVTOOLS_START + 81)
+#define IMG_SVT_DOCTEMPL_HC_PREV_SMALL (RID_SVTOOLS_START + 82)
+#define IMG_SVT_DOCTEMPL_HC_PREV_LARGE (RID_SVTOOLS_START + 83)
+#define IMG_SVT_DOCTEMPL_HC_PRINT_SMALL (RID_SVTOOLS_START + 84)
+#define IMG_SVT_DOCTEMPL_HC_PRINT_LARGE (RID_SVTOOLS_START + 85)
+#define IMG_SVT_DOCTEMPL_HC_DOCINFO_SMALL (RID_SVTOOLS_START + 86)
+#define IMG_SVT_DOCTEMPL_HC_DOCINFO_LARGE (RID_SVTOOLS_START + 87)
+#define IMG_SVT_DOCTEMPL_HC_PREVIEW_SMALL (RID_SVTOOLS_START + 88)
+#define IMG_SVT_DOCTEMPL_HC_PREVIEW_LARGE (RID_SVTOOLS_START + 89)
+
+#define RID_IMG_PRNDLG_COLLATE (STR_SVT_PRNDLG_START + 29)
+#define RID_IMG_PRNDLG_NOCOLLATE (STR_SVT_PRNDLG_START + 30)
+#define RID_IMG_PRNDLG_COLLATE_HC (STR_SVT_PRNDLG_START + 31)
+#define RID_IMG_PRNDLG_NOCOLLATE_HC (STR_SVT_PRNDLG_START + 32)
+
+#endif // #ifndef _SVTOOLS_HRC
+
+// ******************************************************************* EOF
+
diff --git a/svtools/inc/svtools/svtreebx.hxx b/svtools/inc/svtools/svtreebx.hxx
new file mode 100644
index 000000000000..a600b91db1c4
--- /dev/null
+++ b/svtools/inc/svtools/svtreebx.hxx
@@ -0,0 +1,421 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+#ifndef _SVTREEBOX_HXX
+#define _SVTREEBOX_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/svlbox.hxx>
+#include <svtools/svlbitm.hxx>
+
+// forward and defines ---------------------------------------------------
+
+class SvImpLBox;
+class SvInplaceEdit;
+class TabBar;
+
+#define SV_TAB_BORDER 8
+
+#define WB_HASBUTTONSATROOT ((WinBits)0x0800)
+#define WB_NOINITIALSELECTION WB_DROPDOWN
+#define WB_HIDESELECTION WB_NOHIDESELECTION
+#define WB_FORCE_MAKEVISIBLE WB_SPIN
+
+#define SV_LISTBOX_ID_TREEBOX 1 // fuer SvLBox::IsA()
+#define SV_ENTRYHEIGHTOFFS_PIXEL 2
+
+#define TREEFLAG_CHKBTN 0x0001
+#define TREEFLAG_USESEL 0x0002
+#define TREEFLAG_MANINS 0x0004
+#define TREEFLAG_RECALCTABS 0x0008
+
+typedef sal_Int64 ExtendedWinBits;
+
+// disable the behavior of automatically selecting a "CurEntry" upon painting the control
+#define EWB_NO_AUTO_CURENTRY 0x00000001
+
+// class SvTreeListBox ---------------------------------------------------
+
+class SVT_DLLPUBLIC SvTreeListBox : public SvLBox
+{
+ friend class SvImpLBox;
+ friend class ImpLBSelEng;
+ friend class TreeControlPeer;
+
+ SvImpLBox* pImp;
+ Link aCheckButtonHdl;
+ Link aScrolledHdl;
+ Accelerator aInpEditAcc;
+ Image aPrevInsertedExpBmp;
+ Image aPrevInsertedColBmp;
+ Image aCurInsertedExpBmp;
+ Image aCurInsertedColBmp;
+
+ short nContextBmpWidthMax;
+ USHORT nFirstSelTab, nLastSelTab;
+ short nEntryHeight;
+ short nEntryHeightOffs;
+ short nIndent;
+ short nFocusWidth;
+ USHORT aContextBmpMode;
+
+#ifdef _SVTREEBX_CXX
+ DECL_DLLPRIVATE_LINK( CheckButtonClick, SvLBoxButtonData * );
+
+ SVT_DLLPRIVATE short GetHeightOffset( const Image& rBmp, Size& rLogicSize);
+ SVT_DLLPRIVATE short GetHeightOffset( const Font& rFont, Size& rLogicSize);
+
+ SVT_DLLPRIVATE void SetEntryHeight( SvLBoxEntry* pEntry );
+ SVT_DLLPRIVATE void AdjustEntryHeight( const Image& rBmp );
+ SVT_DLLPRIVATE void AdjustEntryHeight( const Font& rFont );
+
+ SVT_DLLPRIVATE void ImpEntryInserted( SvLBoxEntry* pEntry );
+ SVT_DLLPRIVATE long PaintEntry1( SvLBoxEntry*, long nLine,
+ USHORT nTabFlagMask=0xffff,
+ BOOL bHasClipRegion=FALSE );
+
+ SVT_DLLPRIVATE void InitTreeView( WinBits nWinStyle );
+ SVT_DLLPRIVATE SvLBoxItem* GetItem_Impl( SvLBoxEntry*, long nX, SvLBoxTab** ppTab,
+ USHORT nEmptyWidth );
+#endif
+
+protected:
+ SvLBoxButtonData* pCheckButtonData;
+ USHORT nTreeFlags;
+
+ SvLBoxEntry* pEdEntry;
+ SvLBoxItem* pEdItem;
+
+ void EditItemText( SvLBoxEntry* pEntry, SvLBoxString* pItem,
+ const Selection& );
+ void EditedText( const XubString& );
+ void EditingRequest( SvLBoxEntry* pEntry, SvLBoxItem* pItem,
+ const Point& rMousePos );
+
+ SvPtrarr aTabs;
+
+ // berechnet abhaengig von TreeList-Style & Bitmap-Groessen
+ // alle Tabulatoren neu; wird beim Einfuegen/Austauschen von
+ // Bitmaps, beim Wechsel des Models usw. automatisch gerufen
+ virtual void SetTabs();
+ void SetTabs_Impl();
+ void AddTab( long nPos,USHORT nFlags=SV_LBOXTAB_ADJUST_LEFT,
+ void* pUserData = 0 );
+ USHORT TabCount() const { return aTabs.Count(); }
+ SvLBoxTab* GetFirstDynamicTab() const;
+ SvLBoxTab* GetFirstDynamicTab( USHORT& rTabPos ) const;
+ SvLBoxTab* GetFirstTab( USHORT nFlagMask, USHORT& rTabPos );
+ SvLBoxTab* GetLastTab( USHORT nFlagMask, USHORT& rTabPos );
+ SvLBoxTab* GetTab( SvLBoxEntry*, SvLBoxItem* ) const;
+ void ClearTabList();
+
+ virtual void InitEntry(SvLBoxEntry*,const XubString&,const Image&,const Image&,SvLBoxButtonKind);
+
+ virtual void NotifyBeginScroll();
+ virtual void NotifyEndScroll();
+ // nLines == 0 => horizontales Scrolling
+ virtual void NotifyScrolling( long nLines );
+ virtual void NotifyScrolled();
+ void SetScrolledHdl( const Link& rLink ) { aScrolledHdl = rLink; }
+ const Link& GetScrolledHdl() const { return aScrolledHdl; }
+ long GetXOffset() const { return GetMapMode().GetOrigin().X(); }
+
+ // wird aufgerufen, _bevor_ Bereiche im Control invalidiert werden,
+ // kann zum Hiden von Elementen benutzt werden, die von aussen
+ // in das Control hineingezeichnet werden
+ virtual void NotifyInvalidating();
+
+ virtual ULONG GetAscInsertionPos( SvLBoxEntry*, SvLBoxEntry* pParent );
+ virtual ULONG GetDescInsertionPos( SvLBoxEntry*, SvLBoxEntry* pParent );
+ virtual void Command( const CommandEvent& rCEvt );
+
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void CursorMoved( SvLBoxEntry* pNewCursor );
+ virtual void PreparePaint( SvLBoxEntry* );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ void InitSettings(BOOL bFont,BOOL bForeground,BOOL bBackground);
+ BOOL IsCellFocusEnabled() const;
+ bool SetCurrentTabPos( USHORT _nNewPos );
+ USHORT GetCurrentTabPos() const;
+ void CallImplEventListeners(ULONG nEvent, void* pData);
+
+ void ImplEditEntry( SvLBoxEntry* pEntry );
+
+ sal_Bool AreChildrenTransient() const;
+ void SetChildrenNotTransient();
+
+public:
+ SvTreeListBox( Window* pParent, WinBits nWinStyle=0 );
+ SvTreeListBox( Window* pParent, const ResId& rResId );
+ ~SvTreeListBox();
+
+ void SetExtendedWinBits( ExtendedWinBits _nBits );
+ ExtendedWinBits GetExtendedWinBits() const;
+
+ void DisconnectFromModel();
+
+ void EnableCheckButton( SvLBoxButtonData* );
+ void SetCheckButtonData( SvLBoxButtonData* );
+ void SetNodeBitmaps( const Image& rCollapsedNodeBmp, const Image& rExpandedNodeBmp, BmpColorMode _eMode = BMP_COLOR_NORMAL );
+ void SetDontKnowNodeBitmap( const Image& rDontKnowBmp, BmpColorMode _eMode = BMP_COLOR_NORMAL );
+
+ /** returns the default image which clients should use for expanded nodes, to have a consistent user
+ interface experience in the whole product.
+ */
+ static const Image& GetDefaultExpandedNodeImage( BmpColorMode _eMode = BMP_COLOR_NORMAL );
+
+ /** returns the default image which clients should use for expanded nodes, to have a consistent user
+ interface experience in the whole product.
+ */
+ static const Image& GetDefaultCollapsedNodeImage( BmpColorMode _eMode = BMP_COLOR_NORMAL );
+
+ /** sets default bitmaps for collapsed and expanded nodes.
+ */
+ inline void SetNodeDefaultImages( )
+ {
+ SetNodeBitmaps( GetDefaultCollapsedNodeImage( BMP_COLOR_NORMAL ), GetDefaultExpandedNodeImage( BMP_COLOR_NORMAL ), BMP_COLOR_NORMAL );
+ SetNodeBitmaps( GetDefaultCollapsedNodeImage( BMP_COLOR_HIGHCONTRAST ), GetDefaultExpandedNodeImage( BMP_COLOR_HIGHCONTRAST ), BMP_COLOR_HIGHCONTRAST );
+ }
+
+ virtual SvLBoxEntry* InsertEntry( const XubString& rText, SvLBoxEntry* pParent = 0,
+ BOOL bChildsOnDemand = FALSE,
+ ULONG nPos=LIST_APPEND, void* pUserData = 0,
+ SvLBoxButtonKind eButtonKind = SvLBoxButtonKind_enabledCheckbox );
+
+ virtual SvLBoxEntry* InsertEntry( const XubString& rText,
+ const Image& rExpandedEntryBmp,
+ const Image& rCollapsedEntryBmp,
+ SvLBoxEntry* pParent = 0,
+ BOOL bChildsOnDemand = FALSE,
+ ULONG nPos = LIST_APPEND, void* pUserData = 0,
+ SvLBoxButtonKind eButtonKind = SvLBoxButtonKind_enabledCheckbox );
+
+ const Image& GetDefaultExpandedEntryBmp( BmpColorMode _eMode = BMP_COLOR_NORMAL ) const;
+ const Image& GetDefaultCollapsedEntryBmp( BmpColorMode _eMode = BMP_COLOR_NORMAL ) const;
+
+ void SetDefaultExpandedEntryBmp( const Image& rBmp, BmpColorMode _eMode = BMP_COLOR_NORMAL );
+ void SetDefaultCollapsedEntryBmp( const Image& rBmp, BmpColorMode _eMode = BMP_COLOR_NORMAL );
+
+ void SetCheckButtonState( SvLBoxEntry*, SvButtonState );
+ SvButtonState GetCheckButtonState( SvLBoxEntry* ) const;
+
+ void ShowExpandBitmapOnCursor( BOOL );
+ BOOL IsExpandBitmapOnCursor() const { return (BOOL)(aContextBmpMode & SVLISTENTRYFLAG_FOCUSED)!=0; }
+
+ void SetEntryText(SvLBoxEntry*, const XubString& );
+ void SetExpandedEntryBmp( SvLBoxEntry* _pEntry, const Image& _rImage, BmpColorMode _eMode = BMP_COLOR_NORMAL );
+ void SetCollapsedEntryBmp( SvLBoxEntry* _pEntry, const Image& _rImage, BmpColorMode _eMode = BMP_COLOR_NORMAL );
+
+ virtual String GetEntryText( SvLBoxEntry* pEntry ) const;
+ String SearchEntryText( SvLBoxEntry* pEntry ) const;
+ const Image& GetExpandedEntryBmp(SvLBoxEntry* _pEntry, BmpColorMode _eMode = BMP_COLOR_NORMAL ) const;
+ const Image& GetCollapsedEntryBmp(SvLBoxEntry* _pEntry, BmpColorMode _eMode = BMP_COLOR_NORMAL ) const;
+
+ void SetCheckButtonHdl( const Link& rLink ) { aCheckButtonHdl=rLink; }
+ Link GetCheckButtonHdl() const { return aCheckButtonHdl; }
+ virtual void CheckButtonHdl();
+
+ virtual SvLBoxEntry* CloneEntry( SvLBoxEntry* pSource );
+
+ virtual USHORT IsA();
+
+ void SetSublistOpenWithReturn( BOOL bMode = TRUE ); // open/close sublist with return/enter
+ BOOL IsSublistOpenWithReturn() const;
+ void SetSublistOpenWithLeftRight( BOOL bMode = TRUE ); // open/close sublist with cursor left/right
+ BOOL IsSublistOpenWithLeftRight() const;
+
+ void EnableInplaceEditing( BOOL bEnable );
+ BOOL IsInplaceEditingEnabled() const { return SvLBox::IsInplaceEditingEnabled(); }
+ inline void ForbidEmptyText() { SvLBox::ForbidEmptyText(); }
+ // Editiert das erste StringItem des Entries, 0==Cursor
+ void EditEntry( SvLBoxEntry* pEntry = NULL );
+ void CancelEditing();
+ virtual BOOL EditingEntry( SvLBoxEntry* pEntry, Selection& );
+ virtual BOOL EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText );
+ BOOL IsEditingActive() const { return SvLBox::IsEditingActive(); }
+ void EndEditing( BOOL bCancel = FALSE ) { SvLBox::EndEditing( bCancel ); }
+ BOOL EditingCanceled() const { return SvLBox::EditingCanceled(); }
+
+ virtual void RequestingChilds( SvLBoxEntry* pParent );
+
+ virtual void Paint( const Rectangle& rRect );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void Resize();
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ void SetUpdateMode( BOOL );
+ // aktualisiert nicht die vertikale ScrollBar
+ void SetUpdateModeFast( BOOL );
+
+ using SvListView::SetModel;
+ void SetModel( SvLBoxTreeList* );
+ virtual void ModelHasCleared();
+ virtual void ModelHasInserted( SvListEntry* pEntry );
+ virtual void ModelHasInsertedTree( SvListEntry* pEntry );
+ virtual void ModelIsMoving(SvListEntry* pSource,
+ SvListEntry* pTargetParent, ULONG nChildPos );
+ virtual void ModelHasMoved(SvListEntry* pSource );
+ virtual void ModelIsRemoving( SvListEntry* pEntry );
+ virtual void ModelHasRemoved( SvListEntry* pEntry );
+ virtual void ModelHasEntryInvalidated( SvListEntry* pEntry );
+
+ void ShowTargetEmphasis( SvLBoxEntry*, BOOL bShow );
+ using Window::GetDropTarget;
+ SvLBoxEntry* GetDropTarget( const Point& );
+ void ScrollOutputArea( short nDeltaEntries );
+
+ short GetEntryHeight() const { return nEntryHeight; }
+ void SetEntryHeight( short nHeight, BOOL bAlways = FALSE );
+ Size GetOutputSizePixel() const;
+ short GetIndent() const { return nIndent; }
+ void SetIndent( short nIndent );
+ void SetSpaceBetweenEntries( short nSpace );
+ short GetSpaceBetweenEntries() const {return nEntryHeightOffs;}
+ Point GetEntryPosition( SvLBoxEntry* ) const;
+ void ShowEntry( SvLBoxEntry* ); // !!!OBSOLETE, use MakeVisible
+ virtual void MakeVisible( SvLBoxEntry* );
+ void MakeVisible( SvLBoxEntry*, BOOL bMoveToTop );
+
+ void SetCollapsedNodeBmp( const Image&, BmpColorMode _eMode = BMP_COLOR_NORMAL );
+ void SetExpandedNodeBmp( const Image&, BmpColorMode _eMode = BMP_COLOR_NORMAL );
+ Image GetCollapsedNodeBmp( BmpColorMode _eMode = BMP_COLOR_NORMAL ) const;
+ Image GetExpandedNodeBmp( BmpColorMode _eMode = BMP_COLOR_NORMAL ) const;
+
+ void SetFont( const Font& rFont );
+
+ using Window::SetCursor;
+ void SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect = FALSE );
+
+ SvLBoxEntry* GetEntry( const Point& rPos, BOOL bHit = FALSE ) const;
+ SvLBoxEntry* GetEntry( SvLBoxEntry* pParent, ULONG nPos ) const { return SvLBox::GetEntry(pParent,nPos); }
+ SvLBoxEntry* GetEntry( ULONG nRootPos ) const { return SvLBox::GetEntry(nRootPos);}
+
+ void SetWindowBits( WinBits nWinStyle );
+ WinBits GetWindowBits() const { return nWindowStyle; }
+
+ void PaintEntry( SvLBoxEntry* );
+ long PaintEntry( SvLBoxEntry*, long nLine,
+ USHORT nTabFlagMask=0xffff );
+ virtual Rectangle GetFocusRect( SvLBoxEntry*, long nLine );
+ // Beruecksichtigt Einrueckung
+ virtual long GetTabPos( SvLBoxEntry*, SvLBoxTab* );
+ void InvalidateEntry( SvLBoxEntry* );
+ SvLBoxItem* GetItem( SvLBoxEntry*, long nX, SvLBoxTab** ppTab);
+ SvLBoxItem* GetItem( SvLBoxEntry*, long nX );
+ SvLBoxItem* GetFirstDynamicItem( SvLBoxEntry* pEntry );
+
+ void SetDragDropMode( DragDropMode );
+ void SetSelectionMode( SelectionMode );
+ void SetAddMode( BOOL bAdd );
+ BOOL IsAddMode() const;
+
+ virtual BOOL Expand( SvLBoxEntry* pParent );
+ virtual BOOL Collapse( SvLBoxEntry* pParent );
+ virtual BOOL Select( SvLBoxEntry* pEntry, BOOL bSelect=TRUE );
+ virtual ULONG SelectChilds( SvLBoxEntry* pParent, BOOL bSelect );
+ virtual void SelectAll( BOOL bSelect, BOOL bPaint = TRUE );
+ virtual void SetCurEntry( SvLBoxEntry* _pEntry );
+ virtual SvLBoxEntry*
+ GetCurEntry() const;
+
+ using Window::Invalidate;
+ virtual void Invalidate( USHORT nFlags = 0);
+ virtual void Invalidate( const Rectangle&, USHORT nFlags = 0 );
+
+ void SetHighlightRange(USHORT nFirstTab=0,USHORT nLastTab=0xffff);
+ void RemoveHighlightRange();
+
+ virtual Region GetDragRegion() const;
+
+ // Childs des Parents werden Childs des naechstoberen Parents
+ void RemoveParentKeepChilds( SvLBoxEntry* pParent );
+
+ DECL_LINK( DefaultCompare, SvSortData* );
+ virtual void ModelNotification( USHORT nActionId, SvListEntry* pEntry1,
+ SvListEntry* pEntry2, ULONG nPos );
+
+ long GetTextOffset() const;
+ void EndSelection();
+ BOOL IsNodeButton( const Point& rPos ) const;
+ void RepaintScrollBars() const;
+ ScrollBar* GetVScroll();
+ ScrollBar* GetHScroll();
+ void EnableAsyncDrag( BOOL b );
+
+ SvLBoxEntry* GetFirstEntryInView() const;
+ SvLBoxEntry* GetNextEntryInView(SvLBoxEntry*) const;
+
+ void ShowFocusRect( const SvLBoxEntry* pEntry );
+ void SetTabBar( TabBar* pTabBar );
+ void InitStartEntry();
+
+ // reset all what could lead to editingText in e.g. a contextmenu call
+ void CancelPendingEdit();
+
+ virtual PopupMenu* CreateContextMenu( void );
+ virtual void ExcecuteContextMenuAction( USHORT nSelectedPopupEntry );
+
+ void EnableContextMenuHandling( void );
+ void EnableContextMenuHandling( BOOL bEnable );
+ BOOL IsContextMenuHandlingEnabled( void ) const;
+
+ void EnableList( bool _bEnable );
+
+ // ACCESSIBILITY ==========================================================
+
+ /** Creates and returns the accessible object of the Box. */
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible > CreateAccessible();
+
+ /** Fills the StateSet with all states (except DEFUNC, done by the accessible object). */
+ virtual void FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& rStateSet ) const;
+
+ /** Fills the StateSet of one entry. */
+ virtual void FillAccessibleEntryStateSet( SvLBoxEntry* pEntry, ::utl::AccessibleStateSetHelper& rStateSet ) const;
+
+ /** Calculate and returns the bounding rectangle of an entry.
+ @param pEntry
+ The entry.
+ @return The bounding rectangle of an entry. */
+ virtual Rectangle GetBoundingRect( SvLBoxEntry* pEntry );
+
+ /** Enables, that one cell of a tablistbox entry can be focused */
+ void EnableCellFocus();
+
+protected:
+ using SvListView::Expand;
+ using SvListView::Collapse;
+ using SvListView::Select;
+ using SvListView::SelectChilds;
+ using SvListView::SelectAll;
+};
+
+#endif
+
diff --git a/svtools/inc/svtools/svxbox.hxx b/svtools/inc/svtools/svxbox.hxx
new file mode 100644
index 000000000000..25deba4d091c
--- /dev/null
+++ b/svtools/inc/svtools/svxbox.hxx
@@ -0,0 +1,193 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+#ifndef _SVX_BOX_HXX
+#define _SVX_BOX_HXX
+
+// include ---------------------------------------------------------------
+
+#include <svl/svarray.hxx>
+#include <tools/string.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/combobox.hxx>
+#include <svtools/svtdllapi.h>
+
+// forward ---------------------------------------------------------------
+
+class SvxBoxEntry;
+class SvxListBase;
+
+SV_DECL_PTRARR( SvxEntryLst, SvxBoxEntry*, 10, 10 )
+
+// class SvxBoxEntry -----------------------------------------------------
+
+class SVT_DLLPUBLIC SvxBoxEntry
+{
+ friend class SvxListBox;
+ friend class SvxComboBox;
+
+public:
+ SvxBoxEntry( const String& aName, USHORT nId=0 );
+ SvxBoxEntry( const SvxBoxEntry& rOrg );
+ SvxBoxEntry();
+
+ String aName;
+ USHORT nId;
+
+private:
+ BOOL bModified;
+ BOOL bNew;
+};
+
+// class SvxListBox ------------------------------------------------------
+
+class SVT_DLLPUBLIC SvxListBox : public ListBox
+{
+ using ListBox::InsertEntry;
+ using ListBox::RemoveEntry;
+ using ListBox::GetEntryPos;
+ using ListBox::IsEntrySelected;
+ using ListBox::SelectEntry;
+
+public:
+ SvxListBox( Window* pParent, WinBits nBits = WB_BORDER );
+ SvxListBox( Window* pParent, const ResId& rId );
+ ~SvxListBox();
+
+ void InsertNewEntry( const SvxBoxEntry& rEntry );
+ void InsertEntry( const SvxBoxEntry& rEntry,
+ USHORT nId = LISTBOX_ENTRY_NOTFOUND );
+
+ void RemoveEntry( USHORT nPos );
+ void RemoveEntry( const SvxBoxEntry& rEntry );
+
+ void Clear();
+
+ USHORT GetEntryPos( const SvxBoxEntry& rEntry ) const;
+ const SvxBoxEntry& GetSvxBoxEntry( USHORT nIdx ) const;
+
+ inline BOOL IsEntrySelected( const SvxBoxEntry& rEntry ) const;
+ const SvxBoxEntry& GetSelectSvxBoxEntry( USHORT nIdx = 0 ) const;
+ inline void SelectEntry( const SvxBoxEntry& rEntry,
+ BOOL bSelect = TRUE );
+
+ void ModifyEntry( USHORT nPos, const String& aName );
+ USHORT GetModifiedCount() const;
+ const SvxBoxEntry& GetModifiedEntry( USHORT nPos ) const;
+
+ USHORT GetRemovedCount() const;
+ const SvxBoxEntry& GetRemovedEntry( USHORT nPos ) const;
+
+ USHORT GetNewCount() const;
+ const SvxBoxEntry& GetNewEntry( USHORT nPos ) const;
+
+private:
+ SvxEntryLst aEntryLst;
+ SvxEntryLst aDelEntryLst;
+ SvxBoxEntry aDefault;
+
+ void InitListBox();
+ void InsertSorted( SvxBoxEntry* pEntry );
+};
+
+// inlines ---------------------------------------------------------------
+
+inline BOOL SvxListBox::IsEntrySelected( const SvxBoxEntry& aEntry ) const
+ { return ListBox::IsEntrySelected( aEntry.aName ); }
+
+inline void SvxListBox::SelectEntry( const SvxBoxEntry& aEntry, BOOL bSelect )
+ { ListBox::SelectEntry( aEntry.aName, bSelect ); }
+
+// enum SvxComboBoxStyle -------------------------------------------------
+
+enum SvxComboBoxStyle
+{
+ SVX_CBS_UPPER = 0x01,
+ SVX_CBS_LOWER = 0x02,
+ SVX_CBS_ALL = 0x04,
+ SVX_CBS_FILENAME = 0x08,
+#ifdef WIN
+ SVX_CBS_SW_FILENAME = SVX_CBS_FILENAME | SVX_CBS_LOWER
+#else
+ SVX_CBS_SW_FILENAME = SVX_CBS_FILENAME
+#endif
+};
+
+// class SvxComboBox -----------------------------------------------------
+
+class SVT_DLLPUBLIC SvxComboBox : public ComboBox
+{
+ using ComboBox::InsertEntry;
+ using ComboBox::RemoveEntry;
+ using ComboBox::GetEntryPos;
+ using Window::SetStyle;
+
+public:
+ SvxComboBox( Window* pParent,
+ WinBits nBits = WB_BORDER, USHORT nStyleBits = SVX_CBS_ALL );
+ SvxComboBox( Window* pParent, const ResId& rId, USHORT nStyleBits = SVX_CBS_ALL );
+ ~SvxComboBox();
+
+ void InsertNewEntry( const SvxBoxEntry& );
+ void InsertEntry( const SvxBoxEntry& );
+
+ void RemoveEntry( USHORT nPos );
+ void RemoveEntry( const SvxBoxEntry& rEntry );
+
+ void Clear();
+
+ USHORT GetEntryPos( const SvxBoxEntry& rEntry ) const;
+ const SvxBoxEntry& GetEntry( USHORT nIdx ) const;
+
+ void ModifyEntry( USHORT nPos, const String& aName );
+ USHORT GetModifiedCount() const;
+ const SvxBoxEntry& GetModifiedEntry( USHORT nPos ) const;
+
+ USHORT GetRemovedCount() const;
+ const SvxBoxEntry& GetRemovedEntry( USHORT nPos ) const;
+
+ USHORT GetNewCount() const;
+ const SvxBoxEntry& GetNewEntry( USHORT nPos ) const;
+
+ USHORT GetStyle() const { return nStyle; }
+ void SetStyle( const USHORT nSt ) { nStyle = nSt; }
+
+ String GetText() const;
+
+private:
+ SvxEntryLst aEntryLst;
+ SvxEntryLst aDelEntryLst;
+ SvxBoxEntry aDefault;
+ USHORT nStyle;
+
+ virtual void KeyInput( const KeyEvent& rKEvt );
+
+ void InitComboBox();
+ void InsertSorted( SvxBoxEntry* pEntry );
+};
+
+#endif
+
diff --git a/svtools/inc/svtools/syntaxhighlight.hxx b/svtools/inc/svtools/syntaxhighlight.hxx
new file mode 100644
index 000000000000..8cf7126fa24c
--- /dev/null
+++ b/svtools/inc/svtools/syntaxhighlight.hxx
@@ -0,0 +1,191 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+#ifndef _SVTOOLS_SYNTAXHIGHLIGHT_HXX
+#define _SVTOOLS_SYNTAXHIGHLIGHT_HXX
+
+#include <list>
+
+#include <vos/macros.hxx>
+#include <vos/mutex.hxx>
+
+#include <vcl/svapp.hxx>
+
+#include <tools/stream.hxx>
+#include <tools/shl.hxx>
+
+#include <svl/brdcst.hxx>
+#include <svtools/svtdllapi.h>
+
+
+// for the bsearch
+#ifdef WNT
+#define CDECL _cdecl
+#endif
+#if defined(UNX) || defined(OS2)
+#define CDECL
+#endif
+#ifdef UNX
+#include <sys/resource.h>
+#endif
+
+#include <stdio.h>
+
+#include <tools/string.hxx>
+#include <tools/gen.hxx>
+
+#include <svl/svarray.hxx>
+
+
+// Token-Typen TT_...
+enum TokenTypes
+{
+ TT_UNKNOWN,
+ TT_IDENTIFIER,
+ TT_WHITESPACE,
+ TT_NUMBER,
+ TT_STRING,
+ TT_EOL,
+ TT_COMMENT,
+ TT_ERROR,
+ TT_OPERATOR,
+ TT_KEYWORDS,
+ TT_PARAMETER
+};
+
+struct HighlightPortion { UINT16 nBegin; UINT16 nEnd; TokenTypes tokenType; };
+
+
+
+SV_DECL_VARARR(HighlightPortions, HighlightPortion, 0, 16)
+
+/////////////////////////////////////////////////////////////////////////
+// Hilfsklasse zur Untersuchung von JavaScript-Modulen, zunaechst zum
+// Heraussuchen der Funktionen, spaeter auch zum Syntax-Highlighting verwenden
+
+// Flags fuer Zeichen-Eigenschaften
+#define CHAR_START_IDENTIFIER 0x0001
+#define CHAR_IN_IDENTIFIER 0x0002
+#define CHAR_START_NUMBER 0x0004
+#define CHAR_IN_NUMBER 0x0008
+#define CHAR_IN_HEX_NUMBER 0x0010
+#define CHAR_IN_OCT_NUMBER 0x0020
+#define CHAR_START_STRING 0x0040
+#define CHAR_OPERATOR 0x0080
+#define CHAR_SPACE 0x0100
+#define CHAR_EOL 0x0200
+
+#define CHAR_EOF 0x00
+
+
+// Sprachmodus des HighLighters (spaeter eventuell feiner
+// differenzieren mit Keyword-Liste, C-Kommentar-Flag)
+enum HighlighterLanguage
+{
+ HIGHLIGHT_BASIC,
+ HIGHLIGHT_SQL
+};
+
+class SimpleTokenizer_Impl
+{
+ HighlighterLanguage aLanguage;
+ // Zeichen-Info-Tabelle
+ USHORT aCharTypeTab[256];
+
+ const sal_Unicode* mpStringBegin;
+ const sal_Unicode* mpActualPos;
+
+ // Zeile und Spalte
+ UINT32 nLine;
+ UINT32 nCol;
+
+ sal_Unicode peekChar( void ) { return *mpActualPos; }
+ sal_Unicode getChar( void ) { nCol++; return *mpActualPos++; }
+
+ // Hilfsfunktion: Zeichen-Flag Testen
+ BOOL testCharFlags( sal_Unicode c, USHORT nTestFlags );
+
+ // Neues Token holen, Leerstring == nix mehr da
+ BOOL getNextToken( /*out*/TokenTypes& reType,
+ /*out*/const sal_Unicode*& rpStartPos, /*out*/const sal_Unicode*& rpEndPos );
+
+ String getTokStr( /*out*/const sal_Unicode* pStartPos, /*out*/const sal_Unicode* pEndPos );
+
+#ifdef DBG_UTIL
+ // TEST: Token ausgeben
+ String getFullTokenStr( /*out*/TokenTypes eType,
+ /*out*/const sal_Unicode* pStartPos, /*out*/const sal_Unicode* pEndPos );
+#endif
+
+ const char** ppListKeyWords;
+ UINT16 nKeyWordCount;
+
+public:
+ SimpleTokenizer_Impl( HighlighterLanguage aLang = HIGHLIGHT_BASIC );
+ ~SimpleTokenizer_Impl( void );
+
+ UINT16 parseLine( UINT32 nLine, const String* aSource );
+ void getHighlightPortions( UINT32 nParseLine, const String& rLine,
+ /*out*/HighlightPortions& portions );
+ void setKeyWords( const char** ppKeyWords, UINT16 nCount );
+};
+
+
+//*** SyntaxHighlighter-Klasse ***
+// Konzept: Der Highlighter wird ueber alle Aenderungen im Source
+// informiert (notifyChange) und liefert dem Aufrufer jeweils die
+// Information zurueck, welcher Zeilen-Bereich des Source-Codes
+// aufgrund dieser Aenderung neu gehighlighted werden muss.
+// Dazu merkt sich Highlighter intern fuer jede Zeile, ob dort
+// C-Kommentare beginnen oder enden.
+class SVT_DLLPUBLIC SyntaxHighlighter
+{
+ HighlighterLanguage eLanguage;
+ SimpleTokenizer_Impl* m_pSimpleTokenizer;
+ char* m_pKeyWords;
+ UINT16 m_nKeyWordCount;
+
+// void initializeKeyWords( HighlighterLanguage eLanguage );
+
+public:
+ SyntaxHighlighter( void );
+ ~SyntaxHighlighter( void );
+
+ // HighLighter (neu) initialisieren, die Zeilen-Tabelle wird
+ // dabei komplett geloescht, d.h. im Abschluss wird von einem
+ // leeren Source ausgegangen. In notifyChange() kann dann
+ // nur Zeile 0 angegeben werden.
+ void initialize( HighlighterLanguage eLanguage_ );
+
+ const Range notifyChange( UINT32 nLine, INT32 nLineCountDifference,
+ const String* pChangedLines, UINT32 nArrayLength);
+
+ void getHighlightPortions( UINT32 nLine, const String& rLine,
+ HighlightPortions& pPortions );
+
+ HighlighterLanguage GetLanguage() { return eLanguage;}
+};
+#endif
diff --git a/svtools/inc/svtools/table/abstracttablecontrol.hxx b/svtools/inc/svtools/table/abstracttablecontrol.hxx
new file mode 100644
index 000000000000..9206f20ecbcb
--- /dev/null
+++ b/svtools/inc/svtools/table/abstracttablecontrol.hxx
@@ -0,0 +1,134 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#ifndef SVTOOLS_INC_TABLE_ABSTRACTTABLECONTROL_HXX
+#define SVTOOLS_INC_TABLE_ABSTRACTTABLECONTROL_HXX
+
+#include <sal/types.h>
+#include <vcl/event.hxx>
+#include <vcl/seleng.hxx>
+#include "tabletypes.hxx"
+//........................................................................
+namespace svt { namespace table
+{
+//........................................................................
+
+ enum TableControlAction
+ {
+ /// moves the cursor in the table control one row up, if possible, by keeping the current column
+ cursorUp,
+ /// moves the cursor in the table control one row down, if possible, by keeping the current column
+ cursorDown,
+ /// moves the cursor in the table control one column to the left, if possible, by keeping the current row
+ cursorLeft,
+ /// moves the cursor in the table control one column to the right, if possible, by keeping the current row
+ cursorRight,
+ /// moves the cursor to the beginning of the current line
+ cursorToLineStart,
+ /// moves the cursor to the end of the current line
+ cursorToLineEnd,
+ /// moves the cursor to the first row, keeping the current column
+ cursorToFirstLine,
+ /// moves the cursor to the last row, keeping the current column
+ cursorToLastLine,
+ /// moves the cursor one page up, keeping the current column
+ cursorPageUp,
+ /// moves the cursor one page down, keeping the current column
+ cursorPageDown,
+ /// moves the cursor to the top-most, left-most cell
+ cursorTopLeft,
+ /// moves the cursor to the bottom-most, right-most cell
+ cursorBottomRight,
+ /// selects the row, where the actual cursor is
+ cursorSelectRow,
+ /// selects the rows, above the actual cursor is
+ cursorSelectRowUp,
+ /// selects the row, beneath the actual cursor is
+ cursorSelectRowDown,
+ /// selects the row, from the actual cursor till top
+ cursorSelectRowAreaTop,
+ /// selects the row, from the actual cursor till bottom
+ cursorSelectRowAreaBottom,
+
+
+ /// invalid and final enumeration value, not to be actually used
+ invalidTableControlAction
+ };
+
+ //====================================================================
+ //= IAbstractTableControl
+ //====================================================================
+ /** defines a callback interface to be implemented by a concrete table control
+ */
+ class SAL_NO_VTABLE IAbstractTableControl
+ {
+ public:
+ /** hides the cell cursor
+
+ The method cares for successive calls, that is, for every call to
+ ->hideCursor(), you need one call to ->showCursor. Only if the number
+ of both calls matches, the cursor is really shown.
+
+ @see showCursor
+ */
+ virtual void hideCursor() = 0;
+
+ /** shows the cell cursor
+
+ @see hideCursor
+ */
+ virtual void showCursor() = 0;
+
+ /** dispatches an action to the table control
+
+ @return
+ <TRUE/> if the action could be dispatched successfully, <FALSE/> otherwise. Usual
+ failure conditions include some other instance vetoing the action, or impossibility
+ to execute the action at all (for instance moving up one row when already positioned
+ on the very first row).
+
+ @see TableControlAction
+ */
+ virtual bool dispatchAction( TableControlAction _eAction ) = 0;
+ /** returns selection engine*/
+ virtual SelectionEngine* getSelEngine() = 0;
+ virtual void setCursorAtCurrentCell(const Point& rPoint) = 0;
+ virtual bool isTooltipActive() = 0;
+ virtual rtl::OUString& setTooltip(const Point& rPoint ) = 0;
+ virtual RowPos getCurrentRow(const Point& rPoint ) = 0;
+ virtual void resizeColumn(const Point& rPoint ) = 0;
+ virtual bool startResizeColumn(const Point& rPoint) = 0;
+ virtual bool endResizeColumn(const Point& rPoint) = 0;
+ virtual bool isRowSelected(RowPos _nRow) = 0;
+
+ virtual ~IAbstractTableControl() {};
+ };
+
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_INC_TABLE_ABSTRACTTABLECONTROL_HXX
diff --git a/svtools/inc/svtools/table/defaultinputhandler.hxx b/svtools/inc/svtools/table/defaultinputhandler.hxx
new file mode 100644
index 000000000000..ca760896d539
--- /dev/null
+++ b/svtools/inc/svtools/table/defaultinputhandler.hxx
@@ -0,0 +1,69 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#ifndef SVTOOLS_INC_TABLE_DEFAULTINPUTHANDLER_HXX
+#define SVTOOLS_INC_TABLE_DEFAULTINPUTHANDLER_HXX
+
+#include <svtools/table/tableinputhandler.hxx>
+
+//........................................................................
+namespace svt { namespace table
+{
+//........................................................................
+
+ struct DefaultInputHandler_Impl;
+
+ //====================================================================
+ //= DefaultInputHandler
+ //====================================================================
+ class DefaultInputHandler : public ITableInputHandler
+ {
+ friend class TableDataWindow;
+ private:
+ DefaultInputHandler_Impl* m_pImpl;
+ bool m_bResize;
+
+ public:
+ DefaultInputHandler();
+ ~DefaultInputHandler();
+
+ virtual bool MouseMove ( IAbstractTableControl& _rControl, const MouseEvent& rMEvt );
+ virtual bool MouseButtonDown ( IAbstractTableControl& _rControl, const MouseEvent& rMEvt );
+ virtual bool MouseButtonUp ( IAbstractTableControl& _rControl, const MouseEvent& rMEvt );
+ virtual bool KeyInput ( IAbstractTableControl& _rControl, const KeyEvent& rKEvt );
+ virtual bool GetFocus ( IAbstractTableControl& _rControl );
+ virtual bool LoseFocus ( IAbstractTableControl& _rControl );
+ virtual bool RequestHelp ( IAbstractTableControl& _rControl, const HelpEvent& rHEvt );
+ virtual bool Command ( IAbstractTableControl& _rControl, const CommandEvent& rCEvt );
+ virtual bool PreNotify ( IAbstractTableControl& _rControl, NotifyEvent& rNEvt );
+ virtual bool Notify ( IAbstractTableControl& _rControl, NotifyEvent& rNEvt );
+ };
+
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_INC_TABLE_DEFAULTINPUTHANDLER_HXX
diff --git a/svtools/inc/svtools/table/gridtablerenderer.hxx b/svtools/inc/svtools/table/gridtablerenderer.hxx
new file mode 100644
index 000000000000..e474306c0423
--- /dev/null
+++ b/svtools/inc/svtools/table/gridtablerenderer.hxx
@@ -0,0 +1,108 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#ifndef SVTOOLS_INC_TABLE_GRIDTABLERENDERER_HXX
+#define SVTOOLS_INC_TABLE_GRIDTABLERENDERER_HXX
+
+#include <svtools/table/tablemodel.hxx>
+
+//........................................................................
+namespace svt { namespace table
+{
+//........................................................................
+
+ struct GridTableRenderer_Impl;
+
+ //====================================================================
+ //= GridTableRenderer
+ //====================================================================
+ /** a default implementation for the ->ITableRenderer interface
+
+ This class is able to paint a table grid, table headers, and cell
+ backgrounds according to the selected/active state of cells.
+
+ TODO update the documentation when it's decided whether this renderer
+ also does value handling
+ */
+ class GridTableRenderer : public ITableRenderer
+ {
+ private:
+ GridTableRenderer_Impl* m_pImpl;
+
+ public:
+ /** creates a table renderer associated with the given model
+
+ @param _rModel
+ the model which should be rendered. The caller is responsible
+ for lifetime control, that is, the model instance must live
+ at least as long as the renderer instance lives
+ */
+ GridTableRenderer( ITableModel& _rModel );
+ ~GridTableRenderer();
+
+ /** returns the index of the row currently being painted
+
+ According to the ->ITableRenderer interface, one call is made
+ to the renderer with a row to prepare (->PrepareRow()), and subsequent
+ calls do not carry the row index anymore, but are relative to the
+ row which has previously been prepared.
+
+ This method returns the index of the last row which has been prepared
+ */
+ RowPos getCurrentRow();
+
+ protected:
+ // ITableRenderer overridables
+ virtual void PaintHeaderArea(
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ bool _bIsColHeaderArea, bool _bIsRowHeaderArea,
+ const StyleSettings& _rStyle );
+ virtual void PaintColumnHeader( ColPos _nCol, bool _bActive, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ const StyleSettings& _rStyle );
+ virtual void PrepareRow( RowPos _nRow, bool _bActive, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rRowArea,
+ const StyleSettings& _rStyle );
+ virtual void PaintRowHeader(
+ bool _bActive, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ const StyleSettings& _rStyle, rtl::OUString& _rText );
+ virtual void PaintCellImage( ColPos _nColumn,
+ bool _bActive, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ const StyleSettings& _rStyle, Image* _pCellData );
+ virtual void PaintCellString( ColPos _nColumn,
+ bool _bActive, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ const StyleSettings& _rStyle, rtl::OUString& _rText );
+ virtual void ShowCellCursor( Window& _rView, const Rectangle& _rCursorRect);
+ virtual void HideCellCursor( Window& _rView, const Rectangle& _rCursorRect);
+ };
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_INC_TABLE_GRIDTABLERENDERER_HXX
diff --git a/svtools/inc/svtools/table/tablecontrol.hxx b/svtools/inc/svtools/table/tablecontrol.hxx
new file mode 100644
index 000000000000..f3b7ed88b565
--- /dev/null
+++ b/svtools/inc/svtools/table/tablecontrol.hxx
@@ -0,0 +1,243 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#ifndef SVTOOLS_INC_TABLE_TABLECONTROL_HXX
+#define SVTOOLS_INC_TABLE_TABLECONTROL_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/table/tablemodel.hxx>
+#include <vcl/ctrl.hxx>
+#include <vcl/seleng.hxx>
+#include <svtools/table/tabledatawindow.hxx>
+#include <svtools/accessibletable.hxx>
+#include <com/sun/star/util/Color.hpp>
+#include <svtools/accessiblefactory.hxx>
+//........................................................................
+
+namespace svt { namespace table
+{
+//........................................................................
+
+ class TableControl_Impl;
+ class TableDataWindow;
+ class AccessibleTableControl_Impl;
+
+ //====================================================================
+ //= TableControl
+ //====================================================================
+ /** a basic control which manages table-like data, i.e. a number of cells
+ organized in <code>m</code> rows and <code>n</code> columns.
+
+ The control itself does not do any assumptions about the concrete data
+ it displays, this is encapsulated in an instance supporting the
+ ->ITableModel interface.
+
+ Also, the control does not do any assumptions about how the model's
+ content is rendered. This is the responsibility of a component
+ supporting the ->ITableRenderer interface (the renderer is obtained from
+ the model).
+
+ The control supports the concept of a <em>current</em> (or <em>active</em>
+ cell).
+ The control supports accessibility, this is encapsulated in IAccessibleTable
+
+ // TODO: scrolling?
+ */
+ class SVT_DLLPUBLIC TableControl : public Control, public IAccessibleTable
+ {
+ private:
+ DECL_DLLPRIVATE_LINK( ImplMouseButtonDownHdl, MouseEvent* );
+ DECL_DLLPRIVATE_LINK( ImplMouseButtonUpHdl, MouseEvent* );
+
+ DECL_DLLPRIVATE_LINK( ImplSelectHdl, void* );
+
+ TableControl_Impl* m_pImpl;
+ ::com::sun::star::uno::Sequence< sal_Int32 > m_nCols;
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aText;
+ Link m_aSelectHdl;
+ bool m_bSelectionChanged;
+ bool m_bTooltip;
+ public:
+ ::std::auto_ptr< AccessibleTableControl_Impl > m_pAccessTable;
+
+ TableControl( Window* _pParent, WinBits _nStyle );
+ ~TableControl();
+
+ /// sets a new table model
+ SVT_DLLPRIVATE void SetModel( PTableModel _pModel );
+ /// retrieves the current table model
+ PTableModel GetModel() const;
+
+ /// returns the top row, i.e. the first visible row
+ RowPos GetTopRow() const;
+ /// sets a new top row. The top row is the first visible row in the control
+ void SetTopRow( RowPos _nRow );
+
+ /** retrieves the current row
+
+ The current row is the one which contains the active cell.
+
+ @return
+ the row index of the active cell, or ->ROW_INVALID
+ if there is no active cell, e.g. because the table does
+ not contain any rows or columns.
+ */
+ sal_Int32 GetCurrentRow() const;
+
+ /** returns the row, which contains the input point*/
+
+ ColPos GetCurrentRow (const Point& rPoint);
+
+ /** retrieves the current column
+
+ The current col is the one which contains the active cell.
+
+ @return
+ the column index of the active cell, or ->COL_INVALID
+ if there is no active cell, e.g. because the table does
+ not contain any rows or columns.
+ */
+ sal_Int32 GetCurrentColumn() const;
+
+ /** activates the cell at the given position
+
+ @return
+ <TRUE/> if the move was successful, <FALSE/> otherwise. Usual
+ failure conditions include some other instance vetoing the move,
+ or impossibility to execute the move at all (for instance because
+ of invalid coordinates).
+ */
+ bool GoTo( ColPos _nColumnPos, RowPos _nRow);
+
+ /** moves the active cell to the given column, by keeping the active row
+
+ @return
+ <TRUE/> if the move was successful, <FALSE/> otherwise. Usual
+ failure conditions include some other instance vetoing the move,
+ or impossibility to execute the move at all (for instance because
+ of invalid coordinates).
+ */
+ inline bool GoToColumn( ColPos _nColumn )
+ {
+ return GoTo( _nColumn, GetCurrentRow() );
+ }
+
+ /** moves the active cell to the given row, by keeping the active column
+
+ @return
+ <TRUE/> if the move was successful, <FALSE/> otherwise. Usual
+ failure conditions include some other instance vetoing the move,
+ or impossibility to execute the move at all (for instance because
+ of invalid coordinates).
+ */
+ bool GoToRow( RowPos _nRow )
+ {
+ return GoTo( GetCurrentColumn(), _nRow );
+ }
+ SVT_DLLPRIVATE virtual void Resize();
+ virtual void Select();
+ SVT_DLLPRIVATE void SetSelectHdl( const Link& rLink ) { m_aSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return m_aSelectHdl; }
+
+ /**invalidates the table if table has been changed e.g. new row added
+ */
+ void InvalidateDataWindow(RowPos _nRowStart, RowPos _nRowEnd, bool _bRemoved);
+ /**gets the vector, which contains the selected rows
+ */
+ std::vector<sal_Int32>& GetSelectedRows();
+ /**after removing a row, updates the vector which contains the selected rows
+ if the row, which should be removed, is selected, it will be erased from the vector
+ */
+ SelectionEngine* getSelEngine();
+ TableDataWindow* getDataWindow();
+
+ // Window overridables
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void StateChanged( StateChangedType i_nStateChange );
+
+ /** Creates and returns the accessible object of the whole GridControl. */
+ SVT_DLLPRIVATE virtual XACC CreateAccessible();
+ SVT_DLLPRIVATE virtual XACC CreateAccessibleControl( sal_Int32 _nIndex );
+ SVT_DLLPRIVATE virtual ::rtl::OUString GetAccessibleObjectName(AccessibleTableControlObjType eObjType, sal_Int32 _nRow, sal_Int32 _nCol) const;
+ SVT_DLLPRIVATE virtual sal_Bool GoToCell( sal_Int32 _nColumnPos, sal_Int32 _nRow );
+ SVT_DLLPRIVATE virtual ::rtl::OUString GetAccessibleObjectDescription(AccessibleTableControlObjType eObjType, sal_Int32 _nPosition = -1) const;
+ virtual void FillAccessibleStateSet(
+ ::utl::AccessibleStateSetHelper& rStateSet,
+ AccessibleTableControlObjType eObjType ) const;
+ //// Window
+ virtual Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) const;
+ virtual void GrabFocus();
+ virtual XACC GetAccessible( BOOL bCreate = TRUE );
+ virtual Window* GetAccessibleParentWindow() const;
+ virtual Window* GetWindowInstance();
+ virtual sal_Int32 GetAccessibleControlCount() const;
+ virtual sal_Bool ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint );
+ virtual long GetRowCount() const;
+ virtual long GetColumnCount() const;
+ virtual sal_Bool HasRowHeader() const;
+ virtual sal_Int32 GetSelectedRowCount() const;
+ virtual bool IsRowSelected( long _nRow ) const;
+ virtual sal_Bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint );
+ virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, BOOL _bOnScreen = TRUE );
+ virtual Rectangle calcTableRect( BOOL _bOnScreen = TRUE );
+ virtual Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex);
+ virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint);
+ virtual void FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const;
+ virtual ::rtl::OUString GetRowDescription( sal_Int32 _nRow ) const;
+ virtual ::rtl::OUString GetRowName(sal_Int32 _nIndex) const;
+ virtual ::rtl::OUString GetColumnDescription( sal_uInt16 _nColumnPos ) const;
+ virtual ::rtl::OUString GetColumnName( sal_Int32 _nIndex ) const;
+ virtual ::com::sun::star::uno::Any GetCellContent( sal_Int32 _nRowPos, sal_Int32 _nColPos) const;
+ virtual sal_Bool HasRowHeader();
+ virtual sal_Bool HasColHeader();
+ virtual sal_Bool isAccessibleAlive( ) const;
+ virtual void commitGridControlEvent( sal_Int16 _nEventId, const com::sun::star::uno::Any& _rNewValue, const com::sun::star::uno::Any& _rOldValue );
+ virtual void RemoveSelectedRow(RowPos _nRowPos);
+ virtual ::rtl::OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos) const;
+ ::com::sun::star::uno::Sequence< sal_Int32 >& getColumnsForTooltip();
+ ::com::sun::star::uno::Sequence< ::rtl::OUString >& getTextForTooltip();
+ void setTooltip(const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aText, const ::com::sun::star::uno::Sequence< sal_Int32 >& nCols);
+ void clearSelection();
+ void selectionChanged(bool _bChanged);
+ bool isTooltip();
+
+ protected:
+ /// retrieves the XAccessible implementation associated with the GridControl instance
+ ::svt::IAccessibleFactory& getAccessibleFactory();
+
+ private:
+ TableControl(); // never implemented
+ TableControl( const TableControl& ); // never implemented
+ TableControl& operator=( const TableControl& ); // never implemented
+ };
+
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_INC_TABLE_TABLECONTROL_HXX
diff --git a/svtools/inc/svtools/table/tabledatawindow.hxx b/svtools/inc/svtools/table/tabledatawindow.hxx
new file mode 100644
index 000000000000..9a6ece489119
--- /dev/null
+++ b/svtools/inc/svtools/table/tabledatawindow.hxx
@@ -0,0 +1,87 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#ifndef SVTOOLS_SOURCE_TABLE_TABLEDATAWINDOW_HXX
+#define SVTOOLS_SOURCE_TABLE_TABLEDATAWINDOW_HXX
+
+#ifndef _SV_WINDOW_HXX
+#include <vcl/window.hxx>
+#endif
+#include <vcl/seleng.hxx>
+
+//........................................................................
+namespace svt { namespace table
+{
+//........................................................................
+
+ class TableControl_Impl;
+ class TableFunctionSet;
+
+
+ //====================================================================
+ //= TableDataWindow
+ //====================================================================
+ /** the window containing the content area (including headers) of
+ a table control
+ */
+ class TableDataWindow : public Window
+ {
+ friend class TableFunctionSet;
+ private:
+ TableControl_Impl& m_rTableControl;
+ Link m_aMouseButtonDownHdl;
+ Link m_aMouseButtonUpHdl;
+ Link m_aSelectHdl;
+ RowPos m_nRowAlreadySelected;
+ public:
+ TableDataWindow( TableControl_Impl& _rTableControl );
+ inline void SetMouseButtonDownHdl( const Link& rLink ) { m_aMouseButtonDownHdl = rLink; }
+ inline const Link& GetMouseButtonDownHdl() const { return m_aMouseButtonDownHdl; }
+ inline void SetMouseButtonUpHdl( const Link& rLink ) { m_aMouseButtonUpHdl = rLink; }
+ inline const Link& GetMouseButtonUpHdl() const { return m_aMouseButtonUpHdl; }
+ inline void SetSelectHdl( const Link& rLink ) { m_aSelectHdl = rLink; }
+ inline const Link& GetSelectHdl() const { return m_aSelectHdl; }
+
+ // Window overridables
+ virtual void Paint( const Rectangle& rRect );
+ virtual void MouseMove( const MouseEvent& rMEvt);
+ virtual void MouseButtonDown( const MouseEvent& rMEvt);
+ virtual void MouseButtonUp( const MouseEvent& rMEvt);
+ virtual void SetPointer( const Pointer& rPointer );
+ virtual void CaptureMouse();
+ virtual void ReleaseMouse();
+ virtual long Notify(NotifyEvent& rNEvt);
+ virtual void SetControlBackground(const Color& rColor);
+ virtual void SetControlBackground();
+
+ void SetBackground(const Wallpaper& rColor);
+ void SetBackground();
+ };
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_SOURCE_TABLE_TABLEDATAWINDOW_HXX
diff --git a/svtools/inc/svtools/table/tableinputhandler.hxx b/svtools/inc/svtools/table/tableinputhandler.hxx
new file mode 100644
index 000000000000..6d6af9f641bb
--- /dev/null
+++ b/svtools/inc/svtools/table/tableinputhandler.hxx
@@ -0,0 +1,78 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#ifndef SVTOOLS_INC_TABLE_TABLEINPUTHANDLER_HXX
+#define SVTOOLS_INC_TABLE_TABLEINPUTHANDLER_HXX
+
+#include <boost/shared_ptr.hpp>
+
+class MouseEvent;
+class KeyEvent;
+class HelpEvent;
+class CommandEvent;
+class NotifyEvent;
+
+//........................................................................
+namespace svt { namespace table
+{
+//........................................................................
+
+ class IAbstractTableControl;
+
+ //====================================================================
+ //= ITableInputHandler
+ //====================================================================
+ /** interface for components handling input in a ->TableControl
+ */
+ class ITableInputHandler
+ {
+ public:
+ // all those methods have the same semantics as the equal-named methods of ->Window,
+ // with the additional option to return a boolean value indicating whether
+ // the event should be further processed by the ->Window implementations (<FALSE/>),
+ // or whether it has been sufficiently handled by the ->ITableInputHandler instance
+ // (<FALSE/>).
+
+ virtual bool MouseMove ( IAbstractTableControl& _rControl, const MouseEvent& rMEvt ) = 0;
+ virtual bool MouseButtonDown ( IAbstractTableControl& _rControl, const MouseEvent& rMEvt ) = 0;
+ virtual bool MouseButtonUp ( IAbstractTableControl& _rControl, const MouseEvent& rMEvt ) = 0;
+ virtual bool KeyInput ( IAbstractTableControl& _rControl, const KeyEvent& rKEvt ) = 0;
+ virtual bool GetFocus ( IAbstractTableControl& _rControl ) = 0;
+ virtual bool LoseFocus ( IAbstractTableControl& _rControl ) = 0;
+ virtual bool RequestHelp ( IAbstractTableControl& _rControl, const HelpEvent& rHEvt ) = 0;
+ virtual bool Command ( IAbstractTableControl& _rControl, const CommandEvent& rCEvt ) = 0;
+ virtual bool PreNotify ( IAbstractTableControl& _rControl, NotifyEvent& rNEvt ) = 0;
+ virtual bool Notify ( IAbstractTableControl& _rControl, NotifyEvent& rNEvt ) = 0;
+
+ virtual ~ITableInputHandler() { }
+ };
+ typedef ::boost::shared_ptr< ITableInputHandler > PTableInputHandler;
+
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_INC_TABLE_TABLEINPUTHANDLER_HXX
diff --git a/svtools/inc/svtools/table/tablemodel.hxx b/svtools/inc/svtools/table/tablemodel.hxx
new file mode 100644
index 000000000000..3da396d9d86c
--- /dev/null
+++ b/svtools/inc/svtools/table/tablemodel.hxx
@@ -0,0 +1,483 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#ifndef SVTOOLS_INC_TABLE_TABLEMODEL_HXX
+#define SVTOOLS_INC_TABLE_TABLEMODEL_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/table/tabletypes.hxx>
+#include <svtools/table/tablerenderer.hxx>
+#include <svtools/table/tableinputhandler.hxx>
+#include <rtl/ref.hxx>
+#include <sal/types.h>
+#include <com/sun/star/util/Color.hpp>
+#include <boost/shared_ptr.hpp>
+#include <com/sun/star/style/VerticalAlignment.hpp>
+#include <com/sun/star/style/HorizontalAlignment.hpp>
+
+//........................................................................
+namespace svt { namespace table
+{
+//........................................................................
+
+
+ //====================================================================
+ //= cell data
+ //====================================================================
+ struct TableContentType
+ {
+ ::rtl::OUString sContent;
+ Image* pImage;
+ TableContentType() :
+ sContent(),
+ pImage( )
+ {
+ }
+ };
+ //====================================================================
+ //= ScrollbarVisibility
+ //====================================================================
+ enum ScrollbarVisibility
+ {
+ /** enumeration value denoting that a scrollbar should never be visible, even
+ if needed normally
+ */
+ ScrollbarShowNever,
+ /** enumeration value denoting that a scrollbar should be visible when needed only
+ */
+ ScrollbarShowSmart,
+ /** enumeration value denoting that a scrollbar should always be visible, even
+ if not needed normally
+ */
+ ScrollbarShowAlways
+ };
+
+ //====================================================================
+ //= ITableModelListener
+ //====================================================================
+ /** declares an interface to be implemented by components interested in
+ changes in an ->ITableModel
+ */
+ class SAL_NO_VTABLE ITableModelListener
+ {
+ public:
+ //virtual void onTableModelChanged(PTableModel pTableModel) = 0;
+ /** notifies the listener that one or more rows have been inserted into
+ the table
+
+ @param first
+ the index of the first newly inserted row
+ @param last
+ the index of the last newly inserted row. Must not be smaller
+ than ->first
+ */
+ virtual void rowsInserted( RowPos first, RowPos last ) = 0;
+
+ /** notifies the listener that one or more rows have been removed from
+ the table
+
+ @param first
+ the old index of the first removed row
+ @param last
+ the old index of the last removed row. Must not be smaller
+ than ->first
+ */
+ virtual void rowsRemoved( RowPos first, RowPos last ) = 0;
+
+ /** notifies the listener that one or more columns have been inserted into
+ the table
+
+ @param first
+ the index of the first newly inserted row
+ @param last
+ the index of the last newly inserted row. Must not be smaller
+ than ->first
+ */
+ virtual void columnsInserted( ColPos first, ColPos last ) = 0;
+
+ /** notifies the listener that one or more columns have been removed from
+ the table
+
+ @param first
+ the old index of the first removed row
+ @param last
+ the old index of the last removed row. Must not be smaller
+ than ->first
+ */
+ virtual void columnsRemoved( ColPos first, ColPos last ) = 0;
+
+ /** notifies the listener that a column in the table has moved
+
+ @param oldIndex
+ the old index of the column within the model
+ @param newIndex
+ the new index of the column within the model
+ */
+ virtual void columnMoved( ColPos oldIndex, ColPos newIndex ) = 0;
+
+ /** notifies the listener that a rectangular cell range in the table
+ has been updated
+
+ Listeners are required to discard any possibly cached information
+ they have about the cells in question, in particular any possibly
+ cached cell values.
+ */
+ virtual void cellsUpdated( ColPos firstCol, ColPos lastCol, RowPos firstRow, RowPos lastRow ) = 0;
+
+ /// deletes the listener instance
+ virtual ~ITableModelListener(){};
+ };
+ typedef ::boost::shared_ptr< ITableModelListener > PTableModelListener;
+
+ //====================================================================
+ //= IColumnModel
+ //====================================================================
+ /** interface to be implemented by table column models
+ */
+ class SAL_NO_VTABLE IColumnModel
+ {
+ public:
+ /** retrieves the ID of the column
+
+ The semantics of a column id is not defined. It's up to the
+ implementor of the ->IColumnModel, respectively the ->ITableModel
+ which provides the column models, to define such a semantics.
+
+ @return
+ the ID of the column. May be 0 if the table which the column
+ belongs to does not need and support column ids.
+
+ @see setID
+ */
+ virtual ColumnID getID() const = 0;
+
+ /** sets a new column ID
+
+ @return
+ <TRUE/> if setting the new ID was successfull. A possible error
+ conditions is if you try to set an ID which is already used
+ by another column within the same table.
+
+ @see getID
+ */
+ virtual bool setID( const ColumnID _nID ) = 0;
+
+ /** returns the name of the column
+
+ Column names should be human-readable, but not necessarily unique
+ within a given table.
+
+ @see setName
+ */
+ virtual String getName() const = 0;
+
+ /** sets a new name for the column
+
+ @see getName
+ */
+ virtual void setName( const String& _rName ) = 0;
+
+ /** determines whether the column can be resized
+
+ @see getMinWidth
+ @see getMaxWidth
+ @see getWidth
+ */
+ virtual bool isResizable() const = 0;
+
+ /** declares the column as resizable or fixed in width
+
+ @see getMinWidth
+ @see getMaxWidth
+ @see getWidth
+ */
+ virtual void setResizable( bool _bResizable ) = 0;
+
+ /** returns the width of the column, in 1/100 millimeters
+
+ The returned value must be a positive ->TableMetrics value.
+
+ It can also be COLWIDTH_FIT_TO_VIEW, to indicate that the width of the column
+ should automatically be adjusted to completely fit the view. For instance, a
+ model's last column could return this value, to indicate that it is to occupy
+ all horizontal space remaining in the view, after all other columns have been
+ layouted.
+
+ If there is more than one column with width COLWIDTH_FIT_TO_VIEW in a model,
+ they're all layouted equal-width.
+
+ If the columns with a read width (i.e. other than COLWIDTH_FIT_TO_VIEW) are,
+ in sum, wider than the view, then the view is free to choose a real width for any
+ columns which return COLWIDTH_FIT_TO_VIEW here.
+
+ @see setWidth
+ @see getMinWidth
+ @see getMaxWidth
+ @see COLWIDTH_FIT_TO_VIEW
+ */
+ virtual TableMetrics getWidth() const = 0;
+
+ /** sets a new width for the column
+
+ @param _nWidth
+ the new width, in 1/100 millimeters
+
+ @see getWidth
+ */
+ virtual void setWidth( TableMetrics _nWidth ) = 0;
+
+ /** returns the minimum width of the column, in 1/100 millimeters, or 0 if the column
+ does not have a minimal width
+
+ @see setMinWidth
+ @see getMaxWidth
+ @see getWidth
+ */
+ virtual TableMetrics getMinWidth() const = 0;
+
+ /** sets the minimum width of the column, in 1/100 millimeters
+
+ @see getMinWidth
+ @see setMaxWidth
+ @see setWidth
+ */
+ virtual void setMinWidth( TableMetrics _nMinWidth ) = 0;
+
+ /** returns the maximum width of the column, in 1/100 millimeters, or 0 if the column
+ does not have a minimal width
+
+ @see setMaxWidth
+ @see getMinWidth
+ @see getWidth
+ */
+ virtual TableMetrics getMaxWidth() const = 0;
+
+ /** sets the maximum width of the column, in 1/100 millimeters
+
+ @see getMaxWidth
+ @see setMinWidth
+ @see setWidth
+ */
+ virtual void setMaxWidth( TableMetrics _nMaxWidth ) = 0;
+
+ /** returns the preferred width of the column, or 0 if the column
+ does not have a preferred width.
+
+ @see setMaxWidth
+ @see getMinWidth
+ @see getWidth
+ */
+ virtual TableMetrics getPreferredWidth() const = 0;
+ /** sets the preferred width of the column, to be used when user resizes column
+
+ @see getMaxWidth
+ @see setMinWidth
+ @see setWidth
+ */
+ virtual void setPreferredWidth( TableMetrics _nPrefWidth ) = 0;
+
+ virtual ::com::sun::star::style::HorizontalAlignment getHorizontalAlign() = 0;
+ virtual void setHorizontalAlign(::com::sun::star::style::HorizontalAlignment _xAlign) = 0;
+ /// deletes the column model instance
+ virtual ~IColumnModel() { }
+ };
+ typedef ::boost::shared_ptr< IColumnModel > PColumnModel;
+
+ //====================================================================
+ //= ITableModel
+ //====================================================================
+ /** declares the interface to implement by an abtract table model
+ */
+ class SAL_NO_VTABLE SVT_DLLPUBLIC ITableModel
+ {
+ public:
+ /** returns the number of columns in the table
+ */
+ virtual TableSize getColumnCount() const = 0;
+
+ /** returns the number of rows in the table
+ */
+ virtual TableSize getRowCount() const = 0;
+
+ SVT_DLLPRIVATE virtual void setColumnCount(TableSize _nColCount) = 0;
+ SVT_DLLPRIVATE virtual void setRowCount(TableSize _nRowCount) = 0;
+
+ /** determines whether the table has column headers
+
+ If this method returns <TRUE/>, the renderer returned by
+ ->getRenderer must be able to render column headers.
+
+ @see IColumnRenderer
+ */
+ virtual bool hasColumnHeaders() const = 0;
+ /** sets whether the table should have row headers
+ @see IColumnRenderer
+ */
+ SVT_DLLPRIVATE virtual void setRowHeaders( bool rowHeaders) = 0;
+
+ /** sets whether the table should have column headers
+ @see IColumnRenderer
+ */
+ SVT_DLLPRIVATE virtual void setColumnHeaders( bool columnHeaders) = 0;
+
+ /** determines whether the table has row headers
+
+ If this method returns <TRUE/>, the renderer returned by
+ ->getRenderer must be able to render row headers.
+
+ @see IColumnRenderer
+ */
+ virtual bool hasRowHeaders() const = 0;
+
+ /** determines whether the given cell is editable
+
+ @see ICellEditor
+ @todo
+ */
+ virtual bool isCellEditable( ColPos col, RowPos row ) const = 0;
+
+ /** adds the given listener to the list of ->ITableModelListener's
+ */
+ SVT_DLLPRIVATE virtual void addTableModelListener( const PTableModelListener& listener ) = 0;
+
+ /** revokes the given listener from the list of ->ITableModelListener's
+ */
+ SVT_DLLPRIVATE virtual void removeTableModelListener( const PTableModelListener& listener ) = 0;
+
+ /** returns a model for a certain column
+
+ @param column
+ the index of the column in question. Must be greater than or
+ equal 0, and smaller than the return value of ->getColumnCount()
+
+ @return
+ the model of the column in question. Must not be <NULL/>
+
+ @see getColumnModelByID
+ */
+ virtual PColumnModel getColumnModel( ColPos column ) = 0;
+
+ /** finds a column model by ID
+
+ @param id
+ the id of the column which is to be looked up
+ @return
+ the column model with the given ID, or <NULL/> if there is
+ no such column
+ */
+ virtual PColumnModel getColumnModelByID( ColumnID id ) = 0;
+
+ /** returns a renderer which is able to paint the table represented
+ by this table model
+
+ @return the renderer to use. Must not be <NULL/>
+ */
+ SVT_DLLPRIVATE virtual PTableRenderer getRenderer() const = 0;
+
+ /** returns the component handling input in a view associated with the model
+ */
+ virtual PTableInputHandler getInputHandler() const = 0;
+
+ /** determines the height of rows in the table.
+
+ @return
+ the logical height of rows in the table, in 1/100 millimeters. The height must be
+ greater 0.
+ */
+ SVT_DLLPRIVATE virtual TableMetrics getRowHeight() const = 0;
+
+ SVT_DLLPRIVATE virtual void setRowHeight(TableMetrics _nRowHeight) = 0;
+
+ /** determines the height of the column header row
+
+ This method is not to be called if ->hasColumnHeaders()
+ returned <FALSE/>.
+
+ @return
+ the logical height of the column header row, in 1/100 millimeters.
+ Must be greater than 0.
+ */
+ SVT_DLLPRIVATE virtual TableMetrics getColumnHeaderHeight() const = 0;
+
+ /** determines the width of the row header column
+
+ This method is not to be called if ->hasRowHeaders()
+ returned <FALSE/>.
+
+ @return
+ the logical width of the row header column, in 1/100 millimeters.
+ Must be greater than 0.
+ */
+ SVT_DLLPRIVATE virtual TableMetrics getRowHeaderWidth() const = 0;
+
+ /** determines the visibility of the vertical scrollbar of the table control
+ @param overAllHeight the height of the table with all rows
+ @param actHeight the given height of the table
+ */
+ virtual ScrollbarVisibility getVerticalScrollbarVisibility(int overAllHeight,int actHeight) const = 0;
+
+ /** determines the visibility of the horizontal scrollbar of the table control
+ @param overAllWidth the width of the table with all columns
+ @param actWidth the given width of the table
+ */
+ virtual ScrollbarVisibility getHorizontalScrollbarVisibility(int overAllWidth, int actWidth) const = 0;
+ virtual bool hasVerticalScrollbar() =0;
+ virtual bool hasHorizontalScrollbar() = 0;
+ /** fills cells with content
+ */
+ virtual void setCellContent(const std::vector< std::vector< ::com::sun::star::uno::Any > >& cellContent)=0;
+ /** gets the content of the cells
+ */
+ virtual std::vector< std::vector< ::com::sun::star::uno::Any > >& getCellContent() = 0;
+ /**sets title of header rows
+ */
+ SVT_DLLPRIVATE virtual void setRowHeaderName(const std::vector<rtl::OUString>& cellColumnContent)=0;
+ /** gets title of header rows
+ */
+ virtual std::vector<rtl::OUString>& getRowHeaderName() = 0;
+ SVT_DLLPRIVATE virtual ::com::sun::star::util::Color getLineColor() = 0;
+ SVT_DLLPRIVATE virtual void setLineColor(::com::sun::star::util::Color _rColor) = 0;
+ SVT_DLLPRIVATE virtual ::com::sun::star::util::Color getHeaderBackgroundColor() = 0;
+ SVT_DLLPRIVATE virtual void setHeaderBackgroundColor(::com::sun::star::util::Color _rColor) = 0;
+ SVT_DLLPRIVATE virtual ::com::sun::star::util::Color getTextColor() = 0;
+ SVT_DLLPRIVATE virtual void setTextColor(::com::sun::star::util::Color _rColor) = 0;
+ SVT_DLLPRIVATE virtual ::com::sun::star::util::Color getOddRowBackgroundColor() = 0;
+ SVT_DLLPRIVATE virtual void setOddRowBackgroundColor(::com::sun::star::util::Color _rColor) = 0;
+ SVT_DLLPRIVATE virtual ::com::sun::star::util::Color getEvenRowBackgroundColor() = 0;
+ SVT_DLLPRIVATE virtual void setEvenRowBackgroundColor(::com::sun::star::util::Color _rColor) = 0;
+ SVT_DLLPRIVATE virtual ::com::sun::star::style::VerticalAlignment getVerticalAlign() = 0;
+ SVT_DLLPRIVATE virtual void setVerticalAlign(::com::sun::star::style::VerticalAlignment _xAlign) = 0;
+
+ /// destroys the table model instance
+ virtual ~ITableModel() { }
+ };
+ typedef ::boost::shared_ptr< ITableModel > PTableModel;
+
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_INC_TABLE_TABLEMODEL_HXX
diff --git a/svtools/inc/svtools/table/tablerenderer.hxx b/svtools/inc/svtools/table/tablerenderer.hxx
new file mode 100644
index 000000000000..f81771dd22e6
--- /dev/null
+++ b/svtools/inc/svtools/table/tablerenderer.hxx
@@ -0,0 +1,274 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#ifndef SVTOOLS_INC_TABLE_TABLERENDERER_HXX
+#define SVTOOLS_INC_TABLE_TABLERENDERER_HXX
+
+#include <svtools/table/tabletypes.hxx>
+
+#include <vcl/outdev.hxx>
+
+#include <boost/shared_ptr.hpp>
+
+//........................................................................
+namespace svt { namespace table
+{
+//........................................................................
+
+ //====================================================================
+ //= ITableRenderer
+ //====================================================================
+ /** interface to implement by components rendering a ->TableControl
+ */
+ class SAL_NO_VTABLE ITableRenderer
+ {
+ public:
+ /** paints a (part of) header area
+
+ There are two header areas in a table control:
+ <ul><li>The row containing all column headers, i.e. <em>above</em> all rows containing the data</li>
+ <li>The column containing all row headers. i.e. <em>left of</em> all columns containing the data</li>
+ </ul>
+
+ A header area is more than the union of the single column/row headers.
+
+ First, there might be less columns than fit into the view - in this case, right
+ beside the right-most column, there's still room which belongs to the column header
+ area, but is not occupied by any particular column header.<br/>
+ An equivalent statement holds for the row header area, if there are less rows than
+ fit into the view.
+
+ Second, if the table control has both a row header and a column header,
+ the intersection between those both belongs to both the column header area and the
+ row header area, but not to any particular column or row header.
+
+ There are two flags specifying whether the to-be-painted area is part of the column
+ and/or row header area.
+ <ul><li>If both are <TRUE/>, the intersection of both areas is to be painted.</li>
+ <li>If ->_bIsColHeaderArea is <TRUE/> and ->_bIsRowHeaderArea is <FALSE/>,
+ then ->_rArea denotes the column header area <em>excluding</em> the
+ intersection between row and column header area.</li>
+ <li>Equivalently for ->_bIsColHeaderArea being <FALSE/> and ->_bIsRowHeaderArea
+ being <TRUE/></li>
+ </ul>
+ Note that it's not possible for both ->_bIsColHeaderArea and ->_bIsRowHeaderArea
+ to be <FALSE/> at the same time.
+
+ @param _rDevice
+ the device to paint onto
+ @param _rArea
+ the area to paint into
+ @param _bIsColHeaderArea
+ <TRUE/> if and only if ->_rArea is part of the column header area.
+ @param _bIsRowHeaderArea
+ <TRUE/> if and only if ->_rArea is part of the row header area.
+ @param _rStyle
+ the style to be used for drawing
+ */
+ virtual void PaintHeaderArea(
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ bool _bIsColHeaderArea, bool _bIsRowHeaderArea,
+ const StyleSettings& _rStyle ) = 0;
+
+ /** paints the header for a given column
+
+ @param _nCol
+ the index of the column to paint
+ @param _bActive
+ <TRUE/> if and only if the column whose column is to be painted
+ contains the active cell.
+ @param _bSelected
+ <TRUE/> if and only if the column whose column is to be painted
+ is selected currently.
+ @param _rDevice
+ denotes the device to paint onto
+ @param _rArea
+ the are into which the column header should be painted
+ @param _rStyle
+ the style to be used for drawing
+ */
+ virtual void PaintColumnHeader( ColPos _nCol, bool _bActive, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ const StyleSettings& _rStyle ) = 0;
+
+ /** prepares a row for painting
+
+ Painting a table means painting rows as necessary, in an increasing
+ order. The assumption is that retrieving data for two different rows
+ is (potentially) more expensive than retrieving data for two different
+ columns. Thus, the renderer will get the chance to "seek" to a certain
+ row, and then has to render all cells in this row, before another
+ row is going to be painted.
+
+ @param _nRow
+ the row which is going to be painted. The renderer should
+ at least remember this row, since subsequent calls to
+ ->PaintRowHeader(), ->PaintCell(), and ->FinishRow() will
+ not pass this parameter again.
+
+ However, the renderer is also allowed to render any
+ cell-independent content of this row.
+
+ @param _bActive
+ <TRUE/> if and only if the row to be painted contains the
+ currently active cell.
+ @param _bSelected
+ <TRUE/> if and only if the row to be prepared is
+ selected currently.
+ @param _rDevice
+ denotes the device to paint onto
+ @param _rRowArea
+ the are into which the row should be painted. This excludes
+ the row header area, if applicable.
+ @param _rStyle
+ the style to be used for drawing
+ */
+ virtual void PrepareRow( RowPos _nRow, bool _bActive, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rRowArea,
+ const StyleSettings& _rStyle ) = 0;
+
+ /** paints the header of a row
+
+ The row to be painted is denoted by the most recent call to
+ ->PrepareRow.
+
+ @param _bActive
+ <TRUE/> if and only if the row to be painted contains the
+ currently active cell.
+ <br/>
+ Note that this flag is equal to the respective flag in the
+ previous ->PrepareRow call, it's passed here for convinience
+ only.
+ @param _bSelected
+ <TRUE/> if and only if the row whose header cell is to be
+ painted is selected currently.
+ <br/>
+ Note that this flag is equal to the respective flag in the
+ previous ->PrepareRow call, it's passed here for convinience
+ only.
+ @param _rDevice
+ denotes the device to paint onto
+ @param _rArea
+ the are into which the row header should be painted
+ @param _rStyle
+ the style to be used for drawing
+ @param _rText
+ the title of the header row
+ */
+ virtual void PaintRowHeader( bool _bActive, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ const StyleSettings& _rStyle, rtl::OUString& _rText ) = 0;
+
+ /** paints a certain cell
+
+ The row to be painted is denoted by the most recent call to
+ ->PrepareRow.
+
+ @param _bSelected
+ <TRUE/> if and only if the cell to be painted is
+ selected currently. This is the case if either
+ the row or the column of the cell is currently selected.
+ <br/>
+ Note that this flag is equal to the respective flag in the
+ previous ->PrepareRow call, it's passed here for convinience
+ only.
+ @param _bActive
+ <TRUE/> if the cell is currently active.
+ <br/>
+ Note that this flag is equal to the respective flag in the
+ previous ->PrepareRow call, it's passed here for convinience
+ only.
+ @param _rDevice
+ denotes the device to paint onto
+ @param _rArea
+ the are into which the cell should be painted
+ @param _rStyle
+ the style to be used for drawing
+ @param _pCellData
+ the content of the cell
+ */
+ virtual void PaintCellImage( ColPos _nColumn,
+ bool _bActive, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ const StyleSettings& _rStyle, Image* _pCellData ) = 0;
+
+ /** paints a certain cell
+
+ The row to be painted is denoted by the most recent call to
+ ->PrepareRow.
+
+ @param _bSelected
+ <TRUE/> if and only if the cell to be painted is
+ selected currently. This is the case if either
+ the row or the column of the cell is currently selected.
+ <br/>
+ Note that this flag is equal to the respective flag in the
+ previous ->PrepareRow call, it's passed here for convinience
+ only.
+ @param _bActive
+ <TRUE/> if the cell is currently active.
+ <br/>
+ Note that this flag is equal to the respective flag in the
+ previous ->PrepareRow call, it's passed here for convinience
+ only.
+ @param _rDevice
+ denotes the device to paint onto
+ @param _rArea
+ the are into which the cell should be painted
+ @param _rStyle
+ the style to be used for drawing
+ @param _rText
+ the content of the cell
+ */
+ virtual void PaintCellString( ColPos _nColumn,
+ bool _bActive, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ const StyleSettings& _rStyle, rtl::OUString& _rText ) = 0;
+
+ /** draws a cell cursor in the given rectangle
+
+ The cell cursor is used to indicate the active/current cell
+ of a table control.
+ */
+ virtual void ShowCellCursor( Window& _rView, const Rectangle& _rCursorRect) = 0;
+
+ /** hides the cell cursor previously drawn into the given rectangle
+
+ The cell cursor is used to indicate the active/current cell
+ of a table control.
+ */
+ virtual void HideCellCursor( Window& _rView, const Rectangle& _rCursorRect) = 0;
+
+ /// deletes the renderer instance
+ virtual ~ITableRenderer() { }
+ };
+ typedef ::boost::shared_ptr< ITableRenderer > PTableRenderer;
+
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_INC_TABLE_TABLERENDERER_HXX
diff --git a/svtools/inc/svtools/table/tabletypes.hxx b/svtools/inc/svtools/table/tabletypes.hxx
new file mode 100644
index 000000000000..645120e30d4b
--- /dev/null
+++ b/svtools/inc/svtools/table/tabletypes.hxx
@@ -0,0 +1,76 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#ifndef SVTOOLS_INC_TABLE_TABLETYPES_HXX
+#define SVTOOLS_INC_TABLE_TABLETYPES_HXX
+
+#include <sal/types.h>
+
+//........................................................................
+namespace svt { namespace table
+{
+//........................................................................
+ /// a value denoting the size of a table
+ typedef sal_Int32 TableSize;
+
+ /// a value denoting a column position within a table
+ typedef sal_Int32 ColPos;
+ /// a value denoting a row position within a table
+ typedef sal_Int32 RowPos;
+
+ /** a value denoting an arbitrary coordinate value of a position within
+ a table
+
+ Values of this type are guaranteed to be large enough to hold column
+ positions as well as row positions.
+ */
+ typedef sal_Int32 AnyPos;
+
+ /// the ID of a column in a table
+ typedef sal_Int32 ColumnID;
+
+ typedef sal_Int32 TableMetrics;
+/** special column width value which indicates that the column should be
+ automatically resized to fit the view
+*/
+#define COLWIDTH_FIT_TO_VIEW ((::svt::table::TableMetrics)-1)
+
+/// denotes the column containing the row headers
+#define COL_ROW_HEADERS ((::svt::table::ColPos)-1)
+/// denotes the row containing the column headers
+#define ROW_COL_HEADERS ((::svt::table::RowPos)-1)
+
+/// denotes an invalid column index
+#define COL_INVALID ((::svt::table::ColPos)-2)
+/// denotes an invalid row index
+#define ROW_INVALID ((::svt::table::RowPos)-2)
+
+
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_INC_TABLE_TABLETYPES_HXX
diff --git a/svtools/inc/svtools/textdata.hxx b/svtools/inc/svtools/textdata.hxx
new file mode 100644
index 000000000000..809d64248eb6
--- /dev/null
+++ b/svtools/inc/svtools/textdata.hxx
@@ -0,0 +1,205 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _TEXTDATA_HXX
+#define _TEXTDATA_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svl/brdcst.hxx>
+#include <svl/smplhint.hxx>
+#include <tools/string.hxx>
+
+#define TEXTUNDO_START 100
+#define TEXTUNDO_REMOVECHARS 100
+#define TEXTUNDO_CONNECTPARAS 101
+#define TEXTUNDO_SPLITPARA 102
+#define TEXTUNDO_INSERTCHARS 103
+#define TEXTUNDO_DELCONTENT 104
+#define TEXTUNDO_DELETE 105
+#define TEXTUNDO_CUT 106
+#define TEXTUNDO_PASTE 107
+#define TEXTUNDO_INSERT 108
+#define TEXTUNDO_ATTRIBS 109
+#define TEXTUNDO_DRAGANDDROP 110
+#define TEXTUNDO_READ 111
+#define TEXTUNDO_END 149
+
+#define XTEXTUNDO_START 150
+#define XTEXTUNDO_END 199
+
+#define TEXTUNDO_USER 200
+
+// Fuer Notify, wenn alle Absaetze geloescht wurden...
+#define TEXT_PARA_ALL 0xFFFFFFFF
+
+class TextPaM
+{
+private:
+ ULONG mnPara;
+ USHORT mnIndex;
+
+public:
+ TextPaM() { mnPara = 0, mnIndex = 0; }
+ TextPaM( ULONG nPara, USHORT nIndex ) { mnPara = nPara, mnIndex = nIndex; }
+
+ ULONG GetPara() const { return mnPara; }
+ ULONG& GetPara() { return mnPara; }
+
+ USHORT GetIndex() const { return mnIndex; }
+ USHORT& GetIndex() { return mnIndex; }
+
+ inline BOOL operator == ( const TextPaM& rPaM ) const;
+ inline BOOL operator != ( const TextPaM& rPaM ) const;
+ inline BOOL operator < ( const TextPaM& rPaM ) const;
+ inline BOOL operator > ( const TextPaM& rPaM ) const;
+};
+
+inline BOOL TextPaM::operator == ( const TextPaM& rPaM ) const
+{
+ return ( ( mnPara == rPaM.mnPara ) && ( mnIndex == rPaM.mnIndex ) ) ? TRUE : FALSE;
+}
+
+inline BOOL TextPaM::operator != ( const TextPaM& rPaM ) const
+{
+ return !( *this == rPaM );
+}
+
+inline BOOL TextPaM::operator < ( const TextPaM& rPaM ) const
+{
+ return ( ( mnPara < rPaM.mnPara ) ||
+ ( ( mnPara == rPaM.mnPara ) && mnIndex < rPaM.mnIndex ) ) ? TRUE : FALSE;
+}
+
+inline BOOL TextPaM::operator > ( const TextPaM& rPaM ) const
+{
+ return ( ( mnPara > rPaM.mnPara ) ||
+ ( ( mnPara == rPaM.mnPara ) && mnIndex > rPaM.mnIndex ) ) ? TRUE : FALSE;
+}
+
+class SVT_DLLPUBLIC TextSelection
+{
+private:
+ TextPaM maStartPaM;
+ TextPaM maEndPaM;
+
+public:
+ TextSelection();
+ TextSelection( const TextPaM& rPaM );
+ TextSelection( const TextPaM& rStart, const TextPaM& rEnd );
+
+ const TextPaM& GetStart() const { return maStartPaM; }
+ TextPaM& GetStart() { return maStartPaM; }
+
+ const TextPaM& GetEnd() const { return maEndPaM; }
+ TextPaM& GetEnd() { return maEndPaM; }
+
+ void Justify();
+
+ BOOL HasRange() const { return maStartPaM != maEndPaM; }
+
+ inline BOOL operator == ( const TextSelection& rSel ) const;
+ inline BOOL operator != ( const TextSelection& rSel ) const;
+};
+
+inline BOOL TextSelection::operator == ( const TextSelection& rSel ) const
+{
+ return ( ( maStartPaM == rSel.maStartPaM ) && ( maEndPaM == rSel.maEndPaM ) );
+}
+
+inline BOOL TextSelection::operator != ( const TextSelection& rSel ) const
+{
+ return !( *this == rSel );
+}
+
+#define TEXT_HINT_PARAINSERTED 1
+#define TEXT_HINT_PARAREMOVED 2
+#define TEXT_HINT_PARACONTENTCHANGED 3
+#define TEXT_HINT_TEXTHEIGHTCHANGED 4
+#define TEXT_HINT_FORMATPARA 5
+#define TEXT_HINT_TEXTFORMATTED 6
+#define TEXT_HINT_MODIFIED 7
+#define TEXT_HINT_BLOCKNOTIFICATION_START 8
+#define TEXT_HINT_BLOCKNOTIFICATION_END 9
+#define TEXT_HINT_INPUT_START 10
+#define TEXT_HINT_INPUT_END 11
+
+#define TEXT_HINT_VIEWSCROLLED 100
+#define TEXT_HINT_VIEWSELECTIONCHANGED 101
+
+class SVT_DLLPUBLIC TextHint : public SfxSimpleHint
+{
+private:
+ ULONG mnValue;
+
+public:
+ TYPEINFO();
+ TextHint( ULONG nId );
+ TextHint( ULONG nId, ULONG nValue );
+
+ ULONG GetValue() const { return mnValue; }
+ void SetValue( ULONG n ) { mnValue = n; }
+};
+
+struct TEIMEInfos
+{
+ String aOldTextAfterStartPos;
+ USHORT* pAttribs;
+ TextPaM aPos;
+ USHORT nLen;
+ BOOL bCursor;
+ BOOL bWasCursorOverwrite;
+
+ TEIMEInfos( const TextPaM& rPos, const String& rOldTextAfterStartPos );
+ ~TEIMEInfos();
+
+ void CopyAttribs( const USHORT* pA, USHORT nL );
+ void DestroyAttribs();
+};
+
+// ----------------- Wrapper for old Tools List -------------------
+
+#ifndef INCLUDED_VECTOR
+#include <vector>
+#define INCLUDED_VECTOR
+#endif
+
+#ifndef INCLUDED_ALGORITHM
+#include <algorithm>
+#define INCLUDED_ALGORITHM
+#endif
+
+template <class T> class ToolsList : public ::std::vector< T >
+{
+public:
+ ULONG Count() const { return static_cast<ULONG>(::std::vector< T >::size()); }
+ ULONG GetPos( T pObject ) const { return ( ::std::find( this->begin(), this->end(), pObject ) ) - this->begin(); }
+ T GetObject( ULONG nIndex ) const { return (*this)[nIndex]; }
+ void Insert( T pObject, ULONG nPos ) { ::std::vector< T >::insert( this->begin()+nPos, pObject ); }
+ void Remove( ULONG nPos ) { ::std::vector< T >::erase( this->begin()+nPos ); }
+};
+
+#endif // _TEXTDATA_HXX
diff --git a/svtools/inc/svtools/texteng.hxx b/svtools/inc/svtools/texteng.hxx
new file mode 100644
index 000000000000..ef27edee2efe
--- /dev/null
+++ b/svtools/inc/svtools/texteng.hxx
@@ -0,0 +1,329 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+#ifndef _TEXTENG_HXX
+#define _TEXTENG_HXX
+
+#include "svtools/svtdllapi.h"
+
+class TextDoc;
+class TextView;
+class TextPaM;
+class TextSelection;
+class TextViews;
+class TEParaPortions;
+class TextAttrib;
+class TextCharAttrib;
+class TextUndo;
+class TextUndoManager;
+class SfxUndoManager;
+class EditSelFunctionSet;
+class EditSelEngine;
+class IdleFormatter;
+class TextNode;
+class OutputDevice;
+class SfxUndoAction;
+class KeyEvent;
+class Timer;
+
+class TextLine;
+class TETextPortion;
+#include <svl/brdcst.hxx>
+#include <tools/link.hxx>
+#include <vcl/font.hxx>
+#include <tools/string.hxx>
+#include <tools/gen.hxx>
+
+#ifndef _COM_SUN_STAR_LOCALE_LOCALE_HPP_
+#include <com/sun/star/lang/Locale.hpp>
+#endif
+#include <com/sun/star/uno/Reference.hxx>
+
+struct TEIMEInfos;
+class SvtCTLOptions;
+
+namespace com {
+namespace sun {
+namespace star {
+namespace i18n {
+ class XBreakIterator;
+ class XExtendedInputSequenceChecker;
+}}}}
+
+class LocaleDataWrapper;
+
+enum TxtAlign { TXTALIGN_LEFT, TXTALIGN_CENTER, TXTALIGN_RIGHT };
+
+class SVT_DLLPUBLIC TextEngine : public SfxBroadcaster
+{
+ friend class TextView;
+ friend class TextSelFunctionSet;
+ friend class ExtTextEngine;
+ friend class ExtTextView;
+
+ friend class TextUndo;
+ friend class TextUndoManager;
+ friend class TextUndoDelPara;
+ friend class TextUndoConnectParas;
+ friend class TextUndoSplitPara;
+ friend class TextUndoInsertChars;
+ friend class TextUndoRemoveChars;
+ friend class TextUndoSetAttribs;
+
+private:
+ TextDoc* mpDoc;
+ TEParaPortions* mpTEParaPortions;
+ OutputDevice* mpRefDev;
+
+ TextViews* mpViews;
+ TextView* mpActiveView;
+
+ TextUndoManager* mpUndoManager;
+
+ IdleFormatter* mpIdleFormatter;
+
+ TEIMEInfos* mpIMEInfos;
+
+ ::com::sun::star::lang::Locale maLocale;
+ ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > mxBreakIterator;
+
+ Rectangle maInvalidRec;
+ Range maInvalidRange;
+
+ LocaleDataWrapper* mpLocaleDataWrapper;
+
+ Font maFont;
+ Color maTextColor;
+ USHORT mnCharHeight;
+ USHORT mnFixCharWidth100;
+
+ ULONG mnMaxTextLen;
+ ULONG mnMaxTextWidth;
+ ULONG mnCurTextWidth;
+ ULONG mnCurTextHeight;
+ ULONG mnDefTab;
+
+ TxtAlign meAlign;
+
+ BOOL mbIsFormatting : 1; // Semaphore wegen der Hook's
+ BOOL mbFormatted : 1;
+ BOOL mbUpdate : 1;
+ BOOL mbModified : 1;
+ BOOL mbUndoEnabled : 1;
+ BOOL mbIsInUndo : 1;
+ BOOL mbDowning : 1;
+ BOOL mbRightToLeft : 1;
+ BOOL mbHasMultiLineParas : 1;
+
+ TextEngine( const TextEngine& ) : SfxBroadcaster() {}
+ TextEngine& operator=( const TextEngine& ) { return *this; }
+
+protected:
+
+ void CursorMoved( ULONG nNode );
+ void TextModified();
+
+ void ImpInitDoc();
+ void ImpRemoveText();
+ TextPaM ImpDeleteText( const TextSelection& rSel );
+ TextPaM ImpInsertText( const TextSelection& rSel, sal_Unicode c, BOOL bOverwrite = FALSE );
+ TextPaM ImpInsertText( const TextSelection& rSel, const String& rText );
+ TextPaM ImpInsertParaBreak( const TextSelection& rTextSelection, BOOL bKeepEndingAttribs = TRUE );
+ TextPaM ImpInsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAttribs = TRUE );
+ void ImpRemoveChars( const TextPaM& rPaM, USHORT nChars, SfxUndoAction* pCurUndo = 0 );
+ TextPaM ImpConnectParagraphs( ULONG nLeft, ULONG nRight );
+ void ImpRemoveParagraph( ULONG nPara );
+ void ImpInitWritingDirections( ULONG nPara );
+ LocaleDataWrapper* ImpGetLocaleDataWrapper();
+
+ // to remain compatible in the minor release we copy the above ImpInsertText
+ // function and add the extra parameter we need but make sure this function
+ // gets not exported. First and seconf parameter swapped to have a different signatur.
+ SAL_DLLPRIVATE TextPaM ImpInsertText( sal_Unicode c, const TextSelection& rSel, BOOL bOverwrite = FALSE, BOOL bIsUserInput = sal_False );
+ // some other new functions needed that must not be exported to remain compatible
+ SAL_DLLPRIVATE ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XExtendedInputSequenceChecker > GetInputSequenceChecker() const;
+ SAL_DLLPRIVATE BOOL IsInputSequenceCheckingRequired( sal_Unicode c, const TextSelection& rCurSel ) const;
+
+ // Broadcasten bzw. Selektionen anpassen:
+ void ImpParagraphInserted( ULONG nPara );
+ void ImpParagraphRemoved( ULONG nPara );
+ void ImpCharsRemoved( ULONG nPara, USHORT nPos, USHORT nChars );
+ void ImpCharsInserted( ULONG nPara, USHORT nPos, USHORT nChars );
+ void ImpFormattingParagraph( ULONG nPara );
+ void ImpTextHeightChanged();
+ void ImpTextFormatted();
+
+ DECL_LINK( IdleFormatHdl, Timer * );
+ void CheckIdleFormatter();
+ void IdleFormatAndUpdate( TextView* pCurView = 0, USHORT nMaxTimerRestarts = 5 );
+
+ BOOL CreateLines( ULONG nPara );
+ void CreateAndInsertEmptyLine( ULONG nPara );
+ void ImpBreakLine( ULONG nPara, TextLine* pLine, TETextPortion* pPortion, USHORT nPortionStart, long nRemainingWidth );
+ USHORT SplitTextPortion( ULONG nPara, USHORT nPos );
+ void CreateTextPortions( ULONG nPara, USHORT nStartPos );
+ void RecalcTextPortion( ULONG nPara, USHORT nStartPos, short nNewChars );
+ void SeekCursor( ULONG nNode, USHORT nPos, Font& rFont, OutputDevice* pOutDev );
+
+ void FormatDoc();
+ void FormatFullDoc();
+ void FormatAndUpdate( TextView* pCurView = 0 );
+ BOOL IsFormatting() const { return mbIsFormatting; }
+ void UpdateViews( TextView* pCurView = 0 );
+ void SetUpdateMode( BOOL bUp, TextView* pCurView, BOOL bForceUpdate );
+
+ void ImpPaint( OutputDevice* pOut, const Point& rStartPos, Rectangle const* pPaintArea, TextSelection const* pPaintRange = 0, TextSelection const* pSelection = 0 );
+
+ void UpdateSelections();
+
+ BOOL IsFormatted() const { return mbFormatted; }
+
+ USHORT GetCharPos( ULONG nPara, USHORT nLine, long nDocPosX, BOOL bSmart = FALSE );
+ Rectangle GetEditCursor( const TextPaM& rPaM, BOOL bSpecial, BOOL bPreferPortionStart = FALSE );
+ USHORT ImpFindIndex( ULONG nPortion, const Point& rPosInPara, BOOL bSmart );
+ long ImpGetPortionXOffset( ULONG nPara, TextLine* pLine, USHORT nTextPortion );
+ long ImpGetXPos( ULONG nPara, TextLine* pLine, USHORT nIndex, BOOL bPreferPortionStart = FALSE );
+ long ImpGetOutputOffset( ULONG nPara, TextLine* pLine, USHORT nIndex, USHORT nIndex2 );
+ BYTE ImpGetRightToLeft( ULONG nPara, USHORT nPos, USHORT* pStart = NULL, USHORT* pEnd = NULL );
+ void ImpInitLayoutMode( OutputDevice* pOutDev, BOOL bDrawingR2LPortion = FALSE );
+ TxtAlign ImpGetAlign() const;
+
+ ULONG CalcTextHeight();
+ ULONG CalcParaHeight( ULONG nParagraph ) const;
+ ULONG CalcTextWidth( ULONG nPara );
+ ULONG CalcTextWidth( ULONG nPara, USHORT nPortionStart, USHORT nPortionLen, const Font* pFont = 0 );
+ Range GetInvalidYOffsets( ULONG nPortion );
+
+ // Fuer Undo/Redo
+ void InsertContent( TextNode* pNode, ULONG nPara );
+ TextPaM SplitContent( ULONG nNode, USHORT nSepPos );
+ TextPaM ConnectContents( ULONG nLeftNode );
+
+ // Ans API uebergebene PaM's und Selektionen auf einen gueltigen Bereich einstellen
+ void ValidateSelection( TextSelection& rSel ) const;
+ void ValidatePaM( TextPaM& rPaM ) const;
+
+public:
+ TextEngine();
+ ~TextEngine();
+
+ void SetText( const String& rStr );
+ String GetText( LineEnd aSeparator = LINEEND_LF ) const;
+ String GetText( const TextSelection& rSel, LineEnd aSeparator = LINEEND_LF ) const;
+ String GetTextLines( LineEnd aSeparator = LINEEND_LF ) const;
+ void ReplaceText(const TextSelection& rSel, const String& rText);
+
+ ULONG GetTextLen( LineEnd aSeparator = LINEEND_LF ) const;
+ ULONG GetTextLen( const TextSelection& rSel, LineEnd aSeparator = LINEEND_LF ) const;
+
+ void SetFont( const Font& rFont );
+ const Font& GetFont() const { return maFont; }
+
+ void SetDefTab( USHORT nDefTab );
+ USHORT GetDefTab() const;
+
+ void SetLeftMargin( USHORT n );
+ USHORT GetLeftMargin() const;
+
+ void SetUpdateMode( BOOL bUpdate );
+ BOOL GetUpdateMode() const { return mbUpdate; }
+
+ USHORT GetViewCount() const;
+ TextView* GetView( USHORT nView ) const;
+ void InsertView( TextView* pTextView );
+ void RemoveView( TextView* pTextView );
+ TextView* GetActiveView() const;
+ void SetActiveView( TextView* pView );
+
+ void SetMaxTextLen( ULONG nLen );
+ ULONG GetMaxTextLen() const { return mnMaxTextLen; }
+
+ void SetMaxTextWidth( ULONG nWidth );
+ ULONG GetMaxTextWidth() const { return mnMaxTextWidth; }
+
+ ULONG GetTextHeight() const;
+ ULONG CalcTextWidth();
+ USHORT GetCharHeight() const { return mnCharHeight; }
+
+ ULONG GetParagraphCount() const;
+ String GetText( ULONG nParagraph ) const;
+ USHORT GetTextLen( ULONG nParagraph ) const;
+ ULONG GetTextHeight( ULONG nParagraph ) const;
+
+ USHORT GetLineCount( ULONG nParagraph ) const;
+ USHORT GetLineLen( ULONG nParagraph, USHORT nLine ) const;
+
+ void SetRightToLeft( BOOL bR2L );
+ BOOL IsRightToLeft() const { return mbRightToLeft; }
+
+ BOOL HasUndoManager() const { return mpUndoManager ? TRUE : FALSE; }
+ SfxUndoManager& GetUndoManager();
+ void UndoActionStart( USHORT nId );
+ void UndoActionEnd( USHORT nId );
+ void InsertUndo( TextUndo* pUndo, BOOL bTryMerge = FALSE );
+ BOOL IsInUndo() { return mbIsInUndo; }
+ void SetIsInUndo( BOOL bInUndo ) { mbIsInUndo = bInUndo; }
+ void ResetUndo();
+
+ void EnableUndo( BOOL bEnable );
+ BOOL IsUndoEnabled() { return mbUndoEnabled; }
+
+ void SetModified( BOOL bModified ) { mbModified = bModified; }
+ BOOL IsModified() const { return mbModified; }
+
+ BOOL Read( SvStream& rInput, const TextSelection* pSel = NULL );
+
+ BOOL Write( SvStream& rOutput, const TextSelection* pSel = NULL, BOOL bHTML = FALSE );
+
+ TextPaM GetPaM( const Point& rDocPos, BOOL bSmart = TRUE );
+ Rectangle PaMtoEditCursor( const TextPaM& rPaM, BOOL bSpecial = FALSE );
+ String GetWord( const TextPaM& rCursorPos, TextPaM* pStartOfWord = 0 );
+
+ BOOL HasAttrib( USHORT nWhich ) const;
+ const TextAttrib* FindAttrib( const TextPaM& rPaM, USHORT nWhich ) const;
+ const TextCharAttrib* FindCharAttrib( const TextPaM& rPaM, USHORT nWhich ) const;
+
+ void RemoveAttribs( ULONG nPara, USHORT nWhich, BOOL bIdleFormatAndUpdate );
+ void RemoveAttrib( ULONG nPara, const TextCharAttrib& rAttrib );
+ void RemoveAttribs( ULONG nPara, BOOL bIdleFormatAndUpdate = TRUE );
+ void SetAttrib( const TextAttrib& rAttr, ULONG nPara, USHORT nStart, USHORT nEnd, BOOL bIdleFormatAndUpdate = TRUE );
+
+ TxtAlign GetTextAlign() const { return meAlign; }
+ void SetTextAlign( TxtAlign eAlign );
+
+ void Draw( OutputDevice* pDev, const Point& rPos );
+
+ void SetLocale( const ::com::sun::star::lang::Locale& rLocale );
+ ::com::sun::star::lang::Locale GetLocale();
+ ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > GetBreakIterator();
+
+ static BOOL DoesKeyChangeText( const KeyEvent& rKeyEvent );
+ static BOOL DoesKeyMoveCursor( const KeyEvent& rKeyEvent );
+ static BOOL IsSimpleCharInput( const KeyEvent& rKeyEvent );
+};
+
+#endif // _TEXTENG_HXX
+
diff --git a/svtools/inc/svtools/textview.hxx b/svtools/inc/svtools/textview.hxx
new file mode 100644
index 000000000000..c17084a1d693
--- /dev/null
+++ b/svtools/inc/svtools/textview.hxx
@@ -0,0 +1,224 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _TEXTVIEW_HXX
+#define _TEXTVIEW_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/textdata.hxx>
+#include <tools/gen.hxx>
+#include <vcl/dndhelp.hxx>
+
+class TextEngine;
+class OutputDevice;
+class Window;
+class Cursor;
+class KeyEvent;
+class MouseEvent;
+class CommandEvent;
+class TextSelFunctionSet;
+class SelectionEngine;
+class VirtualDevice;
+struct TextDDInfo;
+
+namespace com {
+namespace sun {
+namespace star {
+namespace datatransfer {
+namespace clipboard {
+ class XClipboard;
+}}}}}
+
+struct ImpTextView;
+
+class SVT_DLLPUBLIC TextView : public vcl::unohelper::DragAndDropClient
+{
+ friend class TextEngine;
+ friend class TextUndo;
+ friend class TextUndoManager;
+ friend class TextSelFunctionSet;
+ friend class ExtTextView;
+
+private:
+ ImpTextView* mpImpl;
+
+ TextView( const TextView& ) : vcl::unohelper::DragAndDropClient() {}
+ TextView& operator=( const TextView& ) { return *this; }
+
+protected:
+ void ShowSelection();
+ void HideSelection();
+ void ShowSelection( const TextSelection& rSel );
+ void ImpShowHideSelection( BOOL bShow, const TextSelection* pRange = NULL );
+
+ TextSelection ImpMoveCursor( const KeyEvent& rKeyEvent );
+ TextPaM ImpDelete( BOOL bForward, BYTE nMode );
+ void ImpSetSelection( const TextSelection& rNewSel, BOOL bUI );
+ BOOL IsInSelection( const TextPaM& rPaM );
+
+ void ImpPaint( OutputDevice* pOut, const Point& rStartPos, Rectangle const* pPaintArea, TextSelection const* pPaintRange = 0, TextSelection const* pSelection = 0 );
+ void ImpPaint( const Rectangle& rRect, BOOL bUseVirtDev );
+ void ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bEndKey );
+ void ImpHighlight( const TextSelection& rSel );
+ void ImpSetSelection( const TextSelection& rSelection );
+ Point ImpGetOutputStartPos( const Point& rStartDocPos ) const;
+
+ void ImpHideDDCursor();
+ void ImpShowDDCursor();
+
+ bool ImplTruncateNewText( rtl::OUString& rNewText ) const;
+ BOOL ImplCheckTextLen( const String& rNewText );
+
+ VirtualDevice* GetVirtualDevice();
+
+ // DragAndDropClient
+ virtual void dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent& dge ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSourceDropEvent& dsde ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& dtde ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& dtdee ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& dte ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw (::com::sun::star::uno::RuntimeException);
+
+ using DragAndDropClient::dragEnter;
+ using DragAndDropClient::dragExit;
+ using DragAndDropClient::dragOver;
+
+public:
+ TextView( TextEngine* pEng, Window* pWindow );
+ virtual ~TextView();
+
+ TextEngine* GetTextEngine() const;
+ Window* GetWindow() const;
+
+ void Invalidate();
+ void Scroll( long nHorzScroll, long nVertScroll );
+
+ void ShowCursor( BOOL bGotoCursor = TRUE, BOOL bForceVisCursor = TRUE );
+ void HideCursor();
+
+ void EnableCursor( BOOL bEnable );
+ BOOL IsCursorEnabled() const;
+
+ const TextSelection& GetSelection() const;
+ TextSelection& GetSelection();
+ void SetSelection( const TextSelection& rNewSel );
+ void SetSelection( const TextSelection& rNewSel, BOOL bGotoCursor );
+ BOOL HasSelection() const;
+
+ String GetSelected();
+ String GetSelected( LineEnd aSeparator );
+ void DeleteSelected();
+
+ void InsertNewText( const rtl::OUString& rNew, BOOL bSelect = FALSE );
+ // deprecated: use InsertNewText instead
+ void InsertText( const String& rNew, BOOL bSelect = FALSE );
+
+ BOOL KeyInput( const KeyEvent& rKeyEvent );
+ void Paint( const Rectangle& rRect );
+ void MouseButtonUp( const MouseEvent& rMouseEvent );
+ void MouseButtonDown( const MouseEvent& rMouseEvent );
+ void MouseMove( const MouseEvent& rMouseEvent );
+ void Command( const CommandEvent& rCEvt );
+
+ void Cut();
+ void Copy();
+ void Paste();
+
+ void Copy( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard );
+ void Paste( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard );
+
+ void Undo();
+ void Redo();
+
+ BOOL Read( SvStream& rInput );
+ BOOL Write( SvStream& rOutput );
+
+ void SetStartDocPos( const Point& rPos );
+ const Point& GetStartDocPos() const;
+
+ Point GetDocPos( const Point& rWindowPos ) const;
+ Point GetWindowPos( const Point& rDocPos ) const;
+
+ void SetInsertMode( BOOL bInsert );
+ BOOL IsInsertMode() const;
+
+ void SetAutoIndentMode( BOOL bAutoIndent );
+ BOOL IsAutoIndentMode() const;
+
+ void SetReadOnly( BOOL bReadOnly );
+ BOOL IsReadOnly() const;
+
+ void SetAutoScroll( BOOL bAutoScroll );
+ BOOL IsAutoScroll() const;
+
+ BOOL SetCursorAtPoint( const Point& rPointPixel );
+ BOOL IsSelectionAtPoint( const Point& rPointPixel );
+
+ void SetPaintSelection( BOOL bPaint);
+ BOOL IsPaintSelection() const;
+
+ void SetHighlightSelection( BOOL bSelectByHighlight );
+ BOOL IsHighlightSelection() const;
+
+ void EraseVirtualDevice();
+
+ // aus dem protected Teil hierher verschoben
+ // F�r 'SvtXECTextCursor' (TL). Mu� ggf nochmal anders gel�st werden.
+ TextPaM PageUp( const TextPaM& rPaM );
+ TextPaM PageDown( const TextPaM& rPaM );
+ TextPaM CursorUp( const TextPaM& rPaM );
+ TextPaM CursorDown( const TextPaM& rPaM );
+ TextPaM CursorLeft( const TextPaM& rPaM, USHORT nCharacterIteratorMode );
+ TextPaM CursorRight( const TextPaM& rPaM, USHORT nCharacterIteratorMode );
+ TextPaM CursorWordLeft( const TextPaM& rPaM );
+ TextPaM CursorWordRight( const TextPaM& rPaM );
+ TextPaM CursorStartOfLine( const TextPaM& rPaM );
+ TextPaM CursorEndOfLine( const TextPaM& rPaM );
+ TextPaM CursorStartOfParagraph( const TextPaM& rPaM );
+ TextPaM CursorEndOfParagraph( const TextPaM& rPaM );
+ TextPaM CursorStartOfDoc();
+ TextPaM CursorEndOfDoc();
+
+ // Old, remove!
+ TextPaM CursorLeft( const TextPaM& rPaM, BOOL bWordMode = FALSE );
+ TextPaM CursorRight( const TextPaM& rPaM, BOOL bWordMode = FALSE );
+
+ /**
+ Drag and Drop, deleting and selection regards all text that has an attribute
+ TEXTATTR_PROTECTED set as one entitity. Drag and dropped text is automatically
+ attibuted as protected.
+ */
+ void SupportProtectAttribute(sal_Bool bSupport);
+
+ /**
+ Returns the number in paragraph of the line in which the cursor is blinking
+ if enabled, -1 otherwise.
+ */
+ sal_Int32 GetLineNumberOfCursorInSelection() const;
+};
+
+#endif // _TEXTVIEW_HXX
diff --git a/svtools/inc/svtools/textwindowpeer.hxx b/svtools/inc/svtools/textwindowpeer.hxx
new file mode 100644
index 000000000000..b80eb7ea89f0
--- /dev/null
+++ b/svtools/inc/svtools/textwindowpeer.hxx
@@ -0,0 +1,71 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#if !defined INCLUDED_SVTOOLS_TEXTWINDOWPEER_HXX
+#define INCLUDED_SVTOOLS_TEXTWINDOWPEER_HXX
+
+#include "svtools/svtdllapi.h"
+#include <toolkit/awt/vclxwindow.hxx>
+
+#include <memory>
+
+class TextEngine;
+class TextView;
+
+namespace svt
+{
+ class AccessibleFactoryAccess ;
+
+class TextWindowPeer: public ::VCLXWindow
+{
+public:
+ SVT_DLLPUBLIC TextWindowPeer(::TextView & rView, bool bCompoundControlChild = false);
+
+ virtual ~TextWindowPeer();
+
+private:
+ // VCLXWindow inherits funny copy constructor and assignment operator from
+ // ::cppu::OWeakObject, so override them here:
+
+ TextWindowPeer(TextWindowPeer &); // not implemented
+
+ void operator =(TextWindowPeer); // not implemented
+
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessibleContext >
+ CreateAccessibleContext();
+
+ ::TextEngine & m_rEngine;
+ ::TextView & m_rView;
+ bool m_bCompoundControlChild;
+
+ ::std::auto_ptr< ::svt::AccessibleFactoryAccess > m_pFactoryAccess;
+};
+
+}
+
+#endif // INCLUDED_SVTOOLS_TEXTWINDOWPEER_HXX
diff --git a/svtools/inc/svtools/toolbarmenu.hxx b/svtools/inc/svtools/toolbarmenu.hxx
new file mode 100644
index 000000000000..92b873158a98
--- /dev/null
+++ b/svtools/inc/svtools/toolbarmenu.hxx
@@ -0,0 +1,155 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _SVTOOLS_TOOLBARMENU_HXX_
+#define _SVTOOLS_TOOLBARMENU_HXX_
+
+#include "svtools/svtdllapi.h"
+
+#include <com/sun/star/frame/FeatureStateEvent.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+
+#include <vector>
+
+#include <rtl/ref.hxx>
+
+#include <vcl/ctrl.hxx>
+#include <vcl/menu.hxx>
+#include <vcl/dockwin.hxx>
+
+class ValueSet;
+
+namespace svtools {
+
+class ToolbarMenuEntry;
+struct ToolbarMenu_Impl;
+
+class SVT_DLLPUBLIC ToolbarMenu : public DockingWindow
+{
+ friend class ToolbarMenuStatusListener;
+ friend struct ToolbarMenu_Impl;
+public:
+ ToolbarMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ Window* pParentWindow,
+ WinBits nBits );
+
+ ToolbarMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ Window* pParentWindow,
+ const ResId& rResId );
+
+ ~ToolbarMenu();
+
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void KeyInput( const KeyEvent& rKEvent );
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void GetFocus();
+ virtual void LoseFocus();
+
+ void appendEntry( int nEntryId, const String& rStr, MenuItemBits nItemBits = 0 );
+ void appendEntry( int nEntryId, const Image& rImage, MenuItemBits nItemBits = 0 );
+ void appendEntry( int nEntryId, const String& rStr, const Image& rImage, MenuItemBits nItemBits = 0 );
+ void appendEntry( int nEntryId, Control* pControl, MenuItemBits nItemBits = 0 );
+ void appendSeparator();
+
+ /** creates an empty ValueSet that is initialized and can be inserted with appendEntry. */
+ ValueSet* createEmptyValueSetControl();
+
+ void checkEntry( int nEntryId, bool bCheck = true );
+ bool isEntryChecked( int nEntryId ) const;
+
+ void enableEntry( int nEntryId, bool bEnable = true );
+ bool isEntryEnabled( int nEntryId ) const;
+
+ void setEntryText( int nEntryId, const String& rStr );
+ const String& getEntryText( int nEntryId ) const;
+
+ void setEntryImage( int nEntryId, const Image& rImage );
+ const Image& getEntryImage( int nEntryId ) const;
+
+ const Size& getMenuSize() const;
+
+ void SetSelectHdl( const Link& rLink );
+ const Link& GetSelectHdl() const;
+
+ int getSelectedEntryId() const;
+ int getHighlightedEntryId() const;
+
+ void highlightFirstEntry();
+
+protected:
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
+
+ // todo: move to new base class that will replace SfxPopupWindow
+ void AddStatusListener( const rtl::OUString& rCommandURL );
+ void RemoveStatusListener( const rtl::OUString& rCommandURL );
+ void UpdateStatus( const rtl::OUString& rCommandURL );
+
+ bool IsInPopupMode();
+ void EndPopupMode();
+
+ // XStatusListener (subclasses must override this one to get the status updates
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ void StateChanged( StateChangedType nType );
+ void DataChanged( const DataChangedEvent& rDCEvt );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > GetFrame() const;
+private:
+ DECL_LINK( HighlightHdl, Control * );
+
+ void initStatusListener();
+
+ void implInit( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
+ void initWindow();
+
+ Size implCalcSize();
+
+ void appendEntry( ToolbarMenuEntry* pEntry );
+
+ void implPaint( ToolbarMenuEntry* pThisOnly = NULL, bool bHighlight = false );
+
+ void implHighlightEntry( int nHighlightEntry, bool bHighlight );
+ void implHighlightEntry( const MouseEvent& rMEvt, bool bMBDown );
+
+ void implChangeHighlightEntry( int nEntry );
+ void implSelectEntry( int nSelectedEntry );
+
+ ToolbarMenuEntry* implCursorUpDown( bool bUp, bool bHomeEnd );
+ ToolbarMenuEntry* implGetEntry( int nEntry ) const;
+ ToolbarMenuEntry* implSearchEntry( int nEntryId ) const;
+
+ ToolbarMenu_Impl* mpImpl;
+};
+
+} // namespace svtools
+
+#endif
diff --git a/svtools/inc/svtools/toolboxcontroller.hxx b/svtools/inc/svtools/toolboxcontroller.hxx
new file mode 100644
index 000000000000..7a49b294759c
--- /dev/null
+++ b/svtools/inc/svtools/toolboxcontroller.hxx
@@ -0,0 +1,175 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _SVTOOLS_TOOLBOXCONTROLLER_HXX
+#define _SVTOOLS_TOOLBOXCONTROLLER_HXX
+
+#include "svtools/svtdllapi.h"
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/util/XUpdatable.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/frame/XStatusListener.hpp>
+#include <com/sun/star/frame/XToolbarController.hpp>
+#include <com/sun/star/util/XURLTransformer.hpp>
+#include <com/sun/star/frame/XLayoutManager.hpp>
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <com/sun/star/util/XURLTransformer.hpp>
+//shizhoubo for ToolbarController Visiable
+#include <comphelper/proparrhlp.hxx>
+#include <comphelper/property.hxx>
+#include <comphelper/propertycontainer.hxx>
+#include <cppuhelper/propshlp.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+//end
+#ifndef INCLUDED_HASH_MAP
+#include <hash_map>
+#define INCLUDED_HASH_MAP
+#endif
+
+class ToolBox;
+
+namespace svt
+{
+struct ToolboxController_Impl;
+
+class SVT_DLLPUBLIC ToolboxController : public ::com::sun::star::frame::XStatusListener,
+ public ::com::sun::star::frame::XToolbarController,
+ public ::com::sun::star::lang::XInitialization,
+ public ::com::sun::star::util::XUpdatable,
+ public ::com::sun::star::lang::XComponent,
+ public ::comphelper::OMutexAndBroadcastHelper,//shizhoubo
+ public ::comphelper::OPropertyContainer,//shizhoubo
+ public ::comphelper::OPropertyArrayUsageHelper< ToolboxController >,//shizhoubo
+ public ::cppu::OWeakObject
+{
+ private:
+ sal_Bool m_bSupportVisiable; //shizhoubo
+ public:
+ ToolboxController( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame,
+ const rtl::OUString& aCommandURL );
+ ToolboxController();
+ virtual ~ToolboxController();
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > getFrameInterface() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getServiceManager() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager > getLayoutManager() const;
+
+ void updateStatus( const rtl::OUString aCommandURL );
+ void updateStatus();
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw ();
+ virtual void SAL_CALL release() throw ();
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XUpdatable
+ virtual void SAL_CALL update() throw (::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ using cppu::OPropertySetHelper::disposing;
+ virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException ) = 0;
+
+ // XToolbarController
+ virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL click() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createPopupWindow() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createItemWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& Parent ) throw (::com::sun::star::uno::RuntimeException);
+ // OPropertySetHelper //shizhoubo
+ virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const com::sun::star::uno::Any& rValue ) throw(com::sun::star::uno::Exception);
+ virtual sal_Bool SAL_CALL convertFastPropertyValue( com::sun::star::uno::Any& rConvertedValue, com::sun::star::uno::Any& rOldValue, sal_Int32 nHandle, const com::sun::star::uno::Any& rValue) throw(com::sun::star::lang::IllegalArgumentException);
+ // XPropertySet //shizhoubo
+ virtual ::com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException);
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+ // OPropertyArrayUsageHelper //shizhoubo
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
+
+
+ const rtl::OUString& getCommandURL() const { return m_aCommandURL; }
+ const rtl::OUString& getModuleName() const;
+
+ void dispatchCommand( const ::rtl::OUString& sCommandURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArgs );
+
+ void enable( bool bEnable );
+
+ protected:
+ bool getToolboxId( sal_uInt16& rItemId, ToolBox** ppToolBox );
+ void setSupportVisiableProperty(sal_Bool bValue); //shizhoubo
+ struct Listener
+ {
+ Listener( const ::com::sun::star::util::URL& rURL, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >& rDispatch ) :
+ aURL( rURL ), xDispatch( rDispatch ) {}
+
+ ::com::sun::star::util::URL aURL;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDispatch;
+ };
+
+ typedef ::std::hash_map< ::rtl::OUString,
+ com::sun::star::uno::Reference< com::sun::star::frame::XDispatch >,
+ ::rtl::OUStringHash,
+ ::std::equal_to< ::rtl::OUString > > URLToDispatchMap;
+
+ // methods to support status forwarder, known by the old sfx2 toolbox controller implementation
+ void addStatusListener( const rtl::OUString& aCommandURL );
+ void removeStatusListener( const rtl::OUString& aCommandURL );
+ void bindListener();
+ void unbindListener();
+ sal_Bool isBound() const;
+ sal_Bool hasBigImages() const;
+ sal_Bool isHighContrast() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > getURLTransformer() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > getParent() const;
+
+ sal_Bool m_bInitialized : 1,
+ m_bDisposed : 1;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
+ ToolboxController_Impl* m_pImpl;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
+ rtl::OUString m_aCommandURL;
+ URLToDispatchMap m_aListenerMap;
+ ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener
+};
+
+}
+
+#endif // _SVTOOLS_TOOLBOXCONTROLLER_HXX
diff --git a/svtools/inc/svtools/toolpanel/decklayouter.hxx b/svtools/inc/svtools/toolpanel/decklayouter.hxx
new file mode 100755
index 000000000000..da03d7c6c3aa
--- /dev/null
+++ b/svtools/inc/svtools/toolpanel/decklayouter.hxx
@@ -0,0 +1,104 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#ifndef SVT_DECKLAYOUTER_HXX
+#define SVT_DECKLAYOUTER_HXX
+
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <rtl/ref.hxx>
+
+#include <boost/optional.hpp>
+
+namespace com { namespace sun { namespace star { namespace accessibility {
+ class XAccessible;
+} } } }
+class Rectangle;
+class Point;
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ //====================================================================
+ //= IDeckLayouter
+ //====================================================================
+ class IDeckLayouter : public ::rtl::IReference
+ {
+ public:
+ /** re-arranges the elements of the tool deck, taking into account the
+ available space for the complete deck.
+
+ @param i_rDeckPlayground
+ the playground for the complete tool panel deck
+ @return
+ the content area for a single tool panel
+ */
+ virtual ::Rectangle Layout( const ::Rectangle& i_rDeckPlayground ) = 0;
+
+ /** destroys the instance
+
+ Since the layouter is ref-counted, but might keep references to non-ref-counted objects
+ (in particular, the ToolPanelDeck, which is a VCL-Window, and thus cannot be ref-counted),
+ Destroy is the definitive way to dispose the instance. Technically, it's still alive afterwards,
+ but non-functional.
+ */
+ virtual void Destroy() = 0;
+
+ /** assuming that a layouter neesds to provide some kind of panel selector control, this method
+ requests to set the focus to this control.
+ */
+ virtual void SetFocusToPanelSelector() = 0;
+
+ /** returns the number of components in the XAccessible hierarchy which are needed to represent all elements
+ the layouter is responsible form.
+
+ Note that the implementation must guarantee that the count is fixed over the life time of the layouter.
+ */
+ virtual size_t GetAccessibleChildCount() const = 0;
+
+ /** retrieves the XAccessible implementation for the <code>i_nChildIndex</code>'th child in the XAccessible
+ hierarchy.
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ GetAccessibleChild(
+ const size_t i_nChildIndex,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rParentAccessible
+ ) = 0;
+
+ virtual ~IDeckLayouter()
+ {
+ }
+ };
+
+ typedef ::rtl::Reference< IDeckLayouter > PDeckLayouter;
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVT_DECKLAYOUTER_HXX
diff --git a/svtools/inc/svtools/toolpanel/drawerlayouter.hxx b/svtools/inc/svtools/toolpanel/drawerlayouter.hxx
new file mode 100644
index 000000000000..0ecf493d0e98
--- /dev/null
+++ b/svtools/inc/svtools/toolpanel/drawerlayouter.hxx
@@ -0,0 +1,102 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#ifndef SVT_DRAWERLAYOUTER_HXX
+#define SVT_DRAWERLAYOUTER_HXX
+
+#include "svtools/svtdllapi.h"
+#include "svtools/toolpanel/refbase.hxx"
+#include "svtools/toolpanel/toolpaneldeck.hxx"
+#include "svtools/toolpanel/decklayouter.hxx"
+
+#include <boost/shared_ptr.hpp>
+
+//......................................................................................................................
+namespace svt
+{
+//......................................................................................................................
+
+ class ToolPanelViewShell;
+ class ToolPanelDrawer;
+ typedef ::boost::shared_ptr< ToolPanelDrawer > PToolPanelDrawer;
+
+ //==================================================================================================================
+ //= ToolPanelDrawer
+ //==================================================================================================================
+ /** a class which implements a tool panel selector in the form of the classical drawers
+ */
+ class SVT_DLLPUBLIC DrawerDeckLayouter :public RefBase
+ ,public IDeckLayouter
+ ,public IToolPanelDeckListener
+ {
+ public:
+ DrawerDeckLayouter(
+ ::Window& i_rParentWindow,
+ IToolPanelDeck& i_rPanels
+ );
+ ~DrawerDeckLayouter();
+
+ // IReference
+ DECLARE_IREFERENCE()
+
+ // IDeckLayouter
+ virtual Rectangle Layout( const Rectangle& i_rDeckPlayground );
+ virtual void Destroy();
+ virtual void SetFocusToPanelSelector();
+ virtual size_t GetAccessibleChildCount() const;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ GetAccessibleChild(
+ const size_t i_nChildIndex,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rParentAccessible
+ );
+
+ // IToolPanelDeckListener
+ virtual void PanelInserted( const PToolPanel& i_pPanel, const size_t i_nPosition );
+ virtual void PanelRemoved( const size_t i_nPosition );
+ virtual void ActivePanelChanged( const ::boost::optional< size_t >& i_rOldActive, const ::boost::optional< size_t >& i_rNewActive );
+ virtual void LayouterChanged( const PDeckLayouter& i_rNewLayouter );
+ virtual void Dying();
+
+ private:
+ // triggers a re-arrance of the panel deck elements
+ void impl_triggerRearrange() const;
+ size_t impl_getPanelPositionFromWindow( const Window* i_pDrawerWindow ) const;
+ void impl_removeDrawer( const size_t i_nPosition );
+
+ DECL_LINK( OnWindowEvent, VclSimpleEvent* );
+
+private:
+ Window& m_rParentWindow;
+ IToolPanelDeck& m_rPanelDeck;
+ ::std::vector< PToolPanelDrawer > m_aDrawers;
+ ::boost::optional< size_t > m_aLastKnownActivePanel;
+ };
+
+//......................................................................................................................
+} // namespace svt
+//......................................................................................................................
+
+#endif // SVT_DRAWERLAYOUTER_HXX
diff --git a/svtools/inc/svtools/toolpanel/paneltabbar.hxx b/svtools/inc/svtools/toolpanel/paneltabbar.hxx
new file mode 100644
index 000000000000..668935d8a739
--- /dev/null
+++ b/svtools/inc/svtools/toolpanel/paneltabbar.hxx
@@ -0,0 +1,102 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#ifndef SVT_PANELTABBAR_HXX
+#define SVT_PANELTABBAR_HXX
+
+#include "svtools/svtdllapi.h"
+#include "svtools/toolpanel/tabalignment.hxx"
+#include "svtools/toolpanel/tabitemcontent.hxx"
+
+#include <vcl/ctrl.hxx>
+
+#include <memory>
+#include <boost/optional.hpp>
+
+class PushButton;
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ class PanelTabBar_Impl;
+ class IToolPanelDeck;
+
+ //====================================================================
+ //= PanelTabBar
+ //====================================================================
+ /** a tab bar for selecting panels
+
+ At the moment, this control aligns the tabs vertically, this might be extended to also support a horizontal
+ layout in the future.
+ */
+ class SVT_DLLPUBLIC PanelTabBar : public Control
+ {
+ public:
+ PanelTabBar( Window& i_rParentWindow, IToolPanelDeck& i_rPanelDeck, const TabAlignment i_eAlignment, const TabItemContent i_eItemContent );
+ ~PanelTabBar();
+
+ // attribute access
+ TabItemContent GetTabItemContent() const;
+ void SetTabItemContent( const TabItemContent& i_eItemContent );
+
+ ::boost::optional< size_t > GetFocusedPanelItem() const;
+ void FocusPanelItem( const size_t i_nItemPos );
+ Rectangle GetItemScreenRect( const size_t i_nItemPos ) const;
+ bool IsVertical() const;
+ IToolPanelDeck& GetPanelDeck() const;
+ PushButton& GetScrollButton( const bool i_bForward );
+
+ // Window overridables
+ virtual Size GetOptimalSize( WindowSizeType i_eType ) const;
+
+ protected:
+ // Window overridables
+ virtual void Paint( const Rectangle& i_rRect );
+ virtual void Resize();
+ virtual void MouseMove( const MouseEvent& i_rMouseEvent );
+ virtual void MouseButtonDown( const MouseEvent& i_rMouseEvent );
+ virtual void MouseButtonUp( const MouseEvent& i_rMouseEvent );
+ virtual void RequestHelp( const HelpEvent& i_rHelpEvent );
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual void KeyInput( const KeyEvent& i_rKeyEvent );
+ virtual void DataChanged( const DataChangedEvent& i_rDataChanedEvent );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >
+ GetComponentInterface( BOOL i_bCreate );
+
+ private:
+ ::std::auto_ptr< PanelTabBar_Impl > m_pImpl;
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVT_PANELTABBAR_HXX
+
diff --git a/svtools/inc/svtools/toolpanel/refbase.hxx b/svtools/inc/svtools/toolpanel/refbase.hxx
new file mode 100644
index 000000000000..991d6e619090
--- /dev/null
+++ b/svtools/inc/svtools/toolpanel/refbase.hxx
@@ -0,0 +1,80 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#ifndef SVT_REFBASE_HXX
+#define SVT_REFBASE_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <rtl/ref.hxx>
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ //====================================================================
+ //= RefBase
+ //====================================================================
+ class SVT_DLLPUBLIC RefBase : public ::rtl::IReference
+ {
+ protected:
+ RefBase()
+ :m_refCount( 0 )
+ {
+ }
+
+ virtual ~RefBase()
+ {
+ }
+
+ virtual oslInterlockedCount SAL_CALL acquire();
+ virtual oslInterlockedCount SAL_CALL release();
+
+ private:
+ oslInterlockedCount m_refCount;
+ };
+
+#define DECLARE_IREFERENCE() \
+ virtual oslInterlockedCount SAL_CALL acquire(); \
+ virtual oslInterlockedCount SAL_CALL release();
+
+
+#define IMPLEMENT_IREFERENCE( classname ) \
+ oslInterlockedCount classname::acquire() \
+ { \
+ return RefBase::acquire(); \
+ } \
+ oslInterlockedCount classname::release() \
+ { \
+ return RefBase::release(); \
+ }
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVT_REFBASE_HXX
diff --git a/svtools/inc/svtools/toolpanel/tabalignment.hxx b/svtools/inc/svtools/toolpanel/tabalignment.hxx
new file mode 100644
index 000000000000..cc3f17469ffe
--- /dev/null
+++ b/svtools/inc/svtools/toolpanel/tabalignment.hxx
@@ -0,0 +1,47 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#ifndef SVT_TABALIGNMENT_HXX
+#define SVT_TABALIGNMENT_HXX
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ enum TabAlignment
+ {
+ TABS_LEFT,
+ TABS_RIGHT,
+ TABS_TOP,
+ TABS_BOTTOM
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVT_TABALIGNMENT_HXX
diff --git a/svtools/inc/svtools/toolpanel/tabitemcontent.hxx b/svtools/inc/svtools/toolpanel/tabitemcontent.hxx
new file mode 100644
index 000000000000..a1cf9deae9f4
--- /dev/null
+++ b/svtools/inc/svtools/toolpanel/tabitemcontent.hxx
@@ -0,0 +1,48 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#ifndef SVT_TABITEMCONTENT_HXX
+#define SVT_TABITEMCONTENT_HXX
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ enum TabItemContent
+ {
+ TABITEM_IMAGE_AND_TEXT,
+ TABITEM_IMAGE_ONLY,
+ TABITEM_TEXT_ONLY,
+
+ TABITEM_AUTO
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVT_TABITEMCONTENT_HXX
diff --git a/svtools/inc/svtools/toolpanel/tablayouter.hxx b/svtools/inc/svtools/toolpanel/tablayouter.hxx
new file mode 100755
index 000000000000..92b36acf9114
--- /dev/null
+++ b/svtools/inc/svtools/toolpanel/tablayouter.hxx
@@ -0,0 +1,112 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#ifndef SVT_TABLAYOUTER_HXX
+#define SVT_TABLAYOUTER_HXX
+
+#include "svtools/svtdllapi.h"
+#include "svtools/toolpanel/decklayouter.hxx"
+#include "svtools/toolpanel/tabalignment.hxx"
+#include "svtools/toolpanel/tabitemcontent.hxx"
+#include "svtools/toolpanel/refbase.hxx"
+
+#include <memory>
+
+#include <boost/noncopyable.hpp>
+
+class Window;
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ class IToolPanelDeck;
+
+ struct TabDeckLayouter_Data;
+
+ //====================================================================
+ //= TabDeckLayouter
+ //====================================================================
+ class SVT_DLLPUBLIC TabDeckLayouter :public RefBase
+ ,public IDeckLayouter
+ ,public ::boost::noncopyable
+ {
+ public:
+ /** creates a new layouter
+ @param i_rParent
+ is the parent window for any VCL windows the layouter needs to create.
+ @param i_rPanels
+ is the panel deck which the layouter is responsible for.
+ @param i_eAlignment
+ specifies the alignment of the panel selector
+ @param TabItemContent
+ specifies the content to show on the tab items
+ */
+ TabDeckLayouter(
+ Window& i_rParent,
+ IToolPanelDeck& i_rPanels,
+ const TabAlignment i_eAlignment,
+ const TabItemContent i_eItemContent
+ );
+ ~TabDeckLayouter();
+
+ // attribute access
+ TabItemContent GetTabItemContent() const;
+ void SetTabItemContent( const TabItemContent& i_eItemContent );
+ TabAlignment GetTabAlignment() const;
+
+ // helpers for the A11Y implementation
+ ::boost::optional< size_t >
+ GetFocusedPanelItem() const;
+ void FocusPanelItem( const size_t i_nItemPos );
+ bool IsPanelSelectorEnabled() const;
+ bool IsPanelSelectorVisible() const;
+ Rectangle GetItemScreenRect( const size_t i_nItemPos ) const;
+
+ // IDeckLayouter
+ virtual Rectangle Layout( const Rectangle& i_rDeckPlayground );
+ virtual void Destroy();
+ virtual void SetFocusToPanelSelector();
+ virtual size_t GetAccessibleChildCount() const;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ GetAccessibleChild(
+ const size_t i_nChildIndex,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rParentAccessible
+ );
+
+ // IReference
+ DECLARE_IREFERENCE()
+
+ private:
+ ::std::auto_ptr< TabDeckLayouter_Data > m_pData;
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVT_TABLAYOUTER_HXX
diff --git a/svtools/inc/svtools/toolpanel/toolpanel.hxx b/svtools/inc/svtools/toolpanel/toolpanel.hxx
new file mode 100644
index 000000000000..432dea64e8b5
--- /dev/null
+++ b/svtools/inc/svtools/toolpanel/toolpanel.hxx
@@ -0,0 +1,147 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#ifndef SVT_TOOLPANEL_HXX
+#define SVT_TOOLPANEL_HXX
+
+#include "svtools/svtdllapi.h"
+#include "svtools/toolpanel/refbase.hxx"
+
+#include <rtl/ustring.hxx>
+#include <vcl/image.hxx>
+#include <vcl/smartid.hxx>
+
+#include <boost/noncopyable.hpp>
+
+class Rectangle;
+class Window;
+namespace com { namespace sun { namespace star { namespace accessibility {
+ class XAccessible;
+} } } }
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ //====================================================================
+ //= IToolPanel
+ //====================================================================
+ /** abstract interface for a single tool panel
+ */
+ class SVT_DLLPUBLIC IToolPanel : public ::rtl::IReference
+ {
+ public:
+ /// retrieves the display name of the panel
+ virtual ::rtl::OUString GetDisplayName() const = 0;
+
+ /// retrieves the image associated with the panel, if any
+ virtual Image GetImage() const = 0;
+
+ /// retrieves the help ID associated with the panel, if any.
+ virtual SmartId GetHelpID() const = 0;
+
+ /** activates the panel
+
+ Usually, this means the panel's Window is created (if not previosly done so) and shown.
+
+ @param i_rParentWindow
+ the parent window to anchor the panel window at. Subsequent calls to the Activate
+ method will always get the same parent window. The complete area of this window is
+ available, and should be used, for the panel window.
+ */
+ virtual void Activate( Window& i_rParentWindow ) = 0;
+
+ /** deactivates the panel
+
+ There are different ways how an implementation could deactivate a panel. The easiest way
+ would be to simply hide the associated Window. Alternatively, you could completely destroy it,
+ or decide to cache it by re-parenting it to another (temporary, invisible) window.
+ */
+ virtual void Deactivate() = 0;
+
+ /** sets a new size for the panel's Window
+
+ The panel window is always expected to be positioned at (0,0), relative to the parent window
+ which was passed to the Activate member. Resizing the panel window is necessary when the size of
+ this parent window changes. Effectively, this method is a means of convenience, to relief panel
+ implementations from reacting on size changes of their parent window themselves.
+ */
+ virtual void SetSizePixel( const Size& i_rPanelWindowSize ) = 0;
+
+ /// sets the focus to the panel window
+ virtual void GrabFocus() = 0;
+
+ /** release any resources associated with the panel.
+
+ In particular, implementations should ultimately destroy the VCL window which implements the panel
+ window. No subsequent calls to any other method will happen after Destroy has been called.
+ */
+ virtual void Dispose() = 0;
+
+ /** creates an XAccessible for the tool panel
+
+ Implementations are allowed to create a new instance each time this method is called, the caller
+ is responsible for caching the XAccessible implementation, if this is desired.
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ CreatePanelAccessible(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rParentAccessible
+ ) = 0;
+
+ virtual ~IToolPanel()
+ {
+ }
+ };
+
+ typedef ::rtl::Reference< IToolPanel > PToolPanel;
+
+ //====================================================================
+ //= ToolPanelBase
+ //====================================================================
+ /** base class for tool panel implementations, adding ref count implementation to the IToolPanel interface,
+ but still being abstract
+ */
+ class SVT_DLLPUBLIC ToolPanelBase :public IToolPanel
+ ,public RefBase
+ ,public ::boost::noncopyable
+ {
+ protected:
+ ToolPanelBase();
+ ~ToolPanelBase();
+
+ public:
+ DECLARE_IREFERENCE()
+
+ private:
+ oslInterlockedCount m_refCount;
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVT_TOOLPANEL_HXX
diff --git a/svtools/inc/svtools/toolpanel/toolpaneldeck.hxx b/svtools/inc/svtools/toolpanel/toolpaneldeck.hxx
new file mode 100755
index 000000000000..a1009591ffba
--- /dev/null
+++ b/svtools/inc/svtools/toolpanel/toolpaneldeck.hxx
@@ -0,0 +1,193 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#ifndef SVT_TOOLPANELDECK_HXX
+#define SVT_TOOLPANELDECK_HXX
+
+#include "svtools/svtdllapi.h"
+#include "svtools/toolpanel/toolpanel.hxx"
+#include "svtools/toolpanel/decklayouter.hxx"
+
+#include <vcl/ctrl.hxx>
+
+#include <boost/optional.hpp>
+#include <memory>
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ class ToolPanelCollection;
+ class ToolPanelDeck_Impl;
+
+ //====================================================================
+ //= IToolPanelDeckListener
+ //====================================================================
+ class SAL_NO_VTABLE IToolPanelDeckListener
+ {
+ public:
+ /** called when a panel has been inserted into the deck
+ */
+ virtual void PanelInserted( const PToolPanel& i_pPanel, const size_t i_nPosition ) = 0;
+
+ /** called when a panel has been removed from the deck
+ */
+ virtual void PanelRemoved( const size_t i_nPosition ) = 0;
+
+ /** called when the active panel of the deck changed
+ */
+ virtual void ActivePanelChanged( const ::boost::optional< size_t >& i_rOldActive, const ::boost::optional< size_t >& i_rNewActive ) = 0;
+
+ /** called when a new layouter has been set at a tool panel deck.
+
+ The method is called after the old layouter has been disposed (i.e. its Destroy method has been
+ invoked), and after the complete deck has been re-layouter.
+ */
+ virtual void LayouterChanged( const PDeckLayouter& i_rNewLayouter ) = 0;
+
+ /** called when the tool panel deck which the listener registered at is dying. The listener is required to
+ release all references to the deck then.
+ */
+ virtual void Dying() = 0;
+ };
+
+ //====================================================================
+ //= IToolPanelDeck
+ //====================================================================
+ class SVT_DLLPUBLIC IToolPanelDeck
+ {
+ public:
+ /** returns the number of panels in the container
+ */
+ virtual size_t GetPanelCount() const = 0;
+
+ /** retrieves the panel with the given index. Invalid indexes will be reported via an assertion in the
+ non-product version, and silently ignored in the product version, with a NULL panel being returned.
+ */
+ virtual PToolPanel GetPanel( const size_t i_nPos ) const = 0;
+
+ /** returns the number of the currently active panel.
+ */
+ virtual ::boost::optional< size_t >
+ GetActivePanel() const = 0;
+
+ /** activates the panel with the given number. If the given number is larger or equal to the number of panels
+ in the deck, this will be reported via an assertion in non-product builds, and otherwise ignored.
+ @param i_rPanel
+ the number of the panel to activate. If this is not set, the currently active panel is de-activated,
+ and no new panel is activated at all. Whether or not this makes sense for your application is at
+ your own discretion.
+ */
+ virtual void ActivatePanel( const ::boost::optional< size_t >& i_rPanel ) = 0;
+
+ /** inserts a new panel into the container. NULL panels are not allowed, as are positions greater than the
+ current panel count. Violations of this will be reported via an assertion in the non-product version, and
+ silently ignored in the product version.
+ */
+ virtual size_t InsertPanel( const PToolPanel& i_pPanel, const size_t i_nPosition ) = 0;
+
+ /** removes a panel specified by its position.
+
+ Note: It is the responsibility of the caller to ensure that the panel is destroyed appropriately. That is,
+ the tool panel deck will <em>not</em> invoke <member>IToolPanel::Dispose</member> on the removed panel.
+ The advantage is that the panel might be re-used later, with the disadvantage that the owner of the panel
+ deck must know whether Dispose must be invoked after removal, or whether the panel will properly
+ dispose itself when its ref count drops to 0.
+ */
+ virtual PToolPanel RemovePanel( const size_t i_nPosition ) = 0;
+
+ /** adds a new listener to be notified when the container content changes. The caller is responsible
+ for life time control, i.e. removing the listener before it actually dies.
+ */
+ virtual void AddListener( IToolPanelDeckListener& i_rListener ) = 0;
+
+ /** removes a container listener previously added via addListener.
+ */
+ virtual void RemoveListener( IToolPanelDeckListener& i_rListener ) = 0;
+ };
+
+ //====================================================================
+ //= ToolPanelDeck
+ //====================================================================
+ class SVT_DLLPUBLIC ToolPanelDeck :public Control
+ ,public IToolPanelDeck
+ {
+ public:
+ ToolPanelDeck( Window& i_rParent, const WinBits i_nStyle = WB_DIALOGCONTROL );
+ ~ToolPanelDeck();
+
+ // attributes
+ PDeckLayouter GetLayouter() const;
+ void SetLayouter( const PDeckLayouter& i_pNewLayouter );
+
+ /** returns the window which acts as anchor for the panel windows.
+
+ This is a single dedicated window, which is passed to the IToolPanel::ActivatePanel method
+ whenever a panel is activated, to act as parent window for the panel's VCL-Window.
+ */
+ ::Window& GetPanelWindowAnchor();
+ const ::Window& GetPanelWindowAnchor() const;
+
+ /** sets the window which should act as parent in the A11Y object hierarchy.
+
+ Calling this method has no effect if CreateAccessible had always been called.
+ */
+ void SetAccessibleParentWindow( ::Window* i_pAccessibleParent );
+ ::Window* GetAccessibleParentWindow() const;
+
+ // IToolPanelDeck
+ virtual size_t GetPanelCount() const;
+ virtual PToolPanel GetPanel( const size_t i_nPos ) const;
+ virtual ::boost::optional< size_t >
+ GetActivePanel() const;
+ virtual void ActivatePanel( const ::boost::optional< size_t >& i_rPanel );
+ virtual size_t InsertPanel( const PToolPanel& i_pPanel, const size_t i_nPosition );
+ virtual PToolPanel RemovePanel( const size_t i_nPosition );
+ virtual void AddListener( IToolPanelDeckListener& i_rListener );
+ virtual void RemoveListener( IToolPanelDeckListener& i_rListener );
+
+ protected:
+ // Window overridables
+ virtual void Resize();
+ virtual long Notify( NotifyEvent& i_rNotifyEvent );
+ virtual void GetFocus();
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >
+ GetComponentInterface( BOOL i_bCreate );
+
+ private:
+ ::std::auto_ptr< ToolPanelDeck_Impl > m_pImpl;
+
+ private:
+ using Window::GetAccessibleParentWindow;
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVT_TOOLPANELDECK_HXX
diff --git a/svtools/inc/svtools/transfer.hxx b/svtools/inc/svtools/transfer.hxx
new file mode 100644
index 000000000000..5eac1484fff9
--- /dev/null
+++ b/svtools/inc/svtools/transfer.hxx
@@ -0,0 +1,591 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _TRANSFER_HXX
+#define _TRANSFER_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/globname.hxx>
+#include <tools/gen.hxx>
+#include <sot/formats.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/implbase4.hxx>
+#include <com/sun/star/frame/XTerminateListener.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <com/sun/star/datatransfer/XTransferable.hpp>
+#include <com/sun/star/datatransfer/clipboard/XClipboardOwner.hpp>
+#include <com/sun/star/datatransfer/dnd/DNDConstants.hpp>
+#include <com/sun/star/datatransfer/dnd/XDragGestureRecognizer.hpp>
+#include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
+#include <com/sun/star/datatransfer/dnd/DropTargetDragEvent.hpp>
+#include <com/sun/star/datatransfer/dnd/DropTargetDropEvent.hpp>
+#include <com/sun/star/datatransfer/dnd/XDragSourceListener.hpp>
+#ifndef _COM_SUN_STAR_DATATRANSFER_DND_XDROPTARGETELISTENER_HPP_
+#include <com/sun/star/datatransfer/dnd/XDropTargetListener.hpp>
+#endif
+#include <com/sun/star/io/XInputStream.hpp>
+
+// ------------------------
+// - Forward declarations -
+// ------------------------
+
+class Bitmap;
+class GDIMetaFile;
+class Graphic;
+class ImageMap;
+class SotStorageStreamRef;
+class INetBookmark;
+class INetImage;
+class FileList;
+class Window;
+class Link;
+
+// ---------------------
+// - Drag&Drop defines -
+// ---------------------
+
+#define DND_ACTION_NONE ::com::sun::star::datatransfer::dnd::DNDConstants::ACTION_NONE
+#define DND_ACTION_COPY ::com::sun::star::datatransfer::dnd::DNDConstants::ACTION_COPY
+#define DND_ACTION_MOVE ::com::sun::star::datatransfer::dnd::DNDConstants::ACTION_MOVE
+#define DND_ACTION_COPYMOVE ::com::sun::star::datatransfer::dnd::DNDConstants::ACTION_COPY_OR_MOVE
+#define DND_ACTION_LINK ::com::sun::star::datatransfer::dnd::DNDConstants::ACTION_LINK
+
+#define DND_POINTER_NONE 0
+#define DND_IMAGE_NONE 0
+
+// --------------------------------
+// - TransferableObjectDescriptor -
+// --------------------------------
+
+struct TransferableObjectDescriptor
+{
+ SvGlobalName maClassName;
+ sal_uInt16 mnViewAspect;
+ Point maDragStartPos;
+ Size maSize;
+ sal_uInt32 mnOle2Misc;
+ String maTypeName;
+ String maDisplayName;
+ sal_Bool mbCanLink;
+ void* mpDummy1;
+ void* mpDummy2;
+ sal_Bool mbDummy1;
+
+ SVT_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStm, TransferableObjectDescriptor& rObjDesc );
+ SVT_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStm, const TransferableObjectDescriptor& rObjDesc );
+};
+
+// -------------------
+// - AcceptDragEvent -
+// -------------------
+
+struct AcceptDropEvent
+{
+ sal_Int8 mnAction;
+ Point maPosPixel;
+ const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent maDragEvent;
+ sal_Bool mbLeaving;
+ sal_Bool mbDefault;
+ sal_Bool mbDummy1;
+ sal_Bool mbDummy2;
+ sal_Bool mbDummy3;
+
+ AcceptDropEvent() :
+ mnAction( DND_ACTION_NONE ),
+ mbLeaving( sal_False ),
+ mbDefault( sal_False ) {}
+
+ AcceptDropEvent( sal_Int8 nAction,
+ const Point& rPosPixel,
+ const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& rDragEvent,
+ sal_Bool bLeaving = sal_False ) :
+ mnAction( nAction ),
+ maPosPixel( rPosPixel ),
+ maDragEvent( rDragEvent ),
+ mbLeaving( bLeaving ),
+ mbDefault( sal_False ) {}
+};
+
+// --------------------
+// - ExecuteDropEvent -
+// --------------------
+
+struct ExecuteDropEvent
+{
+ sal_Int8 mnAction;
+ Point maPosPixel;
+ const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent maDropEvent;
+ sal_Bool mbDefault;
+ sal_Bool mbDummy1;
+ sal_Bool mbDummy2;
+ sal_Bool mbDummy3;
+
+ ExecuteDropEvent() :
+ mnAction( DND_ACTION_NONE ),
+ mbDefault( sal_False ) {}
+
+ ExecuteDropEvent( sal_Int8 nAction,
+ const Point& rPosPixel,
+ const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& rDropEvent ) :
+ mnAction( nAction ),
+ maPosPixel( rPosPixel ),
+ maDropEvent( rDropEvent ),
+ mbDefault( sal_False ) {}
+};
+
+// ----------------------
+// - TransferableHelper -
+// ----------------------
+
+class SVT_DLLPUBLIC TransferableHelper : public ::cppu::WeakImplHelper4< ::com::sun::star::datatransfer::XTransferable,
+ ::com::sun::star::datatransfer::clipboard::XClipboardOwner,
+ ::com::sun::star::datatransfer::dnd::XDragSourceListener,
+ ::com::sun::star::lang::XUnoTunnel >
+{
+private:
+
+ // nested class to implement the XTerminateListener interface
+ class TerminateListener : public ::cppu::WeakImplHelper1< ::com::sun::star::frame::XTerminateListener >
+ {
+ private:
+
+ TransferableHelper& mrParent;
+ void* mpDummy;
+
+ private:
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw( ::com::sun::star::uno::RuntimeException );
+
+ // XTerminateListener
+ virtual void SAL_CALL queryTermination( const ::com::sun::star::lang::EventObject& aEvent ) throw( ::com::sun::star::frame::TerminationVetoException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL notifyTermination( const ::com::sun::star::lang::EventObject& aEvent ) throw( ::com::sun::star::uno::RuntimeException );
+
+ public:
+
+ TerminateListener( TransferableHelper& rDropTargetHelper );
+ virtual ~TerminateListener();
+ };
+
+ friend class TransferableHelper::TerminateListener;
+
+private:
+
+ DataFlavorExList maDummy;
+ ::com::sun::star::uno::Any maAny;
+ ::rtl::OUString maLastFormat;
+ mutable ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > mxClipboard;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTerminateListener > mxTerminateListener;
+ DataFlavorExVector* mpFormats;
+ TransferableObjectDescriptor* mpObjDesc;
+ void* mpDummy1;
+
+protected:
+ inline const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >&
+ getOwnClipboard() const { return mxClipboard; }
+
+private:
+
+ // XTransferable
+ virtual ::com::sun::star::uno::Any SAL_CALL getTransferData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) throw(::com::sun::star::datatransfer::UnsupportedFlavorException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors() throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL isDataFlavorSupported( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XDragSourceListener
+ virtual void SAL_CALL dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSourceDropEvent& dsde ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dragEnter( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& dsde ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dragExit( const ::com::sun::star::datatransfer::dnd::DragSourceEvent& dse ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dragOver( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& dsde ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dropActionChanged( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& dsde ) throw(::com::sun::star::uno::RuntimeException);
+
+private:
+
+ // XClipboardOwner
+ virtual void SAL_CALL lostOwnership( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& xClipboard, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& xTrans ) throw(::com::sun::star::uno::RuntimeException);
+
+protected:
+ // derivees need to access lostOwnership in case hey override it
+ // on windows, changing the access rights to a method gives unresolved externals, so we introduce
+ // this impl-method here 'til the next incompatible update
+ inline void implCallOwnLostOwnership(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& _rxClipboard,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& _rxTrans
+ )
+ {
+ TransferableHelper::lostOwnership( _rxClipboard, _rxTrans );
+ }
+
+
+private:
+
+ SVT_DLLPRIVATE void ImplFlush();
+
+protected:
+
+ virtual ~TransferableHelper();
+
+ void AddFormat( SotFormatStringId nFormat );
+ void AddFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ void RemoveFormat( SotFormatStringId nFormat );
+ void RemoveFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool HasFormat( SotFormatStringId nFormat );
+ inline sal_Bool HasFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) { return isDataFlavorSupported( rFlavor ); }
+ void ClearFormats();
+
+ sal_Bool SetAny( const ::com::sun::star::uno::Any& rAny, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetString( const ::rtl::OUString& rString, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetBitmap( const Bitmap& rBitmap, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetGDIMetaFile( const GDIMetaFile& rMtf, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetGraphic( const Graphic& rGraphic, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetImageMap( const ImageMap& rIMap, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetTransferableObjectDescriptor( const TransferableObjectDescriptor& rDesc, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetINetBookmark( const INetBookmark& rBmk, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetINetImage( const INetImage& rINtImg, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetFileList( const FileList& rFileList, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetObject( void* pUserObject, sal_uInt32 nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetInterface( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rIf,
+ const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+
+protected:
+
+ virtual void AddSupportedFormats() = 0;
+ virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) = 0;
+ virtual sal_Bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ virtual void DragFinished( sal_Int8 nDropAction );
+ virtual void ObjectReleased();
+
+public:
+
+ TransferableHelper();
+
+ void PrepareOLE( const TransferableObjectDescriptor& rObjDesc );
+
+ void CopyToClipboard( Window *pWindow ) const;
+ void CopyToSelection( Window *pWindow ) const;
+ void StartDrag( Window* pWindow, sal_Int8 nDragSourceActions,
+ sal_Int32 nDragPointer = DND_POINTER_NONE,
+ sal_Int32 nDragImage = DND_IMAGE_NONE );
+
+ static void ClearSelection( Window *pWindow );
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > GetSystemClipboard();
+ static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId();
+
+public:
+
+ virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw( ::com::sun::star::uno::RuntimeException );
+};
+
+// --------------------------
+// - TransferableDataHelper -
+// --------------------------
+
+struct TransferableDataHelper_Impl;
+
+class SVT_DLLPUBLIC TransferableDataHelper
+{
+ friend class DropTargetHelper;
+
+private:
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > mxTransfer;
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > mxClipboard;
+ DataFlavorExVector* mpFormats;
+ TransferableObjectDescriptor* mpObjDesc;
+ TransferableDataHelper_Impl* mpImpl;
+ void* mpDummy4;
+
+protected:
+ void InitFormats();
+
+public:
+
+ static void FillDataFlavorExVector( const ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor >& rDataFlavorSeq,
+ DataFlavorExVector& rDataFlavorExVector );
+
+ TransferableDataHelper();
+ TransferableDataHelper( const TransferableDataHelper& rDataHelper );
+ TransferableDataHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rxTransferable );
+ ~TransferableDataHelper();
+
+ TransferableDataHelper& operator=( const TransferableDataHelper& rDataHelper );
+
+ const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& GetTransferable() const { return mxTransfer; }
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > GetXTransferable() const;
+
+ sal_Bool HasFormat( SotFormatStringId nFormat ) const;
+ sal_Bool HasFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) const;
+
+ sal_uInt32 GetFormatCount() const;
+
+ SotFormatStringId GetFormat( sal_uInt32 nFormat ) const;
+ ::com::sun::star::datatransfer::DataFlavor GetFormatDataFlavor( sal_uInt32 nFormat ) const;
+
+ DataFlavorExVector& GetDataFlavorExVector() const {return *mpFormats; }
+
+ sal_Bool StartClipboardListening( );
+ void StopClipboardListening( );
+
+ void Rebind( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& _rxNewData );
+
+public:
+
+ ::com::sun::star::uno::Any GetAny( SotFormatStringId nFormat ) const;
+ ::com::sun::star::uno::Any GetAny( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) const;
+
+ sal_Bool GetString( SotFormatStringId nFormat, String& rStr );
+ sal_Bool GetString( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, String& rStr );
+
+ sal_Bool GetString( SotFormatStringId nFormat, ::rtl::OUString& rStr );
+ sal_Bool GetString( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, ::rtl::OUString& rStr );
+
+ sal_Bool GetBitmap( SotFormatStringId nFormat, Bitmap& rBmp );
+ sal_Bool GetBitmap( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, Bitmap& rBmp );
+
+ sal_Bool GetGDIMetaFile( SotFormatStringId nFormat, GDIMetaFile& rMtf );
+ sal_Bool GetGDIMetaFile( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, GDIMetaFile& rMtf );
+
+ sal_Bool GetGraphic( SotFormatStringId nFormat, Graphic& rGraphic );
+ sal_Bool GetGraphic( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, Graphic& rGraphic );
+
+ sal_Bool GetImageMap( SotFormatStringId nFormat, ImageMap& rIMap );
+ sal_Bool GetImageMap( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, ImageMap& rImap );
+
+ sal_Bool GetTransferableObjectDescriptor( SotFormatStringId nFormat, TransferableObjectDescriptor& rDesc );
+ sal_Bool GetTransferableObjectDescriptor( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, TransferableObjectDescriptor& rDesc );
+
+ sal_Bool GetINetBookmark( SotFormatStringId nFormat, INetBookmark& rBmk );
+ sal_Bool GetINetBookmark( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, INetBookmark& rBmk );
+
+ sal_Bool GetINetImage( SotFormatStringId nFormat, INetImage& rINtImg );
+ sal_Bool GetINetImage( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, INetImage& rINtImg );
+
+ sal_Bool GetFileList( SotFormatStringId nFormat, FileList& rFileList );
+ sal_Bool GetFileList( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, FileList& rFileList );
+
+ sal_Bool GetSequence( SotFormatStringId nFormat, ::com::sun::star::uno::Sequence< sal_Int8 >& rSeq );
+ sal_Bool GetSequence( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, ::com::sun::star::uno::Sequence< sal_Int8 >& rSeq );
+
+ sal_Bool GetSotStorageStream( SotFormatStringId nFormat, SotStorageStreamRef& rStreamRef );
+ sal_Bool GetSotStorageStream( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, SotStorageStreamRef& rStreamRef );
+
+ sal_Bool GetInputStream( SotFormatStringId nFormat, ::com::sun::star::uno::Reference < com::sun::star::io::XInputStream >& xStream );
+ sal_Bool GetInputStream( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, ::com::sun::star::uno::Reference < com::sun::star::io::XInputStream >& xStream );
+
+ sal_Bool GetInterface( SotFormatStringId nFormat, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rIf );
+ sal_Bool GetInterface( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rIf );
+
+public:
+
+ static TransferableDataHelper CreateFromSystemClipboard( Window * pWindow );
+ static TransferableDataHelper CreateFromSelection( Window * pWindow );
+ static sal_Bool IsEqual( const ::com::sun::star::datatransfer::DataFlavor& rInternalFlavor,
+ const ::com::sun::star::datatransfer::DataFlavor& rRequestFlavor,
+ sal_Bool bCompareParameters = sal_False );
+};
+
+// --------------------
+// - DragSourceHelper -
+// --------------------
+
+class SVT_DLLPUBLIC DragSourceHelper
+{
+private:
+
+ // nested class to implement the XDragGestureListener interface
+ class DragGestureListener : public ::cppu::WeakImplHelper1< ::com::sun::star::datatransfer::dnd::XDragGestureListener >
+ {
+ private:
+
+ DragSourceHelper& mrParent;
+ void* mpDummy1;
+ void* mpDummy2;
+
+ private:
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XDragGestureListener
+ virtual void SAL_CALL dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent& rDGE ) throw( ::com::sun::star::uno::RuntimeException );
+
+ public:
+
+ DragGestureListener( DragSourceHelper& rDragSourceHelper );
+ ~DragGestureListener();
+ };
+
+ friend class DragSourceHelper::DragGestureListener;
+
+private:
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureRecognizer > mxDragGestureRecognizer;
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureListener > mxDragGestureListener;
+ void* mpDummy1;
+ void* mpDummy2;
+
+ // not available
+ DragSourceHelper();
+ DragSourceHelper& operator=( const DragSourceHelper& rDragSourceHelper );
+ sal_Bool operator==( const DragSourceHelper& rDragSourceHelper ) const;
+
+public:
+
+ // to be overridden by the application
+ virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
+
+ DragSourceHelper( Window* pWindow );
+ virtual ~DragSourceHelper();
+};
+
+// --------------------
+// - DropTargetHelper -
+// --------------------
+
+class SVT_DLLPUBLIC DropTargetHelper
+{
+private:
+
+ // nested class to implement the XDropTargetListener interface
+ class DropTargetListener : public ::cppu::WeakImplHelper1< ::com::sun::star::datatransfer::dnd::XDropTargetListener >
+ {
+ private:
+
+ DropTargetHelper& mrParent;
+ AcceptDropEvent* mpLastDragOverEvent;
+ void* mpDummy2;
+ void* mpDummy3;
+ void* mpDummy4;
+
+ private:
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XDropTargetListener
+ virtual void SAL_CALL drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& dtde ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& dtdee ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& dte ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dropActionChanged( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw(::com::sun::star::uno::RuntimeException);
+
+ public:
+
+ DropTargetListener( DropTargetHelper& rDropTargetHelper );
+ ~DropTargetListener();
+ };
+
+ friend class DropTargetHelper::DropTargetListener;
+
+private:
+
+ DataFlavorExList maDummy;
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTarget > mxDropTarget;
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener > mxDropTargetListener;
+ DataFlavorExVector* mpFormats;
+ void* mpDummy1;
+ void* mpDummy2;
+ void* mpDummy3;
+
+ // not available
+ DropTargetHelper();
+ DropTargetHelper& operator=( const DropTargetHelper& rDropTargetHelper );
+ sal_Bool operator==( const DropTargetHelper& rDropTargetHelper ) const;
+
+ void ImplConstruct();
+
+ // called by our own implementation of XDropTargetListener (DropTargetListener instance)
+ void ImplBeginDrag( const ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor >& rSupportedDataFlavors );
+ void ImplEndDrag();
+
+public:
+
+ // to be overridden by the application
+ virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
+ virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
+
+ DropTargetHelper( Window* pWindow );
+ DropTargetHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTarget >& rxDropTarget );
+
+ virtual ~DropTargetHelper();
+
+ // typically called by the application in ::AcceptDrop and ::ExecuteDrop and (see above)
+ sal_Bool IsDropFormatSupported( SotFormatStringId nFormat );
+ sal_Bool IsDropFormatSupported( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+
+ DataFlavorExVector& GetDataFlavorExVector() const {return *mpFormats; }
+
+};
+
+
+//------------------------
+// TransferDataContainer
+//------------------------
+
+struct TransferDataContainer_Impl;
+
+class SVT_DLLPUBLIC TransferDataContainer : public TransferableHelper
+{
+ TransferDataContainer_Impl* pImpl;
+
+protected:
+
+ virtual void AddSupportedFormats();
+ virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ virtual void DragFinished( sal_Int8 nDropAction );
+
+public:
+
+ TransferDataContainer();
+ ~TransferDataContainer();
+
+ void ClearData();
+
+ void CopyINetBookmark( const INetBookmark& rBkmk );
+ void CopyINetImage( const INetImage& rINtImg );
+ void CopyImageMap( const ImageMap& rImgMap );
+ void CopyGraphic( const Graphic& rGrf );
+ void CopyString( const String& rStr );
+ void CopyString( USHORT nFmt, const String& rStr );
+ void CopyAny( USHORT nFmt, const ::com::sun::star::uno::Any& rAny );
+
+ void CopyByteString( ULONG nFormatId, const ByteString& rStr );
+ void CopyAnyData( ULONG nFormatId, const sal_Char* pData, ULONG nLen );
+
+ sal_Bool HasAnyData() const;
+
+ using TransferableHelper::StartDrag;
+ void StartDrag( Window* pWindow, sal_Int8 nDragSourceActions,
+ const Link& rCallbck,
+ sal_Int32 nDragPointer = DND_POINTER_NONE,
+ sal_Int32 nDragImage = DND_IMAGE_NONE );
+};
+
+#endif
diff --git a/svtools/inc/svtools/treelist.hxx b/svtools/inc/svtools/treelist.hxx
new file mode 100644
index 000000000000..3ba013d90830
--- /dev/null
+++ b/svtools/inc/svtools/treelist.hxx
@@ -0,0 +1,514 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _SVTREELIST_HXX
+#define _SVTREELIST_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/solar.h>
+#include <tools/list.hxx>
+
+#ifndef _TABLE_HXX
+#include <tools/table.hxx>
+#endif
+#include <tools/link.hxx>
+#include <tools/string.hxx>
+#include <tools/debug.hxx>
+
+#define LISTACTION_INSERTED 1
+#define LISTACTION_REMOVING 2
+#define LISTACTION_REMOVED 3
+#define LISTACTION_MOVING 4
+#define LISTACTION_MOVED 5
+#define LISTACTION_CLEARING 6
+#define LISTACTION_INSERTED_TREE 7
+#define LISTACTION_INVALIDATE_ENTRY 8
+#define LISTACTION_RESORTING 9
+#define LISTACTION_RESORTED 10
+#define LISTACTION_CLEARED 11
+
+#define SV_TREELIST_ROOT_ENTRY (SvListEntry*)0
+#define SV_TREELIST_ERROR 0xFFFFFFFF
+
+// Entryflags, die an der View haengen
+#define SVLISTENTRYFLAG_SELECTED 0x0001
+#define SVLISTENTRYFLAG_EXPANDED 0x0002
+#define SVLISTENTRYFLAG_FOCUSED 0x0004
+#define SVLISTENTRYFLAG_CURSORED 0x0008
+#define SVLISTENTRYFLAG_NOT_SELECTABLE 0x0010
+
+class SvListEntry;
+
+class SvTreeEntryList : public List // SvEntryListStd
+{
+public:
+ SvTreeEntryList(USHORT nInitPos=16, USHORT nResize=16 )
+ : List( nInitPos, nResize )
+ {}
+ SvTreeEntryList(USHORT BlockSize, USHORT InitSize, USHORT Resize )
+ : List(BlockSize, InitSize, Resize )
+ {}
+
+ void DestroyAll();
+};
+
+class SVT_DLLPUBLIC SvListEntry
+{
+friend class SvTreeList;
+friend class SvListView;
+
+private:
+ SvListEntry* pParent;
+ SvTreeEntryList* pChilds;
+ ULONG nAbsPos;
+ ULONG nListPos;
+
+ void SetListPositions();
+ void InvalidateChildrensListPositions()
+ {
+ nListPos |= 0x80000000;
+ }
+public:
+ SvListEntry();
+ SvListEntry( const SvListEntry& );
+ virtual ~SvListEntry();
+ BOOL HasChilds() { return (BOOL)(pChilds!=0); }
+ BOOL HasChildListPos() const
+ {
+ if( pParent && !(pParent->nListPos & 0x80000000) )
+ return TRUE;
+ else return FALSE;
+ }
+ ULONG GetChildListPos() const
+ {
+ if( pParent && (pParent->nListPos & 0x80000000) )
+ pParent->SetListPositions();
+ return ( nListPos & 0x7fffffff );
+ }
+ virtual void Clone( SvListEntry* pSource );
+};
+
+class SvListView;
+
+class SvViewData
+{
+friend class SvTreeList;
+friend class SvListView;
+
+ ULONG nVisPos;
+protected:
+ USHORT nFlags;
+public:
+ SvViewData();
+ SvViewData( const SvViewData& );
+ virtual ~SvViewData();
+
+ BOOL IsSelected() const { return (BOOL)(nFlags&SVLISTENTRYFLAG_SELECTED)!=0; }
+ BOOL IsExpanded() const { return (BOOL)(nFlags&SVLISTENTRYFLAG_EXPANDED)!=0; }
+ BOOL HasFocus() const { return (BOOL)(nFlags&SVLISTENTRYFLAG_FOCUSED)!=0; }
+ void SetFocus( BOOL bFocus)
+ {
+ if ( !bFocus )
+ nFlags &= (~SVLISTENTRYFLAG_FOCUSED);
+ else
+ nFlags |= SVLISTENTRYFLAG_FOCUSED;
+ }
+ BOOL IsCursored() const { return (BOOL)(nFlags&SVLISTENTRYFLAG_CURSORED)!=0; }
+ void SetCursored( BOOL bCursored )
+ {
+ if ( !bCursored )
+ nFlags &= (~SVLISTENTRYFLAG_CURSORED);
+ else
+ nFlags |= SVLISTENTRYFLAG_CURSORED;
+ }
+
+ USHORT GetFlags() const { return nFlags; }
+
+ void SetSelectable( bool bSelectable )
+ {
+ if( bSelectable )
+ nFlags &= (~SVLISTENTRYFLAG_NOT_SELECTABLE);
+ else
+ nFlags |= SVLISTENTRYFLAG_NOT_SELECTABLE;
+ }
+ bool IsSelectable() const { return (bool)(nFlags&SVLISTENTRYFLAG_NOT_SELECTABLE)==0; }
+};
+
+enum SvSortMode { SortAscending, SortDescending, SortNone };
+
+// Rueckgabewerte Sortlink:
+// siehe International::Compare( pLeft, pRight )
+// ( Compare(a,b) ==> b.Compare(a) ==> strcmp(a,b) )
+struct SvSortData
+{
+ SvListEntry* pLeft;
+ SvListEntry* pRight;
+};
+
+class SVT_DLLPUBLIC SvTreeList
+{
+ friend class SvListView;
+
+ List aViewList;
+ ULONG nEntryCount;
+
+ Link aCloneLink;
+ Link aCompareLink;
+ SvSortMode eSortMode;
+
+ USHORT nRefCount;
+
+ BOOL bAbsPositionsValid;
+
+ SvListEntry* FirstVisible() const { return First(); }
+ SvListEntry* NextVisible( const SvListView*,SvListEntry* pEntry, USHORT* pDepth=0 ) const;
+ SvListEntry* PrevVisible( const SvListView*,SvListEntry* pEntry, USHORT* pDepth=0 ) const;
+ SvListEntry* LastVisible( const SvListView*,USHORT* pDepth=0 ) const;
+ SvListEntry* NextVisible( const SvListView*,SvListEntry* pEntry, USHORT& rDelta ) const;
+ SvListEntry* PrevVisible( const SvListView*,SvListEntry* pEntry, USHORT& rDelta ) const;
+
+ BOOL IsEntryVisible( const SvListView*,SvListEntry* pEntry ) const;
+ SvListEntry* GetEntryAtVisPos( const SvListView*,ULONG nVisPos ) const;
+ ULONG GetVisiblePos( const SvListView*,SvListEntry* pEntry ) const;
+ ULONG GetVisibleCount( const SvListView* ) const;
+ ULONG GetVisibleChildCount( const SvListView*,SvListEntry* pParent ) const;
+
+ SvListEntry* FirstSelected( const SvListView*) const;
+ SvListEntry* NextSelected( const SvListView*,SvListEntry* pEntry ) const;
+ SvListEntry* PrevSelected( const SvListView*,SvListEntry* pEntry ) const;
+ SvListEntry* LastSelected( const SvListView*) const;
+
+ BOOL Select( SvListView*,SvListEntry* pEntry, BOOL bSelect=TRUE );
+ ULONG SelectChilds( SvListView*,SvListEntry* pParent, BOOL bSelect );
+ void SelectAll( SvListView*,BOOL bSelect ); // ruft nicht Select-Hdl
+ ULONG GetChildSelectionCount( const SvListView*,SvListEntry* pParent ) const;
+
+ void Expand( SvListView*,SvListEntry* pParent );
+ void Collapse( SvListView*,SvListEntry* pParent );
+
+//#if 0 // _SOLAR__PRIVATE
+ SVT_DLLPRIVATE void SetAbsolutePositions();
+ SVT_DLLPRIVATE SvTreeEntryList*CloneChilds( SvTreeEntryList* pChilds,
+ SvListEntry* pNewParent,
+ ULONG& nCloneCount ) const;
+ SVT_DLLPRIVATE void SetListPositions( SvTreeEntryList* );
+
+ // rPos wird bei SortModeNone nicht geaendert
+ SVT_DLLPRIVATE void GetInsertionPos( SvListEntry* pEntry, SvListEntry* pParent,
+ ULONG& rPos );
+ SVT_DLLPRIVATE void ResortChilds( SvListEntry* pParent );
+//#endif /* _SOLAR__PRIVATE */
+
+protected:
+
+ SvListEntry* pRootItem;
+
+public:
+
+ SvTreeList();
+ virtual ~SvTreeList();
+
+ void InsertView( SvListView* );
+ void RemoveView( SvListView* );
+ ULONG GetViewCount() const { return aViewList.Count(); }
+ SvListView* GetView(ULONG nPos) const {return (SvListView*)aViewList.GetObject(nPos);}
+ void Broadcast( USHORT nActionId, SvListEntry* pEntry1=0,
+ SvListEntry* pEntry2=0, ULONG nPos=0 );
+ // informiert alle Listener
+ void InvalidateEntry( SvListEntry* );
+
+ ULONG GetEntryCount() const { return nEntryCount; }
+ SvListEntry* First() const;
+ SvListEntry* Next( SvListEntry* pEntry, USHORT* pDepth=0 ) const;
+ SvListEntry* Prev( SvListEntry* pEntry, USHORT* pDepth=0 ) const;
+ SvListEntry* Last( USHORT* pDepth=0 ) const;
+
+ SvListEntry* FirstChild( SvListEntry* pParent ) const;
+ SvListEntry* NextSibling( SvListEntry* pEntry ) const;
+ SvListEntry* PrevSibling( SvListEntry* pEntry ) const;
+ SvListEntry* LastSibling( SvListEntry* pEntry ) const;
+
+ ULONG Insert( SvListEntry* pEntry,SvListEntry* pPar,ULONG nPos=LIST_APPEND);
+ ULONG Insert( SvListEntry* pEntry,ULONG nRootPos = LIST_APPEND ) { return Insert(pEntry, pRootItem, nRootPos ); }
+ void InsertTree( SvListEntry* pTree, SvListEntry* pTarget );
+ void InsertTree( SvListEntry* pTree, SvListEntry* pTargetParent,
+ ULONG nListPos );
+ // Entries muessen im gleichen Model stehen!
+ void Move( SvListEntry* pSource, SvListEntry* pTarget );
+ // erzeugt ggf. Child-List
+ ULONG Move( SvListEntry* pSource, SvListEntry* pTargetParent,
+ ULONG nListPos);
+ void Copy( SvListEntry* pSource, SvListEntry* pTarget );
+ ULONG Copy( SvListEntry* pSource, SvListEntry* pTargetParent,
+ ULONG nListPos);
+
+ BOOL Remove( SvListEntry* pEntry );
+ void Clear();
+
+ BOOL HasChilds( SvListEntry* pEntry ) const;
+ BOOL HasParent( SvListEntry* pEntry ) const { return (BOOL)(pEntry->pParent!=pRootItem); }
+ BOOL IsChild( SvListEntry* pParent, SvListEntry* pChild ) const;
+ BOOL IsInChildList( SvListEntry* pParent, SvListEntry* pChild) const;
+ SvListEntry* GetEntry( SvListEntry* pParent, ULONG nPos ) const;
+ SvListEntry* GetEntry( ULONG nRootPos ) const;
+ SvListEntry* GetEntryAtAbsPos( ULONG nAbsPos ) const;
+ SvListEntry* GetParent( SvListEntry* pEntry ) const;
+ SvListEntry* GetRootLevelParent( SvListEntry* pEntry ) const;
+ SvTreeEntryList* GetChildList( SvListEntry* pParent ) const;
+
+ ULONG GetAbsPos( SvListEntry* pEntry ) const;
+ ULONG GetRelPos( SvListEntry* pChild ) const { return pChild->GetChildListPos(); }
+ ULONG GetChildCount( SvListEntry* pParent ) const;
+ USHORT GetDepth( SvListEntry* pEntry ) const;
+ BOOL IsAtRootDepth( SvListEntry* pEntry ) const { return (BOOL)(pEntry->pParent==pRootItem); }
+
+ // das Model ruft zum Clonen von Entries den Clone-Link auf,
+ // damit man sich nicht vom Model ableiten muss, wenn man
+ // sich von SvListEntry ableitet.
+ // Deklaration des Clone-Handlers:
+ // DECL_LINK(CloneHdl,SvListEntry*);
+ // der Handler muss einen SvListEntry* zurueckgeben
+ SvListEntry* Clone( SvListEntry* pEntry, ULONG& nCloneCount ) const;
+ void SetCloneLink( const Link& rLink ) { aCloneLink=rLink; }
+ const Link& GetCloneLink() const { return aCloneLink; }
+ virtual SvListEntry* CloneEntry( SvListEntry* ) const; // ruft den Clone-Link
+ virtual SvListEntry* CreateEntry() const; // zum 'new'en von Entries
+
+ USHORT GetRefCount() const { return nRefCount; }
+ void SetRefCount( USHORT nRef ) { nRefCount = nRef; }
+
+ void SetSortMode( SvSortMode eMode ) { eSortMode = eMode; }
+ SvSortMode GetSortMode() const { return eSortMode; }
+ virtual StringCompare Compare( SvListEntry*, SvListEntry* ) const;
+ void SetCompareHdl( const Link& rLink ) { aCompareLink = rLink; }
+ const Link& GetCompareHdl() const { return aCompareLink; }
+ void Resort();
+
+ void CheckIntegrity() const;
+};
+
+class SVT_DLLPUBLIC SvListView
+{
+ friend class SvTreeList;
+
+ ULONG nVisibleCount;
+ ULONG nSelectionCount;
+ BOOL bVisPositionsValid;
+
+//#if 0 // _SOLAR__PRIVATE
+ SVT_DLLPRIVATE void InitTable();
+ SVT_DLLPRIVATE void ClearTable();
+ SVT_DLLPRIVATE void RemoveViewData( SvListEntry* pParent );
+//#endif
+
+protected:
+ Table aDataTable; // Mapping SvListEntry -> ViewData
+ SvTreeList* pModel;
+
+ void ActionMoving( SvListEntry* pEntry,SvListEntry* pTargetPrnt,ULONG nChildPos);
+ void ActionMoved( SvListEntry* pEntry,SvListEntry* pTargetPrnt,ULONG nChildPos);
+ void ActionInserted( SvListEntry* pEntry );
+ void ActionInsertedTree( SvListEntry* pEntry );
+ void ActionRemoving( SvListEntry* pEntry );
+ void ActionRemoved( SvListEntry* pEntry );
+ void ActionClear();
+
+public:
+
+ SvListView(); // !!! setzt das Model auf 0
+ SvListView( SvTreeList* pModel );
+ virtual ~SvListView();
+ void Clear();
+ SvTreeList* GetModel() const { return pModel; }
+ virtual void SetModel( SvTreeList* );
+ virtual void ModelNotification( USHORT nActionId, SvListEntry* pEntry1,
+ SvListEntry* pEntry2, ULONG nPos );
+
+ ULONG GetVisibleCount() const { return pModel->GetVisibleCount( (SvListView*)this );}
+ SvListEntry* FirstVisible() const { return pModel->FirstVisible(); }
+ SvListEntry* NextVisible( SvListEntry* pEntry, USHORT* pDepth=0 ) const {return pModel->NextVisible(this,pEntry,pDepth); }
+ SvListEntry* PrevVisible( SvListEntry* pEntry, USHORT* pDepth=0 ) const {return pModel->PrevVisible(this,pEntry,pDepth); }
+ SvListEntry* LastVisible( USHORT* pDepth=0 ) const { return pModel->LastVisible(this,pDepth);}
+ SvListEntry* NextVisible( SvListEntry* pEntry, USHORT& rDelta ) const { return pModel->NextVisible(this,pEntry,rDelta); }
+ SvListEntry* PrevVisible( SvListEntry* pEntry, USHORT& rDelta ) const { return pModel->PrevVisible(this,pEntry,rDelta); }
+
+ ULONG GetSelectionCount() const { return nSelectionCount; }
+ SvListEntry* FirstSelected() const { return pModel->FirstSelected(this);}
+ SvListEntry* NextSelected( SvListEntry* pEntry ) const { return pModel->NextSelected(this,pEntry); }
+ SvListEntry* PrevSelected( SvListEntry* pEntry ) const { return pModel->PrevSelected(this,pEntry); }
+ SvListEntry* LastSelected() const { return pModel->LastSelected(this); }
+ SvListEntry* GetEntryAtVisPos( ULONG nVisPos ) const { return pModel->GetEntryAtVisPos((SvListView*)this,nVisPos); }
+ ULONG GetVisiblePos( SvListEntry* pEntry ) const { return pModel->GetVisiblePos((SvListView*)this,pEntry); }
+
+ ULONG GetVisibleChildCount(SvListEntry* pParent ) const { return pModel->GetVisibleChildCount((SvListView*)this,pParent); }
+ ULONG GetChildSelectionCount( SvListEntry* pParent ) const { return pModel->GetChildSelectionCount((SvListView*)this,pParent); }
+ void Expand( SvListEntry* pParent ) { pModel->Expand((SvListView*)this,pParent); }
+ void Collapse( SvListEntry* pParent ) { pModel->Collapse((SvListView*)this,pParent); }
+ BOOL Select( SvListEntry* pEntry, BOOL bSelect=TRUE ) { return pModel->Select((SvListView*)this,pEntry,bSelect); }
+ ULONG SelectChilds( SvListEntry* pParent, BOOL bSelect ) { return pModel->SelectChilds((SvListView*)this,pParent, bSelect); }
+ // ruft nicht Select-Hdl
+ virtual void SelectAll( BOOL bSelect, BOOL ) { pModel->SelectAll((SvListView*)this, bSelect); }
+ BOOL IsEntryVisible( SvListEntry* pEntry ) const { return pModel->IsEntryVisible((SvListView*)this,pEntry); }
+ BOOL IsExpanded( SvListEntry* pEntry ) const;
+ BOOL IsSelected( SvListEntry* pEntry ) const;
+ BOOL HasEntryFocus( SvListEntry* pEntry ) const;
+ void SetEntryFocus( SvListEntry* pEntry, BOOL bFocus ) const;
+ SvViewData* GetViewData( SvListEntry* pEntry ) const;
+ BOOL HasViewData() const { return aDataTable.Count() > 1;} // eine ROOT gibts immer
+ virtual SvViewData* CreateViewData( SvListEntry* pEntry );
+ virtual void InitViewData( SvViewData*, SvListEntry* pEntry );
+
+ virtual void ModelHasCleared();
+ virtual void ModelHasInserted( SvListEntry* pEntry );
+ virtual void ModelHasInsertedTree( SvListEntry* pEntry );
+ virtual void ModelIsMoving( SvListEntry* pSource, SvListEntry* pTargetParent,
+ ULONG nPos );
+ virtual void ModelHasMoved( SvListEntry* pSource );
+ virtual void ModelIsRemoving( SvListEntry* pEntry );
+ virtual void ModelHasRemoved( SvListEntry* pEntry );
+ virtual void ModelHasEntryInvalidated( SvListEntry* pEntry );
+};
+
+inline BOOL SvListView::IsExpanded( SvListEntry* pEntry ) const
+{
+ DBG_ASSERT(pEntry,"IsExpanded:No Entry");
+ SvViewData* pData = (SvViewData*)aDataTable.Get( (ULONG)pEntry );
+ DBG_ASSERT(pData,"Entry not in Table");
+ return pData->IsExpanded();
+}
+inline BOOL SvListView::IsSelected( SvListEntry* pEntry ) const
+{
+ DBG_ASSERT(pEntry,"IsExpanded:No Entry");
+ SvViewData* pData = (SvViewData*)aDataTable.Get( (ULONG)pEntry );
+ DBG_ASSERT(pData,"Entry not in Table");
+ return pData->IsSelected();
+}
+inline BOOL SvListView::HasEntryFocus( SvListEntry* pEntry ) const
+{
+ DBG_ASSERT(pEntry,"IsExpanded:No Entry");
+ SvViewData* pData = (SvViewData*)aDataTable.Get( (ULONG)pEntry );
+ DBG_ASSERT(pData,"Entry not in Table");
+ return pData->HasFocus();
+}
+inline void SvListView::SetEntryFocus( SvListEntry* pEntry, BOOL bFocus ) const
+{
+ DBG_ASSERT(pEntry,"SetEntryFocus:No Entry");
+ SvViewData* pData = (SvViewData*)aDataTable.Get( (ULONG)pEntry );
+ DBG_ASSERT(pData,"Entry not in Table");
+ pData->SetFocus(bFocus);
+}
+
+inline SvViewData* SvListView::GetViewData( SvListEntry* pEntry ) const
+{
+#ifndef DBG_UTIL
+ return (SvViewData*)aDataTable.Get( (ULONG)pEntry );
+#else
+ SvViewData* pResult = (SvViewData*)aDataTable.Get( (ULONG)pEntry );
+ DBG_ASSERT(pResult,"Entry not in model or wrong view");
+ return pResult;
+#endif
+}
+
+inline BOOL SvTreeList::HasChilds( SvListEntry* pEntry ) const
+{
+ if ( !pEntry )
+ pEntry = pRootItem;
+ return (BOOL)(pEntry->pChilds != 0);
+}
+
+inline SvListEntry* SvTreeList::GetEntry( SvListEntry* pParent, ULONG nPos ) const
+{ if ( !pParent )
+ pParent = pRootItem;
+ SvListEntry* pRet = 0;
+ if ( pParent->pChilds )
+ pRet = (SvListEntry*)(pParent->pChilds->GetObject(nPos));
+ return pRet;
+}
+
+inline SvListEntry* SvTreeList::GetEntry( ULONG nRootPos ) const
+{
+ SvListEntry* pRet;
+ if ( nEntryCount )
+ pRet = (SvListEntry*)(pRootItem->pChilds->GetObject(nRootPos));
+ else
+ pRet = 0;
+ return pRet;
+}
+
+inline SvTreeEntryList* SvTreeList::GetChildList( SvListEntry* pParent ) const
+{
+ if ( !pParent )
+ pParent = pRootItem;
+ return pParent->pChilds;
+}
+
+inline SvListEntry* SvTreeList::GetParent( SvListEntry* pEntry ) const
+{
+ SvListEntry* pParent = pEntry->pParent;
+ if ( pParent==pRootItem )
+ pParent = 0;
+ return pParent;
+}
+
+#define DECLARE_SVTREELIST( ClassName, Type ) \
+class ClassName : public SvTreeList \
+{ \
+public: \
+ Type First() const \
+ { return (Type)SvTreeList::First(); } \
+ Type Next( SvListEntry* pEntry, USHORT* pDepth=0 ) const \
+ { return (Type)SvTreeList::Next(pEntry,pDepth); } \
+ Type Prev( SvListEntry* pEntry, USHORT* pDepth=0 ) const \
+ { return (Type)SvTreeList::Prev(pEntry,pDepth); } \
+ Type Last( USHORT* pDepth=0 ) const \
+ { return (Type)SvTreeList::Last(pDepth); } \
+ \
+ Type Clone( SvListEntry* pEntry, ULONG& nCloneCount ) const \
+ { return (Type)SvTreeList::Clone(pEntry,nCloneCount); } \
+ Type GetEntry( SvListEntry* pParent, ULONG nPos ) const \
+ { return (Type)SvTreeList::GetEntry(pParent,nPos); } \
+ Type GetEntry( ULONG nRootPos ) const \
+ { return (Type)SvTreeList::GetEntry(nRootPos); } \
+ Type GetParent( SvListEntry* pEntry ) const \
+ { return (Type)SvTreeList::GetParent(pEntry); } \
+ using SvTreeList::FirstChild; \
+ Type FirstChild( Type pParent ) const \
+ { return (Type)SvTreeList::FirstChild(pParent); } \
+ using SvTreeList::NextSibling; \
+ Type NextSibling( Type pEntry ) const \
+ { return (Type)SvTreeList::NextSibling(pEntry); } \
+ using SvTreeList::PrevSibling; \
+ Type PrevSibling( Type pEntry ) const \
+ { return (Type)SvTreeList::PrevSibling(pEntry); } \
+ using SvTreeList::LastSibling; \
+ Type LastSibling( Type pEntry ) const \
+ { return (Type)SvTreeList::LastSibling(pEntry); } \
+ Type GetEntryAtAbsPos( ULONG nAbsPos ) const \
+ { return (Type)SvTreeList::GetEntryAtAbsPos( nAbsPos); } \
+};
+
+#endif
diff --git a/svtools/inc/svtools/ttprops.hxx b/svtools/inc/svtools/ttprops.hxx
new file mode 100644
index 000000000000..15f080b9aa3d
--- /dev/null
+++ b/svtools/inc/svtools/ttprops.hxx
@@ -0,0 +1,106 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _SVTOOLS_TTPROPS_HXX
+#define _SVTOOLS_TTPROPS_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/rtti.hxx>
+#include <vcl/apptypes.hxx>
+#include <svtools/svtdata.hxx>
+
+class SfxPoolItem;
+class Bitmap;
+
+// Defines zur Steuerung der Ausführung von Slots
+#define EXECUTE_NO 0
+#define EXECUTE_POSSIBLE 1
+#define EXECUTE_YES 2
+#define EXECUTEMODE_ASYNCHRON 1
+#define EXECUTEMODE_DIALOGASYNCHRON 2
+
+#define SFX_USE_BINDINGS 0x8000
+
+// Property Requests(PR)
+#define TT_PR_ONCE 0x100
+
+#define TT_PR_SLOTS ( 0x001 | TT_PR_ONCE )
+#define TT_PR_DISPATCHER (0x002 )
+#define TT_PR_IMG ( 0x004 )
+
+#define TT_PR_ERR_NODISPATCHER 01
+#define TT_PR_ERR_NOEXECUTE 02
+
+/// To detect inconsistencies
+#define TT_PROPERTIES_VERSION 1
+
+class SVT_DLLPUBLIC TTProperties : public ApplicationProperty
+{
+ USHORT nDonePRs; // Verwaltung für die Properties, die nur einmal gerufen werden mussen.
+ SVT_DLLPRIVATE BOOL RequestProperty( USHORT nRequest );
+
+ BOOL HasSlots(){ return nPropertyVersion == TT_PROPERTIES_VERSION; }
+
+public:
+ TYPEINFO();
+
+ TTProperties()
+ : nDonePRs( 0 )
+ , mppArgs( NULL )
+ , mpBmp( NULL )
+ , nPropertyVersion( 0 )
+ {}
+
+ BOOL GetSlots();
+
+ /// ExecuteFunction
+ USHORT mnSID;
+ SfxPoolItem** mppArgs;
+ USHORT mnMode;
+ USHORT ExecuteFunction( USHORT nSID, SfxPoolItem** ppArgs = NULL, USHORT nMode = 0 );
+
+ /// Img
+ Bitmap *mpBmp;
+ BOOL Img( Bitmap *pBmp );
+
+ static SvtResId GetSvtResId( USHORT nId );
+
+ ULONG nSidOpenUrl;
+ ULONG nSidFileName;
+ ULONG nSidNewDocDirect;
+ ULONG nSidCopy;
+ ULONG nSidPaste;
+ ULONG nSidSourceView;
+ ULONG nSidSelectAll;
+ ULONG nSidReferer;
+
+ USHORT nActualPR;
+ USHORT nPropertyVersion; // Wird bei jedem call gesetzt.
+};
+
+#endif // _SVTOOLS_TTPROPS_HXX
+
diff --git a/svtools/inc/svtools/unitconv.hxx b/svtools/inc/svtools/unitconv.hxx
new file mode 100644
index 000000000000..becc41543396
--- /dev/null
+++ b/svtools/inc/svtools/unitconv.hxx
@@ -0,0 +1,113 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: dlgutil.hxx,v $
+ * $Revision: 1.11 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+#ifndef _SVT_UNITCONV_HXX
+#define _SVT_UNITCONV_HXX
+
+// include ---------------------------------------------------------------
+#include <vcl/field.hxx>
+#include "svtools/svtdllapi.h"
+#include <svl/poolitem.hxx>
+
+// macro -----------------------------------------------------------------
+
+// typedef ---------------------------------------------------------------
+
+typedef long (*FUNC_CONVERT)(long);
+
+// Functions -------------------------------------------------------------
+
+SVT_DLLPUBLIC void SetFieldUnit( MetricField& rCtrl, FieldUnit eUnit, BOOL bAll = FALSE );
+SVT_DLLPUBLIC void SetFieldUnit( MetricBox& rCtrl, FieldUnit eUnit, BOOL bAll = FALSE );
+
+SVT_DLLPUBLIC long CalcToUnit( float nIn, SfxMapUnit eUnit );
+SVT_DLLPUBLIC long CalcToPoint( long nIn, SfxMapUnit eUnit, USHORT nFaktor );
+
+SVT_DLLPUBLIC long ItemToControl( long nIn, SfxMapUnit eItem, SfxFieldUnit eCtrl );
+SVT_DLLPUBLIC long ControlToItem( long nIn, SfxFieldUnit eCtrl, SfxMapUnit eItem );
+
+SVT_DLLPUBLIC FieldUnit MapToFieldUnit( const SfxMapUnit eUnit );
+SVT_DLLPUBLIC MapUnit FieldToMapUnit( const SfxFieldUnit eUnit );
+
+SVT_DLLPUBLIC long ConvertValueToMap( long nVal, SfxMapUnit eUnit );
+SVT_DLLPUBLIC long ConvertValueToUnit( long nVal, SfxMapUnit eUnit );
+
+SVT_DLLPUBLIC void SetMetricValue( MetricField& rField, long lCoreValue, SfxMapUnit eUnit );
+SVT_DLLPUBLIC long GetCoreValue( const MetricField& rField, SfxMapUnit eUnit );
+
+SVT_DLLPUBLIC long PointToTwips( long nIn );
+
+#if 0
+// to Twips
+SVT_DLLPUBLIC long CMToTwips( long nIn );
+SVT_DLLPUBLIC long MMToTwips( long nIn );
+SVT_DLLPUBLIC long InchToTwips( long nIn );
+SVT_DLLPUBLIC long PicaToTwips( long nIn );
+
+// to CM
+SVT_DLLPUBLIC long TwipsToCM( long nIn );
+SVT_DLLPUBLIC long InchToCM( long nIn );
+SVT_DLLPUBLIC long MMToCM( long nIn );
+SVT_DLLPUBLIC long PointToCM( long nIn );
+SVT_DLLPUBLIC long PicaToCM( long nIn );
+
+// to MM
+SVT_DLLPUBLIC long TwipsToMM( long nIn );
+SVT_DLLPUBLIC long CMToMM( long nIn );
+SVT_DLLPUBLIC long InchToMM( long nIn );
+SVT_DLLPUBLIC long PointToMM( long nIn );
+SVT_DLLPUBLIC long PicaToMM( long nIn );
+
+// to Inch
+SVT_DLLPUBLIC long TwipsToInch(long nIn );
+SVT_DLLPUBLIC long CMToInch(long nIn );
+SVT_DLLPUBLIC long MMToInch(long nIn );
+SVT_DLLPUBLIC long PointToInch(long nIn );
+SVT_DLLPUBLIC long PicaToInch(long nIn );
+
+// to Point
+SVT_DLLPUBLIC long TwipsToPoint(long nIn );
+SVT_DLLPUBLIC long InchToPoint(long nIn );
+SVT_DLLPUBLIC long CMToPoint(long nIn );
+SVT_DLLPUBLIC long MMToPoint(long nIn );
+SVT_DLLPUBLIC long PicaToPoint(long nIn );
+
+// To Pica
+long TwipsToPica(long nIn );
+long InchToPica(long nIn );
+long PointToPica(long nIn );
+long CMToPica(long nIn );
+long MMToPica(long nIn );
+
+#endif
+
+SVT_DLLPUBLIC long TransformMetric( long nVal, FieldUnit aOld, FieldUnit aNew );
+
+#endif
+
diff --git a/svtools/inc/svtools/urlcontrol.hxx b/svtools/inc/svtools/urlcontrol.hxx
new file mode 100644
index 000000000000..ce73573d5e71
--- /dev/null
+++ b/svtools/inc/svtools/urlcontrol.hxx
@@ -0,0 +1,61 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef SVTOOLS_URLCONTROL_HXX
+#define SVTOOLS_URLCONTROL_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/inettbc.hxx>
+
+//.........................................................................
+namespace svt
+{
+//.........................................................................
+
+ //=====================================================================
+ //= OFileURLControl
+ //=====================================================================
+ class SVT_DLLPUBLIC OFileURLControl : public SvtURLBox
+ {
+ protected:
+ String m_sPreservedText;
+
+ public:
+ OFileURLControl(Window* _pParent);
+ OFileURLControl(Window* _pParent, const ResId& _rId);
+
+ protected:
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+ };
+
+//.........................................................................
+} // namespace svt
+//.........................................................................
+
+#endif // SVTOOLS_URLCONTROL_HXX
+
diff --git a/svtools/inc/svtools/valueset.hxx b/svtools/inc/svtools/valueset.hxx
new file mode 100644
index 000000000000..0937d824daf0
--- /dev/null
+++ b/svtools/inc/svtools/valueset.hxx
@@ -0,0 +1,445 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _VALUESET_HXX
+#define _VALUESET_HXX
+
+#include "svtools/svtdllapi.h"
+
+#ifndef _CTRL_HXX
+#include <vcl/ctrl.hxx>
+#endif
+#ifndef _VIRDEV_HXX
+#include <vcl/virdev.hxx>
+#endif
+#include <vcl/timer.hxx>
+
+class MouseEvent;
+class TrackingEvent;
+class HelpEvent;
+class KeyEvent;
+class DataChangedEvent;
+class ScrollBar;
+class ValueItemList;
+struct ValueSetItem;
+struct ValueSet_Impl;
+#ifdef _SV_VALUESET_CXX
+class ValueSetAcc;
+class ValueItemAcc;
+#endif
+
+/*************************************************************************
+
+Beschreibung
+============
+
+class ValueSet
+
+Diese Klasse erlaubt die Auswahl eines Items. Dabei werden die Items
+nebeneinander dargestellt. Die Auswahl der Items kann zum Beispiel bei
+Farben oder Mustern uebersichtlicher sein, als in ListBox-Form. Es kann
+angegeben werden, wieviele Spalten das Control anzeigen soll und ob die
+Items umrandet werden sollen oder nicht. Optional kann auch ein
+NoSelection-Feld oder ein Namenfeld angezeigt werden. An Items werden
+standardmaessig Image, und Color unterstuetzt. Falls InsertItem()
+nur mit einer ID aufgerufen wird, kann man die Items auch selber malen.
+Dazu muss dann jedoch der UserDraw-Handler ueberlagert werden. Bei
+UserDraw-Items, wie auch bei allen anderen Items kann der Beschreibungstext
+auch hinterher gesetzt bzw. umgesetzt werden.
+
+Querverweise
+
+class ListBox
+
+--------------------------------------------------------------------------
+
+WinBits
+
+WB_RADIOSEL Wenn dieses Flag gesetzt wird, wird im ValueSet die
+ Selektion so gezeichnet, wie bei einem ImageRadioButton.
+ Dies ist jedoch nur sinnvoll, wenn die Images min. 8 Pixel
+ in horizontaler und vertikaler Richtung kleiner sind
+ als der Item-Bereich, WB_DOUBLEBORDER gesetzt ist und
+ als Color COL_WINDOWWORKSPACE gesetzt ist.
+WB_FLATVALUESET Flat Look (if you set WB_ITEMBORDER or WB_DOUBLEBORDER,
+ then you get extra border space, but the Borders
+ aren't painted),
+WB_ITEMBORDER Die Items werden umrandet
+WB_DOUBLEBORDER Die Items werden doppelt umrandet. Zusaetzlich muss
+ WB_ITEMBORDER gesetzt werden, ansonsten hat dieses
+ WinBit keine Auswirkung. Gebraucht wird dies, wenn man
+ Items mit weissem Hintergrund hat, da sonst der 3D Effekt
+ nicht mehr sichtbar ist.
+WB_NAMEFIELD Es gibt ein Namensfeld, wo der Name eines Items
+ mit angezeigt wird
+WB_NONEFIELD Es gibt ein NoSelection-Feld. Dieses kann selektiert
+ werden, wenn bei SelectItem 0 uebergeben wird. Bei
+ GetSelectItemId() wird entsprechend 0 zurueckgegeben
+ wenn dieses Feld selektiert ist, bzw. keines selektiert
+ wurde. Dieses Feld zeigt den Text an, der mit SetText()
+ gesetzt wurde, bzw. keinen, wenn kein Text gesetzt
+ wurde. Mit SetNoSelection() kann die Selektion ganz
+ ausgeschaltet werden.
+WB_VSCROLL Es wird immer ein ScrollBar angezeigt. Wenn dieses Flag
+ gesetzt wird, muss auch immer mit SetLineCount() die
+ sichtbare Anzahl der Zeilen eingestellt werden.
+WB_BORDER Um das Fenster wird ein Border gezeichnet.
+WB_NOPOINTERFOCUS Der Focus wird sich nicht geholt, wenn mit der Maus in
+ das Control geklickt wird.
+WB_TABSTOP Mit der TabTaste kann in das ValueSet gesprungen werden.
+WB_NOTABSTOP Mit der TabTaste kann nicht in das ValueSet gesprungen
+ werden.
+WB_NO_DIRECTSELECT Cursor travelling doesn't call select immediately. To
+ execute the selection <RETURN> has to be pressed.
+--------------------------------------------------------------------------
+
+Die Anzahl der Spalten muss entweder mit SetColCount() oder mit SetItemWidth()
+eingestellt werden. Wenn mit SetColCount() die Anzahl der Spalten eingestellt
+wird, wird die Breite der Items aus der sichtbaren Breite berechnet. Wenn
+die Items eine feste Breite haben sollen, sollte die Breite der Items
+mit SetItemWidth() eingestellt werden. Die Anzahl der Spalten wird
+dann aus der sichtbaren Breite berechnet.
+
+Die Anzahl der Zeilen ergibt sich durch Anzahl der Items / Anzahl der
+Spalten. Die Anzahl der sichtbaren Zeilen muss entweder mit SetLineCount()
+oder mit SetItemWidth() eingestellt werden. Wenn mit SetLineCount() die
+Anzahl der sichtbaren Zeilen eingestellt wird, wird die Hoehe der Items
+aus der sichtbaren Hoehe berechnet. Wenn die Items eine feste Hoehe haben
+sollen, sollte die Hoehe der Items mit SetItemHeight() eingestellt werden.
+Die Anzahl der sichtbaren Zeilen wird dann aus der sichtbaren Hoehe berechnet.
+Wenn weder mit SetLineCount() noch mit SetItemHeight() die Anzahl der
+sichtbaren Zeilen eingestellt wird, werden alle Zeilen dargestellt. Die
+Hoehe der Items wird dann aus der sichtbaren Hoehe berechnet. Wenn mit
+SetLineCount() oder mit SetItemHeight() die Anzahl der sichtbaren
+Zeilen gesetzt wird, scrollt das ValueSet automatisch, wenn mehr Zeilen
+vorhanden sind, als sichtbar sind. Wenn scrollen auch ueber einen
+ScrollBar moeglich sein soll muss WB_VSCROLL gesetzt werden.
+Mit SetFirstLine() kann die erste sichtbare Zeile eingestellt werden, wenn
+mehr Zeilen vorhanden sind als sichtbar sind.
+
+Mit SetExtraSpacing() kann der Abstand zwischen den Items vergroessert
+werden. Der Abstand wird in Pixeln angegeben der zusaetzlich zwischen 2 Items
+(sowohl in x wie auch in y) dargestellt werden soll.
+
+Mit CalcWindowSizePixel() kann die genaue Fenstergroesse fuer eine bestimmte
+Itemgroesse berechnet werden. Dazu muessen vorher aber alle relevanten
+Daten (Spaltenanzahl/...) gesetzt werden und falls keine Zeilenanzahl
+eingestellt wird, muessen auch alle Items eingefuegt werden. Falls das
+Window mit WB_BORDER/Border=TRUE erzeugt wurde, muss die Groesse mit
+SetOutputSizePixel() gesetzt werden, im anderen Fall koennen auch die
+anderen Groessen-Methoden benutzt werden. Mit CalcItemSize() laesst sich
+die innere und aeussere Groesse eines Items berechnen (dabei wird der
+optional mit SetExtraSpacing() eingestellte Freiraum nicht mit eingerechnet).
+
+Mit SetColor() kann die Hintergrundfarbe eingestellt werden, mit der Image
+oder UserDraw-Items hinterlegt werden. Wenn keine Farbe eingestellt wird,
+wird der Hintergrund in der gleichen Farbe hinterlegt wie andere
+Fenster (WindowColor).
+
+Mit InsertSpace() kann man ein leeres Feld einfuegen, welches weder
+dargestellt noch selektierbar ist.
+
+--------------------------------------------------------------------------
+
+Da die Ausgabeflaeche vorberechnet wird, sollten erst alle Items eingefuegt
+werden und dann erst Show() aufgerufen werden. Wenn dies nicht gemacht wird,
+erscheint das erste Paint etwas langsamer. Deshalb sollte, wenn dieses
+Control aus der Resource geladen wird und das Control erst im Programm
+mit Items versorgt wird, mit Hide = TRUE geladen werden und im Programm
+dann mit Show() angezeigt werden.
+
+Bei einem sichbaren Control kann die Erzeugung der neuen Ausgabeflaeche
+vor dem Paint aktiviert werden, indem Format() aufgerufen wird.
+
+--------------------------------------------------------------------------
+
+Wenn man ein Drag and Drop aus dem ValueSet heraus starten will, muss
+der Command-Handler ueberlagert werden. Aus diesem muss dann StartDrag
+aufgerufen werden. Wenn diese Methode TRUE zurueckliefert, kann mit
+ExecuteDrag() der Drag-Vorgang gestartet werden, ansonsten sollte keine
+Verarbeitung stattfinden. Diese Methode sorgt dafuer, das das ValueSet
+seine Verarbeitung abbricht und gegebenenfalls den Eintrag selektiert. Es
+muss daher damit gerechnet werden, das innerhalb dieser Funktion der
+Select-Handler gerufen werden kann.
+
+Fuer das Droppen muss man QueryDrop() und Drop() ueberlagern und sollte
+in diesen Methoden ShowDropPos() und HideDropPos() aufrufen. Im QueryDrop-
+Handler ruft man ShowDropPos() auf, um die Einfuegeposition anzuzeigen.
+ShowDropPos() scollt auch gegebenenfalls das ValueSet, wenn die ueber-
+gebene Position sich am Fensterrand befindet. Ausserdem liefert
+ShowDropPos() die Position zurueck, an der das Item dann eingefuegt werden
+soll, bzw. welche Einfuegeposition angezeigt wurde. Falls keine Einfuege-
+Position ermittelt werden kann, wird VALUESET_ITEM_NOTFOUND zurueckgegeben.
+Wenn beim Draggen das Fenster verlassen wird oder der Dragvorgang beendet
+wird, sollte in jedem Fall HideDropPos() gerufen werden.
+
+--------------------------------------------------------------------------
+
+Mit SetItemBits() koennen Flags an einem Item gesetzt werden. Folgende
+Flags sind zur Zeit vorgesehen:
+
+VIB_NODOUBLECLICK Jeder Klick fuehrt zu einer Select-Aktion. Der
+ Doppelklick-Handler wird in diesem Fall nie
+ gerufen.
+
+--------------------------------------------------------------------------
+
+Diese Klasse befindet sich zur Zeit noch in den SV-Tools. Deshalb muss das
+ValueSet zur Zeit als Control aus der Resource geladen werden und die
+gewuenschten WinBits (vor Show) mit SetStyle() gesetzt werden.
+
+*************************************************************************/
+
+// -----------------------
+// - ValueSet-Item-Typen -
+// -----------------------
+
+#define VIB_NODOUBLECLICK ((USHORT)0x0080)
+
+// ------------------
+// - ValueSet-Typen -
+// ------------------
+
+#define WB_RADIOSEL ((WinBits)0x00008000)
+#define WB_ITEMBORDER ((WinBits)0x00010000)
+#define WB_DOUBLEBORDER ((WinBits)0x00020000)
+#define WB_NAMEFIELD ((WinBits)0x00040000)
+#define WB_NONEFIELD ((WinBits)0x00080000)
+#define WB_FLATVALUESET ((WinBits)0x02000000)
+#define WB_NO_DIRECTSELECT ((WinBits)0x04000000)
+#define WB_MENUSTYLEVALUESET ((WinBits)0x08000000)
+
+// ------------
+// - ValueSet -
+// ------------
+
+#define VALUESET_APPEND ((USHORT)0xFFFF)
+#define VALUESET_ITEM_NOTFOUND ((USHORT)0xFFFF)
+
+class SVT_DLLPUBLIC ValueSet : public Control
+{
+private:
+
+ VirtualDevice maVirDev;
+ Timer maTimer;
+ ValueSet_Impl* mpImpl;
+ ValueSetItem* mpNoneItem;
+ ScrollBar* mpScrBar;
+ long mnTextOffset;
+ long mnVisLines;
+ long mnLines;
+ long mnUserItemWidth;
+ long mnUserItemHeight;
+ USHORT mnOldItemId;
+ USHORT mnSelItemId;
+ USHORT mnHighItemId;
+ USHORT mnDropPos;
+ USHORT mnCols;
+ USHORT mnCurCol;
+ USHORT mnUserCols;
+ USHORT mnUserVisLines;
+ USHORT mnFirstLine;
+ USHORT mnSpacing;
+ USHORT mnFrameStyle;
+ BOOL mbFormat;
+ BOOL mbHighlight;
+ BOOL mbSelection;
+ BOOL mbNoSelection;
+ BOOL mbDrawSelection;
+ BOOL mbBlackSel;
+ BOOL mbDoubleSel;
+ BOOL mbScroll;
+ BOOL mbDropPos;
+ BOOL mbFullMode;
+ Color maColor;
+ Link maDoubleClickHdl;
+ Link maSelectHdl;
+
+#ifdef _SV_VALUESET_CXX
+ friend class ValueSetAcc;
+ friend class ValueItemAcc;
+ using Control::ImplInitSettings;
+ using Window::ImplInit;
+ SVT_DLLPRIVATE void ImplInit();
+ SVT_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
+ SVT_DLLPRIVATE void ImplInitScrollBar();
+ SVT_DLLPRIVATE void ImplDeleteItems();
+ SVT_DLLPRIVATE void ImplFormatItem( ValueSetItem* pItem );
+ SVT_DLLPRIVATE void ImplDrawItemText( const XubString& rStr );
+ SVT_DLLPRIVATE void ImplDrawSelect();
+ SVT_DLLPRIVATE void ImplHideSelect( USHORT nItemId );
+ SVT_DLLPRIVATE void ImplHighlightItem( USHORT nItemId, BOOL bIsSelection = TRUE );
+ SVT_DLLPRIVATE void ImplDrawDropPos( BOOL bShow );
+ SVT_DLLPRIVATE void ImplDraw();
+ using Window::ImplScroll;
+ SVT_DLLPRIVATE BOOL ImplScroll( const Point& rPos );
+ SVT_DLLPRIVATE USHORT ImplGetItem( const Point& rPoint, BOOL bMove = FALSE ) const;
+ SVT_DLLPRIVATE ValueSetItem* ImplGetItem( USHORT nPos );
+ SVT_DLLPRIVATE ValueSetItem* ImplGetFirstItem();
+ SVT_DLLPRIVATE USHORT ImplGetVisibleItemCount() const;
+ SVT_DLLPRIVATE ValueSetItem* ImplGetVisibleItem( USHORT nVisiblePos );
+ SVT_DLLPRIVATE void ImplFireAccessibleEvent( short nEventId, const ::com::sun::star::uno::Any& rOldValue, const ::com::sun::star::uno::Any& rNewValue );
+ SVT_DLLPRIVATE BOOL ImplHasAccessibleListeners();
+ SVT_DLLPRIVATE void ImplTracking( const Point& rPos, BOOL bRepeat );
+ SVT_DLLPRIVATE void ImplEndTracking( const Point& rPos, BOOL bCancel );
+ DECL_DLLPRIVATE_LINK( ImplScrollHdl, ScrollBar* );
+ DECL_DLLPRIVATE_LINK( ImplTimerHdl, Timer* );
+#endif
+
+ // Forbidden and not implemented.
+ ValueSet (const ValueSet &);
+ ValueSet & operator= (const ValueSet &);
+
+protected:
+
+ BOOL StartDrag( const CommandEvent& rCEvt, Region& rRegion );
+ USHORT ShowDropPos( const Point& rPos );
+ void HideDropPos();
+
+protected:
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
+
+public:
+ ValueSet( Window* pParent, WinBits nWinStyle = WB_ITEMBORDER, bool bDisableTransientChildren = false );
+ ValueSet( Window* pParent, const ResId& rResId, bool bDisableTransientChildren = false );
+ ~ValueSet();
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void Tracking( const TrackingEvent& rMEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual void Resize();
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual void Select();
+ virtual void DoubleClick();
+ virtual void UserDraw( const UserDrawEvent& rUDEvt );
+
+ void InsertItem( USHORT nItemId, const Image& rImage,
+ USHORT nPos = VALUESET_APPEND );
+ void InsertItem( USHORT nItemId, const Color& rColor,
+ USHORT nPos = VALUESET_APPEND );
+ void InsertItem( USHORT nItemId,
+ const Image& rImage, const XubString& rStr,
+ USHORT nPos = VALUESET_APPEND );
+ void InsertItem( USHORT nItemId,
+ const Color& rColor, const XubString& rStr,
+ USHORT nPos = VALUESET_APPEND );
+ void InsertItem( USHORT nItemId,
+ USHORT nPos = VALUESET_APPEND );
+ void InsertSpace( USHORT nItemId,
+ USHORT nPos = VALUESET_APPEND );
+ void RemoveItem( USHORT nItemId );
+
+ void CopyItems( const ValueSet& rValueSet );
+ void Clear();
+
+ USHORT GetItemCount() const;
+ USHORT GetItemPos( USHORT nItemId ) const;
+ USHORT GetItemId( USHORT nPos ) const;
+ USHORT GetItemId( const Point& rPos ) const;
+ Rectangle GetItemRect( USHORT nItemId ) const;
+
+ void EnableFullItemMode( BOOL bFullMode = TRUE );
+ BOOL IsFullItemModeEnabled() const { return mbFullMode; }
+ void SetColCount( USHORT nNewCols = 1 );
+ USHORT GetColCount() const { return mnUserCols; }
+ void SetLineCount( USHORT nNewLines = 0 );
+ USHORT GetLineCount() const { return mnUserVisLines; }
+ void SetItemWidth( long nItemWidth = 0 );
+ long GetItemWidth() const { return mnUserItemWidth; }
+ void SetItemHeight( long nLineHeight = 0 );
+ long GetItemHeight() const { return mnUserItemHeight; }
+ void SetFirstLine( USHORT nNewLine = 0 );
+ USHORT GetFirstLine() const { return mnFirstLine; }
+
+ void SelectItem( USHORT nItemId );
+ USHORT GetSelectItemId() const { return mnSelItemId; }
+ BOOL IsItemSelected( USHORT nItemId ) const
+ { return ((!mbNoSelection && (nItemId == mnSelItemId)) ? TRUE : FALSE); }
+ void SetNoSelection();
+ BOOL IsNoSelection() const { return mbNoSelection; }
+
+ void SetItemBits( USHORT nItemId, USHORT nBits );
+ USHORT GetItemBits( USHORT nItemId ) const;
+ void SetItemImage( USHORT nItemId, const Image& rImage );
+ Image GetItemImage( USHORT nItemId ) const;
+ void SetItemColor( USHORT nItemId, const Color& rColor );
+ Color GetItemColor( USHORT nItemId ) const;
+ void SetItemData( USHORT nItemId, void* pData );
+ void* GetItemData( USHORT nItemId ) const;
+ void SetItemText( USHORT nItemId, const XubString& rStr );
+ XubString GetItemText( USHORT nItemId ) const;
+ void SetColor( const Color& rColor );
+ void SetColor() { SetColor( Color( COL_TRANSPARENT ) ); }
+ Color GetColor() const { return maColor; }
+ BOOL IsColor() const { return maColor.GetTransparency() == 0; }
+
+ void SetExtraSpacing( USHORT nNewSpacing );
+ USHORT GetExtraSpacing() { return mnSpacing; }
+
+ void Format();
+
+ void StartSelection();
+ void EndSelection();
+
+ Size CalcWindowSizePixel( const Size& rItemSize,
+ USHORT nCalcCols = 0,
+ USHORT nCalcLines = 0 );
+ Size CalcItemSizePixel( const Size& rSize, BOOL bOut = TRUE ) const;
+ long GetScrollWidth() const;
+
+ void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return maSelectHdl; }
+ void SetDoubleClickHdl( const Link& rLink ) { maDoubleClickHdl = rLink; }
+ const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
+
+ void SetHighlightHdl( const Link& rLink );
+ const Link& GetHighlightHdl() const;
+
+private:
+ /** Determine whether RTL (right to left writing) is active. For this
+ method to return <true/> two conditions have to be fullfilled:
+ <ol><li>RTL is active for the whole application.</li>
+ <li>RTL is enabled for the control.</li></ol>
+ @return
+ The method returns <true/> when RTL is active for the control
+ and <false/> when RTL is not active. Note then just enabling
+ RTL for the control is not enough.
+ */
+ SVT_DLLPRIVATE bool IsRTLActive (void);
+};
+
+#endif // _VALUESET_HXX
diff --git a/svtools/inc/svtools/wizardmachine.hxx b/svtools/inc/svtools/wizardmachine.hxx
new file mode 100644
index 000000000000..02562ac4bb63
--- /dev/null
+++ b/svtools/inc/svtools/wizardmachine.hxx
@@ -0,0 +1,394 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+#ifndef _SVTOOLS_WIZARDMACHINE_HXX_
+#define _SVTOOLS_WIZARDMACHINE_HXX_
+
+#include "svtools/svtdllapi.h"
+#include <svtools/wizdlg.hxx>
+#ifndef _SV_BUTTON_HXX
+#include <vcl/button.hxx>
+#endif
+#include <vcl/tabpage.hxx>
+#include <comphelper/stl_types.hxx>
+
+class Bitmap;
+//.........................................................................
+namespace svt
+{
+//.........................................................................
+
+// wizard buttons
+#define WZB_NONE 0x0000
+#define WZB_NEXT 0x0001
+#define WZB_PREVIOUS 0x0002
+#define WZB_FINISH 0x0004
+#define WZB_CANCEL 0x0008
+#define WZB_HELP 0x0010
+
+// wizard states
+#define WZS_INVALID_STATE ((WizardState)-1)
+
+ //=====================================================================
+ //= WizardTypes
+ //=====================================================================
+ struct WizardTypes
+ {
+ typedef sal_Int16 WizardState;
+ enum CommitPageReason
+ {
+ eTravelForward, // traveling forward (maybe with skipping pages)
+ eTravelBackward, // traveling backward (maybe with skipping pages)
+ eFinish, // the wizard is about to be finished
+ eValidate // the data should be validated only, no traveling wll happen
+ };
+ };
+
+ class SAL_NO_VTABLE IWizardPageController
+ {
+ public:
+ //-----------------------------------------------------------------
+ // This methods behave somewhat different than ActivatePage/DeactivatePage
+ // The latter are handled by the base class itself whenever changing the pages is in the offing,
+ // i.e., when it's already decided which page is the next.
+ // We may have situations where the next page depends on the state of the current, which needs
+ // to be committed for this.
+ // So initializePage and commitPage are designated to initialitzing/committing data on the page.
+ virtual void initializePage() = 0;
+ virtual sal_Bool commitPage( WizardTypes::CommitPageReason _eReason ) = 0;
+
+ /** determines whether or not it is allowed to advance to a next page
+
+ You should make this dependent on the current state of the page only, not on
+ states on other pages of the whole dialog.
+
+ The default implementation always returns <TRUE/>.
+ */
+ virtual bool canAdvance() const = 0;
+ };
+
+ //=====================================================================
+ //= OWizardPage
+ //=====================================================================
+ class OWizardMachine;
+ struct WizardPageImplData;
+
+ class SVT_DLLPUBLIC OWizardPage : public TabPage, public IWizardPageController
+ {
+ private:
+ WizardPageImplData* m_pImpl;
+
+ public:
+ /** @param _pParent
+ if the OWizardPage is used in an OWizardMachine, this parameter
+ must be the OWizardMachine (which is derived from Window)
+ */
+ OWizardPage( Window* _pParent, WinBits _nStyle = 0 );
+ OWizardPage( Window* _pParent, const ResId& _rResId );
+ ~OWizardPage();
+
+ // IWizardPageController overridables
+ virtual void initializePage();
+ virtual sal_Bool commitPage( WizardTypes::CommitPageReason _eReason );
+ virtual bool canAdvance() const;
+
+ protected:
+ // TabPage overridables
+ virtual void ActivatePage();
+
+ /** updates the travel-related UI elements of the OWizardMachine we live in (if any)
+
+ If the parent of the tab page is a OWizardMachine, then updateTravelUI at this instance
+ is called. Otherwise, nothing happens.
+ */
+ void updateDialogTravelUI();
+ };
+
+ //=====================================================================
+ //= OWizardMachine
+ //=====================================================================
+ struct WizardMachineImplData;
+ /** implements some kind of finite automata, where the states of the automata exactly correlate
+ with tab pages.
+
+ That is, the machine can have up to n states, where at each point in time exactly one state is
+ the current one. A state being current is represented as one of n tab pages being displayed
+ currently.
+
+ The class handles the UI for traveling between the states (e.g. it administrates the <em>Next</em> and
+ <em>Previous</em> buttons which you usually find in a wizard.
+
+ Derived classes have to implement the travel logic by overriding <member>determineNextState</member>,
+ which has to determine the state which follows the current state. Since this may depend
+ on the actual data presented in the wizard (e.g. checkboxes checked, or something like this),
+ they can implement non-linear traveling this way.
+ */
+
+ class SVT_DLLPUBLIC OWizardMachine : public WizardDialog, public WizardTypes
+ {
+ private:
+ // restrict access to some aspects of our base class
+ SVT_DLLPRIVATE void AddPage( TabPage* pPage ) { WizardDialog::AddPage(pPage); }
+ SVT_DLLPRIVATE void RemovePage( TabPage* pPage ) { WizardDialog::RemovePage(pPage); }
+ SVT_DLLPRIVATE void SetPage( USHORT nLevel, TabPage* pPage ) { WizardDialog::SetPage(nLevel, pPage); }
+ // TabPage* GetPage( USHORT nLevel ) const { return WizardDialog::GetPage(nLevel); }
+ // TODO: probably the complete page handling (next, previous etc.) should be prohibited ...
+
+ // IMPORTANT:
+ // traveling pages should not be done by calling these base class member, some mechanisms of this class
+ // here (e.g. committing page data) depend on having full control over page traveling.
+ // So use the travelXXX methods if you need to travel
+
+ protected:
+ OKButton* m_pFinish;
+ CancelButton* m_pCancel;
+ PushButton* m_pNextPage;
+ PushButton* m_pPrevPage;
+ HelpButton* m_pHelp;
+
+ private:
+ WizardMachineImplData*
+ m_pImpl;
+ // hold members in this structure to allow keeping compatible when members are added
+
+ SVT_DLLPRIVATE void addButtons(Window* _pParent, sal_uInt32 _nButtonFlags);
+ SVT_DLLPRIVATE long calcRightHelpOffset(sal_uInt32 _nButtonFlags);
+
+ public:
+ /** ctor
+
+ The ctor does not call FreeResource, this is the resposibility of the derived class.
+
+ For the button flags, use any combination of the WZB_* flags.
+ */
+ OWizardMachine(Window* _pParent, const ResId& _rRes, sal_uInt32 _nButtonFlags );
+ OWizardMachine(Window* _pParent, const WinBits i_nStyle, sal_uInt32 _nButtonFlags );
+ ~OWizardMachine();
+
+ /// enable (or disable) buttons
+ void enableButtons(sal_uInt32 _nWizardButtonFlags, sal_Bool _bEnable);
+ /// set the default style for a button
+ void defaultButton(sal_uInt32 _nWizardButtonFlags);
+ /// set the default style for a button
+ void defaultButton(PushButton* _pNewDefButton);
+
+ /// set the base of the title to use - the title of the current page is appended
+ void setTitleBase(const String& _rTitleBase);
+ const String& getTitleBase() const;
+
+ /// determines whether there is a next state to which we can advance
+ virtual bool canAdvance() const;
+
+ /** updates the user interface which deals with traveling in the wizard
+
+ The default implementation simply checks whether both the current page and the wizard
+ itself allow to advance to the next state (<code>canAdvance</code>), and enables the "Next"
+ button if and only if this is the case.
+ */
+ virtual void updateTravelUI();
+
+ protected:
+ // WizardDialog overridables
+ virtual void ActivatePage();
+ virtual long DeactivatePage();
+
+ // our own overridables
+
+ /// to override to create new pages
+ virtual TabPage* createPage(WizardState _nState) = 0;
+
+ /// will be called when a new page is about to be displayed
+ virtual void enterState(WizardState _nState);
+
+ /** will be called when the current state is about to be left for the given reason
+
+ The base implementation in this class will simply call <member>OWizardPage::commitPage</member>
+ for the current page, and return whatever this call returns.
+
+ @param _eReason
+ The reason why the state is to be left.
+ @return
+ <TRUE/> if and only if the page is allowed to be left
+ */
+ virtual sal_Bool prepareLeaveCurrentState( CommitPageReason _eReason );
+
+ /** will be called when the given state is left
+
+ This is the very last possibility for derived classes to veto the deactivation
+ of a page.
+
+ @todo Normally, we would not need the return value here - derived classes now have
+ the possibility to veto page deactivations in <member>prepareLeaveCurrentState</member>. However,
+ changing this return type is too incompatible at the moment ...
+
+ @return
+ <TRUE/> if and only if the page is allowed to be left
+ */
+ virtual sal_Bool leaveState( WizardState _nState );
+
+ /** determine the next state to travel from the given one
+
+ The default behaviour is linear traveling, overwrite this to change it
+
+ Return WZS_INVALID_STATE to prevent traveling.
+ */
+ virtual WizardState determineNextState( WizardState _nCurrentState ) const;
+
+ /** called when the finish button is pressed
+ <p>By default, only the base class' Finnish method (which is not virtual) is called</p>
+ */
+ virtual sal_Bool onFinish();
+
+ /// travel to the next state
+ sal_Bool travelNext();
+
+ /// travel to the previous state
+ sal_Bool travelPrevious();
+
+ /** enables the automatic enabled/disabled state of the "Next" button
+
+ If this is <TRUE/>, then upon entering a new state, the "Next" button will automatically be
+ enabled if and only if determineNextState does not return WZS_INVALID_STATE.
+ */
+ void enableAutomaticNextButtonState( bool _bEnable = true );
+ bool isAutomaticNextButtonStateEnabled() const;
+
+ /** removes a page from the history. Should be called when the page is being disabled
+ */
+ void removePageFromHistory( WizardState nToRemove );
+
+ /** skip a state
+
+ The method behaves as if from the current state, <arg>_nSteps</arg> <method>travelNext</method>s were
+ called, but without actually creating or displaying the íntermediate pages. Only the
+ (<arg>_nSteps</arg> + 1)th page is created.
+
+ The skipped states appear in the state history, so <method>travelPrevious</method> will make use of them.
+
+ A very essential precondition for using this method is that your <method>determineNextState</method>
+ method is able to determine the next state without actually having the page of the current state.
+
+ @return
+ <TRUE/> if and only if traveling was successfull
+
+ @see skipUntil
+ @see skipBackwardUntil
+ */
+ sal_Bool skip( sal_Int32 _nSteps = 1 );
+
+ /** skips one or more states, until a given state is reached
+
+ The method behaves as if from the current state, <method>travelNext</method>s were called
+ successively, until <arg>_nTargetState</arg> is reached, but without actually creating or
+ displaying the íntermediate pages.
+
+ The skipped states appear in the state history, so <method>travelPrevious</method> will make use of them.
+
+ @return
+ <TRUE/> if and only if traveling was successfull
+
+ @see skip
+ @see skipBackwardUntil
+ */
+ sal_Bool skipUntil( WizardState _nTargetState );
+
+ /** moves back one or more states, until a given state is reached
+
+ This method allows traveling backwards more than one state without actually showing the intermediate
+ states.
+
+ For instance, if you want to travel two steps backward at a time, you could used
+ two travelPrevious calls, but this would <em>show</em> both pages, which is not necessary,
+ since you're interested in the target page only. Using <member>skipBackwardUntil</member> reliefs
+ you from this.
+
+ @return
+ <TRUE/> if and only if traveling was successfull
+
+ @see skipUntil
+ @see skip
+ */
+ sal_Bool skipBackwardUntil( WizardState _nTargetState );
+
+ /** returns the current state of the machine
+
+ Vulgo, this is the identifier of the current tab page :)
+ */
+ WizardState getCurrentState() const { return WizardDialog::GetCurLevel(); }
+
+ virtual IWizardPageController*
+ getPageController( TabPage* _pCurrentPage ) const;
+
+ /** retrieves a copy of the state history, i.e. all states we already visited
+ */
+ void getStateHistory( ::std::vector< WizardState >& _out_rHistory );
+
+ public:
+ class AccessGuard { friend class WizardTravelSuspension; private: AccessGuard() { } };
+
+ void suspendTraveling( AccessGuard );
+ void resumeTraveling( AccessGuard );
+ bool isTravelingSuspended() const;
+
+ protected:
+ TabPage* GetOrCreatePage( const WizardState i_nState );
+
+ private:
+ // long OnNextPage( PushButton* );
+ DECL_DLLPRIVATE_LINK(OnNextPage, PushButton*);
+ DECL_DLLPRIVATE_LINK(OnPrevPage, PushButton*);
+ DECL_DLLPRIVATE_LINK(OnFinish, PushButton*);
+
+ SVT_DLLPRIVATE void implResetDefault(Window* _pWindow);
+ SVT_DLLPRIVATE void implUpdateTitle();
+ SVT_DLLPRIVATE void implConstruct( const sal_uInt32 _nButtonFlags );
+ };
+
+ /// helper class to temporarily suspend any traveling in the wizard
+ class WizardTravelSuspension
+ {
+ public:
+ WizardTravelSuspension( OWizardMachine& _rWizard )
+ :m_rWizard( _rWizard )
+ {
+ m_rWizard.suspendTraveling( OWizardMachine::AccessGuard() );
+ }
+
+ ~WizardTravelSuspension()
+ {
+ m_rWizard.resumeTraveling( OWizardMachine::AccessGuard() );
+ }
+
+ private:
+ OWizardMachine& m_rWizard;
+ };
+
+//.........................................................................
+} // namespace svt
+//.........................................................................
+
+#endif // _SVTOOLS_WIZARDMACHINE_HXX_
+
diff --git a/svtools/inc/svtools/wizdlg.hxx b/svtools/inc/svtools/wizdlg.hxx
new file mode 100644
index 000000000000..5bd2db5672ed
--- /dev/null
+++ b/svtools/inc/svtools/wizdlg.hxx
@@ -0,0 +1,311 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _SVT_WIZDLG_HXX
+#define _SVT_WIZDLG_HXX
+
+#include "svtools/svtdllapi.h"
+
+#ifndef _VCL_DIALOG_HXX
+#include <vcl/dialog.hxx>
+#endif
+
+class TabPage;
+class Button;
+class PushButton;
+class FixedLine;
+struct ImplWizPageData;
+struct ImplWizButtonData;
+
+/*************************************************************************
+
+Beschreibung
+============
+
+class WizardDialog
+
+Diese Klasse dient als Basis fuer einen WizardDialog. Als
+Basisfunktionalitaet wird das Anordnen der Controls angeboten und
+Hilfesmethoden fuer das Umschalten von TabPages. Der Dialog
+ordnet bei einer Groessenanderung die Controls auch wieder
+entsprechend an.
+
+--------------------------------------------------------------------------
+
+Mit SetPageSizePixel() kann als Groesse die Groesse der groessten
+TabPage vorgegeben werden. Wenn der Dialog angezeigt wird, wird
+zu dem Zeitpunkt wenn noch keine Groesse gesetzt wurde, dafuer
+die entsprechende Dialoggroesse berechnet und gesetzt. Wenn mit
+SetPageSizePixel() keine Groesse gesetzt wurde, wird als Groesse
+die maximale Groesse der zu diesem Zeitpunkt zugewiesenen TabPages
+berechnet und genommen.
+
+ShowPrevPage()/ShowNextPage() zeigt die vorherige/naechste TabPage
+an. Dazu wird zuerst der Deactivate-Handler vom Dialog gerufen und
+wenn dieser TRUE zurueckgegeben hat, wird der Acivate-Handler
+vom Dialog gerufen und die entsprechende TabPage angezeigt.
+Finnsh() kann gerufen werden, wenn der Finnish-Button betaetigt
+wird. Dort wird dann auch noch der Deactivate-Page-Handler vom
+Dialog und der aktuellen TabPage gerufen und dann der Dialog
+beendet (Close() oder EndDialog()).
+
+Mit AddPage()/RemovePage()/SetPage() koennen die TabPages dem Wizard
+bekannt gemacht werden. Es wird immer die TabPage des aktuellen Levels
+angezeigt, wenn fuer den aktuellen Level keine TabPage zugewiesen
+ist, wird die TabPages des hoechsten Levels angezeigt. Somit kann auch
+immer die aktuelle TabPage ausgetauscht werden, wobei zu
+beruecksichtigen ist, das im Activate-Handler die aktuelle TabPage
+nicht zerstoert werden darf.
+
+Mit SetPrevButton()/SetNextButton() werden der Prev-Button und der
+Next-Button dem Dialog bekannt gemacht. In dem Fall loest der
+Dialog bei Ctr+Tab, Shift+Ctrl+Tab den entsprechenden Click-Handler
+am zugewiesenen Button aus. Die Button werden nicht vom WizardDialog
+disablte. Eine entsprechende Steuerung muss der Benutzer dieses
+Dialoges selber programieren.
+
+Mit AddButton()/RemoveButton() koennen Buttons dem Wizard bekannt
+gemacht werden, die in der Reihenfolge der Hinzufuegung angeordnet
+werden. Die Buttons werden unabhengig von ihrem sichtbarkeitsstatus
+angeordnet, so das auch spaeter ein entsprechender Button angezeigt/
+gehidet werden kann. Der Offset wird in Pixeln angegeben und bezieht
+sich immer auf den nachfolgenden Button. Damit der Abstand zwischen
+den Buttons bei allen Dialogen gleich ist, gibt es das Define
+WIZARDDIALOG_BUTTON_STDOFFSET_X, welches als Standard-Offset genommen
+werden sollte.
+
+Mit ShowButtonFixedLine() kann gesteuert werden, ob die zwischen den
+Buttons und der TabPage eine Trennlinie angezeigt werden soll.
+
+Mit SetViewWindow() und SetViewAlign() kann ein Control gesetzt werden,
+welches als PreView-Window oder fuer die Anzeige von schoenen Bitmaps
+genutzt werden kann.
+
+--------------------------------------------------------------------------
+
+Der ActivatePage()-Handler wird gerufen, wenn eine neue TabPages
+angezeigt wird. In diesem Handler kann beispielsweise die neue
+TabPage erzeugt werden, wenn diese zu diesem Zeitpunkt noch nicht
+erzeugt wurde. Der Handler kann auch als Link gesetzt werden. Mit
+GetCurLevel() kann die aktuelle ebene abgefragt werden, wobei
+Level 0 die erste Seite ist.
+
+Der DeactivatePage()-Handler wird gerufen, wenn eine neue TabPage
+angezeigt werden soll. In diesem Handler kann noch eine Fehler-
+ueberprufung stattfinden und das Umschalten gegebenenfalls verhindert
+werden, indem FALSE zurueckgegeben wird. Der Handler kann auch als
+Link gesetzt werden. Die Defaultimplementierung ruft den Link und
+gibt den Rueckgabewert des Links zurueck und wenn kein Link gesetzt
+ist, wird TRUE zurueckgegeben.
+
+--------------------------------------------------------------------------
+
+Beispiel:
+
+MyWizardDlg-Ctor
+----------------
+
+// add buttons
+AddButton( &maHelpBtn, WIZARDDIALOG_BUTTON_STDOFFSET_X );
+AddButton( &maCancelBtn, WIZARDDIALOG_BUTTON_STDOFFSET_X );
+AddButton( &maPrevBtn );
+AddButton( &maNextBtn, WIZARDDIALOG_BUTTON_STDOFFSET_X );
+AddButton( &maFinnishBtn );
+SetPrevButton( &maPrevBtn );
+SetNextButton( &maNextBtn );
+
+// SetHandler
+maPrevBtn.SetClickHdl( LINK( this, MyWizardDlg, ImplPrevHdl ) );
+maNextBtn.SetClickHdl( LINK( this, MyWizardDlg, ImplNextHdl ) );
+
+// Set PreviewWindow
+SetViewWindow( &maPreview );
+
+// Show line between Buttons and Page
+ShowButtonFixedLine( TRUE );
+
+// Call ActivatePage, because the first page should be created an activated
+ActivatePage();
+
+
+MyWizardDlg-ActivatePage-Handler
+--------------------------------
+
+void MyWizardDlg::ActivatePage()
+{
+ WizardDialog::ActivatePage();
+
+ // Test, if Page is created already
+ if ( !GetPage( GetCurLevel() ) )
+ {
+ // Create and add new page
+ TabPage* pNewTabPage;
+ switch ( GetCurLevel() )
+ {
+ case 0:
+ pNewTabPage = CreateIntroPage();
+ break;
+ case 1:
+ pNewTabPage = CreateSecondPage();
+ break;
+ case 2:
+ pNewTabPage = CreateThirdPage();
+ break;
+ case 3:
+ pNewTabPage = CreateFinnishedPage();
+ break;
+
+ }
+ AddPage( pNewTabPage );
+ }
+}
+
+
+MyWizardDlg-Prev/Next-Handler
+-----------------------------
+
+IMPL_LINK( MyWizardDlg, ImplPrevHdl, PushButton*, pBtn )
+{
+ ShowPrevPage();
+ if ( !GetCurLevel() )
+ pBtn->Disable();
+ return 0;
+}
+
+IMPL_LINK( MyWizardDlg, ImplNextHdl, PushButton*, pBtn )
+{
+ ShowNextPage();
+ if ( GetCurLevel() < 3 )
+ pBtn->Disable();
+ return 0;
+}
+
+*************************************************************************/
+
+// ----------------------
+// - WizardDialog-Types -
+// ----------------------
+
+#define WIZARDDIALOG_BUTTON_STDOFFSET_X 6
+#define WIZARDDIALOG_BUTTON_SMALLSTDOFFSET_X 3
+#define WIZARDDIALOG_BUTTON_STDOFFSETLEFT_X -10
+
+// ----------------
+// - WizardDialog -
+// ----------------
+
+class SVT_DLLPUBLIC WizardDialog : public ModalDialog
+{
+private:
+ Size maPageSize;
+ ImplWizPageData* mpFirstPage;
+ ImplWizButtonData* mpFirstBtn;
+ FixedLine* mpFixedLine;
+ TabPage* mpCurTabPage;
+ PushButton* mpPrevBtn;
+ PushButton* mpNextBtn;
+ Window* mpViewWindow;
+ USHORT mnCurLevel;
+ WindowAlign meViewAlign;
+ Link maActivateHdl;
+ Link maDeactivateHdl;
+ sal_Int16 mnLeftAlignCount;
+ bool mbEmptyViewMargin;
+
+protected:
+ long LogicalCoordinateToPixel(int iCoordinate);
+ /**sets the number of buttons which should be left-aligned. Normally, buttons are right-aligned.
+
+ only to be used during construction, before any layouting happened
+ */
+ void SetLeftAlignedButtonCount( sal_Int16 _nCount );
+ /** declares the view area to have an empty margin
+
+ Normally, the view area has a certain margin to the top/left/bottom/right of the
+ dialog. By calling this method, you can reduce this margin to 0.
+ */
+ void SetEmptyViewMargin();
+
+#ifdef _SVT_WIZDLG_CXX
+private:
+ SVT_DLLPRIVATE void ImplInitData();
+ SVT_DLLPRIVATE void ImplCalcSize( Size& rSize );
+ SVT_DLLPRIVATE void ImplPosCtrls();
+ SVT_DLLPRIVATE void ImplPosTabPage();
+ SVT_DLLPRIVATE void ImplShowTabPage( TabPage* pPage );
+ SVT_DLLPRIVATE TabPage* ImplGetPage( USHORT nLevel ) const;
+#endif
+
+public:
+ WizardDialog( Window* pParent, WinBits nStyle = WB_STDTABDIALOG );
+ WizardDialog( Window* pParent, const ResId& rResId );
+ ~WizardDialog();
+
+ virtual void Resize();
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual long Notify( NotifyEvent& rNEvt );
+
+ virtual void ActivatePage();
+ virtual long DeactivatePage();
+
+ BOOL ShowPrevPage();
+ BOOL ShowNextPage();
+ BOOL ShowPage( USHORT nLevel );
+ BOOL Finnish( long nResult = 0 );
+ USHORT GetCurLevel() const { return mnCurLevel; }
+
+ void AddPage( TabPage* pPage );
+ void RemovePage( TabPage* pPage );
+ void SetPage( USHORT nLevel, TabPage* pPage );
+ TabPage* GetPage( USHORT nLevel ) const;
+
+ void AddButton( Button* pButton, long nOffset = 0 );
+ void RemoveButton( Button* pButton );
+
+ void SetPrevButton( PushButton* pButton ) { mpPrevBtn = pButton; }
+ PushButton* GetPrevButton() const { return mpPrevBtn; }
+ void SetNextButton( PushButton* pButton ) { mpNextBtn = pButton; }
+ PushButton* GetNextButton() const { return mpNextBtn; }
+
+ void ShowButtonFixedLine( BOOL bVisible );
+ BOOL IsButtonFixedLineVisible();
+
+ void SetViewWindow( Window* pWindow ) { mpViewWindow = pWindow; }
+ Window* GetViewWindow() const { return mpViewWindow; }
+ void SetViewAlign( WindowAlign eAlign ) { meViewAlign = eAlign; }
+ WindowAlign GetViewAlign() const { return meViewAlign; }
+
+ void SetPageSizePixel( const Size& rSize ) { maPageSize = rSize; }
+ const Size& GetPageSizePixel() const { return maPageSize; }
+
+ void SetActivatePageHdl( const Link& rLink ) { maActivateHdl = rLink; }
+ const Link& GetActivatePageHdl() const { return maActivateHdl; }
+ void SetDeactivatePageHdl( const Link& rLink ) { maDeactivateHdl = rLink; }
+ const Link& GetDeactivatePageHdl() const { return maDeactivateHdl; }
+};
+
+#endif // _SVT_WIZDLG_HXX
diff --git a/svtools/inc/svtools/wmf.hxx b/svtools/inc/svtools/wmf.hxx
new file mode 100644
index 000000000000..a41b6180747b
--- /dev/null
+++ b/svtools/inc/svtools/wmf.hxx
@@ -0,0 +1,46 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _WMF_HXX
+#define _WMF_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/fltcall.hxx>
+
+BOOL ConvertWMFToGDIMetaFile( SvStream & rStreamWMF, GDIMetaFile & rGDIMetaFile, FilterConfigItem* pConfigItem = NULL );
+
+SVT_DLLPUBLIC BOOL ReadWindowMetafile( SvStream& rStream, GDIMetaFile& rMTF, FilterConfigItem* pConfigItem );
+
+SVT_DLLPUBLIC BOOL ConvertGDIMetaFileToWMF( const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pConfigItem = NULL, BOOL bPlaceable = TRUE );
+
+BOOL ConvertGDIMetaFileToEMF( const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pConfigItem = NULL );
+
+SVT_DLLPUBLIC BOOL WriteWindowMetafile( SvStream& rStream, const GDIMetaFile& rMTF );
+
+SVT_DLLPUBLIC BOOL WriteWindowMetafileBits( SvStream& rStream, const GDIMetaFile& rMTF );
+
+#endif
diff --git a/svtools/inc/svtools/xtextedt.hxx b/svtools/inc/svtools/xtextedt.hxx
new file mode 100644
index 000000000000..46c6441e005e
--- /dev/null
+++ b/svtools/inc/svtools/xtextedt.hxx
@@ -0,0 +1,79 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+#ifndef _XTEXTEDT_HXX
+#define _XTEXTEDT_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/texteng.hxx>
+#include <svtools/textview.hxx>
+
+#define XTEXTUNDO_REPLACEALL (XTEXTUNDO_START+1)
+#define XTEXTUNDO_INDENTBLOCK 122
+#define XTEXTUNDO_UNINDENTBLOCK 123
+
+namespace com {
+namespace sun {
+namespace star {
+namespace util {
+ struct SearchOptions;
+}}}}
+
+class SVT_DLLPUBLIC ExtTextEngine : public TextEngine
+{
+private:
+ String maGroupChars;
+
+public:
+ ExtTextEngine();
+ ~ExtTextEngine();
+
+ const String& GetGroupChars() const { return maGroupChars; }
+ void SetGroupChars( const String& r ) { maGroupChars = r; }
+ TextSelection MatchGroup( const TextPaM& rCursor ) const;
+
+ BOOL Search( TextSelection& rSel, const ::com::sun::star::util::SearchOptions& rSearchOptions, BOOL bForward = TRUE );
+};
+
+class SVT_DLLPUBLIC ExtTextView : public TextView
+{
+protected:
+ BOOL ImpIndentBlock( BOOL bRight );
+
+public:
+ ExtTextView( ExtTextEngine* pEng, Window* pWindow );
+ ~ExtTextView();
+
+ BOOL MatchGroup();
+
+ BOOL Search( const ::com::sun::star::util::SearchOptions& rSearchOptions, BOOL bForward );
+ USHORT Replace( const ::com::sun::star::util::SearchOptions& rSearchOptions, BOOL bAll, BOOL bForward );
+
+ BOOL IndentBlock();
+ BOOL UnindentBlock();
+};
+
+#endif // _XTEXTEDT_HXX
diff --git a/svtools/inc/svtools/xwindowitem.hxx b/svtools/inc/svtools/xwindowitem.hxx
new file mode 100755
index 000000000000..eca425cf1369
--- /dev/null
+++ b/svtools/inc/svtools/xwindowitem.hxx
@@ -0,0 +1,70 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: chrtitem.hxx,v $
+ * $Revision: 1.9 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+#ifndef _XWINDOWITEM_HXX_
+#define _XWINDOWITEM_HXX_
+
+
+#include "svtools/svtdllapi.h"
+
+#include <svl/poolitem.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
+
+#include <com/sun/star/awt/XWindow.hpp>
+
+class Window;
+
+//////////////////////////////////////////////////////////////////////
+
+class SVT_DLLPUBLIC XWindowItem : public SfxPoolItem
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xWin;
+
+ // disallow use assignment operator
+ XWindowItem & operator = ( const XWindowItem & );
+
+public:
+ TYPEINFO();
+ XWindowItem();
+ explicit XWindowItem( USHORT nWhich, Window * pWin );
+ XWindowItem( USHORT nWhich, com::sun::star::uno::Reference< com::sun::star::awt::XWindow > & rxWin );
+ XWindowItem( const XWindowItem &rItem );
+ ~XWindowItem();
+
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual int operator == ( const SfxPoolItem& rAttr ) const;
+
+ Window * GetWindowPtr() const { return VCLUnoHelper::GetWindow( m_xWin ); }
+ com::sun::star::uno::Reference< com::sun::star::awt::XWindow > GetXWindow() const { return m_xWin; }
+};
+
+//////////////////////////////////////////////////////////////////////
+
+#endif
+