Ananas Library 0.9.5
acatalogue.h
1/****************************************************************************
2** $Id: acatalogue.h,v 1.36 2008/04/12 18:05:35 app Exp $
3**
4** Catalogue metadata object header file of
5** Ananas application library
6**
7** Created : 20031201
8**
9** Copyright (C) 2003-2004 Leader InfoTech. All rights reserved.
10**
11** This file is part of the Designer application of the Ananas
12** automation accounting system.
13**
14** This file may be distributed and/or modified under the terms of the
15** GNU General Public License version 2 as published by the Free Software
16** Foundation and appearing in the file LICENSE.GPL included in the
17** packaging of this file.
18**
19** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21**
22** See http://www.leaderit.ru/page=ananas or email sales@leaderit.ru
23** See http://www.leaderit.ru/gpl/ for GPL licensing information.
24**
25** Contact org@leaderit.ru if any conditions of this licensing are
26** not clear to you.
27**
28**********************************************************************/
29
30#ifndef ACATALOGUE_H
31#define ACATALOGUE_H
32
33#include "acfg.h"
34#include "aobject.h"
35
36class aDatabase;
37class aCatGroup;
38//class aObject;
39
40
41
54class ANANAS_EXPORT aCatalogue :public aObject
55{
56 Q_OBJECT
57public:
58
59 aCatalogue(aCfgItem context, aDatabase * adb = 0);
60 aCatalogue(QString name, aDatabase * adb = 0);
61// virtual ERR_Code initObject(aDatabase * adb);
62 virtual ERR_Code initObject();
63
64protected:
65 virtual aCfgItem displayStringContext();
66
67private:
68// Q_ULLONG getCatGroup();
69 Q_ULLONG getGroup();
70// Q_ULLONG getOwner();
71// ERR_Code setOwner( Q_ULLONG ido );
72// ERR_Code setGroup( Q_ULLONG idg );
73 ERR_Code selectByOwner ( Q_ULLONG ido );
74 ERR_Code groupSelect ();
75 ERR_Code groupByParent(Q_ULLONG idp );
76public slots:
77 //virtual aCatGroup * group();
78 virtual int New( bool child);
79 virtual int New();
80 virtual int Delete();
81
82 virtual int newGroup( Q_ULLONG parentId );
83 virtual int newElement( Q_ULLONG parentId );
84
85 virtual int Update();
86 virtual int Copy();
87// virtual int SetOwner( aCatalogue * cat );
88// virtual int SetGroup( aCatalogue * cat );
89 virtual int Select( bool grouponly = false );
90 void UnSelect( bool grouponly = false );
91 virtual int selectByLevel ( int level );
92 virtual int selectByGroup ( Q_ULLONG idg );
93 virtual Q_ULLONG idGroupByElement(Q_ULLONG ide );
94 virtual int groupSelect ( Q_ULLONG idg );
95
96 virtual QVariant GetElementValue(QVariant ide, const QString &fname);
97 virtual bool FindById(QString el_id);
98
99 virtual Q_ULLONG delElement();
100 virtual Q_ULLONG delGroup(Q_ULLONG idg, QValueList<Q_ULLONG> &listDelId);
101
102 Q_ULLONG setMarkDeletedElement(Q_ULLONG el_id, bool del);
103 Q_ULLONG setMarkDeletedGroup(Q_ULLONG gr_id, bool del);
104 void getMarkDeletedList(Q_ULLONG idg, QValueList<Q_ULLONG> &listDelId);
105
106 virtual bool isGroupMarkDeleted();
107 virtual bool isElementMarkDeleted();
108
109 virtual bool Next();
110 virtual bool Prev();
111 virtual bool First();
112 virtual bool Last();
113
114 virtual bool NextInGroupTable();
115 virtual bool PrevInGroupTable();
116 virtual bool FirstInGroupTable();
117 virtual bool LastInGroupTable();
118
119 virtual int GroupNew( bool reparent = false );
120 virtual int GroupDelete();
121 virtual int GroupMarkDeleted();
122 virtual int GroupUpdate();
123 virtual int GroupSelect();
124 virtual int GroupSetGroup( aCatalogue * cat );
125 virtual QVariant GroupValue( const QString & name );
126 virtual int GroupSetValue( const QString & name, const QVariant & value);
127 virtual QVariant GroupSysValue( const QString & name );
128 virtual int GroupSetSysValue( const QString & name, const QVariant & value);
129// virtual ERR_Code GroupSelectChild( aCatalogue * parent = 0 );
130 virtual QStringList getUserFields();
131 virtual QStringList getGroupUserFields();
132};
133
134class ANANAS_EXPORT aCatElement :public aObject
135{
136 Q_OBJECT
137public:
138 aCatElement(aCfgItem context, aDatabase * adb = 0);
139
140};
141
142
143
154class ANANAS_EXPORT aCatGroup :public aObject
155{
156 Q_OBJECT
157 void setLevel( Q_ULLONG newlevel );
158 virtual QString trSysName( const QString & sname );
159 QVariant sysValue( const QString & sname );
160public:
161 aCatGroup(aCfgItem context, aDatabase * adb = 0);
162 aCatGroup(QString name, aDatabase * adb = 0);
163 virtual ERR_Code initObject();
164 Q_ULLONG parentUid();
165public slots:
166 ERR_Code New();
167 ERR_Code New(aCatGroup *gr);
168 ERR_Code Select();
169 ERR_Code SelectChild( aCatGroup * parent = 0 );
170 ERR_Code SetParent( aCatGroup * parent );
171protected:
172 virtual aCfgItem displayStringContext();
173};
174
175#endif// ACATALOGUE_H
Definition acatalogue.h:155
ERR_Code Select()
Definition acatalogue.cpp:1216
ERR_Code SetParent(aCatGroup *parent)
Definition acatalogue.cpp:1265
Q_ULLONG parentUid()
Definition acatalogue.cpp:1078
ERR_Code SelectChild(aCatGroup *parent=0)
Definition acatalogue.cpp:1238
virtual QVariant GroupSysValue(const QString &name)
Definition acatalogue.cpp:886
Q_ULLONG setMarkDeletedElement(Q_ULLONG el_id, bool del)
Definition acatalogue.cpp:634
void UnSelect(bool grouponly=false)
Definition acatalogue.cpp:378
virtual QStringList getGroupUserFields()
Definition acatalogue.cpp:1013
virtual Q_ULLONG idGroupByElement(Q_ULLONG ide)
Definition acatalogue.cpp:513
virtual int Select(bool grouponly=false)
Definition acatalogue.cpp:327
virtual Q_ULLONG delElement()
Definition acatalogue.cpp:661
virtual Q_ULLONG delGroup(Q_ULLONG idg, QValueList< Q_ULLONG > &listDelId)
Definition acatalogue.cpp:762
aCatalogue(aCfgItem context, aDatabase *adb=0)
Definition acatalogue.cpp:44
virtual int selectByLevel(int level)
Definition acatalogue.cpp:476
virtual int GroupSelect()
Definition acatalogue.cpp:361
void getMarkDeletedList(Q_ULLONG idg, QValueList< Q_ULLONG > &listDelId)
Definition acatalogue.cpp:696
virtual int newGroup(Q_ULLONG parentId)
Definition acatalogue.cpp:560
virtual QStringList getUserFields()
Definition acatalogue.cpp:997
virtual int newElement(Q_ULLONG parentId)
Definition acatalogue.cpp:599
virtual bool FindById(QString el_id)
Definition acatalogue.cpp:1034
Definition adatabase.h:78
virtual bool First(const QString &tableName="")
Перемещает указатель на первую запись SQL таблицы.
Definition aobject.cpp:1065
virtual int New()
Add new object record in database.
Definition aobject.cpp:625
virtual QVariant sysValue(const QString &name, const QString &tableName="")
Gets system field value.
Definition aobject.cpp:438
virtual QString trSysName(const QString &sname)
Not implemented.
Definition aobject.cpp:426
virtual bool Next(const QString &tableName="")
Перемещает указатель на следующую запись SQL таблицы.
Definition aobject.cpp:1040
virtual ERR_Code initObject()
Init object after create.
Definition aobject.cpp:253
virtual int Delete()
Definition aobject.cpp:692
virtual bool Prev(const QString &tableName="")
Перемещает указатель на предыдующую запись SQL таблицы.
Definition aobject.cpp:1052
aObject(QObject *parent=0, const char *name=0)
Definition aobject.cpp:62
virtual int Copy()
Definition aobject.cpp:674
virtual bool Last(const QString &tableName="")
Перемещает указатель на последнюю запись SQL таблицы.
Definition aobject.cpp:1078
virtual int Update()
Update curent selected object record to database.
Definition aobject.cpp:718
virtual aCfgItem displayStringContext()
Возвращает контекст (узел дерева) метаданных для вычисления строкового представления сложного типа.
Definition aobject.cpp:1311