00001
00015 #ifndef INC_MI32_MICALLBACKLIST_H
00016 #define INC_MI32_MICALLBACKLIST_H
00017
00018 #ifndef INC_MI32_STDDEFNS_H
00019 #include <mi32/stddefns.h>
00020 #endif
00021
00022 #ifdef MISYSTEMDLL
00023 #define LIBEXPORT MI_DLLEXPORT
00024 #define CLASSLIBEXPORT MI_DLLCLASSEXPORT
00025 #else
00026 #define LIBEXPORT MI_DLLIMPORT
00027 #define CLASSLIBEXPORT MI_DLLCLASSIMPORT
00028 #endif
00029
00030
00032 class CLASSLIBEXPORT MICALLBACKLIST {
00033 public:
00034
00035 enum PRIORITY {
00036 PRIORITY_High = -1,
00037 PRIORITY_Normal = 0,
00038 PRIORITY_Low = 1
00039 };
00040
00041 struct ANYCALLBACKSTRUCT {
00042 UINT32 reason;
00043
00045 ANYCALLBACKSTRUCT () {}
00046
00048 ANYCALLBACKSTRUCT (
00049 UINT32 ireason
00050 ):
00051 reason(ireason)
00052 { }
00053 };
00054
00055 typedef void (*CALLBACKFUNC)(ANYCALLBACKSTRUCT*,void*);
00056
00057
00058
00059 MICALLBACKLIST (
00060 );
00061
00062 ~MICALLBACKLIST (
00063 );
00064
00068 ERRVALUE Add (
00069 CALLBACKFUNC cbfunc,
00070 void *cbdata,
00071 UINT32 reasonmask,
00072 PRIORITY priority = PRIORITY_Normal
00073 );
00074
00081 void CallCallbacks (
00082 ANYCALLBACKSTRUCT *cbstruct,
00083 UINT32 reason
00084 );
00085
00089 bool HasCallbacks (
00090 UINT32 reason
00091 ) const;
00092
00094 void RemoveAll (
00095 );
00096
00104 void Remove (
00105 CALLBACKFUNC cbfunc,
00106 void *cbdata,
00107 UINT32 reasonmask
00108 );
00109
00110 private:
00111 #ifndef GENERATING_DOXYGEN_OUTPUT
00112 class PRIV;
00113 PRIV* m_priv;
00114 #endif
00115 };
00116
00117 #undef LIBEXPORT
00118 #undef CLASSLIBEXPORT
00119
00120 #endif