MT Showcase SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
ScheduledEvent.hpp
1 #pragma once
2 
3 #include "Export.hpp"
4 
5 #include <Valuable/AttributeString.hpp>
6 #include <Valuable/Node.hpp>
7 
8 #include <QDateTime>
9 
10 namespace Showcase
11 {
12  class UIComponent;
13 
15  class SHOWCASE_API ScheduledEvent : public Valuable::Node,
16  public std::enable_shared_from_this<ScheduledEvent>
17  {
18  public:
20  virtual ~ScheduledEvent();
21 
23  virtual bool isScheduled() const = 0;
26  bool isActive() const { return m_active; }
27 
28  QString eventName() const { return m_name; }
29  QString eventTime() const { return m_eventTime; }
30  QString recurrence() const { return m_recurrence; }
31 
35  void checkEvent();
36 
39  virtual void setHostComponent(std::shared_ptr<UIComponent> comp);
40 
41  protected:
43  virtual void eventStarted() {}
45  virtual void eventEnded() {}
46 
48  virtual void checkRecurrence() {}
49 
50  private:
51  Valuable::AttributeString m_name;
52  Valuable::AttributeString m_eventTime;
53  Valuable::AttributeString m_recurrence;
54 
55  bool m_active;
56  };
57  typedef std::shared_ptr<ScheduledEvent> ScheduledEventPtr;
58  typedef std::weak_ptr<ScheduledEvent> ScheduledEventWeakPtr;
59 }