contentstorage/caclient/s60/inc/caobserver.h
changeset 93 82b66994846c
child 107 b34d53f6acdf
equal deleted inserted replaced
92:782e3408c2ab 93:82b66994846c
       
     1 /*
       
     2  * Copyright (c) 2010 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 : Content Arsenal client session
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef CAOBSERVER_H_
       
    19 #define CAOBSERVER_H_
       
    20 
       
    21 #include <QObject>
       
    22 
       
    23 #include "cadef.h"
       
    24 #include "cadefs.h"
       
    25 
       
    26 
       
    27 class CCaInnerEntry;
       
    28 class CaEntry;
       
    29 
       
    30 /**
       
    31  *  IDataObserver
       
    32  *
       
    33  */
       
    34 class IDataObserver
       
    35 {
       
    36 public:
       
    37     /**
       
    38      * Method invoked when entry is changed.
       
    39      * @param entryId entry id.
       
    40      * @param changeType change type.
       
    41      */
       
    42     virtual void entryChanged(TInt entryId,
       
    43                               TChangeType changeType) const = 0;
       
    44 
       
    45     /**
       
    46      * Method invoked when entry is changed.
       
    47      * @param entry entry.
       
    48      * @param changeType change type.
       
    49      */
       
    50     virtual void entryChanged(const CCaInnerEntry &entry,
       
    51                               TChangeType changeType) const = 0;
       
    52 
       
    53     /**
       
    54      * Method invoked when entry was changed.
       
    55      * @param entryId entry id.
       
    56      */
       
    57     virtual void entryTouched(TInt id) const = 0;
       
    58 
       
    59     /**
       
    60      * Method invoked when entry was changed.
       
    61      * @param groupId group id.
       
    62      */
       
    63     virtual void groupContentChanged(TInt groupId) const = 0;
       
    64 };
       
    65 
       
    66 
       
    67 
       
    68 class CaObserver: public QObject, public IDataObserver
       
    69 {
       
    70     Q_OBJECT
       
    71 public:
       
    72     /**
       
    73      * Constructor.
       
    74      * @param parent pointer to parent. Defaults to NULL.
       
    75      */
       
    76     CaObserver(QObject *parent = 0);
       
    77 
       
    78     /**
       
    79      * Destructor.
       
    80      */
       
    81     ~CaObserver();
       
    82     
       
    83     /**
       
    84      * Method invoked when entry is changed.
       
    85      * @param entryId entry id.
       
    86      * @param changeType change type.
       
    87      */
       
    88     void entryChanged(TInt entryId,
       
    89                               TChangeType changeType) const;
       
    90 
       
    91     /**
       
    92      * Method invoked when entry is changed.
       
    93      * @param entry entry.
       
    94      * @param changeType change type.
       
    95      */
       
    96     void entryChanged(const CCaInnerEntry &entry,
       
    97                               TChangeType changeType) const;
       
    98 
       
    99     /**
       
   100      * Method invoked when entry was changed.
       
   101      * @param entryId entry id.
       
   102      */
       
   103     void entryTouched(TInt id) const ;
       
   104 
       
   105     /**
       
   106      * Method invoked when entry was changed.
       
   107      * @param groupId group id.
       
   108      */
       
   109     void groupContentChanged(TInt groupId) const;
       
   110 
       
   111 signals:
       
   112 
       
   113     void signalEntryChanged(int entryId, ChangeType changeType) const;
       
   114     void signalEntryChanged(const CaEntry &entry,
       
   115                             ChangeType changeType) const;
       
   116     void signalEntryTouched(int id) const;
       
   117     void signalGroupContentChanged(int groupId) const;
       
   118 };
       
   119 
       
   120 
       
   121 #endif /* CAOBSERVER_H_ */