browserutilities/favouritesengine/ClientServer/srvinc/FavouritesMsg.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 TFavouritesHandle and TFavouritesMsg.
       
    16 *      
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef FAVOURITES_MSG_H
       
    22 #define FAVOURITES_MSG_H
       
    23 
       
    24 //  INCLUDES
       
    25 
       
    26 #include <e32std.h>
       
    27 #include "FavouritesPanic.h"
       
    28 
       
    29 /// Favourites Engine functions.
       
    30 enum TFavouritesFunction
       
    31     {
       
    32     EFavengNullFunction,
       
    33     
       
    34     // Functions with test capability
       
    35     EFavengTestCapabilityStart,
       
    36     
       
    37     EFavengResourceMarkStart,
       
    38     EFavengResourceMarkEnd,
       
    39     EFavengResourceCount,
       
    40     EFavengSetHeapFailure,
       
    41     
       
    42     EFavengTestCapabilityEnd,
       
    43     
       
    44     // Functions with read user data capability
       
    45     EFavengReadCapabilityStart,
       
    46     
       
    47     EFavengOpenDatabase,
       
    48     EFavengOpenNotifier,
       
    49     EFavengOpenStream,
       
    50     EFavengIsDamaged,
       
    51     EFavengSize,
       
    52     EFavengClose,
       
    53     EFavengGet,
       
    54     EFavengGetAll,
       
    55     EFavengGetUids,
       
    56     EFavengPreferredUid,
       
    57     EFavengItemExists,
       
    58     EFavengFolderExists,
       
    59     EFavengCount,
       
    60     EFavengGetData,
       
    61     EFavengGetBrowserData,
       
    62     EFavengFileOpen,
       
    63     EFavengFileOpenRead,
       
    64     EFavengNotifyAllEvents,
       
    65     EFavengNotifyChange,
       
    66     EFavengNotifyCancel,
       
    67     EFavengStreamRead,
       
    68     
       
    69     EFavengReadCapabilityEnd,
       
    70     
       
    71     // Functions with write user data capability
       
    72     EFavengWriteCapabilityStart,
       
    73     
       
    74     EFavengDeleteDatabase,
       
    75     EFavengRecover,
       
    76     EFavengCompact,
       
    77     EFavengUpdateStats,
       
    78     EFavengBegin,
       
    79     EFavengCommit,
       
    80     EFavengRollback,
       
    81     EFavengDelete,
       
    82     EFavengUpdate,
       
    83     EFavengAdd,
       
    84     EFavengSetSpecialItem,
       
    85     EFavengSetFactoryItem,
       
    86     EFavengSetReadOnly,
       
    87     EFavengSetModified,
       
    88     EFavengSetPreferredUid,
       
    89     EFavengSetData,
       
    90     EFavengSetBrowserData,
       
    91     EFavengMakeUniqueName,
       
    92     EFavengRestoreFactorySettings,
       
    93     EFavengSetAccessPoints,
       
    94     EFavengFileOpenWrite,
       
    95     EFavengFileDelete,
       
    96     EFavengIncrementalRecover,
       
    97     EFavengIncrementalCompact,
       
    98     EFavengIncrementalNext,
       
    99     EFavengStreamWrite,
       
   100     
       
   101     EFavengWriteCapabilityEnd,
       
   102     
       
   103     EFavengMaxFunction                  // End marker for sanity check.
       
   104     };
       
   105 
       
   106 // CLASS DECLARATION
       
   107 
       
   108 /**
       
   109 * Favourites Engine handle.
       
   110 */
       
   111 NONSHARABLE_CLASS(TFavouritesHandle)
       
   112     {
       
   113     public:     // Constructor
       
   114 
       
   115         /**
       
   116         * Construct from index and check number.
       
   117         * @param aIndex Index.
       
   118         * @param aChkNum Check number.
       
   119         */
       
   120         inline TFavouritesHandle( TInt aIndex, TInt aChkNum );
       
   121 
       
   122         /**
       
   123         * Construct from handle number.
       
   124         * @param aIndex Index.
       
   125         * @param aChkNum Check number.
       
   126         */
       
   127         inline TFavouritesHandle( TInt aHandle );
       
   128 
       
   129     public:     // Operators
       
   130 
       
   131         /**
       
   132         * Convert to integer.
       
   133         */
       
   134         inline operator TInt() const;
       
   135 
       
   136     public:     // Getters
       
   137 
       
   138         /**
       
   139         * Get index.
       
   140         * @return Index.
       
   141         */
       
   142         inline TInt Index() const;
       
   143 
       
   144         /**
       
   145         * Get check number.
       
   146         * @return Check number.
       
   147         */
       
   148         inline TInt ChkNum() const;
       
   149 
       
   150         /**
       
   151         * Check if null handle.
       
   152         * @return Check number.
       
   153         */
       
   154         inline TBool IsNull() const;
       
   155 
       
   156     protected:  // Data
       
   157 
       
   158         TInt iData; ///< Data.
       
   159 
       
   160     };
       
   161 
       
   162 /**
       
   163 * Favourites Engine Message (a handle and a function packaged together).
       
   164 * For object-less functions, set the handle to 0.
       
   165 */
       
   166 NONSHARABLE_CLASS(TFavouritesMsg): public TFavouritesHandle
       
   167     {
       
   168     public:     // Constructors
       
   169 
       
   170         /**
       
   171         * Create from handle number and function.
       
   172         * @param aHandle Handle.
       
   173         * @param aFunction Function.
       
   174         */
       
   175         inline TFavouritesMsg( TInt aHandle, TInt aFunction );
       
   176 
       
   177         /**
       
   178         * Create from message.
       
   179         * @param aMsg Message.
       
   180         */
       
   181         inline TFavouritesMsg( TInt aMsg );
       
   182 
       
   183     public:     // Operators
       
   184 
       
   185         /**
       
   186         * Convert to integer.
       
   187         */
       
   188         inline operator TInt() const;
       
   189 
       
   190     public:     // Getters.
       
   191 
       
   192         /**
       
   193         * Get function.
       
   194         * @return Function.
       
   195         */
       
   196         inline TFavouritesFunction Function() const;
       
   197 
       
   198     };
       
   199 
       
   200 #include "FavouritesMsg.inl"
       
   201 
       
   202 #endif
       
   203 
       
   204 // End of File