upnpharvester/common/cmlibrary/inc/cmsearchresponsehash.h
changeset 0 7f85d04be362
equal deleted inserted replaced
-1:000000000000 0:7f85d04be362
       
     1 /*
       
     2 * Copyright (c) 2007 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:      Capsulating Search response hash
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 #ifndef __CMSEARCHRESPONSEHASH_H
       
    24 #define __CMSEARCHRESPONSEHASH_H
       
    25 
       
    26 #include <e32base.h>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class RWriteStream;
       
    30 class RReadStream;
       
    31 
       
    32 /**
       
    33  *  CCmSearchResponseHash class
       
    34  *  Capsulating search responce hash
       
    35  *  @lib cmcommon.lib
       
    36  *  @since S60 v3.2
       
    37  */
       
    38 class CCmSearchResponseHash : public CBase
       
    39     {
       
    40 public:
       
    41     
       
    42     /* Constructors and destructor. */
       
    43 
       
    44     /**
       
    45      * Creates new CCmSearchResponseHash class.
       
    46      * @param aStartIndex, starting search index
       
    47      * @param aItemCount, count of search items
       
    48      * @param aHash, calculated hash code
       
    49      * @return  pointer to CCmSearchResponseHash class
       
    50      */        
       
    51     IMPORT_C static CCmSearchResponseHash* NewL( TInt aStartIndex,
       
    52                                          TInt aItemCount,
       
    53                                          const TDesC8& aHash );
       
    54 
       
    55     /**
       
    56      * Creates new CCmSearchResponseHash class.
       
    57      * @param None
       
    58      * @return  pointer to CCmSearchResponseHash class
       
    59      */ 
       
    60     IMPORT_C static CCmSearchResponseHash* NewL();                                             
       
    61  
       
    62     /**
       
    63      * Destructor
       
    64      */      
       
    65     virtual ~CCmSearchResponseHash();
       
    66     
       
    67 public:
       
    68         
       
    69     /**
       
    70      * Returns hash code
       
    71      * @param None
       
    72      * @return  Hash code 
       
    73      */         
       
    74     IMPORT_C const TDesC8& Hash() const;
       
    75 
       
    76     /**
       
    77      * Returns hash code
       
    78      * @param None
       
    79      * @return  Hash code 
       
    80      */ 
       
    81     IMPORT_C void SetHashL( const TDesC8& aHash );     
       
    82     
       
    83     /**
       
    84      * Returns starting index of search
       
    85      * @param None
       
    86      * @return  starting index 
       
    87      */     
       
    88     IMPORT_C TInt StartIndex() const;
       
    89     
       
    90     /**
       
    91      * Sets starting index
       
    92      * @param aStartIndex, starting searh index
       
    93      * @return None
       
    94      */     
       
    95     IMPORT_C void SetStartIndex( TInt aStartIndex );
       
    96     
       
    97     /**
       
    98      * Returns item count
       
    99      * @param None
       
   100      * @return  Item count 
       
   101      */     
       
   102     IMPORT_C TInt ItemCount() const;
       
   103     
       
   104     /**
       
   105      * Sets item count
       
   106      * @param aItemCount, count of items
       
   107      * @return  None
       
   108      */     
       
   109     IMPORT_C void SetItemCount( TInt aItemCount );
       
   110         
       
   111      /**
       
   112     * Externalizes search has information to stream.
       
   113     * Leaves in case of errors.
       
   114     * @since Series 60 3.1
       
   115     * @param reference to RWriteStream
       
   116     * @return none
       
   117     */
       
   118     void ExternalizeL( RWriteStream& aStream ) const;
       
   119     
       
   120     /**
       
   121     * Internalizes search hash information from stream.
       
   122     * Leaves in case of errors.
       
   123     * @since Series 60 3.1
       
   124     * @param reference to RReadStream
       
   125     * @return none
       
   126     */
       
   127     void InternalizeL( RReadStream& aStream );    
       
   128         
       
   129 private:
       
   130 
       
   131     /**
       
   132      * Constructor
       
   133      */ 
       
   134     CCmSearchResponseHash();
       
   135         
       
   136     /**
       
   137      * Constructor
       
   138      */         
       
   139     void ConstructL( TInt aStartIndex,
       
   140                          TInt aItemCount,
       
   141                          const TDesC8& aHash );
       
   142         
       
   143 private:
       
   144 
       
   145     /** Start search index **/
       
   146     TInt    iStartIndex;
       
   147     
       
   148     /** Item count **/        
       
   149     TInt    iItemCount;
       
   150         
       
   151     /** Hash code **/        
       
   152     HBufC8* iHash;          // owned
       
   153     
       
   154     };
       
   155 
       
   156 #endif //  __CMSEARCHRESPONCSEHASH_H