~ubuntu-branches/ubuntu/vivid/akonadi/vivid

« back to all changes in this revision

Viewing changes to server/src/notificationmanager.h

  • Committer: Package Import Robot
  • Author(s): Rohan Garg
  • Date: 2013-11-11 17:38:58 UTC
  • mfrom: (1.1.46)
  • Revision ID: package-import@ubuntu.com-20131111173858-kltz6s4ebjishfej
Tags: 1.10.80-0ubuntu1
* New upstream release
 - Update install files
 - Update disable_dbus_requiring_tests.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
#include "../libs/notificationmessage_p.h"
24
24
#include "../libs/notificationmessagev2_p.h"
 
25
#include "storage/entity.h"
25
26
 
26
27
#include <QtCore/QHash>
27
28
#include <QtCore/QObject>
28
29
#include <QtCore/QTimer>
29
30
#include <QtDBus/qdbuscontext.h>
30
31
 
 
32
class NotificationManagerTest;
 
33
 
31
34
namespace Akonadi {
32
35
 
33
36
class NotificationCollector;
60
63
    Q_SCRIPTABLE QDBusObjectPath subscribe( const QString &identifier );
61
64
 
62
65
    /**
 
66
     * Subscribe to notifications emitted by this manager.
 
67
     *
 
68
     * @param identifier Identifier to use for our subscription.
 
69
     * @param serverSideMonitor Whether client supports server-side monitoring
 
70
     * @return The path we got assigned. Contains identifier.
 
71
     */
 
72
    Q_SCRIPTABLE QDBusObjectPath subscribeV2( const QString &identifier, bool serverSideMonitor );
 
73
 
 
74
    /**
63
75
     * Unsubscribe from this manager.
64
76
     *
65
77
     * This method is for your inconvenience only. It's advisable to use the unsubscribe method
69
81
     */
70
82
    Q_SCRIPTABLE void unsubscribe( const QString &identifier );
71
83
 
 
84
    /**
 
85
     * Returns identifiers of currently subscribed sources
 
86
     */
 
87
    Q_SCRIPTABLE QStringList subscribers() const;
 
88
 
72
89
  Q_SIGNALS:
73
90
    Q_SCRIPTABLE void notify( const Akonadi::NotificationMessage::List &msgs );
74
91
 
 
92
    Q_SCRIPTABLE void subscribed( const QString &identifier );
 
93
    Q_SCRIPTABLE void unsubscribed( const QString &identifier );
 
94
 
75
95
  private Q_SLOTS:
76
96
    void slotNotify( const Akonadi::NotificationMessageV2::List &msgs );
77
97
 
78
98
  private:
79
 
 
80
99
    NotificationManager();
81
100
 
82
101
  private:
 
102
    void registerSource( NotificationSource *source );
 
103
    void unregisterSource( NotificationSource *source );
83
104
 
84
105
    static NotificationManager *mSelf;
85
106
    NotificationMessageV2::List mNotifications;
86
107
    QTimer mTimer;
87
108
 
88
 
    //! One message source for each subscibed process
89
 
    QHash<QString, NotificationSource*> mNotificationSources;
 
109
    //! One message source for each subscribed process
 
110
    QHash<QString, NotificationSource *> mNotificationSources;
90
111
 
 
112
    friend class NotificationSource;
 
113
    friend class ::NotificationManagerTest;
91
114
};
92
115
 
93
116
}