33 #include <QtGui/QLineEdit> 41 class KLineEditPrivate;
152 friend class KLineEditStyle;
155 #ifndef KDE_NO_DEPRECATED 156 Q_PROPERTY(
bool contextMenuEnabled READ isContextMenuEnabled WRITE setContextMenuEnabled )
158 Q_PROPERTY(
bool urlDropsEnabled READ urlDropsEnabled WRITE setUrlDropsEnabled )
159 Q_PROPERTY(
bool trapEnterKeyEvent READ trapReturnKey WRITE setTrapReturnKey )
160 Q_PROPERTY(
bool squeezedTextEnabled READ isSqueezedTextEnabled WRITE setSqueezedTextEnabled )
161 Q_PROPERTY( QString clickMessage READ clickMessage WRITE setClickMessage )
162 Q_PROPERTY(
bool showClearButton READ isClearButtonShown WRITE setClearButtonShown )
163 Q_PROPERTY(
bool passwordMode READ passwordMode WRITE setPasswordMode )
191 void setUrl( const
KUrl& url );
209 void setCompletionModeDisabled(
KGlobalSettings::Completion mode,
bool disable = true );
225 #ifndef KDE_NO_DEPRECATED 226 virtual KDE_DEPRECATED
void setContextMenuEnabled(
bool showMenu );
233 #ifndef KDE_NO_DEPRECATED 234 KDE_DEPRECATED
bool isContextMenuEnabled()
const;
244 void setUrlDropsEnabled(
bool enable );
249 bool urlDropsEnabled()
const;
261 void setTrapReturnKey(
bool trap );
269 bool trapReturnKey()
const;
289 virtual void copy()
const;
301 void setSqueezedTextEnabled(
bool enable );
307 bool isSqueezedTextEnabled()
const;
316 QString originalText()
const;
324 QString userText()
const;
340 void setClickMessage(
const QString &msg );
345 QString clickMessage()
const;
352 void setClearButtonShown(
bool show);
357 bool isClearButtonShown()
const;
363 QSize clearButtonUsedSize()
const;
372 void doCompletion(
const QString& txt);
379 void completionBoxActivated (
const QString &);
388 void returnPressed(
const QString& );
416 #ifndef KDE_NO_DEPRECATED 417 QT_MOC_COMPAT
void userTextChanged(
const QString & );
451 void aboutToShowContextMenu(
QMenu* menu);
456 void clearButtonClicked();
464 virtual void setReadOnly(
bool);
497 virtual void clear();
503 void setSqueezedText(
const QString &text);
508 virtual void setText (
const QString& );
515 void setPasswordMode(
bool b =
true );
520 bool passwordMode( )
const;
529 virtual void makeCompletion(
const QString& );
536 void userCancelled(
const QString & cancelText);
543 virtual bool event( QEvent * );
550 virtual void resizeEvent( QResizeEvent * );
557 virtual void keyPressEvent( QKeyEvent * );
564 virtual void mousePressEvent( QMouseEvent * );
571 virtual void mouseReleaseEvent( QMouseEvent * );
578 virtual void mouseDoubleClickEvent( QMouseEvent * );
585 virtual void contextMenuEvent( QContextMenuEvent * );
592 QMenu* createStandardContextMenu();
599 virtual void dropEvent( QDropEvent * );
616 void setUserSelection(
bool userSelection );
621 virtual void create( WId = 0,
bool initializeWindow =
true,
622 bool destroyOldWindow =
true );
627 bool autoSuggest()
const;
629 virtual void paintEvent( QPaintEvent *ev );
631 virtual void focusInEvent( QFocusEvent *ev );
633 virtual void focusOutEvent( QFocusEvent *ev );
636 void completionMenuActivated(
QAction *act );
637 void tripleClickTimeout();
638 void slotRestoreSelectionColors();
639 void _k_slotCompletionBoxTextChanged(
const QString& text );
644 void updateClearButtonIcon(
const QString&);
654 bool copySqueezedText(
bool clipboard )
const;
660 void setSqueezedText ();
665 void updateClearButton();
668 friend class KLineEditPrivate;
669 KLineEditPrivate *
const d;
671 Q_PRIVATE_SLOT( d,
void _k_slotSettingsChanged(
int category ) )
672 Q_PRIVATE_SLOT( d,
void _k_textChanged(
const QString&) )
A helper widget for "completion-widgets" (KLineEdit, KComboBox))
KAction * copy(const QObject *recvr, const char *slot, QObject *parent)
Copy the selected area into the clipboard.
const KShortcut & substringCompletion()
Find a string within another string or list of strings.
virtual void setCompletedText(const QString &text)=0
A pure virtual function that must be implemented by all inheriting classes.
A generic class for completing QStrings.
KAction * clear(const QObject *recvr, const char *slot, QObject *parent)
Clear the content of the focus widget.
Access the KDE global configuration.
An abstract base class for adding a completion feature into widgets.
An enhanced QLineEdit widget for inputting text.
KAction * create(StandardAction id, const QObject *recvr, const char *slot, QObject *parent)
Creates an action corresponding to one of the KStandardAction::StandardAction actions, which is connected to the given object and slot, and is owned by parent.
Completion
This enum describes the completion mode used for by the KCompletion class.
virtual void setCompletionObject(KCompletion *compObj, bool hsig=true)
Sets up the completion object to be used.
KeyBindingType
Constants that represent the items whose short-cut key-binding is programmable.
virtual void setCompletedItems(const QStringList &items, bool autoSuggest=true)=0
A pure virtual function that must be implemented by all inheriting classes.
const KShortcut & completion()
Complete text in input widgets.