Index: xfa/fwl/core/ifwl_edit.h |
diff --git a/xfa/fwl/basewidget/fwl_editimp.h b/xfa/fwl/core/ifwl_edit.h |
similarity index 67% |
rename from xfa/fwl/basewidget/fwl_editimp.h |
rename to xfa/fwl/core/ifwl_edit.h |
index e17a4cfc0942b35133e285dbadce0e290ce5a238..2d65897b8cd3004a16f4042839798a7395c8d2d4 100644 |
--- a/xfa/fwl/basewidget/fwl_editimp.h |
+++ b/xfa/fwl/core/ifwl_edit.h |
@@ -4,8 +4,8 @@ |
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
-#ifndef XFA_FWL_BASEWIDGET_FWL_EDITIMP_H_ |
-#define XFA_FWL_BASEWIDGET_FWL_EDITIMP_H_ |
+#ifndef XFA_FWL_CORE_IFWL_EDIT_H_ |
+#define XFA_FWL_CORE_IFWL_EDIT_H_ |
#include <deque> |
#include <memory> |
@@ -13,11 +13,88 @@ |
#include "xfa/fde/ifde_txtedtdorecord.h" |
#include "xfa/fde/ifde_txtedtengine.h" |
-#include "xfa/fwl/basewidget/ifwl_scrollbar.h" |
-#include "xfa/fwl/core/fwl_widgetimp.h" |
+#include "xfa/fwl/core/cfwl_event.h" |
+#include "xfa/fwl/core/ifwl_dataprovider.h" |
+#include "xfa/fwl/core/ifwl_scrollbar.h" |
+#include "xfa/fwl/lightwidget/cfwl_widget.h" |
#include "xfa/fxgraphics/cfx_path.h" |
-class CFWL_EditImp; |
+#define FWL_CLASS_Edit L"FWL_EDIT" |
+#define FWL_STYLEEXT_EDT_ReadOnly (1L << 0) |
+#define FWL_STYLEEXT_EDT_MultiLine (1L << 1) |
+#define FWL_STYLEEXT_EDT_WantReturn (1L << 2) |
+#define FWL_STYLEEXT_EDT_NoHideSel (1L << 3) |
+#define FWL_STYLEEXT_EDT_AutoHScroll (1L << 4) |
+#define FWL_STYLEEXT_EDT_AutoVScroll (1L << 5) |
+#define FWL_STYLEEXT_EDT_NoRedoUndo (1L << 6) |
+#define FWL_STYLEEXT_EDT_Validate (1L << 7) |
+#define FWL_STYLEEXT_EDT_Password (1L << 8) |
+#define FWL_STYLEEXT_EDT_Number (1L << 9) |
+#define FWL_STYLEEXT_EDT_HSelfAdaption (1L << 10) |
+#define FWL_STYLEEXT_EDT_VSelfAdaption (1L << 11) |
+#define FWL_STYLEEXT_EDT_VerticalLayout (1L << 12) |
+#define FWL_STYLEEXT_EDT_VerticalChars (1L << 13) |
+#define FWL_STYLEEXT_EDT_ReverseLine (1L << 14) |
+#define FWL_STYLEEXT_EDT_ArabicShapes (1L << 15) |
+#define FWL_STYLEEXT_EDT_ExpandTab (1L << 16) |
+#define FWL_STYLEEXT_EDT_CombText (1L << 17) |
+#define FWL_STYLEEXT_EDT_HNear (0L << 18) |
+#define FWL_STYLEEXT_EDT_HCenter (1L << 18) |
+#define FWL_STYLEEXT_EDT_HFar (2L << 18) |
+#define FWL_STYLEEXT_EDT_VNear (0L << 20) |
+#define FWL_STYLEEXT_EDT_VCenter (1L << 20) |
+#define FWL_STYLEEXT_EDT_VFar (2L << 20) |
+#define FWL_STYLEEXT_EDT_Justified (1L << 22) |
+#define FWL_STYLEEXT_EDT_Distributed (2L << 22) |
+#define FWL_STYLEEXT_EDT_HAlignMask (3L << 18) |
+#define FWL_STYLEEXT_EDT_VAlignMask (3L << 20) |
+#define FWL_STYLEEXT_EDT_HAlignModeMask (3L << 22) |
+#define FWL_STYLEEXT_EDT_InnerCaret (1L << 24) |
+#define FWL_STYLEEXT_EDT_ShowScrollbarFocus (1L << 25) |
+#define FWL_STYLEEXT_EDT_OuterScrollbar (1L << 26) |
+#define FWL_STYLEEXT_EDT_LastLineHeight (1L << 27) |
+ |
+enum FWL_EDT_TEXTCHANGED { |
+ FWL_EDT_TEXTCHANGED_Insert = 0, |
+ FWL_EDT_TEXTCHANGED_Delete, |
+ FWL_EDT_TEXTCHANGED_Replace, |
+}; |
+ |
+FWL_EVENT_DEF(CFWL_EvtEdtTextChanged, |
+ CFWL_EventType::TextChanged, |
+ int32_t nChangeType; |
+ CFX_WideString wsInsert; |
+ CFX_WideString wsDelete; |
+ CFX_WideString wsPrevText;) |
+ |
+FWL_EVENT_DEF(CFWL_EvtEdtTextFull, CFWL_EventType::TextFull) |
+ |
+FWL_EVENT_DEF(CFWL_EvtEdtPreSelfAdaption, |
+ CFWL_EventType::PreSelfAdaption, |
+ FX_BOOL bHSelfAdaption; |
+ FX_BOOL bVSelfAdaption; |
+ CFX_RectF rtAfterChange;) |
+ |
+FWL_EVENT_DEF(CFWL_EvtEdtValidate, |
+ CFWL_EventType::Validate, |
+ IFWL_Widget* pDstWidget; |
+ CFX_WideString wsInsert; |
+ FX_BOOL bValidate;) |
+ |
+FWL_EVENT_DEF(CFWL_EvtEdtCheckWord, |
+ CFWL_EventType::CheckWord, |
+ CFX_ByteString bsWord; |
+ FX_BOOL bCheckWord;) |
+ |
+FWL_EVENT_DEF(CFWL_EvtEdtGetSuggestWords, |
+ CFWL_EventType::GetSuggestedWords, |
+ FX_BOOL bSuggestWords; |
+ CFX_ByteString bsWord; |
+ std::vector<CFX_ByteString> bsArraySuggestWords;) |
+ |
+class CFWL_WidgetImpProperties; |
+class IFDE_TxtEdtDoRecord; |
+class IFWL_Edit; |
class CFWL_EditImpDelegate; |
class CFWL_MsgActivate; |
class CFWL_MsgDeactivate; |
@@ -26,12 +103,17 @@ class CFWL_WidgetImpDelegate; |
class CFWL_WidgetImpProperties; |
class IFWL_Caret; |
-class CFWL_EditImp : public CFWL_WidgetImp { |
+class IFWL_EditDP : public IFWL_DataProvider {}; |
+ |
+class IFWL_Edit : public IFWL_Widget { |
public: |
- CFWL_EditImp(const CFWL_WidgetImpProperties& properties, IFWL_Widget* pOuter); |
- ~CFWL_EditImp() override; |
+ static IFWL_Edit* Create(const CFWL_WidgetImpProperties& properties, |
+ IFWL_Widget* pOuter); |
+ |
+ IFWL_Edit(const CFWL_WidgetImpProperties& properties, IFWL_Widget* pOuter); |
+ ~IFWL_Edit() override; |
- // CFWL_WidgetImp: |
+ // IFWL_Widget: |
FWL_Error GetClassName(CFX_WideString& wsClass) const override; |
FWL_Type GetClassID() const override; |
FWL_Error Initialize() override; |
@@ -177,7 +259,7 @@ class CFWL_EditImp : public CFWL_WidgetImp { |
class CFWL_EditImpDelegate : public CFWL_WidgetImpDelegate { |
public: |
- CFWL_EditImpDelegate(CFWL_EditImp* pOwner); |
+ CFWL_EditImpDelegate(IFWL_Edit* pOwner); |
void OnProcessMessage(CFWL_Message* pMessage) override; |
void OnProcessEvent(CFWL_Event* pEvent) override; |
void OnDrawWidget(CFX_Graphics* pGraphics, |
@@ -196,7 +278,7 @@ class CFWL_EditImpDelegate : public CFWL_WidgetImpDelegate { |
void OnChar(CFWL_MsgKey* pMsg); |
FX_BOOL OnScroll(IFWL_ScrollBar* pScrollBar, uint32_t dwCode, FX_FLOAT fPos); |
void DoCursor(CFWL_MsgMouse* pMsg); |
- CFWL_EditImp* m_pOwner; |
+ IFWL_Edit* m_pOwner; |
}; |
-#endif // XFA_FWL_BASEWIDGET_FWL_EDITIMP_H_ |
+#endif // XFA_FWL_CORE_IFWL_EDIT_H_ |