browserutilities/favouritesengine/ClientServer/srvinc/FavouritesSrvSessionEntry.h
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2004 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 the License "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 *      Declaration of class TFavouritesSessionEntry and
       
    16 *                           CFavouritesSessionEntryList
       
    17 *      
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 #ifndef FAVOURITES_SRV_SESSION_ENTRY_H
       
    23 #define FAVOURITES_SRV_SESSION_ENTRY_H
       
    24 
       
    25 //  INCLUDES
       
    26 
       
    27 #include <e32base.h>
       
    28 #include "FavouritesDef.h"
       
    29 #include "FavouritesPanic.h"
       
    30 
       
    31 // FORWARD DECLARATION
       
    32 
       
    33 class CFavouritesSrvDb;
       
    34 class CFavouritesSrvDbNotifier;
       
    35 class CFavouritesSrvDbIncremental;
       
    36 class HFavouritesSrvStream;
       
    37 class CFavouritesSrvFile;
       
    38 
       
    39 // CLASS DECLARATIONS
       
    40 
       
    41 /**
       
    42 * Favourites Engine Server Session entry.
       
    43 */
       
    44 NONSHARABLE_CLASS(TFavouritesSessionEntry)
       
    45     {
       
    46     public:     // types
       
    47 
       
    48         enum TType          ///< Entry types.
       
    49             {
       
    50             ENone,          ///< No object (empty).
       
    51             EDatabase,      ///< Database.
       
    52             ENotifier,      ///< Notifier.
       
    53             EIncremental,   ///< Incremental.
       
    54             EStream,        ///< Stream.
       
    55             EFile           ///< File.
       
    56             };
       
    57 
       
    58     public:     // administration
       
    59 
       
    60         /**
       
    61         * Set object pointer to NULL (initialize / reset).
       
    62         */
       
    63         inline void SetNull();
       
    64 
       
    65         /**
       
    66         * Check if NULL.
       
    67         * @return ETrue if NULL.
       
    68         */
       
    69         inline TBool IsNull();
       
    70 
       
    71         /**
       
    72         * Delete object in entry and set to NULL.
       
    73         */
       
    74         void Release();
       
    75 
       
    76     public:     // operators (setters)
       
    77 
       
    78         /**
       
    79         * Set from a database.
       
    80         */
       
    81         inline void operator=( CFavouritesSrvDb& aDb );
       
    82 
       
    83         /**
       
    84         * Set from a notifier.
       
    85         */
       
    86         inline void operator=( CFavouritesSrvDbNotifier& aNotifier );
       
    87 
       
    88         /**
       
    89         * Set from a incremental.
       
    90         */
       
    91         inline void operator=( CFavouritesSrvDbIncremental& aIncremental );
       
    92 
       
    93         /**
       
    94         * Set from a stream.
       
    95         */
       
    96         inline void operator=( HFavouritesSrvStream& aStream );
       
    97 
       
    98         /**
       
    99         * Set from a file.
       
   100         */
       
   101         inline void operator=( CFavouritesSrvFile& aFile );
       
   102 
       
   103         /**
       
   104         * Access check number.
       
   105         */
       
   106         inline TInt& ChkNum();
       
   107 
       
   108     public:     // getters
       
   109 
       
   110         /**
       
   111         * Get type.
       
   112         */
       
   113         inline TType Type() const;
       
   114 
       
   115         /**
       
   116         * Get database.
       
   117         * @return Database.
       
   118         */
       
   119         inline CFavouritesSrvDb& Database();
       
   120 
       
   121         /**
       
   122         * Get notifier.
       
   123         * @return Notifier.
       
   124         */
       
   125         inline CFavouritesSrvDbNotifier& Notifier();
       
   126 
       
   127         /**
       
   128         * Get incremental.
       
   129         * @return Incremental.
       
   130         */
       
   131         inline CFavouritesSrvDbIncremental& Incremental();
       
   132 
       
   133         /**
       
   134         * Get incremental.
       
   135         * @return Incremental.
       
   136         */
       
   137         inline HFavouritesSrvStream& Stream();
       
   138 
       
   139         /**
       
   140         * Get file.
       
   141         * @return File.
       
   142         */
       
   143         inline CFavouritesSrvFile& File();
       
   144 
       
   145         /**
       
   146         * Get check number.
       
   147         */
       
   148         inline TInt ChkNum() const;
       
   149 
       
   150     private:    // data
       
   151 
       
   152         TType iType;        ///< Type.
       
   153         TAny* iObject;      ///< The object. Owned by the session.
       
   154         TInt iChkNum;       ///< Check number.
       
   155     };
       
   156 
       
   157 #include "FavouritesSrvSessionEntry.inl"
       
   158 
       
   159 #endif
       
   160 
       
   161 // End of File