messagingappbase/smsmtm/clientmtm/inc/tmsvsmsentry.inl
changeset 23 238255e8b033
equal deleted inserted replaced
5:4697dfb2d7ad 23:238255e8b033
       
     1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // tmsvsmsentry.inl
       
    15 //
       
    16 
       
    17 #include <smcmmain.h>
       
    18 #include <gsmumsg.h>
       
    19 
       
    20 /*
       
    21  *	TMsvSmsEntry
       
    22  */
       
    23 
       
    24 /**
       
    25 Constructor.
       
    26 
       
    27 @internalTechnology
       
    28 @released
       
    29 */
       
    30 inline TMsvSmsEntry::TMsvSmsEntry()
       
    31 	{
       
    32 	}
       
    33 
       
    34 /**
       
    35 Copy constuctor.
       
    36 
       
    37 @param	aEntry
       
    38 The index entry to copy.
       
    39 
       
    40 @internalTechnology
       
    41 @released
       
    42 */
       
    43 inline TMsvSmsEntry::TMsvSmsEntry(const TMsvEntry& aEntry)  
       
    44 : TMsvEntry(aEntry)
       
    45 	{
       
    46 	}
       
    47 
       
    48 /**
       
    49 Sets the User Prompt Indicator flag.
       
    50 
       
    51 @param	aUPI
       
    52 A value of True to set the flag.
       
    53 
       
    54 @internalTechnology
       
    55 @released
       
    56 */
       
    57 inline void TMsvSmsEntry::SetUserPromptIndicator(TBool aUPI)
       
    58 	{
       
    59 	(aUPI) ? (iMtmData2 |= EMsvSmsEntryUserPromptIndicator) : (iMtmData2 &= ~EMsvSmsEntryUserPromptIndicator);
       
    60 	}
       
    61 
       
    62 /**
       
    63 Gets the User Prompt Indicator flag.
       
    64 
       
    65 @return
       
    66 A value of True if the User Prompt Indicator flag is.
       
    67 
       
    68 @internalTechnology
       
    69 @released
       
    70 */
       
    71 inline TBool TMsvSmsEntry::UserPromptIndicator() const
       
    72 	{
       
    73 	return (iMtmData2 & EMsvSmsEntryUserPromptIndicator);
       
    74 	}
       
    75 
       
    76 /**
       
    77 Gets the Protocol Identifier data.
       
    78 
       
    79 @return
       
    80 The Protocol Identifier data.
       
    81 
       
    82 @internalTechnology
       
    83 @released
       
    84 */
       
    85 inline TUint8 TMsvSmsEntry::ProtocolIdentifier() const
       
    86 	{
       
    87 	return STATIC_CAST(TUint8, iMtmData2 & EMsvSmsEntryProtocolIdentifier);
       
    88 	}
       
    89 
       
    90 /**
       
    91 Sets the Protocol Identifier data.
       
    92 
       
    93 @param	aPID
       
    94 The Protocol Identifier data.
       
    95 
       
    96 @internalTechnology
       
    97 @released
       
    98 */
       
    99 inline void TMsvSmsEntry::SetProtocolIdentifier(TSmsProtocolIdentifier aPID)
       
   100 	{
       
   101 	SetProtocolIdentifier(STATIC_CAST(TUint8, aPID));
       
   102 	}
       
   103 
       
   104 /**
       
   105 Sets the Protocol Identifier data.
       
   106 
       
   107 @param	aPID
       
   108 The Protocol Identifier data.
       
   109 
       
   110 @internalTechnology
       
   111 @released
       
   112 */
       
   113 inline void TMsvSmsEntry::SetProtocolIdentifier(TUint8 aPID)
       
   114 	{
       
   115 	iMtmData2 = (iMtmData2 & ~EMsvSmsEntryProtocolIdentifier) | (aPID & EMsvSmsEntryProtocolIdentifier);
       
   116 	}
       
   117 
       
   118 /**
       
   119 Sets the SMS class data and defined flag.
       
   120 
       
   121 @param	aClassDefined
       
   122 A value of True to set the SMS class data defined flag.
       
   123 
       
   124 @param	aClass
       
   125 The SMS class data.
       
   126 
       
   127 @internalTechnology
       
   128 @released
       
   129 */
       
   130 inline void TMsvSmsEntry::SetClass(TBool aClassDefined, TSmsDataCodingScheme::TSmsClass aClass)
       
   131 	{
       
   132 	aClassDefined ? (iMtmData2 |= EMsvSmsEntryClassDefined) : (iMtmData2 &= ~EMsvSmsEntryClassDefined);
       
   133 	iMtmData2 = (iMtmData2 & ~EMsvSmsEntryClass) | ((aClass << EMsvSmsEntryClassShift) & EMsvSmsEntryClass);
       
   134 	}
       
   135 
       
   136 /**
       
   137 Gets the SMS class data and defined flag.
       
   138 
       
   139 @param	aClass
       
   140 An output argument with the SMS class data.
       
   141 
       
   142 @return
       
   143 A value of True if the SMS class data defined flag is set.
       
   144 
       
   145 @internalTechnology
       
   146 @released
       
   147 */
       
   148 inline TBool TMsvSmsEntry::Class(TSmsDataCodingScheme::TSmsClass& aClass) const
       
   149 	{
       
   150 	aClass = STATIC_CAST(TSmsDataCodingScheme::TSmsClass, ((iMtmData2 & EMsvSmsEntryClass) >> EMsvSmsEntryClassShift));
       
   151 	return iMtmData2 & EMsvSmsEntryClassDefined;
       
   152 	}
       
   153 
       
   154