25 #include <tqlineedit.h>
26 #include <tqcombobox.h>
30 #include <tqtoolbutton.h>
33 #include <kcompletion.h>
34 #include <kdialogbase.h>
35 #include <klistview.h>
154 Q_PROPERTY(
bool autoCompletion READ autoCompletion WRITE setAutoCompletion )
155 Q_PROPERTY(
bool contextMenuEnabled READ isContextMenuEnabled WRITE setContextMenuEnabled )
156 Q_PROPERTY(
bool urlDropsEnabled READ isURLDropsEnabled WRITE setURLDropsEnabled )
157 Q_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 * );
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 Q_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 KDEUI_EXPORT KHistoryComboEditor :
public KDialogBase
804 KHistoryComboEditor(
const TQStringList& entries, TQWidget *parent = 0L );
805 ~KHistoryComboEditor();
808 void removeFromHistory(
const TQString& );
811 virtual void slotUser1();
812 void slotSelectionChanged( TQListViewItem * item );
815 virtual void virtual_hook(
int id,
void* data );
820 class KHistoryComboEditorPrivate;
821 KHistoryComboEditorPrivate*
const d;
void returnPressed(const TQString &)
Emitted when the user presses the Enter key.
void aboutToShowContextMenu(TQPopupMenu *p)
Emitted before the context menu is displayed.
bool autoCompletion() const
Re-implemented from TQComboBox.
virtual void itemSelected(TQListBoxItem *)
bool isContextMenuEnabled() const
Returns true when the context menu is enabled.
void textRotation(KCompletionBase::KeyBindingType)
Emitted when the text rotation key-bindings are pressed.
void completionModeChanged(KGlobalSettings::Completion)
Emitted whenever the completion mode is changed by the user through the context menu.
void setCurrentItem(int index)
Simply calls QComboBox' implementation.
int cursorPosition() const
Returns the current cursor position.
void substringCompletion(const TQString &)
Emitted when the shortcut for substring completion is pressed.
void returnPressed()
Emitted when the user presses the Enter key.
void completion(const TQString &)
Emitted when the completion key is pressed.
virtual void setCompletedItems(const TQStringList &items)=0
KGlobalSettings::Completion completionMode() const
KCompletion * compObj() const
virtual void setCompletedText(const TQString &text)=0
A helper widget for "completion-widgets" (KLineEdit, KComboBox))
A dialog base class with standard buttons and predefined layouts.
A combobox for offering a history and completion.
bool useCompletion() const
void cleared()
Emitted when the history was cleared by the entry in the popup menu.
KPixmapProvider * pixmapProvider() const
void setHistoryItems(TQStringList items)
Inserts items into the combobox.
void reset()
Resets the current position of the up/down history.
This Widget extends the functionality of TQListView to honor the system wide settings for Single Clic...