Ananas Library  0.9.5
aobjectlist.h
1 /****************************************************************************
2 ** $Id: aobjectlist.h,v 1.3 2006/08/23 08:23:23 app Exp $
3 **
4 ** Header file of the Ananas Objects List of Ananas
5 ** Designer and Engine applications
6 **
7 ** Created : 20031201
8 **
9 ** Copyright (C) 2003-2004 Leader InfoTech. All rights reserved.
10 **
11 ** This file is part of the Library 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 AOBJECTLIST_H
31 #define AOBJECTLIST_H
32 
33 #include <qdatetime.h>
34 #include "acfg.h"
35 #include "asqltable.h"
36 
37 
38 class aDatabase;
39 class aObject;
40 
41 
51 class ANANAS_EXPORT aObjectList : public QObject
52 {
53  Q_OBJECT
54 // Q_PROPERTY( aObject currentObject READ currentObject )
55 public:
56  aCfg * md;
57  aCfgItem obj;
58  aDatabase * db;
59 
60  aObjectList( QObject *parent = 0, const char *name = 0 );
61  aObjectList( const QString &oname, aDatabase *adb, QObject *parent = 0, const char *name = 0 );
62  aObjectList( aCfgItem context, aDatabase *adb, QObject *parent = 0, const char *name = 0 );
63  virtual ~aObjectList();
64 
65  ERR_Code init();
66  ERR_Code decodeDocNum( QString nm, QString & pref, int & num);
67  virtual ERR_Code select( Q_ULLONG id );
68  Q_ULLONG getUid();
69  bool selected();
70  void setSelected( bool sel );
71  ERR_Code select(const QString & query );
72 
73 // virtual Q_ULLONG docId();
74 
75 
76 public slots:
77  virtual aObject *currentObject() const;
78 
79  virtual QString Uid();
80  virtual bool IsSelected();
81  virtual bool IsMarkDeleted();
82  virtual bool IsMarked();
83  virtual int SetMarkDeleted( bool Deleted );
84  virtual int SetMarked( bool Marked );
85  virtual QVariant Value( const QString & name );
86  virtual int SetValue( const QString & name, const QVariant &value );
87 
88  virtual bool Next();
89  virtual bool Prev();
90  virtual bool First();
91  virtual bool Last();
92 
93  virtual int SetFilter( const QString & valname, const QVariant & value );
94  virtual int ClearFilter();
95  virtual bool IsFiltred() {return filtred;};
96  virtual QString displayString();
97 
98 protected:
99  virtual aCfgItem displayStringContext();
100  virtual ERR_Code setObject( aCfgItem newobject );
101  virtual ERR_Code initObject();
102  bool isInited() { return vInited; };
103  void setInited( bool flag ){ vInited = flag; };
104 private:
105  aDataTable *table;
106  bool vInited, selectFlag, filtred;
107  QDict <aDataTable> dbtables;
108 // QDict <aDataRecord> attributes;
109 };
110 
111 
112 #endif
Definition: aobjectlist.h:51
Класс реализует програмный интерфейс доступа к элемен...
Definition: acfg.h:436
Определяет программный интерфейс модели данных aDataTable...
Definition: asqltable.h:54
Класс для работы с СУБД. Ananas Data Abstraction Layer. Наследует QObject...
Definition: adatabase.h:77
Базовый класс для невизуальных классов (моделей в терм...
Definition: aobject.h:63