KPeople

peopleqmlplugin.h
1/*
2 Persons Model
3 SPDX-FileCopyrightText: 2012 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
4
5 SPDX-License-Identifier: LGPL-2.1-or-later
6*/
7
8#ifndef PEOPLEQMLPLUGIN_H
9#define PEOPLEQMLPLUGIN_H
10
11#include <QQmlEngine>
12#include <QQmlExtensionPlugin>
13
14#include "personsmodel.h"
15#include <KPeople/PersonPluginManager>
16#include <actions.h>
17#include <personactionsmodel_p.h>
18#include <personssortfilterproxymodel.h>
19
20class DeclarativePersonPluginManager : public QObject
21{
23 QML_SINGLETON
24 QML_NAMED_ELEMENT(PersonPluginManager)
25
26public:
27 Q_SCRIPTABLE bool addContact(const QVariantMap &properties)
28 {
30 }
31 Q_SCRIPTABLE bool deleteContact(const QString &uri)
32 {
34 }
35};
36
37namespace ActionType
38{
39Q_NAMESPACE
40QML_ELEMENT
41
42enum ActionType {
43 TextChatAction = KPeople::TextChatAction,
44 AudioCallAction = KPeople::AudioCallAction,
45 VideoCallAction = KPeople::VideoCallAction,
46 SendEmailAction = KPeople::SendEmailAction,
47 SendFileAction = KPeople::SendFileAction,
48 OtherAction = KPeople::OtherAction,
49};
50Q_ENUM_NS(ActionType)
51};
52
53class PeopleQMLPlugin : public QQmlExtensionPlugin
54{
56 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
57public:
58 void initializeEngine(QQmlEngine *engine, const char *uri) override;
59 void registerTypes(const char *uri) override;
60};
61
62struct PersonDataForeign {
63 Q_GADGET
64 QML_FOREIGN(KPeople::PersonData)
65 QML_ANONYMOUS
66};
67
68struct PersonsModelForeign {
69 Q_GADGET
70 QML_FOREIGN(KPeople::PersonsModel)
71 QML_NAMED_ELEMENT(PersonsModel)
72};
73
74class PersonsSortFilterProxyModelForeign
75{
76 Q_GADGET
78 QML_NAMED_ELEMENT(PersonsSortFilterProxyModel)
79};
80
81#endif // PEOPLEQMLPLUGIN_H
Allows to query the information about a given person.
Definition persondata.h:35
static bool addContact(const QVariantMap &properties)
Creates a contact with the specified properties.
static bool deleteContact(const QString &uri)
Deletes a contact with the specified &p uri.
This class creates a model of all known contacts from all sources Contacts are represented as a tree ...
Helps filtering and sorting PersonsModel.
Q_OBJECTQ_OBJECT
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.