Merge to XFA: Use stdint.h types throughout PDFium.
[pdfium.git] / xfa / src / fwl / src / basewidget / fwl_formproxyimp.cpp
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 #include "../../../foxitlib.h"\r
8 #include "../core/include/fwl_targetimp.h"\r
9 #include "../core/include/fwl_noteimp.h"\r
10 #include "../core/include/fwl_widgetimp.h"\r
11 #include "../core/include/fwl_panelimp.h"\r
12 #include "../core/include/fwl_formimp.h"\r
13 #include "include/fwl_formproxyimp.h"\r
14 CFWL_FormProxyImp::CFWL_FormProxyImp(IFWL_Widget *pOuter )\r
15     : CFWL_FormImp(pOuter)\r
16 {\r
17 }\r
18 CFWL_FormProxyImp::CFWL_FormProxyImp(const CFWL_WidgetImpProperties &properties, IFWL_Widget *pOuter )\r
19     : CFWL_FormImp(properties, pOuter)\r
20 {\r
21 }\r
22 CFWL_FormProxyImp::~CFWL_FormProxyImp()\r
23 {\r
24 }\r
25 FWL_ERR CFWL_FormProxyImp::GetClassName(CFX_WideString &wsClass) const\r
26 {\r
27     wsClass = FWL_CLASS_FormProxy;\r
28     return FWL_ERR_Succeeded;\r
29 }\r
30 FX_DWORD CFWL_FormProxyImp::GetClassID() const\r
31 {\r
32     return FWL_CLASSHASH_FormProxy;\r
33 }\r
34 FX_BOOL CFWL_FormProxyImp::IsInstance(FX_WSTR wsClass) const\r
35 {\r
36     if (wsClass == CFX_WideStringC(FWL_CLASS_FormProxy)) {\r
37         return TRUE;\r
38     }\r
39     return CFWL_FormImp::IsInstance(wsClass);\r
40 }\r
41 FWL_ERR CFWL_FormProxyImp::Initialize()\r
42 {\r
43     _FWL_ERR_CHECK_RETURN_VALUE_IF_FAIL(CFWL_WidgetImp::Initialize(), FWL_ERR_Indefinite);\r
44     m_pDelegate = (IFWL_WidgetDelegate *)FX_NEW CFWL_FormProxyImpDelegate(this);\r
45     return FWL_ERR_Succeeded;\r
46 }\r
47 FWL_ERR CFWL_FormProxyImp::Finalize()\r
48 {\r
49     if ( m_pDelegate) {\r
50         delete (CFWL_FormProxyImpDelegate*)m_pDelegate;\r
51         m_pDelegate = NULL;\r
52     }\r
53     return CFWL_WidgetImp::Finalize();\r
54 }\r
55 FWL_ERR CFWL_FormProxyImp::Update()\r
56 {\r
57     return FWL_ERR_Succeeded;\r
58 }\r
59 FWL_ERR CFWL_FormProxyImp::DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix )\r
60 {\r
61     return FWL_ERR_Succeeded;\r
62 }\r
63 CFWL_FormProxyImpDelegate::CFWL_FormProxyImpDelegate(CFWL_FormProxyImp *pOwner)\r
64     : m_pOwner(pOwner)\r
65 {\r
66 }\r
67 int32_t CFWL_FormProxyImpDelegate::OnProcessMessage(CFWL_Message *pMessage)\r
68 {\r
69     IFWL_WidgetDelegate *pDelegate = m_pOwner->m_pOuter->SetDelegate(NULL);\r
70     return pDelegate->OnProcessMessage(pMessage);\r
71 }\r