InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CLinkObject.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Michael Easter
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 // Description:
24 // Pure virtual base class that all ILinkObject derived classes should inherit.
25 //
26 //========================================================================================
27 
28 #ifndef __CLinkObject__
29 #define __CLinkObject__
30 
31 // ----- Includes -----
32 #include "CPMUnknown.h"
33 #include "ILinkObject.h"
34 
35 #include "ILink.h"
36 #include "UIDList.h"
37 
38 class IPMStream;
39 
40 
51 class CLinkObject : public CPMUnknown<ILinkObject>
52 {
53 public:
55  typedef object_type data_type;
56 
57  CLinkObject(IPMUnknown* boss);
58  virtual ~CLinkObject();
59 
60  virtual LinkClientID GetClientID() const { return fClientId; }
61 
62  virtual bool IsDirectLink() const { return true; }
63  virtual IPMUnknown* QueryLinkedObject(const PMIID& interfaceId) const;
64 
65  virtual bool CanUpdate(const ILinkResource* iResource, UID linkUID, UIFlags uiFlags, ErrorCode& err) const { return true; }
66 
67  virtual ClassID GetImportProvider(const ILinkResource* iResource, UID linkUID) const { return kInvalidClass; }
68  virtual ClassID GetExportProvider(const ILinkResource* iResource, UID linkUID) const { return kInvalidClass; }
69  virtual ClassID GetResolveProvider(const ILinkResource* iResource, UID linkUID) const { return kInvalidClass; }
70 
71  virtual UIDList GetLinks() const { return fLinkRefs; }
72 
73  virtual void MarkLinksModified() const;
74  virtual void ClearLinksModified() const;
75 
83  virtual void ReadWrite(IPMStream* s, ImplementationID prop);
84 
85 protected:
91 
92 private:
93  virtual void AddLinkRef(UID linkUID);
94  virtual void RemoveLinkRef(UID linkUID);
95 
96  void SetLinksObjectModificationState(ILink::ObjectModificationState modState) const;
97 
98  UIDList fLinkRefs;
99 };
100 
101 #endif // __CLinkObject__