29 #ifndef _DocWordCompletionPlugin_h_
30 #define _DocWordCompletionPlugin_h_
32 #include <tdetexteditor/plugin.h>
33 #include <tdetexteditor/view.h>
34 #include <tdetexteditor/codecompletioninterface.h>
35 #include <tdetexteditor/configinterfaceextension.h>
36 #include <kxmlguiclient.h>
40 #include <tqvaluelist.h>
42 class DocWordCompletionPlugin
43 :
public KTextEditor::Plugin
44 ,
public KTextEditor::PluginViewInterface
45 ,
public KTextEditor::ConfigInterfaceExtension
50 DocWordCompletionPlugin( TQObject *parent = 0,
52 const TQStringList &args = TQStringList() );
53 virtual ~DocWordCompletionPlugin() {};
55 void addView (KTextEditor::View *view);
56 void removeView (KTextEditor::View *view);
62 uint configPages()
const {
return 1; };
63 KTextEditor::ConfigPage * configPage( uint number, TQWidget *parent,
const char *name );
64 TQString configPageName( uint )
const;
65 TQString configPageFullName( uint )
const;
66 TQPixmap configPagePixmap( uint,
int )
const;
68 uint treshold()
const {
return m_treshold; };
69 void setTreshold( uint t ) { m_treshold = t; };
70 bool autoPopupEnabled()
const {
return m_autopopup; };
71 void setAutoPopupEnabled(
bool enable ) { m_autopopup = enable; };
75 TQPtrList<class DocWordCompletionPluginView> m_views;
81 class DocWordCompletionPluginView
87 DocWordCompletionPluginView( uint treshold=3,
bool autopopup=
true, KTextEditor::View *view=0,
89 ~DocWordCompletionPluginView() {};
91 void settreshold( uint treshold );
94 void completeBackwards();
95 void completeForwards();
98 void popupCompletionList( TQString word=TQString::null );
99 void autoPopupCompletionList();
100 void toggleAutoPopup();
102 void slotVariableChanged(
const TQString &,
const TQString & );
105 void complete(
bool fw=
true );
108 TQValueList<KTextEditor::CompletionEntry> allMatches(
const TQString &word );
109 TQString findLongestUnique(
const TQValueList < KTextEditor::CompletionEntry > &matches);
110 KTextEditor::View *m_view;
111 struct DocWordCompletionPluginViewPrivate *d;
114 class DocWordCompletionConfigPage :
public KTextEditor::ConfigPage
118 DocWordCompletionConfigPage( DocWordCompletionPlugin *completion, TQWidget *parent,
const char *name );
119 virtual ~DocWordCompletionConfigPage() {};
121 virtual void apply();
122 virtual void reset();
123 virtual void defaults();
126 DocWordCompletionPlugin *m_completion;
127 class TQCheckBox *cbAutoPopup;
128 class TQSpinBox *sbAutoPopup;
129 class TQLabel *lSbRight;