Salome HOME
4241f457217585edc960c9b8d24b5e5fb1141982
[modules/kernel.git] / src / SALOMEDSClient / SALOMEDSClient_AttributeTable.hxx
1 // Copyright (C) 2007-2023  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 //  File   : SALOMEDSClient_AttributeTable.hxx
21 //  Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
22 //
23 #ifndef SALOMEDSClient_AttributeTable_HeaderFile
24 #define SALOMEDSClient_AttributeTable_HeaderFile
25
26 #include <vector>
27 #include <string>
28 #include "SALOMEDSClient_definitions.hxx" 
29 #include "SALOMEDSClient_GenericAttribute.hxx" 
30
31 class SALOMEDSClient_AttributeTable: public virtual SALOMEDSClient_GenericAttribute
32 {
33 public:
34   typedef enum { 
35     AscendingOrder,
36     DescendingOrder,
37   } SortOrder;
38
39   typedef enum {
40     EmptyLowest,
41     EmptyHighest,
42     EmptyFirst,
43     EmptyLast,
44     EmptyIgnore,
45   } SortPolicy;
46
47   virtual void SetTitle(const std::string& theTitle) = 0;
48   virtual std::string GetTitle() = 0;
49   virtual void SetRowTitle(int theIndex, const std::string& theTitle) = 0;
50   virtual std::string GetRowTitle(int theIndex) = 0;
51   virtual void SetRowTitles(const std::vector<std::string>& theTitles) = 0;
52   virtual std::vector<std::string> GetRowTitles() = 0;
53   virtual void SetColumnTitle(int theIndex, const std::string& theTitle) = 0;
54   virtual std::string GetColumnTitle(int theIndex) = 0;
55   virtual void SetColumnTitles(const std::vector<std::string>& theTitles) = 0;
56   virtual std::vector<std::string> GetColumnTitles() = 0;
57   virtual void SetRowUnit(int theIndex, const std::string& theUnit) = 0;
58   virtual std::string GetRowUnit(int theIndex) = 0;
59   virtual void SetRowUnits(const std::vector<std::string>& theUnits) = 0;
60   virtual std::vector<std::string> GetRowUnits() = 0;
61
62   virtual int GetNbRows() = 0;
63   virtual int GetNbColumns() = 0;
64   virtual bool HasValue(int theRow, int theColumn) = 0;
65   virtual void RemoveValue(int theRow, int theColumn) = 0;
66
67   virtual std::vector<int> GetRowSetIndices(int theRow) = 0;
68   virtual void SetNbColumns(int theNbColumns) = 0;
69
70   virtual std::vector<int> SortRow(int theRow, SortOrder theOrder, SortPolicy thePolicy) = 0;
71   virtual std::vector<int> SortColumn(int theColumn, SortOrder theOrder, SortPolicy thePolicy) = 0;
72   virtual std::vector<int> SortByRow(int theRow, SortOrder theOrder, SortPolicy thePolicy) = 0;
73   virtual std::vector<int> SortByColumn(int theColumn, SortOrder theOrder, SortPolicy thePolicy) = 0;
74   virtual void SwapCells(int theRow1, int theColumn1, int theRow2, int theColumn2) = 0;
75   virtual void SwapRows(int theRow1, int theRow2) = 0;
76   virtual void SwapColumns(int theColumn1, int theColumn2) = 0;
77 };
78
79 #endif // SALOMEDSClient_AttributeTable_HeaderFile