HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDG_CommandChunk.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_CHUNK_H__
10 #define __PDG_COMMAND_CHUNK_H__
11 
12 #include "PDG_API.h"
13 
14 #include "PDG_Command.h"
15 
16 #include <UT/UT_Array.h>
17 #include <UT/UT_NonCopyable.h>
18 #include <UT/UT_StringHolder.h>
19 #include <UT/UT_UniquePtr.h>
20 
21 class PDG_Command;
22 class PDG_CommandManager;
23 
25 {
26 public:
27  PDG_CommandChunk(bool is_delayed);
28  PDG_CommandChunk(bool is_delayed, const UT_StringHolder& description);
29 
31 
32  bool canDoIt() override;
33  bool canUndoIt() override;
34 
35  void addCommand(UT_UniquePtr<PDG_Command> cmd);
36  bool hasCommand();
37  bool isDelayed() { return myIsDelayed; }
40  {
41  return PDG_COMMAND_CHUNK;
42  };
43 
44  void description(UT_WorkBuffer& buffer, int depth=0) override;
45  void fullDescription(UT_WorkBuffer& buffer) override;
46 
47  void commands(UT_Array<PDG_Command*>& commands) const;
48 
49 protected:
50  bool doCommand(PDG_GraphContext* context,
51  UT_WorkBuffer& errors) override;
52  bool undoCommand(PDG_GraphContext* context,
53  UT_WorkBuffer& errors) override;
57 };
58 
59 #endif /* __PDG_COMMAND_CHUNK_H__ */
PDG_CommandType
Definition: PDG_Types.h:542
virtual PDG_CommandType baseCommandType()
#define PDG_API
Definition: PDG_API.h:23
virtual bool canUndoIt()
virtual bool canDoIt()
virtual void fullDescription(UT_WorkBuffer &buffer)
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
virtual bool doCommand(PDG_GraphContext *, UT_WorkBuffer &)=0
Definition: core.h:760
virtual void description(UT_WorkBuffer &buffer, int depth=0)
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
virtual bool undoCommand(PDG_GraphContext *, UT_WorkBuffer &)=0
UT_Array< UT_UniquePtr< PDG_Command > > myCommands
GLint GLint GLsizei GLsizei GLsizei depth
Definition: glcorearb.h:476
UT_StringHolder myChunkDescription
PDG_CommandType commandType() override