Home | History | Annotate | Download | only in lightwidget
      1 // Copyright 2014 PDFium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
      6 
      7 #ifndef _FWL_DATETIMEPICKER_LIGHT_H
      8 #define _FWL_DATETIMEPICKER_LIGHT_H
      9 class CFWL_Widget;
     10 class CFWL_WidgetProperties;
     11 class IFWL_DateTimePickerDP;
     12 class CFWL_DateTimePicker;
     13 class CFWL_DateTimePickerDP;
     14 class CFWL_DateTimePicker : public CFWL_Widget {
     15  public:
     16   static CFWL_DateTimePicker* Create();
     17   FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL);
     18   FWL_ERR SetToday(int32_t iYear, int32_t iMonth, int32_t iDay);
     19   FWL_ERR GetEditText(CFX_WideString& wsText);
     20   FWL_ERR SetEditText(const CFX_WideStringC& wsText);
     21   int32_t CountSelRanges();
     22   int32_t GetSelRange(int32_t nIndex, int32_t& nStart);
     23   FWL_ERR GetCurSel(int32_t& iYear, int32_t& iMonth, int32_t& iDay);
     24   FWL_ERR SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay);
     25   FX_BOOL CanUndo();
     26   FX_BOOL CanRedo();
     27   FX_BOOL Undo();
     28   FX_BOOL Redo();
     29   FX_BOOL CanCopy();
     30   FX_BOOL CanCut();
     31   FX_BOOL CanSelectAll();
     32   FX_BOOL Copy(CFX_WideString& wsCopy);
     33   FX_BOOL Cut(CFX_WideString& wsCut);
     34   FX_BOOL Paste(const CFX_WideString& wsPaste);
     35   FX_BOOL SelectAll();
     36   FX_BOOL Delete();
     37   FX_BOOL DeSelect();
     38   FWL_ERR GetBBox(CFX_RectF& rect);
     39   FWL_ERR SetEditLimit(int32_t nLimit);
     40   FWL_ERR ModifyEditStylesEx(FX_DWORD dwStylesExAdded,
     41                              FX_DWORD dwStylesExRemoved);
     42 
     43  protected:
     44   CFWL_DateTimePicker();
     45   virtual ~CFWL_DateTimePicker();
     46   class CFWL_DateTimePickerDP : public IFWL_DateTimePickerDP {
     47    public:
     48     CFWL_DateTimePickerDP();
     49     virtual FWL_ERR GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption);
     50     virtual FWL_ERR GetToday(IFWL_Widget* pWidget,
     51                              int32_t& iYear,
     52                              int32_t& iMonth,
     53                              int32_t& iDay);
     54     int32_t m_iYear;
     55     int32_t m_iMonth;
     56     int32_t m_iDay;
     57     CFX_WideString m_wsData;
     58   };
     59   CFWL_DateTimePickerDP m_DateTimePickerDP;
     60 };
     61 #endif
     62