WSF
wizard::Editor Class Reference

#include <Editor.hpp>

Inheritance diagram for wizard::Editor:

Public Slots

void DebugRunStateChange (wizard::ScriptDebugger *aDebuggerPtr, bool aIsRunning)
void TextModified ()

Public Member Functions

 Editor (QWidget *aParent, Project *aProject, TextSource *aTextSource, EditorManager *aManagerPtr)
 ~Editor () override
void Initialize ()
void PrintFile ()
void DeleteLine ()
virtual void Paste ()
void FindNextAction ()
void FindPreviousAction ()
void GoToLineAction ()
virtual void LoadSettings ()
bool ReplaceFoundText ()
void Replace (const UtTextRange &aRange, const std::string aText)
std::string GetSelectedText ()
bool SearchNext (const FindTextRequest &aFindRequest, QTextCursor *aCursorPtr=nullptr)
bool SearchNextNoWrap (const FindTextRequest &aFindRequest, QTextCursor *aCursorPtr=nullptr, int aLowerBound=-1, int aUpperBound=-1)
bool SearchPrevious (const FindTextRequest &aFindRequest)
bool GetSelectionRange (UtTextDocumentRange &aRange)
void SetSelection (const UtTextRange &aRange)
void GetCurrentPosition (size_t &aOffset, size_t &aLine, size_t &aColumn)
std::string GetLineText (const size_t &aLine)
bool TextIsSelected ()
void GetLineColumn (const size_t &aOffset, size_t &aLine, size_t &aColumn)
QPoint GetPoint (const size_t aOffset)
size_t GetOffset (const size_t aLine, const size_t aColumn)
int GetLineHeight (const int aLine)
TextSourceGetSource ()
ProjectGetProject ()
size_t GetPosition (size_t aLine, size_t aColumn)
size_t GetPosition (const QPoint &aPoint)
std::string RangeText (size_t aStart, size_t aEnd)
void RequestCloseAction ()
virtual void BeginNonUserAction ()
virtual void EndNonUserAction ()
virtual bool ExecutingNonUserAction ()
virtual void ReloadComplete ()
void RecordCurrentLocation (bool aForceNewEntry=true)
void GoToLine (size_t aLine)
void GoToRange (const UtTextRange &aRange)
void CopyLine ()
void CutLine ()
QString ToPlainText ()
virtual void UpdateStyle ()
void SetGlobalReadOnly (bool aIsGlobalReadOnly)
void Unindent ()
void Indent ()
void SetManager (EditorManager *aManagerPtr)
virtual int MarginWidth ()
int LineNumberWidth ()
void BuildTitleBarMenu (QMenu &aMenu)
bool AcceptsClose ()
QString GetShortName (bool aTrim=true) const
void mousePressEvent (QMouseEvent *aEvent) override
const EditorDockGetDock () const noexcept
EditorDockGetDock () noexcept

Static Public Member Functions

static std::string ToAscii (const QString &aText)
static void UpdateStyleFromArray (const QVector< QTextCharFormat > &aFormatChanges, const QTextBlock &firstBlk, int aLastBlockNumber, int startPos, int endPos)
static QStringList Split (const QString &aStr)
static int FindNextValidToken (const QStringList &aList, int aStart)

Protected Member Functions

void keyPressEvent (QKeyEvent *e) override
EditorManagerManager ()
bool FoldingEnabled ()
void RedrawMargin ()
QTimer & DeferUpdateTimer ()
EditorMarginMargin ()
virtual void PaintMargin (QPaintEvent *event)
virtual void OnCursorPositionChanged ()
void GetCursorPoint (int &aX, int &aY, int &aLineHeight)
virtual void OnUpdateRequest (const QRect &, int)
virtual void DocContentsChange (int aFrom, int aCharsRemoves, int aCharsAdded)
void AddCurrentLineSelection (QList< QTextEdit::ExtraSelection > &aSelections)
bool event (QEvent *e) override
void UpdateMarginGeometry ()
void focusInEvent (QFocusEvent *e) override

Static Protected Attributes

static const int cSYMBOL_MARGIN_WIDTH = 16

Friends

class EditorMargin

Constructor & Destructor Documentation

◆ Editor()

◆ ~Editor()

wizard::Editor::~Editor ( )
override

Member Function Documentation

◆ AcceptsClose()

◆ AddCurrentLineSelection()

void wizard::Editor::AddCurrentLineSelection ( QList< QTextEdit::ExtraSelection > & aSelections)
protected

◆ BeginNonUserAction()

virtual void wizard::Editor::BeginNonUserAction ( )
inlinevirtual

◆ BuildTitleBarMenu()

◆ CopyLine()

void wizard::Editor::CopyLine ( )

◆ CutLine()

void wizard::Editor::CutLine ( )

◆ DebugRunStateChange

void wizard::Editor::DebugRunStateChange ( wizard::ScriptDebugger * aDebuggerPtr,
bool aIsRunning )
slot

Referenced by Editor().

◆ DeferUpdateTimer()

QTimer & wizard::Editor::DeferUpdateTimer ( )
inlineprotected

◆ DeleteLine()

void wizard::Editor::DeleteLine ( )

Referenced by CutLine(), and EditorMargin.

◆ DocContentsChange()

void wizard::Editor::DocContentsChange ( int aFrom,
int aCharsRemoves,
int aCharsAdded )
protectedvirtual

References ToAscii().

Referenced by Editor().

◆ EndNonUserAction()

virtual void wizard::Editor::EndNonUserAction ( )
inlinevirtual

◆ event()

bool wizard::Editor::event ( QEvent * e)
overrideprotected

◆ ExecutingNonUserAction()

virtual bool wizard::Editor::ExecutingNonUserAction ( )
inlinevirtual

◆ FindNextAction()

void wizard::Editor::FindNextAction ( )

◆ FindNextValidToken()

int wizard::Editor::FindNextValidToken ( const QStringList & aList,
int aStart )
static

◆ FindPreviousAction()

void wizard::Editor::FindPreviousAction ( )

◆ focusInEvent()

void wizard::Editor::focusInEvent ( QFocusEvent * e)
overrideprotected

◆ FoldingEnabled()

bool wizard::Editor::FoldingEnabled ( )
inlineprotected

◆ GetCurrentPosition()

void wizard::Editor::GetCurrentPosition ( size_t & aOffset,
size_t & aLine,
size_t & aColumn )

Referenced by CopyLine(), CutLine(), and EditorMargin.

◆ GetCursorPoint()

void wizard::Editor::GetCursorPoint ( int & aX,
int & aY,
int & aLineHeight )
protected

References GetLineHeight().

◆ GetDock() [1/2]

const wizard::EditorDock * wizard::Editor::GetDock ( ) const
noexcept

Get the EditorDock containing this Editor

Returns
the containing EditorDock

Referenced by wizard::ProjectWorkspace::GotoFile(), and wizard::EditorManager::RequestClose().

◆ GetDock() [2/2]

wizard::EditorDock * wizard::Editor::GetDock ( )
noexcept

Get the EditorDock containing this Editor

Returns
the containing EditorDock

◆ GetLineColumn()

void wizard::Editor::GetLineColumn ( const size_t & aOffset,
size_t & aLine,
size_t & aColumn )

Referenced by EditorMargin, and ~Editor().

◆ GetLineHeight()

int wizard::Editor::GetLineHeight ( const int aLine)

Referenced by EditorMargin, and GetCursorPoint().

◆ GetLineText()

std::string wizard::Editor::GetLineText ( const size_t & aLine)

References ToAscii().

Referenced by CopyLine(), CutLine(), and EditorMargin.

◆ GetOffset()

size_t wizard::Editor::GetOffset ( const size_t aLine,
const size_t aColumn )

◆ GetPoint()

QPoint wizard::Editor::GetPoint ( const size_t aOffset)

Referenced by EditorMargin.

◆ GetPosition() [1/2]

size_t wizard::Editor::GetPosition ( const QPoint & aPoint)

◆ GetPosition() [2/2]

size_t wizard::Editor::GetPosition ( size_t aLine,
size_t aColumn )

◆ GetProject()

◆ GetSelectedText()

std::string wizard::Editor::GetSelectedText ( )

References ToAscii().

Referenced by EditorMargin.

◆ GetSelectionRange()

bool wizard::Editor::GetSelectionRange ( UtTextDocumentRange & aRange)

◆ GetShortName()

QString wizard::Editor::GetShortName ( bool aTrim = true) const

◆ GetSource()

◆ GoToLine()

void wizard::Editor::GoToLine ( size_t aLine)

◆ GoToLineAction()

void wizard::Editor::GoToLineAction ( )

References GoToLine(), and ok.

Referenced by EditorMargin.

◆ GoToRange()

void wizard::Editor::GoToRange ( const UtTextRange & aRange)

◆ Indent()

void wizard::Editor::Indent ( )

References GetSource().

◆ Initialize()

void wizard::Editor::Initialize ( )

◆ keyPressEvent()

void wizard::Editor::keyPressEvent ( QKeyEvent * e)
overrideprotected

◆ LineNumberWidth()

int wizard::Editor::LineNumberWidth ( )

◆ LoadSettings()

void wizard::Editor::LoadSettings ( )
virtual

◆ Manager()

EditorManager * wizard::Editor::Manager ( )
inlineprotected

References Manager().

Referenced by Manager().

◆ Margin()

EditorMargin * wizard::Editor::Margin ( )
inlineprotected

References EditorMargin.

◆ MarginWidth()

int wizard::Editor::MarginWidth ( )
virtual

References LineNumberWidth().

Referenced by UpdateMarginGeometry().

◆ mousePressEvent()

void wizard::Editor::mousePressEvent ( QMouseEvent * aEvent)
override

◆ OnCursorPositionChanged()

void wizard::Editor::OnCursorPositionChanged ( )
protectedvirtual

References RecordCurrentLocation(), and wizSignals.

Referenced by Editor().

◆ OnUpdateRequest()

void wizard::Editor::OnUpdateRequest ( const QRect & rect,
int dy )
protectedvirtual

Referenced by Editor().

◆ PaintMargin()

void wizard::Editor::PaintMargin ( QPaintEvent * event)
protectedvirtual

◆ Paste()

void wizard::Editor::Paste ( )
virtual

Referenced by EditorMargin.

◆ PrintFile()

void wizard::Editor::PrintFile ( )

◆ RangeText()

std::string wizard::Editor::RangeText ( size_t aStart,
size_t aEnd )

References ToAscii().

◆ RecordCurrentLocation()

void wizard::Editor::RecordCurrentLocation ( bool aForceNewEntry = true)

◆ RedrawMargin()

void wizard::Editor::RedrawMargin ( )
protected

◆ ReloadComplete()

virtual void wizard::Editor::ReloadComplete ( )
inlinevirtual

◆ Replace()

void wizard::Editor::Replace ( const UtTextRange & aRange,
const std::string aText )

References SetSelection().

Referenced by EditorMargin.

◆ ReplaceFoundText()

bool wizard::Editor::ReplaceFoundText ( )

◆ RequestCloseAction()

void wizard::Editor::RequestCloseAction ( )

◆ SearchNext()

bool wizard::Editor::SearchNext ( const FindTextRequest & aFindRequest,
QTextCursor * aCursorPtr = nullptr )

◆ SearchNextNoWrap()

bool wizard::Editor::SearchNextNoWrap ( const FindTextRequest & aFindRequest,
QTextCursor * aCursorPtr = nullptr,
int aLowerBound = -1,
int aUpperBound = -1 )

◆ SearchPrevious()

bool wizard::Editor::SearchPrevious ( const FindTextRequest & aFindRequest)

◆ SetGlobalReadOnly()

void wizard::Editor::SetGlobalReadOnly ( bool aIsGlobalReadOnly)

◆ SetManager()

void wizard::Editor::SetManager ( EditorManager * aManagerPtr)

References SetGlobalReadOnly().

◆ SetSelection()

void wizard::Editor::SetSelection ( const UtTextRange & aRange)

◆ Split()

QStringList wizard::Editor::Split ( const QString & aStr)
static

◆ TextIsSelected()

bool wizard::Editor::TextIsSelected ( )

Referenced by CopyLine(), CutLine(), and EditorMargin.

◆ TextModified

void wizard::Editor::TextModified ( )
slot

References wizSignals.

Referenced by Editor().

◆ ToAscii()

std::string wizard::Editor::ToAscii ( const QString & aText)
static

◆ ToPlainText()

QString wizard::Editor::ToPlainText ( )

◆ Unindent()

void wizard::Editor::Unindent ( )

References GetSource().

◆ UpdateMarginGeometry()

void wizard::Editor::UpdateMarginGeometry ( )
protected

References MarginWidth().

◆ UpdateStyle()

virtual void wizard::Editor::UpdateStyle ( )
inlinevirtual

Reimplemented in wizard::WsfEditor.

Referenced by wizard::ProxyUtil::InvalidateInput().

◆ UpdateStyleFromArray()

void wizard::Editor::UpdateStyleFromArray ( const QVector< QTextCharFormat > & aFormatChanges,
const QTextBlock & firstBlk,
int aLastBlockNumber,
int startPos,
int endPos )
static

◆ EditorMargin

Member Data Documentation

◆ cSYMBOL_MARGIN_WIDTH

const int wizard::Editor::cSYMBOL_MARGIN_WIDTH = 16
staticprotected

The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved