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 FPDFSDK_INCLUDE_FPDFXFA_FPDFXFA_UTIL_H_ | 7 #ifndef FPDFSDK_INCLUDE_FPDFXFA_FPDFXFA_UTIL_H_ |
8 #define FPDFSDK_INCLUDE_FPDFXFA_FPDFXFA_UTIL_H_ | 8 #define FPDFSDK_INCLUDE_FPDFXFA_FPDFXFA_UTIL_H_ |
9 | 9 |
| 10 #include <vector> |
| 11 |
10 #include "xfa/include/fwl/adapter/fwl_adaptertimermgr.h" | 12 #include "xfa/include/fwl/adapter/fwl_adaptertimermgr.h" |
11 | 13 |
12 #define JS_STR_VIEWERTYPE_STANDARD L"Exchange" | 14 #define JS_STR_VIEWERTYPE_STANDARD L"Exchange" |
13 #define JS_STR_LANGUANGE L"ENU" | 15 #define JS_STR_LANGUANGE L"ENU" |
14 #define JS_STR_VIEWERVARIATION L"Full" | 16 #define JS_STR_VIEWERVARIATION L"Full" |
15 #define JS_STR_VIEWERVERSION_XFA L"11" | 17 #define JS_STR_VIEWERVERSION_XFA L"11" |
16 | 18 |
| 19 class CFWL_TimerInfo; |
| 20 |
17 class CXFA_FWLAdapterTimerMgr : public IFWL_AdapterTimerMgr { | 21 class CXFA_FWLAdapterTimerMgr : public IFWL_AdapterTimerMgr { |
18 public: | 22 public: |
19 CXFA_FWLAdapterTimerMgr(CPDFDoc_Environment* pEnv) : m_pEnv(pEnv) {} | 23 CXFA_FWLAdapterTimerMgr(CPDFDoc_Environment* pEnv) : m_pEnv(pEnv) {} |
20 virtual FWL_ERR Start(IFWL_Timer* pTimer, | 24 virtual FWL_ERR Start(IFWL_Timer* pTimer, |
21 FX_DWORD dwElapse, | 25 FX_DWORD dwElapse, |
22 FWL_HTIMER& hTimer, | 26 FWL_HTIMER& hTimer, |
23 FX_BOOL bImmediately = TRUE); | 27 FX_BOOL bImmediately = TRUE); |
24 virtual FWL_ERR Stop(FWL_HTIMER hTimer); | 28 virtual FWL_ERR Stop(FWL_HTIMER hTimer); |
25 | 29 |
26 protected: | 30 protected: |
27 static void TimerProc(int32_t idEvent); | 31 static void TimerProc(int32_t idEvent); |
28 | 32 |
29 static CFX_PtrArray ms_timerArray; | 33 static std::vector<CFWL_TimerInfo*> s_TimerArray; |
30 CPDFDoc_Environment* m_pEnv; | 34 CPDFDoc_Environment* const m_pEnv; |
31 }; | 35 }; |
32 | 36 |
33 class CFWL_TimerInfo { | 37 class CFWL_TimerInfo { |
34 public: | 38 public: |
35 CFWL_TimerInfo() : pTimer(nullptr) {} | 39 CFWL_TimerInfo() : pTimer(nullptr) {} |
| 40 CFWL_TimerInfo(uint32_t event, IFWL_Timer* timer) |
| 41 : uIDEvent(event), pTimer(timer) {} |
| 42 |
36 uint32_t uIDEvent; | 43 uint32_t uIDEvent; |
37 IFWL_Timer* pTimer; | 44 IFWL_Timer* pTimer; |
38 }; | 45 }; |
39 | 46 |
40 #endif // FPDFSDK_INCLUDE_FPDFXFA_FPDFXFA_UTIL_H_ | 47 #endif // FPDFSDK_INCLUDE_FPDFXFA_FPDFXFA_UTIL_H_ |
OLD | NEW |