ximpfw/core/srcdatamodel/ximpfeatureinfoimp.h
changeset 0 e6b17d312c8b
equal deleted inserted replaced
-1:000000000000 0:e6b17d312c8b
       
     1 /*
       
     2 * Copyright (c) 2006 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:  MXIMPFeatureInfo API object implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CXIMPFEATUREINFOIMP_H
       
    19 #define CXIMPFEATUREINFOIMP_H
       
    20 
       
    21 
       
    22 #include "ximpapidataobjbase.h"
       
    23 #include <ximpfeatureinfo.h>
       
    24 #include <s32strm.h> // RWriteStream, RReadStream
       
    25 #include <badesca.h> // CDesC8ArraySeg
       
    26 
       
    27 
       
    28 /**
       
    29  * MXIMPFeatureInfo API object implementation.
       
    30  *
       
    31  * @lib ximpdatamodel.dll
       
    32  * @since S60 v3.2
       
    33  */
       
    34 NONSHARABLE_CLASS( CXIMPFeatureInfoImp ): public CXIMPApiDataObjBase,
       
    35                                           public MXIMPFeatureInfo
       
    36     {
       
    37 public:
       
    38     /** The class ID. */
       
    39     enum { KClassId = XIMPIMP_CLSID_CXIMPFEATUREINFOIMP };
       
    40 
       
    41 
       
    42 public:
       
    43 
       
    44     IMPORT_C static CXIMPFeatureInfoImp* NewLC();
       
    45     IMPORT_C static CXIMPFeatureInfoImp* NewL();
       
    46     virtual ~CXIMPFeatureInfoImp();
       
    47 
       
    48 
       
    49 private:
       
    50 
       
    51     CXIMPFeatureInfoImp();
       
    52     void ConstructL();
       
    53     
       
    54     /**
       
    55      * @see CXIMPApiDataObjBase
       
    56      */
       
    57     XIMPIMP_DECLARE_DATAOBJ_BASE_PRIV_METHODS
       
    58 
       
    59 
       
    60 public: // From MXIMPBase
       
    61 
       
    62     /**
       
    63      * Implementation of MXIMPBase interface methods
       
    64      * @see MXIMPBase
       
    65      */
       
    66     XIMPIMP_DECLARE_IF_BASE_METHODS
       
    67 
       
    68     /**
       
    69      * @see CXIMPApiDataObjBase
       
    70      */
       
    71     XIMPIMP_DECLARE_DATAOBJ_BASE_METHODS
       
    72 
       
    73 public: // From MXIMPFeatureInfo
       
    74 
       
    75     /**
       
    76      * Implementation of MXIMPFeatureInfo interface methods
       
    77      * @see MXIMPFeatureInfo
       
    78      */
       
    79     const MDesC8Array& FeatureIds() const;
       
    80     TInt HasFeatureId( const TDesC8& aFeatureId );
       
    81 
       
    82 
       
    83 public: // New methods
       
    84 
       
    85     /**
       
    86      * Adds a feature.
       
    87      *
       
    88      * @param aFeature Feature to be added.
       
    89      * @return KErrNone if the feature was added successfully,
       
    90      *         KErrAlreadyExists if the feature already exists,
       
    91      */
       
    92     IMPORT_C TInt AddFeatureL( const TDesC8& aFeature );
       
    93 
       
    94     /**
       
    95      * Internalizes object data from given stream.
       
    96      * @param aStream Stream to read.
       
    97      */
       
    98     IMPORT_C void InternalizeL( RReadStream& aStream );
       
    99 
       
   100 
       
   101 private: // helpers
       
   102 
       
   103     /**
       
   104      * Find a feature from features.
       
   105      *
       
   106      * @param [in] aFeature That is searched.
       
   107      * @param [out] aIndex If found the index position of the found feature,
       
   108      *                     if not found the place where it should be inserted.
       
   109      * @return KErrNone if the feature exists,
       
   110      *         KErrNotFound if the feature isn't found,
       
   111      */
       
   112     TInt FindFeature( const TDesC8& aFeature, TInt& aIndex );
       
   113 
       
   114 
       
   115 private: // data
       
   116 
       
   117     /**
       
   118      * Supported features
       
   119      * Own.
       
   120      */
       
   121     CDesC8ArraySeg* iFeatures;
       
   122 
       
   123     };
       
   124 
       
   125 
       
   126 #endif // CXIMPFEATUREINFOIMP_H