1 
2 #ifndef _SCREEN_FLOW_
3 #define _SCREEN_FLOW_
4 
5 
6 class action_info{
7 public:
8     action_info();
9     action_info(const action_info &other);
10     ~action_info();
11     action_info &operator=(const action_info &other);
12     void RemoveAnimationIdFromDictionary(int display_index);
13     void AddAnimationIdToDictionary(int display_index);
14 
15 public:
16     ULONG           action_type;
17     CString         action_name;
18     CString         parent_widget_name;
19     CString         target_widget_name;
20     CString         animation_id_name;
21     BOOL            parent_show_child_widgets;
22     BOOL            target_show_child_widgets;
23     GX_ANIMATION_INFO *animation;
24 
25 private:
26     void copy(const action_info &other);
27 };
28 
29 class trigger_info{
30     public:
31         trigger_info();
32         trigger_info(const trigger_info &other);
33         ~trigger_info();
34         trigger_info &operator=(const trigger_info &other);
35         void MergeActionInfo(trigger_info *add_trigger);
36         static action_info *GetActionInfo(CArray<action_info *> &ActionList, CString &action_name);
37         static BOOL FindActionName(CArray<action_info *> &ActionList, CString &name);
38         static void CreateUniqueActionName(CArray<action_info *> &ActionList, action_info *action);
39         static void CleanActionList(CArray<action_info *> &list);
40         void RemoveAnimationIdFromDictionary(int display_index);
41         void AddAnimationIdToDictionary(int display_index);
42 
43     public:
44         CString               trigger_name;
45         CString               system_event_animat_id_name;
46         CString               signal_id_name;
47         CString               user_event_id_name;
48         INT                   trigger_type;
49         ULONG                 event_type;
50         CArray<action_info *> action_list;
51         trigger_info         *next;
52 
53     private:
54         void copy(const trigger_info &other);
55 };
56 
57 class flow_item{
58     public:
59         flow_item();
60         flow_item(const flow_item &other);
61         ~flow_item();
62         flow_item &operator=(const flow_item &other);
63         void RemovedAnimationIdFromDictionary(int display_index);
64         void AddAnimationIdToDictionary(int display_index);
65 
66     public:
67         CString       screen_name;
68         CRect         rect;//the size of the box that represent the screen in screen flow dialog
69         trigger_info *trigger_list;
70         BOOL          enabled;
71 
72     private:
73         void copy(const flow_item &other);
74 };
75 
76 class screen_flow
77 {
78 public:
79     screen_flow();
80     screen_flow(const screen_flow &other);// copy constructer
81     ~screen_flow();
82 
83     void UpdateScreenName(CString screen_name, CString new_name);
84     void UpdateIdName(widget_info *info, CString old_id_name, CString new_name);
85     void CheckAddFlowItem(CString screen_name, int diagram_width, int diagram_height);
86     void DeleteFlowItem(CString &screen_name, int display_index);
AddFlowItem(flow_item * item)87     void AddFlowItem(flow_item *item){ flow_list.Add(item); };
88     void InitFlowItemRect(CRect &rect, int diagram_width, int diagram_height);
89     void UpdateFlowItemRect(flow_item *item, int diagram_width, int diagram_height);
90 
91     trigger_info *FindTrigger(flow_item *item, CString id_name);
92     static void RemoveTrigger(flow_item *item, trigger_info *del_trigger);
93 
94     static BOOL CheckAddTrigger(flow_item *item, trigger_info *add_trigger, CWnd *parent = NULL);
GetFlowListCount()95     INT GetFlowListCount(){ return flow_list.GetCount(); };
GetFlowItem(int index)96     flow_item *GetFlowItem(int index){ return flow_list.GetAt(index); };
97     flow_item *GetFlowItem(CPoint point, BOOL move_front = FALSE);
98     flow_item *GetFlowItem(CString &screen_name);
GetScale()99     int GetScale(){ return mDiagramScale; };
100     void SetScale(int scale);
101     void RebuildAnimationIdDictionary(int display_index);
102     BOOL IsAnimationIdBeReferenced(CString id_name);
103 
104 protected:
105     int GetFlowItemIndex(CString screen_name);
106 
107 private:
108     CArray<flow_item *> flow_list;
109     int mScale;
110     int mDiagramScale;
111 };
112 #endif
113 
114