Ananas Library  0.9.5
adocument.h
1 /****************************************************************************
2 ** $Id: adocument.h,v 1.39 2006/09/28 13:04:13 gr Exp $
3 **
4 ** Document 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 ADOCUMENT_H
31 #define ADOCUMENT_H
32 
33 #include <qdatetime.h>
34 #include "acfg.h"
35 #include "aobject.h"
36 //#include "adocjournal.h"
37 
38 class aDocJournal;
39 
40 class aDatabase;
41 
42 
43 
62 class ANANAS_EXPORT aDocument :public aObject
63 {
64  Q_OBJECT
65  ERR_Code tableDeleteLines( const QString & tablename );
66  ERR_Code tableSelect( const QString & tablename, Q_ULLONG = 0 );
67 public:
68 
69  aDocument( aCfgItem context, aDatabase * adb = 0 );
70  aDocument( const QString & name, aDatabase * adb = 0 );
71  virtual ~aDocument();
72 
73  virtual ERR_Code select ( Q_ULLONG uid );
74  virtual ERR_Code initObject();
75  virtual QString trSysName( const QString & sname );
76  virtual QVariant sysValue( const QString & sname, const QString & = ""); // second parameter is here to make method declaration identical to aObject::sysValue
77  virtual ERR_Code setSysValue( const QString & sname, QVariant value, const QString & = ""); // third parameter makes method declaration identical to aObject::setSysValue
78 
79  aSQLTable * getTable( const QString & tablename );
80 public slots:
81 
82  virtual ERR_Code New();
83  virtual ERR_Code Delete();
84  virtual ERR_Code Update();
85  virtual ERR_Code Select( QDateTime from, QDateTime to );
86  virtual bool Select();
87  virtual ERR_Code Select( const QString & num );
88  virtual int SelectDocument( QVariant uid );
89  virtual ERR_Code Copy();
90 
91  virtual bool Next();
92  virtual bool Prev();
93  virtual bool First();
94  virtual bool Last();
95 
96  virtual ERR_Code TableNewLine( const QString & tablename );
97  virtual ERR_Code TableDelete(const QString & tablename);
98  virtual ERR_Code TableSelect( const QString & name );
99 
100  virtual QVariant TableValue( const QString & tablename, const QString & name );
101  virtual ERR_Code TableSetValue( const QString & tablename, const QString & name,
102  const QVariant &value );
103  virtual ERR_Code TableUpdate( const QString & tablename = "" );
104 
105  virtual bool TableNext( const QString & name);
106  virtual bool TablePrev( const QString & name);
107  virtual bool TableFirst( const QString & name);
108  virtual bool TableLast( const QString & name);
109 
110  virtual bool IsMarkDeleted();
111  virtual bool IsMarked();
112  virtual ERR_Code SetMarkDeleted( bool Deleted );
113  virtual ERR_Code SetMarked( bool Marked );
114 
115  void SetPrefix( const QString & pr );
116  QString Prefix();
117 
118  virtual QVariant Value( const QString & name, const QString &tableName = "" );
119 
120  virtual ERR_Code SetFilter( const QString & valname, const QVariant & value );
121  virtual ERR_Code ClearFilter();
122 
123  ERR_Code Conduct(); //depricated
124  ERR_Code UnConduct(); //depricated
125  bool IsConducted(); // depricated
126  ERR_Code SignIn();
127  ERR_Code SignOut();
128  bool IsSignedIn();
129 // virtual ERR_Code TableSetFilter( const QString & tname, const QString & valname, const QVariant & value );
130 // virtual ERR_Code TableClearFilter( const QString & tname );
131  void Seek(int pos, const QString &tname);
132  QVariant GetDocumentValue(QVariant ide, const QString &fname);
133 
134 private:
135  QString pref;
136  aDocJournal* sysJournal;
137  ERR_Code setConduct( bool cond );
138 };
139 
140 #endif// ADOCUMENT_H
virtual ERR_Code select(Q_ULLONG id)
Позиционирует указатель в БД на запись, соотвествующую...
Definition: aobject.cpp:857
virtual int Conduct()
Проводит документ.
Definition: aobject.cpp:776
virtual int ClearFilter()
Чистит фильтр записей/объектов.
Definition: aobject.cpp:1193
Определяет программный интерфейс для работы с бизнес о...
Definition: adocument.h:62
virtual bool Last(const QString &tableName="")
Перемещает указатель на последнюю запись SQL таблицы.
Definition: aobject.cpp:1078
virtual ERR_Code initObject()
Инициализирует объект при его создании.
Definition: aobject.cpp:253
virtual bool IsMarkDeleted(const QString &tname="")
Checks &quot;Deleted&quot; marker.
Definition: aobject.cpp:535
virtual QVariant sysValue(const QString &name, const QString &tableName="")
Gets system field value.
Definition: aobject.cpp:438
virtual int setSysValue(const QString &name, QVariant value, const QString &tableName="")
Sets system field value.
Definition: aobject.cpp:455
virtual int Delete()
Удаляет текущий объект из базы данных.
Definition: aobject.cpp:692
virtual bool Prev(const QString &tableName="")
Перемещает указатель на предыдующую запись SQL таблицы...
Definition: aobject.cpp:1052
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 int UnConduct()
Отменяет проведение документа.
Definition: aobject.cpp:798
virtual int Update()
Обновляет запись в базе данных текущеми значениями.
Definition: aobject.cpp:718
Определяет программный интерфейс управления общим (си...
Definition: adocjournal.h:58
virtual bool IsMarked()
Checks &quot;Marked&quot; marker.
Definition: aobject.cpp:549
virtual bool IsConducted()
Проверяет проведен ли документ.
Definition: aobject.cpp:820
Класс для работы с СУБД. Ananas Data Abstraction Layer. Наследует QObject...
Definition: adatabase.h:77
virtual QVariant Value(const QString &name, const QString &tableName="")
Return field value of the primary object database table.
Definition: aobject.cpp:475
virtual int Copy()
Создает новый объект, являющийся клоном текущего объек...
Definition: aobject.cpp:674
virtual QString trSysName(const QString &sname)
Not implemented.
Definition: aobject.cpp:426
Базовый класс для невизуальных классов (моделей в терм...
Definition: aobject.h:63
virtual int SetFilter(const QString &valname, const QVariant &value)
Задает фильтр записей/объектов
Definition: aobject.cpp:1178
virtual int TableUpdate(const QString &tablename)
Обновляет базу данных данными табличной части объекта...
Definition: aobject.cpp:1241
virtual bool Next(const QString &tableName="")
Перемещает указатель на следующую запись SQL таблицы.
Definition: aobject.cpp:1040
virtual int SetMarkDeleted(bool Deleted, const QString &tablename="")
Устанавливает признак логического удаления объекта (з...
Definition: aobject.cpp:581
virtual int SetMarked(bool Marked)
Выставляет отметку на объекте.
Definition: aobject.cpp:605