Merge XFA to PDFium master at 4dc95e7 on 10/28/2014
[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 _FXFA_FORMFILLER_APP_IMP_H\r
8 #define _FXFA_FORMFILLER_APP_IMP_H\r
9 class CXFA_FileRead : public IFX_FileRead, public CFX_Object\r
10 {\r
11 public:\r
12     CXFA_FileRead(const CFX_ArrayTemplate<CPDF_Stream*> &streams);\r
13     ~CXFA_FileRead();\r
14     virtual FX_FILESIZE GetSize();\r
15     virtual FX_BOOL             ReadBlock(void* buffer, FX_FILESIZE offset, size_t size);\r
16     virtual void                Release()\r
17     {\r
18         delete this;\r
19     }\r
20 protected:\r
21     CFX_ArrayTemplate<CPDF_Stream*>                     m_Streams;\r
22     CFX_DWordArray                                                      m_StreamSize;\r
23     FX_DWORD                                                            m_dwSize;\r
24 };\r
25 class CXFA_FileRead2 : public IFX_FileRead, public CFX_Object\r
26 {\r
27 public:\r
28     CXFA_FileRead2(const CFX_ArrayTemplate<CPDF_Stream*> &streams);\r
29 \r
30     virtual FX_FILESIZE GetSize();\r
31     virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size);\r
32 \r
33     virtual void Release()\r
34     {\r
35         delete this;\r
36     }\r
37 \r
38 protected:\r
39     CFX_ObjectArray<CPDF_StreamAcc>                     m_Data;\r
40 };\r
41 class CXFA_FWLAdapterWidgetMgr;\r
42 class CXFA_FWLTheme;\r
43 class CXFA_FFDocHandler;\r
44 class CXFA_FFMenuHandler;\r
45 class CXFA_FontMgr;\r
46 class CXFA_FFApp : public IXFA_App, public IFWL_AdapterNative, public CFX_Object\r
47 {\r
48 public:\r
49     CXFA_FFApp(IXFA_AppProvider* pProvider);\r
50     ~CXFA_FFApp();\r
51     virtual void                Release()\r
52     {\r
53         delete this;\r
54     }\r
55     virtual IXFA_DocHandler*    GetDocHandler();\r
56     virtual XFA_HDOC                    CreateDoc(IXFA_DocProvider* pProvider, IFX_FileRead* pStream, FX_BOOL bTakeOverFile);\r
57     virtual XFA_HDOC                    CreateDoc(IXFA_DocProvider* pProvider, CPDF_Document* pPDFDoc);\r
58     virtual     IXFA_AppProvider*       GetAppProvider()\r
59     {\r
60         return m_pProvider;\r
61     }\r
62     virtual void                                SetDefaultFontMgr(IXFA_FontMgr* pFontMgr);\r
63     virtual IXFA_MenuHandler*   GetMenuHandler();\r
64     virtual IFWL_AdapterWidgetMgr*      GetWidgetMgr(IFWL_WidgetMgrDelegate* pDelegate);\r
65     virtual IFWL_AdapterThreadMgr*      GetThreadMgr();\r
66     virtual IFWL_AdapterTimerMgr*       GetTimerMgr();\r
67     virtual IFWL_AdapterCursorMgr*      GetCursorMgr();\r
68     virtual IFWL_AdapterMonitorMgr* GetMonitorMgr();\r
69     virtual     IFWL_AdapterClipboardMgr* GetClipboardMgr();\r
70     CXFA_FontMgr*               GetXFAFontMgr();\r
71     IFX_FontMgr*                GetFDEFontMgr();\r
72     CXFA_FWLTheme*              GetFWLTheme();\r
73     IFWL_WidgetMgrDelegate* GetWidgetMgrDelegate()\r
74     {\r
75         return m_pWidgetMgrDelegate;\r
76     }\r
77 protected:\r
78     CXFA_FFDocHandler*          m_pDocHandler;\r
79     IFWL_App*                           m_pFWLApp;\r
80     CXFA_FWLTheme*                      m_pFWLTheme;\r
81     IXFA_AppProvider*           m_pProvider;\r
82     CXFA_FontMgr*                       m_pFontMgr;\r
83 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_\r
84     IFX_FontSourceEnum*         m_pFontSource;\r
85 #endif\r
86     CXFA_FWLAdapterWidgetMgr* m_pAdapterWidgetMgr;\r
87     IFWL_WidgetMgrDelegate*     m_pWidgetMgrDelegate;\r
88     IFX_FontMgr*                        m_pFDEFontMgr;\r
89     CXFA_FFMenuHandler*         m_pMenuHandler;\r
90     CFWL_SDAdapterThreadMgr* m_pAdapterThreadMgr;\r
91 };\r
92 #endif\r