kabc
KABC::AddressLineEdit Class Reference
A lineedit with kabc completion. More...
#include <addresslineedit.h>
Inherits KLineEdit.
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 | |
void | addAddress (const QString &addr) |
void | doCompletion (bool) |
virtual void | dropEvent (QDropEvent *e) |
virtual void | insert (const QString &addr) |
virtual void | keyPressEvent (QKeyEvent *e) |
virtual void | loadAddresses () |
virtual void | mouseReleaseEvent (QMouseEvent *e) |
virtual void | paste () |
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 43 of file addresslineedit.h.
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] |
Destroys the instance.
Definition at line 206 of file addresslineedit.cpp.
Member Function Documentation
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::cursorAtEnd | ( | ) | [slot] |
Set cursor to end of line.
Definition at line 329 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.
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::enableCompletion | ( | bool | enable | ) | [slot] |
Toggle completion.
- Parameters:
-
enable When true
address completion will be enabled, whenfalse
it will be disabled
Definition at line 335 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::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::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::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::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::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.
The documentation for this class was generated from the following files: