Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 : : *
5 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
6 : : *
7 : : * OpenOffice.org - a multi-platform office productivity suite
8 : : *
9 : : * This file is part of OpenOffice.org.
10 : : *
11 : : * OpenOffice.org is free software: you can redistribute it and/or modify
12 : : * it under the terms of the GNU Lesser General Public License version 3
13 : : * only, as published by the Free Software Foundation.
14 : : *
15 : : * OpenOffice.org is distributed in the hope that it will be useful,
16 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 : : * GNU Lesser General Public License version 3 for more details
19 : : * (a copy is included in the LICENSE file that accompanied this code).
20 : : *
21 : : * You should have received a copy of the GNU Lesser General Public License
22 : : * version 3 along with OpenOffice.org. If not, see
23 : : * <http://www.openoffice.org/license.html>
24 : : * for a copy of the LGPLv3 License.
25 : : *
26 : : ************************************************************************/
27 : :
28 : : #ifndef SVTOOLS_TABLESORT_HXX
29 : : #define SVTOOLS_TABLESORT_HXX
30 : :
31 : : #include "svtools/table/tabletypes.hxx"
32 : :
33 : : //......................................................................................................................
34 : : namespace svt { namespace table
35 : : {
36 : : //......................................................................................................................
37 : :
38 : : //==================================================================================================================
39 : : //= ColumnSortDirection
40 : : //==================================================================================================================
41 : : enum ColumnSortDirection
42 : : {
43 : : ColumnSortAscending,
44 : : ColumnSortDescending
45 : : };
46 : :
47 : : //==================================================================================================================
48 : : //= ColumnSort
49 : : //==================================================================================================================
50 : : struct ColumnSort
51 : : {
52 : : ColPos nColumnPos;
53 : : ColumnSortDirection eSortDirection;
54 : :
55 : 0 : ColumnSort()
56 : : :nColumnPos( COL_INVALID )
57 : 0 : ,eSortDirection( ColumnSortAscending )
58 : : {
59 : 0 : }
60 : :
61 : : ColumnSort( ColPos const i_columnPos, ColumnSortDirection const i_sortDirection )
62 : : :nColumnPos( i_columnPos )
63 : : ,eSortDirection( i_sortDirection )
64 : : {
65 : : }
66 : : };
67 : :
68 : : //==================================================================================================================
69 : : //= ITableDataSort
70 : : //==================================================================================================================
71 : : /** provides sorting functionality for the datta underlying an ITableModel
72 : : */
73 : 0 : class SAL_NO_VTABLE ITableDataSort
74 : : {
75 : : public:
76 : : /** sorts the rows in the model by the given column's data, in the given direction.
77 : : */
78 : : virtual void sortByColumn( ColPos const i_column, ColumnSortDirection const i_sortDirection ) = 0;
79 : :
80 : : /** retrieves the current sort order of the data
81 : :
82 : : If the <code>nColumnIndex</code> member of the returned srtructure is <code>COL_INVALID</code>, then
83 : : the data is currently not sorted.
84 : : */
85 : : virtual ColumnSort getCurrentSortOrder() const = 0;
86 : :
87 : : protected:
88 : 0 : ~ITableDataSort() {}
89 : : };
90 : :
91 : : //......................................................................................................................
92 : : } } // namespace svt::table
93 : : //......................................................................................................................
94 : :
95 : : #endif // SVTOOLS_TABLESORT_HXX
96 : :
97 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|