Akonadi Contacts
contactviewer.cpp
58 void updateView(const QVariantList &localCustomFieldDescriptions = QVariantList(), const QString &addressBookName = QString())
60 static QPixmap defaultPixmap = QIcon::fromTheme(QStringLiteral("user-identity")).pixmap(QSize(100, 100));
61 static QPixmap defaultMapPixmap = QIcon::fromTheme(QStringLiteral("map-symbolic")).pixmap(QSize(16, 16));
62 static QPixmap defaultSmsPixmap = QIcon::fromTheme(QStringLiteral("message-new")).pixmap(QSize(16, 16));
67 mBrowser->document()->addResource(QTextDocument::ImageResource, QUrl(QStringLiteral("contact_photo")), mCurrentContact.photo().data());
72 QObject::connect(job, &KIO::TransferJob::data, job, [&imageData](KIO::Job *, const QByteArray &data) {
77 mBrowser->document()->addResource(QTextDocument::ImageResource, QUrl(QStringLiteral("contact_photo")), image);
79 mBrowser->document()->addResource(QTextDocument::ImageResource, QUrl(QStringLiteral("contact_photo")), defaultPixmap);
82 mBrowser->document()->addResource(QTextDocument::ImageResource, QUrl(QStringLiteral("contact_photo")), defaultPixmap);
85 mBrowser->document()->addResource(QTextDocument::ImageResource, QUrl(QStringLiteral("contact_photo")), defaultPixmap);
89 mBrowser->document()->addResource(QTextDocument::ImageResource, QUrl(QStringLiteral("contact_logo")), mCurrentContact.logo().data());
94 QObject::connect(job, &KIO::TransferJob::data, job, [&imageData](KIO::Job *, const QByteArray &data) {
99 mBrowser->document()->addResource(QTextDocument::ImageResource, QUrl(QStringLiteral("contact_logo")), image);
104 mBrowser->document()->addResource(QTextDocument::ImageResource, QUrl(QStringLiteral("map_icon")), defaultMapPixmap);
106 mBrowser->document()->addResource(QTextDocument::ImageResource, QUrl(QStringLiteral("sms_icon")), defaultSmsPixmap);
118 mQRCode->toImage(mQRCode->preferredSize(QGuiApplication::primaryScreen()->devicePixelRatio()).toSize()));
124 const CustomField::List globalCustomFields = CustomFieldManager::globalCustomFieldDescriptions();
125 customFieldDescriptions.reserve(localCustomFieldDescriptions.count() + globalCustomFields.count());
140 contact.insertCustom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("AddressBook"), addressBookName);
153 if (urlScheme == QLatin1StringView("http") || urlScheme == QLatin1StringView("https") || urlScheme == QLatin1StringView("tel")
154 || urlScheme == QLatin1StringView("sms") || urlScheme == QLatin1StringView("geo") || urlScheme == QLatin1StringView("mailto")) {
271 d->mParentCollectionFetchJob = new CollectionFetchJob(contactItem.parentCollection(), CollectionFetchJob::Base, this);
272 d->mCollectionFetchJobConnection = connect(d->mParentCollectionFetchJob, &CollectionFetchJob::result, this, [this](KJob *job) {
The interface for all contact formatters.
Definition abstractcontactformatter.h:38
void setContact(const KContacts::Addressee &contact)
Sets the contact that will be formatted.
Definition abstractcontactformatter.cpp:31
virtual QString toHtml(HtmlForm form=SelfcontainedForm) const =0
This method must be reimplemented to return the contact formatted as HTML according to the requested ...
void setCustomFieldDescriptions(const QList< QVariantMap > &descriptions)
Sets the custom field descriptions that will be used.
Definition abstractcontactformatter.cpp:51
QString displayName() const
KContacts::Addressee rawContact() const
Returns the raw contact that is currently displayed.
Definition contactviewer.cpp:227
void addressClicked(const KContacts::Address &address)
This signal is emitted whenever the user has clicked on an address in the viewer.
Akonadi::Item contact() const
Returns the contact that is currently displayed.
Definition contactviewer.cpp:222
void urlClicked(const QUrl &url)
This signal is emitted whenever the user has clicked on a url (e.g.
void setContactFormatter(Akonadi::AbstractContactFormatter *formatter)
Sets the contact formatter that should be used for formatting the contact.
Definition contactviewer.cpp:232
void setRawContact(const KContacts::Addressee &contact)
Sets the raw contact object that shall be displayed in the viewer.
Definition contactviewer.cpp:248
void setContact(const Akonadi::Item &contact)
Sets the contact that shall be displayed in the viewer.
Definition contactviewer.cpp:243
void setAncestorRetrieval(AncestorRetrieval ancestorDepth)
void fetchAttribute(bool fetch=true)
void fetchFullPayload(bool fetch=true)
void setItem(const Item &item)
Item item() const
ItemFetchScope & fetchScope()
Collection & parentCollection()
bool hasPayload() const
T payload() const
A class that formats a contact as HTML code.
Definition standardcontactformatter.h:44
Picture photo() const
Picture logo() const
QString assembledName() const
Address::List addresses() const
QImage data() const
bool isIntern() const
QString url() const
QByteArray createVCard(const Addressee &addr, Version version=v3_0) const
void data(KIO::Job *job, const QByteArray &data)
bool exec()
int error() const
void result(KJob *job)
QString i18nc(const char *context, const char *text, const TYPE &arg...)
A widget for editing the display name of a contact.
KSERVICE_EXPORT KService::List query(FilterFunc filterFunc)
QAction * create(GameStandardAction id, const QObject *recvr, const char *slot, QObject *parent)
KIOCORE_EXPORT TransferJob * get(const QUrl &url, LoadType reload=NoReload, JobFlags flags=DefaultFlags)
QRCode
QByteArray & append(QByteArrayView data)
primaryScreen
QPixmap pixmap(QWindow *window, const QSize &size, Mode mode, State state) const const
QIcon fromTheme(const QString &name)
bool loadFromData(QByteArrayView data, const char *format)
void addWidget(QWidget *w)
void setContentsMargins(const QMargins &margins)
const_reference at(qsizetype i) const const
qsizetype count() const const
void reserve(qsizetype size)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
bool disconnect(const QMetaObject::Connection &connection)
QString fromUtf8(QByteArrayView str)
bool isEmpty() const const
ImageResource
QString scheme() const const
QLayout * layout() const const
void setWindowTitle(const QString &)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:08:53 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:08:53 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.