summaryrefslogtreecommitdiff
path: root/fpdfsdk/include
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-09-07 14:11:27 -0700
committerCommit bot <commit-bot@chromium.org>2016-09-07 14:11:27 -0700
commit7b68f616e49235267eeac8db51aadade6d60e243 (patch)
treee49619edf4ff8f7b10adec869bb30dcc4a1b88f9 /fpdfsdk/include
parentf56d93f8ea1c2145401e99e61cefdbfcb7341229 (diff)
downloadpdfium-7b68f616e49235267eeac8db51aadade6d60e243.tar.xz
Make Observers into a templated class
Review-Url: https://codereview.chromium.org/2311343003
Diffstat (limited to 'fpdfsdk/include')
-rw-r--r--fpdfsdk/include/cpdfsdk_annot.h17
1 files changed, 2 insertions, 15 deletions
diff --git a/fpdfsdk/include/cpdfsdk_annot.h b/fpdfsdk/include/cpdfsdk_annot.h
index a43b8775db..e7ae2e15a2 100644
--- a/fpdfsdk/include/cpdfsdk_annot.h
+++ b/fpdfsdk/include/cpdfsdk_annot.h
@@ -10,6 +10,7 @@
#include "core/fpdfdoc/include/cpdf_aaction.h"
#include "core/fpdfdoc/include/cpdf_annot.h"
#include "core/fpdfdoc/include/cpdf_defaultappearance.h"
+#include "core/fxcrt/include/cfx_observable.h"
#include "core/fxcrt/include/fx_basic.h"
#include "fpdfsdk/cfx_systemhandler.h"
#include "fpdfsdk/include/fsdk_common.h"
@@ -21,24 +22,11 @@ class CPDF_Page;
class CPDF_RenderOptions;
class CPDFSDK_PageView;
-class CPDFSDK_Annot {
+class CPDFSDK_Annot : public CFX_Observable<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;
@@ -70,7 +58,6 @@ class CPDFSDK_Annot {
void SetSelected(FX_BOOL bSelected);
protected:
- std::set<Observer*> m_Observers;
CPDFSDK_PageView* m_pPageView;
FX_BOOL m_bSelected;
};