Home | History | Annotate | Download | only in fxfa
      1 // Copyright 2017 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 XFA_FXFA_CXFA_FFDATETIMEEDIT_H_
      8 #define XFA_FXFA_CXFA_FFDATETIMEEDIT_H_
      9 
     10 #include "core/fxcrt/fx_coordinates.h"
     11 #include "xfa/fxfa/cxfa_fftextedit.h"
     12 
     13 enum XFA_DATETIMETYPE {
     14   XFA_DATETIMETYPE_Date = 0,
     15   XFA_DATETIMETYPE_Time,
     16   XFA_DATETIMETYPE_DateAndTime
     17 };
     18 
     19 class CFWL_Event;
     20 class CFWL_Widget;
     21 
     22 class CXFA_FFDateTimeEdit : public CXFA_FFTextEdit {
     23  public:
     24   explicit CXFA_FFDateTimeEdit(CXFA_Node* pNode);
     25   ~CXFA_FFDateTimeEdit() override;
     26 
     27   // CXFA_FFTextEdit
     28   CFX_RectF GetBBox(uint32_t dwStatus, bool bDrawFocus = false) override;
     29   bool LoadWidget() override;
     30   void UpdateWidgetProperty() override;
     31   void OnProcessEvent(CFWL_Event* pEvent) override;
     32 
     33   void OnSelectChanged(CFWL_Widget* pWidget,
     34                        int32_t iYear,
     35                        int32_t iMonth,
     36                        int32_t iDay);
     37 
     38  private:
     39   bool PtInActiveRect(const CFX_PointF& point) override;
     40   bool CommitData() override;
     41   bool UpdateFWLData() override;
     42   bool IsDataChanged() override;
     43 
     44   uint32_t GetAlignment();
     45 };
     46 
     47 #endif  // XFA_FXFA_CXFA_FFDATETIMEEDIT_H_
     48