/****************************************************************************
-** $Id: main.cpp,v 1.4 2008/12/05 21:11:54 leader Exp $
+** $Id: main.cpp,v 1.5 2008/12/25 19:08:03 leader Exp $
**
** Main file of Ananas Administrator application
**
//QApplication *application = 0;
//MainForm *mainform = 0;
-//QTranslator *translator = 0, tr_app(0), tr_lib(0), tr_plugins(0);
+QTranslator *translator = 0, tr_app(0), tr_lib(0), tr_plugins(0);
QString lang="en",
rcfile="",
username="",
userpassword="";
-int setTranslator(QString lang)
+int setTranslator(QString langdir, QString lang)
{
- QString langdir;
-#ifdef _Windows
- langdir = qApp->applicationDirPath()+"/";
-#else
- langdir = "/usr/share/ananas/translations/";
-#endif
-// tr_app.load( langdir+"ananas-administrator-"+lang+".qm",".");
-// tr_lib.load( langdir+"ananas-lib-"+lang+".qm",".");
-// tr_plugins.load( langdir+"ananas-plugins-"+lang+".qm",".");
+ tr_app.load( langdir+"ananas-administrator-"+lang+".qm",".");
+ tr_lib.load( langdir+"ananas-lib-"+lang+".qm",".");
+ tr_plugins.load( langdir+"ananas-plugins-"+lang+".qm",".");
return 0;
}
int
-parseCommandLine( int argc, char **argv )
+parseCommandLine( AApplication *a )
{
QString param, name, value;
- int i;
- char *s, locale[50]="en";
-
- strncpy( locale, QTextCodec::locale(), sizeof( locale ) );
- s = strchr( locale, '_' );
- if ( s ) {
- *s = 0;
- }
- lang = locale;
- setTranslator( lang );
+ int i, argc;
+ char **argv;
+
+ argc = a->argc();
+ argv = a->argv();
+ setTranslator( a->langDir(), a->lang() );
// printf("locale=%s\n", locale );
QString str_ru=QString::null, str_en=QString::null;
bool lang_setted = false;
if (name == "--lang") {
lang = value;
lang_setted = true;
- setTranslator( lang );
+ setTranslator( a->langDir(), lang );
}
if (name == "--rc") rcfile = value;
}
QTextCodec::setCodecForCStrings( QTextCodec::codecForName("UTF8") );
qApp->addLibraryPath( qApp->applicationDirPath() );
- if ( parseCommandLine( argc, argv ) ) return 1;
+ if ( parseCommandLine( &a ) ) return 1;
// qApp->installTranslator( &tr_app );
// qApp->installTranslator( &tr_lib );
// qApp->installTranslator( &tr_plugins );
/****************************************************************************
-** $Id: main.cpp,v 1.5 2008/12/10 21:05:14 leader Exp $
+** $Id: main.cpp,v 1.6 2008/12/25 19:08:03 leader Exp $
**
** Main file of Ananas Engine application
**
username="",
userpassword="";
-int setTranslator(QString lang)
+
+int
+setTranslator(QString langdir, QString lang)
{
- QString langdir;
-#ifdef _Windows
- langdir = qApp->applicationDirPath()+"/translations/";
-#else
- langdir = "/usr/share/ananas/translations/";
-#endif
tr_app.load( langdir+"ananas-engine-"+lang.lower()+".qm",".");
tr_lib.load( langdir+"ananas-lib-"+lang.lower()+".qm",".");
tr_plugins.load( langdir+"ananas-plugins-"+lang.lower()+".qm",".");
return 0;
}
+
+
int
-parseCommandLine( int argc, char **argv )
+parseCommandLine( AApplication *a )
{
QString param, name, value;
- int i;
- char *s, locale[50]="ru";
-
- strncpy( locale, QTextCodec::locale(), sizeof( locale ) );
- s = strchr( locale, '_' );
- if ( s ) {
- *s = 0;
- }
- lang = locale;
- setTranslator( lang );
+ int i, argc;
+ char **argv;
+
+ argc = a->argc();
+ argv = a->argv();
+ setTranslator( a->langDir(), a->lang() );
// printf("locale=%s\n", locale );
QString str_ru=QString::null, str_en=QString::null;
bool lang_setted = false;
if (name == "--lang") {
lang = value;
lang_setted = true;
- setTranslator( lang );
+ setTranslator( a->langDir(), lang );
}
if (name == "--rc") rcfile = value;
}
return 0;
}
+
+
int main( int argc, char ** argv )
{
a.setOrganizationName("ananasgroup");
a.setApplicationName("ananas");
- if ( parseCommandLine( qApp->argc(), qApp->argv() ) ) return 1;
+ if ( parseCommandLine( &a ) ) return 1;
qApp->installTranslator( &tr_app );
qApp->installTranslator( &tr_lib );
qApp->installTranslator( &tr_plugins );
/****************************************************************************
-** $Id: main.cpp,v 1.5 2008/12/05 21:11:54 leader Exp $
+** $Id: main.cpp,v 1.6 2008/12/25 19:08:03 leader Exp $
**
** Main file of Ananas Designer application
**
userpassword="";
-int setTranslator(QString lang)
+int setTranslator(QString langdir, QString lang)
{
- QString langdir;
-#ifdef Q_OS_WIN32
- langdir = qApp->applicationDirPath()+"/translations/";
-#else
- langdir = "/usr/share/ananas4/translations/";
-#endif
+// QString langdir;
+//#ifdef Q_OS_WIN32
+// langdir = qApp->applicationDirPath()+"/translations/";
+//#else
+// langdir = "/usr/share/ananas4/translations/";
+//#endif
tr_app.load( langdir+"ananas-designer-"+lang+".qm",".");
tr_lib.load( langdir+"ananas-lib-"+lang+".qm",".");
tr_plugins.load( langdir+"ananas-plugins-"+lang+".qm",".");
return 0;
}
+
+
int
-parseCommandLine( int argc, char **argv )
+parseCommandLine( AApplication *a )
{
QString param, name, value;
- int i;
- char *s, locale[50]="en";
+ int i, argc;
+ char **argv;
+
+ argc = a->argc();
+ argv = a->argv();
+// char *s, locale[50]="en";
- strncpy( locale, QTextCodec::locale(), sizeof( locale ) );
- s = strchr( locale, '_' );
- if ( s ) {
- *s = 0;
- }
- lang = locale;
- setTranslator( lang );
+// strncpy( locale, QTextCodec::locale(), sizeof( locale ) );
+// s = strchr( locale, '_' );
+// if ( s ) {
+// *s = 0;
+// }
+// lang = locale;
+ setTranslator( a->langDir(), a->lang() );
// printf("locale=%s\n", locale );
QString str_ru=QString::null, str_en=QString::null;
bool lang_setted = false;
if (name == "--lang") {
lang = value;
lang_setted = true;
- setTranslator( lang );
+ setTranslator( a->langDir(), lang );
}
if (name == "--rc") rcfile = value;
}
int rc;
QPixmap pixmap;
- if ( parseCommandLine( argc, argv ) ) return 1;
+ if ( parseCommandLine( &app ) ) return 1;
qApp->installTranslator( &tr_lib );
qApp->installTranslator( &tr_plugins );
qApp->installTranslator( &tr_app );
--- /dev/null
+/****************************************************************************
+** $Id: ametaaccregister.cpp,v 1.1 2008/12/24 16:19:38 leader Exp $
+**
+** Code file of the Ananas configuration objects of Ananas
+** Designer and Engine applications
+**
+** Created : 20031201
+**
+** Copyright (C) 2003-2004 Leader AccTech. All rights reserved.
+** Copyright (C) Grigory Panov <gr1313 at mail.ru>, Yoshkar-Ola.
+**
+** This file is part of the Library of the Ananas
+** automation accounting system.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.leaderit.ru/page=ananas or email sales@leaderit.ru
+** See http://www.leaderit.ru/gpl/ for GPL licensing information.
+**
+** Contact org@leaderit.ru if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#include "ametaaccregister.h"
+
+/*!
+ * \class AMetaAccRegister
+ *
+ */
+AMetaAccRegister::AMetaAccRegister( AMetaObject *parent )
+:AMetaObject("AccRegister", "", parent )
+{
+ setId( lastId() );
+ setName( QString("%1_%2").arg( tr("AccRegister") ).arg( id() ) );
+ addChild( &v_fields );
+ addChild( &v_gfields );
+ addChild( &v_forms );
+
+}
+
+
+AMetaFields *
+AMetaAccRegister::fields()
+{
+ return &v_fields;
+}
+
+
+
+AMetaFields *
+AMetaAccRegister::gfields()
+{
+ return &v_gfields;
+}
+
+
+AMetaForms *
+AMetaAccRegister::forms()
+{
+ return &v_forms;
+}
+
+
+
+/*!
+ * \class AMetaAccRegisters
+ *
+ */
+AMetaAccRegisters::AMetaAccRegisters()
+:AMetaGroup("AccRegisters")
+{
+
+}
--- /dev/null
+/****************************************************************************
+** $Id: ametaaccregister.h,v 1.1 2008/12/24 16:19:38 leader Exp $
+**
+** Header file of the Ananas configuration objects of Ananas
+** Designer and Engine applications
+**
+** Created : 20031201
+**
+** Copyright (C) 2003-2004 Leader AccTech. All rights reserved.
+** Copyright (C) Andrey Paskal <app at lrn dot ru>, Yoshkar-Ola
+** Copyright (C) 2003-2005 Grigory Panov <gr1313 at mail dot ru >, Yoshkar-Ola
+**
+** This file is part of the Library of the Ananas
+** automation accounting system.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.leaderit.ru/page=ananas or email sales@leaderit.ru
+** See http://www.leaderit.ru/gpl/ for GPL licensing information.
+**
+** Contact org@leaderit.ru if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#ifndef AMETAACCREGISTER_H
+#define AMETAACCREGISTER_H
+
+#include "ametaobject.h"
+#include "ametaobjectgroup.h"
+#include "ametafield.h"
+#include "ametaform.h"
+
+
+class AMetaAccRegister: public AMetaObject
+{
+Q_OBJECT
+public:
+ AMetaAccRegister( AMetaObject *parent = 0 );
+
+public slots:
+ AMetaFields *fields();
+ AMetaFields *gfields();
+ AMetaForms *forms();
+
+private:
+ AMetaFields v_fields;
+ AMetaFields v_gfields;
+ AMetaForms v_forms;
+};
+
+
+
+class AMetaAccRegisters: public AMetaGroup
+{
+Q_OBJECT
+public:
+ AMetaAccRegisters();
+
+ AMetaAccRegister *newAccRegister(){ return new AMetaAccRegister( this );};
+ AMetaAccRegister *accReister( const QString &name ){ return (AMetaAccRegister*) child( name );};
+ AMetaAccRegister *accRegister( int idx ){ return (AMetaAccRegister*) child( idx );};
+ int accRegisterCount(){ return childCount(); };
+
+public slots:
+
+
+};
+
+#endif
--- /dev/null
+/****************************************************************************
+** $Id: ametacatalogue.cpp,v 1.1 2008/12/24 16:19:38 leader Exp $
+**
+** Code file of the Ananas configuration objects of Ananas
+** Designer and Engine applications
+**
+** Created : 20031201
+**
+** Copyright (C) 2003-2004 Leader InfoTech. All rights reserved.
+** Copyright (C) Grigory Panov <gr1313 at mail.ru>, Yoshkar-Ola.
+**
+** This file is part of the Library of the Ananas
+** automation accounting system.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.leaderit.ru/page=ananas or email sales@leaderit.ru
+** See http://www.leaderit.ru/gpl/ for GPL licensing information.
+**
+** Contact org@leaderit.ru if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#include "ametacatalogue.h"
+
+/*!
+ * \class AMetaCatalogue
+ *
+ */
+AMetaCatalogue::AMetaCatalogue( AMetaObject *parent )
+:AMetaObject("Catalogue", "", parent )
+{
+ setId( lastId() );
+ setName( QString("%1_%2").arg( tr("Catalogue") ).arg( id() ) );
+ addChild( &v_fields );
+ addChild( &v_gfields );
+ addChild( &v_forms );
+
+}
+
+
+AMetaFields *
+AMetaCatalogue::fields()
+{
+ return &v_fields;
+}
+
+
+
+AMetaFields *
+AMetaCatalogue::gfields()
+{
+ return &v_gfields;
+}
+
+
+AMetaForms *
+AMetaCatalogue::forms()
+{
+ return &v_forms;
+}
+
+
+
+/*!
+ * \class AMetaCatalogues
+ *
+ */
+AMetaCatalogues::AMetaCatalogues()
+:AMetaGroup("Catalogues")
+{
+
+}
--- /dev/null
+/****************************************************************************
+** $Id: ametacatalogue.h,v 1.1 2008/12/24 16:19:38 leader Exp $
+**
+** Header file of the Ananas configuration objects of Ananas
+** Designer and Engine applications
+**
+** Created : 20031201
+**
+** Copyright (C) 2003-2004 Leader InfoTech. All rights reserved.
+** Copyright (C) Andrey Paskal <app at lrn dot ru>, Yoshkar-Ola
+** Copyright (C) 2003-2005 Grigory Panov <gr1313 at mail dot ru >, Yoshkar-Ola
+**
+** This file is part of the Library of the Ananas
+** automation accounting system.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.leaderit.ru/page=ananas or email sales@leaderit.ru
+** See http://www.leaderit.ru/gpl/ for GPL licensing information.
+**
+** Contact org@leaderit.ru if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#ifndef AMETACATALOGUE_H
+#define AMETACATALOGUE_H
+
+#include "ametaobject.h"
+#include "ametaobjectgroup.h"
+#include "ametafield.h"
+#include "ametaform.h"
+
+
+class AMetaCatalogue: public AMetaObject
+{
+Q_OBJECT
+public:
+ AMetaCatalogue( AMetaObject *parent = 0 );
+
+public slots:
+ AMetaFields *fields();
+ AMetaFields *gfields();
+ AMetaForms *forms();
+
+private:
+ AMetaFields v_fields;
+ AMetaFields v_gfields;
+ AMetaForms v_forms;
+};
+
+
+
+class AMetaCatalogues: public AMetaGroup
+{
+Q_OBJECT
+public:
+ AMetaCatalogues();
+
+ AMetaCatalogue *newCatalogue(){ return new AMetaCatalogue( this );};
+ AMetaCatalogue *catalogue( const QString &name ){ return (AMetaCatalogue*) child( name );};
+ AMetaCatalogue *catalogue( int idx ){ return (AMetaCatalogue*) child( idx );};
+ int catalogueCount(){ return childCount(); };
+
+public slots:
+
+
+};
+
+#endif
/****************************************************************************
-** $Id: ametadata.cpp,v 1.5 2008/12/20 21:17:49 leader Exp $
+** $Id: ametadata.cpp,v 1.6 2008/12/24 16:19:38 leader Exp $
**
** Code file of the Ananas configuration objects of Ananas
** Designer and Engine applications
-ACataloguesGroup *
+AMetaCatalogues *
AMetaData::catalogues()
{
return &v_catalogues;
-ADocumentsGroup *
+AMetaDocuments *
AMetaData::documents()
{
return &v_documents;
}
-AReportsGroup *
+AMetaReports *
AMetaData::reports()
{
return &v_reports;
}
-AJournalsGroup *
+AMetaJournals *
AMetaData::journals()
{
return &v_journals;
}
-AInfoRegistersGroup *
+AMetaInfoRegisters *
AMetaData::inforegisters()
{
return &v_inforegisters;
-AAccRegistersGroup *
+AMetaAccRegisters *
AMetaData::accregisters()
{
return &v_accregisters;
/****************************************************************************
-** $Id: ametadata.h,v 1.4 2008/12/20 21:17:49 leader Exp $
+** $Id: ametadata.h,v 1.5 2008/12/24 16:19:38 leader Exp $
**
** Header file of the Ananas configuration objects of Ananas
** Designer and Engine applications
#include "ametaobject.h"
#include "ametaobjectgroup.h"
#include "ametadocument.h"
+#include "ametacatalogue.h"
+#include "ametainforegister.h"
+#include "ametaaccregister.h"
+#include "ametareport.h"
+#include "ametajournal.h"
+#include "ametainfo.h"
+#include "ametaglobal.h"
#ifdef __BORLANDC__
static AMetaData* metadata();
public slots:
- AMetaDataInfo *info(){ return &v_info;};
- AMetaDataGlobal *global(){ return &v_global;};
+ AMetaInfo *info(){ return &v_info;};
+ AMetaGlobal *global(){ return &v_global;};
- ADocumentsGroup* documents();
- ACataloguesGroup* catalogues();
- AReportsGroup* reports();
- AJournalsGroup* journals();
- AInfoRegistersGroup* inforegisters();
- AAccRegistersGroup* accregisters();
+ AMetaDocuments* documents();
+ AMetaCatalogues* catalogues();
+ AMetaReports* reports();
+ AMetaJournals* journals();
+ AMetaInfoRegisters* inforegisters();
+ AMetaAccRegisters* accregisters();
QString test(){ return QString("AMETADATA TEST STRING");};
private:
- AMetaDataInfo v_info;
- AMetaDataGlobal v_global;
+ AMetaInfo v_info;
+ AMetaGlobal v_global;
//groups
- ACataloguesGroup v_catalogues;
- ADocumentsGroup v_documents;
- AReportsGroup v_reports;
- AJournalsGroup v_journals;
- AInfoRegistersGroup v_inforegisters;
- AAccRegistersGroup v_accregisters;
+ AMetaCatalogues v_catalogues;
+ AMetaDocuments v_documents;
+ AMetaReports v_reports;
+ AMetaJournals v_journals;
+ AMetaInfoRegisters v_inforegisters;
+ AMetaAccRegisters v_accregisters;
};
#endif
/****************************************************************************
-** $Id: ametadataio.cpp,v 1.2 2008/12/13 22:19:15 leader Exp $
+** $Id: ametadataio.cpp,v 1.3 2008/12/24 16:19:38 leader Exp $
**
** Code file of the Ananas configuration objects of Ananas
** Designer and Engine applications
}
-QObject *
-AMetaDataIO::createObject( const QString &name )
+AMetaObject *
+AMetaDataIO::createObject( const QString &className, AMetaObject *parent )
{
- QObject *o = 0;
- if ( name == "AMetaObject" ) return new AMetaObject();
+ AMetaObject *o = 0;
+ if ( className == "AMetaObject" ) return new AMetaObject();
// if ( name == "AMetaObjectGroup" ) return new AMetaObjectGroup();
return o;
/****************************************************************************
-** $Id: ametadataio.h,v 1.4 2008/12/19 20:15:50 leader Exp $
+** $Id: ametadataio.h,v 1.5 2008/12/24 16:19:38 leader Exp $
**
** Header file of the Ananas configuration objects of Ananas
** Designer and Engine applications
~AMetaDataIO();
virtual int read( const QString &name, AMetaData *md = 0);
virtual int write( const QString &name, AMetaData *md = 0);
- virtual QObject *createObject( const QString &name );
+ virtual AMetaObject *createObject( const QString &className, AMetaObject *parent = 0 );
//virtual void storeGroup( AMetaObjectGroup *g );
// virtual void storeGroupBegin( AMetaObjectGroup *g );
/****************************************************************************
-** $Id: ametadataioxml.cpp,v 1.5 2008/12/20 21:17:49 leader Exp $
+** $Id: ametadataioxml.cpp,v 1.7 2008/12/24 20:06:51 leader Exp $
**
** Code file of the Ananas configuration objects of Ananas
** Designer and Engine applications
xml.appendChild( rootnode );
rootnode = xml.documentElement();
-// rootnode.appendChild( AMetaObjectToXML( md ) );
-/*
- rootnode.appendChild( AMetaObjectToXML( md->info() ) );
- rootnode.appendChild( AMetaObjectToXML( md->global() ) );
-
- int i;
- for ( i = 0; i< md->groupCount(); i++ ){
- node = xml.createElement( md->group( i )->name() );
- rootnode.appendChild( node );
- }
-*/
-/* node = xml.createElement( md_info );
- rootnode.appendChild( node );
-
-
- node = xml.createElement( md_interface );
- rootnode.appendChild( node );
-
- node = xml.createElement( md_metadata );
- rootnode.appendChild( node );
-
- node = xml.createElement( md_actions );
- rootnode.appendChild( node );
-*/
-
if ( !file.open( QIODevice::WriteOnly ) ) return 1;
QTextStream ts( &file );
xml.save( ts, 4 );
if ( se.hasAttribute( "type" ) ) {
t = se.attribute("type");
v.clear();
- v = se.text();
- if ( v.convert( QVariant::nameToType( t ) ) ) o->setAttr( se.tagName(), v );
+ v = AMetaObject::strToVar( se.text(), QVariant::nameToType( t ) );
+// if ( v.convert( QVariant::nameToType( t ) ) ) o->setAttr( se.tagName(), v );
+ if ( v.isValid() ) o->setAttr( se.tagName(), v );
}
+ if ( se.tagName() == "description" &&
+ !o->inherits("AMetaGroup") ) o->setDescription( se.text() );
cur = cur.nextSibling();
}
int i;
QDomElement e, se;
- e = xml.createElement( o->className() );
- if ( !o->inherits("AMetaObjectGroup") ){
+ if ( !o ) return e;
+ e = xml.createElement( o->metaObject()->className() );
+ if ( !o->inherits("AMetaGroup") ){
if ( !o->name().isEmpty() ) {
e.setAttribute("name", o->name() );
if ( o->id() > 0 ) e.setAttribute("id", QString::number(o->id()) );
}
+ se = xml.createElement( "description" );
+ se.appendChild( xml.createTextNode( o->description() ) );
+ e.appendChild( se );
}
for ( i=0; i< o->attrCount(); i++ ){
se = xml.createElement( o->attrName( i ) );
se.setAttribute("type", o->attr( i ).typeName() );
- se.appendChild( xml.createTextNode( o->attr( i ).toString() ) );
+ se.appendChild( xml.createTextNode( AMetaObject::varToStr( o->attr( i ) ) ) );
e.appendChild( se );
}
for ( i=0; i< o->childCount(); i++ ){
/****************************************************************************
-** $Id: ametadocument.cpp,v 1.2 2008/12/20 21:17:49 leader Exp $
+** $Id: ametadocument.cpp,v 1.3 2008/12/24 16:19:38 leader Exp $
**
** Code file of the Ananas configuration objects of Ananas
** Designer and Engine applications
* \class ADocumentsGroup
*
*/
-ADocumentsGroup::ADocumentsGroup()
+AMetaDocuments::AMetaDocuments()
:AMetaGroup("Documents")
{
/****************************************************************************
-** $Id: ametadocument.h,v 1.2 2008/12/20 21:17:49 leader Exp $
+** $Id: ametadocument.h,v 1.3 2008/12/24 16:19:38 leader Exp $
**
** Header file of the Ananas configuration objects of Ananas
** Designer and Engine applications
-class ADocumentsGroup: public AMetaGroup
+class AMetaDocuments: public AMetaGroup
{
Q_OBJECT
public:
- ADocumentsGroup();
+ AMetaDocuments();
AMetaDocument *newDocument(){ return new AMetaDocument( this );};
AMetaDocument *document( const QString &name ){ return (AMetaDocument*) child( name );};
/****************************************************************************
-** $Id: ametaform.cpp,v 1.2 2008/12/20 21:17:49 leader Exp $
+** $Id: ametaform.cpp,v 1.3 2008/12/24 20:06:51 leader Exp $
**
** Code file of the Ananas configuration objects of Ananas
** Designer and Engine applications
* \class AMetaField
*
*/
-AMetaForm::AMetaForm()
-:AMetaObject("MetaForm")
+AMetaForm::AMetaForm( AMetaObject *parent )
+:AMetaObject("MetaForm", "", parent )
{
+ setSourceCode(
+ "function on_formstart()\n{\n}\n\n"
+ "function on_formstop()\n{\n}\n\n"
+ "function on_button( name )\n{\n}\n\n"
+ "function on_valuechanged( name, value )\n{\n}\n\n"
+ "function on_tabupdate( row, col, tablename )\n{\n}\n\n"
+ "function on_tablerow( tablename )\n{\n}\n\n"
+ "function on_event( source, data )\n{\n}\n\n"
+ "function on_tabrowselected( tablename, uid )\n{\n}\n\n"
+ "function on_conduct()\n{\n}\n\n"
+ );
+ setDefaultMode( 0 );
+}
+
+
+QString
+AMetaForm::sourceCode()
+{
+ return attr("sourcecode").toString();
+}
+
+
+void
+AMetaForm::setSourceCode( const QString &src )
+{
+ setAttr( "sourcecode", src );
+}
+
+
+int
+AMetaForm::defaultMode()
+{
+ return attr("defaultmode").toInt();
+}
+
+
+void
+AMetaForm::setDefaultMode( int mode )
+{
+ setAttr( "defaultmode", mode );
+}
+
+
+QByteArray
+AMetaForm::dialogue()
+{
+ return attr("dialogue").toByteArray();
+}
+
+
+void
+AMetaForm::setDialogue( const QByteArray &d )
+{
+ setAttr( "dialogue", d );
}
{
}
+
/****************************************************************************
-** $Id: ametaform.h,v 1.2 2008/12/20 21:17:49 leader Exp $
+** $Id: ametaform.h,v 1.3 2008/12/24 20:06:51 leader Exp $
**
** Header file of the Ananas configuration objects of Ananas
** Designer and Engine applications
{
Q_OBJECT
public:
- AMetaForm();
+ AMetaForm( AMetaObject *parent = 0 );
+
+ QString sourceCode();
+ void setSourceCode( const QString &src );
+
+ int defaultMode();
+ void setDefaultMode( int mode );
+
+ QByteArray dialogue();
+ void setDialogue( const QByteArray &d );
+
private:
};
+
class AMetaForms: public AMetaGroup
{
Q_OBJECT
public:
AMetaForms();
+ AMetaForm * newForm(){ return new AMetaForm( this );};
+ AMetaForm *form( const QString &name ){ return (AMetaForm*) child( name );};
+ AMetaForm *form( int idx ){ return (AMetaForm*) child( idx );};
+ int formCount(){ return childCount(); };
public slots:
--- /dev/null
+/****************************************************************************
+** $Id: ametaglobal.cpp,v 1.1 2008/12/24 16:19:38 leader Exp $
+**
+** Code file of the Ananas configuration objects of Ananas
+** Designer and Engine applications
+**
+** Created : 20031201
+**
+** Copyright (C) 2003-2004 Leader InfoTech. All rights reserved.
+** Copyright (C) Grigory Panov <gr1313 at mail.ru>, Yoshkar-Ola.
+**
+** This file is part of the Library of the Ananas
+** automation accounting system.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.leaderit.ru/page=ananas or email sales@leaderit.ru
+** See http://www.leaderit.ru/gpl/ for GPL licensing information.
+**
+** Contact org@leaderit.ru if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#include "ametaglobal.h"
+
+
+/*!
+ * \class AMetaGlobal
+ *
+ */
+AMetaGlobal::AMetaGlobal()
+:AMetaObject("Global")
+{
+ setSourceCode("function on_systemstart()\n{\n}\n");
+}
+
+
+QString
+AMetaGlobal::sourceCode()
+{
+ return attr("sourcecode").toString();
+}
+
+
+void
+AMetaGlobal::setSourceCode( const QString &src )
+{
+ setAttr( "sourcecode", src );
+}
+
+
+
--- /dev/null
+/****************************************************************************
+** $Id: ametaglobal.h,v 1.1 2008/12/24 16:19:38 leader Exp $
+**
+** Header file of the Ananas configuration objects of Ananas
+** Designer and Engine applications
+**
+** Created : 20031201
+**
+** Copyright (C) 2003-2004 Leader InfoTech. All rights reserved.
+** Copyright (C) Andrey Paskal <app at lrn dot ru>, Yoshkar-Ola
+** Copyright (C) 2003-2005 Grigory Panov <gr1313 at mail dot ru >, Yoshkar-Ola
+**
+** This file is part of the Library of the Ananas
+** automation accounting system.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.leaderit.ru/page=ananas or email sales@leaderit.ru
+** See http://www.leaderit.ru/gpl/ for GPL licensing information.
+**
+** Contact org@leaderit.ru if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#ifndef AMETAGLOBAL_H
+#define AMETAGLOBAL_H
+#include "ametaobject.h"
+
+class AMetaGlobal: public AMetaObject
+{
+Q_OBJECT
+public:
+ AMetaGlobal();
+
+ QString sourceCode();
+ void setSourceCode( const QString &src );
+
+};
+
+#endif
--- /dev/null
+/****************************************************************************
+** $Id: ametainfo.cpp,v 1.1 2008/12/24 16:19:38 leader Exp $
+**
+** Code file of the Ananas configuration objects of Ananas
+** Designer and Engine applications
+**
+** Created : 20031201
+**
+** Copyright (C) 2003-2004 Leader InfoTech. All rights reserved.
+** Copyright (C) Grigory Panov <gr1313 at mail.ru>, Yoshkar-Ola.
+**
+** This file is part of the Library of the Ananas
+** automation accounting system.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.leaderit.ru/page=ananas or email sales@leaderit.ru
+** See http://www.leaderit.ru/gpl/ for GPL licensing information.
+**
+** Contact org@leaderit.ru if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#include "ametainfo.h"
+
+/*!
+ * \class AMetaInfo
+ *
+ */
+AMetaInfo::AMetaInfo()
+:AMetaObject("Info")
+{
+ setAppName("new");
+ setAuthor("unknown");
+ setDate( QDate::currentDate() );
+ setLastId( 100 );
+
+}
+
+
+AMetaInfo::AMetaInfo( const AMetaInfo &info )
+:AMetaObject("Info")
+{
+}
+
+
+AMetaInfo::~AMetaInfo()
+{
+}
+
+
+AMetaInfo&
+AMetaInfo::operator=(const AMetaInfo&)
+{
+ return *this;
+}
+
+
+QString
+AMetaInfo::appName()
+{
+ return attr("name").toString();
+}
+
+
+void
+AMetaInfo::setAppName( const QString &name )
+{
+ setAttr( "name", name );
+}
+
+
+int
+AMetaInfo::lastId()
+{
+ return attr( "lastid" ).toInt();
+}
+
+
+void
+AMetaInfo::setLastId( int id )
+{
+ setAttr( "lastid", id );
+}
+
+
+QString
+AMetaInfo::author()
+{
+ return attr("author").toString();
+}
+
+
+void
+AMetaInfo::setAuthor( const QString &name )
+{
+ setAttr( "author", name );
+}
+
+
+QDate
+AMetaInfo::date()
+{
+ return attr("date").toDate();
+}
+
+
+void
+AMetaInfo::setDate( QDate d )
+{
+ setAttr( "date", d );
+}
--- /dev/null
+/****************************************************************************
+** $Id: ametainfo.h,v 1.1 2008/12/24 16:19:38 leader Exp $
+**
+** Header file of the Ananas configuration objects of Ananas
+** Designer and Engine applications
+**
+** Created : 20031201
+**
+** Copyright (C) 2003-2004 Leader InfoTech. All rights reserved.
+** Copyright (C) Andrey Paskal <app at lrn dot ru>, Yoshkar-Ola
+** Copyright (C) 2003-2005 Grigory Panov <gr1313 at mail dot ru >, Yoshkar-Ola
+**
+** This file is part of the Library of the Ananas
+** automation accounting system.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.leaderit.ru/page=ananas or email sales@leaderit.ru
+** See http://www.leaderit.ru/gpl/ for GPL licensing information.
+**
+** Contact org@leaderit.ru if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#ifndef AMETAINFO_H
+#define AMETAINFO_H
+
+#include "ametaobject.h"
+
+class AMetaInfo: public AMetaObject
+{
+Q_OBJECT
+Q_PROPERTY( QString appname READ appName SCRIPTABLE true )
+Q_PROPERTY( QString author READ author SCRIPTABLE true )
+Q_PROPERTY( QDate date READ date SCRIPTABLE true )
+public:
+ AMetaInfo();
+ AMetaInfo( const AMetaInfo &info );
+ ~AMetaInfo();
+ AMetaInfo& operator=(const AMetaInfo&);
+
+ QString appName();
+ void setAppName( const QString &name );
+ int lastId();
+ void setLastId( int id );
+ QString author();
+ void setAuthor( const QString &name );
+ QDate date();
+ void setDate( QDate d );
+};
+
+
+Q_DECLARE_METATYPE ( AMetaInfo )
+
+//qRegisterMetaType<AMetaDataInfo>("MetaDataInfo");
+//Q_DECLARE_METATYPE ( AMetaDataGlobal )
+
+
+#endif
--- /dev/null
+/****************************************************************************
+** $Id: ametainforegister.cpp,v 1.1 2008/12/24 16:19:38 leader Exp $
+**
+** Code file of the Ananas configuration objects of Ananas
+** Designer and Engine applications
+**
+** Created : 20031201
+**
+** Copyright (C) 2003-2004 Leader InfoTech. All rights reserved.
+** Copyright (C) Grigory Panov <gr1313 at mail.ru>, Yoshkar-Ola.
+**
+** This file is part of the Library of the Ananas
+** automation accounting system.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.leaderit.ru/page=ananas or email sales@leaderit.ru
+** See http://www.leaderit.ru/gpl/ for GPL licensing information.
+**
+** Contact org@leaderit.ru if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#include "ametainforegister.h"
+
+/*!
+ * \class AMetaInfoRegister
+ *
+ */
+AMetaInfoRegister::AMetaInfoRegister( AMetaObject *parent )
+:AMetaObject("InfoRegister", "", parent )
+{
+ setId( lastId() );
+ setName( QString("%1_%2").arg( tr("InfoRegister") ).arg( id() ) );
+ addChild( &v_fields );
+ addChild( &v_gfields );
+ addChild( &v_forms );
+
+}
+
+
+AMetaFields *
+AMetaInfoRegister::fields()
+{
+ return &v_fields;
+}
+
+
+
+AMetaFields *
+AMetaInfoRegister::gfields()
+{
+ return &v_gfields;
+}
+
+
+AMetaForms *
+AMetaInfoRegister::forms()
+{
+ return &v_forms;
+}
+
+
+
+/*!
+ * \class AMetaInfoRegisters
+ *
+ */
+AMetaInfoRegisters::AMetaInfoRegisters()
+:AMetaGroup("InfoRegisters")
+{
+
+}
--- /dev/null
+/****************************************************************************
+** $Id: ametainforegister.h,v 1.1 2008/12/24 16:19:38 leader Exp $
+**
+** Header file of the Ananas configuration objects of Ananas
+** Designer and Engine applications
+**
+** Created : 20031201
+**
+** Copyright (C) 2003-2004 Leader InfoTech. All rights reserved.
+** Copyright (C) Andrey Paskal <app at lrn dot ru>, Yoshkar-Ola
+** Copyright (C) 2003-2005 Grigory Panov <gr1313 at mail dot ru >, Yoshkar-Ola
+**
+** This file is part of the Library of the Ananas
+** automation accounting system.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.leaderit.ru/page=ananas or email sales@leaderit.ru
+** See http://www.leaderit.ru/gpl/ for GPL licensing information.
+**
+** Contact org@leaderit.ru if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#ifndef AMETAINFOREGISTER_H
+#define AMETAINFOREGISTER_H
+
+#include "ametaobject.h"
+#include "ametaobjectgroup.h"
+#include "ametafield.h"
+#include "ametaform.h"
+
+
+class AMetaInfoRegister: public AMetaObject
+{
+Q_OBJECT
+public:
+ AMetaInfoRegister( AMetaObject *parent = 0 );
+
+public slots:
+ AMetaFields *fields();
+ AMetaFields *gfields();
+ AMetaForms *forms();
+
+private:
+ AMetaFields v_fields;
+ AMetaFields v_gfields;
+ AMetaForms v_forms;
+};
+
+
+
+class AMetaInfoRegisters: public AMetaGroup
+{
+Q_OBJECT
+public:
+ AMetaInfoRegisters();
+
+ AMetaInfoRegister *newInfoRegister(){ return new AMetaInfoRegister( this );};
+ AMetaInfoRegister *infoReister( const QString &name ){ return (AMetaInfoRegister*) child( name );};
+ AMetaInfoRegister *infoRegister( int idx ){ return (AMetaInfoRegister*) child( idx );};
+ int infoRegisterCount(){ return childCount(); };
+
+public slots:
+
+
+};
+
+#endif
--- /dev/null
+/****************************************************************************
+** $Id: ametajournal.cpp,v 1.1 2008/12/24 16:19:38 leader Exp $
+**
+** Code file of the Ananas configuration objects of Ananas
+** Designer and Engine applications
+**
+** Created : 20031201
+**
+** Copyright (C) 2003-2004 Leader InfoTech. All rights reserved.
+** Copyright (C) Grigory Panov <gr1313 at mail.ru>, Yoshkar-Ola.
+**
+** This file is part of the Library of the Ananas
+** automation accounting system.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.leaderit.ru/page=ananas or email sales@leaderit.ru
+** See http://www.leaderit.ru/gpl/ for GPL licensing information.
+**
+** Contact org@leaderit.ru if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#include "ametajournal.h"
+
+/*!
+ * \class AMetaJournal
+ *
+ */
+AMetaJournal::AMetaJournal( AMetaObject *parent )
+:AMetaObject("Journal", "", parent )
+{
+ setId( lastId() );
+ setName( QString("%1_%2").arg( tr("Journal") ).arg( id() ) );
+ addChild( &v_fields );
+ addChild( &v_tables );
+ addChild( &v_forms );
+
+}
+
+
+AMetaFields *
+AMetaJournal::fields()
+{
+ return &v_fields;
+}
+
+
+
+AMetaTables *
+AMetaJournal::tables()
+{
+ return &v_tables;
+}
+
+
+AMetaForms *
+AMetaJournal::forms()
+{
+ return &v_forms;
+}
+
+
+
+/*!
+ * \class AMetaJournals
+ *
+ */
+AMetaJournals::AMetaJournals()
+:AMetaGroup("Journals")
+{
+
+}
+
--- /dev/null
+/****************************************************************************
+** $Id: ametajournal.h,v 1.1 2008/12/24 16:19:38 leader Exp $
+**
+** Header file of the Ananas configuration objects of Ananas
+** Designer and Engine applications
+**
+** Created : 20031201
+**
+** Copyright (C) 2003-2004 Leader InfoTech. All rights reserved.
+** Copyright (C) Andrey Paskal <app at lrn dot ru>, Yoshkar-Ola
+** Copyright (C) 2003-2005 Grigory Panov <gr1313 at mail dot ru >, Yoshkar-Ola
+**
+** This file is part of the Library of the Ananas
+** automation accounting system.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.leaderit.ru/page=ananas or email sales@leaderit.ru
+** See http://www.leaderit.ru/gpl/ for GPL licensing information.
+**
+** Contact org@leaderit.ru if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#ifndef AMETAJOURNAL_H
+#define AMETAJOURNAL_H
+
+#include "ametaobject.h"
+#include "ametaobjectgroup.h"
+#include "ametafield.h"
+#include "ametaform.h"
+
+
+class AMetaJournal: public AMetaObject
+{
+Q_OBJECT
+public:
+ AMetaJournal( AMetaObject *parent = 0 );
+
+public slots:
+ AMetaFields *fields();
+ AMetaTables *tables();
+ AMetaForms *forms();
+
+private:
+ AMetaFields v_fields;
+ AMetaTables v_tables;
+ AMetaForms v_forms;
+};
+
+
+
+class AMetaJournals: public AMetaGroup
+{
+Q_OBJECT
+public:
+ AMetaJournals();
+
+ AMetaJournal *newJournal(){ return new AMetaJournal( this );};
+ AMetaJournal *journal( const QString &name ){ return (AMetaJournal*) child( name );};
+ AMetaJournal *journal( int idx ){ return (AMetaJournal*) child( idx );};
+ int journalCount(){ return childCount(); };
+
+public slots:
+
+
+};
+
+#endif
/****************************************************************************
-** $Id: ametaobject.cpp,v 1.5 2008/12/20 21:17:49 leader Exp $
+** $Id: ametaobject.cpp,v 1.7 2008/12/24 20:06:51 leader Exp $
**
** Code file of the Ananas configuration objects of Ananas
** Designer and Engine applications
setDescription("");
setId( 0 );
if ( parent ) parent->addChild( this );
-// if ( !this->inherits("AMetaObjectGroup") ) setId( lastId() );
}
QString
AMetaObject::description()
{
+// return attr("description").toString();
return v_description;
}
void
AMetaObject::setDescription( const QString &descr )
{
+// setAttr( "description", descr );
v_description = descr;
}
}
-
-/*!
- * \class AMetaCatalogue
- *
- */
-AMetaCatalogue::AMetaCatalogue()
-:AMetaObject("Catalogue")
-{
- setId( lastId() );
- setName( QString("%1_%2").arg( tr("Catalogue") ).arg( id() ) );
-}
-
-
-
-/*!
- * \class AMetaDataInfo
- *
- */
-AMetaDataInfo::AMetaDataInfo()
-:AMetaObject("Info")
-{
- setAppName("new");
- setAuthor("unknown");
- setDate( QDate::currentDate() );
- setLastId( 100 );
-
-}
-
-
-AMetaDataInfo::AMetaDataInfo( const AMetaDataInfo &info )
-:AMetaObject("Info")
-{
-}
-
-
-AMetaDataInfo::~AMetaDataInfo()
-{
-}
-
-
-AMetaDataInfo&
-AMetaDataInfo::operator=(const AMetaDataInfo&)
-{
- return *this;
-}
-
-
-QString
-AMetaDataInfo::appName()
-{
- return attr("name").toString();
-}
-
-
-void
-AMetaDataInfo::setAppName( const QString &name )
-{
- setAttr( "name", name );
-}
-
-
-int
-AMetaDataInfo::lastId()
+QString
+AMetaObject::varToStr( QVariant v )
{
- return attr( "lastid" ).toInt();
-}
-
-
-void
-AMetaDataInfo::setLastId( int id )
-{
- setAttr( "lastid", id );
-}
-
-
-QString
-AMetaDataInfo::author()
-{
- return attr("author").toString();
-}
-
-
-void
-AMetaDataInfo::setAuthor( const QString &name )
-{
- setAttr( "author", name );
-}
-
-
-QDate
-AMetaDataInfo::date()
-{
- return attr("date").toDate();
-}
+ QString s;
-
-void
-AMetaDataInfo::setDate( QDate d )
-{
- setAttr( "date", d );
-}
-
-
-
-/*!
- * \class AMetaDataGlobal
- *
- */
-AMetaDataGlobal::AMetaDataGlobal()
-:AMetaObject("Global")
-{
- setSourceCode("function on_systemstart()\n{\n}\n");
+ switch ( v.type() ){
+ case QVariant::ByteArray:
+ s = v.toByteArray().toHex();
+ break;
+ default:
+ s = v.toString();
+ }
+ return s;
}
-QString
-AMetaDataGlobal::sourceCode()
+QVariant
+AMetaObject::strToVar( const QString &str, QVariant::Type t )
{
- return attr("sourcecode").toString();
-}
+ QVariant v;
-
-void
-AMetaDataGlobal::setSourceCode( const QString &src )
-{
- setAttr( "sourcecode", src );
+ switch ( t ){
+ case QVariant::ByteArray:
+ v = QByteArray::fromHex( str.toLatin1() );
+ break;
+ default:
+ v = str;
+ }
+ if ( v.convert( t ) ) return v;
+ return QVariant();
}
/****************************************************************************
-** $Id: ametaobject.h,v 1.5 2008/12/20 21:17:49 leader Exp $
+** $Id: ametaobject.h,v 1.7 2008/12/24 20:06:51 leader Exp $
**
** Header file of the Ananas configuration objects of Ananas
** Designer and Engine applications
bool attrExists( const QString &name );
int attrCount() const;
- static int lastId();
- static void setLastId( int id );
int childCount();
AMetaObject *child( int idx );
void addChild( AMetaObject * c );
void removeChild( AMetaObject * c );
+ static int lastId();
+ static void setLastId( int id );
+ static QString varToStr( QVariant v );
+ static QVariant strToVar( const QString &str, QVariant::Type t );
+
public slots:
private:
typedef AMetaGroupA<AMetaObject> AMetaGroupAXXX;
-
-class AMetaCatalogue: public AMetaObject
-{
-Q_OBJECT
-public:
- AMetaCatalogue();
-};
-
-
-
-class AMetaDataInfo: public AMetaObject
-{
-Q_OBJECT
-Q_PROPERTY( QString appname READ appName SCRIPTABLE true )
-Q_PROPERTY( QString author READ author SCRIPTABLE true )
-Q_PROPERTY( QDate date READ date SCRIPTABLE true )
-public:
- AMetaDataInfo();
- AMetaDataInfo( const AMetaDataInfo &info );
- ~AMetaDataInfo();
- AMetaDataInfo& operator=(const AMetaDataInfo&);
-
- QString appName();
- void setAppName( const QString &name );
- int lastId();
- void setLastId( int id );
- QString author();
- void setAuthor( const QString &name );
- QDate date();
- void setDate( QDate d );
-};
-
-
-class AMetaDataGlobal: public AMetaObject
-{
-Q_OBJECT
-public:
- AMetaDataGlobal();
-
- QString sourceCode();
- void setSourceCode( const QString &src );
-
-};
-
-Q_DECLARE_METATYPE ( AMetaDataInfo )
-
-//qRegisterMetaType<AMetaDataInfo>("MetaDataInfo");
-//Q_DECLARE_METATYPE ( AMetaDataGlobal )
-
#endif
/****************************************************************************
-** $Id: ametaobjectgroup.cpp,v 1.4 2008/12/20 21:17:49 leader Exp $
+** $Id: ametaobjectgroup.cpp,v 1.5 2008/12/24 16:19:38 leader Exp $
**
** Code file of the Ananas configuration objects of Ananas
** Designer and Engine applications
/*!
- * \class AMetaGroup
- *
- */
-
-
-
-/*!
- * \class ACataloguesGroup
- *
- */
-ACataloguesGroup::ACataloguesGroup()
-:AMetaGroup("Catalogues")
-{
-
-}
-
-
-
-/*!
- * \class AReportsGroup
- *
- */
-AReportsGroup::AReportsGroup()
-:AMetaGroup("Reports")
-{
-
-}
-
-
-
-/*!
- * \class AReportsGroup
- *
- */
-AJournalsGroup::AJournalsGroup()
-:AMetaGroup("Journals")
-{
-
-}
-
-
-
-/*!
- * \class AInformationRegistersGroup
- *
- */
-AInfoRegistersGroup::AInfoRegistersGroup()
-:AMetaGroup("InfoRegisters")
-{
-
-}
-
-
-
-/*!
- * \class AInformationRegistersGroup
- *
- */
-AAccRegistersGroup::AAccRegistersGroup()
-:AMetaGroup("AccRegisters")
-{
-
-}
-
-
-
-/*!
* \class AMetaTables
*
*/
/****************************************************************************
-** $Id: ametaobjectgroup.h,v 1.4 2008/12/20 21:17:49 leader Exp $
+** $Id: ametaobjectgroup.h,v 1.5 2008/12/24 16:19:38 leader Exp $
**
** Header file of the Ananas configuration objects of Ananas
** Designer and Engine applications
#include <QVariant>
-class ACataloguesGroup: public AMetaGroup
-{
-Q_OBJECT
-public:
- ACataloguesGroup();
-
-public slots:
-
-
-};
-
-
-
-class AReportsGroup: public AMetaGroup
-{
-Q_OBJECT
-public:
- AReportsGroup();
-
-public slots:
-
-
-};
-
-
-
-class AJournalsGroup: public AMetaGroup
-{
-Q_OBJECT
-public:
- AJournalsGroup();
-
-public slots:
-
-
-};
-
-
-
-class AInfoRegistersGroup: public AMetaGroup
-{
-Q_OBJECT
-public:
- AInfoRegistersGroup();
-
-public slots:
-
-
-};
-
-
-
-class AAccRegistersGroup: public AMetaGroup
-{
-Q_OBJECT
-public:
- AAccRegistersGroup();
-
-public slots:
-
-
-};
--- /dev/null
+/****************************************************************************
+** $Id: ametareport.cpp,v 1.1 2008/12/24 16:19:38 leader Exp $
+**
+** Code file of the Ananas configuration objects of Ananas
+** Designer and Engine applications
+**
+** Created : 20031201
+**
+** Copyright (C) 2003-2004 Leader InfoTech. All rights reserved.
+** Copyright (C) Grigory Panov <gr1313 at mail.ru>, Yoshkar-Ola.
+**
+** This file is part of the Library of the Ananas
+** automation accounting system.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.leaderit.ru/page=ananas or email sales@leaderit.ru
+** See http://www.leaderit.ru/gpl/ for GPL licensing information.
+**
+** Contact org@leaderit.ru if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#include "ametareport.h"
+
+/*!
+ * \class AMetaReport
+ *
+ */
+AMetaReport::AMetaReport( AMetaObject *parent )
+:AMetaObject("Report", "", parent )
+{
+ setId( lastId() );
+ setName( QString("%1_%2").arg( tr("Report") ).arg( id() ) );
+ addChild( &v_fields );
+ addChild( &v_tables );
+ addChild( &v_forms );
+
+}
+
+
+AMetaFields *
+AMetaReport::fields()
+{
+ return &v_fields;
+}
+
+
+
+AMetaTables *
+AMetaReport::tables()
+{
+ return &v_tables;
+}
+
+
+AMetaForms *
+AMetaReport::forms()
+{
+ return &v_forms;
+}
+
+
+
+/*!
+ * \class AMetaReports
+ *
+ */
+AMetaReports::AMetaReports()
+:AMetaGroup("Reports")
+{
+
+}
+
--- /dev/null
+/****************************************************************************
+** $Id: ametareport.h,v 1.1 2008/12/24 16:19:38 leader Exp $
+**
+** Header file of the Ananas configuration objects of Ananas
+** Designer and Engine applications
+**
+** Created : 20031201
+**
+** Copyright (C) 2003-2004 Leader InfoTech. All rights reserved.
+** Copyright (C) Andrey Paskal <app at lrn dot ru>, Yoshkar-Ola
+** Copyright (C) 2003-2005 Grigory Panov <gr1313 at mail dot ru >, Yoshkar-Ola
+**
+** This file is part of the Library of the Ananas
+** automation accounting system.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.leaderit.ru/page=ananas or email sales@leaderit.ru
+** See http://www.leaderit.ru/gpl/ for GPL licensing information.
+**
+** Contact org@leaderit.ru if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#ifndef AMETAREPORT_H
+#define AMETAREPORT_H
+
+#include "ametaobject.h"
+#include "ametaobjectgroup.h"
+#include "ametafield.h"
+#include "ametaform.h"
+
+
+class AMetaReport: public AMetaObject
+{
+Q_OBJECT
+public:
+ AMetaReport( AMetaObject *parent = 0 );
+
+public slots:
+ AMetaFields *fields();
+ AMetaTables *tables();
+ AMetaForms *forms();
+
+private:
+ AMetaFields v_fields;
+ AMetaTables v_tables;
+ AMetaForms v_forms;
+};
+
+
+
+class AMetaReports: public AMetaGroup
+{
+Q_OBJECT
+public:
+ AMetaReports();
+
+ AMetaReport *newReport(){ return new AMetaReport( this );};
+ AMetaReport *report( const QString &name ){ return (AMetaReport*) child( name );};
+ AMetaReport *report( int idx ){ return (AMetaReport*) child( idx );};
+ int reportCount(){ return childCount(); };
+
+public slots:
+
+
+};
+
+#endif
metadata/ametaobject.h \
metadata/ametaobjectgroup.h \
metadata/ametafield.h \
+ metadata/ametainfo.h \
+ metadata/ametaglobal.h \
metadata/ametadocument.h \
+ metadata/ametacatalogue.h \
+ metadata/ametainforegister.h \
+ metadata/ametaaccregister.h \
+ metadata/ametareport.h \
+ metadata/ametajournal.h \
metadata/ametaform.h \
metadata/ametadataio.h \
metadata/ametadataioxml.h
metadata/ametaobject.cpp \
metadata/ametaobjectgroup.cpp \
metadata/ametafield.cpp \
+ metadata/ametainfo.cpp \
+ metadata/ametaglobal.cpp \
metadata/ametadocument.cpp \
+ metadata/ametacatalogue.cpp \
+ metadata/ametainforegister.cpp \
+ metadata/ametaaccregister.cpp \
+ metadata/ametareport.cpp \
+ metadata/ametajournal.cpp \
metadata/ametaform.cpp \
metadata/ametadataio.cpp \
metadata/ametadataioxml.cpp
/****************************************************************************
-** $Id: aapplication.cpp,v 1.1 2008/11/09 21:08:09 leader Exp $
+** $Id: aapplication.cpp,v 1.3 2008/12/25 19:10:21 leader Exp $
**
** Code file of the Ananas Library of Ananas
** Designer and Engine applications
#include "aapplication.h"
#include "dselectdb.h"
#include "dlogin.h"
+#include "QTextCodec"
AApplication::AApplication( int & argc, char ** argv, AApplicationType aat )
:QApplication( argc, argv, true )
{
v_aat = aat;
+ printf("langDir = %s\n", langDir().toUtf8().data() );
}
int
return v_aat;
}
+
+QString
+AApplication::applicationName()
+{
+ char *appN[] = {"unknown","ananas","designer","administrator","srv"};
+ return QString(appN[v_aat]);
+}
+
+
+QString
+AApplication::langDir()
+{
+#ifdef _Windows
+ return applicationDirPath()+"/";
+#else
+ return "/usr/share/ananas4/translations/";
+#endif
+}
+
+
+QString
+AApplication::lang()
+{
+ char *s, locale[50]="en";
+
+ strncpy( locale, QTextCodec::locale(), sizeof( locale ) );
+ s = strchr( locale, '_' );
+ if ( s ) *s = 0;
+ return QString( locale );
+}
/****************************************************************************
-** $Id: aapplication.h,v 1.2 2008/11/21 20:58:12 leader Exp $
+** $Id: aapplication.h,v 1.3 2008/12/25 19:08:03 leader Exp $
**
** Header file of the Ananas Library of Ananas
** Designer and Engine applications
AApplication( int & argc, char ** argv, AApplicationType aat = Unknown );
int applicationType();
+ QString applicationName();
+ QString langDir();
+ QString lang();
private:
int v_aat;
/****************************************************************************
-** $Id: engine.cpp,v 1.5 2008/12/23 20:15:32 leader Exp $
+** $Id: engine.cpp,v 1.6 2008/12/24 17:47:41 leader Exp $
**
** Code file of the Ananas Engine of Ananas
** Engine applications
registerClass("MetaObject",&AMetaObject::staticMetaObject);
registerClass("MetaGroup",&AMetaGroup::staticMetaObject);
- registerClass("DocumentsGroup",&ADocumentsGroup::staticMetaObject);
- registerClass("CataloguesGroup",&ACataloguesGroup::staticMetaObject);
- registerClass("MetaDataInfo",&AMetaDataInfo::staticMetaObject);
- registerClass("MetaDataGlobal",&AMetaDataGlobal::staticMetaObject);
+ registerClass("Documents",&AMetaDocuments::staticMetaObject);
+ registerClass("Catalogues",&AMetaCatalogues::staticMetaObject);
+ registerClass("MetaInfo",&AMetaInfo::staticMetaObject);
+ registerClass("MetaGlobal",&AMetaGlobal::staticMetaObject);
registerClass("PopupMenu",&Q3PopupMenu::staticMetaObject);
/****************************************************************************
-** $Id: testametadata.cpp,v 1.8 2008/12/20 21:17:49 leader Exp $
+** $Id: testametadata.cpp,v 1.9 2008/12/24 20:06:51 leader Exp $
**
** Tool for automatic running Ananas tests
**
{
AMetaDataIOXML *o = new AMetaDataIOXML();
QString xml;
+ char c[]={0,1,2,3,4,5,6,7,8,9,10,'1','2','3','4','5','6','7','8','9','0'};
AMetaData *md = AMetaData::metadata();
AMetaDocument *d = md->documents()->newDocument();
AMetaField *f;
+ AMetaForm *form;
f = d->fields()->newField();
f = d->fields()->newField();
+ form = d->forms()->newForm();
+// form->setDialogue( QByteArray("1234567890\000\001\002\003\004\005\006\007\010\011\012") );
+ form->setDialogue( QByteArray( c, sizeof(c) ) );
// delete d;
QCOMPARE( o->write("test.cfg"), 0 );