• Skip to content
  • Skip to link menu
KDE API Documentation - contactmonitor.cpp Source File (KPeople)
  • KDE Home
  • Contact Us
 

KPeople

  • frameworks
  • kpeople
  • src
  • backends
contactmonitor.cpp
1 /*
2  Abstract class to load a monitor changes for a single contact
3  Copyright (C) 2013 David Edmundson <davidedmundson@kde.org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19 
20 #include "contactmonitor.h"
21 
22 using namespace KPeople;
23 
24 class KPeople::ContactMonitorPrivate
25 {
26 public:
27  QString m_contactUri;
28  AbstractContact::Ptr m_contact;
29 };
30 
31 ContactMonitor::ContactMonitor(const QString &contactUri)
32  : QObject(0),
33  d_ptr(new ContactMonitorPrivate)
34 {
35  Q_D(ContactMonitor);
36  d->m_contactUri = contactUri;
37 }
38 
39 ContactMonitor::~ContactMonitor()
40 {
41  delete d_ptr;
42 }
43 
44 void ContactMonitor::setContact(const AbstractContact::Ptr &contact)
45 {
46  Q_D(ContactMonitor);
47 
48  d->m_contact = contact;
49  Q_EMIT contactChanged();
50 }
51 
52 AbstractContact::Ptr ContactMonitor::contact() const
53 {
54  Q_D(const ContactMonitor);
55 
56  return d->m_contact;
57 }
58 
59 QString ContactMonitor::contactUri() const
60 {
61  Q_D(const ContactMonitor);
62 
63  return d->m_contactUri;
64 }
65 
66 #include "contactmonitor.moc"
KPeople::ContactMonitor::contactUri
QString contactUri() const
The ID of the contact being loaded.
Definition: contactmonitor.cpp:59
KPeople::ContactMonitor
This class loads data for a single contact from a datasource.
Definition: contactmonitor.h:42
KPeople::ContactMonitor::contact
AbstractContact::Ptr contact() const
The currently loaded information on this contact.
Definition: contactmonitor.cpp:52
KPeople
The KPeople namespace contains all the classes for Libkpeople.
KPeople::ContactMonitor::setContact
void setContact(const AbstractContact::Ptr &contact)
Sets or updates the contact and emits contactChanged Subclasses should call this when data is loaded ...
Definition: contactmonitor.cpp:44
KPeople::ContactMonitor::contactChanged
void contactChanged()
Emitted whenever the contact changes.
This file is part of the KDE documentation.
Documentation copyright © 1996-2015 The KDE developers.
Generated on Fri Feb 13 2015 15:16:39 by doxygen 1.8.9.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KPeople

Skip menu "KPeople"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • File List

Class Picker

Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal