Guitar
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
MyTextEditorWidget Class Reference

#include <MyTextEditorWidget.h>

Inheritance diagram for MyTextEditorWidget:
Inheritance graph
[legend]
Collaboration diagram for MyTextEditorWidget:
Collaboration graph
[legend]

Public Member Functions

 MyTextEditorWidget (QWidget *parent=nullptr)
 
void setDocument (const QList< Document::Line > *source, MainWindow *mw, QString const &object_id, QString const &object_path)
 
TextEditorViewview ()
 
void clear ()
 
- Public Member Functions inherited from TextEditorView
void internalUpdateScrollBar ()
 
FormattedLinesfetchLines ()
 ビューに表示されている範囲のテキストを取得 More...
 
int basisCharWidth () const
 基準文字幅 More...
 
 TextEditorView (QWidget *parent=nullptr)
 
 ~TextEditorView () override
 
void setTheme (const TextEditorThemePtr &theme)
 
const TextEditorThemetheme () const
 
int lineHeight () const
 行の高さ More...
 
void updateVisibility (bool ensure_current_line_visible, bool change_col, bool auto_scroll) override
 
bool event (QEvent *event) override
 
void bindScrollBar (QScrollBar *vsb, QScrollBar *hsb)
 
void setupForLogWidget (const TextEditorThemePtr &theme)
 
RowCol mapFromPixel (const QPoint &pt)
 ビューのピクセル座標から行と桁を求める More...
 
QVariant inputMethodQuery (Qt::InputMethodQuery q) const override
 
void inputMethodEvent (QInputMethodEvent *e) override
 
void refrectScrollBar ()
 
void move (int cur_row, int cur_col, int scr_row, int scr_col, bool auto_scroll)
 
void layoutEditor () override
 
void setFocusFrameVisible (bool f)
 
void setScrollUnit (int n)
 
int scrollUnit () const
 
void setTextFont (const QFont &font)
 
void updateLayout ()
 
PointInView pointInView (int row, int col) const
 行と桁からビュー座標を求める More...
 
void setSomethingBadFlag (bool f)
 
- Public Member Functions inherited from AbstractCharacterBasedApplication
QList< FormattedLine2formatLine_ (const Document::Line &line, int tab_span, int anchor_a=-1, int anchor_b=-1) const
 
QList< FormattedLine2formatLine2_ (int row_index) const
 
int currentRow () const
 
int currentCol () const
 
void scrollUp ()
 
void scrollDown ()
 
void moveCursorOut ()
 
void moveCursorHome ()
 
void moveCursorEnd ()
 
void moveCursorUp ()
 
virtual void moveCursorDown ()
 
void moveCursorLeft ()
 
void moveCursorRight ()
 
void movePageUp ()
 
void movePageDown ()
 
void scrollToTop ()
 
 AbstractCharacterBasedApplication ()
 
virtual ~AbstractCharacterBasedApplication ()
 
TextEditorEnginePtr engine () const
 
int screenWidth () const
 
int screenHeight () const
 
void setScreenSize (int w, int h, bool update_layout)
 
void setTextEditorEngine (const TextEditorEnginePtr &e)
 
void openFile (QString const &path)
 
void saveFile (QString const &path)
 
void loadExampleFile ()
 
void pressEnter ()
 
void pressEscape ()
 
State state () const
 
bool isLineNumberVisible () const
 
void showLineNumber (bool show, int left_margin=LEFT_MARGIN)
 
void showHeader (bool f)
 
void showFooter (bool f)
 
void setAutoLayout (bool f)
 
void setDocument (const QList< Document::Line > *source)
 
void setSelectionAnchor (SelectionAnchor::Enabled enabled, bool update_anchor, bool auto_scroll)
 
void setNormalTextEditorMode (bool f)
 
void setToggleSelectionAnchorEnabled (bool f)
 
void setReadOnly (bool f)
 
bool isReadOnly () const
 
void editPaste ()
 
void editCopy ()
 
void editCut ()
 
void setWriteMode (WriteMode wm)
 
bool isInsertMode () const
 
bool isOverwriteMode () const
 
void setTerminalMode (bool f)
 
bool isTerminalMode () const
 
void moveToTop ()
 
void moveToBottom ()
 
bool isBottom () const
 
void setLineMargin (int n)
 
void write (uint32_t c, bool by_keyboard)
 
void write (char const *ptr, int len, bool by_keyboard)
 
void write (std::string const &text)
 
void write (QKeyEvent *e)
 
void setTextCodec (QTextCodec *codec)
 
void setCursorVisible (bool show)
 
bool isCursorVisible ()
 
void setModifierKeys (Qt::KeyboardModifiers keymod)
 
bool isControlModifierPressed () const
 
bool isShiftModifierPressed () const
 
void clearShiftModifier ()
 
void retrieveLastText (std::vector< char > *out, int maxlen) const
 
bool isChanged () const
 
void setChanged (bool f)
 
void logicalMoveToBottom ()
 
void logicalMoveToBottom2 ()
 
void appendBulk (const char *ptr, int len)
 
void clear ()
 

Protected Member Functions

void contextMenuEvent (QContextMenuEvent *event) override
 
- Protected Member Functions inherited from TextEditorView
void paintEvent (QPaintEvent *) override
 描画 More...
 
void mousePressEvent (QMouseEvent *event) override
 
void mouseReleaseEvent (QMouseEvent *event) override
 
void mouseMoveEvent (QMouseEvent *event) override
 
void wheelEvent (QWheelEvent *event) override
 
void resizeEvent (QResizeEvent *event) override
 
void contextMenuEvent (QContextMenuEvent *event) override
 
QFont textFont () const
 
void drawText (QPainter *painter, int px, int py, QString const &str)
 
void timerEvent (QTimerEvent *) override
 
void setCursorCol (int col) override
 桁位置を変更する More...
 
void setCursorRow (int row, bool auto_scroll, bool by_mouse) override
 行位置を変更する More...
 
- Protected Member Functions inherited from AbstractCharacterBasedApplication
int char_screen_w () const
 
int char_screen_h () const
 
std::vector< Character > * char_screen ()
 
const std::vector< Character > * char_screen () const
 
std::vector< uint8_t > * line_flags ()
 
void initEditor ()
 
void fetchCurrentLine () const
 
QByteArray fetchLine (int row) const
 現在行を取得 More...
 
void clearParsedLine ()
 
int currentColX () const
 
void setCurrentRow (int row)
 
void setCurrentCol (int col)
 
int cursorCol () const
 
int cursorRow () const
 
int editorViewportWidth () const
 
int editorViewportHeight () const
 
virtual int print (int x, int y, QString const &text, Option const &opt)
 
TextEditorContextcx ()
 
const TextEditorContextcx () const
 
Documentdocument ()
 
int documentLines () const
 
bool isSingleLineMode () const
 
void ensureCurrentLineVisible ()
 
int decideColumnScrollPos () const
 
int calcVisualWidth (Document::Line const &line) const
 
int leftMargin_ () const
 
void makeBuffer ()
 
int printArea (const TextEditorContext *cx, SelectionAnchor const *sel_a=nullptr, SelectionAnchor const *sel_b=nullptr)
 
void commitLine (const std::vector< Char > &vec)
 
void doDelete ()
 
void doBackspace ()
 
bool isDialogMode ()
 
void setDialogMode (bool f)
 
void closeDialog (bool result)
 
void setDialogOption (QString const &title, QString const &value, const DialogHandler &handler)
 
void execDialog (QString const &dialog_title, const QString &dialog_value, const DialogHandler &handler)
 
void deselect ()
 
std::vector< Char > * parseCurrentLine (std::vector< Char > *vec, int increase_hint, bool force)
 行のレイアウトを解析 More...
 
void parseLine (int row, std::vector< Char > *vec) const
 行の桁位置を求める More...
 
void setCursorPosByMouse (RowCol pos, QPoint pt)
 
void setCursorPos (int row, int col)
 
int nextTabStop (int x) const
 
int scrollBottomLimit () const
 
int scrollBottomLimit2 () const
 
bool isPaintingSuppressed () const
 
void setPaintingSuppressed (bool f)
 
void addNewLineToBottom ()
 
void appendNewLine (std::vector< Char > *vec)
 
void writeNewLine ()
 
void updateCursorPos (bool auto_scroll)
 
QString statusLine () const
 
void preparePaintScreen ()
 
void setRecentlyUsedPath (QString const &path)
 
QString recentlyUsedPath ()
 
void clearRect (int x, int y, int w, int h)
 
void paintLineNumbers (std::function< void(int, QString const &, Document::Line const *)> const &draw)
 
bool isAutoLayout () const
 
void invalidateArea (int top_y=0)
 
void savePos ()
 
void restorePos ()
 
void write_ (char const *ptr, bool by_keyboard)
 
void write_ (QString const &text, bool by_keyboard)
 
void makeColumnPosList (std::vector< int > *out)
 現在行の桁座標リストを作成する More...
 
bool isValidRowIndex (int row_index) const
 
bool hasSelection () const
 
void updateSelectionAnchor1 (bool auto_scroll)
 
void updateSelectionAnchor2 (bool auto_scroll)
 

Private Attributes

MainWindowmainwindow
 
QString object_id
 
QString object_path
 

Additional Inherited Members

- Public Types inherited from TextEditorView
enum  ScrollUnit { ScrollByCharacter = 0 }
 
- Public Types inherited from AbstractCharacterBasedApplication
enum  WriteMode { WriteMode::Insert, WriteMode::Overwrite }
 
enum  State { State::Normal, State::Exit }
 
enum  LineFlag { LineChanged = 1 }
 
- Signals inherited from TextEditorView
void moved (int cur_row, int cur_col, int scr_row, int scr_col)
 
void updateScrollBar ()
 
void idle ()
 
- Static Public Member Functions inherited from AbstractCharacterBasedApplication
static int charWidth (uint32_t c)
 
- Public Attributes inherited from TextEditorView
int scroll_unit_ = ScrollByCharacter
 
bool something_bad_flag = false
 
- Static Public Attributes inherited from AbstractCharacterBasedApplication
static const int LEFT_MARGIN = 8
 
static const int RIGHT_MARGIN = 10
 
- Protected Attributes inherited from AbstractCharacterBasedApplication
SelectionAnchor selection_start
 
SelectionAnchor selection_end
 
const int reference_char_width_ = 1
 
std::shared_ptr< TextEditorContexteditor_cx
 
std::shared_ptr< TextEditorContextdialog_cx
 

Constructor & Destructor Documentation

◆ MyTextEditorWidget()

MyTextEditorWidget::MyTextEditorWidget ( QWidget *  parent = nullptr)
Here is the call graph for this function:

Member Function Documentation

◆ clear()

void MyTextEditorWidget::clear ( )
Here is the call graph for this function:

◆ contextMenuEvent()

void MyTextEditorWidget::contextMenuEvent ( QContextMenuEvent *  event)
overrideprotected
Here is the call graph for this function:

◆ setDocument()

void MyTextEditorWidget::setDocument ( const QList< Document::Line > *  source,
MainWindow mw,
QString const &  object_id,
QString const &  object_path 
)
Here is the call graph for this function:

◆ view()

TextEditorView * MyTextEditorWidget::view ( )

Member Data Documentation

◆ mainwindow

MainWindow* MyTextEditorWidget::mainwindow
private

◆ object_id

QString MyTextEditorWidget::object_id
private

◆ object_path

QString MyTextEditorWidget::object_path
private

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