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