mmuifw_plat/mul_datamodel_api/inc/mul/imulvarianttype.h
changeset 17 3eca7e70b1b8
parent 3 4526337fb576
equal deleted inserted replaced
3:4526337fb576 17:3eca7e70b1b8
     1 /*
       
     2 * Copyright (c) 2007-2008 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:  Interface for generic data type
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef I_MULVARIANTTYPE_H
       
    20 #define I_MULVARIANTTYPE_H
       
    21 
       
    22 #include <memory>
       
    23 //#include <osn/osntypes.h>
       
    24 #include <e32cmn.h>
       
    25 
       
    26 // Forward Declarations
       
    27 
       
    28 namespace Alf
       
    29     {
       
    30 
       
    31 // Forward Declarations
       
    32  class IAlfMap;
       
    33 
       
    34 /*! @class IMulVariantType
       
    35  *  @brief Interface for mul model data type 
       
    36  *
       
    37  *  Application should implement this interface if application needs
       
    38  * 	to provide custom data type to model.
       
    39  *
       
    40  */
       
    41 class IMulVariantType
       
    42     {
       
    43 public:
       
    44     
       
    45     enum TMulType{ EUnknown ,EBool, EInt, EUint, EReal, EDes, EMap, ECustomData };
       
    46 
       
    47     /**
       
    48      * Create copy of variant type
       
    49      *
       
    50      * @return Copy of variant type and ownsership is transferred
       
    51      */ 
       
    52     virtual std::auto_ptr< IMulVariantType > Clone() = 0;
       
    53     
       
    54     /**
       
    55      * Get data as symbian descriptior
       
    56      * 
       
    57      * @return Descriptor data value.
       
    58      */
       
    59     virtual const TDesC& DesC() const = 0 ;
       
    60     
       
    61     /**
       
    62      * Type of data
       
    63      * 
       
    64      * @return Data type of Variant Data
       
    65      */
       
    66     virtual TMulType Type() const = 0 ;
       
    67     
       
    68     /**
       
    69      * Destructor
       
    70      */
       
    71     virtual ~IMulVariantType()
       
    72     	{
       
    73     	}
       
    74     
       
    75     /**
       
    76      * Get the data value as an bool .
       
    77      *
       
    78      * @exception osncore:AlfDataException Thrown if type() is not EBool.
       
    79      * @return bool data value.
       
    80      */
       
    81     virtual bool boolean() const = 0;
       
    82 
       
    83     /**
       
    84      * Get the data value as an integer.
       
    85      *
       
    86      * @exception osncore:AlfDataException Thrown if type() is not EInt.
       
    87      * @return Integer data value.
       
    88      */
       
    89     virtual int integer() const = 0;
       
    90 
       
    91     /**
       
    92      * Get the data value as an unsigned integer.
       
    93      *
       
    94      * @exception osncore:AlfDataException Thrown if type() is not EUInt.
       
    95      * @return Unsigned integer data value.
       
    96      */
       
    97     virtual uint uinteger() const = 0;
       
    98 
       
    99     /**
       
   100      * Get the data value as a real number.
       
   101      *
       
   102      * @exception osncore:AlfDataException Thrown if type() is not EReal.
       
   103      * @return Real data value.
       
   104      */
       
   105     virtual double real() const = 0;
       
   106 
       
   107     /**
       
   108      * Get the data value as a map interface.
       
   109      *
       
   110      * @exception osncore:AlfDataException Thrown if type() is not EMap.
       
   111      * @return Map interface.
       
   112      * @since S60 ?S60_version
       
   113      */
       
   114     virtual IAlfMap& Map() const = 0 ;
       
   115             
       
   116     };
       
   117 
       
   118     } // namespace Alf
       
   119 
       
   120 #endif // I_MULVARIANTTYPE_H
       
   121 
       
   122 //End of file
       
   123