00001
00010 #ifndef _CHECKBOXMENUITEM_H_
00011 #define _CHECKBOXMENUITEM_H_
00012
00013 #include "../jnilib.h"
00014 #include "listeners.h"
00015
00016 #ifdef __cplusplus
00017 extern "C" {
00018 #endif
00019
00021 #define CLS_CHECKBOXMENUITEM "java/awt/CheckboxMenuItem"
00022
00023 struct CheckBoxMenuItem_;
00024
00025 struct CheckBoxMenuItemCPP_;
00026
00027 #ifdef __cplusplus
00028 typedef CheckBoxMenuItemCPP_ CheckBoxMenuItem;
00029 #define createCheckBoxMenuItem createCheckBoxMenuItemCPP
00030 #define deleteCheckBoxMenuItem deleteCheckBoxMenuItemCPP
00031 #else
00032 typedef struct CheckBoxMenuItem_ CheckBoxMenuItem;
00033 #define createCheckBoxMenuItem createCheckBoxMenuItemC
00034 #define deleteCheckBoxMenuItem deleteCheckBoxMenuItemC
00035 #endif
00036
00040 typedef struct CheckBoxMenuItemData {
00041 jclass clscheckboxmenuitem;
00042 jobject checkboxmenuitem;
00043 jmethodID mgetLabel;
00044 jmethodID msetLabel;
00045 jmethodID msetEnabled;
00046 jmethodID misEnabled;
00047 jmethodID mgetState;
00048 jmethodID msetState;
00049 } CheckBoxMenuItemData;
00050
00054 typedef struct CheckBoxMenuItem_ {
00055 CheckBoxMenuItemData checkboxmenuitem;
00056 jobject (*getObject)(CheckBoxMenuItem* checkboxmenuitem);
00057 char* (*getLabel)(CheckBoxMenuItem* checkboxmenuitem);
00058 void (*setLabel)(CheckBoxMenuItem* checkboxmenuitem, const char* label);
00059 void (*setEnabled)(CheckBoxMenuItem* checkboxmenuitem, jboolean enable);
00060 jboolean (*isEnabled)(CheckBoxMenuItem* checkboxmenuitem);
00061 void (*setState)(CheckBoxMenuItem* checkboxmenuitem, jboolean state);
00062 jboolean (*getState)(CheckBoxMenuItem* checkboxmenuitem);
00063 ItemListener (*addItemListener)(CheckBoxMenuItem* checkboxmenuitem, void (*func)(Component, jboolean, const char*));
00064 void (*removeItemListener)(CheckBoxMenuItem* checkboxmenuitem, ItemListener il);
00065 } CheckBoxMenuItem_;
00066
00070 typedef struct CheckBoxMenuItemCPP_ {
00071 CheckBoxMenuItemData checkboxmenuitem;
00072 struct CheckBoxMenuItem_ *functions;
00073
00074 #ifdef __cplusplus
00075 jobject getObject() {
00076 return functions->getObject(this);
00077 }
00078
00079 char* getLabel() {
00080 return functions->getLabel(this);
00081 }
00082
00083 void setLabel(const char* label) {
00084 functions->setLabel(this, label);
00085 }
00086
00087 void setEnabled(jboolean enable) {
00088 functions->setEnabled(this, enable);
00089 }
00090
00091 jboolean isEnabled() {
00092 return functions->isEnabled(this);
00093 }
00094
00095 void setState(jboolean enable) {
00096 functions->setState(this, enable);
00097 }
00098
00099 jboolean getState() {
00100 return functions->getState(this);
00101 }
00102
00103 ItemListener addItemListener(void (*func)(Component, jboolean, const char*)) {
00104 return functions->addItemListener(this, func);
00105 }
00106
00107 void removeItemListener(ItemListener il) {
00108 functions->removeItemListener(this, il);
00109 }
00110
00111 #endif
00112 } CheckBoxMenuItemCPP_;
00113
00114
00115 void createCheckBoxMenuItemC(CheckBoxMenuItem_* checkboxmenuitem);
00116 void createCheckBoxMenuItemCPP(CheckBoxMenuItemCPP_* checkboxmenuitem);
00117 void deleteCheckBoxMenuItemC(CheckBoxMenuItem_* checkboxmenuitem);
00118 void deleteCheckBoxMenuItemCPP(CheckBoxMenuItemCPP_* checkboxmenuitem);
00119
00120 #ifdef __cplusplus
00121 }
00122 #endif
00123
00124 #endif
00125
00126