OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 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_IFWL_WIDGET_H_ | 7 #ifndef XFA_FWL_CORE_IFWL_WIDGET_H_ |
8 #define XFA_FWL_CORE_IFWL_WIDGET_H_ | 8 #define XFA_FWL_CORE_IFWL_WIDGET_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "core/fxcrt/include/fx_basic.h" | 12 #include "core/fxcrt/include/fx_basic.h" |
13 #include "core/fxcrt/include/fx_coordinates.h" | 13 #include "core/fxcrt/include/fx_coordinates.h" |
14 #include "core/fxcrt/include/fx_system.h" | 14 #include "core/fxcrt/include/fx_system.h" |
15 #include "xfa/fwl/core/fwl_error.h" | 15 #include "xfa/fwl/core/fwl_error.h" |
16 #include "xfa/fwl/core/fwl_widgetimp.h" | 16 #include "xfa/fwl/core/fwl_widgetimp.h" |
17 | 17 |
18 // FWL contains three parallel inheritance hierarchies, which reference each | 18 // FWL contains three parallel inheritance hierarchies, which reference each |
19 // other via pointers as follows: | 19 // other via pointers as follows: |
20 // | 20 // |
21 // m_pIface m_pImpl | 21 // m_pIface m_pImpl |
22 // CFWL_Widget ----------> IFWL_Widget ----------> CFWL_WidgetImp | 22 // CFWL_Widget ----------> IFWL_Widget ----------> CFWL_WidgetImp |
23 // | | | | 23 // | | | |
24 // A A A | 24 // A A A |
25 // | | | | 25 // | | | |
26 // CFWL_... IFWL_... CFWL_...Imp | 26 // CFWL_... IFWL_... CFWL_...Imp |
27 // | 27 // |
28 | 28 |
| 29 enum class FWL_Type { |
| 30 Unknown = 0, |
| 31 |
| 32 Barcode, |
| 33 Caret, |
| 34 CheckBox, |
| 35 ComboBox, |
| 36 DateTimePicker, |
| 37 Edit, |
| 38 Form, |
| 39 FormProxy, |
| 40 ListBox, |
| 41 MonthCalendar, |
| 42 PictureBox, |
| 43 PushButton, |
| 44 ScrollBar, |
| 45 SpinButton, |
| 46 ToolTip |
| 47 }; |
| 48 |
29 class CFWL_WidgetImp; | 49 class CFWL_WidgetImp; |
30 class CFX_Graphics; | 50 class CFX_Graphics; |
31 class IFWL_App; | 51 class IFWL_App; |
32 class IFWL_DataProvider; | 52 class IFWL_DataProvider; |
33 class IFWL_Form; | 53 class IFWL_Form; |
34 class IFWL_ThemeProvider; | 54 class IFWL_ThemeProvider; |
35 class IFWL_WidgetDelegate; | 55 class IFWL_WidgetDelegate; |
36 | 56 |
37 class IFWL_Widget { | 57 class IFWL_Widget { |
38 public: | 58 public: |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 IFWL_ThemeProvider* GetThemeProvider(); | 90 IFWL_ThemeProvider* GetThemeProvider(); |
71 FWL_ERR SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); | 91 FWL_ERR SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); |
72 FWL_ERR SetDataProvider(IFWL_DataProvider* pDataProvider); | 92 FWL_ERR SetDataProvider(IFWL_DataProvider* pDataProvider); |
73 IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate); | 93 IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate); |
74 IFWL_App* GetOwnerApp() const; | 94 IFWL_App* GetOwnerApp() const; |
75 CFX_SizeF GetOffsetFromParent(IFWL_Widget* pParent); | 95 CFX_SizeF GetOffsetFromParent(IFWL_Widget* pParent); |
76 | 96 |
77 // These call into equivalent polymorphic methods of m_pImpl. There | 97 // These call into equivalent polymorphic methods of m_pImpl. There |
78 // should be no need to override these in subclasses. | 98 // should be no need to override these in subclasses. |
79 FWL_ERR GetClassName(CFX_WideString& wsClass) const; | 99 FWL_ERR GetClassName(CFX_WideString& wsClass) const; |
80 uint32_t GetClassID() const; | 100 FWL_Type GetClassID() const; |
81 FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const; | 101 FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const; |
82 FWL_ERR Initialize(); | 102 FWL_ERR Initialize(); |
83 FWL_ERR Finalize(); | 103 FWL_ERR Finalize(); |
84 | 104 |
85 CFWL_WidgetImp* GetImpl() const { return m_pImpl.get(); } | 105 CFWL_WidgetImp* GetImpl() const { return m_pImpl.get(); } |
86 | 106 |
87 protected: | 107 protected: |
88 // Takes ownership of |pImpl|. | 108 // Takes ownership of |pImpl|. |
89 void SetImpl(CFWL_WidgetImp* pImpl) { m_pImpl.reset(pImpl); } | 109 void SetImpl(CFWL_WidgetImp* pImpl) { m_pImpl.reset(pImpl); } |
90 | 110 |
91 private: | 111 private: |
92 std::unique_ptr<CFWL_WidgetImp> m_pImpl; | 112 std::unique_ptr<CFWL_WidgetImp> m_pImpl; |
93 }; | 113 }; |
94 | 114 |
95 #endif // XFA_FWL_CORE_IFWL_WIDGET_H_ | 115 #endif // XFA_FWL_CORE_IFWL_WIDGET_H_ |
OLD | NEW |