1 // Licensed GNU LGPL v3 or later: http://www.gnu.org/licenses/lgpl.html
2 
3 #ifndef SPECTMORPH_MORPH_PLAN_VIEW_HH
4 #define SPECTMORPH_MORPH_PLAN_VIEW_HH
5 
6 #include "smwindow.hh"
7 #include "smlabel.hh"
8 #include "smfixedgrid.hh"
9 #include "smmorphoperatorview.hh"
10 #include "smscrollview.hh"
11 #include "smoperatorrolemap.hh"
12 #include <functional>
13 
14 namespace SpectMorph
15 {
16 
17 class MorphPlanWindow;
18 
19 class MorphPlanView : public Widget
20 {
21   Widget          *output_parent;
22   MorphPlan       *morph_plan;
23   MorphPlanWindow *morph_plan_window;
24   bool             need_view_rebuild;
25   OperatorRoleMap  op_role_map;
26 
27   std::vector<MorphOperatorView *> m_op_views;
28 
29   std::unique_ptr<Widget> move_ind_widget;
30 public:
31   Signal<> signal_widget_size_changed;
32 
33   MorphPlanView (Widget *parent, Widget *output_parent, MorphPlan *morph_plan, MorphPlanWindow *morph_plan_window);
34 
35   void update_positions();
36   const std::vector<MorphOperatorView *>& op_views();
37   void update_roles();
38 
39   void on_plan_changed();
40   void on_move_indication (MorphOperator *op, bool done);
41   void on_need_view_rebuild();
42 };
43 
44 }
45 
46 #endif
47