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

Unified Diff: fpdfsdk/include/cpdfsdk_annot.h

Issue 2306663002: Add observer for BAAnnots from Javascript (Closed)
Patch Set: 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..0cbc324bc8cf6211c0895c3b4d5ed15e477c8427 100644
--- a/fpdfsdk/include/cpdfsdk_annot.h
+++ b/fpdfsdk/include/cpdfsdk_annot.h
@@ -23,9 +23,18 @@ class CPDFSDK_PageView;
class CPDFSDK_Annot {
public:
+ class Observer {
+ public:
+ virtual ~Observer();
+ virtual void OnAnnotDestroyed() = 0;
+ };
+
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 +66,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