Ananas Library  0.9.5
engine.h
1 /****************************************************************************
2 ** $Id: engine.h,v 1.20 2008/07/05 12:19:40 app Exp $
3 **
4 ** Header file of the Ananas Engine of Ananas
5 ** 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 /****************************************************************************
31 ****************************************************************************/
32 #ifndef ENGINE_H
33 #define ENGINE_H
34 #include <qobject.h>
35 #include <qpopupmenu.h>
36 #include <qsobjectfactory.h>
37 #include <qsproject.h>
38 #include <qsinterpreter.h>
39 
40 #include "adatabase.h"
41 #include "acfg.h"
42 #include "awindowslist.h"
43 #include <qmainwindow.h>
44 #include "adatafield.h"
45 #include "aobject.h"
46 
47 
48 
49 class aEngine;
50 class aWidget;
51 
61 class ANANAS_EXPORT aObjectsFactory : public QSObjectFactory
62 {
63 public:
64  aEngine *engine;
65  aDatabase *db;
67  QObject *create( const QString &className,
68  const QSArgumentList &arguments,
69  QObject *context );
70 };
71 
72 
73 class aForm;
74 
87 class ANANAS_EXPORT aEngine : public QObject
88 {
89  Q_OBJECT
90 public:
114  QWidget* ws;
130  QSInterpreter* code;
138  QSProject project;
147 
148  aEngine();
149  virtual ~aEngine();
150  virtual bool init( const QString &rcfile );
151  virtual void done();
152  void openEmbedCatalogueEditor(int oid, QWidget *parent=NULL, const bool toSelect=true);
153 
154  QString sourcePreprocessor( const QString &src );
155 
156  void timerEvent(QTimerEvent *e);
157  int on_systemstart();
158  int on_systemstop();
159  aForm *openForm( int oid, int fid = 0 , int defaultfor = 1,
160  int mode = 0, ANANAS_UID id = 0, aWidget* caller = 0, bool modal = false);
161 
162 public slots:
163  QString cfgname();
164  QString Time();
165  QString Date();
166  void Exit();
167  void Message(int n, const QString &msg );
168  void StatusMessage( const QString &msg );
169  void StatusMessage( const QString &msg, const int &pos );
170  void settimer(int sec, QString proc);
171  aForm * OpenForm(QString fname, int mode=0, aObject * selecter=0, bool modal=false);
172  aForm * OpenForm(QString fname, int mode, int ido,aObject * selecter=0, bool modal=false);
173  QVariant value( const QString &name );
174  void setValue( const QString &name, QVariant value = QVariant::Invalid );
175 
176  void on_MenuBar( int id );
177  void execAction( aCfgItem &act, QObject *context = 0 );
178 
179  aDataField *enterValue( const QString &FieldType, const QString &title = "" );
180  bool startTransaction();
181  bool commitTransaction();
182  bool rollbackTransaction();
183 private slots:
184  void error ( const QString & message, QObject * context,
185  const QString & scriptName, int lineNumber );
186  void on_event( const QString &data );
187 signals:
188  void statusMessage( const QString &msg );
189  void statusMessage( const QString &msg, const int &pos );
190  void statusIcon( const int &status );
191  void event( const QString &source, const QString &data );
192 
193 private:
194  QString pr_timer;
195  QString mGlobal;
196  QDict <QVariant> values;
197 
198 };
199 
200 #endif // ENGINE_H
aCfg * md
Definition: engine.h:106
int next_obj_id
Definition: engine.h:146
QSProject project
Definition: engine.h:138
Определяет программный интерфейс экранных форм Ананаса, предназначенный для использования Ананас...
Definition: aform.h:75
Класс определяет интерфейс управления списком открытых окон. Наследует QWidget.
Definition: awindowslist.h:49
Класс реализует програмный интерфейс доступа к элементам метаданных системы. Наследует QObject...
Definition: acfg.h:436
Метод aObjectsFactory::create регистрирует С++ классы Ананаса в интерпретаторе скриптов, делая доступным работу с объектами зарегистрированного класса из Ананас.Скрипта. Наследует QSObjectFactory.
Definition: engine.h:61
Класс определяет программный интерфейс для доступа к полям бизнес объектов Ананаса. Наследует QObject.
Definition: adatafield.h:60
QSInterpreter * code
Definition: engine.h:130
aDatabase db
Definition: engine.h:98
Класс для работы с СУБД. Ananas Data Abstraction Layer. Наследует QObject.
Definition: adatabase.h:77
Базовый класс для визуальных объектов. Наследует QWidget.
Definition: awidget.h:52
Базовый класс для невизуальных классов (моделей в терминологии MVC) Ананаса, которым необходим доступ...
Definition: aobject.h:63
Определяет программный интерфейс Runtime системы, который используется Ананас скриптом. Наследует QObject.
Definition: engine.h:87
QWidget * ws
Definition: engine.h:114
aWindowsList * wl
Definition: engine.h:122