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

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

Issue 2146503002: Remove RichText support from fpdfsdk/fxedit. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 5 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/fxedit/fxet_pageobjs.cpp ('k') | fpdfsdk/fxedit/include/fxet_edit.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_FXEDIT_INCLUDE_FX_EDIT_H_ 7 #ifndef FPDFSDK_FXEDIT_INCLUDE_FX_EDIT_H_
8 #define FPDFSDK_FXEDIT_INCLUDE_FX_EDIT_H_ 8 #define FPDFSDK_FXEDIT_INCLUDE_FX_EDIT_H_
9 9
10 #include "core/fpdfdoc/include/cpdf_variabletext.h" 10 #include "core/fpdfdoc/include/cpdf_variabletext.h"
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 virtual void SetAutoScroll(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0; 236 virtual void SetAutoScroll(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0;
237 237
238 // set the font size of all words. 238 // set the font size of all words.
239 virtual void SetFontSize(FX_FLOAT fFontSize, FX_BOOL bPaint = TRUE) = 0; 239 virtual void SetFontSize(FX_FLOAT fFontSize, FX_BOOL bPaint = TRUE) = 0;
240 240
241 // the text is allowed to auto-scroll, allow the text overflow? 241 // the text is allowed to auto-scroll, allow the text overflow?
242 virtual void SetTextOverflow(FX_BOOL bAllowed = FALSE, 242 virtual void SetTextOverflow(FX_BOOL bAllowed = FALSE,
243 FX_BOOL bPaint = TRUE) = 0; 243 FX_BOOL bPaint = TRUE) = 0;
244 244
245 // query if the edit is richedit. 245 // query if the edit is richedit.
246 virtual FX_BOOL IsRichText() const = 0; 246 virtual FX_BOOL IsRichText() const = 0;
Wei Li 2016/07/12 17:56:53 Are we removing (potential) support for rich text?
dsinclair 2016/07/12 18:09:33 I removed the below because they're never called.
Wei Li 2016/07/12 21:15:31 Where IsRichText() and SetRichText() are called?
dsinclair 2016/07/13 13:51:15 Looked again and you're right. The calls to SetRic
247 247
248 // set the edit is richedit. 248 // set the edit is richedit.
249 virtual void SetRichText(FX_BOOL bRichText = TRUE, FX_BOOL bPaint = TRUE) = 0; 249 virtual void SetRichText(FX_BOOL bRichText = TRUE, FX_BOOL bPaint = TRUE) = 0;
250 250
251 // set the fontsize of selected text.
252 virtual FX_BOOL SetRichFontSize(FX_FLOAT fFontSize) = 0;
253
254 // set the fontindex of selected text, user can change the font of selected
255 // text.
256 virtual FX_BOOL SetRichFontIndex(int32_t nFontIndex) = 0;
257
258 // set the textcolor of selected text.
259 virtual FX_BOOL SetRichTextColor(FX_COLORREF dwColor) = 0;
260
261 // set the text script type of selected text. (0:normal 1:superscript
262 // 2:subscript)
263 virtual FX_BOOL SetRichTextScript(
264 CPDF_VariableText::ScriptType nScriptType) = 0;
265
266 // set the bold font style of selected text.
267 virtual FX_BOOL SetRichTextBold(FX_BOOL bBold = TRUE) = 0;
268
269 // set the italic font style of selected text.
270 virtual FX_BOOL SetRichTextItalic(FX_BOOL bItalic = TRUE) = 0;
271
272 // set the underline style of selected text.
273 virtual FX_BOOL SetRichTextUnderline(FX_BOOL bUnderline = TRUE) = 0;
274
275 // set the crossout style of selected text.
276 virtual FX_BOOL SetRichTextCrossout(FX_BOOL bCrossout = TRUE) = 0;
277
278 // set the charspace of selected text, in user coordinate.
279 virtual FX_BOOL SetRichTextCharSpace(FX_FLOAT fCharSpace) = 0;
280
281 // set the horizontal scale of selected text, default value is 100.
282 virtual FX_BOOL SetRichTextHorzScale(int32_t nHorzScale = 100) = 0;
283
284 // set the leading of selected section, in user coordinate.
285 virtual FX_BOOL SetRichTextLineLeading(FX_FLOAT fLineLeading) = 0;
286
287 // set the indent of selected section, in user coordinate.
288 virtual FX_BOOL SetRichTextLineIndent(FX_FLOAT fLineIndent) = 0;
289
290 // set the alignment of selected section, nAlignment(0:left 1:middle 2:right)
291 virtual FX_BOOL SetRichTextAlignment(int32_t nAlignment) = 0;
292
293 // set the selected range of text. 251 // set the selected range of text.
294 // if nStartChar == 0 and nEndChar == -1, select all the text. 252 // if nStartChar == 0 and nEndChar == -1, select all the text.
295 virtual void SetSel(int32_t nStartChar, int32_t nEndChar) = 0; 253 virtual void SetSel(int32_t nStartChar, int32_t nEndChar) = 0;
296 254
297 // get the selected range of text. 255 // get the selected range of text.
298 virtual void GetSel(int32_t& nStartChar, int32_t& nEndChar) const = 0; 256 virtual void GetSel(int32_t& nStartChar, int32_t& nEndChar) const = 0;
299 257
300 // select all the text. 258 // select all the text.
301 virtual void SelectAll() = 0; 259 virtual void SelectAll() = 0;
302 260
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 virtual void Paint() = 0; 364 virtual void Paint() = 0;
407 365
408 // allow to refresh screen? 366 // allow to refresh screen?
409 virtual void EnableRefresh(FX_BOOL bRefresh) = 0; 367 virtual void EnableRefresh(FX_BOOL bRefresh) = 0;
410 368
411 virtual void RefreshWordRange(const CPVT_WordRange& wr) = 0; 369 virtual void RefreshWordRange(const CPVT_WordRange& wr) = 0;
412 370
413 // allow undo/redo? 371 // allow undo/redo?
414 virtual void EnableUndo(FX_BOOL bUndo) = 0; 372 virtual void EnableUndo(FX_BOOL bUndo) = 0;
415 373
416 // allow notify?
417 virtual void EnableNotify(FX_BOOL bNotify) = 0;
418
419 // allow opr notify? 374 // allow opr notify?
420 virtual void EnableOprNotify(FX_BOOL bNotify) = 0; 375 virtual void EnableOprNotify(FX_BOOL bNotify) = 0;
421 376
422 // map word place to word index. 377 // map word place to word index.
423 virtual int32_t WordPlaceToWordIndex(const CPVT_WordPlace& place) const = 0; 378 virtual int32_t WordPlaceToWordIndex(const CPVT_WordPlace& place) const = 0;
424 // map word index to word place. 379 // map word index to word place.
425 virtual CPVT_WordPlace WordIndexToWordPlace(int32_t index) const = 0; 380 virtual CPVT_WordPlace WordIndexToWordPlace(int32_t index) const = 0;
426 381
427 // get the beginning position of a line 382 // get the beginning position of a line
428 virtual CPVT_WordPlace GetLineBeginPlace( 383 virtual CPVT_WordPlace GetLineBeginPlace(
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 static void DrawEdit(CFX_RenderDevice* pDevice, 441 static void DrawEdit(CFX_RenderDevice* pDevice,
487 CFX_Matrix* pUser2Device, 442 CFX_Matrix* pUser2Device,
488 IFX_Edit* pEdit, 443 IFX_Edit* pEdit,
489 FX_COLORREF crTextFill, 444 FX_COLORREF crTextFill,
490 FX_COLORREF crTextStroke, 445 FX_COLORREF crTextStroke,
491 const CFX_FloatRect& rcClip, 446 const CFX_FloatRect& rcClip,
492 const CFX_FloatPoint& ptOffset, 447 const CFX_FloatPoint& ptOffset,
493 const CPVT_WordRange* pRange, 448 const CPVT_WordRange* pRange,
494 CFX_SystemHandler* pSystemHandler, 449 CFX_SystemHandler* pSystemHandler,
495 void* pFFLData); 450 void* pFFLData);
496 static void DrawUnderline(CFX_RenderDevice* pDevice,
497 CFX_Matrix* pUser2Device,
498 IFX_Edit* pEdit,
499 FX_COLORREF color,
500 const CFX_FloatRect& rcClip,
501 const CFX_FloatPoint& ptOffset,
502 const CPVT_WordRange* pRange);
503 static void DrawRichEdit(CFX_RenderDevice* pDevice,
504 CFX_Matrix* pUser2Device,
505 IFX_Edit* pEdit,
506 const CFX_FloatRect& rcClip,
507 const CFX_FloatPoint& ptOffset,
508 const CPVT_WordRange* pRange);
509 static void GeneratePageObjects( 451 static void GeneratePageObjects(
510 CPDF_PageObjectHolder* pObjectHolder, 452 CPDF_PageObjectHolder* pObjectHolder,
511 IFX_Edit* pEdit, 453 IFX_Edit* pEdit,
512 const CFX_FloatPoint& ptOffset, 454 const CFX_FloatPoint& ptOffset,
513 const CPVT_WordRange* pRange, 455 const CPVT_WordRange* pRange,
514 FX_COLORREF crText, 456 FX_COLORREF crText,
515 CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray); 457 CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray);
516 static void GenerateRichPageObjects(
517 CPDF_PageObjectHolder* pObjectHolder,
518 IFX_Edit* pEdit,
519 const CFX_FloatPoint& ptOffset,
520 const CPVT_WordRange* pRange,
521 CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray);
522 static void GenerateUnderlineObjects(CPDF_PageObjectHolder* pObjectHolder,
523 IFX_Edit* pEdit,
524 const CFX_FloatPoint& ptOffset,
525 const CPVT_WordRange* pRange,
526 FX_COLORREF color);
527 458
528 protected: 459 protected:
529 virtual ~IFX_Edit() {} 460 virtual ~IFX_Edit() {}
530 }; 461 };
531 462
532 class IFX_List_Notify { 463 class IFX_List_Notify {
533 public: 464 public:
534 // set the horizontal scrollbar information. 465 // set the horizontal scrollbar information.
535 virtual void IOnSetScrollInfoX(FX_FLOAT fPlateMin, 466 virtual void IOnSetScrollInfoX(FX_FLOAT fPlateMin,
536 FX_FLOAT fPlateMax, 467 FX_FLOAT fPlateMax,
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 protected: 547 protected:
617 virtual ~IFX_List() {} 548 virtual ~IFX_List() {}
618 }; 549 };
619 550
620 CFX_ByteString GetPDFWordString(IPVT_FontMap* pFontMap, 551 CFX_ByteString GetPDFWordString(IPVT_FontMap* pFontMap,
621 int32_t nFontIndex, 552 int32_t nFontIndex,
622 uint16_t Word, 553 uint16_t Word,
623 uint16_t SubWord); 554 uint16_t SubWord);
624 555
625 #endif // FPDFSDK_FXEDIT_INCLUDE_FX_EDIT_H_ 556 #endif // FPDFSDK_FXEDIT_INCLUDE_FX_EDIT_H_
OLDNEW
« no previous file with comments | « fpdfsdk/fxedit/fxet_pageobjs.cpp ('k') | fpdfsdk/fxedit/include/fxet_edit.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698