metadataengine/server/inc/mdsitemdef.inl
changeset 0 c53acadfccc6
equal deleted inserted replaced
-1:000000000000 0:c53acadfccc6
       
     1 /*
       
     2 * Copyright (c) 2009 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:  Class to hold description about one item definition
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 /**
       
    20  * Get object name
       
    21  * @return object name
       
    22  */
       
    23 inline const TDesC& CMdsItemDef::GetName() const
       
    24 	{
       
    25 	return *iName;
       
    26 	}
       
    27 
       
    28 /**
       
    29  * Get object Id
       
    30  * @return object Id
       
    31  */
       
    32 inline TDefId CMdsItemDef::GetId() const
       
    33 	{
       
    34 	return iId;
       
    35 	}
       
    36 
       
    37 inline void CMdsItemDef::SetId(TDefId aId)
       
    38 	{
       
    39 	iId = aId;
       
    40 	}	
       
    41 
       
    42 inline void CMdsItemDef::SetFlag( TStoredFlags aFlag )
       
    43 	{
       
    44 	iStoredFlags |= aFlag;
       
    45 	}
       
    46 
       
    47 inline TBool CMdsItemDef::GetFlag( TStoredFlags aFlag ) const
       
    48 	{
       
    49 	return iStoredFlags & aFlag;
       
    50 	}
       
    51 
       
    52 inline void CMdsItemDef::SetStoredInDB()
       
    53 	{
       
    54 	iStoredFlags |= EStoredFlagsDB;
       
    55 	}
       
    56 
       
    57 inline void CMdsItemDef::SetAllNotStoredInDB()
       
    58 	{
       
    59 	iStoredFlags = EStoredFlagsNone;
       
    60 	}
       
    61 
       
    62 inline void CMdsItemDef::SetTableStoredInDB()
       
    63 	{
       
    64 	iStoredFlags |= EStoredFlagsTable;
       
    65 	}
       
    66 
       
    67 inline TBool CMdsItemDef::GetStoredInDB() const
       
    68 	{
       
    69 	return iStoredFlags & EStoredFlagsDB;
       
    70 	}
       
    71 
       
    72 inline TBool CMdsItemDef::GetTableStoredInDB() const
       
    73 	{
       
    74 	return iStoredFlags & EStoredFlagsTable;
       
    75 	}
       
    76 
       
    77 inline void CMdsItemDef::CheckAlphabetL( TUint16 aChar )
       
    78 	{	
       
    79 	if( !( ( 0x0041 <= aChar && aChar <= 0x005a ) || 
       
    80 		   ( 0x0061 <= aChar && aChar <= 0x007a ) ) )
       
    81 		{
       
    82 		User::Leave( KErrGeneral );
       
    83 		}
       
    84 	}
       
    85 
       
    86 inline void CMdsItemDef::CheckAlphabetOrNumberL( TUint16 aChar )
       
    87 	{
       
    88 	if( !( ( 0x0041 <= aChar && aChar <= 0x005a ) || 
       
    89 		   ( 0x0061 <= aChar && aChar <= 0x007a ) || 
       
    90 		   ( 0x0030 <= aChar && aChar <= 0x0039 ) ) )
       
    91 		{
       
    92 		User::Leave( KErrGeneral );
       
    93 		}	
       
    94 	}