Akonadi::AbstractContactGroupFormatter

Search for usage in LXR

Akonadi::AbstractContactGroupFormatter Class Referenceabstract

#include <abstractcontactgroupformatter.h>

Inheritance diagram for Akonadi::AbstractContactGroupFormatter:

Public Types

enum  HtmlForm { SelfcontainedForm , EmbeddableForm , UserForm = SelfcontainedForm + 42 }
 

Public Member 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 (HtmlForm form=SelfcontainedForm) const =0
 

Detailed Description

The interface for all contact group formatters.

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.

See also
StandardContactGroupFormatter
Author
Tobias Koenig tokoe.nosp@m.@kde.nosp@m..org
Since
4.6

Definition at line 37 of file abstractcontactgroupformatter.h.

Member Enumeration Documentation

◆ HtmlForm

Describes the form of the HTML that is created.

Enumerator
SelfcontainedForm 

Creates a complete HTML document.

EmbeddableForm 

Creates a div HTML element that can be embedded.

UserForm 

Point for extension.

Definition at line 43 of file abstractcontactgroupformatter.h.

Constructor & Destructor Documentation

◆ AbstractContactGroupFormatter()

AbstractContactGroupFormatter::AbstractContactGroupFormatter ( )

Creates a new abstract contact group formatter.

Definition at line 24 of file abstractcontactgroupformatter.cpp.

◆ ~AbstractContactGroupFormatter()

AbstractContactGroupFormatter::~AbstractContactGroupFormatter ( )
virtualdefault

Destroys the abstract contact group formatter.

Member Function Documentation

◆ additionalFields()

QList< QVariantMap > AbstractContactGroupFormatter::additionalFields ( ) const
nodiscard

Returns the additional fields that will be shown.

Definition at line 56 of file abstractcontactgroupformatter.cpp.

◆ contactGroup()

KContacts::ContactGroup AbstractContactGroupFormatter::contactGroup ( ) const
nodiscard

Returns the contact group that will be formatted.

Definition at line 36 of file abstractcontactgroupformatter.cpp.

◆ item()

Akonadi::Item AbstractContactGroupFormatter::item ( ) const
nodiscard

Returns the item who's payload will be formatted.

Definition at line 46 of file abstractcontactgroupformatter.cpp.

◆ setAdditionalFields()

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
Parameters
fieldsadditional fields that will be shown

Definition at line 51 of file abstractcontactgroupformatter.cpp.

◆ setContactGroup()

void AbstractContactGroupFormatter::setContactGroup ( const KContacts::ContactGroup & group)

Sets the contact group that will be formatted.

Definition at line 31 of file abstractcontactgroupformatter.cpp.

◆ setItem()

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.
Parameters
itemitem, who's payload will be formatted.

Definition at line 41 of file abstractcontactgroupformatter.cpp.

◆ toHtml()

virtual QString Akonadi::AbstractContactGroupFormatter::toHtml ( HtmlForm form = SelfcontainedForm) const
pure virtual

This method must be reimplemented to return the contact group formatted as HTML according to the requested form.

Implemented in Akonadi::StandardContactGroupFormatter, and KAddressBookGrantlee::GrantleeContactGroupFormatter.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:36:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.