InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IGraphicStateUtils.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Bernd Paradies
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 __IGraphicStateUtils__
25 #define __IGraphicStateUtils__
26 
27 #include "GraphicsID.h"
28 #include "IPMUnknown.h"
29 #include "Utils.h"
30 
31 //========================================================================================
32 //________________________________________________________________________________________
33 // INCLUDES
34 //________________________________________________________________________________________
35 #include "IGraphicAttributeSuite.h"
36 #include "IGraphicAttrProxySuite.h"
37 
38 //========================================================================================
39 //________________________________________________________________________________________
40 // CLASS FORWARDS
41 //________________________________________________________________________________________
42  class IClassIDListData;
43  class ICommand;
44  class IDataBase;
45  class IWorkspace;
47  class IRenderingObject;
49  class ITextModel;
50  class ITextFocus;
51  class IPMUnknown;
52  class ISelectionManager;
53 
54  class UIDList;
55  class GraphicAttrMessage;
56  class GraphicAttrCacheMessage;
57 
58 
59 
63 {
64 public:
65  enum { kDefaultIID = IID_IGRAPHICSTATEUTILS };
66 
67 
75  virtual ErrorCode ProcessGfxStateApplyAttribute (IPMUnknown* iNewAttribute, ISelectionManager* iSelectionMgr = nil) = 0;
83  virtual ErrorCode ProcessGfxStateApplyAttribute (IPMUnknown* iNewAttribute, IGraphicAttributeSuite* iGraphicAttrSuite = nil) = 0;
84 
91  virtual ErrorCode ProcessGfxStateAddMultAttributes (IGraphicStyleAttributeBossList* iNewAttrList, IGraphicAttributeSuite* iGraphicAttrSuite = nil) = 0;
99  virtual ErrorCode ProcessGfxStateRemoveAttributes (ClassID* pClassList, uint16 attributeCount, IGraphicAttributeSuite* iGraphicAttrSuite = nil) = 0;
100 
110  virtual ICommand* CreateAttributeCommand (const IPMUnknown *attribute, const UIDList *pTargetItemList, bool16 doPrePost, bool16 enableDoNotify) = 0;
111 
120  virtual ICommand* CreateGfxClearOverrideCommand (ClassID attributeClassID, const UIDList *targetItemList, bool16 enableDoNotify) = 0;
121 
134  virtual ICommand* CreateGfxApplyOverrideCommand (ClassID renderObjectClassID, UID renderUID, ClassID attributeClassID, const UIDList& targetItemList, bool16 doPrePost, bool16 enableDoNotify) = 0;
135 
140  virtual ICommand* CreateGfxSwapStrokeAndFillCommand (const UIDList& targetItemList) = 0;
146  virtual ICommand* CreateTextSwapStrokeAndFillCommand (ITextModel* iTextModel, ITextFocus* iTextFocus) = 0;
147 
153  virtual void TransferAttributesModified (ICommand *iSourceCommand, IClassIDListData *iDestAttrModified) = 0;
154 
159  virtual void AppendAttributesModified (ClassID attributeModified, IClassIDListData *iDestAttrModified) = 0;
160 
175  virtual ErrorCode ProcessApplyTargetAttributesToPageItems (IGraphicStyleAttributeBossList* iNewAttrList, ClassID* pClassList, int32 attrCount, const UIDList& targetItemList, bool16 doPrePost = kTrue, bool16 enableDoNotify = kTrue) = 0;
176 
181  virtual ErrorCode ProcessSwapStrokeAndFillCmdSequence (IGraphicAttributeSuite* iGraphicAttrSuite = nil) = 0;
182 
187  virtual ErrorCode ProcessDefaultStrokeAndFillCmdSequence (IGraphicAttributeSuite* = nil) = 0;
188 
192  virtual ErrorCode ProcessToggleStrokeAndFillCmd (void) = 0;
193 
205  (
206  ClassID renderObjectClassID,
207  UID renderUID,
208  bool16 isFill,
209  IGraphicAttributeSuite* iGfxAttrSuite = nil
210  ) = 0;
211 
212  //________________________________________________________________________________________
213  // Graphic State object accessors
214  //________________________________________________________________________________________
220  virtual IPMUnknown* QueryActiveGraphicState (const PMIID& requestedIID = IID_IUNKNOWN, IActiveContext* iActiveContext = nil) = 0;
226  virtual IPMUnknown* QueryGraphicState (IDataBase* iDataBase, const PMIID& requestedIID = IID_IUNKNOWN) = 0;
231  virtual IWorkspace* QueryDataBaseWorkspace (IDataBase* iDataBase) = 0;
232 
245  virtual UIDList* CreateFlattenedPageItemList (const UIDList* pItemList, const PMIID& interestedIID, bool16 onlyIncludeGfxStateSelection) = 0;
246 
247  //________________________________________________________________________________________
248  // Is stroke or fill active in the toolbox proxy. These accessors are a shortcut
249  // for querying the preference directly from the session workspace.
250  //________________________________________________________________________________________
253  virtual bool16 IsStrokeActive (void) = 0;
256  virtual bool16 IsFillActive (void) = 0;
257 
263  virtual IGraphicAttributeSuite* QueryActiveGraphicAttrSuite (ISelectionManager* iSelectionMgr = nil) = 0;
264 
277  (
278  ClassID renderObjectClassID,
279  IGraphicAttributeSuite* iGfxAttrSuite,
280  IGraphicStateRenderObjects* iGfxStateRenderObjects,
281  bool16 doNotify
282  ) = 0;
283 
286  virtual const K2Vector<ClassID>* GetInstalledRenderingTypes (void) = 0;
287 
288  //________________________________________________________________________________________
289  // DESCR: Proxy utilities
290  //________________________________________________________________________________________
291 
304 
305 
306  //________________________________________________________________________________________
307  // DESCR: Graphic Attr message utilities
308  //________________________________________________________________________________________
316  virtual GraphicAttrMessage* CreateGraphicAttrMessage
317  (
318  const IGraphicAttrMessage::MessageType& messageID,
319  const K2Vector<ClassID>& pClassList
320  ) = 0;
321 
329  virtual GraphicAttrCacheMessage* CreateGraphicAttrCacheMessage
330  (
331  const PMIID& messageID,
332  const IGraphicAttrMessage::MessageType& messageType,
333  const K2Vector<ClassID>* attrClassList
334  ) = 0;
335 
336 
337  //________________________________________________________________________________________
338  // Graphic State Rendering object accessors
339  //________________________________________________________________________________________
344  virtual IRenderObjectService* QueryRenderObjectService (ClassID renderClassID) = 0;
352  virtual IRenderingObject* CreateTemporaryRenderObject (ClassID, const IRenderingObject* iSourceRenderObject = nil) = 0;
353 
354 
355 };
356 
357 
358 #endif // __IGraphicStateUtils__