HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UI_OHTriggerObject.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: UI_OHTriggerObject.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 UI_OHEventHandler off a
11  * UI_Object because that prevents multiple inheritance of
12  * UI_OHEventHandler and some UI_Object based class, making
13  * UI_OHEventHandler useless. So, I just contain this little
14  * UI_Object for expressing interests in UI events.
15  */
16 
17 #ifndef __UI_OHTriggerObject__
18 #define __UI_OHTriggerObject__
19 
20 #include "UI_API.h"
21 #include "UI_Object.h"
22 #include "UI_Value.h"
23 
24 class UI_OHEventHandler;
25 
27 {
28 public:
30  ~UI_OHTriggerObject() override;
31 
32  const char *className() const override;
33 
34  void addTimeInterest();
35  void removeTimeInterest();
36  void sendTriggerEvent();
37 
38  // getTimeValue returns nullptr if you haven't set a time interest
39  UI_Value *getTimeValue() { return myTimeValue; }
40 
41  // getTime returns 0 if you haven't set a time interest
42  fpreal getTime() const { return myTimeValue ?
43  (fpreal)*myTimeValue : 0; }
44 
45 private:
46  void handleTriggerEvent(UI_Event *);
47  void handleTimeChange(UI_Event *);
48 
49  UI_Value *myTimeValue;
50  UI_OHEventHandler &myEventHandler;
51 };
52 
53 #endif
54 
fpreal getTime() const
UI_Value * getTimeValue()
fpreal64 fpreal
Definition: SYS_Types.h:277
virtual const char * className() const
Definition: UI_Object.h:87
#define UI_API
Definition: UI_API.h:10