VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtMenuPath.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2008 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #ifndef DtMenuPath_H_
11 #define DtMenuPath_H_
12 
13 #include <vrvCore/vrvCore.h>
14 #include <string>
15 
16 namespace makVrv
17 {
18 
28  {
29  public:
30 
31  //Internal class which is used to ensure that it is not possible to incorrectly
32  //build a menu path.
34  {
35  public:
36  friend class DtMenuPath;
37 
38  //Add a menu to the path.
39  MenuPathBuilder menu(const std::string& name) const;
40 
43  DtMenuPath item(const std::string& name) const;
44 
47  DtMenuPath operator/(const std::string& name) const;
48 
50  DtMenuPath separator(const std::string& name) const;
51 
52  protected:
53 
54  //Access the path.
55  inline const std::string& path() const { return myPath; }
56 
57  //The CTOR this class is automatically created by the DtMenuPath.
58  MenuPathBuilder(const std::string& name);
59 
60  std::string myPath;
61  };
62 
63  //Empty Menu Path CTOR.
64  DtMenuPath();
65 
66  //Useful CTOR.
67  DtMenuPath(const MenuPathBuilder& builder);
68 
70  DtMenuPath(const DtMenuPath& copy);
71 
72  //Create an empty menu path.
73  static DtMenuPath empty();
74 
75  //Create an empty root menu path.
76  static DtMenuPath root();
77 
78  //Create an empty popup menu path.
79  static DtMenuPath popup();
80 
81  //Start a main menu.
82  static MenuPathBuilder mainMenu(const std::string& name);
83 
84  //Start a popup menu.
85  static MenuPathBuilder popupMenu( const std::string& name );
86 
87  //Start a relative menu.
88  static MenuPathBuilder menu(const std::string& name);
89 
90  //Get the current path.
91  inline const std::string& path() const { return myPath; }
92 
95  DtMenuPath menuPart() const;
96 
99  DtMenuPath parentMenu() const;
100 
102  DtMenuPath rootParentMenu() const;
103 
106  std::string name() const;
107 
109  bool isEmpty() const;
110 
112  bool isAbsolutePath() const;
113 
115  bool isMainMenu() const;
116 
118  bool isPopupPath() const;
119 
121  bool isMenu() const;
122 
124  bool isItem() const;
125 
127  bool isChildOf(const DtMenuPath& parent) const;
128 
130  bool isDescendant(const DtMenuPath& ancestor) const;
131 
133  bool isSiblingOf(const DtMenuPath& sibling) const;
134 
136  bool isSeparator() const;
137 
138  bool operator ==(const DtMenuPath& other) const;
139  bool operator <(const DtMenuPath& other) const;
140  bool operator !=(const DtMenuPath& other) const;
141 
142  protected:
143 
145  DtMenuPath(const std::string& path);
146 
148  std::string myPath;
149  };
150 
151 
152 }
153 
154 #endif
155 
std::string myPath
Definition: DtMenuPath.h:60
Definition: DtMenuPath.h:33
const std::string & path() const
Definition: DtMenuPath.h:91
const std::string & path() const
Definition: DtMenuPath.h:55
std::string myPath
Internal path.
Definition: DtMenuPath.h:148
#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
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)
Contains DLL export macros.

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)