Eneboo - Documentación para desarrolladores
|
00001 /*************************************************************************** 00002 AQSEventLoop_p.h 00003 ------------------- 00004 begin : 22/02/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 AQSEVENTLOOP_P_H_ 00020 #define AQSEVENTLOOP_P_H_ 00021 00022 #include "AQSObject_p.h" 00023 #include <qeventloop.h> 00024 00025 class AQSEventLoop : public AQSObject 00026 { 00027 Q_OBJECT 00028 00029 AQ_DECLARE_AQS_OBJECT(EventLoop, Object); 00030 00031 //@AQ_BEGIN_DEF_PUB_SLOTS@ 00032 public slots: 00033 void processEvents(uint, int); 00034 virtual bool processEvents(uint); 00035 virtual bool hasPendingEvents() const; 00036 virtual void registerSocketNotifier(QSocketNotifier *); 00037 virtual void unregisterSocketNotifier(QSocketNotifier *); 00038 void setSocketNotifierPending(QSocketNotifier *); 00039 int activateSocketNotifiers(); 00040 int activateTimers(); 00041 int timeToWait() const; 00042 virtual int exec(); 00043 virtual void exit(int = 0); 00044 virtual int enterLoop(); 00045 virtual void exitLoop(); 00046 virtual int loopLevel() const; 00047 virtual void wakeUp(); 00048 00049 protected: 00050 static void *construct(const QSArgumentList &args) { 00051 QMap<int, QStringList> candidates; 00052 candidates[0].append(QString::null); 00053 candidates[1].append(QString::fromLatin1("QObject*")); 00054 candidates[2].append(QString::fromLatin1("QObject*,QString")); 00055 QString sgt(castArgsSignature(args, candidates)); 00056 if (sgt.isEmpty()) 00057 return new QEventLoop; 00058 if (sgt == QString::fromLatin1("QObject*")) 00059 return new QEventLoop(argValue<QObject *>(args[0])); 00060 if (sgt == QString::fromLatin1("QObject*,QString")) 00061 return new QEventLoop(argValue<QObject *>(args[0]), 00062 *(argValue<QString *>(args[1]))); 00063 return 0; 00064 } 00065 00066 public: 00067 static QMap<int, QStringList> candidateConstructors() { 00068 QMap<int, QStringList> candidates; 00069 candidates[0].append(QString::null); 00070 candidates[1].append(QString::fromLatin1("QObject*")); 00071 candidates[2].append(QString::fromLatin1("QObject*,QString")); 00072 return candidates; 00073 } 00074 //@AQ_END_DEF_PUB_SLOTS@ 00075 }; 00076 00077 //@AQ_BEGIN_IMP_PUB_SLOTS@ 00078 inline void AQSEventLoop::processEvents(uint arg0, int arg1) 00079 { 00080 AQ_CALL_VOID(processEvents(static_cast<QEventLoop::ProcessEventsFlags>(arg0), arg1)); 00081 } 00082 inline bool AQSEventLoop::processEvents(uint arg0) 00083 { 00084 AQ_CALL_RET_V(processEvents(static_cast<QEventLoop::ProcessEventsFlags>(arg0)), bool); 00085 } 00086 inline bool AQSEventLoop::hasPendingEvents() const 00087 { 00088 AQ_CALL_RET_V(hasPendingEvents(), bool); 00089 } 00090 inline void AQSEventLoop::registerSocketNotifier(QSocketNotifier *arg0) 00091 { 00092 AQ_CALL_VOID(registerSocketNotifier(arg0)); 00093 } 00094 inline void AQSEventLoop::unregisterSocketNotifier(QSocketNotifier *arg0) 00095 { 00096 AQ_CALL_VOID(unregisterSocketNotifier(arg0)); 00097 } 00098 inline void AQSEventLoop::setSocketNotifierPending(QSocketNotifier *arg0) 00099 { 00100 AQ_CALL_VOID(setSocketNotifierPending(arg0)); 00101 } 00102 inline int AQSEventLoop::activateSocketNotifiers() 00103 { 00104 AQ_CALL_RET_V(activateSocketNotifiers(), int); 00105 } 00106 inline int AQSEventLoop::activateTimers() 00107 { 00108 AQ_CALL_RET_V(activateTimers(), int); 00109 } 00110 inline int AQSEventLoop::timeToWait() const 00111 { 00112 AQ_CALL_RET_V(timeToWait(), int); 00113 } 00114 inline int AQSEventLoop::exec() 00115 { 00116 AQ_CALL_RET_V(exec(), int); 00117 } 00118 inline void AQSEventLoop::exit(int arg0) 00119 { 00120 AQ_CALL_VOID(exit(arg0)); 00121 } 00122 inline int AQSEventLoop::enterLoop() 00123 { 00124 AQ_CALL_RET_V(enterLoop(), int); 00125 } 00126 inline void AQSEventLoop::exitLoop() 00127 { 00128 AQ_CALL_VOID(exitLoop()); 00129 } 00130 inline int AQSEventLoop::loopLevel() const 00131 { 00132 AQ_CALL_RET_V(loopLevel(), int); 00133 } 00134 inline void AQSEventLoop::wakeUp() 00135 { 00136 AQ_CALL_VOID(wakeUp()); 00137 } 00138 //@AQ_END_IMP_PUB_SLOTS@ 00139 00140 #endif /* AQSEVENTLOOP_P_H_ */ 00141 // @AQSOBJECT@