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_Options.h>
21 #include <UT/UT_StringHolder.h>
22 #include <UT/UT_Undo.h>
23 #include <SYS/SYS_Types.h>
24 
25 class CH_Bookmark;
26 
28 {
29 public:
30  enum class Operation
31  {
32  Create,
33  Modify,
34  Delete,
35  };
36 
37  CH_UndoBookmark(CH_Bookmark * bookmark,
38  int bookmark_index,
39  Operation operation,
40  bool metadata_changed = false);
41 
42  ~CH_UndoBookmark() override;
43 
44  void undo() override;
45  void redo() override;
46 
47 private:
48  void swap();
49 
50  void undoDelete();
51  void undoModify();
52 
53  // Index into the list of bookmarks at the time this bookmark was
54  // created/modified/deleted
55  int myBookmarkIndex;
56 
57  fpreal myStart;
58  fpreal myEnd;
59  UT_Color myColor;
60  UT_StringHolder myName;
61  UT_StringHolder myComment;
62  bool myIsTemporary;
63  bool myVisible;
64  bool myEnabled;
65 
66  bool myMetadataChanged;
67 
68  UT_Options myMetadata;
69 
70  Operation myOperation;
71 };
72 
73 #endif
74 
virtual void redo()=0
void swap(T &lhs, T &rhs)
Definition: pugixml.cpp:7172
virtual void undo()=0
A map of string to various well defined value types.
Definition: UT_Options.h:84
fpreal64 fpreal
Definition: SYS_Types.h:277
#define CH_API
Definition: CH_API.h:10