Welcome to mirror list, hosted at ThFree Co, Russian Federation.

FbMasterTypes.h « MyRuLib « sources - github.com/lintest/myrulib.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e8bce17b448ceb06f067fde63b103c394928710b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
#ifndef __FBMASTERTYPES_H__
#define __FBMASTERTYPES_H__

#include "FbMasterInfo.h"
#include "FbDatabase.h"

class FbMasterAuthInfo: public FbMasterInfoBase
{
	public:
		FbMasterAuthInfo(int id)
			: m_id(id) {}
		FbMasterAuthInfo(const FbMasterAuthInfo &info)
			: FbMasterInfoBase(info), m_id(info.m_id) {}
		virtual FbMasterInfoBase * Clone() const
			{ return new FbMasterAuthInfo(*this); }
		int GetId() const
			{ return m_id; }
		virtual bool operator==(const FbMasterInfoBase & info) {
			const FbMasterAuthInfo * data = wxDynamicCast(&info, FbMasterAuthInfo);
			return data && data->m_id == m_id;
		}
	protected:
		virtual wxString GetWhere(wxSQLite3Database &database) const;
		virtual wxString GetTreeSQL(wxSQLite3Database &database) const;
		virtual wxString GetOrderTable() const;
		virtual void Bind(FbSQLite3Statement  &stmt) const;
		virtual void MakeTree(wxEvtHandler *owner, FbThread * thread, wxSQLite3ResultSet &result) const;
	private:
		int m_id;
		DECLARE_CLASS(FbMasterAuthInfo);
};

class FbMasterSeqnInfo: public FbMasterInfoBase
{
	public:
		FbMasterSeqnInfo(int id)
			: m_id(id) {}
		FbMasterSeqnInfo(const FbMasterSeqnInfo &info)
			: FbMasterInfoBase(info), m_id(info.m_id) {}
		virtual FbMasterInfoBase * Clone() const
			{ return new FbMasterSeqnInfo(*this); }
		int GetId() const
			{ return m_id; }
		virtual bool operator==(const FbMasterInfoBase & info) {
			const FbMasterSeqnInfo * data = wxDynamicCast(&info, FbMasterSeqnInfo);
			return data && data->m_id == m_id;
		}
	protected:
		virtual wxString GetWhere(wxSQLite3Database &database) const;
		virtual wxString GetTreeSQL(wxSQLite3Database &database) const;
		virtual void Bind(FbSQLite3Statement  &stmt) const;
		virtual void MakeTree(wxEvtHandler *owner, FbThread * thread, wxSQLite3ResultSet &result) const;
	private:
		int m_id;
		DECLARE_CLASS(FbMasterSeqnInfo);
};

class FbMasterGenrInfo: public FbMasterInfoBase
{
	public:
		FbMasterGenrInfo(const wxString &id)
			: m_id(id) {}
		FbMasterGenrInfo(const FbMasterGenrInfo &info)
			: FbMasterInfoBase(info), m_id(info.m_id) {}
		virtual FbMasterInfoBase * Clone() const
			{ return new FbMasterGenrInfo(*this); }
		wxString GetId() const
			{ return m_id; }
		virtual bool operator==(const FbMasterInfoBase & info) {
			const FbMasterGenrInfo * data = wxDynamicCast(&info, FbMasterGenrInfo);
			return data && data->m_id == m_id;
		}
	protected:
		virtual wxString GetWhere(wxSQLite3Database &database) const;
		virtual void Bind(FbSQLite3Statement  &stmt) const;
	private:
		const wxString m_id;
		DECLARE_CLASS(FbMasterGenrInfo);
};

class FbMasterDownInfo: public FbMasterInfoBase
{
	public:
		enum DownType {
			DT_WAIT,
			DT_READY,
			DT_ERROR,
		};
		FbMasterDownInfo(DownType id)
			: m_id(id) {}
		FbMasterDownInfo(const FbMasterDownInfo &info)
			: FbMasterInfoBase(info), m_id(info.m_id) {}
		virtual FbMasterInfoBase * Clone() const
			{ return new FbMasterDownInfo(*this); }
		DownType GetId() const
			{ return m_id; }
		virtual bool operator==(const FbMasterInfoBase & info) {
			const FbMasterDownInfo * data = wxDynamicCast(&info, FbMasterDownInfo);
			return data && data->m_id == m_id;
		}
		virtual void * Execute(wxEvtHandler * owner, FbThread * thread, const FbFilterObj &filter);
	protected:
		virtual wxString GetWhere(wxSQLite3Database &database) const;
		virtual void Bind(FbSQLite3Statement  &stmt) const;
		void * GetDownloads(wxEvtHandler * owner, FbThread * thread);
	private:
		DownType m_id;
		DECLARE_CLASS(FbMasterDownInfo);
};

class FbMasterDateInfo: public FbMasterInfoBase
{
	public:
		FbMasterDateInfo(int id)
			: m_id(id) {}
		FbMasterDateInfo(const FbMasterDateInfo &info)
			: FbMasterInfoBase(info), m_id(info.m_id) {}
		virtual FbMasterInfoBase * Clone() const
			{ return new FbMasterDateInfo(*this); }
		int GetId() const
			{ return m_id; }
		virtual bool operator==(const FbMasterInfoBase & info) {
			const FbMasterDateInfo * data = wxDynamicCast(&info, FbMasterDateInfo);
			return data && data->m_id == m_id;
		}
	protected:
		virtual wxString GetWhere(wxSQLite3Database &database) const;
		virtual void Bind(FbSQLite3Statement  &stmt) const;
	private:
		int m_id;
		DECLARE_CLASS(FbMasterDateInfo);
};

class FbMasterFldrInfo: public FbMasterInfoBase
{
	public:
		FbMasterFldrInfo(int id)
			: m_id(id) {}
		FbMasterFldrInfo(const FbMasterFldrInfo &info)
			: FbMasterInfoBase(info), m_id(info.m_id) {}
		virtual FbMasterInfoBase * Clone() const
			{ return new FbMasterFldrInfo(*this); }
		int GetId() const
			{ return m_id; }
		virtual bool operator==(const FbMasterInfoBase & info) {
			const FbMasterFldrInfo * data = wxDynamicCast(&info, FbMasterFldrInfo);
			return data && data->m_id == m_id;
		}
	protected:
		virtual wxString GetWhere(wxSQLite3Database &database) const;
		virtual void Bind(FbSQLite3Statement  &stmt) const;
	private:
		int m_id;
		DECLARE_CLASS(FbMasterFldrInfo);
};

class FbMasterCommInfo: public FbMasterInfoBase
{
	public:
		FbMasterCommInfo()
			{}
		FbMasterCommInfo(const FbMasterCommInfo &info)
			: FbMasterInfoBase(info) {}
		virtual FbMasterInfoBase * Clone() const
			{ return new FbMasterCommInfo(*this); }
		virtual bool operator==(const FbMasterInfoBase & info) {
			return IsSameAs(info);
		}
	protected:
		virtual wxString GetWhere(wxSQLite3Database &database) const;
		virtual void Bind(FbSQLite3Statement  &stmt) const;
	private:
		DECLARE_CLASS(FbMasterCommInfo);
};

class FbMasterRateInfo: public FbMasterInfoBase
{
	public:
		FbMasterRateInfo(int id)
			: m_id(id) {}
		FbMasterRateInfo(const FbMasterRateInfo &info)
			: FbMasterInfoBase(info), m_id(info.m_id) {}
		virtual FbMasterInfoBase * Clone() const
			{ return new FbMasterRateInfo(*this); }
		int GetId() const
			{ return m_id; }
		virtual bool operator==(const FbMasterInfoBase & info) {
			const FbMasterRateInfo * data = wxDynamicCast(&info, FbMasterRateInfo);
			return data && data->m_id == m_id;
		}
	protected:
		virtual wxString GetWhere(wxSQLite3Database &database) const;
		virtual void Bind(FbSQLite3Statement  &stmt) const;
	private:
		int m_id;
		DECLARE_CLASS(FbMasterRateInfo);
};

class FbMasterFindInfo: public FbMasterInfoBase
{
	public:
		FbMasterFindInfo(const wxString &title, const wxString &author = wxEmptyString)
			: m_title(title), m_author(author) {}
		FbMasterFindInfo(const FbMasterFindInfo &info)
			: FbMasterInfoBase(info), m_title(info.m_title), m_author(info.m_author) {}
		virtual FbMasterInfoBase * Clone() const
			{ return new FbMasterFindInfo(*this); }
		virtual bool operator==(const FbMasterInfoBase & info) {
			const FbMasterFindInfo * data = wxDynamicCast(&info, FbMasterFindInfo);
			return data && data->m_title == m_title && data->m_author == m_author;
		}
	protected:
		virtual void * Execute(wxEvtHandler * owner, FbThread * thread, const FbFilterObj &filter);
		virtual wxString GetWhere(wxSQLite3Database &database) const;
		virtual void Bind(FbSQLite3Statement  &stmt) const;
		bool DoFind(wxEvtHandler * owner, FbThread * thread, const FbFilterObj &filter);
	private:
		wxString m_title;
		wxString m_author;
		bool m_full;
		bool m_auth;
		DECLARE_CLASS(FbMasterFindInfo);
};

class FbMasterClssInfo: public FbMasterInfoBase
{
	public:
		FbMasterClssInfo(const wxString &sql, const wxString &id)
			: m_sql(sql), m_id(id) {}
		FbMasterClssInfo(const FbMasterClssInfo & info)
			: FbMasterInfoBase(info), m_sql(info.m_sql), m_id(info.m_id) {}
		virtual FbMasterClssInfo * Clone() const
			{ return new FbMasterClssInfo(*this); }
		wxString GetId() const
			{ return m_id; }
		virtual bool operator==(const FbMasterInfoBase & info) {
			const FbMasterClssInfo * data = wxDynamicCast(&info, FbMasterClssInfo);
			return data && data->m_sql == m_sql && data->m_id == m_id;
		}
	protected:
		virtual wxString GetWhere(wxSQLite3Database &database) const;
		virtual void Bind(FbSQLite3Statement  &stmt) const;
	private:
		const wxString m_sql;
		const wxString m_id;
		DECLARE_CLASS(FbMasterClssInfo);
};

#endif // __FBMASTERTYPES_H__