HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CH_UndoBookmark.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  * NAME: CH_UndoBookmark.h ( CH Library, C++)
7  *
8  * COMMENTS: This class handles the undoing of Bookmark
9  * operations.
10  *
11  * This class handles the updating of playbar bookmarks
12  * when they are modified, created, or deleted
13  */
14 
15 #ifndef __CH_UndoBookmark__
16 #define __CH_UndoBookmark__
17 
18 #include "CH_API.h"
19 #include <UT/UT_Color.h>
20 #include <UT/UT_StringHolder.h>
21 #include <UT/UT_Undo.h>
22 #include <SYS/SYS_Types.h>
23 
24 class CH_Bookmark;
25 
27 {
28 public:
29  enum class Operation
30  {
31  Create,
32  Modify,
33  Delete
34  };
35 
36  CH_UndoBookmark(CH_Bookmark * bookmark,
37  int bookmark_index,
38  Operation operation);
39 
40  ~CH_UndoBookmark() override;
41 
42  void undo() override;
43  void redo() override;
44 
45 private:
46  void swap();
47 
48  void undoDelete();
49  void undoModify();
50 
51  // Index into the list of bookmarks at the time this bookmark was
52  // created/modified/deleted
53  int myBookmarkIndex;
54 
55  fpreal myStart;
56  fpreal myEnd;
57  UT_Color myColor;
58  UT_StringHolder myName;
59  UT_StringHolder myComment;
60 
61  Operation myOperation;
62 };
63 
64 #endif
65 
virtual void redo()=0
void swap(T &lhs, T &rhs)
Definition: pugixml.cpp:7172
virtual void undo()=0
fpreal64 fpreal
Definition: SYS_Types.h:277
#define CH_API
Definition: CH_API.h:10