contentstorage/caclient/s60/inc/caobserver.h
branchRCL_3
changeset 113 0efa10d348c0
equal deleted inserted replaced
111:053c6c7c14f3 113:0efa10d348c0
       
     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      * Method invoked when entry is changed.
       
    80      * @param entryId entry id.
       
    81      * @param changeType change type.
       
    82      */
       
    83     void entryChanged(TInt entryId,
       
    84                               TChangeType changeType) const;
       
    85 
       
    86     /**
       
    87      * Method invoked when entry is changed.
       
    88      * @param entry entry.
       
    89      * @param changeType change type.
       
    90      */
       
    91     void entryChanged(const CCaInnerEntry &entry,
       
    92                               TChangeType changeType) const;
       
    93 
       
    94     /**
       
    95      * Method invoked when entry was changed.
       
    96      * @param entryId entry id.
       
    97      */
       
    98     void entryTouched(TInt id) const ;
       
    99 
       
   100     /**
       
   101      * Method invoked when entry was changed.
       
   102      * @param groupId group id.
       
   103      */
       
   104     void groupContentChanged(TInt groupId) const;
       
   105 
       
   106 signals:
       
   107 
       
   108     void signalEntryChanged(int entryId, ChangeType changeType) const;
       
   109     void signalEntryChanged(const CaEntry &entry,
       
   110                             ChangeType changeType) const;
       
   111     void signalEntryTouched(int id) const;
       
   112     void signalGroupContentChanged(int groupId) const;
       
   113 };
       
   114 
       
   115 
       
   116 #endif /* CAOBSERVER_H_ */