00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef BUTTONHANDLE_H
00016 #define BUTTONHANDLE_H
00017
00018 #include "pandabase.h"
00019 #include "typeHandle.h"
00020 #include "register_type.h"
00021
00022
00023
00024
00025
00026
00027
00028 class EXPCL_PANDA_PUTIL ButtonHandle {
00029 PUBLISHED:
00030 INLINE ButtonHandle();
00031 INLINE ButtonHandle(int index);
00032
00033 public:
00034 INLINE ButtonHandle(const ButtonHandle ©);
00035
00036 INLINE bool operator == (const ButtonHandle &other) const;
00037 INLINE bool operator != (const ButtonHandle &other) const;
00038 INLINE bool operator < (const ButtonHandle &other) const;
00039
00040 PUBLISHED:
00041 string get_name() const;
00042 INLINE bool has_ascii_equivalent() const;
00043 INLINE char get_ascii_equivalent() const;
00044
00045 ButtonHandle get_alias() const;
00046
00047 INLINE bool matches(const ButtonHandle &other) const;
00048
00049 INLINE int get_index() const;
00050 INLINE void output(ostream &out) const;
00051 INLINE static ButtonHandle none();
00052
00053 private:
00054 int _index;
00055 static ButtonHandle _none;
00056
00057 public:
00058 static TypeHandle get_class_type() {
00059 return _type_handle;
00060 }
00061 static void init_type() {
00062 register_type(_type_handle, "ButtonHandle");
00063 }
00064
00065 private:
00066 static TypeHandle _type_handle;
00067
00068 friend class ButtonRegistry;
00069 };
00070
00071
00072
00073 INLINE ostream &operator << (ostream &out, ButtonHandle button) {
00074 button.output(out);
00075 return out;
00076 }
00077
00078 #include "buttonHandle.I"
00079
00080 #endif
00081