mmappfw_plat/mpx_common_definition_api/inc/mpxitemid.h
changeset 0 a2952bb97e68
equal deleted inserted replaced
-1:000000000000 0:a2952bb97e68
       
     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:  TMPXitemId definition
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef T_MPXITEMID_H
       
    20 #define T_MPXITEMID_H
       
    21 
       
    22 
       
    23 /**
       
    24 * Structure to hold a the representation of an Item ID
       
    25 * The structure contains 2 ids, and can be extensible to more
       
    26 * The iId1 ID MUST be unique within the collection path.
       
    27 * The IId2 ID can be duplicated in the collection path, 
       
    28 * and can be use for extended purposes.
       
    29 *
       
    30 * @lib mpxcommon.lib
       
    31 */
       
    32 NONSHARABLE_CLASS( TMPXItemId )
       
    33     {
       
    34     public:
       
    35         /**
       
    36         * TInt operator, returns iId1.
       
    37         *
       
    38         * @since S60 3.2.3
       
    39         */
       
    40         inline operator TInt() const; 
       
    41         
       
    42         /**
       
    43         * TInt32 operator, returns iId1.
       
    44         *
       
    45         * @since S60 3.2.3
       
    46         */
       
    47         inline operator TInt32() const; 
       
    48         
       
    49         /**
       
    50         * TUint32 operator, returns iId1.
       
    51         *
       
    52         * @since S60 3.2.3
       
    53         */
       
    54         inline operator TUint() const;
       
    55         
       
    56         /**
       
    57         * TUint32 operator, returns iId1.
       
    58         *
       
    59         * @since S60 3.2.3
       
    60         */
       
    61         inline operator TUint32() const; 
       
    62         
       
    63         /**
       
    64         * TInt64 operator, returns iId1.
       
    65         *
       
    66         * @since S60 3.2.3
       
    67         */
       
    68         inline operator TInt64() const;
       
    69         
       
    70         /**
       
    71         * TUint64 operator, returns iId1.
       
    72         *
       
    73         * @since S60 3.2.3
       
    74         */
       
    75         inline operator TUint64() const;
       
    76         
       
    77         /**
       
    78         * == operator.
       
    79         *
       
    80         * @since S60 3.2.3
       
    81         * @param aOtherId TMPXItemId to compare
       
    82         */
       
    83         inline TBool operator==( const TMPXItemId& aOtherId ) const ;
       
    84         
       
    85         /**
       
    86         * == operator.
       
    87         *
       
    88         * @since S60 3.2.3
       
    89         * @param aOtherId TMPXItemId to compare
       
    90         */
       
    91         inline TBool operator==( TInt aOtherId ) const ;
       
    92         
       
    93         /**
       
    94         * == operator. 
       
    95         *
       
    96         * @since S60 3.2.3
       
    97         * @param aOtherId TInt32 to compare to public id
       
    98         */
       
    99         inline TBool operator==( TInt32 aOtherId ) const ;
       
   100         
       
   101         /**
       
   102         * == operator. 
       
   103         *
       
   104         * @since S60 3.2.3
       
   105         * @param aOtherId TUint32 to compare to public id
       
   106         */
       
   107         inline TBool operator==( TUint32 aOtherId ) const ;
       
   108         
       
   109         /**
       
   110         * != operator. 
       
   111         *
       
   112         * @since S60 3.2.3
       
   113         * @param aOtherId TMPXItemId to compare
       
   114         */
       
   115         inline TBool operator!=( const TMPXItemId& aOtherId ) const; 
       
   116         
       
   117         /**
       
   118         * != operator. 
       
   119         *
       
   120         * @since S60 3.2.3
       
   121         * @param aOtherId TInt to compare to public id
       
   122         */
       
   123         inline TBool operator!=( TInt aOtherId ) const; 
       
   124         
       
   125         /**
       
   126         * An approximately equal operator. If either iId1 or iId2 matches, 
       
   127         * ETrue is returned.
       
   128         *
       
   129         * @since S60 3.2.3
       
   130         * @param aOtherId TMPXItemId to compare
       
   131         */
       
   132         inline TBool ApproxEqual( const TMPXItemId& aOtherId ) const;
       
   133         
       
   134         /**
       
   135         * Constructor.
       
   136         * Public and private ids iniitialized to 0.
       
   137         *
       
   138         * @since S60 3.2.3
       
   139         */
       
   140         inline TMPXItemId(); 
       
   141         
       
   142         /**
       
   143         * Constructor. 
       
   144         *
       
   145         * @since S60 3.2.3
       
   146         * @param aId id to initialize both public and private id
       
   147         */
       
   148         inline TMPXItemId( TUint32 aId ); 
       
   149         
       
   150         /**
       
   151         * Constructor.
       
   152         *
       
   153         * @since S60 3.2.3
       
   154         * @param aPublicId public ID
       
   155         * @param aPrivateId privateID
       
   156         */
       
   157         inline TMPXItemId( TUint32 aId1, TUint32 aId2 );
       
   158         
       
   159         /**
       
   160         * Static function to create an invalid ID.
       
   161         *
       
   162         * @since S60 3.2.3
       
   163         */
       
   164         static inline TMPXItemId InvalidId();
       
   165         
       
   166     public:
       
   167         TUint32 iId1;
       
   168         TUint32 iId2;    
       
   169     };
       
   170 
       
   171 #define KMPXInvalidItemId TMPXItemId::InvalidId()
       
   172 
       
   173 #include "mpxitemid.inl"
       
   174 
       
   175 #endif // T_MPXITEMID_H