• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kate
 

kate

  • kate
  • part
kateviewhelpers.h
1/* This file is part of the KDE libraries
2 Copyright (C) 2002 John Firebaugh <jfirebaugh@kde.org>
3 Copyright (C) 2001 Anders Lund <anders@alweb.dk>
4 Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License version 2 as published by the Free Software Foundation.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#ifndef __KATE_VIEW_HELPERS_H__
22#define __KATE_VIEW_HELPERS_H__
23
24#include <tdeaction.h>
25#include <klineedit.h>
26
27#include <tqwidget.h>
28#include <tqpixmap.h>
29#include <tqcolor.h>
30#include <tqscrollbar.h>
31#include <tqintdict.h>
32
33class KateDocument;
34class KateView;
35class KateViewInternal;
36
37namespace Kate {
38 class Command;
39}
40
48class KateScrollBar : public TQScrollBar
49{
50 TQ_OBJECT
51
52 public:
53 KateScrollBar(Orientation orientation, class KateViewInternal *parent, const char* name = 0L);
54
55 inline bool showMarks() { return m_showMarks; };
56 inline void setShowMarks(bool b) { m_showMarks = b; update(); };
57
58 signals:
59 void sliderMMBMoved(int value);
60
61 protected:
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();
70
71 protected slots:
72 void sliderMaybeMoved(int value);
73 void marksChanged();
74
75 private:
76 void redrawMarks();
77 void recomputeMarksPositions(bool forceFullUpdate = false);
78 void watchScrollBarSize();
79
80 bool m_middleMouseDown;
81
82 KateView *m_view;
83 KateDocument *m_doc;
84 class KateViewInternal *m_viewInternal;
85
86 int m_topMargin;
87 int m_bottomMargin;
88 uint m_savVisibleLines;
89
90 TQIntDict<TQColor> m_lines;
91
92 bool m_showMarks;
93};
94
95class KateCmdLine : public KLineEdit
96{
97 TQ_OBJECT
98
99 public:
100 KateCmdLine (KateView *view);
101
102 private slots:
103 void slotReturnPressed ( const TQString& cmd );
104 void hideMe ();
105
106 protected:
107 void focusInEvent ( TQFocusEvent *ev );
108 void keyPressEvent( TQKeyEvent *ev );
109
110 private:
111 void fromHistory( bool up );
112 KateView *m_view;
113 bool m_msgMode;
114 TQString m_oldText;
115 uint m_histpos;
116 uint m_cmdend;
117 Kate::Command *m_command;
118 class TDECompletion *m_oldCompletionObject;
119 class KateCmdLnWhatsThis *m_help;
120};
121
122class KateIconBorder : public TQWidget
123{
124 TQ_OBJECT
125
126 public:
127 KateIconBorder( KateViewInternal* internalView, TQWidget *parent );
128
129 // VERY IMPORTANT ;)
130 virtual TQSize sizeHint() const;
131
132 void updateFont();
133 int lineNumberWidth() const;
134
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; }
147
148 enum BorderArea { None, LineNumbers, IconBorder, FoldingMarkers };
149 BorderArea positionToArea( const TQPoint& ) const;
150
151 signals:
152 void toggleRegionVisibility( unsigned int );
153
154 private:
155 void paintEvent( TQPaintEvent* );
156 void paintBorder (int x, int y, int width, int height);
157
158 void mousePressEvent( TQMouseEvent* );
159 void mouseMoveEvent( TQMouseEvent* );
160 void mouseReleaseEvent( TQMouseEvent* );
161 void mouseDoubleClickEvent( TQMouseEvent* );
162
163 void showMarkMenu( uint line, const TQPoint& pos );
164
165 KateView *m_view;
166 KateDocument *m_doc;
167 KateViewInternal *m_viewInternal;
168
169 bool m_iconBorderOn:1;
170 bool m_lineNumbersOn:1;
171 bool m_foldingMarkersOn:1;
172 bool m_dynWrapIndicatorsOn:1;
173 int m_dynWrapIndicators;
174
175 uint m_lastClickedLine;
176
177 int m_cachedLNWidth;
178
179 int m_maxCharWidth;
180
181 mutable TQPixmap m_arrow;
182 mutable TQColor m_oldBackgroundColor;
183};
184
185class KateViewEncodingAction : public TDEActionMenu
186{
187 TQ_OBJECT
188
189 public:
190 KateViewEncodingAction(KateDocument *_doc, KateView *_view, const TQString& text, TQObject* parent = 0, const char* name = 0);
191
192 ~KateViewEncodingAction(){;};
193
194 private:
195 KateDocument* doc;
196 KateView *view;
197
198 public slots:
199 void slotAboutToShow();
200
201 private slots:
202 void setMode (int mode);
203};
204
205#endif
KLineEdit
KLineEdit::focusInEvent
virtual void focusInEvent(TQFocusEvent *)
KLineEdit::keyPressEvent
virtual void keyPressEvent(TQKeyEvent *)
KateScrollBar
This class is required because QScrollBar's sliderMoved() signal is really supposed to be a sliderDra...
Definition: kateviewhelpers.h:49
Kate::Command
Kate Commands.
Definition: document.h:97
TDEActionMenu
TDECompletion
Kate
Kate namespace All classes in this namespace must stay BC during one major release series (e....
Definition: document.h:51

kate

Skip menu "kate"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kate

Skip menu "kate"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for kate by doxygen 1.9.4
This website is maintained by Timothy Pearson.