Eneboo - Documentación para desarrolladores
|
00001 /*************************************************************************** 00002 AQSObjectFactory_p.h 00003 ------------------- 00004 begin : 29/01/2011 00005 copyright : (C) 2003-2011 by InfoSiAL S.L. 00006 email : mail@infosial.com 00007 ***************************************************************************/ 00008 /*************************************************************************** 00009 * This program is free software; you can redistribute it and/or modify * 00010 * it under the terms of the GNU General Public License as published by * 00011 * the Free Software Foundation; version 2 of the License. * 00012 ***************************************************************************/ 00013 /*************************************************************************** 00014 Este programa es software libre. Puede redistribuirlo y/o modificarlo 00015 bajo los términos de la Licencia Pública General de GNU en su 00016 versión 2, publicada por la Free Software Foundation. 00017 ***************************************************************************/ 00018 00019 #ifndef AQSOBJECTFACTORY_P_H_ 00020 #define AQSOBJECTFACTORY_P_H_ 00021 00022 #include <qwidget.h> 00023 00024 #define AQ_REG_CLASS(Class) \ 00025 registerClass(AQ_QUOTEME(Q##Class), AQ_QUOTEME(AQS##Class)) 00026 #define AQ_REG_CLASS_AQOBJECT(Class) \ 00027 registerClass(AQ_QUOTEME(AQ##Class), AQ_QUOTEME(AQS##Class)) 00028 00029 #define AQ_CRE_OBJECT(Class) \ 00030 if (className == AQ_QUOTEME(Q##Class)) { \ 00031 QObject *qo = AQS##Class::Q##Class##_(arguments); \ 00032 if (!qo && candidateCtors) \ 00033 *candidateCtors = AQS##Class::candidateConstructors(); \ 00034 return qo; \ 00035 } 00036 00037 #define AQ_CRE_AQOBJECT(Class) \ 00038 if (className == AQ_QUOTEME(AQ##Class)) { \ 00039 QObject *aq = AQS##Class::AQ##Class##_(arguments); \ 00040 if (!aq && candidateCtors) \ 00041 *candidateCtors = AQS##Class::candidateConstructors(); \ 00042 return aq; \ 00043 } 00044 00045 #define AQ_CRE_WIDGET(Class) AQ_CRE_OBJECT(Class) 00046 00047 #define AQ_CRE_AQWIDGET(Class) AQ_CRE_AQOBJECT(Class) 00048 00049 #define AQ_CRE_VOIDPTR(Class) \ 00050 if (className == AQ_QUOTEME(Q##Class)) { \ 00051 AQS##Class *aqo = new AQS##Class(AQS##Class::Q##Class##_(arguments)); \ 00052 if ((!aqo || !aqo->AQSBaseObject::isValid()) && candidateCtors) \ 00053 *candidateCtors = AQS##Class::candidateConstructors(); \ 00054 return aqo; \ 00055 } 00056 00057 #define AQ_CRE_VOIDPTR_AQOBJECT(Class) \ 00058 if (className == AQ_QUOTEME(AQ##Class)) { \ 00059 AQS##Class *aqo = new AQS##Class(AQS##Class::AQ##Class##_(arguments)); \ 00060 if ((!aqo || !aqo->AQSBaseObject::isValid()) && candidateCtors) \ 00061 *candidateCtors = AQS##Class::candidateConstructors(); \ 00062 return aqo; \ 00063 } 00064 00065 class AQSObjectFactoryPrivate 00066 { 00067 public: 00068 AQSObjectFactoryPrivate() { 00069 } 00070 ~AQSObjectFactoryPrivate() { 00071 } 00072 00073 QMap<int, QStringList> candidateCtors_; 00074 }; 00075 00076 #endif /* AQSOBJECTFACTORY_P_H_ */ 00077