Akonadi::AbstractContactGroupFormatter Class
The interface for all contact group formatters. More...
| Header: | #include <Akonadi/AbstractContactGroupFormatter> |
| CMake: | find_package(KPim6AkonadiContactCore REQUIRED)target_link_libraries(mytarget PRIVATE KPim6::AkonadiContactCore) |
| Inherited By: | Akonadi::StandardContactGroupFormatter and KAddressBookGrantlee::GrantleeContactGroupFormatter |
Public Types
| enum | HtmlForm { SelfcontainedForm, EmbeddableForm, UserForm } |
Public Functions
| AbstractContactGroupFormatter() | |
| virtual | ~AbstractContactGroupFormatter() |
| QList<QVariantMap> | additionalFields() const |
| KContacts::ContactGroup | contactGroup() const |
| Akonadi::Item | item() const |
| void | setAdditionalFields(const QList<QVariantMap> &fields) |
| void | setContactGroup(const KContacts::ContactGroup &group) |
| void | setItem(const Akonadi::Item &item) |
| virtual QString | toHtml(Akonadi::AbstractContactGroupFormatter::HtmlForm form = SelfcontainedForm) const = 0 |
Detailed Description
This is the interface that can be used to format an Akonadi item with a contact group payload or a contact group itself as HTML.
Author: Tobias Koenig <tokoe@kde.org>
See also StandardContactGroupFormatter.
Member Type Documentation
enum AbstractContactGroupFormatter::HtmlForm
Describes the form of the HTML that is created.
Member Function Documentation
AbstractContactGroupFormatter::AbstractContactGroupFormatter()
Creates a new abstract contact group formatter.
[virtual noexcept] AbstractContactGroupFormatter::~AbstractContactGroupFormatter()
Destroys the abstract contact group formatter.
QList<QVariantMap> AbstractContactGroupFormatter::additionalFields() const
Returns the additional fields that will be shown.
See also setAdditionalFields().
KContacts::ContactGroup AbstractContactGroupFormatter::contactGroup() const
Returns the contact group that will be formatted.
See also setContactGroup().
Akonadi::Item AbstractContactGroupFormatter::item() const
Returns the item who's payload will be formatted.
See also setItem().
void AbstractContactGroupFormatter::setAdditionalFields(const QList<QVariantMap> &fields)
Sets the additional fields that will be shown.
The fields list contains a QVariantMap for each additional field with the following keys: - key (string) The identifier of the field - title (string) The i18n'ed title of the field - value (string) The value of the field
fields additional fields that will be shown
See also additionalFields().
void AbstractContactGroupFormatter::setContactGroup(const KContacts::ContactGroup &group)
Sets the contact group that will be formatted.
See also contactGroup().
void AbstractContactGroupFormatter::setItem(const Akonadi::Item &item)
Sets the item who's payload will be formatted.
Note: The payload must be a valid KContacts::ContactGroup object.
item item, who's payload will be formatted.
See also item().
[pure virtual] QString AbstractContactGroupFormatter::toHtml(Akonadi::AbstractContactGroupFormatter::HtmlForm form = SelfcontainedForm) const
This method must be reimplemented to return the contact group formatted as HTML according to the requested form.
form The form in which the HTML should be rendered (SelfcontainedForm or EmbeddableForm). \returns The contact group formatted as HTML.