webservices/wsframework/inc/msenlayeredproperties.h
changeset 0 62f9d29f7211
equal deleted inserted replaced
-1:000000000000 0:62f9d29f7211
       
     1 /*
       
     2 * Copyright (c) 2005 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: Header declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 #ifndef M_SEN_LAYERED_PROPERTIES_H
       
    26 #define M_SEN_LAYERED_PROPERTIES_H
       
    27 
       
    28 // INCLUDES
       
    29 #include <e32std.h>
       
    30 #include "MSenProperties.h"
       
    31 #include "MSenProperty.h"
       
    32 
       
    33 class MSenLayeredProperties : public MSenProperties // Does not implement ReadFromL(UTF-8), but DOES implement WriteToL() in a way, where a flat property is generated looping through all the layers..
       
    34     {
       
    35     public:
       
    36         /**
       
    37         * PropertiesClassType enumeration.
       
    38         */
       
    39         enum TSenPropertiesLayer
       
    40         	{
       
    41         	ESenTransportLayer          = 1,
       
    42         	ESenSereneLayer             = 2,
       
    43         	ESenFrameworkLayer          = 3,
       
    44         	ESenProviderSessionLayer    = 4,
       
    45         	ESenConsumerSessionLayer    = 5,
       
    46         	ESenMessageLayer            = 6,
       
    47         	ESenLastLayer               = ESenMessageLayer
       
    48         	};
       
    49         	
       
    50         	     
       
    51         	
       
    52         /**
       
    53         * Writes given layer from this properties object as descriptor
       
    54         * into a stream.
       
    55         * UTF-8 charset encoding will be used.
       
    56         * @since Series60
       
    57         * @param aLayer The layer to be used.
       
    58         * @param aWriteStream The stream to write to.
       
    59         */
       
    60         virtual void WriteToL(RWriteStream& aWriteStream, TSenPropertiesLayer aLayer) = 0;
       
    61 
       
    62         /**
       
    63         * Reads this properties object from the descriptor to given
       
    64         * layer.
       
    65         * UTF-8 charset encoding should be used.
       
    66         * @since Series60
       
    67         * @param aBuffer The buffer to read from.
       
    68         * @param aLayer The layer to be used.
       
    69         */
       
    70         virtual void ReadFromL(const TDesC8& aBuffer, TSenPropertiesLayer aLayer) = 0;
       
    71 
       
    72         /**
       
    73         * Get the given layer from these properties as UTF-8 charset
       
    74         * encoded descriptor.
       
    75         * @since Series60
       
    76         * @param aLayer The layer to be used.
       
    77         * @return a pointer to UTF-8 encoded descriptor.
       
    78         * Caller takes ownership.
       
    79         */
       
    80         virtual HBufC8* AsUtf8L(TSenPropertiesLayer aLayer) = 0;
       
    81 
       
    82         /**
       
    83         * Get the given layer from these properties as UTF-8 charset
       
    84         * encoded descriptor.
       
    85         * @since Series60
       
    86         * @param aLayer The layer to be used.
       
    87         * @return a pointer to UTF-8 encoded descriptor, which is
       
    88         * has been left on cleanup stack.
       
    89         * Caller takes ownership.
       
    90         */
       
    91         virtual HBufC8* AsUtf8LC(TSenPropertiesLayer aLayer) = 0;
       
    92         
       
    93         virtual TInt ShrinkTo(TSenPropertiesLayer aLayer) = 0;
       
    94         
       
    95         virtual void ExpandToL(TSenPropertiesLayer aLayer) = 0;
       
    96         
       
    97         virtual TSenPropertiesLayer TopLayer() = 0;
       
    98         
       
    99         /**
       
   100         * Sets new property.
       
   101         *
       
   102         * If property with given name does not exist, 
       
   103         * new property with given value will be added. Otherwise the value of
       
   104         * existing property will be updated.
       
   105         *
       
   106         * @since Series60
       
   107         * @param aName         Name of the property, which can be later used
       
   108         *                      to refer the given value.
       
   109         * @param aValue        Is the value of this property.
       
   110         * @param aLayer        The layer to be used.
       
   111         * @return              KErrNone if no error, or some of the system wide
       
   112         *                      error codes.
       
   113         * Leave codes:
       
   114         *                      According to implementing classes. 
       
   115         */
       
   116         virtual TInt SetPropertyL(const TDesC8& aName,
       
   117                                   const TDesC8& aValue,
       
   118                                   TSenPropertiesLayer aLayer) = 0;
       
   119         
       
   120         /**
       
   121         * Gets the value of the property behind certain name.
       
   122         * @since Series60
       
   123         * @param aName    The name identifying this property.
       
   124         * @param aValue   A TPtrC8 reference to be filled in with the value of
       
   125         *                 the property.
       
   126         * @param aLayer   The layer to be used.
       
   127         * @return         KErrNone if no error, or some of the system wide
       
   128         *                 error codes.
       
   129         */
       
   130         virtual TInt PropertyL(const TDesC8& aName,
       
   131                                TPtrC8& aValue,
       
   132                                TSenPropertiesLayer aLayer) = 0;
       
   133                                
       
   134         /**
       
   135         * Gets the MSenProperty of the property behind certain name.
       
   136         * @since Series60
       
   137         * @param aName    The name identifying this property.
       
   138         * @param aValue   A MSenProperty reference to pointer to be filled in with
       
   139         *                 the pointer to the property.
       
   140         * @param aLayer   The layer to be used.
       
   141         * @return         KErrNone if no error, or some of the system wide
       
   142         *                 error codes.
       
   143         */
       
   144         virtual TInt PropertyL(const TDesC8& aName,
       
   145                                MSenProperty*& aValue,
       
   146                                TSenPropertiesLayer aLayer) = 0;                               
       
   147         
       
   148         /**
       
   149         * Gets the MSenProperty of the property behind certain name.
       
   150         * @since Series60
       
   151         * @param aName    The name identifying this property.
       
   152         * @param aValue   A MSenProperty reference to pointer to be filled in with
       
   153         *                 the pointer to the property.
       
   154         * @return         KErrNone if no error, or some of the system wide
       
   155         *                 error codes.
       
   156         */
       
   157         virtual TInt PropertyL(const TDesC8& aName,
       
   158                                MSenProperty*& aValue) = 0;                               
       
   159 
       
   160         /**
       
   161         * Gets the array of MSenProperties which match to given property type.
       
   162         * @since Series60
       
   163         * @param aTypeName The name identifying property type.
       
   164         * @param aArray    An array containing MSenProperties which macth
       
   165         *                  to given property type.
       
   166         * @return          KErrNone if no error, or some of the system wide
       
   167         *                  error codes.
       
   168         */
       
   169         virtual TInt PropertiesByTypeL(const TDesC8& aTypeName,
       
   170                                       RPointerArray<MSenProperty>& aArray) = 0;
       
   171 
       
   172         /**
       
   173         * Sets new integer property.
       
   174         *
       
   175         * If property with given name does not exist, 
       
   176         * new property with given value will be added. Otherwise the value of
       
   177         * existing property will be updated.
       
   178         *
       
   179         * @since Series60
       
   180         * @param aName         Name of the property, which can be later used
       
   181         *                      to refer the given value.
       
   182         * @param aValue        Is the integer value of this property.
       
   183         * @param aLayer        The layer to be used.
       
   184         * @return              KErrNone if no error, or some of the system wide
       
   185         *                      error codes.
       
   186         * Leave codes:
       
   187         *                      According to implementing classes. 
       
   188         */
       
   189         virtual TInt SetIntPropertyL(const TDesC8& aName,
       
   190                                      const TInt aValue,
       
   191                                      TSenPropertiesLayer aLayer) = 0;
       
   192         
       
   193         /**
       
   194         * Gets the integer value of the property behind certain name.
       
   195         * @since Series60
       
   196         * @param aName    The name identifying this property.
       
   197         * @param aValue   A TInt reference to be filled in with the value of
       
   198         *                 the property.
       
   199         * @param aLayer   The layer to be used.
       
   200         * @return         The value of the property, or KNullDesC8 if
       
   201         *                 property is not found.
       
   202         */
       
   203         virtual TInt IntPropertyL(const TDesC8& aName,
       
   204                                   TInt& aValue,
       
   205                                   TSenPropertiesLayer aLayer) = 0;
       
   206         
       
   207         /**
       
   208         * Sets new boolean property.
       
   209         *
       
   210         * If property with given name does not exist, 
       
   211         * new property with given value will be added. Otherwise the value of
       
   212         * existing property will be updated.
       
   213         *
       
   214         * @since Series60
       
   215         * @param aName         Name of the property, which can be later used
       
   216         *                      to refer the given value.
       
   217         * @param aValue        The boolean value of this property.
       
   218         * @param aLayer        The layer to be used.
       
   219         * @return              KErrNone if no error, or some of the system wide
       
   220         *                      error codes.
       
   221         * Leave codes:
       
   222         *                      According to implementing classes. 
       
   223         */
       
   224         virtual TInt SetBoolPropertyL(const TDesC8& aName,
       
   225                                       const TBool aValue,
       
   226                                       TSenPropertiesLayer aLayer) = 0;
       
   227         
       
   228         /**
       
   229         * Gets the boolean value of the property behind certain name.
       
   230         * @since Series60
       
   231         * @param aName    The name identifying this property.
       
   232         * @param aValue   A TBool reference to be filled in with the value of
       
   233         *                 the property.
       
   234         * @param aLayer   The layer to be used.
       
   235         * @return         KErrNone if no error, or some of the system wide
       
   236         *                 error codes.
       
   237         */
       
   238         virtual TInt BoolPropertyL(const TDesC8& aName,
       
   239                                    TBool& aValue,
       
   240                                    TSenPropertiesLayer aLayer) = 0;
       
   241         
       
   242     };
       
   243 
       
   244 #endif // M_SEN_LAYERED_PROPERTIES_H
       
   245 
       
   246 
       
   247 // End of File
       
   248