summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorPhilipp Lohmann <Philipp.Lohmann@Sun.COM>2009-10-09 15:11:54 +0200
committerPhilipp Lohmann <Philipp.Lohmann@Sun.COM>2009-10-09 15:11:54 +0200
commit834e45248a6fa97d8b0246c2ce8666ffd9c3cf6b (patch)
treec1222c6e5899327891b31adc93938b9b49a130ac /toolkit
parent2589f7adbf0066980b8da68355c2d48369465764 (diff)
parent9b9d44ee50a38180c2451ca527bf7b9f6f46f0fe (diff)
merge with m61
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/inc/toolkit/helper/listenermultiplexer.hxx2
-rw-r--r--toolkit/inc/toolkit/helper/property.hxx8
-rw-r--r--toolkit/inc/toolkit/helper/servicenames.hxx6
-rw-r--r--toolkit/inc/toolkit/helper/vclunohelper.hxx16
-rw-r--r--toolkit/prj/build.lst3
-rw-r--r--toolkit/source/awt/makefile.mk1
-rw-r--r--toolkit/source/awt/vclxmenu.cxx2
-rw-r--r--toolkit/source/awt/vclxwindow.cxx76
-rw-r--r--toolkit/source/controls/dialogcontrol.cxx4
-rw-r--r--toolkit/source/controls/grid/defaultgridcolumnmodel.cxx242
-rw-r--r--toolkit/source/controls/grid/defaultgridcolumnmodel.hxx96
-rw-r--r--toolkit/source/controls/grid/defaultgriddatamodel.cxx310
-rw-r--r--toolkit/source/controls/grid/defaultgriddatamodel.hxx99
-rw-r--r--toolkit/source/controls/grid/gridcolumn.cxx166
-rw-r--r--toolkit/source/controls/grid/gridcolumn.hxx85
-rw-r--r--toolkit/source/controls/grid/gridcontrol.cxx273
-rw-r--r--toolkit/source/controls/grid/gridcontrol.hxx124
-rw-r--r--toolkit/source/controls/grid/makefile.mk54
-rw-r--r--toolkit/source/controls/roadmapcontrol.cxx1
-rw-r--r--toolkit/source/helper/property.cxx9
-rw-r--r--toolkit/source/helper/registerservices.cxx17
-rw-r--r--toolkit/source/helper/servicenames.cxx6
-rw-r--r--toolkit/source/helper/unowrapper.cxx8
-rw-r--r--toolkit/source/helper/vclunohelper.cxx55
-rw-r--r--toolkit/util/makefile.mk17
-rw-r--r--toolkit/util/toolkit.xml46
26 files changed, 1637 insertions, 89 deletions
diff --git a/toolkit/inc/toolkit/helper/listenermultiplexer.hxx b/toolkit/inc/toolkit/helper/listenermultiplexer.hxx
index 24a16d5868dd..543c8a85c401 100644
--- a/toolkit/inc/toolkit/helper/listenermultiplexer.hxx
+++ b/toolkit/inc/toolkit/helper/listenermultiplexer.hxx
@@ -129,7 +129,7 @@ DECL_LISTENERMULTIPLEXER_END
// ----------------------------------------------------
// class MouseListenerMultiplexer
// ----------------------------------------------------
-DECL_LISTENERMULTIPLEXER_START( MouseListenerMultiplexer, ::com::sun::star::awt::XMouseListener )
+DECL_LISTENERMULTIPLEXER_START_DLLPUB( MouseListenerMultiplexer, ::com::sun::star::awt::XMouseListener )
void SAL_CALL mousePressed( const ::com::sun::star::awt::MouseEvent& e ) throw(::com::sun::star::uno::RuntimeException);
void SAL_CALL mouseReleased( const ::com::sun::star::awt::MouseEvent& e ) throw(::com::sun::star::uno::RuntimeException);
void SAL_CALL mouseEntered( const ::com::sun::star::awt::MouseEvent& e ) throw(::com::sun::star::uno::RuntimeException);
diff --git a/toolkit/inc/toolkit/helper/property.hxx b/toolkit/inc/toolkit/helper/property.hxx
index f5e1b4ea3770..fbfe90494279 100644
--- a/toolkit/inc/toolkit/helper/property.hxx
+++ b/toolkit/inc/toolkit/helper/property.hxx
@@ -191,7 +191,13 @@ namespace rtl {
#define BASEPROPERTY_IMAGE_SCALE_MODE 137
#define BASEPROPERTY_WRITING_MODE 138
#define BASEPROPERTY_CONTEXT_WRITING_MODE 139
-#define BASEPROPERTY_ENABLEVISIBLE 140 // sal_Bool
+#define BASEPROPERTY_GRID_SHOWROWHEADER 140
+#define BASEPROPERTY_GRID_SHOWCOLUMNHEADER 141
+#define BASEPROPERTY_GRID_DATAMODEL 142
+#define BASEPROPERTY_GRID_COLUMNMODEL 143
+#define BASEPROPERTY_GRID_SELECTIONMODE 144
+#define BASEPROPERTY_ENABLEVISIBLE 145 // sal_Bool
+
// Keine gebundenen Properties, werden immer aus der Property BASEPROPERTY_FONTDESCRIPTOR entnommen.
#define BASEPROPERTY_FONTDESCRIPTORPART_START 1000
diff --git a/toolkit/inc/toolkit/helper/servicenames.hxx b/toolkit/inc/toolkit/helper/servicenames.hxx
index 31513f0f2358..89810ae69482 100644
--- a/toolkit/inc/toolkit/helper/servicenames.hxx
+++ b/toolkit/inc/toolkit/helper/servicenames.hxx
@@ -95,6 +95,12 @@ extern const sal_Char __FAR_DATA szServiceName_TreeControl[];
extern const sal_Char __FAR_DATA szServiceName_TreeControlModel[];
extern const sal_Char __FAR_DATA szServiceName_MutableTreeDataModel[];
+extern const sal_Char __FAR_DATA szServiceName_GridControl[];
+extern const sal_Char __FAR_DATA szServiceName_GridControlModel[];
+extern const sal_Char __FAR_DATA szServiceName_DefaultGridDataModel[];
+extern const sal_Char __FAR_DATA szServiceName_DefaultGridColumnModel[];
+extern const sal_Char __FAR_DATA szServiceName_GridColumn[];
+
extern const sal_Char __FAR_DATA szServiceName_UnoSimpleAnimationControl[], szServiceName_UnoSimpleAnimationControlModel[];
extern const sal_Char __FAR_DATA szServiceName_UnoThrobberControl[], szServiceName_UnoThrobberControlModel[];
extern const sal_Char __FAR_DATA szServiceName_UnoControlFixedHyperlink[], szServiceName_UnoControlFixedHyperlinkModel[];
diff --git a/toolkit/inc/toolkit/helper/vclunohelper.hxx b/toolkit/inc/toolkit/helper/vclunohelper.hxx
index 1c5d89a3cc64..e29b7237abb8 100644
--- a/toolkit/inc/toolkit/helper/vclunohelper.hxx
+++ b/toolkit/inc/toolkit/helper/vclunohelper.hxx
@@ -36,6 +36,7 @@
#include <com/sun/star/uno/Sequence.h>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/awt/MouseEvent.hpp>
namespace com { namespace sun { namespace star { namespace uno {
@@ -59,6 +60,7 @@ namespace com { namespace sun { namespace star { namespace awt {
struct SimpleFontMetric;
struct FontDescriptor;
struct Rectangle;
+ struct KeyEvent;
}}}}
@@ -71,6 +73,8 @@ namespace com { namespace sun { namespace star { namespace awt {
class Window;
class OutputDevice;
+class MouseEvent;
+class KeyEvent;
// ----------------------------------------------------
// class VclUnoHelper
@@ -144,6 +148,18 @@ public:
static ::Rectangle ConvertToVCLRect( ::com::sun::star::awt::Rectangle const & _rRect );
static ::com::sun::star::awt::Rectangle ConvertToAWTRect( ::Rectangle const & _rRect );
+
+ static ::com::sun::star::awt::MouseEvent
+ createMouseEvent(
+ const ::MouseEvent& _rVclEvent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext
+ );
+
+ static ::com::sun::star::awt::KeyEvent
+ createKeyEvent(
+ const ::KeyEvent& _rVclEvent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext
+ );
};
diff --git a/toolkit/prj/build.lst b/toolkit/prj/build.lst
index 7fa0efaded53..304d0e7c978f 100644
--- a/toolkit/prj/build.lst
+++ b/toolkit/prj/build.lst
@@ -7,6 +7,7 @@ ti toolkit\source\helper nmake - all ti_helper ti_inc NULL
ti toolkit\source\awt nmake - all ti_awt ti_inc NULL
ti toolkit\source\controls nmake - all ti_controls ti_inc NULL
ti toolkit\source\controls\tree nmake - all ti_tree NULL
+ti toolkit\source\controls\grid nmake - all ti_grid NULL
ti toolkit\source\layout\core nmake - all ti_layout_core NULL
ti toolkit\source\layout\vcl nmake - all ti_layout_vcl NULL
-ti toolkit\util nmake - all ti_util ti_awt ti_controls ti_layout_core ti_helper ti_tree ti_layout_vcl NULL
+ti toolkit\util nmake - all ti_util ti_awt ti_controls ti_layout_core ti_helper ti_tree ti_grid ti_layout_vcl NULL
diff --git a/toolkit/source/awt/makefile.mk b/toolkit/source/awt/makefile.mk
index 86953691ad27..406386c5723e 100644
--- a/toolkit/source/awt/makefile.mk
+++ b/toolkit/source/awt/makefile.mk
@@ -44,7 +44,6 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
.IF "$(GUIBASE)"=="aqua"
-OBJCXXFLAGS=-x objective-c++ -fobjc-exceptions
CFLAGSCXX+=$(OBJCXXFLAGS)
.ENDIF # "$(GUIBASE)"=="aqua"
diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx
index c8e5e1bd3853..5200849d66ed 100644
--- a/toolkit/source/awt/vclxmenu.cxx
+++ b/toolkit/source/awt/vclxmenu.cxx
@@ -578,7 +578,7 @@ sal_Int16 VCLXMenu::execute( const ::com::sun::star::uno::Reference< ::com::sun:
sal_Int16 nRet = 0;
if ( mpMenu && IsPopupMenu() )
- nRet = ((PopupMenu*)mpMenu)->Execute( VCLUnoHelper::GetWindow( rxWindowPeer ), VCLRectangle(rArea), nFlags );
+ nRet = ((PopupMenu*)mpMenu)->Execute( VCLUnoHelper::GetWindow( rxWindowPeer ), VCLRectangle(rArea), nFlags | POPUPMENU_NOMOUSEUPCLOSE );
return nRet;
}
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index 337400c08713..a8c0912a583e 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -554,48 +554,6 @@ void ImplInitWindowEvent( ::com::sun::star::awt::WindowEvent& rEvent, Window* pW
pWindow->GetBorder( rEvent.LeftInset, rEvent.TopInset, rEvent.RightInset, rEvent.BottomInset );
}
-void ImplInitKeyEvent( ::com::sun::star::awt::KeyEvent& rEvent, const KeyEvent& rEvt )
-{
- rEvent.Modifiers = 0;
- if ( rEvt.GetKeyCode().IsShift() )
- rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::SHIFT;
- if ( rEvt.GetKeyCode().IsMod1() )
- rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD1;
- if ( rEvt.GetKeyCode().IsMod2() )
- rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD2;
- if ( rEvt.GetKeyCode().IsMod3() )
- rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD3;
-
- rEvent.KeyCode = rEvt.GetKeyCode().GetCode();
- rEvent.KeyChar = rEvt.GetCharCode();
- rEvent.KeyFunc = sal::static_int_cast< sal_Int16 >(
- rEvt.GetKeyCode().GetFunction());
-}
-
-void ImplInitMouseEvent( awt::MouseEvent& rEvent, const MouseEvent& rEvt )
-{
- rEvent.Modifiers = 0;
- if ( rEvt.IsShift() )
- rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::SHIFT;
- if ( rEvt.IsMod1() )
- rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD1;
- if ( rEvt.IsMod2() )
- rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD2;
-
- rEvent.Buttons = 0;
- if ( rEvt.IsLeft() )
- rEvent.Buttons |= ::com::sun::star::awt::MouseButton::LEFT;
- if ( rEvt.IsRight() )
- rEvent.Buttons |= ::com::sun::star::awt::MouseButton::RIGHT;
- if ( rEvt.IsMiddle() )
- rEvent.Buttons |= ::com::sun::star::awt::MouseButton::MIDDLE;
-
- rEvent.X = rEvt.GetPosPixel().X();
- rEvent.Y = rEvt.GetPosPixel().Y();
- rEvent.ClickCount = rEvt.GetClicks();
- rEvent.PopupTrigger = sal_False;
-}
-
// ----------------------------------------------------
// class VCLXWindow
// ----------------------------------------------------
@@ -890,9 +848,9 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
{
if ( mpImpl->getKeyListeners().getLength() )
{
- ::com::sun::star::awt::KeyEvent aEvent;
- aEvent.Source = (::cppu::OWeakObject*)this;
- ImplInitKeyEvent( aEvent, *(KeyEvent*)rVclWindowEvent.GetData() );
+ ::com::sun::star::awt::KeyEvent aEvent( VCLUnoHelper::createKeyEvent(
+ *(KeyEvent*)rVclWindowEvent.GetData(), *this
+ ) );
mpImpl->getKeyListeners().keyPressed( aEvent );
}
}
@@ -901,9 +859,9 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
{
if ( mpImpl->getKeyListeners().getLength() )
{
- ::com::sun::star::awt::KeyEvent aEvent;
- aEvent.Source = (::cppu::OWeakObject*)this;
- ImplInitKeyEvent( aEvent, *(KeyEvent*)rVclWindowEvent.GetData() );
+ ::com::sun::star::awt::KeyEvent aEvent( VCLUnoHelper::createKeyEvent(
+ *(KeyEvent*)rVclWindowEvent.GetData(), *this
+ ) );
mpImpl->getKeyListeners().keyReleased( aEvent );
}
}
@@ -925,9 +883,7 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
}
MouseEvent aMEvt( aWhere, 1, MOUSE_SIMPLECLICK, MOUSE_LEFT, 0 );
- awt::MouseEvent aEvent;
- aEvent.Source = (::cppu::OWeakObject*)this;
- ImplInitMouseEvent( aEvent, aMEvt );
+ awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( aMEvt, *this ) );
aEvent.PopupTrigger = sal_True;
mpImpl->notifyMouseEvent( aEvent, EVENT_MOUSE_PRESSED );
}
@@ -938,10 +894,7 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
MouseEvent* pMouseEvt = (MouseEvent*)rVclWindowEvent.GetData();
if ( mpImpl->getMouseListeners().getLength() && ( pMouseEvt->IsEnterWindow() || pMouseEvt->IsLeaveWindow() ) )
{
- awt::MouseEvent aEvent;
- aEvent.Source = (::cppu::OWeakObject*)this;
- ImplInitMouseEvent( aEvent, *pMouseEvt );
-
+ awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( *pMouseEvt, *this ) );
mpImpl->notifyMouseEvent(
aEvent,
pMouseEvt->IsEnterWindow() ? EVENT_MOUSE_ENTERED : EVENT_MOUSE_EXITED
@@ -950,11 +903,8 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
if ( mpImpl->getMouseMotionListeners().getLength() && !pMouseEvt->IsEnterWindow() && !pMouseEvt->IsLeaveWindow() )
{
- awt::MouseEvent aEvent;
- aEvent.Source = (::cppu::OWeakObject*)this;
- ImplInitMouseEvent( aEvent, *pMouseEvt );
+ awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( *pMouseEvt, *this ) );
aEvent.ClickCount = 0; // #92138#
-
if ( pMouseEvt->GetMode() & MOUSE_SIMPLEMOVE )
mpImpl->getMouseMotionListeners().mouseMoved( aEvent );
else
@@ -966,9 +916,7 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
{
if ( mpImpl->getMouseListeners().getLength() )
{
- awt::MouseEvent aEvent;
- aEvent.Source = (::cppu::OWeakObject*)this;
- ImplInitMouseEvent( aEvent, *(MouseEvent*)rVclWindowEvent.GetData() );
+ awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( *(MouseEvent*)rVclWindowEvent.GetData(), *this ) );
mpImpl->notifyMouseEvent( aEvent, EVENT_MOUSE_PRESSED );
}
}
@@ -977,9 +925,7 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
{
if ( mpImpl->getMouseListeners().getLength() )
{
- awt::MouseEvent aEvent;
- aEvent.Source = (::cppu::OWeakObject*)this;
- ImplInitMouseEvent( aEvent, *(MouseEvent*)rVclWindowEvent.GetData() );
+ awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( *(MouseEvent*)rVclWindowEvent.GetData(), *this ) );
mpImpl->notifyMouseEvent( aEvent, EVENT_MOUSE_RELEASED );
}
}
diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx
index 47028cc8e071..07d459a6111a 100644
--- a/toolkit/source/controls/dialogcontrol.cxx
+++ b/toolkit/source/controls/dialogcontrol.cxx
@@ -66,6 +66,7 @@
#include <vcl/image.hxx>
#include "tree/treecontrol.hxx"
+#include "grid/gridcontrol.hxx"
#include <map>
#include <algorithm>
@@ -453,6 +454,8 @@ Reference< XInterface > UnoControlDialogModel::createInstance( const ::rtl::OUSt
pNewModel = new OGeometryControlModel< UnoControlRoadmapModel >;
else if ( aServiceSpecifier.compareToAscii( szServiceName_TreeControlModel ) == 0 )
pNewModel = new OGeometryControlModel< UnoTreeModel >;
+ else if ( aServiceSpecifier.compareToAscii( szServiceName_GridControlModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoGridModel >;
if ( !pNewModel )
{
@@ -515,6 +518,7 @@ Sequence< ::rtl::OUString > UnoControlDialogModel::getAvailableServiceNames() th
pNames[18] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlFixedLineModel );
pNames[19] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlRoadmapModel );
pNames[20] = ::rtl::OUString::createFromAscii( szServiceName_TreeControlModel );
+ pNames[20] = ::rtl::OUString::createFromAscii( szServiceName_GridControlModel );
}
return *pNamesSeq;
diff --git a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
new file mode 100644
index 000000000000..bdd7fb475afe
--- /dev/null
+++ b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
@@ -0,0 +1,242 @@
+/*************************************************************************
+ *
+ * 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: treedatamodel.cxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_toolkit.hxx"
+#include "defaultgridcolumnmodel.hxx"
+#include <comphelper/sequence.hxx>
+#include <toolkit/helper/servicenames.hxx>
+#include <rtl/ref.hxx>
+
+using ::rtl::OUString;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::awt::grid;
+using namespace ::com::sun::star::lang;
+
+#define COLUMNSELECTIONALLOWED ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ColumnSelectionAllowed" ))
+
+namespace toolkit
+{
+
+///////////////////////////////////////////////////////////////////////
+// class DefaultGridColumnModel
+///////////////////////////////////////////////////////////////////////
+
+DefaultGridColumnModel::DefaultGridColumnModel()
+: columns(std::vector< Reference< XGridColumn > >())
+{
+}
+
+//---------------------------------------------------------------------
+
+DefaultGridColumnModel::~DefaultGridColumnModel()
+{
+}
+
+//---------------------------------------------------------------------
+
+void DefaultGridColumnModel::broadcast( broadcast_type eType, const GridColumnEvent& aEvent )
+{
+ ::cppu::OInterfaceContainerHelper* pIter = BrdcstHelper.getContainer( XGridColumnListener::static_type() );
+ if( pIter )
+ {
+ ::cppu::OInterfaceIteratorHelper aListIter(*pIter);
+ while(aListIter.hasMoreElements())
+ {
+ XGridColumnListener* pListener = static_cast<XGridColumnListener*>(aListIter.next());
+ switch( eType )
+ {
+ case column_added: pListener->columnAdded(aEvent); break;
+ case column_removed: pListener->columnRemoved(aEvent); break;
+ case column_changed: pListener->columnChanged(aEvent); break;
+ }
+ }
+ }
+}
+
+//---------------------------------------------------------------------
+
+void DefaultGridColumnModel::broadcast_changed( ::rtl::OUString name, Any oldValue, Any newValue )
+{
+ Reference< XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
+ GridColumnEvent aEvent( xSource, name, oldValue, newValue, 0, NULL );
+ broadcast( column_changed, aEvent);
+}
+
+//---------------------------------------------------------------------
+
+void DefaultGridColumnModel::broadcast_add( sal_Int32 index, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > & rColumn )
+{
+ Reference< XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
+ GridColumnEvent aEvent( xSource, ::rtl::OUString(), Any(), Any(), index, rColumn );
+ broadcast( column_added, aEvent);
+}
+
+//---------------------------------------------------------------------
+
+void DefaultGridColumnModel::broadcast_remove( sal_Int32 index, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > & rColumn )
+{
+ Reference< XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
+ GridColumnEvent aEvent( xSource, ::rtl::OUString(), Any(), Any(), index, rColumn );
+ broadcast( column_changed, aEvent);
+}
+
+//---------------------------------------------------------------------
+// XDefaultGridColumnModel
+//---------------------------------------------------------------------
+::sal_Bool SAL_CALL DefaultGridColumnModel::getColumnSelectionAllowed() throw (::com::sun::star::uno::RuntimeException)
+{
+ return selectionAllowed;
+}
+
+//---------------------------------------------------------------------
+
+void SAL_CALL DefaultGridColumnModel::setColumnSelectionAllowed(::sal_Bool value) throw (::com::sun::star::uno::RuntimeException)
+{
+ sal_Bool oldValue = selectionAllowed;
+ selectionAllowed = value;
+ broadcast_changed( COLUMNSELECTIONALLOWED, Any(oldValue) , Any(selectionAllowed));
+}
+
+//---------------------------------------------------------------------
+
+::sal_Int32 SAL_CALL DefaultGridColumnModel::getColumnCount() throw (::com::sun::star::uno::RuntimeException)
+{
+ return columns.size();
+}
+
+//---------------------------------------------------------------------
+
+::sal_Int32 SAL_CALL DefaultGridColumnModel::addColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > & column) throw (::com::sun::star::uno::RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+
+ columns.push_back(column);
+
+ sal_Int32 index = columns.size() - 1;
+ broadcast_add(index, column );
+ return index;
+}
+
+//---------------------------------------------------------------------
+
+::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > > SAL_CALL DefaultGridColumnModel::getColumns() throw (::com::sun::star::uno::RuntimeException)
+{
+ return comphelper::containerToSequence(columns);
+}
+
+//---------------------------------------------------------------------
+
+::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > SAL_CALL DefaultGridColumnModel::getColumn(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException)
+{
+ if ( index >=0 && index < ((sal_Int32)columns.size()))
+ return columns[index];
+ else
+ return Reference< XGridColumn >();
+}
+
+void SAL_CALL DefaultGridColumnModel::addColumnListener( const Reference< XGridColumnListener >& xListener ) throw (RuntimeException)
+{
+ BrdcstHelper.addListener( XGridColumnListener::static_type(), xListener );
+}
+
+//---------------------------------------------------------------------
+
+void SAL_CALL DefaultGridColumnModel::removeColumnListener( const Reference< XGridColumnListener >& xListener ) throw (RuntimeException)
+{
+ BrdcstHelper.removeListener( XGridColumnListener::static_type(), xListener );
+}
+
+//---------------------------------------------------------------------
+// XComponent
+//---------------------------------------------------------------------
+
+void SAL_CALL DefaultGridColumnModel::dispose() throw (RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+
+ ::com::sun::star::lang::EventObject aEvent;
+ aEvent.Source.set( static_cast< ::cppu::OWeakObject* >( this ) );
+ BrdcstHelper.aLC.disposeAndClear( aEvent );
+
+}
+
+//---------------------------------------------------------------------
+
+void SAL_CALL DefaultGridColumnModel::addEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException)
+{
+ BrdcstHelper.addListener( XEventListener::static_type(), xListener );
+}
+
+//---------------------------------------------------------------------
+
+void SAL_CALL DefaultGridColumnModel::removeEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException)
+{
+ BrdcstHelper.removeListener( XEventListener::static_type(), xListener );
+}
+
+//---------------------------------------------------------------------
+// XServiceInfo
+//---------------------------------------------------------------------
+
+::rtl::OUString SAL_CALL DefaultGridColumnModel::getImplementationName( ) throw (RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ static const OUString aImplName( RTL_CONSTASCII_USTRINGPARAM( "toolkit.DefaultGridColumnModel" ) );
+ return aImplName;
+}
+
+//---------------------------------------------------------------------
+
+sal_Bool SAL_CALL DefaultGridColumnModel::supportsService( const ::rtl::OUString& ServiceName ) throw (RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ return ServiceName.equalsAscii( szServiceName_DefaultGridColumnModel );
+}
+
+//---------------------------------------------------------------------
+
+::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL DefaultGridColumnModel::getSupportedServiceNames( ) throw (RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ static const OUString aServiceName( OUString::createFromAscii( szServiceName_DefaultGridColumnModel ) );
+ static const Sequence< OUString > aSeq( &aServiceName, 1 );
+ return aSeq;
+}
+
+}
+
+Reference< XInterface > SAL_CALL DefaultGridColumnModel_CreateInstance( const Reference< XMultiServiceFactory >& )
+{
+ return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::DefaultGridColumnModel );
+}
+
diff --git a/toolkit/source/controls/grid/defaultgridcolumnmodel.hxx b/toolkit/source/controls/grid/defaultgridcolumnmodel.hxx
new file mode 100644
index 000000000000..b230188f9107
--- /dev/null
+++ b/toolkit/source/controls/grid/defaultgridcolumnmodel.hxx
@@ -0,0 +1,96 @@
+/*************************************************************************
+ *
+ * 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: griddatamodel.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_toolkit.hxx"
+#include <com/sun/star/awt/grid/XGridColumnModel.hpp>
+#include <com/sun/star/awt/grid/XGridColumn.hpp>
+#include <com/sun/star/awt/grid/GridColumnEvent.hpp>
+#include <com/sun/star/lang/XEventListener.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/implbase3.hxx>
+#include <rtl/ref.hxx>
+#include <vector>
+#include <toolkit/helper/mutexandbroadcasthelper.hxx>
+
+using ::rtl::OUString;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::awt::grid;
+using namespace ::com::sun::star::lang;
+
+namespace toolkit
+{
+
+enum broadcast_type { column_added, column_removed, column_changed};
+
+class DefaultGridColumnModel : public ::cppu::WeakImplHelper2< XGridColumnModel, XServiceInfo >,
+ public MutexAndBroadcastHelper
+{
+public:
+ DefaultGridColumnModel();
+ virtual ~DefaultGridColumnModel();
+
+ // XGridColumnModel
+
+ virtual ::sal_Bool SAL_CALL getColumnSelectionAllowed() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setColumnSelectionAllowed(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getColumnCount() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL addColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > & column) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > > SAL_CALL getColumns() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > SAL_CALL getColumn(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addColumnListener( const Reference< XGridColumnListener >& xListener ) throw (RuntimeException);
+ virtual void SAL_CALL removeColumnListener( const Reference< XGridColumnListener >& xListener ) throw (RuntimeException);
+
+ // XComponent
+ virtual void SAL_CALL dispose( ) throw (RuntimeException);
+ virtual void SAL_CALL addEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException);
+ virtual void SAL_CALL removeEventListener( const Reference< XEventListener >& aListener ) throw (RuntimeException);
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (RuntimeException);
+ virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (RuntimeException);
+
+private:
+
+ void broadcast( broadcast_type eType, const GridColumnEvent& aEvent );
+ void broadcast_changed( ::rtl::OUString name, Any oldValue, Any newValue );
+ void broadcast_add( sal_Int32 index,const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > & rColumn );
+ void broadcast_remove( sal_Int32 index, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > & rColumn );
+
+ std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > > columns;
+ sal_Bool selectionAllowed;
+};
+
+}
diff --git a/toolkit/source/controls/grid/defaultgriddatamodel.cxx b/toolkit/source/controls/grid/defaultgriddatamodel.cxx
new file mode 100644
index 000000000000..865be80f55a7
--- /dev/null
+++ b/toolkit/source/controls/grid/defaultgriddatamodel.cxx
@@ -0,0 +1,310 @@
+/*************************************************************************
+ *
+ * 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: treedatamodel.cxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_toolkit.hxx"
+#include "defaultgriddatamodel.hxx"
+#include <comphelper/sequence.hxx>
+#include <toolkit/helper/servicenames.hxx>
+#include <rtl/ref.hxx>
+
+using ::rtl::OUString;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::awt::grid;
+using namespace ::com::sun::star::lang;
+
+#define ROWHEIGHT ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "RowHeight" ))
+#define ROWHEADERS ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "RowHeaders" ))
+
+namespace toolkit
+{
+
+///////////////////////////////////////////////////////////////////////
+// class DefaultGridDataModel
+///////////////////////////////////////////////////////////////////////
+
+DefaultGridDataModel::DefaultGridDataModel()
+: rowHeight(0),
+ rowHeaders(std::vector< ::rtl::OUString >())
+{
+}
+
+//---------------------------------------------------------------------
+
+DefaultGridDataModel::~DefaultGridDataModel()
+{
+}
+
+void DefaultGridDataModel::broadcast( broadcast_type eType, const GridDataEvent& aEvent )
+{
+ ::cppu::OInterfaceContainerHelper* pIter = BrdcstHelper.getContainer( XGridDataListener::static_type() );
+ if( pIter )
+ {
+ ::cppu::OInterfaceIteratorHelper aListIter(*pIter);
+ while(aListIter.hasMoreElements())
+ {
+ XGridDataListener* pListener = static_cast<XGridDataListener*>(aListIter.next());
+ switch( eType )
+ {
+ case row_added: pListener->rowAdded(aEvent); break;
+ case row_removed: pListener->rowRemoved(aEvent); break;
+ case data_changed: pListener->dataChanged(aEvent); break;
+ }
+ }
+ }
+}
+
+//---------------------------------------------------------------------
+
+void DefaultGridDataModel::broadcast_changed( ::rtl::OUString name, Any oldValue, Any newValue )
+{
+ Reference< XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
+ GridDataEvent aEvent( xSource, name, oldValue, newValue, 0, ::rtl::OUString(), Sequence< ::rtl::OUString>() );
+ broadcast( data_changed, aEvent);
+}
+
+//---------------------------------------------------------------------
+
+void DefaultGridDataModel::broadcast_add( sal_Int32 index, const ::rtl::OUString & headerName, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rowData )
+{
+ Reference< XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
+ GridDataEvent aEvent( xSource, ::rtl::OUString(), Any(), Any(), index, headerName, rowData );
+ broadcast( row_added, aEvent);
+}
+
+//---------------------------------------------------------------------
+
+void DefaultGridDataModel::broadcast_remove( sal_Int32 index, const ::rtl::OUString & headerName, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rowData )
+{
+ Reference< XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
+ GridDataEvent aEvent( xSource, ::rtl::OUString(), Any(), Any(), index, headerName, rowData );
+ broadcast( row_removed, aEvent);
+}
+
+//---------------------------------------------------------------------
+
+//---------------------------------------------------------------------
+// XDefaultGridDataModel
+//---------------------------------------------------------------------
+::sal_Int32 SAL_CALL DefaultGridDataModel::getRowHeight() throw (::com::sun::star::uno::RuntimeException)
+{
+ return rowHeight;
+}
+
+//---------------------------------------------------------------------
+
+void SAL_CALL DefaultGridDataModel::setRowHeight(::sal_Int32 value) throw (::com::sun::star::uno::RuntimeException)
+{
+ sal_Int32 oldValue = rowHeight;
+ rowHeight = value;
+
+ broadcast_changed( ROWHEIGHT, Any(oldValue), Any(value) );
+}
+
+//---------------------------------------------------------------------
+
+::sal_Int32 SAL_CALL DefaultGridDataModel::getRowCount() throw (::com::sun::star::uno::RuntimeException)
+{
+ return data.size();
+}
+
+//---------------------------------------------------------------------
+
+::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL DefaultGridDataModel::getRowHeaders() throw (::com::sun::star::uno::RuntimeException)
+{
+ return comphelper::containerToSequence(rowHeaders);
+}
+
+//---------------------------------------------------------------------
+
+void SAL_CALL DefaultGridDataModel::setRowHeaders(const ::com::sun::star::uno::Sequence< ::rtl::OUString > & value) throw (::com::sun::star::uno::RuntimeException)
+{
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > oldValue( comphelper::containerToSequence(rowHeaders) );
+
+ std::vector< rtl::OUString>::iterator iterator;
+ int i = 0;
+ int sequenceSize = value.getLength();
+
+ for(iterator = rowHeaders.begin(); iterator != rowHeaders.end(); iterator++)
+ {
+ if ( sequenceSize > i )
+ *iterator = value[i];
+ else
+ *iterator = ::rtl::OUString();
+ i++;
+ }
+
+ broadcast_changed( ROWHEADERS, Any(oldValue), Any(comphelper::containerToSequence(rowHeaders)) );
+}
+
+//---------------------------------------------------------------------
+
+void SAL_CALL DefaultGridDataModel::addRow(const ::rtl::OUString & headername, const ::com::sun::star::uno::Sequence< ::rtl::OUString > & rRowdata) throw (::com::sun::star::uno::RuntimeException)
+{
+ // store header name
+ rowHeaders.push_back(headername);
+
+
+ // store row data
+ std::vector< rtl::OUString > newRow(
+ comphelper::sequenceToContainer< std::vector<rtl::OUString > >(rRowdata));
+
+ data.push_back( newRow );
+
+ broadcast_add( data.size()-1, headername, rRowdata);
+
+}
+
+//---------------------------------------------------------------------
+
+void SAL_CALL DefaultGridDataModel::removeRow(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException)
+{
+ if ( index >= 0 && index <= getRowCount()-1)
+ {
+ /* if(Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->isSelectedIndex( index ))
+ {
+ ::com::sun::star::uno::Sequence<::sal_Int32> selectedRows = Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->getSelection();
+ selectedRow.erase(selectedRows.begin()+index);
+ }*/
+
+ ::rtl::OUString headerName( (::rtl::OUString) rowHeaders[index] );
+ rowHeaders.erase(rowHeaders.begin() + index);
+
+ Sequence< ::rtl::OUString >& rowData ( (Sequence< ::rtl::OUString >&)data[index] );
+ data.erase(data.begin() + index);
+ broadcast_remove( index, headerName, rowData);
+ }
+ else
+ return;
+}
+//---------------------------------------------------------------------
+::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::rtl::OUString > > SAL_CALL DefaultGridDataModel::getData() throw (::com::sun::star::uno::RuntimeException)
+{
+
+ std::vector< std::vector< ::rtl::OUString > >::iterator iterator;
+ std::vector< Sequence< ::rtl::OUString > > dummyContainer(0);
+
+
+ for(iterator = data.begin(); iterator != data.end(); iterator++)
+ {
+ Sequence< ::rtl::OUString > cols(comphelper::containerToSequence(*iterator));
+ dummyContainer.push_back( cols );
+ }
+ Sequence< Sequence< ::rtl::OUString > > dataSequence(comphelper::containerToSequence(dummyContainer));
+
+ return dataSequence;
+}
+
+//---------------------------------------------------------------------
+
+void SAL_CALL DefaultGridDataModel::addDataListener( const Reference< XGridDataListener >& xListener ) throw (RuntimeException)
+{
+ BrdcstHelper.addListener( XGridDataListener::static_type(), xListener );
+}
+
+//---------------------------------------------------------------------
+
+void SAL_CALL DefaultGridDataModel::removeDataListener( const Reference< XGridDataListener >& xListener ) throw (RuntimeException)
+{
+ BrdcstHelper.removeListener( XGridDataListener::static_type(), xListener );
+}
+
+void SAL_CALL DefaultGridDataModel::removeAll() throw (RuntimeException)
+{
+ rowHeaders.clear();
+ data.clear();
+ broadcast_remove( -1, ::rtl::OUString(), 0);
+}
+
+//---------------------------------------------------------------------
+// XComponent
+//---------------------------------------------------------------------
+
+void SAL_CALL DefaultGridDataModel::dispose() throw (RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+
+ ::com::sun::star::lang::EventObject aEvent;
+ aEvent.Source.set( static_cast< ::cppu::OWeakObject* >( this ) );
+ BrdcstHelper.aLC.disposeAndClear( aEvent );
+
+}
+
+//---------------------------------------------------------------------
+
+void SAL_CALL DefaultGridDataModel::addEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException)
+{
+ BrdcstHelper.addListener( XEventListener::static_type(), xListener );
+}
+
+//---------------------------------------------------------------------
+
+void SAL_CALL DefaultGridDataModel::removeEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException)
+{
+ BrdcstHelper.removeListener( XEventListener::static_type(), xListener );
+}
+//---------------------------------------------------------------------
+// XServiceInfo
+//---------------------------------------------------------------------
+
+::rtl::OUString SAL_CALL DefaultGridDataModel::getImplementationName( ) throw (RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ static const OUString aImplName( RTL_CONSTASCII_USTRINGPARAM( "toolkit.DefaultGridDataModel" ) );
+ return aImplName;
+}
+
+//---------------------------------------------------------------------
+
+sal_Bool SAL_CALL DefaultGridDataModel::supportsService( const ::rtl::OUString& ServiceName ) throw (RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ return ServiceName.equalsAscii( szServiceName_DefaultGridDataModel );
+}
+
+//---------------------------------------------------------------------
+
+::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL DefaultGridDataModel::getSupportedServiceNames( ) throw (RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ static const OUString aServiceName( OUString::createFromAscii( szServiceName_DefaultGridDataModel ) );
+ static const Sequence< OUString > aSeq( &aServiceName, 1 );
+ return aSeq;
+}
+
+}
+
+Reference< XInterface > SAL_CALL DefaultGridDataModel_CreateInstance( const Reference< XMultiServiceFactory >& )
+{
+ return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::DefaultGridDataModel );
+}
+
diff --git a/toolkit/source/controls/grid/defaultgriddatamodel.hxx b/toolkit/source/controls/grid/defaultgriddatamodel.hxx
new file mode 100644
index 000000000000..18000c9f5a71
--- /dev/null
+++ b/toolkit/source/controls/grid/defaultgriddatamodel.hxx
@@ -0,0 +1,99 @@
+/*************************************************************************
+ *
+ * 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: griddatamodel.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_toolkit.hxx"
+#include <com/sun/star/awt/grid/XGridDataModel.hpp>
+#include <com/sun/star/awt/grid/GridDataEvent.hpp>
+#include <com/sun/star/awt/grid/XGridDataListener.hpp>
+#include <com/sun/star/lang/XEventListener.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/implbase3.hxx>
+#include <rtl/ref.hxx>
+#include <vector>
+#include <toolkit/helper/mutexandbroadcasthelper.hxx>
+
+using ::rtl::OUString;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::awt::grid;
+using namespace ::com::sun::star::lang;
+
+namespace toolkit
+{
+
+enum broadcast_type { row_added, row_removed, data_changed};
+
+class DefaultGridDataModel : public ::cppu::WeakImplHelper2< XGridDataModel, XServiceInfo >,
+ public MutexAndBroadcastHelper
+{
+public:
+ DefaultGridDataModel();
+ virtual ~DefaultGridDataModel();
+
+ // XGridDataModel
+ virtual ::sal_Int32 SAL_CALL getRowHeight() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setRowHeight(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getRowCount() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getRowHeaders() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setRowHeaders(const ::com::sun::star::uno::Sequence< ::rtl::OUString > & value) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::rtl::OUString > > SAL_CALL getData() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addRow(const ::rtl::OUString & headername, const ::com::sun::star::uno::Sequence< ::rtl::OUString > & data) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeRow(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addDataListener( const Reference< XGridDataListener >& xListener ) throw (RuntimeException);
+ virtual void SAL_CALL removeDataListener( const Reference< XGridDataListener >& xListener ) throw (RuntimeException);
+ virtual void SAL_CALL removeAll() throw (RuntimeException);
+
+ // XComponent
+ virtual void SAL_CALL dispose( ) throw (RuntimeException);
+ virtual void SAL_CALL addEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException);
+ virtual void SAL_CALL removeEventListener( const Reference< XEventListener >& aListener ) throw (RuntimeException);
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (RuntimeException);
+ virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (RuntimeException);
+
+private:
+
+ void broadcast( broadcast_type eType, const GridDataEvent& aEvent );
+ void broadcast_changed( ::rtl::OUString name, Any oldValue, Any newValue );
+ void broadcast_add( sal_Int32 index, const ::rtl::OUString & headerName, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rowData );
+ void broadcast_remove( sal_Int32 index, const ::rtl::OUString & headerName, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rowData );
+
+ sal_Int32 rowHeight;
+ std::vector< std::vector < ::rtl::OUString > > data;
+ std::vector< ::rtl::OUString > rowHeaders;
+};
+
+}
diff --git a/toolkit/source/controls/grid/gridcolumn.cxx b/toolkit/source/controls/grid/gridcolumn.cxx
new file mode 100644
index 000000000000..8b398b4aed58
--- /dev/null
+++ b/toolkit/source/controls/grid/gridcolumn.cxx
@@ -0,0 +1,166 @@
+/*************************************************************************
+ *
+ * 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: treedatamodel.cxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_toolkit.hxx"
+#include "gridcolumn.hxx"
+#include <comphelper/sequence.hxx>
+#include <toolkit/helper/servicenames.hxx>
+#include <rtl/ref.hxx>
+
+using ::rtl::OUString;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::awt::grid;
+using namespace ::com::sun::star::lang;
+
+namespace toolkit
+{
+
+///////////////////////////////////////////////////////////////////////
+// class GridColumn
+///////////////////////////////////////////////////////////////////////
+
+GridColumn::GridColumn()
+: identifier(Any())
+{
+}
+
+//---------------------------------------------------------------------
+
+GridColumn::~GridColumn()
+{
+}
+
+//---------------------------------------------------------------------
+
+//---------------------------------------------------------------------
+// XGridColumn
+//---------------------------------------------------------------------
+
+::com::sun::star::uno::Any SAL_CALL GridColumn::getIdentifier() throw (::com::sun::star::uno::RuntimeException)
+{
+ return identifier;
+}
+
+//---------------------------------------------------------------------
+
+void SAL_CALL GridColumn::setIdentifier(const ::com::sun::star::uno::Any & value) throw (::com::sun::star::uno::RuntimeException)
+{
+ value >>= identifier;
+}
+
+//--------------------------------------------------------------------
+
+::sal_Int32 SAL_CALL GridColumn::getColumnWidth() throw (::com::sun::star::uno::RuntimeException)
+{
+ return columnWidth;
+}
+
+//--------------------------------------------------------------------
+
+void SAL_CALL GridColumn::setColumnWidth(::sal_Int32 value) throw (::com::sun::star::uno::RuntimeException)
+{
+ columnWidth = value;
+}
+
+//--------------------------------------------------------------------
+
+::rtl::OUString SAL_CALL GridColumn::getTitle() throw (::com::sun::star::uno::RuntimeException)
+{
+ return title;
+}
+
+//--------------------------------------------------------------------
+
+void SAL_CALL GridColumn::setTitle(const ::rtl::OUString & value) throw (::com::sun::star::uno::RuntimeException)
+{
+ title = value;
+}
+
+//---------------------------------------------------------------------
+// XComponent
+//---------------------------------------------------------------------
+
+void SAL_CALL GridColumn::dispose() throw (RuntimeException)
+{
+}
+
+//---------------------------------------------------------------------
+
+void SAL_CALL GridColumn::addEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException)
+{
+ (void) xListener;
+}
+
+//---------------------------------------------------------------------
+
+void SAL_CALL GridColumn::removeEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException)
+{
+ (void) xListener;
+}
+
+//---------------------------------------------------------------------
+// XServiceInfo
+//---------------------------------------------------------------------
+
+::rtl::OUString SAL_CALL GridColumn::getImplementationName( ) throw (RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ static const OUString aImplName( RTL_CONSTASCII_USTRINGPARAM( "toolkit.GridColumn" ) );
+ return aImplName;
+}
+
+//---------------------------------------------------------------------
+
+sal_Bool SAL_CALL GridColumn::supportsService( const ::rtl::OUString& ServiceName ) throw (RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ return ServiceName.equalsAscii( szServiceName_GridColumn );
+}
+
+//---------------------------------------------------------------------
+
+::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL GridColumn::getSupportedServiceNames( ) throw (RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ static const OUString aServiceName( OUString::createFromAscii( szServiceName_GridColumn ) );
+ static const Sequence< OUString > aSeq( &aServiceName, 1 );
+ return aSeq;
+}
+
+}
+
+Reference< XInterface > SAL_CALL GridColumn_CreateInstance( const Reference< XMultiServiceFactory >& )
+{
+ return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::GridColumn );
+}
+
diff --git a/toolkit/source/controls/grid/gridcolumn.hxx b/toolkit/source/controls/grid/gridcolumn.hxx
new file mode 100644
index 000000000000..a451054ce93f
--- /dev/null
+++ b/toolkit/source/controls/grid/gridcolumn.hxx
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * 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: griddatamodel.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_toolkit.hxx"
+#include <com/sun/star/awt/grid/XGridColumn.hpp>
+#include <com/sun/star/lang/XEventListener.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/implbase3.hxx>
+#include <rtl/ref.hxx>
+#include <vector>
+#include <toolkit/helper/mutexandbroadcasthelper.hxx>
+
+using ::rtl::OUString;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::awt::grid;
+using namespace ::com::sun::star::lang;
+
+namespace toolkit
+{
+
+class GridColumn : public ::cppu::WeakImplHelper2< XGridColumn, XServiceInfo >,
+ public MutexAndBroadcastHelper
+{
+public:
+ GridColumn();
+ virtual ~GridColumn();
+
+ // XGridColumn
+ virtual ::com::sun::star::uno::Any SAL_CALL getIdentifier() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setIdentifier(const ::com::sun::star::uno::Any & value) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getColumnWidth() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setColumnWidth(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getTitle() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setTitle(const ::rtl::OUString & value) throw (::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ virtual void SAL_CALL dispose( ) throw (RuntimeException);
+ virtual void SAL_CALL addEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException);
+ virtual void SAL_CALL removeEventListener( const Reference< XEventListener >& aListener ) throw (RuntimeException);
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (RuntimeException);
+ virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (RuntimeException);
+
+
+private:
+ Any identifier;
+ sal_Int32 columnWidth;
+ ::rtl::OUString title;
+};
+
+}
diff --git a/toolkit/source/controls/grid/gridcontrol.cxx b/toolkit/source/controls/grid/gridcontrol.cxx
new file mode 100644
index 000000000000..c642d8a0dcce
--- /dev/null
+++ b/toolkit/source/controls/grid/gridcontrol.cxx
@@ -0,0 +1,273 @@
+/*************************************************************************
+ *
+ * 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: gridcontrol.cxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_toolkit.hxx"
+
+#include <gridcontrol.hxx>
+
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/view/SelectionType.hpp>
+#include <com/sun/star/awt/grid/XGridDataModel.hpp>
+#include <com/sun/star/awt/grid/ScrollBarMode.hpp>
+#include <toolkit/helper/unopropertyarrayhelper.hxx>
+#include <toolkit/helper/property.hxx>
+#include <com/sun/star/awt/XVclWindowPeer.hpp>
+#include <comphelper/processfactory.hxx>
+#include <osl/diagnose.h>
+
+using ::rtl::OUString;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::awt::grid;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::view;
+
+namespace toolkit
+{
+// ----------------------------------------------------
+// class UnoGridModel
+// ----------------------------------------------------
+UnoGridModel::UnoGridModel()
+{
+ ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
+ ImplRegisterProperty( BASEPROPERTY_BORDER );
+ ImplRegisterProperty( BASEPROPERTY_BORDERCOLOR );
+ ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
+ ImplRegisterProperty( BASEPROPERTY_ENABLED );
+ ImplRegisterProperty( BASEPROPERTY_FILLCOLOR );
+ ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
+ ImplRegisterProperty( BASEPROPERTY_HELPURL );
+ ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
+ ImplRegisterProperty( BASEPROPERTY_SIZEABLE ); // resizeable
+ ImplRegisterProperty( BASEPROPERTY_HSCROLL );
+ ImplRegisterProperty( BASEPROPERTY_VSCROLL );
+ ImplRegisterProperty( BASEPROPERTY_GRID_SHOWROWHEADER );
+ ImplRegisterProperty( BASEPROPERTY_GRID_SHOWCOLUMNHEADER );
+ ImplRegisterProperty( BASEPROPERTY_GRID_DATAMODEL );
+ ImplRegisterProperty( BASEPROPERTY_GRID_COLUMNMODEL );
+ ImplRegisterProperty( BASEPROPERTY_GRID_SELECTIONMODE );
+
+}
+
+UnoGridModel::UnoGridModel( const UnoGridModel& rModel )
+: UnoControlModel( rModel )
+{
+}
+
+UnoControlModel* UnoGridModel::Clone() const
+{
+ return new UnoGridModel( *this );
+}
+
+OUString UnoGridModel::getServiceName() throw(RuntimeException)
+{
+ return OUString::createFromAscii( szServiceName_GridControlModel );
+}
+
+Any UnoGridModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
+{
+ switch( nPropId )
+ {
+ case BASEPROPERTY_DEFAULTCONTROL:
+ return uno::makeAny( ::rtl::OUString::createFromAscii( szServiceName_GridControl ) );
+ case BASEPROPERTY_GRID_SELECTIONMODE:
+ return uno::makeAny( SelectionType(1) );
+ default:
+ return UnoControlModel::ImplGetDefaultValue( nPropId );
+ }
+
+}
+
+::cppu::IPropertyArrayHelper& UnoGridModel::getInfoHelper()
+{
+ static UnoPropertyArrayHelper* pHelper = NULL;
+ if ( !pHelper )
+ {
+ Sequence<sal_Int32> aIDs = ImplGetPropertyIds();
+ pHelper = new UnoPropertyArrayHelper( aIDs );
+ }
+ return *pHelper;
+}
+
+// XMultiPropertySet
+Reference< XPropertySetInfo > UnoGridModel::getPropertySetInfo( ) throw(RuntimeException)
+{
+ static Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
+ return xInfo;
+}
+
+
+// ----------------------------------------------------
+// class UnoGridControl
+// ----------------------------------------------------
+UnoGridControl::UnoGridControl()
+: mSelectionMode(SelectionType(1))
+{
+}
+
+OUString UnoGridControl::GetComponentServiceName()
+{
+ return OUString::createFromAscii( "Grid" );
+}
+
+void SAL_CALL UnoGridControl::dispose( ) throw(RuntimeException)
+{
+ UnoControl::dispose();
+}
+
+void UnoGridControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer ) throw(uno::RuntimeException)
+{
+ UnoControlBase::createPeer( rxToolkit, rParentPeer );
+
+ Reference< XGridControl > xGrid( getPeer(), UNO_QUERY_THROW );
+
+ Reference<XGridDataListener> xListener ( getPeer(), UNO_QUERY_THROW );
+ Reference<XPropertySet> xPropSet ( getModel(), UNO_QUERY_THROW );
+
+ Reference<XGridDataModel> xGridDataModel ( xPropSet->getPropertyValue(OUString::createFromAscii( "GridDataModel" )), UNO_QUERY_THROW );
+ xGridDataModel->addDataListener(xListener);
+}
+
+
+// -------------------------------------------------------------------
+// XGridControl
+// -------------------------------------------------------------------
+
+::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumnModel > SAL_CALL UnoGridControl::getColumnModel() throw (::com::sun::star::uno::RuntimeException)
+{
+ Reference<XPropertySet> xPropSet ( getModel(), UNO_QUERY_THROW );
+ Reference<XGridColumnModel> xGridColumnModel ( xPropSet->getPropertyValue(OUString::createFromAscii( "ColumnModel" )), UNO_QUERY_THROW );
+
+ return xGridColumnModel;
+}
+
+void SAL_CALL UnoGridControl::setColumnModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumnModel > & model) throw (::com::sun::star::uno::RuntimeException)
+{
+ Reference<XPropertySet> xPropSet ( getModel(), UNO_QUERY_THROW );
+ xPropSet->setPropertyValue(OUString::createFromAscii( "ColumnModel" ), Any (model));
+}
+
+::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataModel > SAL_CALL UnoGridControl::getDataModel() throw (::com::sun::star::uno::RuntimeException)
+{
+ Reference<XPropertySet> xPropSet ( getModel(), UNO_QUERY_THROW );
+ Reference<XGridDataModel> xGridDataModel ( xPropSet->getPropertyValue(OUString::createFromAscii( "GridDataModel" )), UNO_QUERY_THROW );
+
+ return xGridDataModel;
+}
+
+void SAL_CALL UnoGridControl::setDataModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataModel > & model) throw (::com::sun::star::uno::RuntimeException)
+{
+ Reference<XPropertySet> xPropSet ( getModel(), UNO_QUERY_THROW );
+ xPropSet->setPropertyValue(OUString::createFromAscii( "GridDataModel" ), Any(model));
+}
+
+::sal_Int32 UnoGridControl::getItemIndexAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException)
+{
+ return Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->getItemIndexAtPoint( x, y );
+}
+
+/*
+void SAL_CALL UnoGridControl::addMouseListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener > & listener) throw (::com::sun::star::uno::RuntimeException)
+{
+ Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->addMouseListener( listener );
+}
+
+void SAL_CALL UnoGridControl::removeMouseListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener > & listener) throw (::com::sun::star::uno::RuntimeException)
+{
+ Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->removeMouseListener( listener );
+}
+*/
+// -------------------------------------------------------------------
+// XGridSelection
+// -------------------------------------------------------------------
+
+::sal_Int32 SAL_CALL UnoGridControl::getMinSelectionIndex() throw (::com::sun::star::uno::RuntimeException)
+{
+ return Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->getMinSelectionIndex();
+}
+
+::sal_Int32 SAL_CALL UnoGridControl::getMaxSelectionIndex() throw (::com::sun::star::uno::RuntimeException)
+{
+ return Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->getMaxSelectionIndex();
+}
+
+void SAL_CALL UnoGridControl::insertIndexIntervall(::sal_Int32 start, ::sal_Int32 length) throw (::com::sun::star::uno::RuntimeException)
+{
+ Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->insertIndexIntervall( start, length);
+}
+
+void SAL_CALL UnoGridControl::removeIndexIntervall(::sal_Int32 start, ::sal_Int32 length) throw (::com::sun::star::uno::RuntimeException)
+{
+ Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->removeIndexIntervall( start, length );
+}
+
+::com::sun::star::uno::Sequence< ::sal_Int32 > SAL_CALL UnoGridControl::getSelection() throw (::com::sun::star::uno::RuntimeException)
+{
+ return Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->getSelection();
+}
+
+::sal_Bool SAL_CALL UnoGridControl::isSelectionEmpty() throw (::com::sun::star::uno::RuntimeException)
+{
+ return Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->isSelectionEmpty();
+}
+
+::sal_Bool SAL_CALL UnoGridControl::isSelectedIndex(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException)
+{
+ return Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->isSelectedIndex( index );
+}
+
+void SAL_CALL UnoGridControl::selectRow(::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException)
+{
+ Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->selectRow( y );
+}
+
+void SAL_CALL UnoGridControl::addSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException)
+{
+ Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->addSelectionListener( listener );
+}
+
+void SAL_CALL UnoGridControl::removeSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException)
+{
+ Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->removeSelectionListener( listener );
+}
+}
+
+Reference< XInterface > SAL_CALL GridControl_CreateInstance( const Reference< XMultiServiceFactory >& )
+{
+ return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::UnoGridControl );
+}
+
+Reference< XInterface > SAL_CALL GridControlModel_CreateInstance( const Reference< XMultiServiceFactory >& )
+{
+ return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::UnoGridModel );
+}
diff --git a/toolkit/source/controls/grid/gridcontrol.hxx b/toolkit/source/controls/grid/gridcontrol.hxx
new file mode 100644
index 000000000000..5648c812fbff
--- /dev/null
+++ b/toolkit/source/controls/grid/gridcontrol.hxx
@@ -0,0 +1,124 @@
+/*************************************************************************
+ *
+ * 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: gridcontrol.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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 TOOLKIT_GRID_CONTROL_HXX
+#define TOOLKIT_GRID_CONTROL_HXX
+
+#include <com/sun/star/awt/grid/XGridControl.hpp>
+#include <com/sun/star/view/SelectionType.hpp>
+#include <toolkit/controls/unocontrols.hxx>
+#include <toolkit/controls/unocontrolmodel.hxx>
+#include <toolkit/helper/servicenames.hxx>
+#include <cppuhelper/implbase1.hxx>
+
+#include <toolkit/helper/listenermultiplexer.hxx>
+
+namespace toolkit {
+
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::container;
+
+// ===================================================================
+// = UnoGridModel
+// ===================================================================
+class UnoGridModel : public UnoControlModel
+{
+protected:
+ Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+public:
+ UnoGridModel();
+ UnoGridModel( const UnoGridModel& rModel );
+
+ UnoControlModel* Clone() const;
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::io::XPersistObject
+ ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoGridModel, UnoControlModel, szServiceName_GridControlModel )
+};
+
+
+// ===================================================================
+// = UnoGridControl
+// ===================================================================
+class UnoGridControl : public ::cppu::ImplInheritanceHelper1< UnoControlBase, ::com::sun::star::awt::grid::XGridControl >
+{
+public:
+ UnoGridControl();
+ ::rtl::OUString GetComponentServiceName();
+
+ // ::com::sun::star::lang::XComponent
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XControl
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::grid::XGridControl
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumnModel > SAL_CALL getColumnModel() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setColumnModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumnModel > & model) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataModel > SAL_CALL getDataModel() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setDataModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataModel > & model) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getItemIndexAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException);
+ //virtual void SAL_CALL addMouseListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener > & listener) throw (::com::sun::star::uno::RuntimeException);
+ //virtual void SAL_CALL removeMouseListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener > & listener) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::grid::XGridSelection
+
+ virtual ::sal_Int32 SAL_CALL getMinSelectionIndex() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getMaxSelectionIndex() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL insertIndexIntervall(::sal_Int32 start, ::sal_Int32 length) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeIndexIntervall(::sal_Int32 start, ::sal_Int32 length) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::sal_Int32 > SAL_CALL getSelection() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isSelectionEmpty() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isSelectedIndex(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL selectRow(::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoGridControl, UnoControlBase, szServiceName_GridControl )
+
+ using UnoControl::getPeer;
+private:
+ ::com::sun::star::view::SelectionType mSelectionMode;
+};
+
+} // toolkit
+
+#endif // _TOOLKIT_TREE_CONTROL_HXX
diff --git a/toolkit/source/controls/grid/makefile.mk b/toolkit/source/controls/grid/makefile.mk
new file mode 100644
index 000000000000..7c904b3ef02e
--- /dev/null
+++ b/toolkit/source/controls/grid/makefile.mk
@@ -0,0 +1,54 @@
+#*************************************************************************
+#
+# 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: makefile.mk,v $
+#
+# $Revision: 1.3 $
+#
+# 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.
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+
+PRJNAME=toolkit
+TARGET=grid
+
+ENABLE_EXCEPTIONS=TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/util$/makefile.pmk
+
+# --- Files --------------------------------------------------------
+
+SLOFILES= \
+ $(SLO)$/gridcontrol.obj\
+ $(SLO)$/defaultgriddatamodel.obj\
+ $(SLO)$/defaultgridcolumnmodel.obj\
+ $(SLO)$/gridcolumn.obj
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
diff --git a/toolkit/source/controls/roadmapcontrol.cxx b/toolkit/source/controls/roadmapcontrol.cxx
index 724421da5f3c..da3a265130b8 100644
--- a/toolkit/source/controls/roadmapcontrol.cxx
+++ b/toolkit/source/controls/roadmapcontrol.cxx
@@ -104,6 +104,7 @@ static void lcl_throwIndexOutOfBoundsException( )
ImplRegisterProperty( BASEPROPERTY_COMPLETE );
ImplRegisterProperty( BASEPROPERTY_ACTIVATED );
ImplRegisterProperty( BASEPROPERTY_CURRENTITEMID );
+ ImplRegisterProperty( BASEPROPERTY_TABSTOP );
ImplRegisterProperty( BASEPROPERTY_TEXT );
}
diff --git a/toolkit/source/helper/property.cxx b/toolkit/source/helper/property.cxx
index 0560afbd835f..e71c03bae47d 100644
--- a/toolkit/source/helper/property.cxx
+++ b/toolkit/source/helper/property.cxx
@@ -48,6 +48,9 @@
#include <com/sun/star/awt/FontStrikeout.hpp>
#include <com/sun/star/awt/FontPitch.hpp>
#include <com/sun/star/awt/tree/XTreeDataModel.hpp>
+#include <com/sun/star/awt/grid/XGridDataModel.hpp>
+#include <com/sun/star/awt/grid/XGridColumnModel.hpp>
+#include <com/sun/star/awt/grid/ScrollBarMode.hpp>
#include <com/sun/star/view/SelectionType.hpp>
#include <com/sun/star/style/VerticalAlignment.hpp>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
@@ -252,7 +255,6 @@ ImplPropertyInfo* ImplGetPropertyInfos( sal_uInt16& rElementCount )
DECL_PROP_2 ( "ValueStep", VALUESTEP_DOUBLE, double, BOUND, MAYBEDEFAULT ),
DECL_PROP_3 ( "VerticalAlign", VERTICALALIGN, VerticalAlignment, BOUND, MAYBEDEFAULT, MAYBEVOID ),
DECL_DEP_PROP_3 ( "VisibleSize", VISIBLESIZE, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
-
DECL_PROP_2 ( "Activated", ACTIVATED, sal_Bool, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "Complete", COMPLETE, sal_Bool, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "CurrentItemID", CURRENTITEMID, sal_Int16, BOUND, MAYBEDEFAULT ),
@@ -273,6 +275,11 @@ ImplPropertyInfo* ImplGetPropertyInfos( sal_uInt16& rElementCount )
DECL_PROP_2 ( "URL", URL, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "WritingMode", WRITING_MODE, sal_Int16, BOUND, MAYBEDEFAULT ),
DECL_PROP_3 ( "ContextWritingMode", CONTEXT_WRITING_MODE, sal_Int16, BOUND, MAYBEDEFAULT, TRANSIENT ),
+ DECL_PROP_2 ( "ShowRowHeader", GRID_SHOWROWHEADER, sal_Bool, BOUND, MAYBEDEFAULT ),
+ DECL_PROP_2 ( "ShowColumnHeader", GRID_SHOWCOLUMNHEADER, sal_Bool, BOUND, MAYBEDEFAULT ),
+ DECL_PROP_3 ( "GridDataModel", GRID_DATAMODEL, Reference< ::com::sun::star::awt::grid::XGridDataModel >, BOUND, MAYBEDEFAULT, MAYBEVOID ),
+ DECL_PROP_3 ( "ColumnModel", GRID_COLUMNMODEL, Reference< ::com::sun::star::awt::grid::XGridColumnModel >, BOUND, MAYBEDEFAULT, MAYBEVOID ),
+ DECL_PROP_3 ( "SelectionModel", GRID_SELECTIONMODE, ::com::sun::star::view::SelectionType, BOUND, MAYBEDEFAULT, MAYBEVOID ),
DECL_PROP_2 ( "EnableVisible", ENABLEVISIBLE, sal_Bool, BOUND, MAYBEDEFAULT )
};
pPropertyInfos = aImplPropertyInfos;
diff --git a/toolkit/source/helper/registerservices.cxx b/toolkit/source/helper/registerservices.cxx
index d9264f22cb51..ea29c9810beb 100644
--- a/toolkit/source/helper/registerservices.cxx
+++ b/toolkit/source/helper/registerservices.cxx
@@ -202,6 +202,12 @@ IMPL_CREATEINSTANCE( UnoThrobberControlModel )
extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL TreeControl_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL TreeControlModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL MutableTreeDataModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
+extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL GridControl_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
+extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL GridControlModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
+extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL DefaultGridDataModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
+extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL DefaultGridColumnModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
+extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL GridColumn_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
+
extern sal_Bool SAL_CALL comp_AsyncCallback_component_writeInfo( void * serviceManager, void * registryKey );
extern void * SAL_CALL comp_AsyncCallback_component_getFactory( const char * implName, void * serviceManager, void * registryKey );
@@ -287,6 +293,11 @@ TOOLKIT_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo( void* _pServiceManager,
registerServices( xRegistryKey, "UnoThrobberControl", szServiceName_UnoThrobberControl );
registerServices( xRegistryKey, "UnoFixedHyperlinkControl", szServiceName_UnoControlFixedHyperlink );
registerServices( xRegistryKey, "UnoControlFixedHyperlinkModel", szServiceName_UnoControlFixedHyperlinkModel );
+ registerServices( xRegistryKey, "GridControl", szServiceName_GridControl );
+ registerServices( xRegistryKey, "GridControlModel", szServiceName_GridControlModel );
+ registerServices( xRegistryKey, "DefaultGridDataModel", szServiceName_DefaultGridDataModel );
+ registerServices( xRegistryKey, "DefaultGridColumnModel", szServiceName_DefaultGridColumnModel );
+ registerServices( xRegistryKey, "GridColumn", szServiceName_GridColumn );
comp_AsyncCallback_component_writeInfo( _pServiceManager, _pRegistryKey );
comp_Layout_component_writeInfo( _pServiceManager, _pRegistryKey );
@@ -369,6 +380,12 @@ TOOLKIT_DLLPUBLIC void* SAL_CALL component_getFactory( const sal_Char* sImplemen
CHECKANDCREATEFACTORY( UnoThrobberControl, szServiceName_UnoThrobberControl, NULL )
CHECKANDCREATEFACTORY( UnoFixedHyperlinkControl, szServiceName_UnoControlFixedHyperlink, NULL )
CHECKANDCREATEFACTORY( UnoControlFixedHyperlinkModel, szServiceName_UnoControlFixedHyperlinkModel, NULL )
+ CHECKANDCREATEFACTORY( GridControl, szServiceName_GridControl, NULL );
+ CHECKANDCREATEFACTORY( GridControlModel, szServiceName_GridControlModel, NULL );
+ CHECKANDCREATEFACTORY( DefaultGridDataModel, szServiceName_DefaultGridDataModel, NULL );
+ CHECKANDCREATEFACTORY( DefaultGridColumnModel, szServiceName_DefaultGridColumnModel, NULL );
+ CHECKANDCREATEFACTORY( GridColumn, szServiceName_GridColumn, NULL );
+
if ( rtl_str_compare( sImplementationName, "com.sun.star.awt.comp.AsyncCallback" ) == 0 )
return comp_AsyncCallback_component_getFactory( sImplementationName, _pServiceManager, _pRegistryKey );
diff --git a/toolkit/source/helper/servicenames.cxx b/toolkit/source/helper/servicenames.cxx
index 903f18f95eae..f00e7a2b09fa 100644
--- a/toolkit/source/helper/servicenames.cxx
+++ b/toolkit/source/helper/servicenames.cxx
@@ -101,4 +101,8 @@ const sal_Char __FAR_DATA szServiceName_UnoThrobberControlModel[] = "com.sun.sta
const sal_Char __FAR_DATA szServiceName_UnoThrobberControl[] = "com.sun.star.awt.UnoThrobberControl";
const sal_Char __FAR_DATA szServiceName_UnoControlFixedHyperlink[] = "com.sun.star.awt.UnoControlFixedHyperlink";
const sal_Char __FAR_DATA szServiceName_UnoControlFixedHyperlinkModel[] = "com.sun.star.awt.UnoControlFixedHyperlinkModel";
-
+const sal_Char __FAR_DATA szServiceName_GridControl[] = "com.sun.star.awt.grid.UnoControlGrid";
+const sal_Char __FAR_DATA szServiceName_GridControlModel[] = "com.sun.star.awt.grid.UnoControlGridModel";
+const sal_Char __FAR_DATA szServiceName_DefaultGridDataModel[] = "com.sun.star.awt.grid.DefaultGridDataModel";
+const sal_Char __FAR_DATA szServiceName_DefaultGridColumnModel[] = "com.sun.star.awt.grid.DefaultGridColumnModel";
+const sal_Char __FAR_DATA szServiceName_GridColumn[] = "com.sun.star.awt.grid.GridColumn";
diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx
index a652d493e653..96b8908558a7 100644
--- a/toolkit/source/helper/unowrapper.cxx
+++ b/toolkit/source/helper/unowrapper.cxx
@@ -65,6 +65,13 @@ using namespace ::com::sun::star;
case WINDOW_OKBUTTON:
case WINDOW_CANCELBUTTON: return new VCLXButton;
case WINDOW_CHECKBOX: return new VCLXCheckBox;
+ // --> OD 2009-06-29 #i95042#
+ // A Window of type <MetricBox> is inherited from type <ComboBox>.
+ // Thus, it does make more sense to return a <VCLXComboBox> instance
+ // instead of only a <VCLXWindow> instance, especially regarding its
+ // corresponding accessibility API.
+ case WINDOW_METRICBOX:
+ // <--
case WINDOW_COMBOBOX: return new VCLXComboBox;
case WINDOW_SPINFIELD:
case WINDOW_NUMERICFIELD:
@@ -109,7 +116,6 @@ using namespace ::com::sun::star;
// case WINDOW_DATEBOX:
// case WINDOW_GROUPBOX:
// case WINDOW_LONGCURRENCYBOX:
- // case WINDOW_METRICBOX:
// case WINDOW_SPLITTER:
// case WINDOW_STATUSBAR:
// case WINDOW_TABCONTROL:
diff --git a/toolkit/source/helper/vclunohelper.cxx b/toolkit/source/helper/vclunohelper.cxx
index 029e520baca6..89bde88d018e 100644
--- a/toolkit/source/helper/vclunohelper.cxx
+++ b/toolkit/source/helper/vclunohelper.cxx
@@ -45,6 +45,8 @@
#include <com/sun/star/awt/XControlContainer.hpp>
#include <com/sun/star/awt/FontWeight.hpp>
#include <com/sun/star/awt/FontWidth.hpp>
+#include <com/sun/star/awt/KeyModifier.hpp>
+#include <com/sun/star/awt/MouseButton.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/embed/EmbedMapUnits.hpp>
@@ -67,6 +69,8 @@
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/awt/Point.hpp>
+using namespace ::com::sun::star;
+
// ----------------------------------------------------
// class VCLUnoHelper
// ----------------------------------------------------
@@ -745,3 +749,54 @@ com::sun::star::awt::Point VCLUnoHelper::ConvertToAWTPoint(::Point /* VCLPoint *
{
return ::com::sun::star::awt::Rectangle( _rRect.Left(), _rRect.Top(), _rRect.GetWidth(), _rRect.GetHeight() );
}
+
+awt::MouseEvent VCLUnoHelper::createMouseEvent( const ::MouseEvent& _rVclEvent, const uno::Reference< uno::XInterface >& _rxContext )
+{
+ awt::MouseEvent aMouseEvent;
+ aMouseEvent.Source = _rxContext;
+
+ aMouseEvent.Modifiers = 0;
+ if ( _rVclEvent.IsShift() )
+ aMouseEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::SHIFT;
+ if ( _rVclEvent.IsMod1() )
+ aMouseEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD1;
+ if ( _rVclEvent.IsMod2() )
+ aMouseEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD2;
+
+ aMouseEvent.Buttons = 0;
+ if ( _rVclEvent.IsLeft() )
+ aMouseEvent.Buttons |= ::com::sun::star::awt::MouseButton::LEFT;
+ if ( _rVclEvent.IsRight() )
+ aMouseEvent.Buttons |= ::com::sun::star::awt::MouseButton::RIGHT;
+ if ( _rVclEvent.IsMiddle() )
+ aMouseEvent.Buttons |= ::com::sun::star::awt::MouseButton::MIDDLE;
+
+ aMouseEvent.X = _rVclEvent.GetPosPixel().X();
+ aMouseEvent.Y = _rVclEvent.GetPosPixel().Y();
+ aMouseEvent.ClickCount = _rVclEvent.GetClicks();
+ aMouseEvent.PopupTrigger = sal_False;
+
+ return aMouseEvent;
+}
+
+awt::KeyEvent VCLUnoHelper::createKeyEvent( const ::KeyEvent& _rVclEvent, const uno::Reference< uno::XInterface >& _rxContext )
+{
+ awt::KeyEvent aKeyEvent;
+ aKeyEvent.Source = _rxContext;
+
+ aKeyEvent.Modifiers = 0;
+ if ( _rVclEvent.GetKeyCode().IsShift() )
+ aKeyEvent.Modifiers |= awt::KeyModifier::SHIFT;
+ if ( _rVclEvent.GetKeyCode().IsMod1() )
+ aKeyEvent.Modifiers |= awt::KeyModifier::MOD1;
+ if ( _rVclEvent.GetKeyCode().IsMod2() )
+ aKeyEvent.Modifiers |= awt::KeyModifier::MOD2;
+ if ( _rVclEvent.GetKeyCode().IsMod3() )
+ aKeyEvent.Modifiers |= awt::KeyModifier::MOD3;
+
+ aKeyEvent.KeyCode = _rVclEvent.GetKeyCode().GetCode();
+ aKeyEvent.KeyChar = _rVclEvent.GetCharCode();
+ aKeyEvent.KeyFunc = ::sal::static_int_cast< sal_Int16 >( _rVclEvent.GetKeyCode().GetFunction());
+
+ return aKeyEvent;
+}
diff --git a/toolkit/util/makefile.mk b/toolkit/util/makefile.mk
index d6a1e5f15c65..3c5da82d0dd9 100644
--- a/toolkit/util/makefile.mk
+++ b/toolkit/util/makefile.mk
@@ -52,6 +52,7 @@ USE_DEFFILE=TRUE
LIB1TARGET= $(SLB)$/$(TARGET).lib
LIB1FILES= $(SLB)$/awt.lib \
$(SLB)$/tree.lib \
+ $(SLB)$/grid.lib \
$(SLB)$/controls.lib \
$(SLB)$/helper.lib\
$(SLB)$/layout-core.lib \
@@ -79,22 +80,6 @@ DEF1DEPN =$(LIB1TARGET)
DEF1DES =TK
DEFLIB1NAME =tk
-.IF "$(OS)"=="MACOSX"
-
-# [ed] 6/16/02 Add in X libraries if we're building X
-
-.IF "$(GUIBASE)"=="unx"
-SHL1STDLIBS +=\
- -lX11 -lXt -lXmu
-.ENDIF
-
-.ELSE
-.IF "$(GUI)"=="UNX"
-SHL1STDLIBS +=\
- -lX11
-.ENDIF
-.ENDIF
-
RESLIB1IMAGES=$(PRJ)$/source$/awt
RES1FILELIST=$(SRS)$/awt.srs
RESLIB1NAME=$(TARGET)
diff --git a/toolkit/util/toolkit.xml b/toolkit/util/toolkit.xml
index 8ec1a48d440d..2fb4588550bc 100644
--- a/toolkit/util/toolkit.xml
+++ b/toolkit/util/toolkit.xml
@@ -701,4 +701,50 @@
<status value="beta" />
<supported-service>com.sun.star.awt.tree.MutableTreeNode</supported-service>
</component-description>
+ <component-description>
+ <author>Tobias Krause</author>
+ <name>stardiv.Toolkit.UnoGridModel</name>
+ <description>specifies the model of a grid control</description>
+ <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
+ <language>c++</language>
+ <status value="beta" />
+ <supported-service>com.sun.star.awt.grid.UnoControlGridModel</supported-service>
+ </component-description>
+ <component-description>
+ <author>Tobias Krause</author>
+ <name>stardiv.Toolkit.UnoGridControl</name>
+ <description>specifies a grid control</description>
+ <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
+ <language>c++</language>
+ <status value="beta" />
+ <supported-service>com.sun.star.awt.grid.UnoControlGrid</supported-service>
+ </component-description>
+ <component-description>
+ <author>Tobias Krause</author>
+ <name>stardiv.Toolkit.DefaultGridDataModel</name>
+ <description>specifies the grid control default data model</description>
+ <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
+ <language>c++</language>
+ <status value="beta" />
+ <supported-service>com.sun.star.awt.grid.DefaultGridDataModel</supported-service>
+ </component-description>
+ <component-description>
+ <author>Tobias Krause</author>
+ <name>stardiv.Toolkit.DefaultGridColumnModel</name>
+ <description>specifies the grid control default column model</description>
+ <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
+ <language>c++</language>
+ <status value="beta" />
+ <supported-service>com.sun.star.awt.grid.DefaultGridColumnModel</supported-service>
+ </component-description>
+ <component-description>
+ <author>Tobias Krause</author>
+ <name>stardiv.Toolkit.GridColumn</name>
+ <description>specifies the grid coloumn model</description>
+ <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
+ <language>c++</language>
+ <status value="beta" />
+ <supported-service>com.sun.star.awt.grid.GridColumn</supported-service>
+ </component-description>
+
</module-description> \ No newline at end of file