NCBI C++ ToolKit
table_data.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef GUI_OBJUTILS___TABLE_DATA__HPP
2 #define GUI_OBJUTILS___TABLE_DATA__HPP
3 
4 /* $Id: table_data.hpp 32240 2015-01-22 21:53:03Z katargir $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Roman Katargin
30  *
31  * File Description:
32  *
33  */
34 
35 #include <gui/objutils/objects.hpp>
36 
38 
40 {
41 public:
42  virtual ~ITableData() {}
43 
44  enum ColumnType {
52  kObject
53  };
54 
55  virtual string GetTableTypeId() const = 0;
56 
57  virtual ColumnType GetColumnType(size_t col) const = 0;
58  virtual bool IsHtmlColumn(size_t col) const { return false; }
59  virtual string GetColumnLabel(size_t col) const = 0;
60  virtual string GetRowLabel(size_t /*row*/) const { return ""; }
61 
62  virtual vector<string> GetColumnCommonStrings(size_t /*col*/) const { return vector<string>(); }
63  virtual vector< vector< char >* > GetColumnCommonBytes(size_t /*col*/) const { return vector<vector<char>*>(); }
64 
65  virtual size_t GetRowsCount() const = 0;
66  virtual size_t GetColsCount() const = 0;
67 
68  virtual void GetStringValue(size_t /*row*/, size_t /*col*/, string& /*value*/) const = 0;
69  virtual long GetIntValue(size_t /*row*/, size_t /*col*/) const { return 0; }
70  virtual double GetRealValue(size_t /*row*/, size_t /*col*/) const { return 0; }
71  virtual SConstScopedObject GetObjectValue(size_t /*row*/, size_t /*col*/) const { return SConstScopedObject(); }
72  virtual string GetHtmlValue(size_t /*row*/, size_t /*col*/) const { return ""; }
73 
74  virtual SConstScopedObject GetRowObject(size_t /*row*/) const { return SConstScopedObject(); }
75 
76  virtual void SetStringValue(size_t /*row*/, size_t /*col*/, const string& /*value*/) {}
77  virtual void SetIntValue(size_t /*row*/, size_t /*col*/, long /*value*/) {}
78  virtual void SetRealValue(size_t /*row*/, size_t /*col*/, double /*value*/) {}
79  virtual void SetObjectValue(size_t /*row*/, size_t /*col*/, SConstScopedObject* /*value*/) {}
80 
81  virtual bool AllowEdit(size_t /*col*/) { return false; }
82 };
83 
85 
86 #endif // GUI_OBJUTILS___TABLE_DATA__HPP
virtual string GetTableTypeId() const =0
virtual bool AllowEdit(size_t)
Definition: table_data.hpp:81
virtual void SetIntValue(size_t, size_t, long)
Definition: table_data.hpp:77
virtual string GetColumnLabel(size_t col) const =0
virtual size_t GetRowsCount() const =0
virtual ColumnType GetColumnType(size_t col) const =0
virtual void SetRealValue(size_t, size_t, double)
Definition: table_data.hpp:78
virtual vector< string > GetColumnCommonStrings(size_t) const
Definition: table_data.hpp:62
virtual void SetObjectValue(size_t, size_t, SConstScopedObject *)
Definition: table_data.hpp:79
virtual SConstScopedObject GetRowObject(size_t) const
Definition: table_data.hpp:74
virtual double GetRealValue(size_t, size_t) const
Definition: table_data.hpp:70
virtual void GetStringValue(size_t, size_t, string &) const =0
virtual string GetHtmlValue(size_t, size_t) const
Definition: table_data.hpp:72
virtual string GetRowLabel(size_t) const
Definition: table_data.hpp:60
virtual vector< vector< char > * > GetColumnCommonBytes(size_t) const
Definition: table_data.hpp:63
virtual size_t GetColsCount() const =0
virtual long GetIntValue(size_t, size_t) const
Definition: table_data.hpp:69
virtual void SetStringValue(size_t, size_t, const string &)
Definition: table_data.hpp:76
virtual bool IsHtmlColumn(size_t col) const
Definition: table_data.hpp:58
virtual SConstScopedObject GetObjectValue(size_t, size_t) const
Definition: table_data.hpp:71
virtual ~ITableData()
Definition: table_data.hpp:42
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
Modified on Fri Jan 05 07:26:03 2024 by modify_doxy.py rev. 669887