itom
Loading...
Searching...
No Matches
ito::SymbolMatcherMode Class Reference
Inheritance diagram for ito::SymbolMatcherMode:
ito::Mode

Public Types

enum  Symbols { Paren = 0 , Square = 2 , Brace = 4 }
 
enum  CharType { Open = 0 , Close = 1 }
 
- Public Types inherited from ito::Mode
typedef QSharedPointer< ModePtr
 

Public Member Functions

 SymbolMatcherMode (const QString &description="", QObject *parent=NULL)
 
QBrush matchBackground () const
 
void setMatchBackground (const QBrush &value)
 
QColor matchForeground () const
 
void setMatchForeground (const QColor &value)
 
QBrush unmatchBackground () const
 
void setUnmatchBackground (const QBrush &value)
 
QColor unmatchForeground () const
 
void setUnmatchForeground (const QColor &value)
 
virtual void onStateChanged (bool state)
 
QPoint symbolPos (const QTextCursor &cursor, CharType charType=Open, Symbols symbolType=Paren)
 return value is line (x) and column (y)
 
- Public Member Functions inherited from ito::Mode
 Mode (const Mode &copy)
 
 Mode (const QString &name, const QString &description="")
 
bool operator== (const Mode &other) const
 
virtual void onInstall (CodeEditor *editor)
 
virtual void onUninstall ()
 
QString name () const
 
bool enabled () const
 
void setEnabled (bool enabled)
 
CodeEditoreditor () const
 
bool onClose () const
 
virtual QList< QAction * > actions () const
 

Static Public Attributes

static const QByteArray chars = "()[]{}"
 

Protected Member Functions

QTextCursor createDecoration (int pos, bool match=true)
 
void clearDecorations ()
 
void match (Symbols symbol, QList< Utils::ParenthesisInfo > &data, int cursorPos)
 
bool matchLeft (SymbolMatcherMode::Symbols symbol, const QTextBlock &currentBlock, int i, int cpt)
 
bool matchRight (SymbolMatcherMode::Symbols symbol, const QTextBlock &currentBlock, int i, int nbRightParen)
 
void refreshDecorations ()
 

Protected Attributes

QBrush m_matchBackground
 
QColor m_matchForeground
 
QBrush m_unmatchBackground
 
QColor m_unmatchForeground
 
QList< TextDecoration::Ptr > m_decorations
 

Private Slots

void doSymbolsMatching ()
 

Member Function Documentation

◆ onStateChanged()

void ito::SymbolMatcherMode::onStateChanged ( bool state)
virtual

Reimplemented from ito::Mode.


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