Akonadi::ContactEditorDialog Class
A dialog for editing a contact in Akonadi. More...
| Header: | #include <Akonadi/ContactEditorDialog> |
| CMake: | find_package(KPim6AkonadiContactWidgets REQUIRED)target_link_libraries(mytarget PRIVATE KPim6::AkonadiContactWidgets) |
Public Types
| enum | Mode { CreateMode, EditMode } |
Public Functions
| ContactEditorDialog(Akonadi::ContactEditorDialog::Mode mode, QWidget *parent = nullptr) | |
| ContactEditorDialog(Akonadi::ContactEditorDialog::Mode mode, Akonadi::AbstractContactEditorWidget *editorWidget, QWidget *parent = nullptr) | |
| ContactEditorDialog(Akonadi::ContactEditorDialog::Mode mode, Akonadi::ContactEditorDialog::DisplayMode displayMode, QWidget *parent = nullptr) | |
| virtual | ~ContactEditorDialog() override |
| Akonadi::AkonadiContactEditor * | editor() const |
| void | setContact(const Akonadi::Item &contact) |
| void | setDefaultAddressBook(const Akonadi::Collection &addressbook) |
Public Slots
| virtual void | accept() override |
Signals
| void | contactStored(const Akonadi::Item &contact) |
| void | error(const QString &errMsg) |
Detailed Description
This dialog provides a way to create a new contact or edit an existing contact in Akonadi.
Example for creating a new contact:
using namespace Akonadi;
ContactEditorDialog *dlg = new ContactEditorDialog( ContactEditorDialog::CreateMode, this );
connect( dlg, SIGNAL(contactStored(Akonadi::Item)),
this, SLOT(contactStored(Akonadi::Item)) );
dlg->show();
Example for editing an existing contact:
using namespace Akonadi;
const Item contact = ...;
ContactEditorDialog *dlg = new ContactEditorDialog( ContactEditorDialog::EditMode, this );
connect( dlg, SIGNAL(contactStored(Akonadi::Item)),
this, SLOT(contactStored(Akonadi::Item)) );
dlg->setContact( contact );
dlg->show();
Author: Tobias Koenig <tokoe@kde.org>
Member Type Documentation
enum ContactEditorDialog::Mode
Describes the mode of the editor dialog.
Member Function Documentation
[explicit] ContactEditorDialog::ContactEditorDialog(Akonadi::ContactEditorDialog::Mode mode, QWidget *parent = nullptr)
Creates a new contact editor dialog with the standard editor widget.
mode The mode of the dialog. parent The parent widget of the dialog.
ContactEditorDialog::ContactEditorDialog(Akonadi::ContactEditorDialog::Mode mode, Akonadi::AbstractContactEditorWidget *editorWidget, QWidget *parent = nullptr)
Creates a new contact editor dialog with a custom editor widget.
mode The mode of the dialog. editorWidget The contact editor widget that shall be used for editing. parent The parent widget of the dialog.
ContactEditorDialog::ContactEditorDialog(Akonadi::ContactEditorDialog::Mode mode, Akonadi::ContactEditorDialog::DisplayMode displayMode, QWidget *parent = nullptr)
Creates a new contact editor dialog with a custom editor widget.
mode The mode of the dialog. displayMode The mode of displaying: full or vcard parent The parent widget of the dialog.
[override virtual noexcept] ContactEditorDialog::~ContactEditorDialog()
Destroys the contact editor dialog.
[override virtual slot] void ContactEditorDialog::accept()
[signal] void ContactEditorDialog::contactStored(const Akonadi::Item &contact)
This signal is emitted whenever a contact was updated or stored.
contact The data reference of the contact.
Akonadi::AkonadiContactEditor *ContactEditorDialog::editor() const
Returns the ContactEditor that is used by this dialog.
[signal] void ContactEditorDialog::error(const QString &errMsg)
This signal is emitted whenever a contact is not updated or stored.
errMsg The error during updating or storing contact.
void ContactEditorDialog::setContact(const Akonadi::Item &contact)
Sets the contact to edit when in EditMode. contact the contact to edit
Note: The contact item just must have a uid set, all other data are fetched by the dialog automatically.
void ContactEditorDialog::setDefaultAddressBook(const Akonadi::Collection &addressbook)
Sets the addressbook that shall be selected as default in create mode.