upnpharvester/common/cmlibrary/inc/cmstorerulecontainer.h
branchIOP_Improvements
changeset 40 08b5eae9f9ff
parent 39 6369bfd1b60d
child 41 b4d83ea1d6e2
equal deleted inserted replaced
39:6369bfd1b60d 40:08b5eae9f9ff
     1 /*
       
     2 * Copyright (c) 2006-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 store rules
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 #ifndef __CMSTORERULECONTAINER_H
       
    24 #define __CMSTORERULECONTAINER_H
       
    25 
       
    26 // INCLUDES
       
    27 #include <e32base.h>
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class RWriteStream;
       
    31 class RReadStream;
       
    32 class CCmStoreRule;
       
    33 
       
    34 /**
       
    35  *  CCmStoreRuleContainer class
       
    36  *    Capsulating store rules
       
    37  *  @lib cmcommon.lib
       
    38  *  @since S60 v3.0
       
    39  */
       
    40 class CCmStoreRuleContainer : public CBase
       
    41     {
       
    42 
       
    43 public:
       
    44 
       
    45     /* Constructors and destructor. */
       
    46 
       
    47     /**
       
    48      * Creates new CCmStoreRuleContainer class.
       
    49      * @param None
       
    50      * @return  pointer to CCmStoreRuleContainer class
       
    51      */
       
    52     IMPORT_C static CCmStoreRuleContainer* NewL();
       
    53     
       
    54     /**
       
    55      * Creates new CCmStoreRuleContainer class and 
       
    56      * leaves the instance in the cleanup stack.
       
    57      * @param None
       
    58      * @return  pointer to CCmStoreRuleContainer class
       
    59      */
       
    60     IMPORT_C static CCmStoreRuleContainer* NewLC();
       
    61 
       
    62     /**
       
    63      * Destructor.
       
    64      */
       
    65     IMPORT_C virtual ~CCmStoreRuleContainer();
       
    66 
       
    67 public:
       
    68 
       
    69     /**
       
    70      * AddStoreRuleL.
       
    71      * @since Series 60 3.1     
       
    72      * @param aRule
       
    73      * @returns index of the rule
       
    74      */
       
    75     IMPORT_C TInt AddStoreRuleL( CCmStoreRule* aRule );
       
    76 
       
    77     /**
       
    78      * DeleteStoreRule.
       
    79      * @since Series 60 3.1
       
    80      * @param Index
       
    81      * @returns None
       
    82      */    
       
    83     IMPORT_C void DeleteStoreRule( TInt aIndex );
       
    84 
       
    85     /**
       
    86      * StoreRule.
       
    87      * @since Series 60 3.1     
       
    88      * @param aIndex rule index
       
    89      * @returns store rule
       
    90      */    
       
    91     IMPORT_C CCmStoreRule* StoreRule( TInt aIndex );
       
    92 
       
    93     /**
       
    94      * StoreRuleCount.
       
    95      * @since Series 60 3.1     
       
    96      * @param None
       
    97      * @returns count
       
    98      */    
       
    99     IMPORT_C TInt StoreRuleCount() const;
       
   100     
       
   101     /**
       
   102     * Externalizes container information to stream.
       
   103     * Leaves in case of errors.
       
   104     * @since Series 60 3.1
       
   105     * @param reference to RWriteStream
       
   106     * @return none
       
   107     */
       
   108     IMPORT_C void ExternalizeL( RWriteStream& aStream ) const;
       
   109     
       
   110     /**
       
   111     * Internalizes container information from stream.
       
   112     * Leaves in case of errors.
       
   113     * @since Series 60 3.1
       
   114     * @param reference to RReadStream
       
   115     * @return none
       
   116     */
       
   117     IMPORT_C void InternalizeL( RReadStream& aStream );    
       
   118     
       
   119 private:
       
   120 
       
   121     /**
       
   122      * Constructor.
       
   123      */
       
   124     CCmStoreRuleContainer();
       
   125 
       
   126     /**
       
   127      * Second-phase constructor.
       
   128      */
       
   129     void ConstructL();
       
   130     
       
   131 
       
   132 private: // data
       
   133     
       
   134     // Array rules included to fill rule. 
       
   135     RPointerArray<CCmStoreRule> iStoreRuleArray; // Items owned
       
   136 
       
   137     };
       
   138 
       
   139 #endif //  __CMSTORERULECONTAINER_H