contentstorage/caclient/stub/inc/canotifiers.h
changeset 60 f62f87b200ec
child 66 32469d7d46ff
equal deleted inserted replaced
4:1a2a00e78665 60:f62f87b200ec
       
     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  *
       
    14  * Description:
       
    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;
       
    27 class CaClientNotifierProxy;
       
    28 
       
    29 class CaNotifiers
       
    30 {
       
    31 public:
       
    32     static int addNotifier(const CaNotifierFilter *notifierFilter,
       
    33                            CaNotifierPrivate::NotifierType notifierType,
       
    34                            const CaClientNotifierProxy *notifierProxy);
       
    35 
       
    36     static void removeNotifier(const CaNotifierFilter *notifierFilter,
       
    37                                CaNotifierPrivate::NotifierType notifierType);
       
    38 
       
    39     static void Notify(int groupId);
       
    40 
       
    41     static void Notify(const CaEntry &targetEntry,
       
    42                        ChangeType changeType,
       
    43                        QList<int> &parentIds);
       
    44 
       
    45 private:
       
    46     static bool isRegisterdForNotification(
       
    47         const CaNotifierFilter &filter,
       
    48         const CaEntry &entry,
       
    49         const QList<int> &parentIds);
       
    50 
       
    51 private:
       
    52     typedef QPair<const CaNotifierFilter *,
       
    53             CaNotifierPrivate::NotifierType> NotifierKey;
       
    54     typedef QHash<NotifierKey, const CaClientNotifierProxy *> NotifierHash;
       
    55 
       
    56 private:
       
    57     static NotifierHash mNotifiers;
       
    58 
       
    59 };
       
    60 
       
    61 #endif // CANOTIFIERS_H