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_APP_H_ | 7 #ifndef XFA_FWL_CORE_IFWL_APP_H_ |
8 #define XFA_FWL_CORE_IFWL_APP_H_ | 8 #define XFA_FWL_CORE_IFWL_APP_H_ |
9 | 9 |
10 // The FWL app code contains three parallel classes, which reference each | |
11 // other via pointers as follows: | |
12 // | |
13 // m_pIface m_pImpl | |
14 // CXFA_FFApp ------------> IFWL_App -----------> CFWL_AppImp | |
15 // <----------- | |
npm
2016/10/18 17:04:11
Do we still need a comment explaining how these cl
dsinclair
2016/10/18 17:08:27
I don't think so, now it's just CXFA_FFApp -> IFWL
| |
16 // m_pIface | |
17 | |
18 #include <memory> | 10 #include <memory> |
19 | 11 |
20 #include "core/fxcrt/fx_string.h" | 12 #include "core/fxcrt/fx_string.h" |
21 #include "xfa/fwl/core/fwl_appimp.h" | |
22 #include "xfa/fwl/core/fwl_error.h" | |
23 | 13 |
24 class CFWL_NoteDriver; | 14 class CFWL_NoteDriver; |
25 class CFWL_WidgetMgr; | 15 class CFWL_WidgetMgr; |
26 class CXFA_FFApp; | 16 class CXFA_FFApp; |
27 class CXFA_FWLAdapterWidgetMgr; | 17 class CXFA_FWLAdapterWidgetMgr; |
28 class IFWL_ThemeProvider; | |
29 class IFWL_Widget; | 18 class IFWL_Widget; |
30 | 19 |
31 enum FWL_KeyFlag { | 20 enum FWL_KeyFlag { |
32 FWL_KEYFLAG_Ctrl = 1 << 0, | 21 FWL_KEYFLAG_Ctrl = 1 << 0, |
33 FWL_KEYFLAG_Alt = 1 << 1, | 22 FWL_KEYFLAG_Alt = 1 << 1, |
34 FWL_KEYFLAG_Shift = 1 << 2, | 23 FWL_KEYFLAG_Shift = 1 << 2, |
35 FWL_KEYFLAG_Command = 1 << 3, | 24 FWL_KEYFLAG_Command = 1 << 3, |
36 FWL_KEYFLAG_LButton = 1 << 4, | 25 FWL_KEYFLAG_LButton = 1 << 4, |
37 FWL_KEYFLAG_RButton = 1 << 5, | 26 FWL_KEYFLAG_RButton = 1 << 5, |
38 FWL_KEYFLAG_MButton = 1 << 6 | 27 FWL_KEYFLAG_MButton = 1 << 6 |
39 }; | 28 }; |
40 | 29 |
41 class IFWL_App { | 30 class IFWL_App { |
Lei Zhang
2016/10/18 16:48:15
Is this going to get renamed later?
dsinclair
2016/10/18 17:00:22
Probably, I'm saving that for once we've got the r
| |
42 public: | 31 public: |
43 static IFWL_App* Create(CXFA_FFApp* pAdapter); | 32 explicit IFWL_App(CXFA_FFApp* pAdapter); |
33 ~IFWL_App(); | |
44 | 34 |
45 virtual ~IFWL_App(); | |
46 | |
47 FWL_Error Initialize(); | |
48 FWL_Error Finalize(); | |
49 CXFA_FFApp* GetAdapterNative(); | 35 CXFA_FFApp* GetAdapterNative(); |
50 CFWL_WidgetMgr* GetWidgetMgr(); | 36 CFWL_WidgetMgr* GetWidgetMgr(); |
51 IFWL_ThemeProvider* GetThemeProvider(); | 37 CFWL_NoteDriver* GetNoteDriver() const { return m_pNoteDriver.get(); } |
52 void SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); | |
53 void Exit(int32_t iExitCode); | |
npm
2016/10/18 17:04:11
So these three methods were simply unused?
dsinclair
2016/10/18 17:08:26
GetThemeProvider was used but it always returned n
| |
54 | |
55 // These call into polymorphic methods in the impl; no need to override. | |
56 void Release(); | |
57 | |
58 CFWL_AppImp* GetImpl() const { return m_pImpl.get(); } | |
59 | |
60 // Takes ownership of |pImpl|. | |
61 void SetImpl(CFWL_AppImp* pImpl) { m_pImpl.reset(pImpl); } | |
62 | |
63 CFWL_NoteDriver* GetNoteDriver() const; | |
64 | 38 |
65 private: | 39 private: |
66 IFWL_App(); | 40 CXFA_FFApp* const m_pAdapterNative; |
67 | 41 std::unique_ptr<CFWL_WidgetMgr> m_pWidgetMgr; |
68 std::unique_ptr<CFWL_AppImp> m_pImpl; | 42 std::unique_ptr<CFWL_NoteDriver> m_pNoteDriver; |
69 }; | 43 }; |
70 | 44 |
71 IFWL_App* FWL_GetApp(); | 45 IFWL_App* FWL_GetApp(); |
72 void FWL_SetApp(IFWL_App* pApp); | 46 void FWL_SetApp(IFWL_App* pApp); |
73 | 47 |
74 CXFA_FFApp* FWL_GetAdapterNative(); | 48 CXFA_FFApp* FWL_GetAdapterNative(); |
75 CXFA_FWLAdapterWidgetMgr* FWL_GetAdapterWidgetMgr(); | 49 CXFA_FWLAdapterWidgetMgr* FWL_GetAdapterWidgetMgr(); |
76 | 50 |
77 #endif // XFA_FWL_CORE_IFWL_APP_H_ | 51 #endif // XFA_FWL_CORE_IFWL_APP_H_ |
OLD | NEW |