Index: fpdfsdk/include/cpdfsdk_annot.h |
diff --git a/fpdfsdk/include/cpdfsdk_annot.h b/fpdfsdk/include/cpdfsdk_annot.h |
index 967226e9db382a96364169d1d4f890d6c983f8dc..a43b8775dbbb3b581f67a35999c4324c7c781959 100644 |
--- a/fpdfsdk/include/cpdfsdk_annot.h |
+++ b/fpdfsdk/include/cpdfsdk_annot.h |
@@ -23,9 +23,22 @@ class CPDFSDK_PageView; |
class CPDFSDK_Annot { |
public: |
+ class Observer { |
+ public: |
+ explicit Observer(CPDFSDK_Annot** pWatchedPtr); |
+ ~Observer(); |
+ void OnAnnotDestroyed(); |
+ |
+ private: |
+ CPDFSDK_Annot** m_pWatchedPtr; |
+ }; |
+ |
explicit CPDFSDK_Annot(CPDFSDK_PageView* pPageView); |
virtual ~CPDFSDK_Annot(); |
+ void AddObserver(Observer* observer); |
+ void RemoveObserver(Observer* observer); |
+ |
#ifdef PDF_ENABLE_XFA |
virtual FX_BOOL IsXFAField(); |
virtual CXFA_FFWidget* GetXFAWidget() const; |
@@ -57,6 +70,7 @@ class CPDFSDK_Annot { |
void SetSelected(FX_BOOL bSelected); |
protected: |
+ std::set<Observer*> m_Observers; |
CPDFSDK_PageView* m_pPageView; |
FX_BOOL m_bSelected; |
}; |