VR-Forces 5.0.3 Developer's Guide
 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 
9 
10 #pragma once
11 
12 #include <vrvCore/vrvCore.h>
14 #include <vrvCore/DtMenuPath.h>
15 
16 #include <string>
17 
18 namespace makVrv
19 {
20  class DtMenuPath;
21 
41  {
42  public:
43 
44  //Internal class which is used to ensure that it is not possible to incorrectly
45  //build a toolbar path.
47  {
48  public:
49  friend class DtToolbarPath;
50 
52 
54  ToolbarPathBuilder mainMenu(const std::string&);
55 
57  DtToolbarPath widget(const std::string& name) const;
58 
59  //Add a menu to the path.
60  ToolbarPathBuilder menu(const std::string& name) const;
61 
62  //Start a toolbar.
63  ToolbarPathBuilder toolbar(const std::string& name) const;
64 
67  DtToolbarPath item(const std::string& name) const;
68 
70  DtToolbarPath separator(const std::string& name) const;
71 
72  protected:
73 
74  //Access the path.
75  inline const std::string& path() const { return myPath; }
76 
77  //The CTOR this class is automatically created by the DtToolbarPath.
78  ToolbarPathBuilder(const std::string& name);
79 
80  std::string myPath;
81  };
82 
83  // CTOR. Used for serialization
84  DtToolbarPath();
85 
86  //Useful CTOR.
87  DtToolbarPath(const ToolbarPathBuilder& builder);
88 
89  //Useful CTOR.
90  DtToolbarPath(const DtMenuPath& copy);
91 
93  DtToolbarPath(const DtToolbarPath& copy);
94 
95  //Start a toolbar.
96  static ToolbarPathBuilder toolbar(const std::string& name);
97 
98  //Start a toolbar row.
99  static ToolbarPathBuilder row(const std::string& name);
100 
101  //Create an empty menu path.
102  static DtToolbarPath empty();
103 
104  //Create an empty root menu path.
105  static DtToolbarPath root();
106 
109  DtToolbarPath menuPart() const;
110 
112  DtToolbarPath toolbarPart() const;
113 
115  DtToolbarPath parentMenu() const;
116 
118  bool isChildOf(const DtToolbarPath& parent) const;
119 
121  bool isDescendant(const DtToolbarPath& ancestor) const;
122 
124  bool isSiblingOf(const DtToolbarPath& sibling) const;
125 
127  bool isToolbar() const;
128 
130  bool isAbsolutePath() const;
131 
133  bool isWidget() const;
134 
135  //Get the current path.
136  inline const std::string& path() const { return myPath; }
137 
139  bool isEmpty() const;
140 
142  bool isItem() const;
143 
145  bool isMainMenu() const;
146 
148  bool isSeparator() const;
149 
151  bool isMenu() const;
152 
154  bool isRow() const;
155 
157  DtToolbarPath rootParentMenu() const;
158 
161  std::string name() const;
162 
163  bool operator ==(const DtToolbarPath& other) const;
164  bool operator <(const DtToolbarPath& other) const;
165  bool operator !=(const DtToolbarPath& other) const;
166 
168 
169  protected:
170 
172  template<class Archive>
173  void _serialize(Archive & ar, const unsigned int version)
174  {
175  ar & DT_SERIALIZE_MEMBER(myPath);
176  }
177 
179  DtToolbarPath(const std::string& path);
180 
181  protected:
182 
184  std::string myPath;
185  };
186 }
Definition: DtToolbarPath.h:46
const std::string & path() const
Definition: DtToolbarPath.h:136
std::string myPath
Internal path.
Definition: DtToolbarPath.h:184
std::string myPath
Definition: DtToolbarPath.h:80
void _serialize(Archive &ar, const unsigned int version)
Serialize this class.
Definition: DtToolbarPath.h:173
Contains makVrv::DtMenuPath class.
#define DT_DECLARE_serialize_FUNCTIONS
Declare all the serialize functions to use.
Definition: DtSerialize.h:120
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
a Class which represents a menu path. The specific strings are not menu text, but the names used when...
Definition: DtMenuPath.h:27
a Class which represents a toolbar path. The specific strings are not toolbar text, but the names used when registering toolbarBuilder, menuBuilder and menuItemBuilder instances.
Definition: DtToolbarPath.h:40
bool operator==(const DtTextureAtlasIndexParser::StringOrFloatAttrib &lhs, const DtTextureAtlasIndexParser::StringOrFloatAttrib &rhs)
needed for search comparison code
Definition: DtTextureAtlasIndexParser.h:153
DT_DLL_terrainCS bool operator!=(const DtDegMinSec &lhs, const DtDegMinSec &rhs)
#define DT_SERIALIZE_MEMBER(NAME)
Serialize a Member whose name starts with &#39;my&#39; If your member does not have that name, use Dt_SERIALIZE.
Definition: DtSerialize.h:158
const std::string & path() const
Definition: DtToolbarPath.h:75
Contains DLL export macros.

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)