fw4spl
CardinalLayoutManagerBase.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2018.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #pragma once
8 
9 #include "fwGui/config.hpp"
11 
12 #include <fwCore/base.hpp>
13 
14 #include <list>
15 #include <map>
16 
17 namespace fwGui
18 {
19 
20 namespace layoutManager
21 {
22 
26 class FWGUI_CLASS_API CardinalLayoutManagerBase : public IViewLayoutManager
27 {
28 
29 public:
30 
32 
33 
34  typedef enum
35  {
36  CENTER,
37  RIGHT,
38  LEFT,
39  BOTTOM,
40  TOP
41  } Align;
42 
43  typedef std::string RegistryKeyType;
44 
45  class ViewInfo
46  {
47  public:
48 
49  ViewInfo() :
50  m_align(CENTER),
51  m_minSize(std::make_pair(-1, -1)),
52  m_visible(true),
53  m_isResizable(true),
54  m_position(0),
55  m_layer(0),
56  m_row(0),
57  m_caption(std::make_pair(false, "")),
58  m_useScrollBar(false)
59  {
60  }
61 
62  Align m_align;
63  std::pair< int, int > m_minSize;
64  bool m_visible;
65  bool m_isResizable;
66  int m_position;
67  int m_layer;
68  int m_row;
69  std::pair< bool, std::string > m_caption;
70  bool m_useScrollBar;
71  };
72 
74  FWGUI_API CardinalLayoutManagerBase();
75 
77  FWGUI_API virtual ~CardinalLayoutManagerBase();
78 
114  FWGUI_API virtual void initialize( ConfigurationType configuration) override;
115 
116  FWGUI_API static const RegistryKeyType REGISTRY_KEY;
117 
118 protected:
119 
120  //------------------------------------------------------------------------------
121 
122  std::list< ViewInfo> getViewsInfo()
123  {
124  return m_views;
125  }
126 
127 private:
128 
129  static const std::map<std::string, Align> STRING_TO_ALIGN;
130 
132  std::list< ViewInfo> m_views;
133 
134 };
135 
136 } // namespace layoutManager
137 } // namespace fwGui
#define fwCoreNonInstanciableClassDefinitionsMacro(_classinfo_)
Generate common code for Non Instanciable classes (Interfaces, Abstract classes, ...)
The namespace fwGui contains the base interface for IHM services.
Definition: SJobBar.hpp:23
This file defines the interface of the base class for managing a layout geometry. ...
Defines the generic layout manager for IHM.
Defines the base for cardinal layout manager.
Align
Defines all possible position for a CardinalLayout.