73 FoldingPanel(
bool highlightCaretScope =
false,
const QString &description =
"", QWidget *parent = NULL);
76 bool nativeLook()
const;
77 void setNativeLook(
bool native);
79 QStringList customIndicatorIcons()
const;
80 void setCustomIndicatorIcons(
const QStringList &icons);
82 QColor customFoldRegionBackground()
const;
83 void setCustomFoldRegionBackground(
const QColor &color);
85 bool highlightCaretScope()
const;
86 void setHighlightCaretScope(
bool value);
89 virtual void onStateChanged(
bool state);
90 virtual QSize sizeHint()
const;
94 void toggleFold(
bool topLevelOnly);
96 void toggleFoldTrigger(
const QTextBlock &block,
bool refreshEditor =
true);
98 void refreshDecorations(
bool force =
false);
101 void triggerStateChanged(QTextBlock,
bool);
102 void collapseAllTriggered();
103 void expandAllTriggered();
106 virtual void paintEvent(QPaintEvent *e);
107 virtual void mouseMoveEvent(QMouseEvent *e);
108 virtual void mousePressEvent(QMouseEvent *e);
109 virtual void leaveEvent(QEvent *e);
111 void drawFoldRegionBackground(
const QTextBlock &block, QPainter &painter)
const;
112 void drawRect(
const QRectF &rect, QPainter &painter)
const;
113 void drawFoldIndicator(
int top,
bool mouseOver,
bool collapsed, QPainter *painter)
const;
114 void addFoldDecoration(
const QTextBlock &block,
const FoldScope ®ion);
115 void addScopeDecorations(
const QTextBlock &block,
int start,
int end);
116 QColor getScopeHighlightColor()
const;
117 void clearScopeDecos();
119 void addScopeDeco(
int start,
int end,
int parentStart,
int parentEnd,
const QColor &baseColor,
int factor);
120 void refreshEditorAndScrollbars();
123 static QColor getSystemBckColor();
124 static void showPreviousBlankLines(
const QTextBlock &block);
125 static QTextBlock findParentScope(
const QTextBlock &block);
127 void highlightSurroundingScopes(QTextBlock block);
130 void clearBlockDeco();
131 void highlightCaretScopeSlot();
132 void onFoldDecoClicked(TextDecoration::Ptr deco);
133 void onKeyPressed(QKeyEvent *e);
137 QStringList m_customIndicators;
139 QColor m_customColor;
140 bool m_highlightCaret;
141 bool m_highlightCaretScope;
144 QList<TextDecoration::Ptr> m_scopeDecos;
145 QList<TextDecoration::Ptr> m_blockDecos;
148 QTextCursor m_prevCursor;