Replace XFA_HDOC with IXFA_Doc*
[pdfium.git] / xfa / src / fxfa / src / app / xfa_ffapp.h
1 // Copyright 2014 PDFium Authors. All rights reserved.\r
2 // Use of this source code is governed by a BSD-style license that can be\r
3 // found in the LICENSE file.\r
4 \r
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
6 \r
7 #ifndef XFA_FFAPP_H_\r
8 #define XFA_FFAPP_H_\r
9 \r
10 class CXFA_FileRead : public IFX_FileRead\r
11 {\r
12 public:\r
13     CXFA_FileRead(const CFX_ArrayTemplate<CPDF_Stream*> &streams);\r
14     ~CXFA_FileRead();\r
15     virtual FX_FILESIZE GetSize();\r
16     virtual FX_BOOL             ReadBlock(void* buffer, FX_FILESIZE offset, size_t size);\r
17     virtual void                Release()\r
18     {\r
19         delete this;\r
20     }\r
21 protected:\r
22     CFX_ArrayTemplate<CPDF_Stream*>                     m_Streams;\r
23     CFX_DWordArray                                                      m_StreamSize;\r
24     FX_DWORD                                                            m_dwSize;\r
25 };\r
26 class CXFA_FileRead2 : public IFX_FileRead\r
27 {\r
28 public:\r
29     CXFA_FileRead2(const CFX_ArrayTemplate<CPDF_Stream*> &streams);\r
30 \r
31     virtual FX_FILESIZE GetSize();\r
32     virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size);\r
33 \r
34     virtual void Release()\r
35     {\r
36         delete this;\r
37     }\r
38 \r
39 protected:\r
40     CFX_ObjectArray<CPDF_StreamAcc>                     m_Data;\r
41 };\r
42 class CXFA_FWLAdapterWidgetMgr;\r
43 class CXFA_FWLTheme;\r
44 class CXFA_FFDocHandler;\r
45 class CXFA_FFMenuHandler;\r
46 class CXFA_FontMgr;\r
47 class CXFA_FFApp : public IXFA_App, public IFWL_AdapterNative\r
48 {\r
49 public:\r
50     CXFA_FFApp(IXFA_AppProvider* pProvider);\r
51     ~CXFA_FFApp() override;\r
52 \r
53     virtual IXFA_DocHandler*    GetDocHandler();\r
54     virtual IXFA_Doc*                   CreateDoc(IXFA_DocProvider* pProvider, IFX_FileRead* pStream, FX_BOOL bTakeOverFile);\r
55     virtual IXFA_Doc*                   CreateDoc(IXFA_DocProvider* pProvider, CPDF_Document* pPDFDoc);\r
56     virtual     IXFA_AppProvider*       GetAppProvider()\r
57     {\r
58         return m_pProvider;\r
59     }\r
60     virtual void                                SetDefaultFontMgr(IXFA_FontMgr* pFontMgr);\r
61     virtual IXFA_MenuHandler*   GetMenuHandler();\r
62     virtual IFWL_AdapterWidgetMgr*      GetWidgetMgr(IFWL_WidgetMgrDelegate* pDelegate);\r
63     virtual IFWL_AdapterThreadMgr*      GetThreadMgr();\r
64     virtual IFWL_AdapterTimerMgr*       GetTimerMgr();\r
65     virtual IFWL_AdapterCursorMgr*      GetCursorMgr();\r
66     virtual IFWL_AdapterMonitorMgr* GetMonitorMgr();\r
67     virtual     IFWL_AdapterClipboardMgr* GetClipboardMgr();\r
68     CXFA_FontMgr*               GetXFAFontMgr();\r
69     IFX_FontMgr*                GetFDEFontMgr();\r
70     CXFA_FWLTheme*              GetFWLTheme();\r
71     IFWL_WidgetMgrDelegate* GetWidgetMgrDelegate()\r
72     {\r
73         return m_pWidgetMgrDelegate;\r
74     }\r
75 protected:\r
76     CXFA_FFDocHandler*          m_pDocHandler;\r
77     IFWL_App*                           m_pFWLApp;\r
78     CXFA_FWLTheme*                      m_pFWLTheme;\r
79     IXFA_AppProvider*           m_pProvider;\r
80     CXFA_FontMgr*                       m_pFontMgr;\r
81 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_\r
82     IFX_FontSourceEnum*         m_pFontSource;\r
83 #endif\r
84     CXFA_FWLAdapterWidgetMgr* m_pAdapterWidgetMgr;\r
85     IFWL_WidgetMgrDelegate*     m_pWidgetMgrDelegate;\r
86     IFX_FontMgr*                        m_pFDEFontMgr;\r
87     CXFA_FFMenuHandler*         m_pMenuHandler;\r
88     CFWL_SDAdapterThreadMgr* m_pAdapterThreadMgr;\r
89 };\r
90 \r
91 #endif  // XFA_FFAPP_H_\r