HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
PDG_CommandManager.h
Go to the documentation of this file.
1
/*
2
* PROPRIETARY INFORMATION. This software is proprietary to
3
* Side Effects Software Inc., and is not to be reproduced,
4
* transmitted, or disclosed in any way without written permission.
5
*
6
* COMMENTS:
7
*/
8
9
#ifndef __PDG_COMMAND_MANAGER_H__
10
#define __PDG_COMMAND_MANAGER_H__
11
12
#include "
PDG_API.h
"
13
14
#include <
UT/UT_Array.h
>
15
#include <
UT/UT_NonCopyable.h
>
16
#include <
UT/UT_UniquePtr.h
>
17
#include <
UT/UT_WorkBuffer.h
>
18
19
class
PDG_Command
;
20
class
PDG_CommandChunk
;
21
class
PDG_GraphContext
;
22
23
class
PDG_API
PDG_CommandManager
24
{
25
public
:
26
PDG_CommandManager
(
PDG_GraphContext
* context);
27
virtual
~
PDG_CommandManager
();
28
29
UT_NON_COPYABLE
(
PDG_CommandManager
)
30
31
PDG_CommandChunk
* openChunk(
UT_StringHolder
description);
32
virtual
PDG_CommandChunk
* openChunk(
bool
delayed,
33
UT_StringHolder
description);
34
void
enableLogging(
bool
enable);
35
PDG_CommandChunk
* currentlyOpenChunk()
const
;
36
37
bool
commitChunk(
UT_WorkBuffer
& errors);
38
bool
commitChunk
()
39
{
40
UT_WorkBuffer
errors;
41
return
commitChunk(errors);
42
}
43
44
bool
rollbackChunk(
UT_WorkBuffer
& errors);
45
46
bool
undoIt(
UT_WorkBuffer
& errors);
47
bool
undoIt
()
48
{
49
UT_WorkBuffer
errors;
50
return
undoIt(errors);
51
}
52
bool
redoIt(
UT_WorkBuffer
& errors);
53
54
bool
recordCommand(
UT_UniquePtr<PDG_Command>
cmd,
UT_WorkBuffer
& errors);
55
bool
recordCommand(
UT_UniquePtr<PDG_Command>
cmd);
56
57
void
clear();
58
void
commandDescriptions(
UT_WorkBuffer
&
buffer
)
const
;
59
void
commands(
UT_Array<PDG_Command*>
& commands)
const
;
60
void
commandChunks(
UT_Array<PDG_Command*>
& commands)
const
;
61
62
int
stateCount
()
const
{
return
myDoneIndex + 1; }
63
int
chunkDepth
()
const
{
return
myCommandChunkStack.size(); }
64
65
protected
:
66
UT_Array<UT_UniquePtr<PDG_CommandChunk>
>
myCommandChunkStack
;
67
68
private
:
69
PDG_GraphContext
* myContext;
70
UT_Array<UT_UniquePtr<PDG_Command>
> myCommands;
71
int
myDoneIndex;
72
};
73
74
#endif
/* __PDG_COMMAND_MANAGER_H__ */
UT_WorkBuffer
Definition:
UT_WorkBuffer.h:74
PDG_API
#define PDG_API
Definition:
PDG_API.h:23
PDG_CommandChunk
Definition:
PDG_CommandChunk.h:24
UT_Array.h
UT_Array
Definition:
BV_KDOPTree.h:18
PDG_CommandManager::stateCount
int stateCount() const
Definition:
PDG_CommandManager.h:62
UT_UniquePtr
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition:
UT_UniquePtr.h:39
UT_StringHolder
Definition:
UT_StringHolder.h:999
buffer
Definition:
core.h:760
UT_WorkBuffer.h
UT_NON_COPYABLE
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
Definition:
UT_NonCopyable.h:31
PDG_CommandManager::myCommandChunkStack
UT_Array< UT_UniquePtr< PDG_CommandChunk > > myCommandChunkStack
Definition:
PDG_CommandManager.h:66
PDG_CommandManager::commitChunk
bool commitChunk()
Definition:
PDG_CommandManager.h:38
UT_NonCopyable.h
PDG_CommandManager::undoIt
bool undoIt()
Definition:
PDG_CommandManager.h:47
PDG_API.h
UT_UniquePtr.h
PDG_Command
Definition:
PDG_Command.h:29
PDG_CommandManager
Definition:
PDG_CommandManager.h:23
PDG_GraphContext
Definition:
PDG_GraphContext.h:61
PDG_CommandManager::chunkDepth
int chunkDepth() const
Definition:
PDG_CommandManager.h:63
PDG
PDG_CommandManager.h
Generated on Fri Nov 22 2024 02:42:26 for HDK by
1.8.6