HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CH_UndoGroup.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_UndoGroup.h ( OP Library, C++)
7  *
8  * COMMENTS: This class handles the undoing of channel group
9  * operations (from JIVE applications).
10  *
11  * This class handles the updating of internal data
12  * when a channel group operation is undone/redone.
13  */
14 
15 #ifndef __CH_UndoGroup__
16 #define __CH_UndoGroup__
17 
18 #include "CH_API.h"
19 #include <UT/UT_Undo.h>
20 #include "CH_ChannelRef.h"
21 
22 class CH_Group;
23 class CH_Manager;
24 
25 class CH_API CH_UndoGroup : public UT_Undo
26 {
27 public:
28  CH_UndoGroup(const CH_Group *chg, bool reverse);
29  virtual ~CH_UndoGroup();
30 
31  virtual void undo();
32  virtual void redo();
33 
34 protected:
35  virtual void swap();
36  CH_Group *getGroup() const;
37 
39  bool myReverse;
40 };
41 
43 {
44 public:
45  CH_UndoGroupCreateDelete(const CH_Group *chg, bool reverse);
46 
47 private:
48  virtual void swap();
49 };
50 
52 {
53 public:
55  const CH_Group *chg,
56  const char *oldName, const char *newName );
57 private:
58  virtual void swap();
59 
60 private:
61  UT_String myOldName;
62  UT_String myNewName;
63 };
64 
66 {
67 public:
68  CH_UndoGroupLoadClear(const CH_Group *chg, bool reverse);
70 
71 private:
72  virtual void swap();
73 
74 private:
75  void saveChannels();
76 
77  char *myBuffer;
78  size_t myBufSize;
79 };
80 
82 {
83 public:
85  const CH_Group *chg, bool reverse,
86  const CH_ChannelRef &chref );
87 private:
88  virtual void swap();
89 
90 private:
91  CH_ChannelRef myChanRef;
92 };
93 
95 {
96 public:
98  const CH_Group *chgsp, CH_Group *chgtp,
99  const char *old_name, const char *new_name);
100 private:
101  virtual void swap();
102 
103 private:
104  UT_String myOldName;
105  UT_String myNewName;
106  UT_String myTargetParentPath;
107 };
108 
110 {
111 public:
112  CH_UndoGroupChangeIndex(const CH_Group *chg, int old_index, int new_index);
113 
114 private:
115  virtual void swap();
116 
117 private:
118  int myOldIndex;
119  int myNewIndex;
120 };
121 #endif
122 
virtual void redo()=0
void swap(UT::ArraySet< Key, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual > &a, UT::ArraySet< Key, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual > &b)
Definition: UT_ArraySet.h:1561
virtual void undo()=0
virtual void swap()
UT_String myPath
Definition: CH_UndoGroup.h:38
#define CH_API
Definition: CH_API.h:10