1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: gridcontrol.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef TOOLKIT_GRID_CONTROL_HXX
32 #define TOOLKIT_GRID_CONTROL_HXX
34 #include <com/sun/star/awt/grid/XGridControl.hpp>
35 #include <com/sun/star/view/SelectionType.hpp>
36 #include <toolkit/controls/unocontrols.hxx>
37 #include <toolkit/controls/unocontrolmodel.hxx>
38 #include <toolkit/helper/servicenames.hxx>
39 #include <cppuhelper/implbase1.hxx>
41 #include <toolkit/helper/listenermultiplexer.hxx>
45 using namespace ::com::sun::star::uno
;
46 using namespace ::com::sun::star::awt
;
47 using namespace ::com::sun::star::lang
;
48 using namespace ::com::sun::star::beans
;
49 using namespace ::com::sun::star::container
;
51 // ===================================================================
53 // ===================================================================
54 class UnoGridModel
: public UnoControlModel
57 Any
ImplGetDefaultValue( sal_uInt16 nPropId
) const;
58 ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper();
62 UnoGridModel( const UnoGridModel
& rModel
);
64 UnoControlModel
* Clone() const;
66 // ::com::sun::star::beans::XMultiPropertySet
67 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException
);
69 // ::com::sun::star::io::XPersistObject
70 ::rtl::OUString SAL_CALL
getServiceName() throw(::com::sun::star::uno::RuntimeException
);
73 DECLIMPL_SERVICEINFO_DERIVED( UnoGridModel
, UnoControlModel
, szServiceName_GridControlModel
)
77 // ===================================================================
79 // ===================================================================
80 class UnoGridControl
: public ::cppu::ImplInheritanceHelper1
< UnoControlBase
, ::com::sun::star::awt::grid::XGridControl
>
84 ::rtl::OUString
GetComponentServiceName();
86 // ::com::sun::star::lang::XComponent
87 void SAL_CALL
dispose( ) throw(::com::sun::star::uno::RuntimeException
);
89 // ::com::sun::star::awt::XControl
90 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
);
92 // ::com::sun::star::awt::grid::XGridControl
93 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::awt::grid::XGridColumnModel
> SAL_CALL
getColumnModel() throw (::com::sun::star::uno::RuntimeException
);
94 virtual void SAL_CALL
setColumnModel(const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::grid::XGridColumnModel
> & model
) throw (::com::sun::star::uno::RuntimeException
);
95 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::awt::grid::XGridDataModel
> SAL_CALL
getDataModel() throw (::com::sun::star::uno::RuntimeException
);
96 virtual void SAL_CALL
setDataModel(const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::grid::XGridDataModel
> & model
) throw (::com::sun::star::uno::RuntimeException
);
97 virtual ::sal_Int32 SAL_CALL
getItemIndexAtPoint(::sal_Int32 x
, ::sal_Int32 y
) throw (::com::sun::star::uno::RuntimeException
);
98 //virtual void SAL_CALL addMouseListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener > & listener) throw (::com::sun::star::uno::RuntimeException);
99 //virtual void SAL_CALL removeMouseListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener > & listener) throw (::com::sun::star::uno::RuntimeException);
101 // ::com::sun::star::awt::grid::XGridSelection
103 virtual ::sal_Int32 SAL_CALL
getMinSelectionIndex() throw (::com::sun::star::uno::RuntimeException
);
104 virtual ::sal_Int32 SAL_CALL
getMaxSelectionIndex() throw (::com::sun::star::uno::RuntimeException
);
105 virtual void SAL_CALL
insertIndexIntervall(::sal_Int32 start
, ::sal_Int32 length
) throw (::com::sun::star::uno::RuntimeException
);
106 virtual void SAL_CALL
removeIndexIntervall(::sal_Int32 start
, ::sal_Int32 length
) throw (::com::sun::star::uno::RuntimeException
);
107 virtual ::com::sun::star::uno::Sequence
< ::sal_Int32
> SAL_CALL
getSelection() throw (::com::sun::star::uno::RuntimeException
);
108 virtual ::sal_Bool SAL_CALL
isSelectionEmpty() throw (::com::sun::star::uno::RuntimeException
);
109 virtual ::sal_Bool SAL_CALL
isSelectedIndex(::sal_Int32 index
) throw (::com::sun::star::uno::RuntimeException
);
110 virtual void SAL_CALL
selectRow(::sal_Int32 y
) throw (::com::sun::star::uno::RuntimeException
);
111 virtual void SAL_CALL
addSelectionListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::grid::XGridSelectionListener
> & listener
) throw (::com::sun::star::uno::RuntimeException
);
112 virtual void SAL_CALL
removeSelectionListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::grid::XGridSelectionListener
> & listener
) throw (::com::sun::star::uno::RuntimeException
);
114 // ::com::sun::star::lang::XServiceInfo
115 DECLIMPL_SERVICEINFO_DERIVED( UnoGridControl
, UnoControlBase
, szServiceName_GridControl
)
117 using UnoControl::getPeer
;
119 ::com::sun::star::view::SelectionType mSelectionMode
;
124 #endif // _TOOLKIT_TREE_CONTROL_HXX