ximpfw/core/srcdatamodel/ximpconfigurationitembase.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:  Configuration item base for configuration items.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CXIMPPSCCONFIGURATIONITEMBASE_H
       
    19 #define CXIMPPSCCONFIGURATIONITEMBASE_H
       
    20 
       
    21 #include <e32base.h>
       
    22 #include "ximpconfigurationitem.h"
       
    23 #include "ximpsubscriptionitembase.h"
       
    24 
       
    25 /**
       
    26  * Configuration item base
       
    27  *
       
    28  * @since S60 v3.2
       
    29  */
       
    30 class CXIMPConfigurationItemBase : public CXIMPSubscriptionItemBase, 
       
    31                                    public MXIMPConfigurationItem
       
    32     {
       
    33 public: // Definitions
       
    34         
       
    35     /** 
       
    36      * Authorization status
       
    37      */
       
    38     enum TConfigurationStatus
       
    39         {
       
    40         ENotConfiguredAtAll,
       
    41         EConfiguredForOtherCtxOnly,
       
    42         EConfiguredForCtxOnly,
       
    43         EConfiguredForCtxAndOthers
       
    44         };
       
    45                 
       
    46 public: // Construction and destruction
       
    47 
       
    48     /**
       
    49      * Destruction
       
    50      * - Remember to inform parent about delete.
       
    51      */
       
    52     IMPORT_C virtual ~CXIMPConfigurationItemBase();
       
    53 
       
    54     /**
       
    55      * Construction
       
    56      */
       
    57     IMPORT_C CXIMPConfigurationItemBase( MXIMPItemParentBase& aParent );
       
    58         
       
    59     /**
       
    60      * Base construction. Must be called from inherited classes ConstructL
       
    61      */
       
    62     IMPORT_C void BaseConstructL();
       
    63      
       
    64     
       
    65 public: // New methods
       
    66     
       
    67     /**
       
    68      * Authorizationstatus for context. 
       
    69      *
       
    70      *   ENotConfiguredAtAll            - Configure not done by any context.
       
    71      *   EConfiguredForOtherCtxOnly     - Configure done by others but not aContext
       
    72      *   EConfiguredForCtxOnly          - Configure done by aContext only.
       
    73      *   EConfiguredForCtxAndOthers     - Configure done by others and aContext.
       
    74      *
       
    75      * @param aContext Check authorization status for aContext.
       
    76      */
       
    77     IMPORT_C TConfigurationStatus ConfigurationStatus( MXIMPPscContext* aContext );
       
    78     
       
    79     /**
       
    80      * Add configurator for item.
       
    81      * @param aContext. Context to be added.
       
    82      */
       
    83     IMPORT_C void AddConfiguratorL( MXIMPPscContext* aContext );
       
    84     
       
    85     /**
       
    86      * Remove configurator from item
       
    87      * @param aContext. Context to be removed.
       
    88      */
       
    89     IMPORT_C void RemoveConfigurator( MXIMPPscContext* aContext );
       
    90     
       
    91     /** 
       
    92      * Add configurator for item.
       
    93      * @param aItem. Item to be added.
       
    94      */
       
    95     IMPORT_C void AddConfiguratorL( CXIMPConfigurationItemBase* aItem );
       
    96 
       
    97     /**
       
    98      * Remove configurator from item
       
    99      * @param aContext. Item to be removed.
       
   100      */
       
   101     IMPORT_C void RemoveConfigurator( CXIMPConfigurationItemBase* aItem );
       
   102     
       
   103     
       
   104     
       
   105 public: // From CXIMPSubscriptionItemBase
       
   106 
       
   107     /**
       
   108      * @see CXIMPSubscriptionItemBase
       
   109      */
       
   110     IMPORT_C TBool IsContext( MXIMPPscContext* aContext ) const;    
       
   111 
       
   112     /**
       
   113      * @see CXIMPSubscriptionItemBase
       
   114      */
       
   115     IMPORT_C void ForceClose();
       
   116 
       
   117  
       
   118 public: // From MXIMPConfigurationItem
       
   119 
       
   120     
       
   121 protected: // Helpers
       
   122 
       
   123     /**
       
   124      * For linear ordering by pointers
       
   125      */
       
   126     static TInt OrderOfItems( const CXIMPConfigurationItemBase& aFirst, 
       
   127                               const CXIMPConfigurationItemBase& aSecond );
       
   128         
       
   129 protected: // New interface methods.
       
   130         
       
   131     
       
   132 protected: // Data
       
   133 
       
   134     /**
       
   135      * Configured contexts.
       
   136      */
       
   137     RPointerArray< MXIMPPscContext > iConfigContexts;
       
   138     RPointerArray< MXIMPPscContext > iPreConfigContexts;
       
   139     RPointerArray< CXIMPConfigurationItemBase > iConfigItems;
       
   140     RPointerArray< CXIMPConfigurationItemBase > iPreConfigItems;
       
   141     };
       
   142 
       
   143 
       
   144 /* ======================================================================== */
       
   145 
       
   146 
       
   147 
       
   148 #endif // CXIMPPSCCONFIGURATIONITEMBASE_H