21 #ifndef __KATE_VIEW_HELPERS_H__
22 #define __KATE_VIEW_HELPERS_H__
24 #include <tdeaction.h>
25 #include <klineedit.h>
30 #include <tqscrollbar.h>
31 #include <tqintdict.h>
35 class KateViewInternal;
53 KateScrollBar(Orientation orientation,
class KateViewInternal *parent,
const char* name = 0L);
55 inline bool showMarks() {
return m_showMarks; };
56 inline void setShowMarks(
bool b) { m_showMarks = b; update(); };
59 void sliderMMBMoved(
int value);
62 virtual void mousePressEvent(TQMouseEvent* e);
63 virtual void mouseReleaseEvent(TQMouseEvent* e);
64 virtual void mouseMoveEvent (TQMouseEvent* e);
65 virtual void paintEvent(TQPaintEvent *);
66 virtual void resizeEvent(TQResizeEvent *);
67 virtual void styleChange(TQStyle &oldStyle);
68 virtual void valueChange();
69 virtual void rangeChange();
72 void sliderMaybeMoved(
int value);
77 void recomputeMarksPositions(
bool forceFullUpdate =
false);
78 void watchScrollBarSize();
80 bool m_middleMouseDown;
84 class KateViewInternal *m_viewInternal;
88 uint m_savVisibleLines;
90 TQIntDict<TQColor> m_lines;
100 KateCmdLine (KateView *view);
103 void slotReturnPressed (
const TQString& cmd );
111 void fromHistory(
bool up );
119 class KateCmdLnWhatsThis *m_help;
122 class KateIconBorder :
public TQWidget
127 KateIconBorder( KateViewInternal* internalView, TQWidget *parent );
130 virtual TQSize sizeHint()
const;
133 int lineNumberWidth()
const;
135 void setIconBorderOn(
bool enable );
136 void setLineNumbersOn(
bool enable );
137 void setDynWrapIndicators(
int state );
138 int dynWrapIndicators()
const {
return m_dynWrapIndicators; }
139 bool dynWrapIndicatorsOn()
const {
return m_dynWrapIndicatorsOn; }
140 void setFoldingMarkersOn(
bool enable );
141 void toggleIconBorder() { setIconBorderOn( !iconBorderOn() ); }
142 void toggleLineNumbers() { setLineNumbersOn( !lineNumbersOn() ); }
143 void toggleFoldingMarkers() { setFoldingMarkersOn( !foldingMarkersOn() ); }
144 bool iconBorderOn()
const {
return m_iconBorderOn; }
145 bool lineNumbersOn()
const {
return m_lineNumbersOn; }
146 bool foldingMarkersOn()
const {
return m_foldingMarkersOn; }
148 enum BorderArea { None, LineNumbers, IconBorder, FoldingMarkers };
149 BorderArea positionToArea(
const TQPoint& )
const;
152 void toggleRegionVisibility(
unsigned int );
155 void paintEvent( TQPaintEvent* );
156 void paintBorder (
int x,
int y,
int width,
int height);
158 void mousePressEvent( TQMouseEvent* );
159 void mouseMoveEvent( TQMouseEvent* );
160 void mouseReleaseEvent( TQMouseEvent* );
161 void mouseDoubleClickEvent( TQMouseEvent* );
163 void showMarkMenu( uint line,
const TQPoint& pos );
167 KateViewInternal *m_viewInternal;
169 bool m_iconBorderOn:1;
170 bool m_lineNumbersOn:1;
171 bool m_foldingMarkersOn:1;
172 bool m_dynWrapIndicatorsOn:1;
173 int m_dynWrapIndicators;
175 uint m_lastClickedLine;
181 mutable TQPixmap m_arrow;
182 mutable TQColor m_oldBackgroundColor;
190 KateViewEncodingAction(KateDocument *_doc, KateView *_view,
const TQString& text, TQObject* parent = 0,
const char* name = 0);
192 ~KateViewEncodingAction(){;};
199 void slotAboutToShow();
202 void setMode (
int mode);
virtual void focusInEvent(TQFocusEvent *)
virtual void keyPressEvent(TQKeyEvent *)
Kate namespace All classes in this namespace must stay BC during one major release series (e....