HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OH_TriggerObject.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: OH_TriggerObject.h ( Op Handler Library, C++)
7  *
8  * COMMENTS:
9  * This is a little helper class. I need to be able to have
10  * UI interests, yet I can't subclass OH_OpHandler off a
11  * UI_Object because that prevents multiple inheritance of
12  * OH_OpHandler and some UI_Object based class, making
13  * OH_OpHandler useless. So, I just contain this little
14  * UI_Object for expressing interests in UI events.
15  */
16 
17 #ifndef __OH_TriggerObject__
18 #define __OH_TriggerObject__
19 
20 #include "OH_API.h"
21 #include <UI/UI_Object.h>
22 #include <UI/UI_Value.h>
23 
24 class OH_EventHandler;
25 
27 {
28 public:
30  virtual ~OH_TriggerObject();
31  virtual const char *className() const;
32 
33  void addTimeInterest();
34  void removeTimeInterest();
35  void sendTriggerEvent();
36 
37  // getTimeValue returns NULL if you haven't set a time interest
38  UI_Value *getTimeValue() { return myTimeValue; }
39 
40  // getTime returns 0 if you haven't set a time interest
41  fpreal getTime() const { return myTimeValue ?
42  (fpreal)*myTimeValue : 0; }
43 
44 private:
45  void handleTriggerEvent(UI_Event *);
46  void handleTimeChange(UI_Event *);
47 
48  UI_Value *myTimeValue;
49  OH_EventHandler &myEventHandler;
50 };
51 
52 #endif
#define OH_API
Definition: OH_API.h:10
fpreal getTime() const
double fpreal
Definition: SYS_Types.h:263
UI_Value * getTimeValue()
virtual const char * className() const