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
24#ifndef __com_sun_star_awt_grid_SortableGridDataModel_idl__
25#define __com_sun_star_awt_grid_SortableGridDataModel_idl__
26
27#include <com/sun/star/i18n/XCollator.idl>
28#include <com/sun/star/lang/IllegalArgumentException.idl>
29
30//==================================================================================================================
31
32module com { module sun { module star { module awt { module grid {
33
34interface XSortableMutableGridDataModel;
35interface XMutableGridDataModel;
36
37//==================================================================================================================
38
39/** provides a default implementation of a <type>XSortableGridData</type>.
40
41    <p>This service must be created with a secondary grid data model, which all actual data requests are delegated to.
42    But before providing this data to the service's own clients, it is sorted, according to the sort order defined
43    via the <code>XSortableGridData</code> interface.</p>
44
45    <p>The service implementation is able to compare the default scalar types, plus strings.</p>
46
47    <p>For determining the data type of a column which the data should be sorted by, the first non-<VOID/> data encountered
48    in this column is taken into account. Further read requests to this column will assume that all non-<VOID/> data is of
49    the same type.</p>
50
51    <p>Consequently, you cannot use this service with data sets containing heterogeneous data in a given column.</p>
52
53    <p>All requests made via the <type>XMutableGridDataModel</type> are delegated to the <code>XMutableGridDataModel</code>
54    instance passed in the service constructor.</p>
55
56    <p>Note that changing the data might result in the sort order being destroyed. If you want to ensure
57    that the data represented by the model is still sorted after your modifications, you should call
58    <member>XSortableGridData::sortByColumn</member>, again.</p>
59 */
60service SortableGridDataModel : XSortableMutableGridDataModel
61{
62    /** creates a new instance of the <code>SortableGridDataModel</code>
63
64        <p>For string comparison, a default <type scope="::com::sun::star::i18n">Collator</type>, based on the system's
65        locale, will be used.</p>
66
67        @param DelegatorModel
68            the data model to which read requests are delegated.
69        @throws ::com::sun::star::lang::IllegalArgumentException
70            if the given <code>DelegatorModel</code> is <NULL/>
71    */
72    create(
73            [in] XMutableGridDataModel DelegatorModel
74        )
75        raises ( ::com::sun::star::lang::IllegalArgumentException );
76
77    /** creates a new instance of the ScortableDefaultGridDataModel, passing a collator to be used for string comparison.
78
79        @param DelegatorModel
80            is the data model to which read requests are delegated
81        @param Collator
82            is the collator to be used for string comparison
83        @throws ::com::sun::star::lang::IllegalArgumentException
84            if the given <code>DelegatorModel</code> is <NULL/>
85    */
86    createWithCollator(
87            [in] XMutableGridDataModel DelegatorModel,
88            [in] ::com::sun::star::i18n::XCollator Collator
89        )
90        raises ( ::com::sun::star::lang::IllegalArgumentException );
91};
92
93//==================================================================================================================
94
95}; }; }; }; };
96
97//==================================================================================================================
98
99#endif
100