00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef JQCHECKBOXMENUITEMBRIDGE_H
00010 #define JQCHECKBOXMENUITEMBRIDGE_H
00011
00012 #include "JavaQxQSwing.h"
00013
00014 #include "JQActionComponentBridge.h"
00015
00016
00017
00018
00019
00026 class JAVAQX_EXPORT JQCheckBoxMenuItemBridge : public JQActionComponentBridge
00027 {
00028 Q_OBJECT
00029 protected:
00030 JQCheckBoxMenuItemBridge(JNIEnv *env, jobject obj);
00031 public slots:
00032 void setText(JNIEnv *env, jstring text);
00033 void setShortcut(JNIEnv *env, jstring shortcut);
00034 void setIcon(JNIEnv *env, jobject iconSet);
00035 void setChecked(JNIEnv *env, jboolean checked);
00036 public:
00037 static void initialize(JNIEnv *env, jclass cls);
00038 static jlong newInstance(JNIEnv *env, jobject obj);
00039 public:
00040 void checkedChanged(jint modifiers, jboolean checked);
00041 protected slots:
00042 void toggledSlot(bool checked);
00043 void stateChangedSlot(int state);
00044 protected:
00045 inline QCheckBox *checkBox() const;
00046 protected:
00047 virtual QWidget *createQWidget();
00048 virtual QAction *createQAction();
00049 virtual void deleteQWidget(QWidget *widget);
00050 virtual void deleteQAction(QAction *action);
00051 virtual QWidget *convertToQWidget(QAction *action);
00052 virtual QAction *convertToQAction(QWidget *widget);
00053 private:
00054 QShortcut *m_shortcut;
00055 private:
00056 static jmethodID sm_checkedChangedMID;
00057 };
00058
00059
00060
00061
00062
00068 inline QCheckBox *JQCheckBoxMenuItemBridge::checkBox() const
00069 {
00070 return static_cast<QCheckBox *>(widget());
00071 }
00072
00073
00074
00075
00076
00077 #define jqCheckBoxMenuItemBridge \
00078 (reinterpret_cast<JQCheckBoxMenuItemBridge *>(bridge))
00079
00080 #endif //JQCHECKBOXMENUITEMBRIDGE_H
00081
00082
00083
00084
00085
00086
00087
00088