28 #ifndef __KateCodeCompletion_H__
29 #define __KateCodeCompletion_H__
31 #include <tdetexteditor/codecompletioninterface.h>
33 #include <tqvaluelist.h>
34 #include <tqstringlist.h>
38 #include <tqintdict.h>
47 class KateCodeCompletionCommentLabel :
public TQLabel
52 KateCodeCompletionCommentLabel( TQWidget* parent,
const TQString& text) : TQLabel( parent,
"toolTipTip",
53 (WFlags)(WStyle_StaysOnTop | WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WX11BypassWM) )
58 setFrameStyle( TQFrame::Plain | TQFrame::Box );
60 setAlignment( AlignAuto | AlignTop );
67 class KateCodeCompletion :
public TQObject
71 friend class KateViewInternal;
74 KateCodeCompletion(KateView *view);
75 ~KateCodeCompletion();
77 bool codeCompletionVisible ();
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 );
85 void handleKey (TQKeyEvent *e);
88 void slotCursorPosChanged();
90 void updateBox () { updateBox(
false); }
93 void completionAborted();
94 void completionDone();
96 void completionDone(KTextEditor::CompletionEntry);
97 void filterInsertString(KTextEditor::CompletionEntry*,TQString *);
101 void abortCompletion();
102 void complete( KTextEditor::CompletionEntry );
103 void updateBox(
bool newCoordinate );
105 KateArgHint* m_pArgHint;
107 TQVBox* m_completionPopup;
108 KateCCListBox* m_completionListBox;
109 TQValueList<KTextEditor::CompletionEntry> m_complList;
113 bool m_caseSensitive;
114 KateCodeCompletionCommentLabel* m_commentLabel;
117 class KateArgHint:
public TQFrame
122 KateArgHint( KateView* =0,
const char* =0 );
123 virtual ~KateArgHint();
125 virtual void setCurrentFunction(
int );
126 virtual int currentFunction()
const {
return m_currentFunction; }
128 void setArgMarkInfos(
const TQString&,
const TQString& );
130 virtual void addFunction(
int,
const TQString& );
131 TQString functionAt(
int id )
const {
return m_functionMap[ id ]; }
134 virtual void adjustSize();
135 virtual bool eventFilter( TQObject*, TQEvent* );
138 void argHintHidden();
139 void argHintCompleted();
140 void argHintAborted();
143 virtual void reset(
int,
int );
144 virtual void cursorPositionChanged( KateView*,
int,
int );
147 void slotDone(
bool completed);
150 TQMap<int, TQString> m_functionMap;
151 int m_currentFunction;
153 TQString m_delimiter;
154 bool m_markCurrentFunction;
157 KateView* editorView;
158 TQIntDict<TQLabel> labelDict;