summaryrefslogtreecommitdiff
path: root/xfa/src/fwl/lightwidget/datetimepicker.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2016-03-08 12:16:00 -0500
committerDan Sinclair <dsinclair@chromium.org>2016-03-08 12:16:00 -0500
commit6f6388fee1fdb4bec57549fe87a0833b2b20bebe (patch)
tree425b282da710e43904ebc68bf098a88cd2676397 /xfa/src/fwl/lightwidget/datetimepicker.cpp
parent71568591f4df8cc2d02fbd5544b0b0cc2b8f55e8 (diff)
downloadpdfium-6f6388fee1fdb4bec57549fe87a0833b2b20bebe.tar.xz
Remove xfa/src/fwl/src and move code up a level.
This Cl moves the xfa/src/fwl/src code up to the previously empty parent directory and removes xfa/src/fwl/src. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1770953004 .
Diffstat (limited to 'xfa/src/fwl/lightwidget/datetimepicker.cpp')
-rw-r--r--xfa/src/fwl/lightwidget/datetimepicker.cpp144
1 files changed, 144 insertions, 0 deletions
diff --git a/xfa/src/fwl/lightwidget/datetimepicker.cpp b/xfa/src/fwl/lightwidget/datetimepicker.cpp
new file mode 100644
index 0000000000..957ed87fed
--- /dev/null
+++ b/xfa/src/fwl/lightwidget/datetimepicker.cpp
@@ -0,0 +1,144 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#include "xfa/include/fwl/lightwidget/datetimepicker.h"
+
+#include <memory>
+
+#include "xfa/include/fwl/core/fwl_error.h"
+#include "xfa/include/fwl/core/fwl_note.h"
+#include "xfa/include/fwl/core/fwl_widget.h"
+#include "xfa/include/fwl/basewidget/fwl_datetimepicker.h"
+
+CFWL_DateTimePicker* CFWL_DateTimePicker::Create() {
+ return new CFWL_DateTimePicker;
+}
+FWL_ERR CFWL_DateTimePicker::Initialize(
+ const CFWL_WidgetProperties* pProperties) {
+ if (m_pIface)
+ return FWL_ERR_Indefinite;
+ if (pProperties) {
+ *m_pProperties = *pProperties;
+ }
+ std::unique_ptr<IFWL_DateTimePicker> pDateTimePicker(
+ IFWL_DateTimePicker::Create(
+ m_pProperties->MakeWidgetImpProperties(&m_DateTimePickerDP),
+ nullptr));
+ FWL_ERR ret = pDateTimePicker->Initialize();
+ if (ret != FWL_ERR_Succeeded) {
+ return ret;
+ }
+ m_pIface = pDateTimePicker.release();
+ CFWL_Widget::Initialize();
+ return FWL_ERR_Succeeded;
+}
+
+FWL_ERR CFWL_DateTimePicker::SetToday(int32_t iYear,
+ int32_t iMonth,
+ int32_t iDay) {
+ m_DateTimePickerDP.m_iYear = iYear;
+ m_DateTimePickerDP.m_iMonth = iMonth;
+ m_DateTimePickerDP.m_iDay = iDay;
+ return FWL_ERR_Succeeded;
+}
+int32_t CFWL_DateTimePicker::CountSelRanges() {
+ return static_cast<IFWL_DateTimePicker*>(m_pIface)->CountSelRanges();
+}
+int32_t CFWL_DateTimePicker::GetSelRange(int32_t nIndex, int32_t& nStart) {
+ return static_cast<IFWL_DateTimePicker*>(m_pIface)
+ ->GetSelRange(nIndex, nStart);
+}
+FWL_ERR CFWL_DateTimePicker::GetEditText(CFX_WideString& wsText) {
+ return static_cast<IFWL_DateTimePicker*>(m_pIface)->GetEditText(wsText);
+}
+FWL_ERR CFWL_DateTimePicker::SetEditText(const CFX_WideStringC& wsText) {
+ return static_cast<IFWL_DateTimePicker*>(m_pIface)->SetEditText(wsText);
+}
+FWL_ERR CFWL_DateTimePicker::GetCurSel(int32_t& iYear,
+ int32_t& iMonth,
+ int32_t& iDay) {
+ return static_cast<IFWL_DateTimePicker*>(m_pIface)
+ ->GetCurSel(iYear, iMonth, iDay);
+}
+FWL_ERR CFWL_DateTimePicker::SetCurSel(int32_t iYear,
+ int32_t iMonth,
+ int32_t iDay) {
+ return static_cast<IFWL_DateTimePicker*>(m_pIface)
+ ->SetCurSel(iYear, iMonth, iDay);
+}
+CFWL_DateTimePicker::CFWL_DateTimePicker() {}
+CFWL_DateTimePicker::~CFWL_DateTimePicker() {}
+CFWL_DateTimePicker::CFWL_DateTimePickerDP::CFWL_DateTimePickerDP() {
+ m_iYear = 2011;
+ m_iMonth = 1;
+ m_iDay = 1;
+}
+FWL_ERR CFWL_DateTimePicker::CFWL_DateTimePickerDP::GetCaption(
+ IFWL_Widget* pWidget,
+ CFX_WideString& wsCaption) {
+ wsCaption = m_wsData;
+ return FWL_ERR_Succeeded;
+}
+FWL_ERR CFWL_DateTimePicker::CFWL_DateTimePickerDP::GetToday(
+ IFWL_Widget* pWidget,
+ int32_t& iYear,
+ int32_t& iMonth,
+ int32_t& iDay) {
+ iYear = m_iYear;
+ iMonth = m_iMonth;
+ iDay = m_iDay;
+ return FWL_ERR_Succeeded;
+}
+FX_BOOL CFWL_DateTimePicker::CanUndo() {
+ return static_cast<IFWL_DateTimePicker*>(m_pIface)->CanUndo();
+}
+FX_BOOL CFWL_DateTimePicker::CanRedo() {
+ return static_cast<IFWL_DateTimePicker*>(m_pIface)->CanRedo();
+}
+FX_BOOL CFWL_DateTimePicker::Undo() {
+ return static_cast<IFWL_DateTimePicker*>(m_pIface)->Undo();
+}
+FX_BOOL CFWL_DateTimePicker::Redo() {
+ return static_cast<IFWL_DateTimePicker*>(m_pIface)->Redo();
+}
+FX_BOOL CFWL_DateTimePicker::CanCopy() {
+ return static_cast<IFWL_DateTimePicker*>(m_pIface)->CanCopy();
+}
+FX_BOOL CFWL_DateTimePicker::CanCut() {
+ return static_cast<IFWL_DateTimePicker*>(m_pIface)->CanCut();
+}
+FX_BOOL CFWL_DateTimePicker::CanSelectAll() {
+ return static_cast<IFWL_DateTimePicker*>(m_pIface)->CanSelectAll();
+}
+FX_BOOL CFWL_DateTimePicker::Copy(CFX_WideString& wsCopy) {
+ return static_cast<IFWL_DateTimePicker*>(m_pIface)->Copy(wsCopy);
+}
+FX_BOOL CFWL_DateTimePicker::Cut(CFX_WideString& wsCut) {
+ return static_cast<IFWL_DateTimePicker*>(m_pIface)->Copy(wsCut);
+}
+FX_BOOL CFWL_DateTimePicker::Paste(const CFX_WideString& wsPaste) {
+ return static_cast<IFWL_DateTimePicker*>(m_pIface)->Paste(wsPaste);
+}
+FX_BOOL CFWL_DateTimePicker::SelectAll() {
+ return static_cast<IFWL_DateTimePicker*>(m_pIface)->SelectAll();
+}
+FX_BOOL CFWL_DateTimePicker::Delete() {
+ return static_cast<IFWL_DateTimePicker*>(m_pIface)->Delete();
+}
+FX_BOOL CFWL_DateTimePicker::DeSelect() {
+ return static_cast<IFWL_DateTimePicker*>(m_pIface)->DeSelect();
+}
+FWL_ERR CFWL_DateTimePicker::GetBBox(CFX_RectF& rect) {
+ return static_cast<IFWL_DateTimePicker*>(m_pIface)->GetBBox(rect);
+}
+FWL_ERR CFWL_DateTimePicker::SetEditLimit(int32_t nLimit) {
+ return static_cast<IFWL_DateTimePicker*>(m_pIface)->SetEditLimit(nLimit);
+}
+FWL_ERR CFWL_DateTimePicker::ModifyEditStylesEx(FX_DWORD dwStylesExAdded,
+ FX_DWORD dwStylesExRemoved) {
+ return static_cast<IFWL_DateTimePicker*>(m_pIface)
+ ->ModifyEditStylesEx(dwStylesExAdded, dwStylesExRemoved);
+}