VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtToolbarPath.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2010 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtToolbarPath.h,v $ $Revision: 1.9 $ $State: Exp $
7 ******************************************************************************/
8 
12 
13 #pragma once
14 
15 #include <vrvCore/vrvCore.h>
17 #include <vrvCore/DtMenuPath.h>
18 
19 #include <string>
20 
21 namespace makVrv
22 {
23  class DtMenuPath;
24 
44  {
45  public:
46 
47  //Internal class which is used to ensure that it is not possible to incorrectly
48  //build a toolbar path.
50  {
51  public:
52  friend class DtToolbarPath;
53 
55 
57  ToolbarPathBuilder mainMenu(const std::string&);
58 
60  DtToolbarPath widget(const std::string& name) const;
61 
62  //Add a menu to the path.
63  ToolbarPathBuilder menu(const std::string& name) const;
64 
65  //Start a toolbar.
66  ToolbarPathBuilder toolbar(const std::string& name) const;
67 
70  DtToolbarPath item(const std::string& name) const;
71 
73  DtToolbarPath separator(const std::string& name) const;
74 
75  protected:
76 
77  //Access the path.
78  inline const std::string& path() const { return myPath; }
79 
80  //The CTOR this class is automatically created by the DtToolbarPath.
81  ToolbarPathBuilder(const std::string& name);
82 
83  std::string myPath;
84  };
85 
86  // CTOR. Used for serialization
87  DtToolbarPath();
88 
89  //Useful CTOR.
90  DtToolbarPath(const ToolbarPathBuilder& builder);
91 
92  //Useful CTOR.
93  DtToolbarPath(const DtMenuPath& copy);
94 
96  DtToolbarPath(const DtToolbarPath& copy);
97 
98  //Start a toolbar.
99  static ToolbarPathBuilder toolbar(const std::string& name);
100 
101  //Start a toolbar row.
102  static ToolbarPathBuilder row(const std::string& name);
103 
104  //Create an empty menu path.
105  static DtToolbarPath empty();
106 
107  //Create an empty root menu path.
108  static DtToolbarPath root();
109 
112  DtToolbarPath menuPart() const;
113 
115  DtToolbarPath toolbarPart() const;
116 
118  DtToolbarPath parentMenu() const;
119 
121  bool isChildOf(const DtToolbarPath& parent) const;
122 
124  bool isDescendant(const DtToolbarPath& ancestor) const;
125 
127  bool isSiblingOf(const DtToolbarPath& sibling) const;
128 
130  bool isToolbar() const;
131 
133  bool isAbsolutePath() const;
134 
136  bool isWidget() const;
137 
138  //Get the current path.
139  inline const std::string& path() const { return myPath; }
140 
142  bool isEmpty() const;
143 
145  bool isItem() const;
146 
148  bool isMainMenu() const;
149 
151  bool isSeparator() const;
152 
154  bool isMenu() const;
155 
157  bool isRow() const;
158 
160  DtToolbarPath rootParentMenu() const;
161 
164  std::string name() const;
165 
166  bool operator ==(const DtToolbarPath& other) const;
167  bool operator <(const DtToolbarPath& other) const;
168  bool operator !=(const DtToolbarPath& other) const;
169 
171 
172  protected:
173 
175  template<class Archive>
176  void _serialize(Archive & ar, const unsigned int version)
177  {
178  ar & DT_SERIALIZE_MEMBER(myPath);
179  }
180 
182  DtToolbarPath(const std::string& path);
183 
184  protected:
185 
187  std::string myPath;
188  };
189 }

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)