25 #include <tqlineedit.h>
26 #include <tqcombobox.h>
30 #include <tqtoolbutton.h>
33 #include <kcompletion.h>
34 #include <kdialogbase.h>
35 #include <tdelistview.h>
154 TQ_PROPERTY(
bool autoCompletion READ autoCompletion WRITE setAutoCompletion )
155 TQ_PROPERTY(
bool contextMenuEnabled READ isContextMenuEnabled WRITE setContextMenuEnabled )
156 TQ_PROPERTY(
bool urlDropsEnabled READ isURLDropsEnabled WRITE setURLDropsEnabled )
157 TQ_PROPERTY(
bool trapReturnKey READ trapReturnKey WRITE setTrapReturnKey )
168 KComboBox( TQWidget *parent=0,
const char *name=0 );
179 KComboBox(
bool rw, TQWidget *parent=0,
const char *name=0 );
191 void setEditURL(
const KURL& url );
198 void insertURL(
const KURL& url,
int index = -1 );
206 void insertURL(
const TQPixmap& pixmap,
const KURL& url,
int index = -1 );
213 void changeURL(
const KURL& url,
int index );
220 void changeURL(
const TQPixmap& pixmap,
const KURL& url,
int index );
230 int cursorPosition()
const {
return ( lineEdit() ) ? lineEdit()->cursorPosition() : -1; }
242 virtual void setAutoCompletion(
bool autocomplete );
272 virtual void setContextMenuEnabled(
bool showMenu );
286 void setURLDropsEnabled(
bool enable );
291 bool isURLDropsEnabled()
const;
302 bool contains(
const TQString& text )
const;
317 void setTrapReturnKey(
bool trap );
325 bool trapReturnKey()
const;
330 virtual bool eventFilter( TQObject *, TQEvent * );
349 virtual void setLineEdit( TQLineEdit * );
357 void returnPressed();
368 void returnPressed(
const TQString& );
378 void completion(
const TQString& );
383 void substringCompletion(
const TQString& );
413 void aboutToShowContextMenu( TQPopupMenu * p );
454 void setCurrentItem(
const TQString& item,
bool insert =
false,
int index = -1 );
480 virtual void makeCompletion(
const TQString& );
496 virtual void create( WId = 0,
bool initializeWindow =
true,
497 bool destroyOldWindow =
true );
499 virtual void wheelEvent( TQWheelEvent *ev );
502 void lineEditDeleted();
510 bool m_trapReturnKey;
513 virtual void virtual_hook(
int id,
void* data );
516 class KComboBoxPrivate;
517 KComboBoxPrivate*
const d;
543 TQ_PROPERTY( TQStringList historyItems READ historyItems WRITE setHistoryItems )
565 KHistoryCombo( TQWidget *parent = 0L,
const char *name = 0L );
575 TQWidget *parent = 0L,
const char *name = 0L );
589 setHistoryItems(items,
false);
633 void setHistoryItems( TQStringList items,
bool setCompletionList );
641 TQStringList historyItems()
const;
650 bool removeFromHistory(
const TQString& item );
682 void setHistoryEditorEnabled(
bool enable );
683 bool isHistoryEditorEnabled()
const;
705 void addToHistory(
const TQString& item );
718 void removed(
const TQString& item );
724 virtual void keyPressEvent( TQKeyEvent * );
729 virtual void wheelEvent( TQWheelEvent *ev );
739 void insertItems(
const TQStringList& items );
766 void addContextMenuItems( TQPopupMenu* );
768 void slotRemoveFromHistory(
const TQString & );
771 void init(
bool useCompletion );
793 virtual void virtual_hook(
int id,
void* data );
795 class KHistoryComboPrivate;
796 KHistoryComboPrivate*
const d;
799 class TDEUI_EXPORT KHistoryComboEditor :
public KDialogBase
804 KHistoryComboEditor(
const TQStringList& entries, TQWidget *parent = 0L );
805 ~KHistoryComboEditor();
808 void removeFromHistory(
const TQString& );
812 void slotSelectionChanged( TQListViewItem * item );
815 virtual void virtual_hook(
int id,
void* data );
820 class KHistoryComboEditorPrivate;
821 KHistoryComboEditorPrivate*
const d;
virtual void setCompletedText(const TQString &text)=0
bool useCompletion() const
KPixmapProvider * pixmapProvider() const
TDEGlobalSettings::Completion completionMode() const
int cursorPosition() const
Returns the current cursor position.
A dialog base class with standard buttons and predefined layouts.
bool isContextMenuEnabled() const
Returns true when the context menu is enabled.
virtual void setCompletedItems(const TQStringList &items)=0
void reset()
Resets the current position of the up/down history.
bool autoCompletion() const
Re-implemented from TQComboBox.
This Widget extends the functionality of TQListView to honor the system wide settings for Single Clic...
void setCurrentItem(int index)
Simply calls QComboBox' implementation.
virtual void slotUser1()
Activated when the User1 button has been clicked.
A helper widget for "completion-widgets" (KLineEdit, KComboBox))
void setHistoryItems(TQStringList items)
Inserts items into the combobox.
virtual void itemSelected(TQListBoxItem *)
TDECompletion * compObj() const
A combobox for offering a history and completion.