contentstorage/caclient/s60/inc/caclientnotifierproxy.h
changeset 93 82b66994846c
parent 87 9d806967057c
equal deleted inserted replaced
92:782e3408c2ab 93:82b66994846c
    28 #include "caclientnotifiersession.h"
    28 #include "caclientnotifiersession.h"
    29 
    29 
    30 class CaEntry;
    30 class CaEntry;
    31 class CaNotifierFilter;
    31 class CaNotifierFilter;
    32 
    32 
    33 /**
    33 class CACLIENT_EXPORT CaClientNotifierProxy: public QObject
    34  *  IDataObserver
       
    35  *
       
    36  */
       
    37 class IDataObserver
       
    38 {
       
    39 public:
       
    40     /**
       
    41      * Method invoked when entry is changed.
       
    42      * @param entryId entry id.
       
    43      * @param changeType change type.
       
    44      */
       
    45     virtual void entryChanged(TInt entryId,
       
    46                               TChangeType changeType) const = 0;
       
    47 
       
    48     /**
       
    49      * Method invoked when entry is changed.
       
    50      * @param entry entry.
       
    51      * @param changeType change type.
       
    52      */
       
    53     virtual void entryChanged(const CCaInnerEntry &entry,
       
    54                               TChangeType changeType) const = 0;
       
    55 
       
    56     /**
       
    57      * Method invoked when entry was changed.
       
    58      * @param entryId entry id.
       
    59      */
       
    60     virtual void entryTouched(TInt id) const = 0;
       
    61 
       
    62     /**
       
    63      * Method invoked when entry was changed.
       
    64      * @param groupId group id.
       
    65      */
       
    66     virtual void groupContentChanged(TInt groupId) const = 0;
       
    67 };
       
    68 
       
    69 class CACLIENT_EXPORT CaClientNotifierProxy: public QObject,
       
    70     public IDataObserver
       
    71 {
    34 {
    72     Q_OBJECT
    35     Q_OBJECT
    73 
    36 
    74 public:
    37 public:
    75 
    38 
    83      * Destructor.
    46      * Destructor.
    84      */
    47      */
    85     ~CaClientNotifierProxy();
    48     ~CaClientNotifierProxy();
    86 
    49 
    87     /**
    50     /**
    88      * Method invoked when entry is changed.
       
    89      * @param entryId entry id.
       
    90      * @param changeType change type.
       
    91      */
       
    92     virtual void entryChanged(TInt entryId, TChangeType changeType) const;
       
    93 
       
    94     /**
       
    95      * Method invoked when entry is changed.
       
    96      * @param entry entry.
       
    97      * @param changeType change type.
       
    98      */
       
    99     virtual void entryChanged(const CCaInnerEntry &entry,
       
   100                               TChangeType changeType) const;
       
   101 
       
   102     /**
       
   103      * Method invoked when entry was changed.
       
   104      * @param entryId entry id.
       
   105      */
       
   106     virtual void entryTouched(TInt entryId) const;
       
   107 
       
   108     /**
       
   109      * Method invoked when entry was changed.
       
   110      * @param groupId group id.
       
   111      */
       
   112     virtual void groupContentChanged(TInt groupId) const;
       
   113 
       
   114     /**
       
   115      * Method for registering notifier
    51      * Method for registering notifier
   116      *
    52      *
   117      * @param notifierFilter notifierFilter used to register notifier.
    53      * @param notifierFilter notifierFilter used to register notifier.
   118      * @param notifierType type of notifier
    54      * @param notifierType type of notifier
   119      * @return error code
    55      * @return error code
   120      */
    56      */
   121     int registerNotifier(
    57     int registerNotifier(
   122         const CaNotifierFilter *notifierFilter,
    58         const CaNotifierFilter *notifierFilter,
   123         CaNotifierPrivate::NotifierType notifierType,
    59         CaNotifierPrivate::NotifierType notifierType,
   124         const CaClientNotifierProxy *notifierProxy);
    60         const IDataObserver *observer);
   125 
    61 
   126     /**
    62     /**
   127      * Method for unregistering notifier.
    63      * Method for unregistering notifier.
   128      *
    64      *
   129      * @param notifierFilter notifierFilter used to unregister notifier.
    65      * @param notifierFilter notifierFilter used to unregister notifier.
   131      */
    67      */
   132     void unregisterNotifier(
    68     void unregisterNotifier(
   133         const CaNotifierFilter &notifierFilter,
    69         const CaNotifierFilter &notifierFilter,
   134         CaNotifierPrivate::NotifierType notifierType);
    70         CaNotifierPrivate::NotifierType notifierType);
   135 
    71 
   136 signals:
    72     /**
   137 
    73      * Reconnect all sessions when server was terminated
   138     void signalEntryChanged(int entryId, ChangeType changeType) const;
    74      *
   139     void signalEntryChanged(const CaEntry &entry,
    75      */
   140                             ChangeType changeType) const;
    76     void connectSessions();
   141     void signalEntryTouched(int id) const;
       
   142     void signalGroupContentChanged(int groupId) const;
       
   143 
    77 
   144 private:
    78 private:
   145     /**
    79     /**
   146      * Method for finding a session with free slots.
    80      * Method for finding a session with free slots.
   147      *
    81      *
   179     QMutex mMutex;
   113     QMutex mMutex;
   180 
   114 
   181     Q_DISABLE_COPY(CaClientNotifierProxy)
   115     Q_DISABLE_COPY(CaClientNotifierProxy)
   182 
   116 
   183     friend class CaClientProxy;
   117     friend class CaClientProxy;
   184     friend class CaClientObserver;
       
   185 
   118 
   186 };
   119 };
   187 
   120 
   188 #endif //_CACLIENTNOTIFIERPROXY_H
   121 #endif //_CACLIENTNOTIFIERPROXY_H