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 FPDFSDK_INCLUDE_FXEDIT_FXET_EDIT_H_ | 7 #ifndef FPDFSDK_INCLUDE_FXEDIT_FXET_EDIT_H_ |
8 #define FPDFSDK_INCLUDE_FXEDIT_FXET_EDIT_H_ | 8 #define FPDFSDK_INCLUDE_FXEDIT_FXET_EDIT_H_ |
9 | 9 |
10 #include "../../../core/include/fpdfdoc/fpdf_vt.h" | 10 #include "../../../core/include/fpdfdoc/fpdf_vt.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 EP_ITALIC | 61 EP_ITALIC |
62 }; | 62 }; |
63 | 63 |
64 struct CFX_Edit_LineRect | 64 struct CFX_Edit_LineRect |
65 { | 65 { |
66 CFX_Edit_LineRect(const CPVT_WordRange & wrLine,const CPDF_Rect & rcLine
) : | 66 CFX_Edit_LineRect(const CPVT_WordRange & wrLine,const CPDF_Rect & rcLine
) : |
67 m_wrLine(wrLine), m_rcLine(rcLine) | 67 m_wrLine(wrLine), m_rcLine(rcLine) |
68 { | 68 { |
69 } | 69 } |
70 | 70 |
71 » FX_BOOL operator != (const CFX_Edit_LineRect & linerect) const | 71 » bool operator != (const CFX_Edit_LineRect & linerect) const |
72 { | 72 { |
73 return FXSYS_memcmp(this, &linerect, sizeof(CFX_Edit_LineRect))
!= 0; | 73 return FXSYS_memcmp(this, &linerect, sizeof(CFX_Edit_LineRect))
!= 0; |
74 } | 74 } |
75 | 75 |
76 » FX_BOOL IsSameHeight(const CFX_Edit_LineRect & linerect) const | 76 » bool IsSameHeight(const CFX_Edit_LineRect & linerect) const |
77 { | 77 { |
78 return FX_EDIT_IsFloatZero((m_rcLine.top - m_rcLine.bottom) - (l
inerect.m_rcLine.top -linerect.m_rcLine.bottom)); | 78 return FX_EDIT_IsFloatZero((m_rcLine.top - m_rcLine.bottom) - (l
inerect.m_rcLine.top -linerect.m_rcLine.bottom)); |
79 } | 79 } |
80 | 80 |
81 » FX_BOOL IsSameTop(const CFX_Edit_LineRect & linerect) const | 81 » bool IsSameTop(const CFX_Edit_LineRect & linerect) const |
82 { | 82 { |
83 return FX_EDIT_IsFloatZero(m_rcLine.top - linerect.m_rcLine.top)
; | 83 return FX_EDIT_IsFloatZero(m_rcLine.top - linerect.m_rcLine.top)
; |
84 } | 84 } |
85 | 85 |
86 » FX_BOOL IsSameLeft(const CFX_Edit_LineRect & linerect) const | 86 » bool IsSameLeft(const CFX_Edit_LineRect & linerect) const |
87 { | 87 { |
88 return FX_EDIT_IsFloatZero(m_rcLine.left - linerect.m_rcLine.lef
t); | 88 return FX_EDIT_IsFloatZero(m_rcLine.left - linerect.m_rcLine.lef
t); |
89 } | 89 } |
90 | 90 |
91 » FX_BOOL IsSameRight(const CFX_Edit_LineRect & linerect) const | 91 » bool IsSameRight(const CFX_Edit_LineRect & linerect) const |
92 { | 92 { |
93 return FX_EDIT_IsFloatZero(m_rcLine.right - linerect.m_rcLine.ri
ght); | 93 return FX_EDIT_IsFloatZero(m_rcLine.right - linerect.m_rcLine.ri
ght); |
94 } | 94 } |
95 | 95 |
96 CPVT_WordRange m_wrLine
; | 96 CPVT_WordRange m_wrLine
; |
97 CPDF_Rect
m_rcLine; | 97 CPDF_Rect
m_rcLine; |
98 }; | 98 }; |
99 | 99 |
100 class CFX_Edit_LineRectArray | 100 class CFX_Edit_LineRectArray |
101 { | 101 { |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 void SetBeginPos(const CPVT_WordPlace & begin) | 260 void SetBeginPos(const CPVT_WordPlace & begin) |
261 { | 261 { |
262 BeginPos = begin; | 262 BeginPos = begin; |
263 } | 263 } |
264 | 264 |
265 void SetEndPos(const CPVT_WordPlace & end) | 265 void SetEndPos(const CPVT_WordPlace & end) |
266 { | 266 { |
267 EndPos = end; | 267 EndPos = end; |
268 } | 268 } |
269 | 269 |
270 » FX_BOOL IsExist() const | 270 » bool IsExist() const |
271 { | 271 { |
272 return BeginPos != EndPos; | 272 return BeginPos != EndPos; |
273 } | 273 } |
274 | 274 |
275 » FX_BOOL operator != (const CPVT_WordRange & wr) const | 275 » bool operator != (const CPVT_WordRange & wr) const |
276 { | 276 { |
277 return wr.BeginPos != BeginPos || wr.EndPos != EndPos; | 277 return wr.BeginPos != BeginPos || wr.EndPos != EndPos; |
278 } | 278 } |
279 | 279 |
280 CPVT_WordPlace BeginPos,EndPos; | 280 CPVT_WordPlace BeginPos,EndPos; |
281 }; | 281 }; |
282 | 282 |
283 /* ------------------------- CFX_Edit_Undo ---------------------------- */ | 283 /* ------------------------- CFX_Edit_Undo ---------------------------- */ |
284 | 284 |
285 class CFX_Edit_Undo | 285 class CFX_Edit_Undo |
286 { | 286 { |
287 public: | 287 public: |
288 CFX_Edit_Undo(int32_t nBufsize = 10000); | 288 CFX_Edit_Undo(int32_t nBufsize = 10000); |
289 virtual ~CFX_Edit_Undo(); | 289 virtual ~CFX_Edit_Undo(); |
290 | 290 |
291 void
Undo(); | 291 void
Undo(); |
292 void
Redo(); | 292 void
Redo(); |
293 | 293 |
294 void
AddItem(IFX_Edit_UndoItem* pItem); | 294 void
AddItem(IFX_Edit_UndoItem* pItem); |
295 | 295 |
296 » FX_BOOL»» » » » » » » »
CanUndo() const; | 296 » bool» » » » » » » » »
CanUndo() const; |
297 » FX_BOOL»» » » » » » » »
CanRedo() const; | 297 » bool» » » » » » » » »
CanRedo() const; |
298 » FX_BOOL»» » » » » » » »
IsModified() const; | 298 » bool» » » » » » » » »
IsModified() const; |
299 » FX_BOOL»» » » » » » » »
IsWorking() const; | 299 » bool» » » » » » » » »
IsWorking() const; |
300 | 300 |
301 void
Reset(); | 301 void
Reset(); |
302 | 302 |
303 IFX_Edit_UndoItem* GetItem(
int32_t nIndex); | 303 IFX_Edit_UndoItem* GetItem(
int32_t nIndex); |
304 int32_t GetItemC
ount(){return m_UndoItemStack.GetSize();} | 304 int32_t GetItemC
ount(){return m_UndoItemStack.GetSize();} |
305 int32_t GetCurUn
doPos(){return m_nCurUndoPos;} | 305 int32_t GetCurUn
doPos(){return m_nCurUndoPos;} |
306 | 306 |
307 private: | 307 private: |
308 void
SetBufSize(int32_t nSize){m_nBufSize = nSize;} | 308 void
SetBufSize(int32_t nSize){m_nBufSize = nSize;} |
309 int32_t GetBufSi
ze(){return m_nBufSize;} | 309 int32_t GetBufSi
ze(){return m_nBufSize;} |
310 | 310 |
311 void
RemoveHeads(); | 311 void
RemoveHeads(); |
312 void
RemoveTails(); | 312 void
RemoveTails(); |
313 | 313 |
314 private: | 314 private: |
315 CFX_ArrayTemplate<IFX_Edit_UndoItem*> m_UndoItemStack; | 315 CFX_ArrayTemplate<IFX_Edit_UndoItem*> m_UndoItemStack; |
316 | 316 |
317 int32_t m_nCurUn
doPos; | 317 int32_t m_nCurUn
doPos; |
318 int32_t m_nBufSi
ze; | 318 int32_t m_nBufSi
ze; |
319 » FX_BOOL»» » » » » » » »
m_bModified; | 319 » bool» » » » » » » » »
m_bModified; |
320 » FX_BOOL»» » » » » » » »
m_bVirgin; | 320 » bool» » » » » » » » »
m_bVirgin; |
321 » FX_BOOL»» » » » » » » »
m_bWorking; | 321 » bool» » » » » » » » »
m_bWorking; |
322 }; | 322 }; |
323 | 323 |
324 class CFX_Edit_UndoItem : public IFX_Edit_UndoItem | 324 class CFX_Edit_UndoItem : public IFX_Edit_UndoItem |
325 { | 325 { |
326 public: | 326 public: |
327 » CFX_Edit_UndoItem() : m_bFirst(TRUE), m_bLast(TRUE) {} | 327 » CFX_Edit_UndoItem() : m_bFirst(true), m_bLast(true) {} |
328 | 328 |
329 CFX_WideString GetUndoTitle() override { return L""; } | 329 CFX_WideString GetUndoTitle() override { return L""; } |
330 | 330 |
331 » void» » » » » » » » »
SetFirst(FX_BOOL bFirst){m_bFirst = bFirst;} | 331 » void» » » » » » » » »
SetFirst(bool bFirst){m_bFirst = bFirst;} |
332 » FX_BOOL»» » » » » » » »
IsFirst(){return m_bFirst;} | 332 » bool» » » » » » » » »
IsFirst(){return m_bFirst;} |
333 » void» » » » » » » » »
SetLast(FX_BOOL bLast){m_bLast = bLast;} | 333 » void» » » » » » » » »
SetLast(bool bLast){m_bLast = bLast;} |
334 » FX_BOOL»» » » » » » » »
IsLast(){return m_bLast;} | 334 » bool» » » » » » » » »
IsLast(){return m_bLast;} |
335 | 335 |
336 private: | 336 private: |
337 » FX_BOOL»» » » » » » » »
m_bFirst; | 337 » bool» » » » » » » » »
m_bFirst; |
338 » FX_BOOL»» » » » » » » »
m_bLast; | 338 » bool» » » » » » » » »
m_bLast; |
339 }; | 339 }; |
340 | 340 |
341 class CFX_Edit_GroupUndoItem : public IFX_Edit_UndoItem | 341 class CFX_Edit_GroupUndoItem : public IFX_Edit_UndoItem |
342 { | 342 { |
343 public: | 343 public: |
344 CFX_Edit_GroupUndoItem(const CFX_WideString& sTitle); | 344 CFX_Edit_GroupUndoItem(const CFX_WideString& sTitle); |
345 ~CFX_Edit_GroupUndoItem() override; | 345 ~CFX_Edit_GroupUndoItem() override; |
346 | 346 |
347 void Undo() override; | 347 void Undo() override; |
348 void Redo() override; | 348 void Redo() override; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 int32_t m_nCharset; | 417 int32_t m_nCharset; |
418 CPVT_SecProps m_SecProps; | 418 CPVT_SecProps m_SecProps; |
419 CPVT_WordProps m_WordProps; | 419 CPVT_WordProps m_WordProps; |
420 }; | 420 }; |
421 | 421 |
422 class CFXEU_Delete : public CFX_Edit_UndoItem | 422 class CFXEU_Delete : public CFX_Edit_UndoItem |
423 { | 423 { |
424 public: | 424 public: |
425 CFXEU_Delete(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const
CPVT_WordPlace & wpNewPlace, | 425 CFXEU_Delete(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const
CPVT_WordPlace & wpNewPlace, |
426 FX_WORD word, int32_t charset, | 426 FX_WORD word, int32_t charset, |
427 » » » » » » const CPVT_SecProps & SecProps,
const CPVT_WordProps & WordProps, FX_BOOL bSecEnd); | 427 » » » » » » const CPVT_SecProps & SecProps,
const CPVT_WordProps & WordProps, bool bSecEnd); |
428 virtual ~CFXEU_Delete(); | 428 virtual ~CFXEU_Delete(); |
429 | 429 |
430 void Redo(); | 430 void Redo(); |
431 void Undo(); | 431 void Undo(); |
432 | 432 |
433 private: | 433 private: |
434 CFX_Edit * m_pEdit; | 434 CFX_Edit * m_pEdit; |
435 | 435 |
436 CPVT_WordPlace m_wpOld; | 436 CPVT_WordPlace m_wpOld; |
437 CPVT_WordPlace m_wpNew; | 437 CPVT_WordPlace m_wpNew; |
438 FX_WORD m_Word; | 438 FX_WORD m_Word; |
439 int32_t m_nCharset; | 439 int32_t m_nCharset; |
440 CPVT_SecProps m_SecProps; | 440 CPVT_SecProps m_SecProps; |
441 CPVT_WordProps m_WordProps; | 441 CPVT_WordProps m_WordProps; |
442 » FX_BOOL»» » » » » m_bSecEnd; | 442 » bool» » » » » » m_bSecEnd; |
443 }; | 443 }; |
444 | 444 |
445 class CFXEU_Clear : public CFX_Edit_UndoItem | 445 class CFXEU_Clear : public CFX_Edit_UndoItem |
446 { | 446 { |
447 public: | 447 public: |
448 CFXEU_Clear(CFX_Edit * pEdit, const CPVT_WordRange & wrSel, const CFX_Wi
deString & swText); | 448 CFXEU_Clear(CFX_Edit * pEdit, const CPVT_WordRange & wrSel, const CFX_Wi
deString & swText); |
449 virtual ~CFXEU_Clear(); | 449 virtual ~CFXEU_Clear(); |
450 | 450 |
451 void Redo(); | 451 void Redo(); |
452 void Undo(); | 452 void Undo(); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 | 568 |
569 void
SetFontMap(IFX_Edit_FontMap * pFontMap); | 569 void
SetFontMap(IFX_Edit_FontMap * pFontMap); |
570 void
SetVTProvider(IPDF_VariableText_Provider* pProvider); | 570 void
SetVTProvider(IPDF_VariableText_Provider* pProvider); |
571 void
SetNotify(IFX_Edit_Notify * pNotify); | 571 void
SetNotify(IFX_Edit_Notify * pNotify); |
572 void
SetOprNotify(IFX_Edit_OprNotify* pOprNotify); | 572 void
SetOprNotify(IFX_Edit_OprNotify* pOprNotify); |
573 IFX_Edit_Iterator* GetItera
tor(); | 573 IFX_Edit_Iterator* GetItera
tor(); |
574 IPDF_VariableText * GetVaria
bleText(); | 574 IPDF_VariableText * GetVaria
bleText(); |
575 IFX_Edit_FontMap* GetFontM
ap(); | 575 IFX_Edit_FontMap* GetFontM
ap(); |
576 | 576 |
577 void
Initialize(); | 577 void
Initialize(); |
578 » void» » » » » » » » »
SetPlateRect(const CPDF_Rect & rect, FX_BOOL bPaint = TRUE); | 578 » void» » » » » » » » »
SetPlateRect(const CPDF_Rect & rect, bool bPaint = true); |
579 void
SetScrollPos(const CPDF_Point & point); | 579 void
SetScrollPos(const CPDF_Point & point); |
580 | 580 |
581 » void» » » » » » » » »
SetAlignmentH(int32_t nFormat = 0, FX_BOOL bPaint = TRUE); | 581 » void» » » » » » » » »
SetAlignmentH(int32_t nFormat = 0, bool bPaint = true); |
582 » void» » » » » » » » »
SetAlignmentV(int32_t nFormat = 0, FX_BOOL bPaint = TRUE); | 582 » void» » » » » » » » »
SetAlignmentV(int32_t nFormat = 0, bool bPaint = true); |
583 » void» » » » » » » » »
SetPasswordChar(FX_WORD wSubWord = '*', FX_BOOL bPaint = TRUE); | 583 » void» » » » » » » » »
SetPasswordChar(FX_WORD wSubWord = '*', bool bPaint = true); |
584 » void» » » » » » » » »
SetLimitChar(int32_t nLimitChar = 0, FX_BOOL bPaint = TRUE); | 584 » void» » » » » » » » »
SetLimitChar(int32_t nLimitChar = 0, bool bPaint = true); |
585 » void» » » » » » » » »
SetCharArray(int32_t nCharArray = 0, FX_BOOL bPaint = TRUE); | 585 » void» » » » » » » » »
SetCharArray(int32_t nCharArray = 0, bool bPaint = true); |
586 » void» » » » » » » » »
SetCharSpace(FX_FLOAT fCharSpace = 0.0f, FX_BOOL bPaint = TRUE); | 586 » void» » » » » » » » »
SetCharSpace(FX_FLOAT fCharSpace = 0.0f, bool bPaint = true); |
587 » void» » » » » » » » »
SetHorzScale(int32_t nHorzScale = 100, FX_BOOL bPaint = TRUE); | 587 » void» » » » » » » » »
SetHorzScale(int32_t nHorzScale = 100, bool bPaint = true); |
588 » void» » » » » » » » »
SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint = TRUE); | 588 » void» » » » » » » » »
SetLineLeading(FX_FLOAT fLineLeading, bool bPaint = true); |
589 » void» » » » » » » » »
SetMultiLine(FX_BOOL bMultiLine = TRUE, FX_BOOL bPaint = TRUE); | 589 » void» » » » » » » » »
SetMultiLine(bool bMultiLine = true, bool bPaint = true); |
590 » void» » » » » » » » »
SetAutoReturn(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE); | 590 » void» » » » » » » » »
SetAutoReturn(bool bAuto = true, bool bPaint = true); |
591 » void» » » » » » » » »
SetAutoFontSize(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE); | 591 » void» » » » » » » » »
SetAutoFontSize(bool bAuto = true, bool bPaint = true); |
592 » void» » » » » » » » »
SetAutoScroll(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE); | 592 » void» » » » » » » » »
SetAutoScroll(bool bAuto = true, bool bPaint = true); |
593 » void» » » » » » » » »
SetFontSize(FX_FLOAT fFontSize, FX_BOOL bPaint = TRUE); | 593 » void» » » » » » » » »
SetFontSize(FX_FLOAT fFontSize, bool bPaint = true); |
594 » void» » » » » » » » »
SetTextOverflow(FX_BOOL bAllowed = FALSE, FX_BOOL bPaint = TRUE); | 594 » void» » » » » » » » »
SetTextOverflow(bool bAllowed = false, bool bPaint = true); |
595 | 595 |
596 » FX_BOOL»» » » » » » » »
IsRichText() const; | 596 » bool» » » » » » » » »
IsRichText() const; |
597 » void» » » » » » » » »
SetRichText(FX_BOOL bRichText = TRUE, FX_BOOL bPaint = TRUE); | 597 » void» » » » » » » » »
SetRichText(bool bRichText = true, bool bPaint = true); |
598 » FX_BOOL»» » » » » » » »
SetRichFontSize(FX_FLOAT fFontSize); | 598 » bool» » » » » » » » »
SetRichFontSize(FX_FLOAT fFontSize); |
599 » FX_BOOL»» » » » » » » »
SetRichFontIndex(int32_t nFontIndex); | 599 » bool» » » » » » » » »
SetRichFontIndex(int32_t nFontIndex); |
600 » FX_BOOL»» » » » » » » »
SetRichTextColor(FX_COLORREF dwColor); | 600 » bool» » » » » » » » »
SetRichTextColor(FX_COLORREF dwColor); |
601 » FX_BOOL»» » » » » » » »
SetRichTextScript(int32_t nScriptType); | 601 » bool» » » » » » » » »
SetRichTextScript(int32_t nScriptType); |
602 » FX_BOOL»» » » » » » » »
SetRichTextBold(FX_BOOL bBold = TRUE); | 602 » bool» » » » » » » » »
SetRichTextBold(bool bBold = true); |
603 » FX_BOOL»» » » » » » » »
SetRichTextItalic(FX_BOOL bItalic = TRUE); | 603 » bool» » » » » » » » »
SetRichTextItalic(bool bItalic = true); |
604 » FX_BOOL»» » » » » » » »
SetRichTextUnderline(FX_BOOL bUnderline = TRUE); | 604 » bool» » » » » » » » »
SetRichTextUnderline(bool bUnderline = true); |
605 » FX_BOOL»» » » » » » » »
SetRichTextCrossout(FX_BOOL bCrossout = TRUE); | 605 » bool» » » » » » » » »
SetRichTextCrossout(bool bCrossout = true); |
606 » FX_BOOL»» » » » » » » »
SetRichTextCharSpace(FX_FLOAT fCharSpace); | 606 » bool» » » » » » » » »
SetRichTextCharSpace(FX_FLOAT fCharSpace); |
607 » FX_BOOL»» » » » » » » »
SetRichTextHorzScale(int32_t nHorzScale = 100); | 607 » bool» » » » » » » » »
SetRichTextHorzScale(int32_t nHorzScale = 100); |
608 » FX_BOOL»» » » » » » » »
SetRichTextLineLeading(FX_FLOAT fLineLeading); | 608 » bool» » » » » » » » »
SetRichTextLineLeading(FX_FLOAT fLineLeading); |
609 » FX_BOOL»» » » » » » » »
SetRichTextLineIndent(FX_FLOAT fLineIndent); | 609 » bool» » » » » » » » »
SetRichTextLineIndent(FX_FLOAT fLineIndent); |
610 » FX_BOOL»» » » » » » » »
SetRichTextAlignment(int32_t nAlignment); | 610 » bool» » » » » » » » »
SetRichTextAlignment(int32_t nAlignment); |
611 | 611 |
612 » void» » » » » » » » »
OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl); | 612 » void» » » » » » » » »
OnMouseDown(const CPDF_Point & point,bool bShift,bool bCtrl); |
613 » void» » » » » » » » »
OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl); | 613 » void» » » » » » » » »
OnMouseMove(const CPDF_Point & point,bool bShift,bool bCtrl); |
614 » void» » » » » » » » »
OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl); | 614 » void» » » » » » » » »
OnVK_UP(bool bShift,bool bCtrl); |
615 » void» » » » » » » » »
OnVK_DOWN(FX_BOOL bShift,FX_BOOL bCtrl); | 615 » void» » » » » » » » »
OnVK_DOWN(bool bShift,bool bCtrl); |
616 » void» » » » » » » » »
OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl); | 616 » void» » » » » » » » »
OnVK_LEFT(bool bShift,bool bCtrl); |
617 » void» » » » » » » » »
OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl); | 617 » void» » » » » » » » »
OnVK_RIGHT(bool bShift,bool bCtrl); |
618 » void» » » » » » » » »
OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl); | 618 » void» » » » » » » » »
OnVK_HOME(bool bShift,bool bCtrl); |
619 » void» » » » » » » » »
OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl); | 619 » void» » » » » » » » »
OnVK_END(bool bShift,bool bCtrl); |
620 | 620 |
621 void
SetText(const FX_WCHAR* text,int32_t charset = DEFAULT_CHARSET, | 621 void
SetText(const FX_WCHAR* text,int32_t charset = DEFAULT_CHARSET, |
622
const CPVT_SecProps * pSecProps = NULL,const CPVT_WordPr
ops * pWordProps = NULL); | 622
const CPVT_SecProps * pSecProps = NULL,const CPVT_WordPr
ops * pWordProps = NULL); |
623 » FX_BOOL»» » » » » » » »
InsertWord(FX_WORD word, int32_t charset = DEFAULT_CHARSET, const CPVT_WordProps
* pWordProps = NULL); | 623 » bool» » » » » » » » »
InsertWord(FX_WORD word, int32_t charset = DEFAULT_CHARSET, const CPVT_WordProps
* pWordProps = NULL); |
624 » FX_BOOL»» » » » » » » »
InsertReturn(const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWord
Props = NULL); | 624 » bool» » » » » » » » »
InsertReturn(const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWord
Props = NULL); |
625 » FX_BOOL»» » » » » » » »
Backspace(); | 625 » bool» » » » » » » » »
Backspace(); |
626 » FX_BOOL»» » » » » » » »
Delete(); | 626 » bool» » » » » » » » »
Delete(); |
627 » FX_BOOL»» » » » » » » »
Clear(); | 627 » bool» » » » » » » » »
Clear(); |
628 » FX_BOOL»» » » » » » » »
Empty(); | 628 » bool» » » » » » » » »
Empty(); |
629 » FX_BOOL»» » » » » » » »
InsertText(const FX_WCHAR* text, int32_t charset = DEFAULT_CHARSET, | 629 » bool» » » » » » » » »
InsertText(const FX_WCHAR* text, int32_t charset = DEFAULT_CHARSET, |
630
const CPVT_SecProps * pSecProps = NULL,const CPVT_WordPr
ops * pWordProps = NULL); | 630
const CPVT_SecProps * pSecProps = NULL,const CPVT_WordPr
ops * pWordProps = NULL); |
631 » FX_BOOL»» » » » » » » »
Redo(); | 631 » bool» » » » » » » » »
Redo(); |
632 » FX_BOOL»» » » » » » » »
Undo(); | 632 » bool» » » » » » » » »
Undo(); |
633 CPVT_WordPlace DoInsert
Text(const CPVT_WordPlace& place, const FX_WCHAR* text, int32_t charset, | 633 CPVT_WordPlace DoInsert
Text(const CPVT_WordPlace& place, const FX_WCHAR* text, int32_t charset, |
634
const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordPro
ps); | 634
const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordPro
ps); |
635 int32_t GetCharS
etFromUnicode(FX_WORD word, int32_t nOldCharset); | 635 int32_t GetCharS
etFromUnicode(FX_WORD word, int32_t nOldCharset); |
636 | 636 |
637 int32_t WordPlac
eToWordIndex(const CPVT_WordPlace & place) const; | 637 int32_t WordPlac
eToWordIndex(const CPVT_WordPlace & place) const; |
638 CPVT_WordPlace WordInde
xToWordPlace(int32_t index) const; | 638 CPVT_WordPlace WordInde
xToWordPlace(int32_t index) const; |
639 | 639 |
640 CPVT_WordPlace GetLineB
eginPlace(const CPVT_WordPlace & place) const; | 640 CPVT_WordPlace GetLineB
eginPlace(const CPVT_WordPlace & place) const; |
641 CPVT_WordPlace GetLineE
ndPlace(const CPVT_WordPlace & place) const; | 641 CPVT_WordPlace GetLineE
ndPlace(const CPVT_WordPlace & place) const; |
642 CPVT_WordPlace GetSecti
onBeginPlace(const CPVT_WordPlace & place) const; | 642 CPVT_WordPlace GetSecti
onBeginPlace(const CPVT_WordPlace & place) const; |
(...skipping 16 matching lines...) Expand all Loading... |
659 int32_t GetTotal
Words() const; | 659 int32_t GetTotal
Words() const; |
660 int32_t GetTotal
Lines() const; | 660 int32_t GetTotal
Lines() const; |
661 | 661 |
662 void
SetSel(int32_t nStartChar,int32_t nEndChar); | 662 void
SetSel(int32_t nStartChar,int32_t nEndChar); |
663 void
GetSel(int32_t & nStartChar, int32_t & nEndChar) const; | 663 void
GetSel(int32_t & nStartChar, int32_t & nEndChar) const; |
664 | 664 |
665 private: | 665 private: |
666 void
SelectAll(); | 666 void
SelectAll(); |
667 void
SelectNone(); | 667 void
SelectNone(); |
668 void
SetSel(const CPVT_WordPlace & begin,const CPVT_WordPlace & end); | 668 void
SetSel(const CPVT_WordPlace & begin,const CPVT_WordPlace & end); |
669 » FX_BOOL»» » » » » » » »
IsSelected() const; | 669 » bool» » » » » » » » »
IsSelected() const; |
670 | 670 |
671 void
RearrangeAll(); | 671 void
RearrangeAll(); |
672 void
RearrangePart(const CPVT_WordRange & range); | 672 void
RearrangePart(const CPVT_WordRange & range); |
673 void
Paint(); | 673 void
Paint(); |
674 void
ScrollToCaret(); | 674 void
ScrollToCaret(); |
675 void
SetScrollInfo(); | 675 void
SetScrollInfo(); |
676 void
SetScrollPosX(FX_FLOAT fx); | 676 void
SetScrollPosX(FX_FLOAT fx); |
677 void
SetScrollPosY(FX_FLOAT fy); | 677 void
SetScrollPosY(FX_FLOAT fy); |
678 void
SetScrollLimit(); | 678 void
SetScrollLimit(); |
679 void
SetContentChanged(); | 679 void
SetContentChanged(); |
680 » void» » » » » » » » »
EnableNotify(FX_BOOL bNotify); | 680 » void» » » » » » » » »
EnableNotify(bool bNotify); |
681 | 681 |
682 void
SetText(const FX_WCHAR* text,int32_t charset, | 682 void
SetText(const FX_WCHAR* text,int32_t charset, |
683 » » » » » » » » » »
» » » const CPVT_SecProps * pSecProps,const CPVT_WordProps * p
WordProps,FX_BOOL bAddUndo, FX_BOOL bPaint); | 683 » » » » » » » » » »
» » » const CPVT_SecProps * pSecProps,const CPVT_WordProps * p
WordProps,bool bAddUndo, bool bPaint); |
684 » FX_BOOL»» » » » » » » »
InsertWord(FX_WORD word, int32_t charset, const CPVT_WordProps * pWordProps,FX_B
OOL bAddUndo, FX_BOOL bPaint); | 684 » bool» » » » » » » » »
InsertWord(FX_WORD word, int32_t charset, const CPVT_WordProps * pWordProps,bool
bAddUndo, bool bPaint); |
685 » FX_BOOL»» » » » » » » »
InsertReturn(const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,F
X_BOOL bAddUndo, FX_BOOL bPaint); | 685 » bool» » » » » » » » »
InsertReturn(const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,b
ool bAddUndo, bool bPaint); |
686 » FX_BOOL»» » » » » » » »
Backspace(FX_BOOL bAddUndo, FX_BOOL bPaint); | 686 » bool» » » » » » » » »
Backspace(bool bAddUndo, bool bPaint); |
687 » FX_BOOL»» » » » » » » »
Delete(FX_BOOL bAddUndo, FX_BOOL bPaint); | 687 » bool» » » » » » » » »
Delete(bool bAddUndo, bool bPaint); |
688 » FX_BOOL»» » » » » » » »
Clear(FX_BOOL bAddUndo, FX_BOOL bPaint); | 688 » bool» » » » » » » » »
Clear(bool bAddUndo, bool bPaint); |
689 » FX_BOOL»» » » » » » » »
InsertText(const FX_WCHAR* text, int32_t charset, | 689 » bool» » » » » » » » »
InsertText(const FX_WCHAR* text, int32_t charset, |
690 » » » » » » » » » »
» » const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProp
s,FX_BOOL bAddUndo, FX_BOOL bPaint); | 690 » » » » » » » » » »
» » const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProp
s,bool bAddUndo, bool bPaint); |
691 » FX_BOOL»» » » » » » » »
SetRichTextProps(EDIT_PROPS_E eProps, | 691 » bool» » » » » » » » »
SetRichTextProps(EDIT_PROPS_E eProps, |
692
const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordPro
ps); | 692
const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordPro
ps); |
693 » FX_BOOL»» » » » » » » »
SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place, | 693 » bool» » » » » » » » »
SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place, |
694 » » » » » » » » » »
» » const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordPro
ps, const CPVT_WordRange & wr, FX_BOOL bAddUndo); | 694 » » » » » » » » » »
» » const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordPro
ps, const CPVT_WordRange & wr, bool bAddUndo); |
695 » FX_BOOL»» » » » » » » »
SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place, | 695 » bool» » » » » » » » »
SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place, |
696 » » » » » » » » » »
» » const CPVT_WordProps * pWordProps, const CPVT_WordRange & wr, FX
_BOOL bAddUndo); | 696 » » » » » » » » » »
» » const CPVT_WordProps * pWordProps, const CPVT_WordRange & wr, bo
ol bAddUndo); |
697 void
PaintSetProps(EDIT_PROPS_E eProps, const CPVT_WordRange & wr); | 697 void
PaintSetProps(EDIT_PROPS_E eProps, const CPVT_WordRange & wr); |
698 void
PaintInsertText(const CPVT_WordPlace & wpOld, const CPVT_WordPlace & wpNew); | 698 void
PaintInsertText(const CPVT_WordPlace & wpOld, const CPVT_WordPlace & wpNew); |
699 | 699 |
700 inline CPDF_Point VTToEdit
(const CPDF_Point & point) const; | 700 inline CPDF_Point VTToEdit
(const CPDF_Point & point) const; |
701 inline CPDF_Point EditToVT
(const CPDF_Point & point) const; | 701 inline CPDF_Point EditToVT
(const CPDF_Point & point) const; |
702 inline CPDF_Rect VTToEdit
(const CPDF_Rect & rect) const; | 702 inline CPDF_Rect VTToEdit
(const CPDF_Rect & rect) const; |
703 inline CPDF_Rect EditToVT
(const CPDF_Rect & rect) const; | 703 inline CPDF_Rect EditToVT
(const CPDF_Rect & rect) const; |
704 | 704 |
705 » void» » » » » » » » »
EnableRefresh(FX_BOOL bRefresh); | 705 » void» » » » » » » » »
EnableRefresh(bool bRefresh); |
706 void
Refresh(REFRESH_PLAN_E ePlan,const CPVT_WordRange * pRange1 = NULL,const CPVT_Wo
rdRange * pRange2 = NULL); | 706 void
Refresh(REFRESH_PLAN_E ePlan,const CPVT_WordRange * pRange1 = NULL,const CPVT_Wo
rdRange * pRange2 = NULL); |
707 void
RefreshPushLineRects(const CPVT_WordRange & wr); | 707 void
RefreshPushLineRects(const CPVT_WordRange & wr); |
708 void
RefreshPushRandomRects(const CPVT_WordRange & wr); | 708 void
RefreshPushRandomRects(const CPVT_WordRange & wr); |
709 void
RefreshWordRange(const CPVT_WordRange& wr); | 709 void
RefreshWordRange(const CPVT_WordRange& wr); |
710 | 710 |
711 void
SetCaret(int32_t nPos); | 711 void
SetCaret(int32_t nPos); |
712 void
SetCaret(const CPVT_WordPlace & place); | 712 void
SetCaret(const CPVT_WordPlace & place); |
713 void
SetCaretInfo(); | 713 void
SetCaretInfo(); |
714 void
SetCaretOrigin(); | 714 void
SetCaretOrigin(); |
715 void
SetCaretChange(); | 715 void
SetCaretChange(); |
716 | 716 |
717 CPVT_WordRange GetWhole
WordRange() const; | 717 CPVT_WordRange GetWhole
WordRange() const; |
718 CPVT_WordRange GetVisib
leWordRange() const; | 718 CPVT_WordRange GetVisib
leWordRange() const; |
719 CPVT_WordRange GetLatin
WordsRange(const CPVT_WordPlace & place) const; | 719 CPVT_WordRange GetLatin
WordsRange(const CPVT_WordPlace & place) const; |
720 CPVT_WordRange CombineW
ordRange(const CPVT_WordRange & wr1, const CPVT_WordRange & wr2); | 720 CPVT_WordRange CombineW
ordRange(const CPVT_WordRange & wr1, const CPVT_WordRange & wr2); |
721 CPVT_WordRange GetSelec
tWordRange() const; | 721 CPVT_WordRange GetSelec
tWordRange() const; |
722 | 722 |
723 » void» » » » » » » » »
EnableUndo(FX_BOOL bUndo); | 723 » void» » » » » » » » »
EnableUndo(bool bUndo); |
724 » void» » » » » » » » »
EnableOprNotify(FX_BOOL bNotify); | 724 » void» » » » » » » » »
EnableOprNotify(bool bNotify); |
725 | 725 |
726 » FX_BOOL»» » » » » » » »
IsTextFull() const; | 726 » bool» » » » » » » » »
IsTextFull() const; |
727 » FX_BOOL»» » » » » » » »
IsTextOverflow() const; | 727 » bool» » » » » » » » »
IsTextOverflow() const; |
728 » FX_BOOL»» » » » » » » »
CanUndo() const; | 728 » bool» » » » » » » » »
CanUndo() const; |
729 » FX_BOOL»» » » » » » » »
CanRedo() const; | 729 » bool» » » » » » » » »
CanRedo() const; |
730 » FX_BOOL»» » » » » » » »
IsModified() const; | 730 » bool» » » » » » » » »
IsModified() const; |
731 | 731 |
732 void
BeginGroupUndo(const CFX_WideString& sTitle); | 732 void
BeginGroupUndo(const CFX_WideString& sTitle); |
733 void
EndGroupUndo(); | 733 void
EndGroupUndo(); |
734 void
AddEditUndoItem(CFX_Edit_UndoItem* pEditUndoItem); | 734 void
AddEditUndoItem(CFX_Edit_UndoItem* pEditUndoItem); |
735 void
AddUndoItem(IFX_Edit_UndoItem* pUndoItem); | 735 void
AddUndoItem(IFX_Edit_UndoItem* pUndoItem); |
736 | 736 |
737 void
SetPageInfo(const CPVT_WordPlace& place); | 737 void
SetPageInfo(const CPVT_WordPlace& place); |
738 CPVT_WordPlace SearchPa
geEndPlace(const CPVT_WordPlace& wpPageBegin, const CPDF_Point& point) const; | 738 CPVT_WordPlace SearchPa
geEndPlace(const CPVT_WordPlace& wpPageBegin, const CPDF_Point& point) const; |
739 FX_FLOAT
GetLineTop(const CPVT_WordPlace& place) const; | 739 FX_FLOAT
GetLineTop(const CPVT_WordPlace& place) const; |
740 FX_FLOAT
GetLineBottom(const CPVT_WordPlace& place) const; | 740 FX_FLOAT
GetLineBottom(const CPVT_WordPlace& place) const; |
741 | 741 |
742 private: | 742 private: |
743 IPDF_VariableText* m_pVT; | 743 IPDF_VariableText* m_pVT; |
744 IFX_Edit_Notify* m_pNotif
y; | 744 IFX_Edit_Notify* m_pNotif
y; |
745 IFX_Edit_OprNotify* m_pOprNo
tify; | 745 IFX_Edit_OprNotify* m_pOprNo
tify; |
746 CFX_Edit_Provider* m_pVTPro
vide; | 746 CFX_Edit_Provider* m_pVTPro
vide; |
747 | 747 |
748 CPVT_WordPlace m_wpCare
t; | 748 CPVT_WordPlace m_wpCare
t; |
749 CPVT_WordPlace m_wpOldC
aret; | 749 CPVT_WordPlace m_wpOldC
aret; |
750 CFX_Edit_Select m_SelSta
te; | 750 CFX_Edit_Select m_SelSta
te; |
751 | 751 |
752 CPDF_Point
m_ptScrollPos; | 752 CPDF_Point
m_ptScrollPos; |
753 CPDF_Point
m_ptRefreshScrollPos; | 753 CPDF_Point
m_ptRefreshScrollPos; |
754 » FX_BOOL»» » » » » » » »
m_bEnableScroll; | 754 » bool» » » » » » » » »
m_bEnableScroll; |
755 IFX_Edit_Iterator * m_pItera
tor; | 755 IFX_Edit_Iterator * m_pItera
tor; |
756 CFX_Edit_Refresh m_Refres
h; | 756 CFX_Edit_Refresh m_Refres
h; |
757 CPDF_Point
m_ptCaret; | 757 CPDF_Point
m_ptCaret; |
758 CFX_Edit_Undo m_Undo; | 758 CFX_Edit_Undo m_Undo; |
759 int32_t m_nAlign
ment; | 759 int32_t m_nAlign
ment; |
760 » FX_BOOL»» » » » » » » »
m_bNotifyFlag; | 760 » bool» » » » » » » » »
m_bNotifyFlag; |
761 » FX_BOOL»» » » » » » » »
m_bEnableOverflow; | 761 » bool» » » » » » » » »
m_bEnableOverflow; |
762 » FX_BOOL»» » » » » » » »
m_bEnableRefresh; | 762 » bool» » » » » » » » »
m_bEnableRefresh; |
763 CPDF_Rect
m_rcOldContent; | 763 CPDF_Rect
m_rcOldContent; |
764 » FX_BOOL»» » » » » » » »
m_bEnableUndo; | 764 » bool» » » » » » » » »
m_bEnableUndo; |
765 » FX_BOOL»» » » » » » » »
m_bNotify; | 765 » bool» » » » » » » » »
m_bNotify; |
766 » FX_BOOL»» » » » » » » »
m_bOprNotify; | 766 » bool» » » » » » » » »
m_bOprNotify; |
767 CFX_Edit_GroupUndoItem* m_pGroupUndoItem
; | 767 CFX_Edit_GroupUndoItem* m_pGroupUndoItem
; |
768 }; | 768 }; |
769 | 769 |
770 /* ------------------------- CFX_Edit_Iterator ---------------------------- */ | 770 /* ------------------------- CFX_Edit_Iterator ---------------------------- */ |
771 | 771 |
772 class CFX_Edit_Iterator : public IFX_Edit_Iterator | 772 class CFX_Edit_Iterator : public IFX_Edit_Iterator |
773 { | 773 { |
774 public: | 774 public: |
775 CFX_Edit_Iterator(CFX_Edit * pEdit,IPDF_VariableText_Iterator * pVTItera
tor); | 775 CFX_Edit_Iterator(CFX_Edit * pEdit,IPDF_VariableText_Iterator * pVTItera
tor); |
776 virtual ~CFX_Edit_Iterator(); | 776 virtual ~CFX_Edit_Iterator(); |
777 | 777 |
778 » FX_BOOL»» » » » » » » »
NextWord(); | 778 » bool» » » » » » » » »
NextWord(); |
779 » FX_BOOL»» » » » » » » »
NextLine(); | 779 » bool» » » » » » » » »
NextLine(); |
780 » FX_BOOL»» » » » » » » »
NextSection(); | 780 » bool» » » » » » » » »
NextSection(); |
781 » FX_BOOL»» » » » » » » »
PrevWord(); | 781 » bool» » » » » » » » »
PrevWord(); |
782 » FX_BOOL»» » » » » » » »
PrevLine(); | 782 » bool» » » » » » » » »
PrevLine(); |
783 » FX_BOOL»» » » » » » » »
PrevSection(); | 783 » bool» » » » » » » » »
PrevSection(); |
784 | 784 |
785 » FX_BOOL»» » » » » » » »
GetWord(CPVT_Word & word) const; | 785 » bool» » » » » » » » »
GetWord(CPVT_Word & word) const; |
786 » FX_BOOL»» » » » » » » »
GetLine(CPVT_Line & line) const; | 786 » bool» » » » » » » » »
GetLine(CPVT_Line & line) const; |
787 » FX_BOOL»» » » » » » » »
GetSection(CPVT_Section & section) const; | 787 » bool» » » » » » » » »
GetSection(CPVT_Section & section) const; |
788 void
SetAt(int32_t nWordIndex); | 788 void
SetAt(int32_t nWordIndex); |
789 void
SetAt(const CPVT_WordPlace & place); | 789 void
SetAt(const CPVT_WordPlace & place); |
790 const CPVT_WordPlace & GetAt() const; | 790 const CPVT_WordPlace & GetAt() const; |
791 IFX_Edit*
GetEdit() const; | 791 IFX_Edit*
GetEdit() const; |
792 | 792 |
793 private: | 793 private: |
794 CFX_Edit *
m_pEdit; | 794 CFX_Edit *
m_pEdit; |
795 IPDF_VariableText_Iterator* m_pVTIterator; | 795 IPDF_VariableText_Iterator* m_pVTIterator; |
796 }; | 796 }; |
797 | 797 |
798 class CFX_Edit_Provider : public IPDF_VariableText_Provider | 798 class CFX_Edit_Provider : public IPDF_VariableText_Provider |
799 { | 799 { |
800 public: | 800 public: |
801 CFX_Edit_Provider(IFX_Edit_FontMap* pFontMap); | 801 CFX_Edit_Provider(IFX_Edit_FontMap* pFontMap); |
802 virtual ~CFX_Edit_Provider(); | 802 virtual ~CFX_Edit_Provider(); |
803 | 803 |
804 IFX_Edit_FontMap* GetFontMap(); | 804 IFX_Edit_FontMap* GetFontMap(); |
805 | 805 |
806 int32_t GetCharWidth(int32_t nFontIndex,
FX_WORD word, int32_t nWordStyle); | 806 int32_t GetCharWidth(int32_t nFontIndex,
FX_WORD word, int32_t nWordStyle); |
807 int32_t GetTypeAscent(int32_t nFontIndex
); | 807 int32_t GetTypeAscent(int32_t nFontIndex
); |
808 int32_t GetTypeDescent(int32_t nFontInde
x); | 808 int32_t GetTypeDescent(int32_t nFontInde
x); |
809 int32_t GetWordFontIndex(FX_WORD word, i
nt32_t charset, int32_t nFontIndex); | 809 int32_t GetWordFontIndex(FX_WORD word, i
nt32_t charset, int32_t nFontIndex); |
810 int32_t GetDefaultFontIndex(); | 810 int32_t GetDefaultFontIndex(); |
811 » FX_BOOL»» » » » » IsLatinWord(FX_WORD word
); | 811 » bool» » » » » » IsLatinWord(FX_WORD word
); |
812 | 812 |
813 private: | 813 private: |
814 IFX_Edit_FontMap* m_pFontMap; | 814 IFX_Edit_FontMap* m_pFontMap; |
815 }; | 815 }; |
816 | 816 |
817 #endif // FPDFSDK_INCLUDE_FXEDIT_FXET_EDIT_H_ | 817 #endif // FPDFSDK_INCLUDE_FXEDIT_FXET_EDIT_H_ |
OLD | NEW |