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
QString displayName() const
KContacts::Addressee rawContact() const
Returns the raw contact that is currently displayed.
Definition contactviewer.cpp:227
Akonadi::Item contact() const
Returns the contact that is currently displayed.
Definition contactviewer.cpp:222
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
QList< Address > List
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)
KIOCORE_EXPORT TransferJob * get(const QUrl &url, LoadType reload=NoReload, JobFlags flags=DefaultFlags)
QAction * create(StandardAction id, const QObject *recvr, const char *slot, QObject *parent)
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)
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)
QObject * parent() const const
QString fromUtf8(QByteArrayView str)
ImageResource
QString scheme() const const
QWidget(QWidget *parent, Qt::WindowFlags f)
QLayout * layout() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:55:33 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:55:33 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.