Debian Codegraph @

DatabaseExplorer/IDbType.h

raw
1 //////////////////////////////////////////////////////////////////////////////
2 //////////////////////////////////////////////////////////////////////////////
3 //
4 // copyright : (C) 2014 Eran Ifrah
5 // file name : IDbType.h
6 //
7 // -------------------------------------------------------------------------
8 // A
9 // _____ _ _ _ _
10 // / __ \ | | | | (_) |
11 // | / \/ ___ __| | ___| | _| |_ ___
12 // | | / _ \ / _ |/ _ \ | | | __/ _ )
13 // | \__/\ (_) | (_| | __/ |___| | || __/
14 // \____/\___/ \__,_|\___\_____/_|\__\___|
15 //
16 // F i l e
17 //
18 // This program is free software; you can redistribute it and/or modify
19 // it under the terms of the GNU General Public License as published by
20 // the Free Software Foundation; either version 2 of the License, or
21 // (at your option) any later version.
22 //
23 //////////////////////////////////////////////////////////////////////////////
24 //////////////////////////////////////////////////////////////////////////////
25
26 #ifndef IDBTYPE_H
27 #define IDBTYPE_H
28
29 #include <wx/wx.h>
30 #include <wx/wxxmlserializer/XmlSerializer.h>
31
32 class IDbType :public xsSerializable
33 {
34 public:
35 IDbType(){}
36 IDbType(const IDbType& obj):xsSerializable(obj){}
37
38 /*! \brief Basic dbType parameter */
39 enum PROPERTY
40 {
41 /*! \brief Enable parameter Not NULL */
42 dbtNOT_NULL = 1,
43 /*! \brief Enable parameter SIZE*/
44 dbtSIZE = 2,
45 /*! \brief Enable parameter second SIZE */
46 dbtSIZE_TWO = 4,
47 /*! \brief Enable parameter PRIMARY KEY */
48 dbtPRIMARY_KEY = 8,
49 /*! \brief Enable parameter UNIQUE */
50 dbtUNIQUE = 16,
51 /*! \brief Enable parameter AUTO_INCREMENT */
52 dbtAUTO_INCREMENT = 32
53 };
54
55 /*! \brief Basic type for conversion */
56 enum UNIVERSAL_TYPE
57 {
58 dbtTYPE_INT = 1,
59 dbtTYPE_FLOAT = 2,
60 dbtTYPE_DECIMAL = 3,
61 dbtTYPE_TEXT = 4,
62 dbtTYPE_DATE_TIME = 5,
63 dbtTYPE_BOOLEAN = 6,
64 dbtTYPE_OTHER = 7
65 };
66
67 virtual wxString GetTypeName() = 0;
68
69 // size
70 virtual bool HaveSize() = 0;
71 virtual long GetSize() = 0;
72 virtual void SetSize(long size) = 0;
73
74 // size2
75 virtual bool HaveSize2() = 0;
76 virtual long GetSize2() = 0;
77 virtual void SetSize2(long size) = 0;
78
79
80 // primary key
81 virtual bool HavePrimaryKey() = 0;
82 virtual bool GetPrimaryKey() = 0;
83 virtual void SetPrimaryKey(bool primaryKey) = 0;
84
85 // unique
86 virtual bool HaveUnique() = 0;
87 virtual bool GetUnique() = 0;
88 virtual void SetUnique(bool unique) = 0;
89
90 // not null
91 virtual bool HaveNotNull() = 0;
92 virtual bool GetNotNull() = 0;
93 virtual void SetNotNull(bool notNull) = 0;
94
95 // auto increment
96 virtual bool HaveAutoIncrement() = 0;
97 virtual bool GetAutoIncrement() = 0;
98 virtual void SetAutoIncrement(bool autoIncrement) = 0;
99
100 // sql
101 virtual wxString ReturnSql() = 0;
102
103 virtual long GetPropertyFlags() = 0;
104 virtual void SetPropertyFlags(long flags) = 0;
105 virtual UNIVERSAL_TYPE GetUniversalType() = 0;
106
107 };
108
109
110 #endif