epoc32/include/smuthdr.inl
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@2
     4
// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
williamr@2
     5
// which accompanies this distribution, and is available
williamr@2
     6
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
//
williamr@2
    15
williamr@2
    16
#include <smcmmain.h>
williamr@2
    17
#include <gsmumsg.h>
williamr@2
    18
williamr@2
    19
/** 
williamr@2
    20
Gets the message PDU for a SMS-SUBMIT type message.
williamr@2
    21
williamr@2
    22
The message PDU type can be checked by using the CSmsHeader::Type API.
williamr@2
    23
williamr@2
    24
@return
williamr@2
    25
The SMS-SUBMIT PDU object.
williamr@2
    26
williamr@2
    27
@panic	SMCM	0
williamr@2
    28
The message was not a PDU of type SMS-SUBMIT (debug only).
williamr@2
    29
williamr@2
    30
@see	CSmsHeader::Type
williamr@2
    31
*/
williamr@2
    32
inline CSmsSubmit& CSmsHeader::Submit()
williamr@2
    33
	{
williamr@2
    34
	__ASSERT_DEBUG( Type() == CSmsPDU::ESmsSubmit, Panic(ESmutPanicUnsupportedMsgType));
williamr@2
    35
	return (CSmsSubmit&)(iMessage->SmsPDU());
williamr@2
    36
	}
williamr@2
    37
williamr@2
    38
/** 
williamr@2
    39
Gets the (const) message PDU for a SMS-SUBMIT type message.
williamr@2
    40
williamr@2
    41
The message PDU type can be checked by using the CSmsHeader::Type API.
williamr@2
    42
williamr@2
    43
@return
williamr@2
    44
The SMS-SUBMIT PDU const object.
williamr@2
    45
williamr@2
    46
@panic	SMCM	0
williamr@2
    47
The message was not a PDU of type SMS-SUBMIT (debug only).
williamr@2
    48
williamr@2
    49
@see	CSmsHeader::Type
williamr@2
    50
*/
williamr@2
    51
inline const CSmsSubmit& CSmsHeader::Submit() const
williamr@2
    52
	{
williamr@2
    53
	__ASSERT_DEBUG( Type() == CSmsPDU::ESmsSubmit, Panic(ESmutPanicUnsupportedMsgType));
williamr@2
    54
	return (CSmsSubmit&)(iMessage->SmsPDU());
williamr@2
    55
	}
williamr@2
    56
williamr@2
    57
/** 
williamr@2
    58
Gets the message PDU for a SMS-DELIVER type message.
williamr@2
    59
williamr@2
    60
The message PDU type can be checked by using the CSmsHeader::Type API.
williamr@2
    61
williamr@2
    62
@return
williamr@2
    63
The SMS-DELIVER PDU object.
williamr@2
    64
williamr@2
    65
@panic	SMCM	0
williamr@2
    66
The message was not a PDU of type SMS-DELIVER (debug only).
williamr@2
    67
williamr@2
    68
@see	CSmsHeader::Type
williamr@2
    69
*/
williamr@2
    70
inline CSmsDeliver& CSmsHeader::Deliver()
williamr@2
    71
	{
williamr@2
    72
	__ASSERT_DEBUG( Type() == CSmsPDU::ESmsDeliver, Panic(ESmutPanicUnsupportedMsgType));
williamr@2
    73
	return (CSmsDeliver&)(iMessage->SmsPDU());
williamr@2
    74
	}
williamr@2
    75
williamr@2
    76
/** 
williamr@2
    77
Gets the (const) message PDU for a SMS-DELIVER type message.
williamr@2
    78
williamr@2
    79
The message PDU type can be checked by using the CSmsHeader::Type API.
williamr@2
    80
williamr@2
    81
@return
williamr@2
    82
The SMS-DELIVER PDU const object.
williamr@2
    83
williamr@2
    84
@panic	SMCM	0
williamr@2
    85
The message was not a PDU of type SMS-DELIVER (debug only).
williamr@2
    86
williamr@2
    87
@see	CSmsHeader::Type
williamr@2
    88
*/
williamr@2
    89
inline const CSmsDeliver& CSmsHeader::Deliver() const
williamr@2
    90
	{
williamr@2
    91
	__ASSERT_DEBUG( Type() == CSmsPDU::ESmsDeliver, Panic(ESmutPanicUnsupportedMsgType));
williamr@2
    92
	return (CSmsDeliver&)(iMessage->SmsPDU());
williamr@2
    93
	}
williamr@2
    94
williamr@2
    95
/** 
williamr@2
    96
Gets the message PDU for a SMS-COMMMAND type message.
williamr@2
    97
williamr@2
    98
The message PDU type can be checked by using the CSmsHeader::Type API.
williamr@2
    99
williamr@2
   100
@return	The SMS-COMMMAND PDU object.
williamr@2
   101
williamr@2
   102
@panic	SMCM	0
williamr@2
   103
The message was not a PDU of type SMS-COMMMAND (debug only).
williamr@2
   104
williamr@2
   105
@see	CSmsHeader::Type
williamr@2
   106
*/
williamr@2
   107
inline CSmsCommand& CSmsHeader::Command()
williamr@2
   108
	{
williamr@2
   109
	__ASSERT_DEBUG( Type() == CSmsPDU::ESmsCommand, Panic(ESmutPanicUnsupportedMsgType));
williamr@2
   110
	return (CSmsCommand&)(iMessage->SmsPDU());
williamr@2
   111
	}
williamr@2
   112
williamr@2
   113
/** 
williamr@2
   114
Gets the (const) message PDU for a SMS-COMMMAND type message.
williamr@2
   115
williamr@2
   116
The message PDU type can be checked by using the CSmsHeader::Type API.
williamr@2
   117
williamr@2
   118
@return
williamr@2
   119
The SMS-COMMMAND PDU const object.
williamr@2
   120
williamr@2
   121
@panic	SMCM	0
williamr@2
   122
The message was not a PDU of type SMS-COMMMAND (debug only).
williamr@2
   123
williamr@2
   124
@see	CSmsHeader::Type
williamr@2
   125
*/
williamr@2
   126
inline const CSmsCommand& CSmsHeader::Command() const
williamr@2
   127
	{
williamr@2
   128
	__ASSERT_DEBUG( Type() == CSmsPDU::ESmsCommand, Panic(ESmutPanicUnsupportedMsgType));
williamr@2
   129
	return (CSmsCommand&)(iMessage->SmsPDU());
williamr@2
   130
	}
williamr@2
   131
williamr@2
   132
/** 
williamr@2
   133
Gets the message PDU for a SMS-STATUS-REPORT type message.
williamr@2
   134
williamr@2
   135
The message PDU type can be checked by using the CSmsHeader::Type API.
williamr@2
   136
williamr@2
   137
@return
williamr@2
   138
The SMS-STATUS-REPORT PDU object.
williamr@2
   139
williamr@2
   140
@panic	SMCM	0
williamr@2
   141
The message was not a PDU of type SMS-STATUS-REPORT (debug only).
williamr@2
   142
williamr@2
   143
@see	CSmsHeader::Type
williamr@2
   144
*/
williamr@2
   145
inline CSmsStatusReport& CSmsHeader::StatusReport()
williamr@2
   146
	{
williamr@2
   147
	__ASSERT_DEBUG( Type() == CSmsPDU::ESmsStatusReport, Panic(ESmutPanicUnsupportedMsgType));
williamr@2
   148
	return (CSmsStatusReport&)(iMessage->SmsPDU());
williamr@2
   149
	}
williamr@2
   150
williamr@2
   151
/** 
williamr@2
   152
Gets the (const) message PDU for a SMS-STATUS-REPORT type message.
williamr@2
   153
williamr@2
   154
The message PDU type can be checked by using the CSmsHeader::Type API.
williamr@2
   155
williamr@2
   156
@return
williamr@2
   157
The SMS-STATUS-REPORT PDU const object.
williamr@2
   158
williamr@2
   159
@panic	SMCM	0
williamr@2
   160
The message was not a PDU of type SMS-STATUS-REPORT (debug only).
williamr@2
   161
williamr@2
   162
@see	CSmsHeader::Type
williamr@2
   163
*/
williamr@2
   164
inline const CSmsStatusReport& CSmsHeader::StatusReport() const
williamr@2
   165
	{
williamr@2
   166
	__ASSERT_DEBUG( Type() == CSmsPDU::ESmsStatusReport, Panic(ESmutPanicUnsupportedMsgType));
williamr@2
   167
	return (CSmsStatusReport&)(iMessage->SmsPDU());
williamr@2
   168
	}
williamr@2
   169
williamr@2
   170
/**
williamr@2
   171
Gets the message PDU type.
williamr@2
   172
williamr@2
   173
There are six types of PDU -  SMS-DELIVER, SMS-DELIVER-REPORT, SMS-SUBMIT, 
williamr@2
   174
SMS-SUBMIT-REPORT, SMS-STATUS-REPORT and SMS-COMMAND. 
williamr@2
   175
williamr@2
   176
There is access to only to SMS-DELIVER, SMS-SUBMIT, SMS-STATUS-REPORT and
williamr@2
   177
SMS-COMMAND PDUs via the CSmsHeader encapsulation.
williamr@2
   178
williamr@2
   179
@return
williamr@2
   180
The message PDU type.
williamr@2
   181
williamr@2
   182
@see	CSmsPDU::TSmsPDUType
williamr@2
   183
*/
williamr@2
   184
inline CSmsPDU::TSmsPDUType CSmsHeader::Type() const
williamr@2
   185
	{
williamr@2
   186
	return iMessage->SmsPDU().Type();
williamr@2
   187
	}
williamr@2
   188
williamr@2
   189
/**
williamr@2
   190
Gets the (const) message recipients.
williamr@2
   191
williamr@2
   192
@return
williamr@2
   193
The const array of message recipients 
williamr@2
   194
*/
williamr@2
   195
inline const CArrayPtrFlat<CSmsNumber>& CSmsHeader::Recipients() const
williamr@2
   196
	{
williamr@2
   197
	return iRecipients;
williamr@2
   198
	}
williamr@2
   199
williamr@2
   200
/** 
williamr@2
   201
Gets the (const) message recipients.
williamr@2
   202
williamr@2
   203
@return
williamr@2
   204
The array of message recipients 
williamr@2
   205
*/
williamr@2
   206
inline CArrayPtrFlat<CSmsNumber>& CSmsHeader::Recipients()
williamr@2
   207
	{
williamr@2
   208
	return iRecipients;
williamr@2
   209
	}
williamr@2
   210
williamr@2
   211
/** 
williamr@2
   212
Gets the SMS stack representation of the message.
williamr@2
   213
williamr@2
   214
@return
williamr@2
   215
The SMS stack representation of the message
williamr@2
   216
williamr@2
   217
@see	CSmsMessage
williamr@2
   218
*/
williamr@2
   219
inline CSmsMessage& CSmsHeader::Message()
williamr@2
   220
	{
williamr@2
   221
	return *iMessage;
williamr@2
   222
	}
williamr@2
   223
	
williamr@2
   224
/** 
williamr@2
   225
Gets the (const) SMS stack representation of the message.
williamr@2
   226
williamr@2
   227
@return
williamr@2
   228
The const SMS stack representation of the message 
williamr@2
   229
*/
williamr@2
   230
inline const CSmsMessage& CSmsHeader::Message() const
williamr@2
   231
	{
williamr@2
   232
	return *iMessage;
williamr@2
   233
	}
williamr@2
   234
williamr@2
   235
/**
williamr@2
   236
Tests if the message contains a reply path.
williamr@2
   237
williamr@2
   238
@return
williamr@2
   239
A value of True if the message contains a reply path.
williamr@2
   240
*/
williamr@2
   241
inline TBool CSmsHeader::ReplyPathProvided() const
williamr@2
   242
	{
williamr@2
   243
	return iFlags & ESmsHeaderReplyPathProvided;
williamr@2
   244
	}
williamr@2
   245
williamr@2
   246
/** 
williamr@2
   247
Set the message flag that indicates whether it contains a reply path.
williamr@2
   248
williamr@2
   249
@param	aReplyPathProvided
williamr@2
   250
A value of True to set the flag.
williamr@2
   251
*/
williamr@2
   252
inline void CSmsHeader::SetReplyPathProvided(TBool aReplyPathProvided)
williamr@2
   253
	{
williamr@2
   254
	iFlags = (iFlags & ~ESmsHeaderReplyPathProvided) | (aReplyPathProvided ? ESmsHeaderReplyPathProvided : ESmsHeaderNoFlags);
williamr@2
   255
	}
williamr@2
   256
williamr@2
   257
/**
williamr@2
   258
Sets the originator address.
williamr@2
   259
williamr@2
   260
@param	aAddress
williamr@2
   261
The originator address
williamr@2
   262
*/
williamr@2
   263
inline void CSmsHeader::SetFromAddressL(const TDesC& aAddress)
williamr@2
   264
	{
williamr@2
   265
	Message().SmsPDU().SetToFromAddressL(aAddress);
williamr@2
   266
	}
williamr@2
   267
williamr@2
   268
/** 
williamr@2
   269
Gets the originator address.
williamr@2
   270
williamr@2
   271
Only valid for SMS-DELIVER and SMS-SUBMIT type messages. With any other message
williamr@2
   272
types the returned originator address is empty.
williamr@2
   273
williamr@2
   274
@return
williamr@2
   275
The originator address.
williamr@2
   276
*/
williamr@2
   277
inline TPtrC CSmsHeader::FromAddress() const
williamr@2
   278
	{
williamr@2
   279
	switch(Type())
williamr@2
   280
		{
williamr@2
   281
		case(CSmsPDU::ESmsSubmit):
williamr@2
   282
			return Submit().ToFromAddress();
williamr@2
   283
		case(CSmsPDU::ESmsDeliver):
williamr@2
   284
			return Deliver().ToFromAddress();
williamr@2
   285
		default: 
williamr@2
   286
			return TPtrC(0,0);
williamr@2
   287
		}
williamr@2
   288
	}
williamr@2
   289
williamr@2
   290
/** 
williamr@2
   291
Gets the message's service center address.
williamr@2
   292
williamr@2
   293
This can only be used on SMS-SUBMIT type messages. The message PDU type can be
williamr@2
   294
checked by using the CSmsHeader::Type API.
williamr@2
   295
williamr@2
   296
@return
williamr@2
   297
The Service Center address.
williamr@2
   298
williamr@2
   299
@panic	SMCM	0
williamr@2
   300
The message was not a PDU of type SMS-SUBMIT (debug only).
williamr@2
   301
williamr@2
   302
@see	CSmsHeader::Type
williamr@2
   303
*/
williamr@2
   304
inline TPtrC CSmsHeader::ServiceCenterAddress() const
williamr@2
   305
	{
williamr@2
   306
	return Submit().ServiceCenterAddress();
williamr@2
   307
	}
williamr@2
   308
williamr@2
   309
/**
williamr@2
   310
Sets the message's service center address.
williamr@2
   311
williamr@2
   312
This can only be used on SMS-SUBMIT type messages. The message PDU type can be
williamr@2
   313
checked by using the CSmsHeader::Type API.
williamr@2
   314
williamr@2
   315
williamr@2
   316
@param	aAddress
williamr@2
   317
The Service Center address
williamr@2
   318
williamr@2
   319
@panic	SMCM	0
williamr@2
   320
The message was not a PDU of type SMS-SUBMIT (debug only).
williamr@2
   321
williamr@2
   322
@see	CSmsHeader::Type
williamr@2
   323
*/
williamr@2
   324
inline void CSmsHeader::SetServiceCenterAddressL(const TDesC& aAddress)
williamr@2
   325
	{
williamr@2
   326
	Submit().SetServiceCenterAddressL(aAddress);
williamr@2
   327
	}
williamr@2
   328
williamr@2
   329
/** 
williamr@2
   330
Gets the message's BIO message type identifier.
williamr@2
   331
williamr@2
   332
For non-BIO messages, this is EBioMsgIdNbs.
williamr@2
   333
williamr@2
   334
@return
williamr@2
   335
The BIO message type identifier 
williamr@2
   336
*/
williamr@2
   337
inline TBioMsgIdType CSmsHeader::BioMsgIdType() const
williamr@2
   338
	{
williamr@2
   339
	return iBioMsgIdType;
williamr@2
   340
	}
williamr@2
   341
williamr@2
   342
/** 
williamr@2
   343
Sets the message's BIO message type identifier.
williamr@2
   344
williamr@2
   345
@param	aBioMsgIdType
williamr@2
   346
The BIO message type identifier
williamr@2
   347
*/
williamr@2
   348
inline void CSmsHeader::SetBioMsgIdType(TBioMsgIdType aBioMsgIdType)
williamr@2
   349
	{
williamr@2
   350
	iBioMsgIdType = aBioMsgIdType;
williamr@2
   351
	}
williamr@2
   352
williamr@2
   353
/*
williamr@2
   354
 *	TMsvSmsEntry
williamr@2
   355
 */
williamr@2
   356
williamr@2
   357
/**
williamr@2
   358
Constructor.
williamr@2
   359
williamr@2
   360
@internalTechnology
williamr@2
   361
@released
williamr@2
   362
*/
williamr@2
   363
inline TMsvSmsEntry::TMsvSmsEntry()
williamr@2
   364
	{
williamr@2
   365
	}
williamr@2
   366
williamr@2
   367
/**
williamr@2
   368
Copy constuctor.
williamr@2
   369
williamr@2
   370
@param	aEntry
williamr@2
   371
The index entry to copy.
williamr@2
   372
williamr@2
   373
@internalTechnology
williamr@2
   374
@released
williamr@2
   375
*/
williamr@2
   376
inline TMsvSmsEntry::TMsvSmsEntry(const TMsvEntry& aEntry)  
williamr@2
   377
: TMsvEntry(aEntry)
williamr@2
   378
	{
williamr@2
   379
	}
williamr@2
   380
williamr@2
   381
/**
williamr@2
   382
Sets the User Prompt Indicator flag.
williamr@2
   383
williamr@2
   384
@param	aUPI
williamr@2
   385
A value of True to set the flag.
williamr@2
   386
williamr@2
   387
@internalTechnology
williamr@2
   388
@released
williamr@2
   389
*/
williamr@2
   390
inline void TMsvSmsEntry::SetUserPromptIndicator(TBool aUPI)
williamr@2
   391
	{
williamr@2
   392
	(aUPI) ? (iMtmData2 |= EMsvSmsEntryUserPromptIndicator) : (iMtmData2 &= ~EMsvSmsEntryUserPromptIndicator);
williamr@2
   393
	}
williamr@2
   394
williamr@2
   395
/**
williamr@2
   396
Gets the User Prompt Indicator flag.
williamr@2
   397
williamr@2
   398
@return
williamr@2
   399
A value of True if the User Prompt Indicator flag is.
williamr@2
   400
williamr@2
   401
@internalTechnology
williamr@2
   402
@released
williamr@2
   403
*/
williamr@2
   404
inline TBool TMsvSmsEntry::UserPromptIndicator() const
williamr@2
   405
	{
williamr@2
   406
	return (iMtmData2 & EMsvSmsEntryUserPromptIndicator);
williamr@2
   407
	}
williamr@2
   408
williamr@2
   409
/**
williamr@2
   410
Gets the Protocol Identifier data.
williamr@2
   411
williamr@2
   412
@return
williamr@2
   413
The Protocol Identifier data.
williamr@2
   414
williamr@2
   415
@internalTechnology
williamr@2
   416
@released
williamr@2
   417
*/
williamr@2
   418
inline TUint8 TMsvSmsEntry::ProtocolIdentifier() const
williamr@2
   419
	{
williamr@2
   420
	return STATIC_CAST(TUint8, iMtmData2 & EMsvSmsEntryProtocolIdentifier);
williamr@2
   421
	}
williamr@2
   422
williamr@2
   423
/**
williamr@2
   424
Sets the Protocol Identifier data.
williamr@2
   425
williamr@2
   426
@param	aPID
williamr@2
   427
The Protocol Identifier data.
williamr@2
   428
williamr@2
   429
@internalTechnology
williamr@2
   430
@released
williamr@2
   431
*/
williamr@2
   432
inline void TMsvSmsEntry::SetProtocolIdentifier(TSmsProtocolIdentifier aPID)
williamr@2
   433
	{
williamr@2
   434
	SetProtocolIdentifier(STATIC_CAST(TUint8, aPID));
williamr@2
   435
	}
williamr@2
   436
williamr@2
   437
/**
williamr@2
   438
Sets the Protocol Identifier data.
williamr@2
   439
williamr@2
   440
@param	aPID
williamr@2
   441
The Protocol Identifier data.
williamr@2
   442
williamr@2
   443
@internalTechnology
williamr@2
   444
@released
williamr@2
   445
*/
williamr@2
   446
inline void TMsvSmsEntry::SetProtocolIdentifier(TUint8 aPID)
williamr@2
   447
	{
williamr@2
   448
	iMtmData2 = (iMtmData2 & ~EMsvSmsEntryProtocolIdentifier) | (aPID & EMsvSmsEntryProtocolIdentifier);
williamr@2
   449
	}
williamr@2
   450
williamr@2
   451
/**
williamr@2
   452
Sets the SMS class data and defined flag.
williamr@2
   453
williamr@2
   454
@param	aClassDefined
williamr@2
   455
A value of True to set the SMS class data defined flag.
williamr@2
   456
williamr@2
   457
@param	aClass
williamr@2
   458
The SMS class data.
williamr@2
   459
williamr@2
   460
@internalTechnology
williamr@2
   461
@released
williamr@2
   462
*/
williamr@2
   463
inline void TMsvSmsEntry::SetClass(TBool aClassDefined, TSmsDataCodingScheme::TSmsClass aClass)
williamr@2
   464
	{
williamr@2
   465
	aClassDefined ? (iMtmData2 |= EMsvSmsEntryClassDefined) : (iMtmData2 &= ~EMsvSmsEntryClassDefined);
williamr@2
   466
	iMtmData2 = (iMtmData2 & ~EMsvSmsEntryClass) | ((aClass << EMsvSmsEntryClassShift) & EMsvSmsEntryClass);
williamr@2
   467
	}
williamr@2
   468
williamr@2
   469
/**
williamr@2
   470
Gets the SMS class data and defined flag.
williamr@2
   471
williamr@2
   472
@param	aClass
williamr@2
   473
An output argument with the SMS class data.
williamr@2
   474
williamr@2
   475
@return
williamr@2
   476
A value of True if the SMS class data defined flag is set.
williamr@2
   477
williamr@2
   478
@internalTechnology
williamr@2
   479
@released
williamr@2
   480
*/
williamr@2
   481
inline TBool TMsvSmsEntry::Class(TSmsDataCodingScheme::TSmsClass& aClass) const
williamr@2
   482
	{
williamr@2
   483
	aClass = STATIC_CAST(TSmsDataCodingScheme::TSmsClass, ((iMtmData2 & EMsvSmsEntryClass) >> EMsvSmsEntryClassShift));
williamr@2
   484
	return iMtmData2 & EMsvSmsEntryClassDefined;
williamr@2
   485
	}