Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(716)

Side by Side Diff: xfa/src/fwl/src/basewidget/fwl_datetimepickerimp.cpp

Issue 1460883002: Make IFWL_Target::m_pImpl a private member. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "../../../foxitlib.h" 7 #include "../../../foxitlib.h"
8 #include "../core/include/fwl_targetimp.h" 8 #include "../core/include/fwl_targetimp.h"
9 #include "../core/include/fwl_noteimp.h" 9 #include "../core/include/fwl_noteimp.h"
10 #include "../core/include/fwl_widgetimp.h" 10 #include "../core/include/fwl_widgetimp.h"
11 #include "../core/include/fwl_panelimp.h" 11 #include "../core/include/fwl_panelimp.h"
12 #include "../core/include/fwl_formimp.h" 12 #include "../core/include/fwl_formimp.h"
13 #include "../core/include/fwl_widgetmgrimp.h" 13 #include "../core/include/fwl_widgetmgrimp.h"
14 #include "include/fwl_formproxyimp.h" 14 #include "include/fwl_formproxyimp.h"
15 #include "include/fwl_editimp.h" 15 #include "include/fwl_editimp.h"
16 #include "include/fwl_monthcalendarimp.h" 16 #include "include/fwl_monthcalendarimp.h"
17 #include "include/fwl_datetimepickerimp.h" 17 #include "include/fwl_datetimepickerimp.h"
18 #define FWL_DTP_WIDTH 100 18 #define FWL_DTP_WIDTH 100
19 #define FWL_DTP_HEIGHT 20 19 #define FWL_DTP_HEIGHT 20
20 IFWL_DateTimePicker* IFWL_DateTimePicker::Create() { 20 IFWL_DateTimePicker* IFWL_DateTimePicker::Create() {
21 return new IFWL_DateTimePicker; 21 return new IFWL_DateTimePicker;
22 } 22 }
23 FWL_ERR IFWL_DateTimeForm::Initialize( 23 FWL_ERR IFWL_DateTimeForm::Initialize(
24 const CFWL_WidgetImpProperties& properties, 24 const CFWL_WidgetImpProperties& properties,
25 IFWL_Widget* pOuter) { 25 IFWL_Widget* pOuter) {
26 m_pImpl = new CFWL_FormProxyImp(properties, pOuter); 26 CFWL_FormProxyImp* pFormProxyImpl = new CFWL_FormProxyImp(properties, pOuter);
27 ((CFWL_FormProxyImp*)m_pImpl)->SetInterface(this); 27 SetImpl(pFormProxyImpl);
28 return ((CFWL_FormProxyImp*)m_pImpl)->Initialize(); 28 pFormProxyImpl->SetInterface(this);
29 return pFormProxyImpl->Initialize();
29 } 30 }
30 FWL_ERR IFWL_DateTimeCalender::Initialize( 31 FWL_ERR IFWL_DateTimeCalender::Initialize(
31 const CFWL_WidgetImpProperties& properties, 32 const CFWL_WidgetImpProperties& properties,
32 IFWL_Widget* pOuter) { 33 IFWL_Widget* pOuter) {
33 m_pImpl = new CFWL_DateTimeCalendar(properties, pOuter); 34 CFWL_DateTimeCalendar* pDateTimeCalendarImpl =
34 ((CFWL_DateTimeCalendar*)m_pImpl)->SetInterface(this); 35 new CFWL_DateTimeCalendar(properties, pOuter);
35 return ((CFWL_DateTimeCalendar*)m_pImpl)->Initialize(); 36 SetImpl(pDateTimeCalendarImpl);
37 pDateTimeCalendarImpl->SetInterface(this);
38 return pDateTimeCalendarImpl->Initialize();
36 } 39 }
37 FWL_ERR IFWL_DateTimeEdit::Initialize( 40 FWL_ERR IFWL_DateTimeEdit::Initialize(
38 const CFWL_WidgetImpProperties& properties, 41 const CFWL_WidgetImpProperties& properties,
39 IFWL_Widget* pOuter) { 42 IFWL_Widget* pOuter) {
40 m_pImpl = new CFWL_DateTimeEdit(properties, pOuter); 43 CFWL_DateTimeEdit* pDateTimeEditImpl =
41 ((CFWL_DateTimeEdit*)m_pImpl)->SetInterface(this); 44 new CFWL_DateTimeEdit(properties, pOuter);
42 return ((CFWL_DateTimeEdit*)m_pImpl)->Initialize(); 45 SetImpl(pDateTimeEditImpl);
46 pDateTimeEditImpl->SetInterface(this);
47 return pDateTimeEditImpl->Initialize();
43 } 48 }
44 IFWL_DateTimePicker::IFWL_DateTimePicker() { 49 IFWL_DateTimePicker::IFWL_DateTimePicker() {
45 m_pImpl = NULL;
46 }
47 IFWL_DateTimePicker::~IFWL_DateTimePicker() {
48 if (m_pImpl) {
49 delete (CFWL_DateTimePickerImp*)m_pImpl;
50 m_pImpl = NULL;
51 }
52 } 50 }
53 FWL_ERR IFWL_DateTimePicker::Initialize(IFWL_Widget* pOuter) { 51 FWL_ERR IFWL_DateTimePicker::Initialize(IFWL_Widget* pOuter) {
54 m_pImpl = new CFWL_DateTimePickerImp(pOuter); 52 CFWL_DateTimePickerImp* pDateTimePickerImpl =
55 ((CFWL_DateTimePickerImp*)m_pImpl)->SetInterface(this); 53 new CFWL_DateTimePickerImp(pOuter);
56 return ((CFWL_DateTimePickerImp*)m_pImpl)->Initialize(); 54 SetImpl(pDateTimePickerImpl);
55 pDateTimePickerImpl->SetInterface(this);
56 return pDateTimePickerImpl->Initialize();
57 } 57 }
58 FWL_ERR IFWL_DateTimePicker::Initialize( 58 FWL_ERR IFWL_DateTimePicker::Initialize(
59 const CFWL_WidgetImpProperties& properties, 59 const CFWL_WidgetImpProperties& properties,
60 IFWL_Widget* pOuter) { 60 IFWL_Widget* pOuter) {
61 m_pImpl = new CFWL_DateTimePickerImp(properties, pOuter); 61 CFWL_DateTimePickerImp* pDateTimePickerImpl =
62 ((CFWL_DateTimePickerImp*)m_pImpl)->SetInterface(this); 62 new CFWL_DateTimePickerImp(properties, pOuter);
63 return ((CFWL_DateTimePickerImp*)m_pImpl)->Initialize(); 63 SetImpl(pDateTimePickerImpl);
64 pDateTimePickerImpl->SetInterface(this);
65 return pDateTimePickerImpl->Initialize();
64 } 66 }
65 int32_t IFWL_DateTimePicker::CountSelRanges() { 67 int32_t IFWL_DateTimePicker::CountSelRanges() {
66 return ((CFWL_DateTimePickerImp*)m_pImpl) 68 return static_cast<CFWL_DateTimePickerImp*>(GetImpl())
67 ->GetDataTimeEdit() 69 ->GetDataTimeEdit()
68 ->CountSelRanges(); 70 ->CountSelRanges();
69 } 71 }
70 int32_t IFWL_DateTimePicker::GetSelRange(int32_t nIndex, int32_t& nStart) { 72 int32_t IFWL_DateTimePicker::GetSelRange(int32_t nIndex, int32_t& nStart) {
71 return ((CFWL_DateTimePickerImp*)m_pImpl) 73 return static_cast<CFWL_DateTimePickerImp*>(GetImpl())
72 ->GetDataTimeEdit() 74 ->GetDataTimeEdit()
73 ->GetSelRange(nIndex, nStart); 75 ->GetSelRange(nIndex, nStart);
74 } 76 }
75 FWL_ERR IFWL_DateTimePicker::GetCurSel(int32_t& iYear, 77 FWL_ERR IFWL_DateTimePicker::GetCurSel(int32_t& iYear,
76 int32_t& iMonth, 78 int32_t& iMonth,
77 int32_t& iDay) { 79 int32_t& iDay) {
78 return ((CFWL_DateTimePickerImp*)m_pImpl)->GetCurSel(iYear, iMonth, iDay); 80 return static_cast<CFWL_DateTimePickerImp*>(GetImpl())
81 ->GetCurSel(iYear, iMonth, iDay);
79 } 82 }
80 FWL_ERR IFWL_DateTimePicker::SetCurSel(int32_t iYear, 83 FWL_ERR IFWL_DateTimePicker::SetCurSel(int32_t iYear,
81 int32_t iMonth, 84 int32_t iMonth,
82 int32_t iDay) { 85 int32_t iDay) {
83 return ((CFWL_DateTimePickerImp*)m_pImpl)->SetCurSel(iYear, iMonth, iDay); 86 return static_cast<CFWL_DateTimePickerImp*>(GetImpl())
87 ->SetCurSel(iYear, iMonth, iDay);
84 } 88 }
85 FWL_ERR IFWL_DateTimePicker::SetEditText(const CFX_WideString& wsText) { 89 FWL_ERR IFWL_DateTimePicker::SetEditText(const CFX_WideString& wsText) {
86 return ((CFWL_DateTimePickerImp*)m_pImpl)->SetEditText(wsText); 90 return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->SetEditText(wsText);
87 } 91 }
88 FWL_ERR IFWL_DateTimePicker::GetEditText(CFX_WideString& wsText, 92 FWL_ERR IFWL_DateTimePicker::GetEditText(CFX_WideString& wsText,
89 int32_t nStart, 93 int32_t nStart,
90 int32_t nCount) const { 94 int32_t nCount) const {
91 return ((CFWL_DateTimePickerImp*)m_pImpl) 95 return static_cast<CFWL_DateTimePickerImp*>(GetImpl())
92 ->GetEditText(wsText, nStart, nCount); 96 ->GetEditText(wsText, nStart, nCount);
93 } 97 }
94 FX_BOOL IFWL_DateTimePicker::CanUndo() { 98 FX_BOOL IFWL_DateTimePicker::CanUndo() {
95 return ((CFWL_DateTimePickerImp*)m_pImpl)->CanUndo(); 99 return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->CanUndo();
96 } 100 }
97 FX_BOOL IFWL_DateTimePicker::CanRedo() { 101 FX_BOOL IFWL_DateTimePicker::CanRedo() {
98 return ((CFWL_DateTimePickerImp*)m_pImpl)->CanRedo(); 102 return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->CanRedo();
99 } 103 }
100 FX_BOOL IFWL_DateTimePicker::Undo() { 104 FX_BOOL IFWL_DateTimePicker::Undo() {
101 return ((CFWL_DateTimePickerImp*)m_pImpl)->Undo(); 105 return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->Undo();
102 } 106 }
103 FX_BOOL IFWL_DateTimePicker::Redo() { 107 FX_BOOL IFWL_DateTimePicker::Redo() {
104 return ((CFWL_DateTimePickerImp*)m_pImpl)->Redo(); 108 return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->Redo();
105 } 109 }
106 FX_BOOL IFWL_DateTimePicker::CanCopy() { 110 FX_BOOL IFWL_DateTimePicker::CanCopy() {
107 return ((CFWL_DateTimePickerImp*)m_pImpl)->CanCopy(); 111 return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->CanCopy();
108 } 112 }
109 FX_BOOL IFWL_DateTimePicker::CanCut() { 113 FX_BOOL IFWL_DateTimePicker::CanCut() {
110 return ((CFWL_DateTimePickerImp*)m_pImpl)->CanCut(); 114 return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->CanCut();
111 } 115 }
112 FX_BOOL IFWL_DateTimePicker::CanSelectAll() { 116 FX_BOOL IFWL_DateTimePicker::CanSelectAll() {
113 return ((CFWL_DateTimePickerImp*)m_pImpl)->CanSelectAll(); 117 return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->CanSelectAll();
114 } 118 }
115 FX_BOOL IFWL_DateTimePicker::Copy(CFX_WideString& wsCopy) { 119 FX_BOOL IFWL_DateTimePicker::Copy(CFX_WideString& wsCopy) {
116 return ((CFWL_DateTimePickerImp*)m_pImpl)->Copy(wsCopy); 120 return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->Copy(wsCopy);
117 } 121 }
118 FX_BOOL IFWL_DateTimePicker::Cut(CFX_WideString& wsCut) { 122 FX_BOOL IFWL_DateTimePicker::Cut(CFX_WideString& wsCut) {
119 return ((CFWL_DateTimePickerImp*)m_pImpl)->Cut(wsCut); 123 return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->Cut(wsCut);
120 } 124 }
121 FX_BOOL IFWL_DateTimePicker::Paste(const CFX_WideString& wsPaste) { 125 FX_BOOL IFWL_DateTimePicker::Paste(const CFX_WideString& wsPaste) {
122 return ((CFWL_DateTimePickerImp*)m_pImpl)->Paste(wsPaste); 126 return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->Paste(wsPaste);
123 } 127 }
124 FX_BOOL IFWL_DateTimePicker::SelectAll() { 128 FX_BOOL IFWL_DateTimePicker::SelectAll() {
125 return ((CFWL_DateTimePickerImp*)m_pImpl)->SelectAll(); 129 return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->SelectAll();
126 } 130 }
127 FX_BOOL IFWL_DateTimePicker::Delete() { 131 FX_BOOL IFWL_DateTimePicker::Delete() {
128 return ((CFWL_DateTimePickerImp*)m_pImpl)->Delete(); 132 return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->Delete();
129 } 133 }
130 FX_BOOL IFWL_DateTimePicker::DeSelect() { 134 FX_BOOL IFWL_DateTimePicker::DeSelect() {
131 return ((CFWL_DateTimePickerImp*)m_pImpl)->DeSelect(); 135 return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->DeSelect();
132 } 136 }
133 FWL_ERR IFWL_DateTimePicker::GetBBox(CFX_RectF& rect) { 137 FWL_ERR IFWL_DateTimePicker::GetBBox(CFX_RectF& rect) {
134 return ((CFWL_DateTimePickerImp*)m_pImpl)->GetBBox(rect); 138 return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->GetBBox(rect);
135 } 139 }
136 FWL_ERR IFWL_DateTimePicker::SetEditLimit(int32_t nLimit) { 140 FWL_ERR IFWL_DateTimePicker::SetEditLimit(int32_t nLimit) {
137 return ((CFWL_DateTimePickerImp*)m_pImpl)->SetEditLimit(nLimit); 141 return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->SetEditLimit(nLimit);
138 } 142 }
139 FWL_ERR IFWL_DateTimePicker::ModifyEditStylesEx(FX_DWORD dwStylesExAdded, 143 FWL_ERR IFWL_DateTimePicker::ModifyEditStylesEx(FX_DWORD dwStylesExAdded,
140 FX_DWORD dwStylesExRemoved) { 144 FX_DWORD dwStylesExRemoved) {
141 return ((CFWL_DateTimePickerImp*)m_pImpl) 145 return static_cast<CFWL_DateTimePickerImp*>(GetImpl())
142 ->ModifyEditStylesEx(dwStylesExAdded, dwStylesExRemoved); 146 ->ModifyEditStylesEx(dwStylesExAdded, dwStylesExRemoved);
143 } 147 }
144 CFWL_DateTimeEdit::CFWL_DateTimeEdit(const CFWL_WidgetImpProperties& properties, 148 CFWL_DateTimeEdit::CFWL_DateTimeEdit(const CFWL_WidgetImpProperties& properties,
145 IFWL_Widget* pOuter) 149 IFWL_Widget* pOuter)
146 : CFWL_EditImp(properties, pOuter) {} 150 : CFWL_EditImp(properties, pOuter) {}
147 FWL_ERR CFWL_DateTimeEdit::Initialize() { 151 FWL_ERR CFWL_DateTimeEdit::Initialize() {
148 m_pDelegate = (IFWL_WidgetDelegate*)new CFWL_DateTimeEditImpDelegate(this); 152 m_pDelegate = (IFWL_WidgetDelegate*)new CFWL_DateTimeEditImpDelegate(this);
149 _FWL_ERR_CHECK_RETURN_VALUE_IF_FAIL(CFWL_EditImp::Initialize(), 153 _FWL_ERR_CHECK_RETURN_VALUE_IF_FAIL(CFWL_EditImp::Initialize(),
150 FWL_ERR_Indefinite); 154 FWL_ERR_Indefinite);
151 return FWL_ERR_Succeeded; 155 return FWL_ERR_Succeeded;
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after
1160 } 1164 }
1161 if (m_pOwner->m_pEdit->GetStates() & FWL_WGTSTATE_Focused) { 1165 if (m_pOwner->m_pEdit->GetStates() & FWL_WGTSTATE_Focused) {
1162 pMsg->m_pSrcTarget = m_pOwner->m_pEdit; 1166 pMsg->m_pSrcTarget = m_pOwner->m_pEdit;
1163 IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(NULL); 1167 IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(NULL);
1164 pDelegate->OnProcessMessage(pMsg); 1168 pDelegate->OnProcessMessage(pMsg);
1165 } 1169 }
1166 } 1170 }
1167 rtInvalidate.Inflate(2, 2); 1171 rtInvalidate.Inflate(2, 2);
1168 m_pOwner->Repaint(&rtInvalidate); 1172 m_pOwner->Repaint(&rtInvalidate);
1169 } 1173 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698