Akonadi Contacts

contactgrantleewrapper.h
1/*
2 SPDX-FileCopyrightText: 2019 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include <KContacts/Addressee>
10
11namespace KAddressBookGrantlee
12{
13/**
14 * Additional properties for the KContacts::Addressee Grantlee model.
15 */
17{
18 Q_GADGET
19 // ### those probably should eventually become i18n calls in the template itself
20 Q_PROPERTY(QString addressBookLabel READ addressBookLabel)
21 Q_PROPERTY(QString anniversaryLabel READ anniversaryLabel)
22 Q_PROPERTY(QString assistantLabel READ assistantLabel)
23 Q_PROPERTY(QString birthdayLabel READ birthdayLabel)
24 Q_PROPERTY(QString departmentLabel READ departmentLabel)
25 Q_PROPERTY(QString noteLabel READ noteLabel)
26 Q_PROPERTY(QString managerLabel READ managerLabel)
27 Q_PROPERTY(QString officeLabel READ officeLabel)
28 Q_PROPERTY(QString professionLabel READ professionLabel)
29 Q_PROPERTY(QString spouseLabel READ spouseLabel)
30
31 Q_PROPERTY(QString addressBookName READ addressBookName)
32 Q_PROPERTY(int age READ age)
33
34 // ### this shouldn't be returning assembled HTML, that's a job for Grantlee
35 Q_PROPERTY(QString photo READ photoImgElement)
36 Q_PROPERTY(QString logo READ logoImgElement)
37
38 // ### those two would be unnecessary if we had a proper way for formatting dates in Grantlee
39 Q_PROPERTY(QString formattedBirthday READ formattedBirthday)
40 Q_PROPERTY(QString formattedAnniversary READ formattedAnniversary)
41
42public:
45
46private:
47 [[nodiscard]] QString addressBookLabel() const;
48 [[nodiscard]] QString anniversaryLabel() const;
49 [[nodiscard]] QString assistantLabel() const;
50 [[nodiscard]] QString managerLabel() const;
51 [[nodiscard]] QString officeLabel() const;
52 [[nodiscard]] QString professionLabel() const;
53 [[nodiscard]] QString spouseLabel() const;
54
55 [[nodiscard]] QString addressBookName() const;
56 [[nodiscard]] int age() const;
57
58 [[nodiscard]] QString photoImgElement() const;
59 [[nodiscard]] QString logoImgElement() const;
60
61 [[nodiscard]] QString formattedBirthday() const;
62 [[nodiscard]] QString formattedAnniversary() const;
63};
64
65}
Additional properties for the KContacts::Addressee Grantlee model.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:56:08 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.