Akonadi Contacts

contactgrantleewrapper.h
1 /*
2  SPDX-FileCopyrightText: 2019 Volker Krause <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include <KContacts/Addressee>
10 
11 namespace 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  Q_PROPERTY(QString cryptoPreference READ cryptoPreference)
34  Q_PROPERTY(QString signaturePreference READ signaturePreference)
35 
36  // ### this shouldn't be returning assembled HTML, that's a job for Grantlee
37  Q_PROPERTY(QString photo READ photoImgElement)
38  Q_PROPERTY(QString logo READ logoImgElement)
39 
40  // ### those two would be unnecessary if we had a proper way for formatting dates in Grantlee
41  Q_PROPERTY(QString formattedBirthday READ formattedBirthday)
42  Q_PROPERTY(QString formattedAnniversary READ formattedAnniversary)
43 
44 public:
47 
48 private:
49  Q_REQUIRED_RESULT QString addressBookLabel() const;
50  Q_REQUIRED_RESULT QString anniversaryLabel() const;
51  Q_REQUIRED_RESULT QString assistantLabel() const;
52  Q_REQUIRED_RESULT QString managerLabel() const;
53  Q_REQUIRED_RESULT QString officeLabel() const;
54  Q_REQUIRED_RESULT QString professionLabel() const;
55  Q_REQUIRED_RESULT QString spouseLabel() const;
56 
57  Q_REQUIRED_RESULT QString addressBookName() const;
58  Q_REQUIRED_RESULT int age() const;
59  Q_REQUIRED_RESULT QString cryptoPreference() const;
60  Q_REQUIRED_RESULT QString signaturePreference() const;
61 
62  Q_REQUIRED_RESULT QString photoImgElement() const;
63  Q_REQUIRED_RESULT QString logoImgElement() const;
64 
65  Q_REQUIRED_RESULT QString formattedBirthday() const;
66  Q_REQUIRED_RESULT QString formattedAnniversary() const;
67 };
68 
69 }
70 
72 
Additional properties for the KContacts::Addressee Grantlee model.
static QString noteLabel()
Picture photo() const
static QString birthdayLabel()
static QString departmentLabel()
Picture logo() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Wed Jun 23 2021 23:09:24 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.