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

#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 ()
 
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 200 of file textview.cxx.

References mpImpl.

Member Function Documentation

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

Definition at line 1039 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 1017 of file textview.cxx.

References GetSelected().

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

Definition at line 1528 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 1514 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 1251 of file textview.cxx.

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

Referenced by ImpDelete(), and ImpMoveCursor().

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

Definition at line 1522 of file textview.cxx.

Referenced by ImpMoveCursor().

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

Definition at line 1507 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 1291 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 1313 of file textview.cxx.

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

Referenced by ImpMoveCursor().

void TextView::Cut ( )

Definition at line 1009 of file textview.cxx.

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

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

void TextView::DeleteSelected ( )

Definition at line 248 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 1867 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 1978 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 1982 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 1845 of file textview.cxx.

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

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

Definition at line 2147 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 2081 of file textview.cxx.

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

OUString TextView::GetSelected ( )

Definition at line 1094 of file textview.cxx.

References GetSystemLineEnd().

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

OUString TextView::GetSelected ( LineEnd  aSeparator)

Definition at line 1099 of file textview.cxx.

References mpImpl.

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

Definition at line 243 of file textview.cxx.

References mpImpl.

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

Definition at line 2143 of file textview.cxx.

References mpImpl.

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

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

Definition at line 2145 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 2163 of file textview.cxx.

References mpImpl.

void TextView::HideCursor ( )

Definition at line 951 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 2028 of file textview.cxx.

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

Referenced by ImpPaint().

void TextView::ImpHideDDCursor ( )
private

Definition at line 1762 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 1828 of file textview.cxx.

References mpImpl.

Referenced by drop(), and KeyInput().

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

Definition at line 1802 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 291 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 2326 of file textview.cxx.

References ImpIndentBlock().

void TextView::InsertText ( const OUString &  rNew)

Definition at line 1238 of file textview.cxx.

References ImpSetSelection(), and mpImpl.

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

void TextView::Invalidate ( )

Definition at line 212 of file textview.cxx.

References mpImpl.

Referenced by ImpShowHideSelection().

bool TextView::IsAutoScroll ( ) const

Definition at line 2161 of file textview.cxx.

References mpImpl.

Referenced by TextEngine::UpdateViews().

bool TextView::IsCursorEnabled ( ) const

Definition at line 2149 of file textview.cxx.

References mpImpl.

Referenced by VclMultiLineEdit::PreNotify().

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

Definition at line 2165 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 1726 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 804 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 286 of file textview.cxx.

References ImpPaint().

void TextView::Paste ( )

Definition at line 1088 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 1796 of file textview.cxx.

References mpImpl, and ShowCursor().

void TextView::Redo ( )

Definition at line 1003 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 2155 of file textview.cxx.

References mpImpl.

void TextView::SetAutoScroll ( bool  bAutoScroll)

Definition at line 2159 of file textview.cxx.

References mpImpl.

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

Definition at line 1104 of file textview.cxx.

References mpImpl, and ShowCursor().

Referenced by Command(), and KeyInput().

void TextView::SetPaintSelection ( bool  bPaint)

Definition at line 1787 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 217 of file textview.cxx.

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

void TextView::SetStartDocPos ( const Point rPos)

Definition at line 2151 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 411 of file textview.cxx.

References ImpShowHideSelection().

void TextView::Undo ( )

Definition at line 997 of file textview.cxx.

References mpImpl.

Referenced by KeyInput().

bool TextView::UnindentBlock ( )

Definition at line 2331 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: