1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_awt_grid_XGridDataModel_idl__
24#define __com_sun_star_awt_grid_XGridDataModel_idl__
25
26
27#include <com/sun/star/lang/XComponent.idl>
28#include <com/sun/star/util/XCloneable.idl>
29#include <com/sun/star/awt/grid/XGridDataListener.idl>
30#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
31
32//=============================================================================
33
34module com {  module sun {  module star {  module awt { module grid {
35
36//=============================================================================
37/** An instance of this interface is used by the <type>UnoControlGrid</type> to
38	retrieve the content data that is displayed in the actual control.
39
40	If you do not need your own model implementation, you can also use the <type>DefaultGridDataModel</type>.
41
42	@since OOo 3.3
43*/
44published interface XGridDataModel
45{
46    /** implements life time control for the component
47    */
48    interface ::com::sun::star::lang::XComponent;
49
50    /** allows cloning the complete data model
51    */
52    interface ::com::sun::star::util::XCloneable;
53
54    /** denotes the number of rows for which the model can provide data
55    */
56    [attribute, readonly] long RowCount;
57
58    /** denotes the number of columns for which the model can provide data
59    */
60    [attribute, readonly] long ColumnCount;
61
62    /** retrieves the data for a given cell
63
64        @throws ::com::sun::star::lang::IndexOutOfBoundsException
65            if the column or row index do not denote a valid cell position.
66    */
67    any getCellData( [in] long Column, [in] long RowIndex )
68        raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
69
70    /** retrieves the tool tip to be displayed when the mouse hovers over a given cell
71
72        <p>At the moment, only string tool tips are supported.</p>
73
74        <p>If <VOID/> is returned here, the cell's content will be displayed as tip, but only if it does
75        not fit into the cell.</p>
76
77        @throws ::com::sun::star::lang::IndexOutOfBoundsException
78            if the column or row index do not denote a valid cell position.
79    */
80    any getCellToolTip( [in] long Column, [in] long RowIndex )
81        raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
82
83    /** retrieves the heading of a given row
84
85        <p>A grid control will usually paint a row's title in the header column of the respective row.</p>
86
87        <p>At the moment, only strings are supported as row headings.</p>
88
89        @throws ::com::sun::star::lang::IndexOutOfBoundsException
90            if the given index does not denote a valid row.
91    */
92    any
93        getRowHeading( [in] long RowIndex )
94        raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
95
96    /** retrieves the data for a complete row
97
98        <p>This method is provided for performance and convenience reasons, it delivers the same result
99        as subsequent calls to <member>getCellData</member> would.</p>
100
101        @param Row
102            the index of the row whose data should is to be retrieved.
103        @raises ::com::sun::star::lang::IndexOutOfBoundsException
104            of the given row index does not denote a valid row.
105    */
106    sequence< any >
107        getRowData( [in] long RowIndex )
108        raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
109};
110
111//=============================================================================
112
113}; }; }; };};
114
115#endif
116