~ubuntu-branches/ubuntu/trusty/ktp-kded-integration-module/trusty-proposed

« back to all changes in this revision

Viewing changes to contactnotify.h

  • Committer: Package Import Robot
  • Author(s): Rohan Garg
  • Date: 2013-03-07 16:28:32 UTC
  • mfrom: (1.2.6)
  • Revision ID: package-import@ubuntu.com-20130307162832-p5cr1zm131gcedas
Tags: 0.5.80-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (C) 2012 Rohan Garg <rohangarg@kubuntu.org>
 
3
 
 
4
    This library is free software; you can redistribute it and/or
 
5
    modify it under the terms of the GNU Lesser General Public
 
6
    License as published by the Free Software Foundation; either
 
7
    version 2.1 of the License, or (at your option) any later version.
 
8
 
 
9
    This library is distributed in the hope that it will be useful,
 
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
    Lesser General Public License for more details.
 
13
 
 
14
    You should have received a copy of the GNU Lesser General Public
 
15
    License along with this library; if not, write to the Free Software
 
16
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
17
*/
 
18
 
 
19
#ifndef CONTACTNOTIFY_H
 
20
#define CONTACTNOTIFY_H
 
21
 
 
22
#include <TelepathyQt/Types>
 
23
#include <TelepathyQt/Connection>
 
24
 
 
25
#include <KTp/global-contact-manager.h>
 
26
 
 
27
class KIcon;
 
28
 
 
29
using namespace KTp;
 
30
 
 
31
class ContactNotify : public QObject
 
32
{
 
33
    Q_OBJECT
 
34
public:
 
35
    ContactNotify(const Tp::AccountManagerPtr &accountMgr, QObject *parent = 0);
 
36
 
 
37
private Q_SLOTS:
 
38
    void onContactsChanged(const Tp::Contacts &contactsAdded, const Tp::Contacts &contactsRemoved);
 
39
    void contactPresenceChanged(const Tp::Presence &presence);
 
40
 
 
41
private:
 
42
    Tp::AccountManagerPtr m_accountManager;
 
43
    void sendNotification(const QString &text, const KIcon &icon, const Tp::ContactPtr &contact);
 
44
    QHash<QString, int> m_presenceHash;
 
45
};
 
46
 
 
47
#endif // CONTACTNOTIFY_H