85
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
87
|
14 |
* Description:
|
85
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef CANOTIFIERS_H
|
|
19 |
#define CANOTIFIERS_H
|
|
20 |
|
|
21 |
#include <QHash>
|
|
22 |
#include <QPair>
|
|
23 |
|
|
24 |
#include "canotifier_p.h"
|
|
25 |
|
|
26 |
class CaNotifierFilter;
|
93
|
27 |
class CaObserver;
|
85
|
28 |
|
|
29 |
class CaNotifiers
|
|
30 |
{
|
|
31 |
public:
|
|
32 |
static int addNotifier(const CaNotifierFilter *notifierFilter,
|
87
|
33 |
CaNotifierPrivate::NotifierType notifierType,
|
93
|
34 |
const CaObserver *notifierProxy);
|
85
|
35 |
|
|
36 |
static void removeNotifier(const CaNotifierFilter *notifierFilter,
|
87
|
37 |
CaNotifierPrivate::NotifierType notifierType);
|
85
|
38 |
|
|
39 |
static void Notify(int groupId);
|
|
40 |
|
92
|
41 |
static void NotifyTouched(int id);
|
|
42 |
|
85
|
43 |
static void Notify(const CaEntry &targetEntry,
|
87
|
44 |
ChangeType changeType,
|
|
45 |
QList<int> &parentIds);
|
85
|
46 |
|
|
47 |
private:
|
|
48 |
static bool isRegisterdForNotification(
|
|
49 |
const CaNotifierFilter &filter,
|
|
50 |
const CaEntry &entry,
|
|
51 |
const QList<int> &parentIds);
|
87
|
52 |
|
85
|
53 |
private:
|
|
54 |
typedef QPair<const CaNotifierFilter *,
|
87
|
55 |
CaNotifierPrivate::NotifierType> NotifierKey;
|
93
|
56 |
typedef QHash<NotifierKey, const CaObserver *> NotifierHash;
|
85
|
57 |
|
|
58 |
private:
|
|
59 |
static NotifierHash mNotifiers;
|
|
60 |
|
|
61 |
};
|
|
62 |
|
92
|
63 |
#endif // CANOTIFIERS_H
|