InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ISubject.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Lonnie Millett
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 __ISUBJECT__
25 #define __ISUBJECT__
26 
27 #include "IPMUnknown.h"
28 #include "ShuksanID.h"
29 #include "K2SmartPtr.h"
30 #include "LazyNotificationData.h"
31 
32 class IObserver;
33 class IChangeManager;
34 class IDataBase;
35 struct void_type
36 {};
37 
38 
39 //----------------------------------------------------------------------------------------
40 // Class ISubject
41 //----------------------------------------------------------------------------------------
42 
90 class ISubject : public IPMUnknown
91 {
92  public:
93  enum { kDefaultIID = IID_ISUBJECT };
94 
106  virtual bool16 IsAttached(IObserver* observer,
107  const PMIID& interestedIn,
108  const PMIID& asObserver = IID_IOBSERVER) = 0;
109 
120  virtual void AttachObserver(IObserver* observer,
121  const PMIID& interestedIn,
122  const PMIID& asObserver = IID_IOBSERVER) = 0;
123 
134  virtual void DetachObserver(IObserver* observer,
135  const PMIID& interestedIn,
136  const PMIID& asObserver = IID_IOBSERVER) = 0;
137 
149  virtual void Change(ClassID theChange, const PMIID& interestedIn = IID_IUNKNOWN, void* changedBy = nil) = 0;
150 
167  virtual void Change(ISubject* originalSubject, ClassID theChange, const PMIID& interestedIn = IID_IUNKNOWN, void* changedBy = nil) = 0;
168 
173  virtual void Mute(bool16 muteOn) = 0;
174 
177  virtual bool16 IsMuted() const = 0;
178 
182  virtual IChangeManager* GetChangeManager() const = 0;
183 
184 
202  virtual void ModelChange(ClassID theChange, const PMIID& interestedIn,
203  void* changedBy = nil, LazyNotificationData* data = nil) = 0;
204 
224  virtual void ModelChange(ISubject* originalSubject, ClassID theChange, const PMIID& interestedIn,
225  void* changedBy = nil, LazyNotificationData* data = nil) = 0;
226 
244  virtual void ModelChange(IDataBase* model, ClassID theChange, const PMIID& interestedIn,
245  void* changedBy = nil, LazyNotificationData* data = nil) = 0;
246 
250  {
260  } ;
261 
269  virtual bool16 IsAttached(AttachmentType attachType, IObserver* observer, const PMIID& interestedIn, const PMIID& asObserver) = 0;
270 
279  virtual void AttachObserver(AttachmentType attachType, IObserver* observer, const PMIID& interestedIn, const PMIID& asObserver) = 0;
280 
287  virtual void DetachObserver(AttachmentType attachType, IObserver* observer, const PMIID& interestedIn, const PMIID& asObserver) = 0;
288 };
289 
290 #endif