InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CSubject.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 __CSUBJECT__
25 #define __CSUBJECT__
26 
27 #include "ISubject.h"
28 #include "HelperInterface.h"
29 #include "K2SmartPtr.h"
30 //----------------------------------------------------------------------------------------
31 // Forward Declarations
32 //----------------------------------------------------------------------------------------
33 class IChangeManager;
34 
35 //----------------------------------------------------------------------------------------
36 // Class Info
37 //----------------------------------------------------------------------------------------
38 
39 
48 class CSubject : public ISubject
49 {
50  public:
51  CSubject(IPMUnknown *boss);
52  virtual ~CSubject();
53 
54  virtual IChangeManager* GetChangeManager() const;
55 
56  virtual bool16 IsAttached(IObserver* observer,
57  const PMIID& interestedIn,
58  const PMIID& asObserver = IID_IOBSERVER);
59 
60  virtual void AttachObserver(IObserver* observer,
61  const PMIID& interestedIn,
62  const PMIID& asObserver = IID_IOBSERVER);
63 
64  virtual void DetachObserver(IObserver* observer,
65  const PMIID& interestedIn,
66  const PMIID& asObserver = IID_IOBSERVER);
67 
68  virtual void Change(ClassID theChange, const PMIID& interestedIn = IID_IUNKNOWN, void* changedBy = nil);
69 
70  virtual void Change(ISubject* originalSubject, ClassID theChange, const PMIID& interestedIn = IID_IUNKNOWN, void* changedBy = nil);
71 
72  virtual void Mute(bool16 muteOn);
73 
74  virtual bool16 IsMuted() const;
75 
76 
77  virtual void AttachObserver(AttachmentType attachType, IObserver* observer, const PMIID& interestedIn, const PMIID& asObserver);
78 
79  virtual void DetachObserver(AttachmentType attachType, IObserver* observer, const PMIID& interestedIn, const PMIID& asObserver);
80 
81  virtual bool16 IsAttached(AttachmentType attachType, IObserver* observer, const PMIID& interestedIn, const PMIID& asObserver);
82 
83  virtual void ModelChange(ClassID theChange, const PMIID& interestedIn,
84  void* changedBy, LazyNotificationData* data);
85 
86  virtual void ModelChange(ISubject* originalSubject, ClassID theChange, const PMIID& interestedIn,
87  void* changedBy, LazyNotificationData* data);
88 
89  virtual void ModelChange(IDataBase* model, ClassID theChange, const PMIID& interestedIn,
90  void* changedBy, LazyNotificationData* data);
91 
92 
93 protected:
94  bool16 fDetachObserversOnDelete;
95  bool16 fMuted;
96  const UIDRef fThisRef;
97 
98 };
99 
100 
101 #endif