KPeople 5.109.0
contactmonitor.h
1/*
2 Abstract class to load a monitor changes for a single contact
3 SPDX-FileCopyrightText: 2013 David Edmundson <davidedmundson@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.1-or-later
6*/
7
8#ifndef CONTACTMONITOR_H
9#define CONTACTMONITOR_H
10
11#include <QObject>
12
13#include <kpeoplebackend/kpeoplebackend_export.h>
14
15#include "abstractcontact.h"
16
17namespace KPeople
18{
19class ContactMonitorPrivate;
20
30class KPEOPLEBACKEND_EXPORT ContactMonitor : public QObject
31{
32 Q_OBJECT
33public:
34 ContactMonitor(const QString &contactUri);
35 ~ContactMonitor() override;
36
40 QString contactUri() const;
41
45 AbstractContact::Ptr contact() const;
46Q_SIGNALS:
51
52protected:
57 void setContact(const AbstractContact::Ptr &contact);
58
59private:
60 Q_DISABLE_COPY(ContactMonitor)
61 Q_DECLARE_PRIVATE(ContactMonitor)
62 ContactMonitorPrivate *d_ptr;
63};
64
65}
66typedef QSharedPointer<KPeople::ContactMonitor> ContactMonitorPtr;
67
68#endif // CONTACTMONITOR_H
This class loads data for a single contact from a datasource.
Definition contactmonitor.h:31
void setContact(const AbstractContact::Ptr &contact)
Sets or updates the contact and emits contactChanged Subclasses should call this when data is loaded ...
QString contactUri() const
The ID of the contact being loaded.
AbstractContact::Ptr contact() const
The currently loaded information on this contact.
void contactChanged()
Emitted whenever the contact changes.