JQMenuBridge.h

00001 /*
00002  * @(#)JQMenuBridge.h  0.2.0 / 2007-11-08
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 JQMENUBRIDGE_H
00010 #define JQMENUBRIDGE_H
00011 
00012 #include "JavaQxQSwing.h"
00013 
00014 #include "JQContainerBridge.h"
00015 
00016 /*^**************************************************************************^*/
00017 /*- JQMenuBridge Class.                                                      -*/
00018 /*^**************************************************************************^*/
00019 
00026 class JAVAQX_EXPORT JQMenuBridge : public JQContainerBridge
00027 {
00028   Q_OBJECT
00029 protected:
00030   JQMenuBridge(JNIEnv *env, jobject obj);
00031 public slots: // native calls
00032   void setText(JNIEnv *env, jstring text);
00033   void insertChild(JNIEnv *env, jlong childBridge, jint index);
00034   void removeChild(JNIEnv *env, jlong childBridge);
00035   void show(JNIEnv *env, jint x, jint y);
00036 public: // native calls
00037   static jlong newInstance(JNIEnv *env, jobject obj);
00038 public:
00039   inline QMenu *qMenu() const;
00040 public:
00041   virtual QAction *qAction();
00042 };
00043 
00044 /*^**************************************************************************^*/
00045 /*- JQMenuBridge :: Public Inline Member Function.                           -*/
00046 /*^**************************************************************************^*/
00047 
00053 inline QMenu *JQMenuBridge::qMenu() const
00054 {
00055   return static_cast<QMenu *>(qObject());
00056 }
00057 
00058 /*^**************************************************************************^*/
00059 /*- Macro Definitions.                                                       -*/
00060 /*^**************************************************************************^*/
00061 
00062 #define jqMenuCast(bridge) (reinterpret_cast<JQMenuBridge *>(bridge))
00063 #define jqMenuBridge jqMenuCast(bridge)
00064 
00065 #endif //JQMENUBRIDGE_H
00066 
00067 /*^*****************************************************************************
00068   File History:
00069 
00070  - 2007-11-08 11:02:50 Slobodan
00071    Initial version
00072 
00073 *****************************************************************************^*/

Copyright © 2007 ETF and contributors. All Rights Reserved.