InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ITextMacroList.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: mramme
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //========================================================================================
23 
24 #ifndef __ITextMacroList__
25 #define __ITextMacroList__
26 
27 #include "PMString.h"
28 #include "EditorHelperID.h"
29 #include "VirtualKey.h"
30 #include "K2SmartPtr.h"
31 #include "VOSSavedData.h"
32 
33 class IControlView;
34 
37 {
38  typedef base_type data_type;
39  int32 fAccessNum;
40  bool16 fStyled;
41 
42  // We need to stash the Shortcut if there is one - lets just say this is a pain in the rump...
43  VirtualKey fVKey;
44  int16 fMods;
45 
46  bool16 operator==(const MacroAttribs&) const;
47 };
48 
49 
53 class ITextMacroList : public IPMUnknown
54 {
55 
56 public:
57 
58  enum {kDefaultIID = IID_ITEXTMACROLIST};
59 
63  virtual void ProcessAddMacro(PMString key, PMString fullString) = 0;
64  virtual void ProcessAddMacro(PMString key, UIDRef otherModel, TextIndex start, int32 length) = 0;
65  virtual void ProcessAddMacro(PMString key, const boost::shared_ptr<PasteData>& vosData) = 0;
66  virtual void ProcessRemoveMacro(PMString key) = 0;
67  virtual void ProcessReplaceMacro(PMString oldKey, PMString newKey, PMString fullString) = 0;
68  virtual void ProcessReplaceMacro(PMString oldKey, PMString newKey, UIDRef otherModel, TextIndex start, int32 length) = 0;
69  virtual void ProcessSetMacroAction(PMString key, VirtualKey vKey, int16 mods) = 0;
70 
73  virtual void AddMacro(PMString key, PMString fullString) = 0;
75  virtual void AddMacro(PMString key, UIDRef otherModel, TextIndex start, int32 length) = 0;
77  virtual void AddMacro(PMString key, const boost::shared_ptr<PasteData>& vosData) = 0;
79  virtual void ReplaceMacro(PMString oldKey, PMString newKey, PMString fullString) = 0;
81  virtual void ReplaceMacro(PMString oldKey, PMString newKey, UIDRef otherModel, TextIndex start, int32 length) = 0;
83  virtual void ReplaceMacro(PMString oldKey, PMString newKey, const boost::shared_ptr<PasteData>&vosData) = 0;
84  virtual void RemoveMacro(PMString key) = 0;
85 
88  virtual void SetMacroAction(PMString key, ActionID actionID) = 0;
89 
90  virtual bool16 IsMacro(PMString key) = 0;
91 
93  virtual bool16 IsStyledMacroInsert(PMString key) = 0;
94  virtual void SetStyledMacroInsert(PMString key, bool16 bStyled) = 0;
95 
97  virtual boost::shared_ptr<PasteData> GetMacroBinding(PMString key) = 0;
98  virtual boost::shared_ptr<PasteData> GetMacroAt(int32 pos) = 0;
99  virtual boost::shared_ptr<PasteData> GetMacroAtAction(ActionID actionID) = 0;
101  virtual PMString GetStringMacroBinding(PMString key) = 0;
102  virtual PMString GetStringMacroAt(int32 pos) = 0;
103  virtual PMString GetStringMacroAtAction(ActionID actionID) = 0;
104 
105  virtual PMString GetKeyAt(int32 pos) = 0;
106  virtual int32 GetKeyPos(PMString key) = 0;
107 
109  virtual ActionID GetActionAt(PMString key) = 0;
110  virtual int32 GetActionPos(ActionID actionID) = 0;
111 
112  virtual int32 GetNumMacros() = 0;
113 
115  virtual void LoadMacros(UID storageUID = kInvalidUID) = 0;
116  virtual void UnloadMacros() = 0;
117 
121  virtual bool16 AttachMacroToEditor(PMString macro, IControlView *editWidget, const boost::shared_ptr<PasteData>& selectedText) = 0;
122 
123  // NOTE: Never use this - I tried to make this protected, but the compiler whines...
124  virtual void UpdateMacroShortcut(PMString key, VirtualKey vKey, int16 mods) = 0;
125 
127  virtual bool16 GetAutoExpand() const = 0;
128  virtual void SetAutoExpand(const bool16 expand) = 0;
129 };
130 
131 #endif