xref: /trunk/main/sc/inc/sortparam.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
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 SC_SORTPARAM_HXX
29 #define SC_SORTPARAM_HXX
30 
31 #include "address.hxx"
32 #include <tools/string.hxx>
33 #include <tools/solar.h>
34 #include <com/sun/star/lang/Locale.hpp>
35 #include "scdllapi.h"
36 
37 #define MAXSORT     3
38 
39 
40 struct ScSubTotalParam;
41 struct ScQueryParam;
42 
43 struct SC_DLLPUBLIC ScSortParam
44 {
45     SCCOL       nCol1;
46     SCROW       nRow1;
47     SCCOL       nCol2;
48     SCROW       nRow2;
49     sal_Bool        bHasHeader;
50     sal_Bool        bByRow;
51     sal_Bool        bCaseSens;
52     sal_Bool        bUserDef;
53     sal_uInt16      nUserIndex;
54     sal_Bool        bIncludePattern;
55     sal_Bool        bInplace;
56     SCTAB       nDestTab;
57     SCCOL       nDestCol;
58     SCROW       nDestRow;
59     sal_Bool        bDoSort[MAXSORT];
60     SCCOLROW    nField[MAXSORT];
61     sal_Bool        bAscending[MAXSORT];
62     ::com::sun::star::lang::Locale      aCollatorLocale;
63     String      aCollatorAlgorithm;
64     sal_uInt16      nCompatHeader;
65 
66     ScSortParam();
67     ScSortParam( const ScSortParam& r );
68     /// SubTotals sort
69     ScSortParam( const ScSubTotalParam& rSub, const ScSortParam& rOld );
70     /// TopTen sort
71     ScSortParam( const ScQueryParam&, SCCOL nCol );
72 
73     ScSortParam&    operator=   ( const ScSortParam& r );
74     sal_Bool            operator==  ( const ScSortParam& rOther ) const;
75     void            Clear       ();
76 
77     void            MoveToDest();
78 };
79 
80 
81 #endif // SC_SORTPARAM_HXX
82