Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: fpdfsdk/include/fxedit/fxet_edit.h

Issue 1287193005: Use override in more classes in fpdfsdk/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: nits, rebase Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/include/fxedit/fx_edit.h ('k') | fpdfsdk/include/fxedit/fxet_list.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 int32_t m_nCurUndoPos; 262 int32_t m_nCurUndoPos;
263 int32_t m_nBufSize; 263 int32_t m_nBufSize;
264 FX_BOOL m_bModified; 264 FX_BOOL m_bModified;
265 FX_BOOL m_bVirgin; 265 FX_BOOL m_bVirgin;
266 FX_BOOL m_bWorking; 266 FX_BOOL m_bWorking;
267 }; 267 };
268 268
269 class CFX_Edit_UndoItem : public IFX_Edit_UndoItem { 269 class CFX_Edit_UndoItem : public IFX_Edit_UndoItem {
270 public: 270 public:
271 CFX_Edit_UndoItem() : m_bFirst(TRUE), m_bLast(TRUE) {} 271 CFX_Edit_UndoItem() : m_bFirst(TRUE), m_bLast(TRUE) {}
272 ~CFX_Edit_UndoItem() override {}
272 273
273 CFX_WideString GetUndoTitle() override { return L""; } 274 CFX_WideString GetUndoTitle() override { return L""; }
274 275
275 void SetFirst(FX_BOOL bFirst) { m_bFirst = bFirst; } 276 void SetFirst(FX_BOOL bFirst) { m_bFirst = bFirst; }
276 FX_BOOL IsFirst() { return m_bFirst; } 277 FX_BOOL IsFirst() { return m_bFirst; }
277 void SetLast(FX_BOOL bLast) { m_bLast = bLast; } 278 void SetLast(FX_BOOL bLast) { m_bLast = bLast; }
278 FX_BOOL IsLast() { return m_bLast; } 279 FX_BOOL IsLast() { return m_bLast; }
279 280
280 private: 281 private:
281 FX_BOOL m_bFirst; 282 FX_BOOL m_bFirst;
(...skipping 21 matching lines...) Expand all
303 * ---------------------------- */ 304 * ---------------------------- */
304 305
305 class CFXEU_InsertWord : public CFX_Edit_UndoItem { 306 class CFXEU_InsertWord : public CFX_Edit_UndoItem {
306 public: 307 public:
307 CFXEU_InsertWord(CFX_Edit* pEdit, 308 CFXEU_InsertWord(CFX_Edit* pEdit,
308 const CPVT_WordPlace& wpOldPlace, 309 const CPVT_WordPlace& wpOldPlace,
309 const CPVT_WordPlace& wpNewPlace, 310 const CPVT_WordPlace& wpNewPlace,
310 FX_WORD word, 311 FX_WORD word,
311 int32_t charset, 312 int32_t charset,
312 const CPVT_WordProps* pWordProps); 313 const CPVT_WordProps* pWordProps);
313 virtual ~CFXEU_InsertWord(); 314 ~CFXEU_InsertWord() override;
314 315
315 void Redo(); 316 // CFX_Edit_UndoItem
316 void Undo(); 317 void Redo() override;
318 void Undo() override;
317 319
318 private: 320 private:
319 CFX_Edit* m_pEdit; 321 CFX_Edit* m_pEdit;
320 322
321 CPVT_WordPlace m_wpOld; 323 CPVT_WordPlace m_wpOld;
322 CPVT_WordPlace m_wpNew; 324 CPVT_WordPlace m_wpNew;
323 FX_WORD m_Word; 325 FX_WORD m_Word;
324 int32_t m_nCharset; 326 int32_t m_nCharset;
325 CPVT_WordProps m_WordProps; 327 CPVT_WordProps m_WordProps;
326 }; 328 };
327 329
328 class CFXEU_InsertReturn : public CFX_Edit_UndoItem { 330 class CFXEU_InsertReturn : public CFX_Edit_UndoItem {
329 public: 331 public:
330 CFXEU_InsertReturn(CFX_Edit* pEdit, 332 CFXEU_InsertReturn(CFX_Edit* pEdit,
331 const CPVT_WordPlace& wpOldPlace, 333 const CPVT_WordPlace& wpOldPlace,
332 const CPVT_WordPlace& wpNewPlace, 334 const CPVT_WordPlace& wpNewPlace,
333 const CPVT_SecProps* pSecProps, 335 const CPVT_SecProps* pSecProps,
334 const CPVT_WordProps* pWordProps); 336 const CPVT_WordProps* pWordProps);
335 virtual ~CFXEU_InsertReturn(); 337 ~CFXEU_InsertReturn() override;
336 338
337 void Redo(); 339 // CFX_Edit_UndoItem
338 void Undo(); 340 void Redo() override;
341 void Undo() override;
339 342
340 private: 343 private:
341 CFX_Edit* m_pEdit; 344 CFX_Edit* m_pEdit;
342 345
343 CPVT_WordPlace m_wpOld; 346 CPVT_WordPlace m_wpOld;
344 CPVT_WordPlace m_wpNew; 347 CPVT_WordPlace m_wpNew;
345 CPVT_SecProps m_SecProps; 348 CPVT_SecProps m_SecProps;
346 CPVT_WordProps m_WordProps; 349 CPVT_WordProps m_WordProps;
347 }; 350 };
348 351
349 class CFXEU_Backspace : public CFX_Edit_UndoItem { 352 class CFXEU_Backspace : public CFX_Edit_UndoItem {
350 public: 353 public:
351 CFXEU_Backspace(CFX_Edit* pEdit, 354 CFXEU_Backspace(CFX_Edit* pEdit,
352 const CPVT_WordPlace& wpOldPlace, 355 const CPVT_WordPlace& wpOldPlace,
353 const CPVT_WordPlace& wpNewPlace, 356 const CPVT_WordPlace& wpNewPlace,
354 FX_WORD word, 357 FX_WORD word,
355 int32_t charset, 358 int32_t charset,
356 const CPVT_SecProps& SecProps, 359 const CPVT_SecProps& SecProps,
357 const CPVT_WordProps& WordProps); 360 const CPVT_WordProps& WordProps);
358 virtual ~CFXEU_Backspace(); 361 ~CFXEU_Backspace() override;
359 362
360 void Redo(); 363 // CFX_Edit_UndoItem
361 void Undo(); 364 void Redo() override;
365 void Undo() override;
362 366
363 private: 367 private:
364 CFX_Edit* m_pEdit; 368 CFX_Edit* m_pEdit;
365 369
366 CPVT_WordPlace m_wpOld; 370 CPVT_WordPlace m_wpOld;
367 CPVT_WordPlace m_wpNew; 371 CPVT_WordPlace m_wpNew;
368 FX_WORD m_Word; 372 FX_WORD m_Word;
369 int32_t m_nCharset; 373 int32_t m_nCharset;
370 CPVT_SecProps m_SecProps; 374 CPVT_SecProps m_SecProps;
371 CPVT_WordProps m_WordProps; 375 CPVT_WordProps m_WordProps;
372 }; 376 };
373 377
374 class CFXEU_Delete : public CFX_Edit_UndoItem { 378 class CFXEU_Delete : public CFX_Edit_UndoItem {
375 public: 379 public:
376 CFXEU_Delete(CFX_Edit* pEdit, 380 CFXEU_Delete(CFX_Edit* pEdit,
377 const CPVT_WordPlace& wpOldPlace, 381 const CPVT_WordPlace& wpOldPlace,
378 const CPVT_WordPlace& wpNewPlace, 382 const CPVT_WordPlace& wpNewPlace,
379 FX_WORD word, 383 FX_WORD word,
380 int32_t charset, 384 int32_t charset,
381 const CPVT_SecProps& SecProps, 385 const CPVT_SecProps& SecProps,
382 const CPVT_WordProps& WordProps, 386 const CPVT_WordProps& WordProps,
383 FX_BOOL bSecEnd); 387 FX_BOOL bSecEnd);
384 virtual ~CFXEU_Delete(); 388 ~CFXEU_Delete() override;
385 389
386 void Redo(); 390 // CFX_Edit_UndoItem
387 void Undo(); 391 void Redo() override;
392 void Undo() override;
388 393
389 private: 394 private:
390 CFX_Edit* m_pEdit; 395 CFX_Edit* m_pEdit;
391 396
392 CPVT_WordPlace m_wpOld; 397 CPVT_WordPlace m_wpOld;
393 CPVT_WordPlace m_wpNew; 398 CPVT_WordPlace m_wpNew;
394 FX_WORD m_Word; 399 FX_WORD m_Word;
395 int32_t m_nCharset; 400 int32_t m_nCharset;
396 CPVT_SecProps m_SecProps; 401 CPVT_SecProps m_SecProps;
397 CPVT_WordProps m_WordProps; 402 CPVT_WordProps m_WordProps;
398 FX_BOOL m_bSecEnd; 403 FX_BOOL m_bSecEnd;
399 }; 404 };
400 405
401 class CFXEU_Clear : public CFX_Edit_UndoItem { 406 class CFXEU_Clear : public CFX_Edit_UndoItem {
402 public: 407 public:
403 CFXEU_Clear(CFX_Edit* pEdit, 408 CFXEU_Clear(CFX_Edit* pEdit,
404 const CPVT_WordRange& wrSel, 409 const CPVT_WordRange& wrSel,
405 const CFX_WideString& swText); 410 const CFX_WideString& swText);
406 virtual ~CFXEU_Clear(); 411 ~CFXEU_Clear() override;
407 412
408 void Redo(); 413 // CFX_Edit_UndoItem
409 void Undo(); 414 void Redo() override;
415 void Undo() override;
410 416
411 private: 417 private:
412 CFX_Edit* m_pEdit; 418 CFX_Edit* m_pEdit;
413 419
414 CPVT_WordRange m_wrSel; 420 CPVT_WordRange m_wrSel;
415 CFX_WideString m_swText; 421 CFX_WideString m_swText;
416 }; 422 };
417 423
418 class CFXEU_ClearRich : public CFX_Edit_UndoItem { 424 class CFXEU_ClearRich : public CFX_Edit_UndoItem {
419 public: 425 public:
420 CFXEU_ClearRich(CFX_Edit* pEdit, 426 CFXEU_ClearRich(CFX_Edit* pEdit,
421 const CPVT_WordPlace& wpOldPlace, 427 const CPVT_WordPlace& wpOldPlace,
422 const CPVT_WordPlace& wpNewPlace, 428 const CPVT_WordPlace& wpNewPlace,
423 const CPVT_WordRange& wrSel, 429 const CPVT_WordRange& wrSel,
424 FX_WORD word, 430 FX_WORD word,
425 int32_t charset, 431 int32_t charset,
426 const CPVT_SecProps& SecProps, 432 const CPVT_SecProps& SecProps,
427 const CPVT_WordProps& WordProps); 433 const CPVT_WordProps& WordProps);
428 virtual ~CFXEU_ClearRich(); 434 ~CFXEU_ClearRich() override;
429 435
430 void Redo(); 436 // CFX_Edit_UndoItem
431 void Undo(); 437 void Redo() override;
438 void Undo() override;
432 439
433 private: 440 private:
434 CFX_Edit* m_pEdit; 441 CFX_Edit* m_pEdit;
435 442
436 CPVT_WordPlace m_wpOld; 443 CPVT_WordPlace m_wpOld;
437 CPVT_WordPlace m_wpNew; 444 CPVT_WordPlace m_wpNew;
438 CPVT_WordRange m_wrSel; 445 CPVT_WordRange m_wrSel;
439 FX_WORD m_Word; 446 FX_WORD m_Word;
440 int32_t m_nCharset; 447 int32_t m_nCharset;
441 CPVT_SecProps m_SecProps; 448 CPVT_SecProps m_SecProps;
442 CPVT_WordProps m_WordProps; 449 CPVT_WordProps m_WordProps;
443 }; 450 };
444 451
445 class CFXEU_InsertText : public CFX_Edit_UndoItem { 452 class CFXEU_InsertText : public CFX_Edit_UndoItem {
446 public: 453 public:
447 CFXEU_InsertText(CFX_Edit* pEdit, 454 CFXEU_InsertText(CFX_Edit* pEdit,
448 const CPVT_WordPlace& wpOldPlace, 455 const CPVT_WordPlace& wpOldPlace,
449 const CPVT_WordPlace& wpNewPlace, 456 const CPVT_WordPlace& wpNewPlace,
450 const CFX_WideString& swText, 457 const CFX_WideString& swText,
451 int32_t charset, 458 int32_t charset,
452 const CPVT_SecProps* pSecProps, 459 const CPVT_SecProps* pSecProps,
453 const CPVT_WordProps* pWordProps); 460 const CPVT_WordProps* pWordProps);
454 virtual ~CFXEU_InsertText(); 461 ~CFXEU_InsertText() override;
455 462
456 void Redo(); 463 // CFX_Edit_UndoItem
457 void Undo(); 464 void Redo() override;
465 void Undo() override;
458 466
459 private: 467 private:
460 CFX_Edit* m_pEdit; 468 CFX_Edit* m_pEdit;
461 469
462 CPVT_WordPlace m_wpOld; 470 CPVT_WordPlace m_wpOld;
463 CPVT_WordPlace m_wpNew; 471 CPVT_WordPlace m_wpNew;
464 CFX_WideString m_swText; 472 CFX_WideString m_swText;
465 int32_t m_nCharset; 473 int32_t m_nCharset;
466 CPVT_SecProps m_SecProps; 474 CPVT_SecProps m_SecProps;
467 CPVT_WordProps m_WordProps; 475 CPVT_WordProps m_WordProps;
468 }; 476 };
469 477
470 class CFXEU_SetSecProps : public CFX_Edit_UndoItem { 478 class CFXEU_SetSecProps : public CFX_Edit_UndoItem {
471 public: 479 public:
472 CFXEU_SetSecProps(CFX_Edit* pEdit, 480 CFXEU_SetSecProps(CFX_Edit* pEdit,
473 const CPVT_WordPlace& place, 481 const CPVT_WordPlace& place,
474 EDIT_PROPS_E ep, 482 EDIT_PROPS_E ep,
475 const CPVT_SecProps& oldsecprops, 483 const CPVT_SecProps& oldsecprops,
476 const CPVT_WordProps& oldwordprops, 484 const CPVT_WordProps& oldwordprops,
477 const CPVT_SecProps& newsecprops, 485 const CPVT_SecProps& newsecprops,
478 const CPVT_WordProps& newwordprops, 486 const CPVT_WordProps& newwordprops,
479 const CPVT_WordRange& range); 487 const CPVT_WordRange& range);
480 virtual ~CFXEU_SetSecProps(); 488 ~CFXEU_SetSecProps() override;
481 489
482 void Redo(); 490 // CFX_Edit_UndoItem
483 void Undo(); 491 void Redo() override;
492 void Undo() override;
484 493
485 private: 494 private:
486 CFX_Edit* m_pEdit; 495 CFX_Edit* m_pEdit;
487 CPVT_WordPlace m_wpPlace; 496 CPVT_WordPlace m_wpPlace;
488 CPVT_WordRange m_wrPlace; 497 CPVT_WordRange m_wrPlace;
489 EDIT_PROPS_E m_eProps; 498 EDIT_PROPS_E m_eProps;
490 499
491 CPVT_SecProps m_OldSecProps; 500 CPVT_SecProps m_OldSecProps;
492 CPVT_SecProps m_NewSecProps; 501 CPVT_SecProps m_NewSecProps;
493 CPVT_WordProps m_OldWordProps; 502 CPVT_WordProps m_OldWordProps;
494 CPVT_WordProps m_NewWordProps; 503 CPVT_WordProps m_NewWordProps;
495 }; 504 };
496 505
497 class CFXEU_SetWordProps : public CFX_Edit_UndoItem { 506 class CFXEU_SetWordProps : public CFX_Edit_UndoItem {
498 public: 507 public:
499 CFXEU_SetWordProps(CFX_Edit* pEdit, 508 CFXEU_SetWordProps(CFX_Edit* pEdit,
500 const CPVT_WordPlace& place, 509 const CPVT_WordPlace& place,
501 EDIT_PROPS_E ep, 510 EDIT_PROPS_E ep,
502 const CPVT_WordProps& oldprops, 511 const CPVT_WordProps& oldprops,
503 const CPVT_WordProps& newprops, 512 const CPVT_WordProps& newprops,
504 const CPVT_WordRange& range); 513 const CPVT_WordRange& range);
505 virtual ~CFXEU_SetWordProps(); 514 ~CFXEU_SetWordProps() override;
506 515
507 void Redo(); 516 // CFX_Edit_UndoItem
508 void Undo(); 517 void Redo() override;
518 void Undo() override;
509 519
510 private: 520 private:
511 CFX_Edit* m_pEdit; 521 CFX_Edit* m_pEdit;
512 CPVT_WordPlace m_wpPlace; 522 CPVT_WordPlace m_wpPlace;
513 CPVT_WordRange m_wrPlace; 523 CPVT_WordRange m_wrPlace;
514 EDIT_PROPS_E m_eProps; 524 EDIT_PROPS_E m_eProps;
515 525
516 CPVT_WordProps m_OldWordProps; 526 CPVT_WordProps m_OldWordProps;
517 CPVT_WordProps m_NewWordProps; 527 CPVT_WordProps m_NewWordProps;
518 }; 528 };
519 529
520 /* ------------------------- CFX_Edit ---------------------------- */ 530 /* ------------------------- CFX_Edit ---------------------------- */
521 531
522 class CFX_Edit : public IFX_Edit { 532 class CFX_Edit : public IFX_Edit {
523 friend class CFX_Edit_Iterator; 533 friend class CFX_Edit_Iterator;
524 friend class CFXEU_InsertWord; 534 friend class CFXEU_InsertWord;
525 friend class CFXEU_InsertReturn; 535 friend class CFXEU_InsertReturn;
526 friend class CFXEU_Backspace; 536 friend class CFXEU_Backspace;
527 friend class CFXEU_Delete; 537 friend class CFXEU_Delete;
528 friend class CFXEU_Clear; 538 friend class CFXEU_Clear;
529 friend class CFXEU_ClearRich; 539 friend class CFXEU_ClearRich;
530 friend class CFXEU_SetSecProps; 540 friend class CFXEU_SetSecProps;
531 friend class CFXEU_SetWordProps; 541 friend class CFXEU_SetWordProps;
532 friend class CFXEU_InsertText; 542 friend class CFXEU_InsertText;
533 543
534 public: 544 public:
535 CFX_Edit(IPDF_VariableText* pVT); 545 CFX_Edit(IPDF_VariableText* pVT);
536 virtual ~CFX_Edit(); 546 ~CFX_Edit() override;
537 547
538 void SetFontMap(IFX_Edit_FontMap* pFontMap); 548 // IFX_Edit
539 void SetVTProvider(IPDF_VariableText_Provider* pProvider); 549 void SetFontMap(IFX_Edit_FontMap* pFontMap) override;
540 void SetNotify(IFX_Edit_Notify* pNotify); 550 void SetVTProvider(IPDF_VariableText_Provider* pProvider) override;
541 void SetOprNotify(IFX_Edit_OprNotify* pOprNotify); 551 void SetNotify(IFX_Edit_Notify* pNotify) override;
542 IFX_Edit_Iterator* GetIterator(); 552 void SetOprNotify(IFX_Edit_OprNotify* pOprNotify) override;
543 IPDF_VariableText* GetVariableText(); 553 IFX_Edit_Iterator* GetIterator() override;
544 IFX_Edit_FontMap* GetFontMap(); 554 IPDF_VariableText* GetVariableText() override;
545 555 IFX_Edit_FontMap* GetFontMap() override;
546 void Initialize(); 556 void Initialize() override;
547 void SetPlateRect(const CPDF_Rect& rect, FX_BOOL bPaint = TRUE); 557 void SetPlateRect(const CPDF_Rect& rect, FX_BOOL bPaint = TRUE) override;
548 void SetScrollPos(const CPDF_Point& point); 558 void SetScrollPos(const CPDF_Point& point) override;
549 559 void SetAlignmentH(int32_t nFormat = 0, FX_BOOL bPaint = TRUE) override;
550 void SetAlignmentH(int32_t nFormat = 0, FX_BOOL bPaint = TRUE); 560 void SetAlignmentV(int32_t nFormat = 0, FX_BOOL bPaint = TRUE) override;
551 void SetAlignmentV(int32_t nFormat = 0, FX_BOOL bPaint = TRUE); 561 void SetPasswordChar(FX_WORD wSubWord = '*', FX_BOOL bPaint = TRUE) override;
552 void SetPasswordChar(FX_WORD wSubWord = '*', FX_BOOL bPaint = TRUE); 562 void SetLimitChar(int32_t nLimitChar = 0, FX_BOOL bPaint = TRUE) override;
553 void SetLimitChar(int32_t nLimitChar = 0, FX_BOOL bPaint = TRUE); 563 void SetCharArray(int32_t nCharArray = 0, FX_BOOL bPaint = TRUE) override;
554 void SetCharArray(int32_t nCharArray = 0, FX_BOOL bPaint = TRUE); 564 void SetCharSpace(FX_FLOAT fCharSpace = 0.0f, FX_BOOL bPaint = TRUE) override;
555 void SetCharSpace(FX_FLOAT fCharSpace = 0.0f, FX_BOOL bPaint = TRUE); 565 void SetHorzScale(int32_t nHorzScale = 100, FX_BOOL bPaint = TRUE) override;
556 void SetHorzScale(int32_t nHorzScale = 100, FX_BOOL bPaint = TRUE); 566 void SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint = TRUE) override;
557 void SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint = TRUE); 567 void SetMultiLine(FX_BOOL bMultiLine = TRUE, FX_BOOL bPaint = TRUE) override;
558 void SetMultiLine(FX_BOOL bMultiLine = TRUE, FX_BOOL bPaint = TRUE); 568 void SetAutoReturn(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) override;
559 void SetAutoReturn(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE); 569 void SetAutoFontSize(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) override;
560 void SetAutoFontSize(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE); 570 void SetAutoScroll(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) override;
561 void SetAutoScroll(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE); 571 void SetFontSize(FX_FLOAT fFontSize, FX_BOOL bPaint = TRUE) override;
562 void SetFontSize(FX_FLOAT fFontSize, FX_BOOL bPaint = TRUE); 572 void SetTextOverflow(FX_BOOL bAllowed = FALSE,
563 void SetTextOverflow(FX_BOOL bAllowed = FALSE, FX_BOOL bPaint = TRUE); 573 FX_BOOL bPaint = TRUE) override;
564 574 FX_BOOL IsRichText() const override;
565 FX_BOOL IsRichText() const; 575 void SetRichText(FX_BOOL bRichText = TRUE, FX_BOOL bPaint = TRUE) override;
566 void SetRichText(FX_BOOL bRichText = TRUE, FX_BOOL bPaint = TRUE); 576 FX_BOOL SetRichFontSize(FX_FLOAT fFontSize) override;
567 FX_BOOL SetRichFontSize(FX_FLOAT fFontSize); 577 FX_BOOL SetRichFontIndex(int32_t nFontIndex) override;
568 FX_BOOL SetRichFontIndex(int32_t nFontIndex); 578 FX_BOOL SetRichTextColor(FX_COLORREF dwColor) override;
569 FX_BOOL SetRichTextColor(FX_COLORREF dwColor); 579 FX_BOOL SetRichTextScript(int32_t nScriptType) override;
570 FX_BOOL SetRichTextScript(int32_t nScriptType); 580 FX_BOOL SetRichTextBold(FX_BOOL bBold = TRUE) override;
571 FX_BOOL SetRichTextBold(FX_BOOL bBold = TRUE); 581 FX_BOOL SetRichTextItalic(FX_BOOL bItalic = TRUE) override;
572 FX_BOOL SetRichTextItalic(FX_BOOL bItalic = TRUE); 582 FX_BOOL SetRichTextUnderline(FX_BOOL bUnderline = TRUE) override;
573 FX_BOOL SetRichTextUnderline(FX_BOOL bUnderline = TRUE); 583 FX_BOOL SetRichTextCrossout(FX_BOOL bCrossout = TRUE) override;
574 FX_BOOL SetRichTextCrossout(FX_BOOL bCrossout = TRUE); 584 FX_BOOL SetRichTextCharSpace(FX_FLOAT fCharSpace) override;
575 FX_BOOL SetRichTextCharSpace(FX_FLOAT fCharSpace); 585 FX_BOOL SetRichTextHorzScale(int32_t nHorzScale = 100) override;
576 FX_BOOL SetRichTextHorzScale(int32_t nHorzScale = 100); 586 FX_BOOL SetRichTextLineLeading(FX_FLOAT fLineLeading) override;
577 FX_BOOL SetRichTextLineLeading(FX_FLOAT fLineLeading); 587 FX_BOOL SetRichTextLineIndent(FX_FLOAT fLineIndent) override;
578 FX_BOOL SetRichTextLineIndent(FX_FLOAT fLineIndent); 588 FX_BOOL SetRichTextAlignment(int32_t nAlignment) override;
579 FX_BOOL SetRichTextAlignment(int32_t nAlignment); 589 void OnMouseDown(const CPDF_Point& point,
580 590 FX_BOOL bShift,
581 void OnMouseDown(const CPDF_Point& point, FX_BOOL bShift, FX_BOOL bCtrl); 591 FX_BOOL bCtrl) override;
582 void OnMouseMove(const CPDF_Point& point, FX_BOOL bShift, FX_BOOL bCtrl); 592 void OnMouseMove(const CPDF_Point& point,
583 void OnVK_UP(FX_BOOL bShift, FX_BOOL bCtrl); 593 FX_BOOL bShift,
584 void OnVK_DOWN(FX_BOOL bShift, FX_BOOL bCtrl); 594 FX_BOOL bCtrl) override;
585 void OnVK_LEFT(FX_BOOL bShift, FX_BOOL bCtrl); 595 void OnVK_UP(FX_BOOL bShift, FX_BOOL bCtrl) override;
586 void OnVK_RIGHT(FX_BOOL bShift, FX_BOOL bCtrl); 596 void OnVK_DOWN(FX_BOOL bShift, FX_BOOL bCtrl) override;
587 void OnVK_HOME(FX_BOOL bShift, FX_BOOL bCtrl); 597 void OnVK_LEFT(FX_BOOL bShift, FX_BOOL bCtrl) override;
588 void OnVK_END(FX_BOOL bShift, FX_BOOL bCtrl); 598 void OnVK_RIGHT(FX_BOOL bShift, FX_BOOL bCtrl) override;
589 599 void OnVK_HOME(FX_BOOL bShift, FX_BOOL bCtrl) override;
600 void OnVK_END(FX_BOOL bShift, FX_BOOL bCtrl) override;
590 void SetText(const FX_WCHAR* text, 601 void SetText(const FX_WCHAR* text,
591 int32_t charset = DEFAULT_CHARSET, 602 int32_t charset = DEFAULT_CHARSET,
592 const CPVT_SecProps* pSecProps = NULL, 603 const CPVT_SecProps* pSecProps = NULL,
593 const CPVT_WordProps* pWordProps = NULL); 604 const CPVT_WordProps* pWordProps = NULL) override;
594 FX_BOOL InsertWord(FX_WORD word, 605 FX_BOOL InsertWord(FX_WORD word,
595 int32_t charset = DEFAULT_CHARSET, 606 int32_t charset = DEFAULT_CHARSET,
596 const CPVT_WordProps* pWordProps = NULL); 607 const CPVT_WordProps* pWordProps = NULL) override;
597 FX_BOOL InsertReturn(const CPVT_SecProps* pSecProps = NULL, 608 FX_BOOL InsertReturn(const CPVT_SecProps* pSecProps = NULL,
598 const CPVT_WordProps* pWordProps = NULL); 609 const CPVT_WordProps* pWordProps = NULL) override;
599 FX_BOOL Backspace(); 610 FX_BOOL Backspace() override;
600 FX_BOOL Delete(); 611 FX_BOOL Delete() override;
601 FX_BOOL Clear(); 612 FX_BOOL Clear() override;
602 FX_BOOL Empty();
603 FX_BOOL InsertText(const FX_WCHAR* text, 613 FX_BOOL InsertText(const FX_WCHAR* text,
604 int32_t charset = DEFAULT_CHARSET, 614 int32_t charset = DEFAULT_CHARSET,
605 const CPVT_SecProps* pSecProps = NULL, 615 const CPVT_SecProps* pSecProps = NULL,
606 const CPVT_WordProps* pWordProps = NULL); 616 const CPVT_WordProps* pWordProps = NULL) override;
607 FX_BOOL Redo(); 617 FX_BOOL Redo() override;
608 FX_BOOL Undo(); 618 FX_BOOL Undo() override;
619 int32_t WordPlaceToWordIndex(const CPVT_WordPlace& place) const override;
620 CPVT_WordPlace WordIndexToWordPlace(int32_t index) const override;
621 CPVT_WordPlace GetLineBeginPlace(const CPVT_WordPlace& place) const override;
622 CPVT_WordPlace GetLineEndPlace(const CPVT_WordPlace& place) const override;
623 CPVT_WordPlace GetSectionBeginPlace(
624 const CPVT_WordPlace& place) const override;
625 CPVT_WordPlace GetSectionEndPlace(const CPVT_WordPlace& place) const override;
626 CPVT_WordPlace SearchWordPlace(const CPDF_Point& point) const override;
627 int32_t GetCaret() const override;
628 CPVT_WordPlace GetCaretWordPlace() const override;
629 CFX_WideString GetSelText() const override;
630 CFX_WideString GetText() const override;
631 FX_FLOAT GetFontSize() const override;
632 FX_WORD GetPasswordChar() const override;
633 CPDF_Point GetScrollPos() const override;
634 int32_t GetCharArray() const override;
635 CPDF_Rect GetPlateRect() const override;
636 CPDF_Rect GetContentRect() const override;
637 CFX_WideString GetRangeText(const CPVT_WordRange& range) const override;
638 int32_t GetHorzScale() const override;
639 FX_FLOAT GetCharSpace() const override;
640 int32_t GetTotalWords() const override;
641 void SetSel(int32_t nStartChar, int32_t nEndChar) override;
642 void GetSel(int32_t& nStartChar, int32_t& nEndChar) const override;
643 void SelectAll() override;
644 void SelectNone() override;
645 FX_BOOL IsSelected() const override;
646 void Paint() override;
647 void EnableNotify(FX_BOOL bNotify) override;
648 void EnableRefresh(FX_BOOL bRefresh) override;
649 void RefreshWordRange(const CPVT_WordRange& wr) override;
650 void SetCaret(int32_t nPos) override;
651 CPVT_WordRange GetWholeWordRange() const override;
652 CPVT_WordRange GetSelectWordRange() const override;
653 void EnableUndo(FX_BOOL bUndo) override;
654 void EnableOprNotify(FX_BOOL bNotify) override;
655 FX_BOOL IsTextFull() const override;
656 FX_BOOL IsTextOverflow() const;
657 FX_BOOL CanUndo() const override;
658 FX_BOOL CanRedo() const override;
659 FX_BOOL IsModified() const override;
660 CPVT_WordRange GetVisibleWordRange() const override;
661 void AddUndoItem(IFX_Edit_UndoItem* pUndoItem) override;
662
663 FX_BOOL Empty();
664
609 CPVT_WordPlace DoInsertText(const CPVT_WordPlace& place, 665 CPVT_WordPlace DoInsertText(const CPVT_WordPlace& place,
610 const FX_WCHAR* text, 666 const FX_WCHAR* text,
611 int32_t charset, 667 int32_t charset,
612 const CPVT_SecProps* pSecProps, 668 const CPVT_SecProps* pSecProps,
613 const CPVT_WordProps* pWordProps); 669 const CPVT_WordProps* pWordProps);
614 int32_t GetCharSetFromUnicode(FX_WORD word, int32_t nOldCharset); 670 int32_t GetCharSetFromUnicode(FX_WORD word, int32_t nOldCharset);
615 671
616 int32_t WordPlaceToWordIndex(const CPVT_WordPlace& place) const;
617 CPVT_WordPlace WordIndexToWordPlace(int32_t index) const;
618
619 CPVT_WordPlace GetLineBeginPlace(const CPVT_WordPlace& place) const;
620 CPVT_WordPlace GetLineEndPlace(const CPVT_WordPlace& place) const;
621 CPVT_WordPlace GetSectionBeginPlace(const CPVT_WordPlace& place) const;
622 CPVT_WordPlace GetSectionEndPlace(const CPVT_WordPlace& place) const;
623 CPVT_WordPlace SearchWordPlace(const CPDF_Point& point) const;
624
625 int32_t GetCaret() const;
626 CPVT_WordPlace GetCaretWordPlace() const;
627 CFX_WideString GetSelText() const;
628 CFX_WideString GetText() const;
629 FX_FLOAT GetFontSize() const;
630 FX_WORD GetPasswordChar() const;
631 CPDF_Point GetScrollPos() const;
632 int32_t GetCharArray() const;
633 CPDF_Rect GetPlateRect() const;
634 CPDF_Rect GetContentRect() const;
635 CFX_WideString GetRangeText(const CPVT_WordRange& range) const;
636 int32_t GetHorzScale() const;
637 FX_FLOAT GetCharSpace() const;
638 int32_t GetTotalWords() const;
639 int32_t GetTotalLines() const; 672 int32_t GetTotalLines() const;
640 673
641 void SetSel(int32_t nStartChar, int32_t nEndChar);
642 void GetSel(int32_t& nStartChar, int32_t& nEndChar) const;
643
644 private: 674 private:
645 void SelectAll();
646 void SelectNone();
647 void SetSel(const CPVT_WordPlace& begin, const CPVT_WordPlace& end); 675 void SetSel(const CPVT_WordPlace& begin, const CPVT_WordPlace& end);
648 FX_BOOL IsSelected() const;
649 676
650 void RearrangeAll(); 677 void RearrangeAll();
651 void RearrangePart(const CPVT_WordRange& range); 678 void RearrangePart(const CPVT_WordRange& range);
652 void Paint();
653 void ScrollToCaret(); 679 void ScrollToCaret();
654 void SetScrollInfo(); 680 void SetScrollInfo();
655 void SetScrollPosX(FX_FLOAT fx); 681 void SetScrollPosX(FX_FLOAT fx);
656 void SetScrollPosY(FX_FLOAT fy); 682 void SetScrollPosY(FX_FLOAT fy);
657 void SetScrollLimit(); 683 void SetScrollLimit();
658 void SetContentChanged(); 684 void SetContentChanged();
659 void EnableNotify(FX_BOOL bNotify);
660 685
661 void SetText(const FX_WCHAR* text, 686 void SetText(const FX_WCHAR* text,
662 int32_t charset, 687 int32_t charset,
663 const CPVT_SecProps* pSecProps, 688 const CPVT_SecProps* pSecProps,
664 const CPVT_WordProps* pWordProps, 689 const CPVT_WordProps* pWordProps,
665 FX_BOOL bAddUndo, 690 FX_BOOL bAddUndo,
666 FX_BOOL bPaint); 691 FX_BOOL bPaint);
667 FX_BOOL InsertWord(FX_WORD word, 692 FX_BOOL InsertWord(FX_WORD word,
668 int32_t charset, 693 int32_t charset,
669 const CPVT_WordProps* pWordProps, 694 const CPVT_WordProps* pWordProps,
(...skipping 28 matching lines...) Expand all
698 FX_BOOL bAddUndo); 723 FX_BOOL bAddUndo);
699 void PaintSetProps(EDIT_PROPS_E eProps, const CPVT_WordRange& wr); 724 void PaintSetProps(EDIT_PROPS_E eProps, const CPVT_WordRange& wr);
700 void PaintInsertText(const CPVT_WordPlace& wpOld, 725 void PaintInsertText(const CPVT_WordPlace& wpOld,
701 const CPVT_WordPlace& wpNew); 726 const CPVT_WordPlace& wpNew);
702 727
703 inline CPDF_Point VTToEdit(const CPDF_Point& point) const; 728 inline CPDF_Point VTToEdit(const CPDF_Point& point) const;
704 inline CPDF_Point EditToVT(const CPDF_Point& point) const; 729 inline CPDF_Point EditToVT(const CPDF_Point& point) const;
705 inline CPDF_Rect VTToEdit(const CPDF_Rect& rect) const; 730 inline CPDF_Rect VTToEdit(const CPDF_Rect& rect) const;
706 inline CPDF_Rect EditToVT(const CPDF_Rect& rect) const; 731 inline CPDF_Rect EditToVT(const CPDF_Rect& rect) const;
707 732
708 void EnableRefresh(FX_BOOL bRefresh);
709 void Refresh(REFRESH_PLAN_E ePlan, 733 void Refresh(REFRESH_PLAN_E ePlan,
710 const CPVT_WordRange* pRange1 = NULL, 734 const CPVT_WordRange* pRange1 = NULL,
711 const CPVT_WordRange* pRange2 = NULL); 735 const CPVT_WordRange* pRange2 = NULL);
712 void RefreshPushLineRects(const CPVT_WordRange& wr); 736 void RefreshPushLineRects(const CPVT_WordRange& wr);
713 void RefreshPushRandomRects(const CPVT_WordRange& wr); 737 void RefreshPushRandomRects(const CPVT_WordRange& wr);
714 void RefreshWordRange(const CPVT_WordRange& wr);
715 738
716 void SetCaret(int32_t nPos);
717 void SetCaret(const CPVT_WordPlace& place); 739 void SetCaret(const CPVT_WordPlace& place);
718 void SetCaretInfo(); 740 void SetCaretInfo();
719 void SetCaretOrigin(); 741 void SetCaretOrigin();
720 void SetCaretChange(); 742 void SetCaretChange();
721 743
722 CPVT_WordRange GetWholeWordRange() const;
723 CPVT_WordRange GetVisibleWordRange() const;
724 CPVT_WordRange GetLatinWordsRange(const CPVT_WordPlace& place) const; 744 CPVT_WordRange GetLatinWordsRange(const CPVT_WordPlace& place) const;
725 CPVT_WordRange CombineWordRange(const CPVT_WordRange& wr1, 745 CPVT_WordRange CombineWordRange(const CPVT_WordRange& wr1,
726 const CPVT_WordRange& wr2); 746 const CPVT_WordRange& wr2);
727 CPVT_WordRange GetSelectWordRange() const;
728 747
729 void EnableUndo(FX_BOOL bUndo);
730 void EnableOprNotify(FX_BOOL bNotify);
731
732 FX_BOOL IsTextFull() const;
733 FX_BOOL IsTextOverflow() const;
734 FX_BOOL CanUndo() const;
735 FX_BOOL CanRedo() const;
736 FX_BOOL IsModified() const;
737 748
738 void BeginGroupUndo(const CFX_WideString& sTitle); 749 void BeginGroupUndo(const CFX_WideString& sTitle);
739 void EndGroupUndo(); 750 void EndGroupUndo();
740 void AddEditUndoItem(CFX_Edit_UndoItem* pEditUndoItem); 751 void AddEditUndoItem(CFX_Edit_UndoItem* pEditUndoItem);
741 void AddUndoItem(IFX_Edit_UndoItem* pUndoItem);
742 752
743 void SetPageInfo(const CPVT_WordPlace& place); 753 void SetPageInfo(const CPVT_WordPlace& place);
744 CPVT_WordPlace SearchPageEndPlace(const CPVT_WordPlace& wpPageBegin, 754 CPVT_WordPlace SearchPageEndPlace(const CPVT_WordPlace& wpPageBegin,
745 const CPDF_Point& point) const; 755 const CPDF_Point& point) const;
746 FX_FLOAT GetLineTop(const CPVT_WordPlace& place) const; 756 FX_FLOAT GetLineTop(const CPVT_WordPlace& place) const;
747 FX_FLOAT GetLineBottom(const CPVT_WordPlace& place) const; 757 FX_FLOAT GetLineBottom(const CPVT_WordPlace& place) const;
748 758
749 private: 759 private:
750 IPDF_VariableText* m_pVT; 760 IPDF_VariableText* m_pVT;
751 IFX_Edit_Notify* m_pNotify; 761 IFX_Edit_Notify* m_pNotify;
(...skipping 20 matching lines...) Expand all
772 FX_BOOL m_bNotify; 782 FX_BOOL m_bNotify;
773 FX_BOOL m_bOprNotify; 783 FX_BOOL m_bOprNotify;
774 CFX_Edit_GroupUndoItem* m_pGroupUndoItem; 784 CFX_Edit_GroupUndoItem* m_pGroupUndoItem;
775 }; 785 };
776 786
777 /* ------------------------- CFX_Edit_Iterator ---------------------------- */ 787 /* ------------------------- CFX_Edit_Iterator ---------------------------- */
778 788
779 class CFX_Edit_Iterator : public IFX_Edit_Iterator { 789 class CFX_Edit_Iterator : public IFX_Edit_Iterator {
780 public: 790 public:
781 CFX_Edit_Iterator(CFX_Edit* pEdit, IPDF_VariableText_Iterator* pVTIterator); 791 CFX_Edit_Iterator(CFX_Edit* pEdit, IPDF_VariableText_Iterator* pVTIterator);
782 virtual ~CFX_Edit_Iterator(); 792 ~CFX_Edit_Iterator() override;
783 793
784 FX_BOOL NextWord(); 794 // IFX_Edit_Iterator
785 FX_BOOL NextLine(); 795 FX_BOOL NextWord() override;
786 FX_BOOL NextSection(); 796 FX_BOOL NextLine() override;
787 FX_BOOL PrevWord(); 797 FX_BOOL NextSection() override;
788 FX_BOOL PrevLine(); 798 FX_BOOL PrevWord() override;
789 FX_BOOL PrevSection(); 799 FX_BOOL PrevLine() override;
790 800 FX_BOOL PrevSection() override;
791 FX_BOOL GetWord(CPVT_Word& word) const; 801 FX_BOOL GetWord(CPVT_Word& word) const override;
792 FX_BOOL GetLine(CPVT_Line& line) const; 802 FX_BOOL GetLine(CPVT_Line& line) const override;
793 FX_BOOL GetSection(CPVT_Section& section) const; 803 FX_BOOL GetSection(CPVT_Section& section) const override;
794 void SetAt(int32_t nWordIndex); 804 void SetAt(int32_t nWordIndex) override;
795 void SetAt(const CPVT_WordPlace& place); 805 void SetAt(const CPVT_WordPlace& place) override;
796 const CPVT_WordPlace& GetAt() const; 806 const CPVT_WordPlace& GetAt() const override;
797 IFX_Edit* GetEdit() const; 807 IFX_Edit* GetEdit() const override;
798 808
799 private: 809 private:
800 CFX_Edit* m_pEdit; 810 CFX_Edit* m_pEdit;
801 IPDF_VariableText_Iterator* m_pVTIterator; 811 IPDF_VariableText_Iterator* m_pVTIterator;
802 }; 812 };
803 813
804 class CFX_Edit_Provider : public IPDF_VariableText_Provider { 814 class CFX_Edit_Provider : public IPDF_VariableText_Provider {
805 public: 815 public:
806 CFX_Edit_Provider(IFX_Edit_FontMap* pFontMap); 816 CFX_Edit_Provider(IFX_Edit_FontMap* pFontMap);
807 virtual ~CFX_Edit_Provider(); 817 virtual ~CFX_Edit_Provider();
808 818
809 IFX_Edit_FontMap* GetFontMap(); 819 IFX_Edit_FontMap* GetFontMap();
810 820
811 int32_t GetCharWidth(int32_t nFontIndex, FX_WORD word, int32_t nWordStyle); 821 int32_t GetCharWidth(int32_t nFontIndex, FX_WORD word, int32_t nWordStyle);
812 int32_t GetTypeAscent(int32_t nFontIndex); 822 int32_t GetTypeAscent(int32_t nFontIndex);
813 int32_t GetTypeDescent(int32_t nFontIndex); 823 int32_t GetTypeDescent(int32_t nFontIndex);
814 int32_t GetWordFontIndex(FX_WORD word, int32_t charset, int32_t nFontIndex); 824 int32_t GetWordFontIndex(FX_WORD word, int32_t charset, int32_t nFontIndex);
815 int32_t GetDefaultFontIndex(); 825 int32_t GetDefaultFontIndex();
816 FX_BOOL IsLatinWord(FX_WORD word); 826 FX_BOOL IsLatinWord(FX_WORD word);
817 827
818 private: 828 private:
819 IFX_Edit_FontMap* m_pFontMap; 829 IFX_Edit_FontMap* m_pFontMap;
820 }; 830 };
821 831
822 #endif // FPDFSDK_INCLUDE_FXEDIT_FXET_EDIT_H_ 832 #endif // FPDFSDK_INCLUDE_FXEDIT_FXET_EDIT_H_
OLDNEW
« no previous file with comments | « fpdfsdk/include/fxedit/fx_edit.h ('k') | fpdfsdk/include/fxedit/fxet_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698