JQRadioButtonMenuItemBridge.h

00001 /*
00002  * @(#)JQRadioButtonMenuItemBridge.h  0.2.0 / 2007-11-14
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 JQRADIOBUTTONMENUITEMBRIDGE_H
00010 #define JQRADIOBUTTONMENUITEMBRIDGE_H
00011 
00012 #include "JavaQxQSwing.h"
00013 
00014 #include "JQActionComponentBridge.h"
00015 
00016 /*^**************************************************************************^*/
00017 /*- JQRadioButtonMenuItemBridge Class.                                       -*/
00018 /*^**************************************************************************^*/
00019 
00026 class JAVAQX_EXPORT JQRadioButtonMenuItemBridge : public JQActionComponentBridge
00027 {
00028   Q_OBJECT
00029 protected:
00030   JQRadioButtonMenuItemBridge(JNIEnv *env, jobject obj);
00031 public slots: // native calls
00032   void setText(JNIEnv *env, jstring text);
00033   void setShortcut(JNIEnv *env, jstring shortcut);
00034   void setIcon(JNIEnv *env, jobject iconSet);
00035   void setSelected(JNIEnv *env, jboolean selected);
00036 public: // native calls
00037   static void initialize(JNIEnv *env, jclass cls);
00038   static jlong newInstance(JNIEnv *env, jobject obj);
00039 public: // native callbacks
00040   void selectedChanged(jint modifiers, jboolean selected);
00041 protected slots:
00042   void toggledSlot(bool checked);
00043 protected:
00044   inline QRadioButton *radioButton() const;
00045 protected:
00046   virtual QWidget *createQWidget();
00047   virtual QAction *createQAction();
00048   virtual void deleteQWidget(QWidget *widget);
00049   virtual void deleteQAction(QAction *action);
00050   virtual QWidget *convertToQWidget(QAction *action);
00051   virtual QAction *convertToQAction(QWidget *widget);
00052 protected:
00053   static QActionGroup *actionGroup();
00054 private:
00055   QShortcut *m_shortcut;
00056   QActionGroup *m_actionGroup;
00057 private:
00058   static jmethodID sm_selectedChangedMID;
00059 };
00060 
00061 /*^**************************************************************************^*/
00062 /*- JQRadioButtonMenuItemBridge :: Protected Inline Member Function.         -*/
00063 /*^**************************************************************************^*/
00064 
00070 inline QRadioButton *JQRadioButtonMenuItemBridge::radioButton() const
00071 {
00072   return static_cast<QRadioButton *>(widget());
00073 }
00074 
00075 /*^**************************************************************************^*/
00076 /*- Macro Definition.                                                        -*/
00077 /*^**************************************************************************^*/
00078 
00079 #define jqRadioButtonMenuItemBridge \
00080     (reinterpret_cast<JQRadioButtonMenuItemBridge *>(bridge))
00081 
00082 #endif //JQRADIOBUTTONMENUITEMBRIDGE_H
00083 
00084 /*^*****************************************************************************
00085   File History:
00086 
00087  - 2007-11-14 12:51:05 Slobodan
00088    Initial version
00089 
00090 *****************************************************************************^*/

Copyright © 2007 ETF and contributors. All Rights Reserved.