VR-Forces 4.7 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
vrvCore
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
>
16
#include <
makArchives/DtSerialize.h
>
17
#include <
vrvCore/DtMenuPath.h
>
18
19
#include <string>
20
21
namespace
makVrv
22
{
23
class
DtMenuPath;
24
43
class
DT_DLL_VRVCORE
DtToolbarPath
44
{
45
public
:
46
47
//Internal class which is used to ensure that it is not possible to incorrectly
48
//build a toolbar path.
49
struct
DT_DLL_VRVCORE
ToolbarPathBuilder
50
{
51
public
:
52
friend
class
DtToolbarPath
;
53
54
ToolbarPathBuilder
(
const
DtMenuPath
&);
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
170
DT_DECLARE_serialize_FUNCTIONS
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 Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (
www.mak.com
)