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
49class aEngine;
50class aWidget;
51
61class ANANAS_EXPORT aObjectsFactory : public QSObjectFactory
62{
63public:
64 aEngine *engine;
65 aDatabase *db;
67 QObject *create( const QString &className,
68 const QSArgumentList &arguments,
69 QObject *context );
70};
71
72
73class aForm;
74
87class ANANAS_EXPORT aEngine : public QObject
88{
89 Q_OBJECT
90public:
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
162public 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();
183private slots:
184 void error ( const QString & message, QObject * context,
185 const QString & scriptName, int lineNumber );
186 void on_event( const QString &data );
187signals:
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
193private:
194 QString pr_timer;
195 QString mGlobal;
196 QDict <QVariant> values;
197
198};
199
200#endif // ENGINE_H
Definition acfg.h:437
Definition adatafield.h:61
Definition adatabase.h:78
Definition engine.h:88
aDatabase db
Definition engine.h:98
aWindowsList * wl
Definition engine.h:122
int next_obj_id
Definition engine.h:146
QSInterpreter * code
Definition engine.h:130
QSProject project
Definition engine.h:138
QWidget * ws
Definition engine.h:114
aCfg * md
Definition engine.h:106
Definition aform.h:76
Definition aobject.h:64
Definition engine.h:62
Definition awidget.h:53
Definition awindowslist.h:50