OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 |
| 7 #ifndef XFA_FWL_CORE_CFWL_NOTE_H_ |
| 8 #define XFA_FWL_CORE_CFWL_NOTE_H_ |
| 9 |
| 10 #include "core/fxcrt/include/fx_string.h" |
| 11 #include "core/fxcrt/include/fx_system.h" |
| 12 #include "xfa/fwl/core/fwl_error.h" |
| 13 |
| 14 class IFWL_Widget; |
| 15 |
| 16 // Separate hierarchy not related to IFWL_* hierarchy. These should not |
| 17 // get cast to IFWL_* types. |
| 18 class CFWL_Note { |
| 19 public: |
| 20 virtual FX_DWORD Release() { |
| 21 m_dwRefCount--; |
| 22 FX_DWORD dwRefCount = m_dwRefCount; |
| 23 if (!m_dwRefCount) |
| 24 delete this; |
| 25 return dwRefCount; |
| 26 } |
| 27 |
| 28 virtual CFWL_Note* Retain() { |
| 29 m_dwRefCount++; |
| 30 return this; |
| 31 } |
| 32 |
| 33 virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const { |
| 34 wsClass = L"CFWL_Note"; |
| 35 return FWL_ERR_Succeeded; |
| 36 } |
| 37 |
| 38 virtual FX_DWORD GetClassID() const { return 0; } |
| 39 |
| 40 virtual FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const { |
| 41 return TRUE; |
| 42 } |
| 43 |
| 44 virtual CFWL_Note* Clone() { return NULL; } |
| 45 FX_BOOL IsEvent() const { return m_bIsEvent; } |
| 46 |
| 47 IFWL_Widget* m_pSrcTarget; |
| 48 IFWL_Widget* m_pDstTarget; |
| 49 FX_DWORD m_dwExtend; |
| 50 |
| 51 protected: |
| 52 CFWL_Note(FX_BOOL bIsEvent) |
| 53 : m_pSrcTarget(NULL), |
| 54 m_pDstTarget(NULL), |
| 55 m_dwExtend(0), |
| 56 m_dwRefCount(1), |
| 57 m_bIsEvent(bIsEvent) {} |
| 58 |
| 59 virtual ~CFWL_Note() {} |
| 60 virtual FX_BOOL Initialize() { return TRUE; } |
| 61 virtual int32_t Finalize() { return 0; } |
| 62 |
| 63 FX_DWORD m_dwRefCount; |
| 64 FX_BOOL m_bIsEvent; |
| 65 }; |
| 66 |
| 67 #endif // XFA_FWL_CORE_CFWL_NOTE_H_ |
OLD | NEW |