JQTimerBridge.h

00001 /*
00002  * @(#)JQTimerBridge.h  0.2.0 / 2007-09-05
00003  *
00004  * Copyright (c) 2007, ETF and contributors. All rights reserved.
00005  *
00006  * This software is licensed under the LGPL, version 2.1, license.
00007  * A copy of the license is included in the file LICENSE-LGPL.txt.
00008  */
00009 #ifndef JQTIMERBRIDGE_H
00010 #define JQTIMERBRIDGE_H
00011 
00012 #include "JavaQxQSwing.h"
00013 
00014 /*^**************************************************************************^*/
00015 /*- JQTimerBridge Class.                                                     -*/
00016 /*^**************************************************************************^*/
00017 
00024 class JAVAQX_EXPORT JQTimerBridge : public QObject
00025 {
00026   Q_OBJECT
00027 protected: // native calls
00028   JQTimerBridge(JNIEnv *env, jobject obj, jint delay, jint initialDelay,
00029                 jboolean singleShot);
00030   virtual ~JQTimerBridge();
00031 public slots: // native calls
00032   void destroy(JNIEnv *env);
00033   void setInterval(JNIEnv *env, jint interval);
00034   void setSingleShot(JNIEnv *env, jboolean singleShot);
00035 public: // native calls
00036   static void initialize(JNIEnv *env, jclass cls);
00037   static jlong newInstance(JNIEnv *env, jobject obj, jint delay,
00038                            jint initialDelay, jboolean singleShot);
00039 protected slots: // native callbacks
00040   void timeout();
00041 private:
00042   jweak m_objref;
00043   QTimer m_timer;
00044 private:
00045   static jmethodID sm_createMID;
00046   static jmethodID sm_timeoutMID;
00047 };
00048 
00049 /*^**************************************************************************^*/
00050 /*- Macro Definition.                                                        -*/
00051 /*^**************************************************************************^*/
00052 
00053 #define jqTimerBridge (reinterpret_cast<JQTimerBridge *>(bridge))
00054 
00055 #endif //JQTIMERBRIDGE_H
00056 
00057 /*^*****************************************************************************
00058   File History:
00059 
00060  - 2007-09-05 17:42:41 JavaQx Native Generator
00061    Initial version
00062 
00063 *****************************************************************************^*/

Copyright © 2007 ETF and contributors. All Rights Reserved.