InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ITrapStyleListMgr.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: James Jardee-Borquist
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 __ITrapStyleListMgr__
25 #define __ITrapStyleListMgr__
26 
27 #if PRAGMA_ONCE
28 #endif
29 
30 //#include "IGenStlEdtListMgr.h"
31 
32 #include "PrintID.h"
33 #include "K2Vector.h"
34 
35 class ITrapStyle;
36 class UIDList;
37 class RangeProgressBar;
38 
39 //========================================================================================
40 // CLASS ITrapStyleListMgr
41 //========================================================================================
46 {
47 public:
48  enum { kDefaultIID = IID_ITRAPSTYLELISTMGR };
49 
50  enum {kInvalidStyleIndex = -1, kNoStyleIndex = 0, kDefaultStyleIndex };
51 
52  //___________________________________________________________________________________
53  // Initialize method
54  // NOTE: This hould be called only if the list is empty. If the list is already populated
55  // this method will assert and do nothing.
56  //___________________________________________________________________________________
57 
62  virtual ErrorCode Init (bool16 doCreateBasicStylesOnly = kTrue) = 0;
63 
64  //___________________________________________________________________________________
65  // There are basic accessors
66  //___________________________________________________________________________________
67 
70  virtual int32 GetNumStyles (void) = 0;
71 
77  virtual ErrorCode GetNthStyleName (int32 index, PMString *pName) = 0;
78 
83  virtual bool32 IsNthStyleEditable (int32 index) = 0;
84 
89  virtual bool32 IsNthStyleDeleteable (int32 index) = 0;
90 
95  virtual int32 GetStyleIndexByName (const PMString& pName) = 0;
96 
101  virtual int32 GetStyleIndexByUID (UID styleUID) = 0;
102 
107  virtual PMString GetUniqueStyleName (PMString& baseName) = 0;
108 
113  virtual UIDRef GetNthStyleRef (int32 index) = 0;
114 
117  virtual PMString GetNoStyleName (void) = 0;
118 
121  virtual UIDRef GetNoStyleUIDRef (void) = 0;
122 
125  virtual PMString GetDefaultStyleName (void) = 0;
126 
129  virtual UIDRef GetDefaultStyleUIDRef (void) = 0;
130 
135  virtual int32 GetNumReservedStyles (void) = 0;
136 
137  //___________________________________________________________________________________
138  // These methods process a command to add, copy, delete, and change a style.
139  //___________________________________________________________________________________
140 
146  virtual ErrorCode SetNthStyleName (int32 index, PMString& name) = 0;
147 
156  virtual ErrorCode AddStyle (PMString& name, bool16 nameLocked = kFalse, bool16 editLocked = kFalse, bool16 deleteLocked = kFalse) = 0;
157 
163  virtual ErrorCode CopyNthStyle (int32 srcIndex, PMString& newName) = 0;
164 
169  virtual ErrorCode DeleteNthStyle (int32 index) = 0;
170 
180  virtual ErrorCode EditNthStyle (int32 index, ITrapStyle* iStyleSetting, bool16 updateLockInfo = kFalse, bool16 nameLocked = kFalse, bool16 editLocked = kFalse, bool16 deleteLocked = kFalse) = 0;
181 
191  virtual void ListInsert (UID uid, int32 index = -1) = 0;
192 
196  virtual void ListRemove (int32 index) = 0;
197 
202  virtual void ListReplace (UID uid, int32 index) = 0;
203 
208  virtual ErrorCode CopyStyleData (UIDRef srcStyle, UIDRef dstStyle) = 0;
209 
216  virtual ErrorCode ImportStyles (const UIDRef&, RangeProgressBar* = nil) = 0;
217 
224  virtual ErrorCode ExportStyles (const UIDRef&, K2Vector<int32>& indexList, RangeProgressBar* = nil) = 0;
225 
226  //___________________________________________________________________________________
227  // These methods facilitate application of styles to the document.
228  //___________________________________________________________________________________
229 
232  enum { kExcludeDefault = (1L<<0) };
235  enum { kExcludeEditLocked = (1L<<1) };
238  enum { kExcludeDeleteLocked = (1L<<2) };
239 
246  virtual UIDList GetReferencedStyles (const UIDList& styeList, int32 flag) = 0;
247 };
248 
249 #endif // __ITrapStyleListMgr__
250 
251 // End, ITrapStyleListMgr.h.