ROOT_Application  2.0
C++ Core modules and GUIStock
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MainControllerIndicatorTHStock.h
Go to the documentation of this file.
1 
6 #ifndef _MAINCONTROLLERINDICATORTHSTOCK_H_
7 #define _MAINCONTROLLERINDICATORTHSTOCK_H_
8 
9 #include <iostream>
10 #include <list>
11 
12 #include "Controller.h"
13 //#include "../GUIMainController.h"
14 
15 // I dont get why here it is required to include the header, not in GUIMainController
16 // required because used in MainIndicatorTHStockFrame (really bad) ?? only new added
17 class GUIMainController;
18 class StockManager;
20 
21 // associated views, need explicit problem with GUIMainController, to solve later
22 //#include "../View/MainIndicatorTHStockFrame.h"
24 //#include "TGFrame.h"
25 class TGCompositeFrame;
26 
37 class MainControllerIndicatorTHStock : public ControllerFrame<ControllerIndicatorTHStock>
38 {
39  private :
40  // it is in constructor, maybe not needed to save as member, keep for now, if need interaction later
42 
43  // need a current controller if do not want to search for it
44  // search may be tricky as well, same could be in ControllerBase
46 
47  // need parent controller, should be in base class or set by the template
48  // could be replaced by normal ControllerBase ? depends on function called
50 
51  // best solution ?? not
53  //StockManager *fstockmanager;
54 
56  bool kMainFrame;
57 
58  public :
65  MainControllerIndicatorTHStock( GUIMainController *parent_control, std::string name,
66  TGCompositeFrame * associated_frame, bool b_mainframe );
67 
69  /*
70  std::cout << "Destructor MainControllerIndicatorTHStock delete sub-controllers " << std::endl;
71  // delete sub-controllers, will delete THstockFrame
72  DeleteList();
73  // reset pointer member ?
74  }*/
75 
76  // may return a base class to GUIMainController
77  // no need, need normally, MainController send to the other controller, but for test
80 
81  // create for getting access to AddData, simply, maybe not the best
82  // AddData moved to subcontroller !
83  // but used if it is a mainframe, see if can avoid later
85 
86  // here works because parent has a copy, but requires explicit include
87  // used by ?
88  StockManager * GetStockManager() const; //{ return myparent_controller->GetStockManager(); }
89 
90  /* Add both coupled frame, Indicator and THStock
91  * They should be associated as much as possible
92  * called from GUIMainFrame
93  */
94  void AddCouple_Indicator_THStock( std::string frame_name );
98  //void DeleteCouple_Indicator_THStock();
100 
101  /* Action when select the Validation button
102  * Should be private
103  * @param fullname : contains action to perform name_indicator
104  */
105  void Validation( std::string fullname );
106 
107  // coming from MainIndicatorFrame, temporary for get GUIMainController
108  //void SetStatusBar ( std::vector<std::string> & vec_str_text );
109 
112  virtual void Updated( std::vector<std::string> & message );
113 
115  /* Select controller
116  * Called by ??
117  */
118  void GetSelected( ControllerIndicatorTHStock *child_controller );
119  // get the child as paremeter, could use current after get selected as well
120  void UpdateIndicator( ControllerIndicatorTHStock *child_controller, std::string mode );
121 
125  void Update();
126 };
127 #endif /* _MAINCONTROLLERINDICATORTHSTOCK_H_ */
Singleton class, stores all loaded stocks.
Definition: StockManager.h:42
MainControllerIndicatorTHStock(GUIMainController *parent_control, std::string name, TGCompositeFrame *associated_frame, bool b_mainframe)
Constructor.
Controller for a dual frame containing Indicator+THStock(s).
bool kMainFrame
link to StockManager, singleton, initialized in constructor
Main controller of the application, linked to the view GUIMainFrame.
MainIndicatorTHStockFrame * findic_thstock
void DeleteIndicatorTHstock()
Delete all couples of frames and thstocks Call by MainControllerIndicatorStock::CloseWindow() ...
Final controller class, does not derive from ListController.
ControllerIndicatorTHStock * fcurrent_controller
MainIndicatorTHStockFrame * GetFrame() const
Sub-controller : assure drawing and coupling of 1 IndicatorFrame and 1 THStock.
virtual void Updated(std::vector< std::string > &message)
Call by parent controller, when a new message is available.
void GetSelected(ControllerIndicatorTHStock *child_controller)
receive indirectly the IndicatorFrame Selected, can set the current_frame ( can get pad also ) ...
Frame contains Indicator and THStock.
void Update()
coming from StockManager, through observer pattern no should come from gui_maincontroller now ...
void UpdateIndicator(ControllerIndicatorTHStock *child_controller, std::string mode)
called by controller child for some tasks child cannot do.
void AddCouple_Indicator_THStock(std::string frame_name)
Create a new sub-controller and update views for adding a new frame Does not add any data...
void Validation(std::string fullname)
Load stock or indicator after pressing the Validation button.
Base class for controllers of the graphical application.
GUIMainController * GetGUIMainController() const
ControllerIndicatorTHStock * GetCurrentController() const
see remark below, much easier if composition than derivation in the case of ListController, same for parent_controller as member <U> easily extends to View as well ( ListView possible ), but strong coupling again
Definition: Controller.h:209
std::string name
name Controller_X, initialized to "" by default
Definition: Controller.h:46