LibreOffice Module vcl (master)  1
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
TextView Class Referencefinal

#include <textview.hxx>

Inheritance diagram for TextView:
[legend]
Collaboration diagram for TextView:
[legend]

Public Member Functions

 TextView (ExtTextEngine *pEng, vcl::Window *pWindow)
 
virtual ~TextView () override
 
TextEngineGetTextEngine () const
 
vcl::WindowGetWindow () const
 
void Invalidate ()
 
void Scroll (long nHorzScroll, long nVertScroll)
 
void ShowCursor (bool bGotoCursor=true, bool bForceVisCursor=true)
 
void HideCursor ()
 
void EnableCursor (bool bEnable)
 
bool IsCursorEnabled () const
 
const TextSelectionGetSelection () const
 
TextSelectionGetSelection ()
 
void SetSelection (const TextSelection &rNewSel)
 
void SetSelection (const TextSelection &rNewSel, bool bGotoCursor)
 
bool HasSelection () const
 
OUString GetSelected ()
 
OUString GetSelected (LineEnd aSeparator)
 
void DeleteSelected ()
 
void InsertText (const OUString &rNew)
 
bool KeyInput (const KeyEvent &rKeyEvent)
 
void Paint (vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
 
void MouseButtonUp (const MouseEvent &rMouseEvent)
 
void MouseButtonDown (const MouseEvent &rMouseEvent)
 
void MouseMove (const MouseEvent &rMouseEvent)
 
void Command (const CommandEvent &rCEvt)
 
void Cut ()
 
void Copy ()
 
void Paste ()
 
void Copy (css::uno::Reference< css::datatransfer::clipboard::XClipboard > const &rxClipboard)
 
void Paste (css::uno::Reference< css::datatransfer::clipboard::XClipboard > const &rxClipboard)
 
void Undo ()
 
void Redo ()
 
void Read (SvStream &rInput)
 
void SetStartDocPos (const Point &rPos)
 
const PointGetStartDocPos () const
 
Point GetDocPos (const Point &rWindowPos) const
 
Point GetWindowPos (const Point &rDocPos) const
 
void SetInsertMode (bool bInsert)
 
bool IsInsertMode () const
 
void SetAutoIndentMode (bool bAutoIndent)
 
void SetReadOnly (bool bReadOnly)
 
bool IsReadOnly () const
 
void SetAutoScroll (bool bAutoScroll)
 
bool IsAutoScroll () const
 
void SetCursorAtPoint (const Point &rPointPixel)
 
bool IsSelectionAtPoint (const Point &rPointPixel)
 
void SetPaintSelection (bool bPaint)
 
TextPaM PageUp (const TextPaM &rPaM)
 
TextPaM PageDown (const TextPaM &rPaM)
 
TextPaM CursorUp (const TextPaM &rPaM)
 
TextPaM CursorDown (const TextPaM &rPaM)
 
TextPaM CursorLeft (const TextPaM &rPaM, sal_uInt16 nCharacterIteratorMode)
 
TextPaM CursorRight (const TextPaM &rPaM, sal_uInt16 nCharacterIteratorMode)
 
TextPaM CursorWordLeft (const TextPaM &rPaM)
 
TextPaM CursorWordRight (const TextPaM &rPaM)
 
TextPaM CursorStartOfLine (const TextPaM &rPaM)
 
TextPaM CursorEndOfLine (const TextPaM &rPaM)
 
TextPaM CursorEndOfParagraph (const TextPaM &rPaM)
 
TextPaM CursorEndOfDoc ()
 
sal_Int32 GetLineNumberOfCursorInSelection () const
 Returns the number in paragraph of the line in which the cursor is blinking if enabled, -1 otherwise. More...
 
void MatchGroup ()
 
void CenterPaM (const TextPaM &rPaM)
 
bool Search (const i18nutil::SearchOptions &rSearchOptions, bool bForward)
 
sal_uInt16 Replace (const i18nutil::SearchOptions &rSearchOptions, bool bAll, bool bForward)
 
bool IndentBlock ()
 
bool UnindentBlock ()
 
- Public Member Functions inherited from vcl::unohelper::DragAndDropClient
virtual ~DragAndDropClient () COVERITY_NOEXCEPT_FALSE
 

Static Public Member Functions

static TextPaM CursorStartOfParagraph (const TextPaM &rPaM)
 
static TextPaM CursorStartOfDoc ()
 

Private Member Functions

 TextView (const TextView &)=delete
 
TextViewoperator= (const TextView &)=delete
 
bool ImpIndentBlock (bool bRight)
 
void ShowSelection ()
 
void HideSelection ()
 
void ShowSelection (const TextSelection &rSel)
 
void ImpShowHideSelection (const TextSelection *pRange=nullptr)
 
TextSelection const & ImpMoveCursor (const KeyEvent &rKeyEvent)
 
TextPaM ImpDelete (sal_uInt8 nMode, sal_uInt8 nDelMode)
 
bool IsInSelection (const TextPaM &rPaM)
 
void ImpPaint (vcl::RenderContext &rRenderContext, const Point &rStartPos, tools::Rectangle const *pPaintArea, TextSelection const *pSelection)
 
void ImpPaint (vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
 
void ImpShowCursor (bool bGotoCursor, bool bForceVisCursor, bool bEndKey)
 
void ImpHighlight (const TextSelection &rSel)
 
void ImpSetSelection (const TextSelection &rSelection)
 
Point ImpGetOutputStartPos (const Point &rStartDocPos) const
 
void ImpHideDDCursor ()
 
void ImpShowDDCursor ()
 
bool ImplTruncateNewText (OUString &rNewText) const
 
bool ImplCheckTextLen (const OUString &rNewText)
 
virtual void dragGestureRecognized (const css::datatransfer::dnd::DragGestureEvent &dge) override
 
virtual void dragDropEnd (const css::datatransfer::dnd::DragSourceDropEvent &dsde) override
 
virtual void drop (const css::datatransfer::dnd::DropTargetDropEvent &dtde) override
 
virtual void dragEnter (const css::datatransfer::dnd::DropTargetDragEnterEvent &dtdee) override
 
virtual void dragExit (const css::datatransfer::dnd::DropTargetEvent &dte) override
 
virtual void dragOver (const css::datatransfer::dnd::DropTargetDragEvent &dtde) override
 

Private Attributes

std::unique_ptr< ImpTextViewmpImpl
 

Friends

class TextEngine
 
class TextUndo
 
class TextUndoManager
 
class TextSelFunctionSet
 

Detailed Description

Definition at line 77 of file textview.hxx.

Constructor & Destructor Documentation

TextView::TextView ( const TextView )
privatedelete
TextView::TextView ( ExtTextEngine pEng,
vcl::Window pWindow 
)
TextView::~TextView ( )
overridevirtual

Definition at line 197 of file textview.cxx.

References mpImpl.

Member Function Documentation

void TextView::CenterPaM ( const TextPaM rPaM)

Definition at line 2121 of file textview.cxx.

References Point::getY(), Size::Height(), mpImpl, Scroll(), and tools::Rectangle::TopLeft().

Referenced by Search().

void TextView::Command ( const CommandEvent rCEvt)
void TextView::Copy ( )

Definition at line 996 of file textview.cxx.

References GetWindow().

Referenced by ImpVclMEdit::Copy(), Cut(), KeyInput(), and MouseButtonUp().

void TextView::Copy ( css::uno::Reference< css::datatransfer::clipboard::XClipboard > const &  rxClipboard)

Definition at line 974 of file textview.cxx.

References GetSelected().

TextPaM TextView::CursorDown ( const TextPaM rPaM)
TextPaM TextView::CursorEndOfDoc ( )

Definition at line 1485 of file textview.cxx.

References TextNode::GetText(), and mpImpl.

Referenced by ImpMoveCursor().

TextPaM TextView::CursorEndOfLine ( const TextPaM rPaM)
TextPaM TextView::CursorEndOfParagraph ( const TextPaM rPaM)

Definition at line 1471 of file textview.cxx.

References TextPaM::GetIndex(), TextPaM::GetPara(), TextNode::GetText(), and mpImpl.

Referenced by ImpMoveCursor().

TextPaM TextView::CursorLeft ( const TextPaM rPaM,
sal_uInt16  nCharacterIteratorMode 
)

Definition at line 1208 of file textview.cxx.

References TextPaM::GetIndex(), TextPaM::GetPara(), TextNode::GetText(), mpImpl, and nCount.

Referenced by ImpDelete(), and ImpMoveCursor().

TextPaM TextView::CursorRight ( const TextPaM rPaM,
sal_uInt16  nCharacterIteratorMode 
)
TextPaM TextView::CursorStartOfDoc ( )
static

Definition at line 1479 of file textview.cxx.

Referenced by ImpMoveCursor().

TextPaM TextView::CursorStartOfLine ( const TextPaM rPaM)
TextPaM TextView::CursorStartOfParagraph ( const TextPaM rPaM)
static

Definition at line 1464 of file textview.cxx.

References TextPaM::GetIndex().

Referenced by ImpMoveCursor().

TextPaM TextView::CursorUp ( const TextPaM rPaM)
TextPaM TextView::CursorWordLeft ( const TextPaM rPaM)

Definition at line 1248 of file textview.cxx.

References TextPaM::GetIndex(), TextPaM::GetPara(), TextNode::GetText(), and mpImpl.

Referenced by ImpMoveCursor().

TextPaM TextView::CursorWordRight ( const TextPaM rPaM)

Definition at line 1270 of file textview.cxx.

References TextPaM::GetIndex(), TextPaM::GetPara(), TextNode::GetText(), and mpImpl.

Referenced by ImpMoveCursor().

void TextView::Cut ( )

Definition at line 966 of file textview.cxx.

References Copy(), DeleteSelected(), and mpImpl.

Referenced by ImpVclMEdit::Cut(), and KeyInput().

void TextView::DeleteSelected ( )

Definition at line 245 of file textview.cxx.

References ImpSetSelection(), mpImpl, and ShowCursor().

Referenced by Command(), and Cut().

void TextView::dragDropEnd ( const css::datatransfer::dnd::DragSourceDropEvent &  dsde)
overrideprivatevirtual
Exceptions
css::uno::RuntimeException

Reimplemented from vcl::unohelper::DragAndDropClient.

Definition at line 1824 of file textview.cxx.

References ImpHideDDCursor(), and mpImpl.

void TextView::dragEnter ( const css::datatransfer::dnd::DropTargetDragEnterEvent &  dtdee)
overrideprivatevirtual
Exceptions
css::uno::RuntimeException

Reimplemented from vcl::unohelper::DragAndDropClient.

Definition at line 1926 of file textview.cxx.

void TextView::dragExit ( const css::datatransfer::dnd::DropTargetEvent &  dte)
overrideprivatevirtual
Exceptions
css::uno::RuntimeException

Reimplemented from vcl::unohelper::DragAndDropClient.

Definition at line 1930 of file textview.cxx.

References ImpHideDDCursor().

void TextView::dragGestureRecognized ( const css::datatransfer::dnd::DragGestureEvent &  dge)
overrideprivatevirtual
Exceptions
css::uno::RuntimeException

Reimplemented from vcl::unohelper::DragAndDropClient.

Definition at line 1802 of file textview.cxx.

References GetSelected(), IsReadOnly(), mpImpl, and SAL_WARN_IF.

void TextView::dragOver ( const css::datatransfer::dnd::DropTargetDragEvent &  dtde)
overrideprivatevirtual
Exceptions
css::uno::RuntimeException

Reimplemented from vcl::unohelper::DragAndDropClient.

Definition at line 1936 of file textview.cxx.

References GetDocPos(), ImpHideDDCursor(), ImpShowDDCursor(), IsInSelection(), IsReadOnly(), and mpImpl.

void TextView::drop ( const css::datatransfer::dnd::DropTargetDropEvent &  dtde)
overrideprivatevirtual
void TextView::EnableCursor ( bool  bEnable)

Definition at line 2085 of file textview.cxx.

References mpImpl.

Referenced by VclMultiLineEdit::EnableCursor().

Point TextView::GetDocPos ( const Point rWindowPos) const
sal_Int32 TextView::GetLineNumberOfCursorInSelection ( ) const

Returns the number in paragraph of the line in which the cursor is blinking if enabled, -1 otherwise.

Definition at line 2019 of file textview.cxx.

References TextSelection::GetEnd(), TextPaM::GetIndex(), TEParaPortion::GetLineNumber(), TextPaM::GetPara(), GetSelection(), and mpImpl.

OUString TextView::GetSelected ( )

Definition at line 1051 of file textview.cxx.

References GetSystemLineEnd().

Referenced by Copy(), dragGestureRecognized(), and ImpVclMEdit::GetSelected().

OUString TextView::GetSelected ( LineEnd  aSeparator)

Definition at line 1056 of file textview.cxx.

References mpImpl.

const TextSelection & TextView::GetSelection ( ) const
TextSelection & TextView::GetSelection ( )

Definition at line 240 of file textview.cxx.

References mpImpl.

const Point & TextView::GetStartDocPos ( ) const
TextEngine * TextView::GetTextEngine ( ) const

Definition at line 2081 of file textview.cxx.

References mpImpl.

Referenced by ImpIndentBlock(), MatchGroup(), Replace(), and Search().

vcl::Window * TextView::GetWindow ( ) const

Definition at line 2083 of file textview.cxx.

References mpImpl.

Referenced by Command(), Copy(), KeyInput(), MouseButtonUp(), Paste(), TextEngine::SetFont(), and SetReadOnly().

Point TextView::GetWindowPos ( const Point rDocPos) const
bool TextView::HasSelection ( ) const

Definition at line 2101 of file textview.cxx.

References mpImpl.

void TextView::HideCursor ( )

Definition at line 908 of file textview.cxx.

References mpImpl.

Referenced by Command(), TextEngine::RemoveView(), and SetReadOnly().

void TextView::HideSelection ( )
private
TextPaM TextView::ImpDelete ( sal_uInt8  nMode,
sal_uInt8  nDelMode 
)
private
Point TextView::ImpGetOutputStartPos ( const Point rStartDocPos) const
private

Definition at line 1966 of file textview.cxx.

References mpImpl, Size::Width(), Point::X(), and Point::Y().

Referenced by ImpPaint().

void TextView::ImpHideDDCursor ( )
private

Definition at line 1719 of file textview.cxx.

References mpImpl.

Referenced by dragDropEnd(), dragExit(), dragOver(), and drop().

void TextView::ImpHighlight ( const TextSelection rSel)
private
bool TextView::ImpIndentBlock ( bool  bRight)
private
bool TextView::ImplCheckTextLen ( const OUString &  rNewText)
private

Definition at line 1785 of file textview.cxx.

References mpImpl, and n.

Referenced by drop(), and KeyInput().

bool TextView::ImplTruncateNewText ( OUString &  rNewText) const
private

Definition at line 1759 of file textview.cxx.

References mpImpl.

Referenced by Paste().

TextSelection const & TextView::ImpMoveCursor ( const KeyEvent rKeyEvent)
private
void TextView::ImpPaint ( vcl::RenderContext rRenderContext,
const Point rStartPos,
tools::Rectangle const *  pPaintArea,
TextSelection const *  pSelection 
)
private
void TextView::ImpPaint ( vcl::RenderContext rRenderContext,
const tools::Rectangle rRect 
)
private

Definition at line 288 of file textview.cxx.

References ImpGetOutputStartPos(), ImpHighlight(), ImpPaint(), and mpImpl.

void TextView::ImpSetSelection ( const TextSelection rSelection)
private
void TextView::ImpShowCursor ( bool  bGotoCursor,
bool  bForceVisCursor,
bool  bEndKey 
)
private
void TextView::ImpShowDDCursor ( )
private
void TextView::ImpShowHideSelection ( const TextSelection pRange = nullptr)
private
bool TextView::IndentBlock ( )

Definition at line 2283 of file textview.cxx.

References ImpIndentBlock().

void TextView::InsertText ( const OUString &  rNew)

Definition at line 1195 of file textview.cxx.

References ImpSetSelection(), and mpImpl.

Referenced by ImpVclMEdit::InsertText(), Paste(), and Replace().

void TextView::Invalidate ( )

Definition at line 209 of file textview.cxx.

References mpImpl.

Referenced by ImpShowHideSelection().

bool TextView::IsAutoScroll ( ) const

Definition at line 2099 of file textview.cxx.

References mpImpl.

Referenced by TextEngine::UpdateViews().

bool TextView::IsCursorEnabled ( ) const

Definition at line 2087 of file textview.cxx.

References mpImpl.

Referenced by VclMultiLineEdit::PreNotify().

bool TextView::IsInSelection ( const TextPaM rPaM)
private
bool TextView::IsInsertMode ( ) const

Definition at line 2103 of file textview.cxx.

References mpImpl.

Referenced by Command(), ImpShowCursor(), and KeyInput().

bool TextView::IsReadOnly ( ) const
bool TextView::IsSelectionAtPoint ( const Point rPointPixel)

Definition at line 1683 of file textview.cxx.

References GetDocPos(), IsInSelection(), and mpImpl.

Referenced by TextSelFunctionSet::IsSelectionAtPoint(), and MouseButtonDown().

bool TextView::KeyInput ( const KeyEvent rKeyEvent)
void TextView::MatchGroup ( )
void TextView::MouseButtonDown ( const MouseEvent rMouseEvent)
void TextView::MouseButtonUp ( const MouseEvent rMouseEvent)
void TextView::MouseMove ( const MouseEvent rMouseEvent)

Definition at line 761 of file textview.cxx.

References mpImpl, and TRAVEL_X_DONTKNOW.

TextView& TextView::operator= ( const TextView )
privatedelete
TextPaM TextView::PageDown ( const TextPaM rPaM)
TextPaM TextView::PageUp ( const TextPaM rPaM)
void TextView::Paint ( vcl::RenderContext rRenderContext,
const tools::Rectangle rRect 
)

Definition at line 283 of file textview.cxx.

References ImpPaint().

void TextView::Paste ( )

Definition at line 1045 of file textview.cxx.

References GetWindow().

Referenced by KeyInput(), MouseButtonUp(), and ImpVclMEdit::Paste().

void TextView::Paste ( css::uno::Reference< css::datatransfer::clipboard::XClipboard > const &  rxClipboard)
void TextView::Read ( SvStream rInput)

Definition at line 1753 of file textview.cxx.

References mpImpl, and ShowCursor().

void TextView::Redo ( )

Definition at line 960 of file textview.cxx.

References mpImpl.

Referenced by KeyInput().

sal_uInt16 TextView::Replace ( const i18nutil::SearchOptions rSearchOptions,
bool  bAll,
bool  bForward 
)
void TextView::Scroll ( long  nHorzScroll,
long  nVertScroll 
)
bool TextView::Search ( const i18nutil::SearchOptions rSearchOptions,
bool  bForward 
)
void TextView::SetAutoIndentMode ( bool  bAutoIndent)

Definition at line 2093 of file textview.cxx.

References mpImpl.

void TextView::SetAutoScroll ( bool  bAutoScroll)

Definition at line 2097 of file textview.cxx.

References mpImpl.

void TextView::SetCursorAtPoint ( const Point rPointPixel)
void TextView::SetInsertMode ( bool  bInsert)

Definition at line 1061 of file textview.cxx.

References mpImpl, and ShowCursor().

Referenced by Command(), and KeyInput().

void TextView::SetPaintSelection ( bool  bPaint)

Definition at line 1744 of file textview.cxx.

References mpImpl, and ShowSelection().

void TextView::SetReadOnly ( bool  bReadOnly)
void TextView::SetSelection ( const TextSelection rNewSel)
void TextView::SetSelection ( const TextSelection rNewSel,
bool  bGotoCursor 
)

Definition at line 214 of file textview.cxx.

References HideSelection(), ImpSetSelection(), mpImpl, ShowCursor(), and ShowSelection().

void TextView::SetStartDocPos ( const Point rPos)

Definition at line 2089 of file textview.cxx.

References mpImpl.

void TextView::ShowCursor ( bool  bGotoCursor = true,
bool  bForceVisCursor = true 
)
void TextView::ShowSelection ( )
private
void TextView::ShowSelection ( const TextSelection rSel)
private

Definition at line 408 of file textview.cxx.

References ImpShowHideSelection().

void TextView::Undo ( )

Definition at line 954 of file textview.cxx.

References mpImpl.

Referenced by KeyInput().

bool TextView::UnindentBlock ( )

Definition at line 2288 of file textview.cxx.

References ImpIndentBlock().

Friends And Related Function Documentation

friend class TextEngine
friend

Definition at line 79 of file textview.hxx.

friend class TextSelFunctionSet
friend

Definition at line 82 of file textview.hxx.

friend class TextUndo
friend

Definition at line 80 of file textview.hxx.

friend class TextUndoManager
friend

Definition at line 81 of file textview.hxx.

Member Data Documentation

std::unique_ptr<ImpTextView> TextView::mpImpl
private

The documentation for this class was generated from the following files: