summaryrefslogtreecommitdiffstats
path: root/include/svtools/svtabbx.hxx
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2013-04-18 18:26:28 +0200
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2013-04-23 22:20:31 +0200
commitb9337e22ce1dbf2eba0e8c8db294ae99f4111f91 (patch)
tree53ee1bd3dfd213815a21579151983cb997922b05 /include/svtools/svtabbx.hxx
parentmove global headers script (diff)
downloadcore-b9337e22ce1dbf2eba0e8c8db294ae99f4111f91.tar.gz
core-b9337e22ce1dbf2eba0e8c8db294ae99f4111f91.zip
execute move of global headers
see https://gerrit.libreoffice.org/#/c/3367/ and Change-Id: I00c96fa77d04b33a6f8c8cd3490dfcd9bdc9e84a for details Change-Id: I199a75bc4042af20817265d5ef85b1134a96ff5a
Diffstat (limited to 'include/svtools/svtabbx.hxx')
-rw-r--r--include/svtools/svtabbx.hxx255
1 files changed, 255 insertions, 0 deletions
diff --git a/include/svtools/svtabbx.hxx b/include/svtools/svtabbx.hxx
new file mode 100644
index 000000000000..7bcd0591b2d1
--- /dev/null
+++ b/include/svtools/svtabbx.hxx
@@ -0,0 +1,255 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVTABBX_HXX
+#define _SVTABBX_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/treelistbox.hxx>
+#include <svtools/accessibletableprovider.hxx>
+
+#include <vector>
+
+enum SvTabJustify
+{
+ AdjustRight = SV_LBOXTAB_ADJUST_RIGHT,
+ AdjustLeft = SV_LBOXTAB_ADJUST_LEFT,
+ AdjustCenter = SV_LBOXTAB_ADJUST_CENTER,
+ AdjustNumeric = SV_LBOXTAB_ADJUST_NUMERIC
+};
+
+struct TabListBoxEventData
+{
+ SvTreeListEntry* m_pEntry;
+ sal_uInt16 m_nColumn;
+ String m_sOldText;
+
+ TabListBoxEventData( SvTreeListEntry* pEntry, sal_uInt16 nColumn, const String& rOldText ) :
+ m_pEntry( pEntry ), m_nColumn( nColumn ), m_sOldText( rOldText ) {}
+};
+
+class SVT_DLLPUBLIC SvTabListBox : public SvTreeListBox
+{
+private:
+ SvLBoxTab* pTabList;
+ sal_uInt16 nTabCount;
+ XubString aCurEntry;
+
+protected:
+ SvTreeListEntry* pViewParent;
+
+ static const sal_Unicode* GetToken( const sal_Unicode* pPtr, sal_uInt16& rLen );
+
+ virtual void SetTabs();
+ virtual void InitEntry(SvTreeListEntry*, const OUString&, const Image&, const Image&, SvLBoxButtonKind);
+
+ String GetTabEntryText( sal_uLong nPos, sal_uInt16 nCol ) const;
+ SvTreeListEntry* GetEntryOnPos( sal_uLong _nEntryPos ) const;
+ SvTreeListEntry* GetChildOnPos( SvTreeListEntry* _pParent, sal_uLong _nEntryPos, sal_uLong& _rPos ) const;
+
+public:
+ SvTabListBox( Window* pParent, WinBits = WB_BORDER );
+ SvTabListBox( Window* pParent, const ResId& );
+ ~SvTabListBox();
+ void SetTabs( long* pTabs, MapUnit = MAP_APPFONT );
+ sal_uInt16 TabCount() const { return (sal_uInt16)nTabCount; }
+ using SvTreeListBox::GetTab;
+ long GetTab( sal_uInt16 nTab ) const;
+ void SetTab( sal_uInt16 nTab, long nValue, MapUnit = MAP_APPFONT );
+ long GetLogicTab( sal_uInt16 nTab );
+
+ virtual SvTreeListEntry* InsertEntry( const XubString& rText, SvTreeListEntry* pParent = 0,
+ sal_Bool bChildrenOnDemand = sal_False,
+ sal_uLong nPos=LIST_APPEND, void* pUserData = 0,
+ SvLBoxButtonKind eButtonKind = SvLBoxButtonKind_enabledCheckbox );
+
+ virtual SvTreeListEntry* InsertEntry( const XubString& rText,
+ const Image& rExpandedEntryBmp,
+ const Image& rCollapsedEntryBmp,
+ SvTreeListEntry* pParent = 0,
+ sal_Bool bChildrenOnDemand = sal_False,
+ sal_uLong nPos = LIST_APPEND, void* pUserData = 0,
+ SvLBoxButtonKind eButtonKind = SvLBoxButtonKind_enabledCheckbox );
+
+ virtual SvTreeListEntry* InsertEntryToColumn( const XubString&, sal_uLong nPos = LIST_APPEND,
+ sal_uInt16 nCol = 0xffff, void* pUserData = NULL );
+ virtual SvTreeListEntry* InsertEntryToColumn( const XubString&, SvTreeListEntry* pParent,
+ sal_uLong nPos, sal_uInt16 nCol, void* pUserData = NULL );
+ virtual SvTreeListEntry* InsertEntryToColumn( const XubString&, const Image& rExpandedEntryBmp,
+ const Image& rCollapsedEntryBmp, SvTreeListEntry* pParent = NULL,
+ sal_uLong nPos = LIST_APPEND, sal_uInt16 nCol = 0xffff, void* pUserData = NULL );
+
+ virtual String GetEntryText( SvTreeListEntry* pEntry ) const;
+ String GetEntryText( SvTreeListEntry*, sal_uInt16 nCol ) const;
+ String GetEntryText( sal_uLong nPos, sal_uInt16 nCol = 0xffff ) const;
+ using SvTreeListBox::SetEntryText;
+ void SetEntryText( const XubString&, sal_uLong, sal_uInt16 nCol=0xffff );
+ void SetEntryText(const XubString&,SvTreeListEntry*,sal_uInt16 nCol=0xffff);
+ String GetCellText( sal_uLong nPos, sal_uInt16 nCol ) const;
+ sal_uLong GetEntryPos( const XubString&, sal_uInt16 nCol = 0xffff );
+ sal_uLong GetEntryPos( const SvTreeListEntry* pEntry ) const;
+
+ virtual void Resize();
+ void SetTabJustify( sal_uInt16 nTab, SvTabJustify );
+};
+
+inline long SvTabListBox::GetTab( sal_uInt16 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< css::uno::Reference< css::accessibility::XAccessible > > AccessibleChildren;
+
+ sal_Bool m_bFirstPaint;
+ ::svt::SvHeaderTabListBoxImpl* m_pImpl;
+ ::svt::IAccessibleTabListBox* m_pAccessible;
+ AccessibleChildren m_aAccessibleChildren;
+
+ DECL_DLLPRIVATE_LINK( ScrollHdl_Impl, void* );
+ DECL_DLLPRIVATE_LINK( CreateAccessibleHdl_Impl, void* );
+
+ 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( SvTreeListEntry* pEntry, sal_uInt16 nCol ) const;
+
+ virtual SvTreeListEntry* InsertEntryToColumn( const XubString&, sal_uLong nPos = LIST_APPEND,
+ sal_uInt16 nCol = 0xffff, void* pUserData = NULL );
+ virtual SvTreeListEntry* InsertEntryToColumn( const XubString&, SvTreeListEntry* pParent,
+ sal_uLong nPos, sal_uInt16 nCol, void* pUserData = NULL );
+ virtual SvTreeListEntry* InsertEntryToColumn( const XubString&, const Image& rExpandedEntryBmp,
+ const Image& rCollapsedEntryBmp, SvTreeListEntry* pParent = NULL,
+ sal_uLong nPos = LIST_APPEND, sal_uInt16 nCol = 0xffff, void* pUserData = NULL );
+ virtual sal_uLong Insert( SvTreeListEntry* pEnt,SvTreeListEntry* pPar,sal_uLong nPos=LIST_APPEND);
+ virtual sal_uLong Insert( SvTreeListEntry* pEntry, sal_uLong nRootPos = LIST_APPEND );
+ void RemoveEntry( SvTreeListEntry* _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 OUString GetRowDescription( sal_Int32 _nRow ) const;
+ /** @return The description of a column.
+ @param _nColumn The column which description is in demand. */
+ virtual 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( sal_Bool bSelect, sal_Bool bPaint = sal_True );
+ virtual void SelectRow( long _nRow, sal_Bool _bSelect = sal_True, sal_Bool bExpand = sal_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( css::uno::Sequence< sal_Int32 >& _rRows ) const;
+ virtual void GetAllSelectedColumns( css::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, sal_uInt16 _nColumnPos ) const;
+
+ virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, sal_Bool _bOnScreen = sal_True );
+ virtual Rectangle calcTableRect( sal_Bool _bOnScreen = sal_True );
+ virtual Rectangle GetFieldRectPixelAbs( sal_Int32 _nRow, sal_uInt16 _nColumn, sal_Bool _bIsHeader, sal_Bool _bOnScreen = sal_True );
+
+ virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleCell( sal_Int32 _nRow, sal_uInt16 _nColumn );
+ virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleRowHeader( sal_Int32 _nRow );
+ virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleColumnHeader( sal_uInt16 _nColumnPos );
+
+ virtual sal_Int32 GetAccessibleControlCount() const;
+ virtual css::uno::Reference< css::accessibility::XAccessible > 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 OUString GetAccessibleObjectName( ::svt::AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos = -1 ) const;
+ virtual 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 sal_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 css::uno::Reference< css::accessibility::XAccessible > GetAccessible( sal_Bool bCreate = sal_True );
+ virtual Window* GetAccessibleParentWindow() const;
+
+ /** Creates and returns the accessible object of the whole BrowseBox. */
+ virtual css::uno::Reference< css::accessibility::XAccessible > 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
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */