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

kate

  • kate
  • part
katecodecompletion.h
1 /* This file is part of the KDE libraries
2 
3  Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
4  Copyright (C) 2002 John Firebaugh <jfirebaugh@kde.org>
5  Copyright (C) 2001 by Victor Röder <Victor_Roeder@GMX.de>
6  Copyright (C) 2002 by Roberto Raggi <roberto@kdevelop.org>
7 
8  This library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Library General Public
10  License version 2 as published by the Free Software Foundation.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
22 
23 /******** Partly based on the ArgHintWidget of Qt3 by Trolltech AS *********/
24 /* Trolltech doesn't mind, if we license that piece of code as LGPL, because there isn't much
25  * left from the desigener code */
26 
27 
28 #ifndef __KateCodeCompletion_H__
29 #define __KateCodeCompletion_H__
30 
31 #include <tdetexteditor/codecompletioninterface.h>
32 
33 #include <tqvaluelist.h>
34 #include <tqstringlist.h>
35 #include <tqlabel.h>
36 #include <tqframe.h>
37 #include <tqmap.h>
38 #include <tqintdict.h>
39 
40 class KateView;
41 class KateArgHint;
42 class KateCCListBox;
43 
44 class TQLayout;
45 class TQVBox;
46 
47 class KateCodeCompletionCommentLabel : public TQLabel
48 {
49  TQ_OBJECT
50 
51  public:
52  KateCodeCompletionCommentLabel( TQWidget* parent, const TQString& text) : TQLabel( parent, "toolTipTip",
53  (WFlags)(WStyle_StaysOnTop | WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WX11BypassWM) )
54  {
55  setMargin(1);
56  setIndent(0);
57  setAutoMask( false );
58  setFrameStyle( TQFrame::Plain | TQFrame::Box );
59  setLineWidth( 1 );
60  setAlignment( AlignAuto | AlignTop );
61  polish();
62  setText(text);
63  adjustSize();
64  }
65 };
66 
67 class KateCodeCompletion : public TQObject
68 {
69  TQ_OBJECT
70 
71  friend class KateViewInternal;
72 
73  public:
74  KateCodeCompletion(KateView *view);
75  ~KateCodeCompletion();
76 
77  bool codeCompletionVisible ();
78 
79  void showArgHint(
80  TQStringList functionList, const TQString& strWrapping, const TQString& strDelimiter );
81  void showCompletionBox(
82  TQValueList<KTextEditor::CompletionEntry> entries, int offset = 0, bool casesensitive = true );
83  bool eventFilter( TQObject* o, TQEvent* e );
84 
85  void handleKey (TQKeyEvent *e);
86 
87  public slots:
88  void slotCursorPosChanged();
89  void showComment();
90  void updateBox () { updateBox(false); }
91 
92  signals:
93  void completionAborted();
94  void completionDone();
95  void argHintHidden();
96  void completionDone(KTextEditor::CompletionEntry);
97  void filterInsertString(KTextEditor::CompletionEntry*,TQString *);
98 
99  private:
100  void doComplete();
101  void abortCompletion();
102  void complete( KTextEditor::CompletionEntry );
103  void updateBox( bool newCoordinate );
104 
105  KateArgHint* m_pArgHint;
106  KateView* m_view;
107  TQVBox* m_completionPopup;
108  KateCCListBox* m_completionListBox;
109  TQValueList<KTextEditor::CompletionEntry> m_complList;
110  uint m_lineCursor;
111  uint m_colCursor;
112  int m_offset;
113  bool m_caseSensitive;
114  KateCodeCompletionCommentLabel* m_commentLabel;
115 };
116 
117 class KateArgHint: public TQFrame
118 {
119  TQ_OBJECT
120 
121  public:
122  KateArgHint( KateView* =0, const char* =0 );
123  virtual ~KateArgHint();
124 
125  virtual void setCurrentFunction( int );
126  virtual int currentFunction() const { return m_currentFunction; }
127 
128  void setArgMarkInfos( const TQString&, const TQString& );
129 
130  virtual void addFunction( int, const TQString& );
131  TQString functionAt( int id ) const { return m_functionMap[ id ]; }
132 
133  virtual void show();
134  virtual void adjustSize();
135  virtual bool eventFilter( TQObject*, TQEvent* );
136 
137  signals:
138  void argHintHidden();
139  void argHintCompleted();
140  void argHintAborted();
141 
142  public slots:
143  virtual void reset( int, int );
144  virtual void cursorPositionChanged( KateView*, int, int );
145 
146  private slots:
147  void slotDone(bool completed);
148 
149  private:
150  TQMap<int, TQString> m_functionMap;
151  int m_currentFunction;
152  TQString m_wrapping;
153  TQString m_delimiter;
154  bool m_markCurrentFunction;
155  int m_currentLine;
156  int m_currentCol;
157  KateView* editorView;
158  TQIntDict<TQLabel> labelDict;
159  TQLayout* layout;
160 };
161 
162 #endif

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.1
This website is maintained by Timothy Pearson.