| OLD | NEW |
| 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 #ifndef XFA_FWL_BASEWIDGET_IFWL_EDIT_H_ | 7 #ifndef XFA_FWL_BASEWIDGET_IFWL_EDIT_H_ |
| 8 #define XFA_FWL_BASEWIDGET_IFWL_EDIT_H_ | 8 #define XFA_FWL_BASEWIDGET_IFWL_EDIT_H_ |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "xfa/fwl/core/cfwl_event.h" |
| 12 #include "xfa/fwl/core/ifwl_dataprovider.h" | 13 #include "xfa/fwl/core/ifwl_dataprovider.h" |
| 13 #include "xfa/fwl/lightwidget/cfwl_widget.h" | 14 #include "xfa/fwl/lightwidget/cfwl_widget.h" |
| 14 | 15 |
| 15 #define FWL_CLASS_Edit L"FWL_EDIT" | 16 #define FWL_CLASS_Edit L"FWL_EDIT" |
| 16 #define FWL_CLASSHASH_Edit 2893987822 | 17 #define FWL_CLASSHASH_Edit 2893987822 |
| 17 #define FWL_STYLEEXT_EDT_ReadOnly (1L << 0) | 18 #define FWL_STYLEEXT_EDT_ReadOnly (1L << 0) |
| 18 #define FWL_STYLEEXT_EDT_MultiLine (1L << 1) | 19 #define FWL_STYLEEXT_EDT_MultiLine (1L << 1) |
| 19 #define FWL_STYLEEXT_EDT_WantReturn (1L << 2) | 20 #define FWL_STYLEEXT_EDT_WantReturn (1L << 2) |
| 20 #define FWL_STYLEEXT_EDT_NoHideSel (1L << 3) | 21 #define FWL_STYLEEXT_EDT_NoHideSel (1L << 3) |
| 21 #define FWL_STYLEEXT_EDT_AutoHScroll (1L << 4) | 22 #define FWL_STYLEEXT_EDT_AutoHScroll (1L << 4) |
| (...skipping 20 matching lines...) Expand all Loading... |
| 42 #define FWL_STYLEEXT_EDT_Distributed (2L << 22) | 43 #define FWL_STYLEEXT_EDT_Distributed (2L << 22) |
| 43 #define FWL_STYLEEXT_EDT_HAlignMask (3L << 18) | 44 #define FWL_STYLEEXT_EDT_HAlignMask (3L << 18) |
| 44 #define FWL_STYLEEXT_EDT_VAlignMask (3L << 20) | 45 #define FWL_STYLEEXT_EDT_VAlignMask (3L << 20) |
| 45 #define FWL_STYLEEXT_EDT_HAlignModeMask (3L << 22) | 46 #define FWL_STYLEEXT_EDT_HAlignModeMask (3L << 22) |
| 46 #define FWL_STYLEEXT_EDT_InnerCaret (1L << 24) | 47 #define FWL_STYLEEXT_EDT_InnerCaret (1L << 24) |
| 47 #define FWL_STYLEEXT_EDT_ShowScrollbarFocus (1L << 25) | 48 #define FWL_STYLEEXT_EDT_ShowScrollbarFocus (1L << 25) |
| 48 #define FWL_STYLEEXT_EDT_OuterScrollbar (1L << 26) | 49 #define FWL_STYLEEXT_EDT_OuterScrollbar (1L << 26) |
| 49 #define FWL_STYLEEXT_EDT_LastLineHeight (1L << 27) | 50 #define FWL_STYLEEXT_EDT_LastLineHeight (1L << 27) |
| 50 #define FWL_PARTDATA_EDT_Background 0 | 51 #define FWL_PARTDATA_EDT_Background 0 |
| 51 #define FWL_PARTDATA_EDT_StaticBackground 1 | 52 #define FWL_PARTDATA_EDT_StaticBackground 1 |
| 52 // TODO(dsinclair): Event hash is hash of string, cleanup. pdfium:474 | |
| 53 #define FWL_EVTHASH_EDT_TextChanged 1064022132 | |
| 54 #define FWL_EVTHASH_EDT_PreSelfAdaption 1001979178 | |
| 55 #define FWL_EVTHASH_EDT_Validate 3373308608 | |
| 56 #define FWL_EVTHASH_EDT_CheckWord 2897181520 | |
| 57 #define FWL_EVTHASH_EDT_GetSuggestWords 315782791 | |
| 58 #define FWL_EVTHASH_EDT_TextFull 2158580174 | |
| 59 | 53 |
| 60 typedef struct FWL_HEDTFIND_ { void* pData; } * FWL_HEDTFIND; | 54 typedef struct FWL_HEDTFIND_ { void* pData; } * FWL_HEDTFIND; |
| 61 | 55 |
| 62 enum FWL_EDT_TEXTCHANGED { | 56 enum FWL_EDT_TEXTCHANGED { |
| 63 FWL_EDT_TEXTCHANGED_Insert = 0, | 57 FWL_EDT_TEXTCHANGED_Insert = 0, |
| 64 FWL_EDT_TEXTCHANGED_Delete, | 58 FWL_EDT_TEXTCHANGED_Delete, |
| 65 FWL_EDT_TEXTCHANGED_Replace, | 59 FWL_EDT_TEXTCHANGED_Replace, |
| 66 }; | 60 }; |
| 67 | 61 |
| 68 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtTextChanged, FWL_EVTHASH_EDT_TextChanged) | 62 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtTextChanged, CFWL_EventType::TextChanged) |
| 69 int32_t nChangeType; | 63 int32_t nChangeType; |
| 70 CFX_WideString wsInsert; | 64 CFX_WideString wsInsert; |
| 71 CFX_WideString wsDelete; | 65 CFX_WideString wsDelete; |
| 72 CFX_WideString wsPrevText; | 66 CFX_WideString wsPrevText; |
| 73 END_FWL_EVENT_DEF | 67 END_FWL_EVENT_DEF |
| 74 | 68 |
| 75 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtTextFull, FWL_EVTHASH_EDT_TextFull) | 69 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtTextFull, CFWL_EventType::TextFull) |
| 76 END_FWL_EVENT_DEF | 70 END_FWL_EVENT_DEF |
| 77 | 71 |
| 78 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtPreSelfAdaption, FWL_EVTHASH_EDT_PreSelfAdaption) | 72 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtPreSelfAdaption, CFWL_EventType::PreSelfAdaption) |
| 79 FX_BOOL bHSelfAdaption; | 73 FX_BOOL bHSelfAdaption; |
| 80 FX_BOOL bVSelfAdaption; | 74 FX_BOOL bVSelfAdaption; |
| 81 CFX_RectF rtAfterChange; | 75 CFX_RectF rtAfterChange; |
| 82 END_FWL_EVENT_DEF | 76 END_FWL_EVENT_DEF |
| 83 | 77 |
| 84 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtValidate, FWL_EVTHASH_EDT_Validate) | 78 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtValidate, CFWL_EventType::Validate) |
| 85 IFWL_Widget* pDstWidget; | 79 IFWL_Widget* pDstWidget; |
| 86 CFX_WideString wsInsert; | 80 CFX_WideString wsInsert; |
| 87 FX_BOOL bValidate; | 81 FX_BOOL bValidate; |
| 88 END_FWL_EVENT_DEF | 82 END_FWL_EVENT_DEF |
| 89 | 83 |
| 90 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtCheckWord, FWL_EVTHASH_EDT_CheckWord) | 84 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtCheckWord, CFWL_EventType::CheckWord) |
| 91 CFX_ByteString bsWord; | 85 CFX_ByteString bsWord; |
| 92 FX_BOOL bCheckWord; | 86 FX_BOOL bCheckWord; |
| 93 END_FWL_EVENT_DEF | 87 END_FWL_EVENT_DEF |
| 94 | 88 |
| 95 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtGetSuggestWords, FWL_EVTHASH_EDT_GetSuggestWords) | 89 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtGetSuggestWords, |
| 90 CFWL_EventType::GetSuggestedWords) |
| 96 FX_BOOL bSuggestWords; | 91 FX_BOOL bSuggestWords; |
| 97 CFX_ByteString bsWord; | 92 CFX_ByteString bsWord; |
| 98 std::vector<CFX_ByteString> bsArraySuggestWords; | 93 std::vector<CFX_ByteString> bsArraySuggestWords; |
| 99 END_FWL_EVENT_DEF | 94 END_FWL_EVENT_DEF |
| 100 | 95 |
| 101 class CFWL_WidgetImpProperties; | 96 class CFWL_WidgetImpProperties; |
| 102 | 97 |
| 103 class IFWL_EditDP : public IFWL_DataProvider {}; | 98 class IFWL_EditDP : public IFWL_DataProvider {}; |
| 104 | 99 |
| 105 class IFWL_Edit : public IFWL_Widget { | 100 class IFWL_Edit : public IFWL_Widget { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 FX_BOOL GetSuggestWords(CFX_PointF pointf, | 147 FX_BOOL GetSuggestWords(CFX_PointF pointf, |
| 153 std::vector<CFX_ByteString>& sSuggest); | 148 std::vector<CFX_ByteString>& sSuggest); |
| 154 FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf, | 149 FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf, |
| 155 const CFX_ByteStringC& bsReplace); | 150 const CFX_ByteStringC& bsReplace); |
| 156 | 151 |
| 157 protected: | 152 protected: |
| 158 IFWL_Edit(); | 153 IFWL_Edit(); |
| 159 }; | 154 }; |
| 160 | 155 |
| 161 #endif // XFA_FWL_BASEWIDGET_IFWL_EDIT_H_ | 156 #endif // XFA_FWL_BASEWIDGET_IFWL_EDIT_H_ |
| OLD | NEW |