Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Unified Diff: fpdfsdk/include/cpdfsdk_annot.h

Issue 2306663002: Add observer for BAAnnots from Javascript (Closed)
Patch Set: Review updates Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
};

Powered by Google App Engine
This is Rietveld 408576698