fw4spl
LineLayoutManagerBase.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 
16 namespace fwGui
17 {
18 namespace layoutManager
19 {
20 
24 class FWGUI_CLASS_API LineLayoutManagerBase : public IViewLayoutManager
25 {
26 
27 public:
28 
30 
31 
32  typedef enum
33  {
34  VERTICAL,
35  HORIZONTAL
36  } Orientation;
37 
38  typedef std::string RegistryKeyType;
39 
40  class ViewInfo
41  {
42  public:
43 
44  ViewInfo() :
45  m_proportion(1),
46  m_border(0),
47  m_minSize(std::make_pair(-1, -1)),
48  m_caption(std::make_pair(false, "")),
49  m_visible(true),
50  m_isSpacer(false),
51  m_useScrollBar(false)
52  {
53  }
54 
55  int m_proportion;
56  int m_border;
57  std::pair< int, int > m_minSize;
58  std::pair< bool, std::string > m_caption;
59  bool m_visible;
60  bool m_isSpacer;
61  bool m_useScrollBar;
62  };
63 
65  FWGUI_API LineLayoutManagerBase();
66 
68  FWGUI_API virtual ~LineLayoutManagerBase();
69 
101  FWGUI_API virtual void initialize( ConfigurationType configuration) override;
102 
103  FWGUI_API static const RegistryKeyType REGISTRY_KEY;
104 
105  //------------------------------------------------------------------------------
106 
107  Orientation getOrientation()
108  {
109  return m_orientation;
110  }
111 
112 protected:
113 
114  //------------------------------------------------------------------------------
115 
116  std::list< ViewInfo> getViewsInfo()
117  {
118  return m_views;
119  }
120 
121 private:
122 
124  std::list< ViewInfo> m_views;
125 
126  Orientation m_orientation;
127 };
128 
129 } // namespace layoutManager
130 } // namespace fwGui
Defines the base for line layout manager.
#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.
Orientation
Defines all possible orientation for a LineLayout.