InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
GenStyleListMgr.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Chris Jones
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 // Purpose:
24 //
25 //========================================================================================
26 
27 #ifndef __CGenStyleListMgr__
28 #define __CGenStyleListMgr__
29 
30 #include "IGenStlEdtListMgr.h"
31 #include "IGenStyleLockInfo.h"
32 #include "IGenericSettings.h"
33 #include "HelperInterface.h"
34 #include "PersistUIDList.h"
35 #include "K2Vector.h"
36 #include "KeyValuePair.h"
37 
38 
40 {
41 public:
42  // Constructors and Destructors
44  virtual ~CGenStyleListMgr();
45 
46  virtual int32 GetNumStyles();
47  virtual ErrorCode GetNthStyleName(int32 index, PMString *pName);
48  virtual ErrorCode GetNthStyleDescription(int32 index, PMString *pDesc);
49  virtual bool32 IsNthStyleEditable(int32 index);
50  virtual bool32 IsNthStyleDeleteable(int32 index);
51  virtual int32 GetStyleIndexByName(const PMString& pName);
52 
53  virtual ErrorCode AddStyle(PMString& name);
54  virtual ErrorCode CopyNthStyle(int32 srcIndex, PMString& newName);
55  virtual ErrorCode DeleteNthStyle(int32 index);
56  virtual PMString GetUniqueStyleName(PMString& baseName);
57  // Requirements for a conforming style name can be determined from the specific
58  // needs of a derived class. For instance, PDF Export styles are now stored as .joboptions
59  // files on disk. Their names must conform to filesystem constraints such as not containing
60  // path segment delimiters. This gives the derived class a way to make appropriate modifications
61  // to the incoming name.
62  virtual PMString GetConformingStyleName(PMString& baseName);
63  virtual ErrorCode SetNthStyleName(int32 index, PMString& name);
64 
65  virtual bool32 CustomImport(const IDFile* theFile) { return kFalse; }
66  virtual bool32 CustomExport(const IDFile* theFile, K2Vector<int32>& indexList) { return kFalse; }
67  virtual ErrorCode ImportStyles(UIDRef uidrefFrom);
68  virtual ErrorCode ExportStyles(UIDRef uidrefTo, K2Vector<int32>& indexList);
69 
70  virtual void GetImportExportFileMagicByte(DBUtils::MagicBytes magicBytes);
71 
72  virtual UIDRef GetNthStyleRef(int32 index);
73 
74  virtual void ReadWrite(IPMStream *s, ImplementationID prop);
75 
76  virtual void ListInsert(UID uid, int32 index = -1);
77  virtual void ListRemove(int32 index);
78  virtual void ListReplace(UID uid, int32 index);
79 
80  ErrorCode ImportFlattenerStyle(int32 nOwningStyle,
81  const PMString& strOwningStyle,
82  IGenStlEdtListMgr* pStyleMgr );
83 
84 
85  ErrorCode AddFlattenerStyle( int32 nSrcIndex,
86  const PMString& strNewName,
87  IGenStlEdtListMgr* pSrc,
88  IGenStlEdtListMgr* pDst );
89 
90 
91  virtual bool16 ReferencesFlattenerStyle() { return kFalse; }
92  virtual UIDRef GetReferencedFlattenerStyle( int32 nIndex ) { ASSERT_UNIMPLEMENTED(); return UIDRef(); }
93  virtual PMString GetFlattenerStyleName( int32 nIndex ) { ASSERT_UNIMPLEMENTED(); return ""; }
94  virtual void SetFlattenerStyleName( int32 nIndex, const PMString& strName ) { ASSERT_UNIMPLEMENTED(); }
95 
96  virtual bool16 EnabledInNoPubState() { return kFalse; }
97 
98 protected:
99  virtual IGenericSettings* QuerySettings( int32 nIndex ) = 0;
100  virtual PMString GetDefaultName() = 0;
101  virtual ClassID GetAddStyleCmdBossID() = 0;
102  virtual ClassID GetSetStyleNameCmdBossID() = 0;
103  virtual ClassID GetDeleteStyleCmdBossID() = 0;
104  virtual ClassID GetStyleBossID() = 0;
105  virtual PMIID GetListMgrIID() = 0;
106  virtual PMIID GetLockInfoIID() { return IID_IGENSTYLELOCKINFO; }
107 
108  UIDRef GetSelfUIDRef() const
109  {
110  return UIDRef(::GetDataBase(this), ::GetUID(this));
111  }
112 
113  PMString GetNextUniqueStyleName(int32 i, const PMString& baseName);
114 
115 protected:
116  // Member Variables
117  PersistUIDList fStyleUIDList;
118 
119 
120 };
121 
122 #endif
123 
124 // End, GenStyleListMgr.h.
125