InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CRenderingObject.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: SusanCL
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 __CRenderingObject__
25 #define __CRenderingObject__
26 
27 #include "IRenderingObject.h"
28 #include "HelperInterface.h"
29 
30 class PMRect;
31 class IGraphicsPort;
32 class IGraphicsContext;
33 
35 {
36  public:
38  virtual ~CRenderingObject( );
39 
40  virtual void ReadWrite (IPMStream *s, ImplementationID prop);
41 
42  // Subclasses must override Install methods. The default method does nothing.
43  virtual void Install (IGraphicsPort* gPort, IGraphicStyleDescriptor* iGSDesc, InstallAction theAction) const;
44  virtual void Install (IGraphicsPort* gPort, IWaxRenderData* iWaxData, InstallAction theAction) const;
45  virtual void Install (IGraphicsPort* gPort, IGraphicAttributeSuite* iGfxAttrSuite, InstallAction theAction, const PMRect& r ) const;
46  virtual void Install (IGraphicsPort* gPort, const AttributeBossList& attrs, const PMRect& r, InstallAction theAction) const;
47  virtual void Install ( IGraphicsPort *gPort, const PMRect& r ) const;
48  virtual void Install (IGraphicsPort* gPort, RenderingObjectInstallData *data, const PMRect& r, InstallAction theAction) const;
49 
50  virtual const PMString& GetSwatchUIName () const;
51  virtual PMString GetTipText() const;
52  virtual PMString GetTipText( const int32& colorSpace, const ColorArray& colorComponents ) const;
53 
54  virtual const PMString& GetSwatchName () const;
55  virtual bool16 GetVisibility () const;
56  virtual bool16 GetCanDelete () const;
57  virtual bool16 GetCanEdit () const;
58  virtual bool16 IsGlobal () const;
59  virtual UID GetSwatchAliasUID () const;
60 
61  // Use this to get special edit info about the render object.
62  // Example: for a solid color, it can indicate which data element can be edited which can't.
63  // Subclass must override. The default method just returns 0.
64  virtual int32 GetSpecialEditInfo () const;
65 
66  virtual void SetSwatchName (const PMString& newName);
67  virtual void SetVisibility (const bool16 visible);
68  virtual void SetCanDelete (const bool16 canDelete);
69  virtual void SetCanEdit (const bool16 canEdit);
70  virtual void SetSwatchAliasUID (UID);
71 
72  virtual int32 GetCreatorID () const;
73  virtual void SetCreatorID (int32);
74 
75  // Use this to set special edit info for the render object.
76  // Subclass must override. The default method does nothing
77  virtual void SetSpecialEditInfo (const int32 editInfo);
78 
79  // Given an UID, determined if that UID caused any changes in the rendering object.
80  // returns kTrue, if updates will be required. Otherwise, return kFalse.
81  virtual bool16 NeedUpdate ( UID interestedUID ) const;
82 
83  // Duplicate this rendering object as a new local rendering object taking into account
84  // any stroke or fill's overriding attributes if any. Returns the new UID that it created.
85  // Use the first one with a page item and the second with text.
86  // IMPORTANT NOTE: These methods must be called within a command sequence in order for the
87  // Undo/Redo to be performed correctly.
88  virtual UID DuplicateAsLocal ( const IGraphicStyleDescriptor* overrideAttrs, InstallAction theAction) const;
89  virtual UID DuplicateAsLocal ( const AttributeBossList* overrideAttrs, InstallAction theAction) const;
90  virtual UID DuplicateAsLocal ( const PMReal& tint) const;
91 
92  //____________________________________________________________________________________
93  // Utilities
94  //____________________________________________________________________________________
95 
96  // Rendering class
97  virtual ClassID GetRenderClass () const {return kInvalidClass;}
98 
99  // Two rendering objects are equal if all their persisten data and rendering data
100  // are equal.
101  virtual bool16 IsEqual (const IRenderingObject*) const;
102 
103  protected:
104  UID DuplicateAsLocal(void) const;
105 
106  PMString fRenderName;
107 
108  private:
109  void SetIsGlobal (const bool16 isGlobal); // to be a public method once we support AI's named local swatches.
110 
111 
112  int32 fRenderingFlag;
113  enum {
114  kDeleteFlag = 0x00000001,
115  kVisibleFlag = 0x00000002,
116  kEditFlag = 0x00000004,
117  kGlobalFlag = 0x00000008
118  };
119 
120 
121 };
122 
123 
124 #endif // __CRenderingObject__