JQStatusBarBridge.h

00001 /*
00002  * @(#)JQStatusBarBridge.h  0.2.0 / 2007-11-07
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 JQSTATUSBARBRIDGE_H
00010 #define JQSTATUSBARBRIDGE_H
00011 
00012 #include "JavaQxQSwing.h"
00013 
00014 #include "JQContainerBridge.h"
00015 
00016 /*^**************************************************************************^*/
00017 /*- JQStatusBarBridge Class.                                                 -*/
00018 /*^**************************************************************************^*/
00019 
00026 class JAVAQX_EXPORT JQStatusBarBridge : public JQContainerBridge
00027 {
00028   Q_OBJECT
00029 protected:
00030   JQStatusBarBridge(JNIEnv *env, jobject obj);
00031 public slots: // native calls
00032   void showMessage(JNIEnv *env, jstring message, jint timeout);
00033   void clearMessage(JNIEnv *env);
00034   void insertChild(JNIEnv *env, jlong childBridge, jint index);
00035   void insertPermanentChild(JNIEnv *env, jlong childBridge, jint index);
00036   void removeChild(JNIEnv *env, jlong childBridge);
00037   void setSizeGripEnabled(JNIEnv *env, jboolean enabled);
00038 public: // native calls
00039   static void initialize(JNIEnv *env, jclass cls);
00040   static jlong newInstance(JNIEnv *env, jobject obj);
00041 public: // native callbacks
00042   void statusMessgeChanged(jstring message);
00043 public:
00044   inline QStatusBar *qStatusBar() const;
00045 public:
00046   virtual void setParentBridge(JQContainerBridge *parentBridge);
00047 protected slots:
00048   void messageChangedSlot(const QString &message);
00049 private:
00050   static jmethodID sm_statusMessgeChangedMID;
00051 };
00052 
00053 /*^**************************************************************************^*/
00054 /*- JQStatusBarBridge :: Public Inline Member Function.                      -*/
00055 /*^**************************************************************************^*/
00056 
00062 inline QStatusBar *JQStatusBarBridge::qStatusBar() const
00063 {
00064   return static_cast<QStatusBar *>(qObject());
00065 }
00066 
00067 /*^**************************************************************************^*/
00068 /*- Macro Definitions.                                                       -*/
00069 /*^**************************************************************************^*/
00070 
00071 #define jqStatusBarCast(bridge) (reinterpret_cast<JQStatusBarBridge *>(bridge))
00072 #define jqStatusBarBridge jqStatusBarCast(bridge)
00073 
00074 #endif //JQSTATUSBARBRIDGE_H
00075 
00076 /*^*****************************************************************************
00077   File History:
00078 
00079  - 2007-11-07 08:45:32 Slobodan
00080    Initial version
00081 
00082 *****************************************************************************^*/

Copyright © 2007 ETF and contributors. All Rights Reserved.