kabc
KABC::AddressLineEdit Class Reference
#include <addresslineedit.h>
Inherits KLineEdit.
Detailed Description
A lineedit with kabc completion.This lineedit is supposed to be used wherever the user types email addresses and might want a completion. You can simply use it as a replacement for KLineEdit or QLineEdit.
You can enable or disable the lineedit at any time.
- See also:
- AddressLineEdit::enableCompletion()
Definition at line 44 of file addresslineedit.h.
Public Slots | |
| void | cursorAtEnd () |
| void | enableCompletion (bool enable) |
Public Member Functions | |
| AddressLineEdit (QWidget *parent, bool useCompletion=true) | |
| virtual | ~AddressLineEdit () |
| virtual void | setFont (const QFont &font) |
Protected Member Functions | |
| virtual void | loadAddresses () |
| void | addAddress (const QString &addr) |
| virtual void | keyPressEvent (QKeyEvent *e) |
| virtual void | dropEvent (QDropEvent *e) |
| virtual void | paste () |
| virtual void | insert (const QString &addr) |
| virtual void | mouseReleaseEvent (QMouseEvent *e) |
| void | doCompletion (bool) |
Constructor & Destructor Documentation
| AddressLineEdit::AddressLineEdit | ( | QWidget * | parent, | |
| bool | useCompletion = true | |||
| ) | [explicit] |
Creates the line edit instance.
- Parameters:
-
parent The QWidget parent useCompletion Whether to use address completion. See enableCompletion()
Definition at line 191 of file addresslineedit.cpp.
| AddressLineEdit::~AddressLineEdit | ( | ) | [virtual] |
Member Function Documentation
| void AddressLineEdit::setFont | ( | const QFont & | font | ) | [virtual] |
Reimplemented for internal reasons.
- Parameters:
-
font The font to use
- See also:
- KLineEdit::setFont()
Definition at line 213 of file addresslineedit.cpp.
| void AddressLineEdit::cursorAtEnd | ( | ) | [slot] |
| void AddressLineEdit::enableCompletion | ( | bool | enable | ) | [slot] |
Toggle completion.
- Parameters:
-
enable When trueaddress completion will be enabled, whenfalseit will be disabled
Definition at line 335 of file addresslineedit.cpp.
| void AddressLineEdit::loadAddresses | ( | ) | [protected, virtual] |
Always call AddressLineEdit::loadAddresses() as the first thing.
Use addAddress() to add addresses.
Definition at line 468 of file addresslineedit.cpp.
| void AddressLineEdit::addAddress | ( | const QString & | addr | ) | [protected] |
Adds a new address to the line edit.
Adds the given string to the completion handler and additionally the email part if the string contains name + address in the angle bracket notation.
- Parameters:
-
addr The address to add
Definition at line 479 of file addresslineedit.cpp.
| void AddressLineEdit::keyPressEvent | ( | QKeyEvent * | e | ) | [protected, virtual] |
Handles KDE completion short cuts.
- Parameters:
-
e The key event to check
- See also:
- KStandardShortcut::SubstringCompletion
KStandardShortcut::TextCompletion
Definition at line 222 of file addresslineedit.cpp.
| void AddressLineEdit::dropEvent | ( | QDropEvent * | e | ) | [protected, virtual] |
Handles drop events.
Creates a list of addresses separated by ',' from a "URI List" drop. Enables smart paste for anything else before relaying the event to the base class. See insert() for information on smart paste.
- Parameters:
-
e The drop event
- See also:
- enableCompletion()
Definition at line 494 of file addresslineedit.cpp.
| void AddressLineEdit::paste | ( | ) | [protected, virtual] |
Pastes the clipboard content.
Enables smart paste if completion is enabled. See insert() for information on smart paste.
- See also:
- enableCompletion()
Definition at line 318 of file addresslineedit.cpp.
| void AddressLineEdit::insert | ( | const QString & | addr | ) | [protected, virtual] |
Inserts the given string.
If smart paste is enabled, the text will be parsed for possible email address parts, i.e. either a mailto: URI or "spam protected" like "developer at kde dot org"
- Parameters:
-
addr The string to insert
Definition at line 257 of file addresslineedit.cpp.
| void AddressLineEdit::mouseReleaseEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
Enables smart paste for X11 middle mouse text paste if completion is enabled.
See insert() for information about smart paste.
- Parameters:
-
e The mouse release event
- See also:
- enableCompletion()
Definition at line 245 of file addresslineedit.cpp.
| void AddressLineEdit::doCompletion | ( | bool | ctrlT | ) | [protected] |
Triggers looking for a completion of the address or the last address if there are already more than one separated by ','.
Definition at line 341 of file addresslineedit.cpp.
The documentation for this class was generated from the following files:
KDE 4.0 API Reference