smsprotocols/smsstack/gsmu/src/gsmuieoperations.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 02 Feb 2010 01:41:59 +0200
changeset 0 3553901f7fa8
child 19 630d2f34d719
permissions -rw-r--r--
Revision: 201005 Kit: 201005
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
// All rights reserved.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
// Initial Contributors:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
// Contributors:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
// Description:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
#include "Gsmumain.h"
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
#include "gsmuieoperations.h"
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
#include "Gsmumsg.h"
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
#include "gsmumsgadditionalattributes.h"
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
#include "Gsmuelem.h"
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
#include "smsstacklog.h"
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
 *  This is used by the CSmsMessage to create a CSmsIEOperation.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
 *  Each instance is owned by the CSmsMessage which created it.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    27
 *  Therefore only the CSmsMessage (GSMU component) is allowed to
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    28
 *  create and delete CSmsIEOperations.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    29
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    30
 *  @param aId
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    31
 *  The ID for the CSmsInformationElement for whom an operation class needs to be created.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    32
 *  @param aMessage
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
 *  The CSmsMessage that this operations class belongs to.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    34
 *  @param aCharacterSetConverter
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    35
 *  A reference to a character set converter, needed by some derived operation classes.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    36
 *  @param aFs
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
 *  A reference to the file server, needed by some derived operations classes.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    38
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    39
 *  @internalComponent
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    40
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
CSmsIEOperation*  CSmsIEOperation::NewL(CSmsInformationElement::TSmsInformationElementIdentifier aId, CSmsMessage& aMessage, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
	LOGGSMU1("CSmsIEOperation::NewL()");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
	CSmsIEOperation* iEOperation = NULL;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
	switch (aId)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    49
	    case CSmsInformationElement::ESmsHyperLinkFormat:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
	        iEOperation = new (ELeave)  CSmsHyperLinkOperations(aId,aMessage);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    51
	        break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    52
	    case CSmsInformationElement::ESmsReplyAddressFormat:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    53
	        iEOperation = new (ELeave) CSmsReplyAddressOperations(aId, aMessage, aCharacterSetConverter, aFs);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
	        break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    55
	    case CSmsInformationElement::ESmsEnhanceVoiceMailInformation:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    56
	        iEOperation = new (ELeave) CSmsEnhancedVoiceMailOperations(aId, aMessage, aCharacterSetConverter, aFs);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    57
	        break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    58
	    case CSmsInformationElement::ESmsIEISpecialSMSMessageIndication:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    59
	        iEOperation = new (ELeave)  CSmsSpecialSMSMessageOperations(aId,aMessage);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    60
	        break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    61
	    case CSmsInformationElement::ESmsIEISMSCControlParameters:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    62
	        iEOperation = new (ELeave)  CSmsSMSCCtrlParameterOperations(aId,aMessage); 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    63
	        break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    64
	    default:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    65
	        User::Leave(KErrArgument);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    66
	        break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    67
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    68
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    69
	iEOperation->ConstructL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    70
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    71
	return iEOperation;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    72
	} // CSmsIEOperation::NewL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    73
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    74
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    75
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    76
 *  @publishedAll
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    77
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    78
 *  Identifies the information element which is supported by this operations class.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    79
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    80
 *  @return The information element ID supported by this operations class.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    81
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    82
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    83
EXPORT_C CSmsInformationElement::TSmsInformationElementIdentifier CSmsIEOperation::Id() const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    84
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    85
	LOGGSMU1("CSmsIEOperation::Id()");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    86
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    87
	return iId;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    88
	} // CSmsInformationElement::TSmsInformationElementIdentifier
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    89
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    90
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    91
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    92
 *  @internalComponent
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    93
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    94
 *  Identifies whether the message type supports is supported
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    95
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    96
 *  @return True if the message type is supported. False otherwise.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    97
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    98
TBool CSmsIEOperation::MessageTypeSupported() const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    99
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   100
	LOGGSMU1("CSmsIEOperation::MessageTypeSupported()");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   101
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   102
	CSmsPDU::TSmsPDUType type = iMessage.Type();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   103
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   104
    return ((type == CSmsPDU::ESmsDeliver) ||
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   105
            (type == CSmsPDU::ESmsSubmit));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   106
	} // CSmsIEOperation::MessageTypeSupported
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   107
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   108
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   109
CSmsIEOperation::CSmsIEOperation(CSmsInformationElement::TSmsInformationElementIdentifier aId, CSmsMessage& aMessage) : iId(aId), iMessage(aMessage)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   110
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   111
	//NOP
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   112
	} // CSmsIEOperation::CSmsIEOperation
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   113
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   114
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   115
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   116
 *  @internalComponent
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   117
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   118
 *  Prevent clients from using the assignment operator by including it in the class definition
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   119
 *  but making it protected and not exporting it.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   120
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   121
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   122
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   123
void CSmsIEOperation::operator=(const CSmsIEOperation&)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   124
    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   125
    // Ignore in code coverage - not intended to be used
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   126
    BULLSEYE_OFF    
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   127
    LOGGSMU1("CSmsIEOperation::operator=");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   128
    Panic(KGsmuPanicMethodBodyNotImplemented1);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   129
    BULLSEYE_RESTORE
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   130
    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   131
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   132
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   133
 *  @internalComponent
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   134
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   135
 *  Prevent clients from using the equality operator by including it in the class definition
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   136
 *  but making it protected and not exporting it.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   137
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   138
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   139
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   140
TBool CSmsIEOperation::operator==(const CSmsIEOperation&)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   141
    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   142
    // Ignore in code coverage - not intended to be used
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   143
    BULLSEYE_OFF    
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   144
    LOGGSMU1("CSmsIEOperation::operator==");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   145
    Panic(KGsmuPanicMethodBodyNotImplemented1);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   146
    return EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   147
    BULLSEYE_RESTORE
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   148
    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   149
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   150
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   151
 *  @internalComponent
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   152
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   153
 *  Prevent clients from using the assignment operator by including it in the class definition
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   154
 *  but making it protected and not exporting it.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   155
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   156
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   157
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   158
void CSmsCtrlOperation::operator=(const CSmsCtrlOperation&)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   159
    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   160
    // Ignore in code coverage - not intended to be used
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   161
    BULLSEYE_OFF    
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   162
    LOGGSMU1("CSmsCtrlOperation::operator=");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   163
    Panic(KGsmuPanicMethodBodyNotImplemented1);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   164
    BULLSEYE_RESTORE
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   165
    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   166
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   167
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   168
 *  @internalComponent
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   169
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   170
 *  Prevent clients from using the equality operator by including it in the class definition
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   171
 *  but making it protected and not exporting it.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   172
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   173
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   174
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   175
TBool CSmsCtrlOperation::operator==(const CSmsCtrlOperation&)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   176
    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   177
    // Ignore in code coverage - not intended to be used
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   178
    BULLSEYE_OFF    
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   179
    LOGGSMU1("CSmsCtrlOperation::operator==");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   180
    Panic(KGsmuPanicMethodBodyNotImplemented1);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   181
    return EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   182
    BULLSEYE_RESTORE
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   183
    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   184
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   185
CSmsCtrlOperation::CSmsCtrlOperation(CSmsInformationElement::TSmsInformationElementIdentifier aId, CSmsMessage& aMessage) : CSmsIEOperation(aId, aMessage)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   186
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   187
	//NOP
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   188
	} // CSmsCtrlOperation::CSmsCtrlOperation
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   189
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   190
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   191
CSmsHyperLinkOperations::CSmsHyperLinkOperations(CSmsInformationElement::TSmsInformationElementIdentifier aId, CSmsMessage& aMessage) : CSmsCtrlOperation(aId, aMessage)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   192
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   193
	//NOP
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   194
	} // CSmsHyperLinkOperations::CSmsHyperLinkOperations
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   195
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   196
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   197
void CSmsIEOperation::ConstructL()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   198
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   199
	LOGGSMU1("CSmsIEOperation::ConstructL()");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   200
	} // CSmsIEOperation::ConstructL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   201
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   202
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   203
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   204
 *  @internalComponent
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   205
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   206
 *  Prevent clients from using the assignment operator by including it in the class definition
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   207
 *  but making it protected and not exporting it.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   208
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   209
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   210
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   211
void CSmsHyperLinkOperations::operator=(const CSmsHyperLinkOperations&)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   212
    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   213
    // Ignore in code coverage - not intended to be used
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   214
    BULLSEYE_OFF    
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   215
    LOGGSMU1("CSmsHyperLinkOperations::operator=");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   216
    Panic(KGsmuPanicMethodBodyNotImplemented1);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   217
    BULLSEYE_RESTORE
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   218
    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   219
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   220
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   221
 *  @internalComponent
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   222
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   223
 *  Prevent clients from using the equality operator by including it in the class definition
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   224
 *  but making it protected and not exporting it.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   225
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   226
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   227
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   228
TBool CSmsHyperLinkOperations::operator==(const CSmsHyperLinkOperations&)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   229
    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   230
    // Ignore in code coverage - not intended to be used
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   231
    BULLSEYE_OFF    
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   232
    LOGGSMU1("CSmsHyperLinkOperations::operator==");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   233
    Panic(KGsmuPanicMethodBodyNotImplemented1);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   234
    return EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   235
    BULLSEYE_RESTORE
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   236
    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   237
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   238
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   239
 *  @internalComponent
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   240
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   241
 *  Identifies whether the message type or version supports this operation
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   242
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   243
 *  @leave
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   244
 *  If the message type or version does not support this operation.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   245
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   246
void CSmsHyperLinkOperations::ValidateOperationL() const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   247
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   248
	LOGGSMU1("CSmsHyperLinkOperations::ValidateOperationL()");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   249
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   250
	if (iMessage.Version() < CSmsMessage::ESmsMessageV1)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   251
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   252
	    LOGGSMU2("CSmsHyperLinkOperations::AddHyperLinkL, Operation not supported, Msg Version %d", iMessage.Version());
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   253
	    User::Leave(KErrNotSupported);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   254
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   255
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   256
	if (!MessageTypeSupported())
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   257
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   258
	    LOGGSMU2("CSmsHyperLinkOperations::AddHyperLinkL, Operation not supported by this PDU type, type = %d", iMessage.Type());
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   259
	    User::Leave(KErrNotSupported);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   260
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   261
	} // CSmsHyperLinkOperations::ValidateOperationL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   262
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   263
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   264
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   265
 *  @publishedAll
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   266
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   267
 *  This method adds a HyperLink to the CSmsMessage.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   268
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   269
 *  @param aPosition
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   270
 *  The absolute character position within the message text.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   271
 *  @param aTitle
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   272
 *  An integer representation of the number of characters in the hyperlink title.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   273
 *  @param URL Length
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   274
 *  An integer representation of the number of characters in the URL.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   275
 *  @leave KErrNotSupported
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   276
 *  If the message version or type does not support hyperlinks.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   277
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   278
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   279
EXPORT_C void CSmsHyperLinkOperations::AddHyperLinkL(TUint aPosition, TUint8 aTitleLength,  TUint8  aURLLength) const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   280
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   281
	LOGGSMU1("CSmsHyperLinkOperations::AddHyperLinkL()");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   282
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   283
	ValidateOperationL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   284
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   285
	CSmsMessageAdditionalAttributes& additionalAttributes = *((CSmsMessageAdditionalAttributes*) iMessage.AdditionalInfo());
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   286
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   287
	TBuf8 <4> buffer;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   288
	buffer.SetLength(4);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   289
	buffer[0] = (TUint8) (aPosition >> 8); // lowest octet contains the
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   290
	buffer[1] = (TUint8)  aPosition;       // most significant bits
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   291
	buffer[2] = aTitleLength;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   292
	buffer[3] = aURLLength;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   293
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   294
	CSmsInformationElement* iE = CSmsInformationElement::NewL(CSmsInformationElement::ESmsHyperLinkFormat, buffer);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   295
	CleanupStack::PushL(iE);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   296
	additionalAttributes.AddControlInformationElementL(iE);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   297
	CleanupStack::Pop(iE);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   298
	} // CSmsHyperLinkOperations::AddHyperLinkL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   299
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   300
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   301
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   302
 *  @publishedAll
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   303
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   304
 *  Returns the number of Hyper Link IEs contained in this message.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   305
 *  @leave KErrNotSupported
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   306
 *  If this functionality is not supported by this version or type of message.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   307
 *  @return
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   308
 *  The number of hyper links contained in this message.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   309
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   310
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   311
EXPORT_C TUint CSmsHyperLinkOperations::NumberOfHyperLinksL() const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   312
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   313
	LOGGSMU1("CSmsHyperLinkOperations::NumberOfHyperLinks");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   314
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   315
	ValidateOperationL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   316
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   317
	TUint numberOfHyperLinks = 0;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   318
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   319
	TSmsInformationElementCategories::TInformationElementCategory category;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   320
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   321
	if (TSmsInformationElementCategories::GetCategoryDefinition(CSmsInformationElement::ESmsHyperLinkFormat, category) == EFalse)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   322
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   323
		User::Leave(KErrArgument);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   324
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   325
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   326
	CSmsMessageAdditionalAttributes* additionalAttributes = (CSmsMessageAdditionalAttributes*) iMessage.AdditionalInfo();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   327
	TUint numberOfElements = additionalAttributes->NumberOfControlInformationElements(category);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   328
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   329
	for (TUint i = 0; i < numberOfElements; i++)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   330
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   331
	    CSmsInformationElement::TSmsInformationElementIdentifier id = CSmsInformationElement::ESmsIEMaximum;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   332
	    
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   333
	    // If function leaves, allow the error to propagate upwards
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   334
	    id = additionalAttributes->GetControlInformationElementL(category, i).Identifier();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   335
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   336
	    if (id == CSmsInformationElement::ESmsHyperLinkFormat)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   337
	        {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   338
	        numberOfHyperLinks++;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   339
	        }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   340
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   341
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   342
	return numberOfHyperLinks;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   343
	} // CSmsHyperLinkOperations::NumberOfHyperLinksL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   344
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   345
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   346
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   347
 *  @publishedAll
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   348
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   349
 *  Copies the attributes of the specified hyperlink.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   350
 *  aIndex has the range [0..[n-1]] where n is the
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   351
 *  value returned by NumberOfHyperLinks()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   352
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   353
 *  @param aIndex
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   354
 *  Identifies the hyperlink to extract. Has the range [0..[n-1]]
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   355
 *  where n is the value returned by NumberOfHyperLinks().
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   356
 *  @param &aPosition
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   357
 *  The absolute character position within the message text.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   358
 *  @param &aTitleLength
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   359
 *  An integer representation of the number of characters in the hyperlink title.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   360
 *  @param &aURLLength
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   361
 *  An integer representation of the number of characters in the URL.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   362
 *  @leave KErrNotSupported
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   363
 *  If the message version or type does not support hyperlinks.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   364
 *  @leave KErrArgument
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   365
 *  If aIndex is out of range.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   366
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   367
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   368
EXPORT_C void  CSmsHyperLinkOperations::CopyHyperLinkAtIndexL(TUint aIndex, TUint& aPosition, TUint8& aTitleLength,  TUint8&  aURLLength) const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   369
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   370
	LOGGSMU2("CSmsHyperLinkOperations::CopyHyperLinkAtIndexL(): aIndex=%d", aIndex);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   371
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   372
	ValidateOperationL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   373
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   374
	TUint numberOfHyperLinks = 0;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   375
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   376
	TSmsInformationElementCategories::TInformationElementCategory category;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   377
	if (TSmsInformationElementCategories::GetCategoryDefinition(CSmsInformationElement::ESmsHyperLinkFormat, category) == EFalse)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   378
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   379
		User::Leave(KErrArgument);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   380
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   381
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   382
	CSmsMessageAdditionalAttributes* additionalAttributes = (CSmsMessageAdditionalAttributes*) iMessage.AdditionalInfo();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   383
	TUint numberOfElements = additionalAttributes->NumberOfControlInformationElements(category);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   384
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   385
	if (aIndex >= numberOfElements)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   386
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   387
	    User::Leave(KErrArgument);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   388
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   389
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   390
	for (TUint i = 0; i < numberOfElements; i++)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   391
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   392
	    CSmsInformationElement::TSmsInformationElementIdentifier id = CSmsInformationElement::ESmsIEMaximum;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   393
	    
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   394
	    // If function leaves, allow the error to propagate upwards
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   395
	    id = additionalAttributes->GetControlInformationElementL(category, i).Identifier();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   396
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   397
	    if ((id == CSmsInformationElement::ESmsHyperLinkFormat) &&
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   398
	        (numberOfHyperLinks++ == aIndex))
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   399
	        {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   400
	        aPosition     = (additionalAttributes->GetControlInformationElementL(category, i).Data()[0] << 8);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   401
	        aPosition    +=  additionalAttributes->GetControlInformationElementL(category, i).Data()[1];
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   402
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   403
	        aTitleLength = additionalAttributes->GetControlInformationElementL(category, i).Data()[2];
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   404
	        aURLLength   = additionalAttributes->GetControlInformationElementL(category, i).Data()[3];
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   405
	        break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   406
	        }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   407
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   408
	} // CSmsHyperLinkOperations::CopyHyperLinkAtIndexL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   409
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   410
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   411
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   412
 *  @publishedAll
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   413
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   414
 *  Removes all hyper Link IEs contained in this message.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   415
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   416
 *  @leave KErrNotSupported
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   417
 *  If the message version or type does not support hyperlinks.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   418
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   419
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   420
EXPORT_C void  CSmsHyperLinkOperations::RemoveAllHyperLinksL() const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   421
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   422
	LOGGSMU1("CSmsHyperLinkOperations::RemoveAllHyperLinks");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   423
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   424
	ValidateOperationL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   425
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   426
	TSmsInformationElementCategories::TInformationElementCategory category;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   427
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   428
	if (TSmsInformationElementCategories::GetCategoryDefinition(CSmsInformationElement::ESmsHyperLinkFormat, category) == EFalse)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   429
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   430
		User::Leave(KErrArgument);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   431
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   432
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   433
	CSmsMessageAdditionalAttributes* additionalAttributes = (CSmsMessageAdditionalAttributes*) iMessage.AdditionalInfo();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   434
	TUint i = additionalAttributes->NumberOfControlInformationElements(category);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   435
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   436
	while (i-- != 0)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   437
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   438
	    CSmsInformationElement::TSmsInformationElementIdentifier id = CSmsInformationElement::ESmsIEMaximum;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   439
	    
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   440
	    // If function leaves, allow the error to propagate upwards
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   441
	    id = additionalAttributes->GetControlInformationElementL(category, i).Identifier();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   442
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   443
	    if (id == CSmsInformationElement::ESmsHyperLinkFormat)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   444
	        {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   445
	        additionalAttributes->DeleteControlInformationElement(category, i);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   446
	        }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   447
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   448
	} // CSmsHyperLinkOperations::RemoveAllHyperLinksL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   449
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   450
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   451
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   452
 *  @publishedAll
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   453
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   454
 *  Removes the indexed hyperlink from this message.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   455
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   456
 *  @param aIndex
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   457
 *  aIndex has the range [0..[n-1]] where n is the
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   458
 *  value returned by NumberOfHyperLinks()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   459
 *  @leave KErrNotSupported
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   460
 *  If the message version or type does not support hyperlinks.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   461
 *  @leave KErrArgument
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   462
 *  If the index is out of range.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   463
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   464
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   465
EXPORT_C void  CSmsHyperLinkOperations::RemoveHyperLinkL(TUint aIndex) const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   466
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   467
	LOGGSMU1("CSmsHyperLinkOperations::RemoveHyperLink");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   468
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   469
	ValidateOperationL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   470
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   471
	TUint numberOfHyperLinks = 0;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   472
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   473
	TSmsInformationElementCategories::TInformationElementCategory category;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   474
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   475
	if (TSmsInformationElementCategories::GetCategoryDefinition(CSmsInformationElement::ESmsHyperLinkFormat, category) == EFalse)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   476
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   477
		User::Leave(KErrArgument);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   478
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   479
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   480
	CSmsMessageAdditionalAttributes* additionalAttributes = (CSmsMessageAdditionalAttributes*) iMessage.AdditionalInfo();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   481
	TUint numberOfElements = additionalAttributes->NumberOfControlInformationElements(category);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   482
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   483
	if (aIndex >= numberOfElements)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   484
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   485
	    User::Leave(KErrArgument);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   486
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   487
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   488
	for (TUint i = 0; i < numberOfElements; i++)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   489
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   490
	    CSmsInformationElement::TSmsInformationElementIdentifier id = CSmsInformationElement::ESmsIEMaximum;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   491
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   492
	    // If function leaves, allow the error to propagate upwards
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   493
	    id = additionalAttributes->GetControlInformationElementL(category, i).Identifier();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   494
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   495
	    if ((id == CSmsInformationElement::ESmsHyperLinkFormat) &&
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   496
	        (numberOfHyperLinks++ == aIndex))
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   497
	        {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   498
	        additionalAttributes->DeleteControlInformationElement(category, i);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   499
	        break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   500
	        }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   501
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   502
	} // CSmsHyperLinkOperations::RemoveHyperLinkL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   503
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   504
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   505
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   506
 *  @internalComponent
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   507
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   508
 *  Prevent clients from using the assignment operator by including it in the class definition
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   509
 *  but making it protected and not exporting it.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   510
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   511
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   512
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   513
void CSmsReplyAddressOperations::operator=(const CSmsReplyAddressOperations&)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   514
    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   515
    // Ignore in code coverage - not intended to be used
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   516
    BULLSEYE_OFF    
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   517
    LOGGSMU1("CSmsReplyAddressOperations::operator=");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   518
    Panic(KGsmuPanicMethodBodyNotImplemented1);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   519
    BULLSEYE_RESTORE
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   520
    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   521
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   522
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   523
 *  @internalComponent
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   524
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   525
 *  Prevent clients from using the equality operator by including it in the class definition
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   526
 *  but making it protected and not exporting it.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   527
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   528
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   529
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   530
TBool CSmsReplyAddressOperations::operator==(const CSmsReplyAddressOperations&)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   531
    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   532
    // Ignore in code coverage - not intended to be used
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   533
    BULLSEYE_OFF    
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   534
    LOGGSMU1("CSmsReplyAddressOperations::operator==");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   535
    Panic(KGsmuPanicMethodBodyNotImplemented1);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   536
    return EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   537
    BULLSEYE_RESTORE
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   538
    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   539
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   540
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   541
 *  @internalComponent
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   542
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   543
 *  Identifies whether the message type or version supports this operation
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   544
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   545
 *  @leave
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   546
 *  If the message type or version does not support this operation.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   547
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   548
void CSmsReplyAddressOperations::ValidateOperationL() const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   549
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   550
	LOGGSMU1("CSmsReplyAddressOperations::ValidateOperationL()");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   551
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   552
	if (iMessage.Version() < CSmsMessage::ESmsMessageV1)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   553
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   554
	    LOGGSMU2("CSmsReplyAddressOperations::AddReplyAddressL, Operation not supported, Msg Version %d", iMessage.Version());
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   555
	    User::Leave(KErrNotSupported);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   556
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   557
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   558
	if (!MessageTypeSupported())
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   559
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   560
	    LOGGSMU2("CSmsReplyAddressOperations::AddReplyAddressL, Operation not supported by this PDU type, type = %d", iMessage.Type());
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   561
	    User::Leave(KErrNotSupported);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   562
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   563
	} // CSmsReplyAddressOperations::ValidateOperationL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   564
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   565
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   566
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   567
 *  @publishedAll
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   568
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   569
 *  Adds a reply address information element.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   570
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   571
 *  @param aAddress
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   572
 *  The international number to be used in the reply address.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   573
 *  @leave KErrNotSupported
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   574
 *  If the message version or type does not support a reply addresses.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   575
 *  @leave KErrAlreadyExists
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   576
 *  If the message already contains a reply address.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   577
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   578
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   579
EXPORT_C void  CSmsReplyAddressOperations::AddReplyAddressL(const TDesC& aAddress) const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   580
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   581
	LOGGSMU1("CSmsReplyAddressOperations::AddReplyAddressL()");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   582
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   583
	ValidateOperationL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   584
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   585
	if (ContainsReplyAddressIEL())
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   586
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   587
	    LOGGSMU1("CSmsReplyAddressOperations::AddReplyAddressL, Already Exists");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   588
	    User::Leave(KErrAlreadyExists);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   589
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   590
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   591
	CSmsMessageAdditionalAttributes& additionalAttributes = *((CSmsMessageAdditionalAttributes*) iMessage.AdditionalInfo());
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   592
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   593
	CSmsAddress* address = CSmsAddress::NewL(iCharacterSetConverter,iFs); // needed for encoding the address into the IE.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   594
	CleanupStack::PushL(address);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   595
	address->SetAddressL(aAddress);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   596
	TBuf8<CSmsAddress::KSmsAddressMaxAddressLength> addressBuffer;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   597
	addressBuffer.SetLength(CSmsAddress::KSmsAddressMaxAddressLength);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   598
	TUint8* startPtr = &addressBuffer[0];
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   599
	TUint8* endPtr = address->EncodeL(startPtr);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   600
	TInt length = 0;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   601
	(endPtr > startPtr) ? (length = endPtr - startPtr) : (length = startPtr - endPtr);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   602
	addressBuffer.SetLength(length);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   603
	CleanupStack::PopAndDestroy(address);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   604
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   605
	CSmsInformationElement* iE = CSmsInformationElement::NewL(CSmsInformationElement::ESmsReplyAddressFormat, addressBuffer);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   606
	CleanupStack::PushL(iE);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   607
	additionalAttributes.AddControlInformationElementL(iE);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   608
	CleanupStack::Pop(iE);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   609
	} // CSmsReplyAddressOperations::AddReplyAddressL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   610
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   611
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   612
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   613
 *  @publishedAll
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   614
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   615
 *  Adds a reply address information element.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   616
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   617
 *  @param aAddress
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   618
 *  Sets To and From addresses in ETSI format.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   619
 *  @leave KErrNotSupported
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   620
 *  If the message version or type does not support a reply addresses.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   621
 *  @leave KErrAlreadyExists
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   622
 *  If the message already contains a reply address.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   623
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   624
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   625
EXPORT_C void  CSmsReplyAddressOperations::AddParsedReplyAddressL(const TGsmSmsTelNumber& aParsedAddress) const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   626
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   627
	LOGGSMU1("CSmsReplyAddressOperations::AddParsedReplyAddressL");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   628
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   629
	ValidateOperationL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   630
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   631
	if (ContainsReplyAddressIEL())
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   632
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   633
	    LOGGSMU1("CSmsReplyAddressOperations::AddParsedReplyAddressL, Already Exists");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   634
	    User::Leave(KErrAlreadyExists);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   635
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   636
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   637
	CSmsMessageAdditionalAttributes& additionalAttributes = *((CSmsMessageAdditionalAttributes*) iMessage.AdditionalInfo());
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   638
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   639
	CSmsAddress* address = CSmsAddress::NewL(iCharacterSetConverter,iFs);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   640
	CleanupStack::PushL(address);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   641
	address->SetParsedAddressL(aParsedAddress);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   642
	TBuf8<CSmsAddress::KSmsAddressMaxAddressLength> addressBuffer;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   643
	addressBuffer.SetLength(CSmsAddress::KSmsAddressMaxAddressLength);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   644
	TUint8* startPtr = &addressBuffer[0];
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   645
	TUint8* endPtr = address->EncodeL(startPtr);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   646
	TInt length = 0;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   647
	(endPtr > startPtr) ? (length = endPtr - startPtr) : (length = startPtr - endPtr);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   648
	addressBuffer.SetLength(length);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   649
	CleanupStack::PopAndDestroy(address);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   650
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   651
	CSmsInformationElement* iE = CSmsInformationElement::NewL(CSmsInformationElement::ESmsReplyAddressFormat, addressBuffer);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   652
	CleanupStack::PushL(iE);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   653
	additionalAttributes.AddControlInformationElementL(iE);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   654
	CleanupStack::Pop(iE);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   655
	} // CSmsReplyAddressOperations::AddParsedReplyAddressL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   656
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   657
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   658
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   659
 *  @publishedAll
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   660
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   661
 *  Identifies whether a reply address has already been added to this
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   662
 *  CSmsMessage using the CSmsReplyAddressOperations interface.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   663
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   664
 *  @return
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   665
 *  True if the reply address has already been added using this interface.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   666
 *  @leave KErrNotSupported
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   667
 *  If the message version or type does not support this query.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   668
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   669
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   670
EXPORT_C TBool CSmsReplyAddressOperations::ContainsReplyAddressIEL() const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   671
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   672
	LOGGSMU1("CSmsReplyAddressOperations::ContainsReplyAddressIEL()");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   673
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   674
	TBool rc = EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   675
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   676
	ValidateOperationL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   677
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   678
	TSmsInformationElementCategories::TInformationElementCategory category;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   679
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   680
	if (TSmsInformationElementCategories::GetCategoryDefinition(CSmsInformationElement::ESmsReplyAddressFormat, category) == EFalse)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   681
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   682
		User::Leave(KErrArgument);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   683
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   684
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   685
	CSmsMessageAdditionalAttributes* additionalAttributes = (CSmsMessageAdditionalAttributes*) iMessage.AdditionalInfo();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   686
	TUint numberOfElements = additionalAttributes->NumberOfControlInformationElements(category);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   687
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   688
	for (TUint i = 0; i < numberOfElements; i++)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   689
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   690
	    CSmsInformationElement::TSmsInformationElementIdentifier id = CSmsInformationElement::ESmsIEMaximum;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   691
	    
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   692
	    // If function leaves, allow the error to propagate upwards
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   693
	    id = additionalAttributes->GetControlInformationElementL(category, i).Identifier();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   694
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   695
	    if (id == CSmsInformationElement::ESmsReplyAddressFormat)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   696
	        {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   697
	        rc = ETrue;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   698
	        break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   699
	        }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   700
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   701
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   702
	return rc;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   703
	} // CSmsReplyAddressOperations::ContainsReplyAddressIEL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   704
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   705
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   706
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   707
 *  @publishedAll
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   708
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   709
 *  Returns the reply address as an international number
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   710
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   711
 *  @return
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   712
 *  The reply address as an international number.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   713
 *  @leave KErrNotSupported
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   714
 *  If the message version or type does not support this query.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   715
 *  @leave KErrNotFound
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   716
 *  If the message does not contain a reply address information element.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   717
 *  @leave KErrCorrupt
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   718
 *  If the reply address is corrupt
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   719
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   720
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   721
EXPORT_C HBufC* CSmsReplyAddressOperations::GetReplyAddressL() const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   722
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   723
	LOGGSMU1("CSmsReplyAddressOperations::GetReplyAddressL");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   724
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   725
	ValidateOperationL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   726
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   727
	TBool found = EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   728
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   729
	CSmsAddress* address = CSmsAddress::NewL(iCharacterSetConverter,iFs);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   730
	CleanupStack::PushL(address);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   731
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   732
	TSmsInformationElementCategories::TInformationElementCategory category;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   733
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   734
	if (TSmsInformationElementCategories::GetCategoryDefinition(CSmsInformationElement::ESmsReplyAddressFormat, category) == EFalse)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   735
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   736
		User::Leave(KErrArgument);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   737
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   738
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   739
	CSmsMessageAdditionalAttributes* additionalAttributes = (CSmsMessageAdditionalAttributes*) iMessage.AdditionalInfo();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   740
	TUint numberOfElements = additionalAttributes->NumberOfControlInformationElements(category);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   741
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   742
	for (TUint i = 0; i < numberOfElements; i++)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   743
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   744
	    CSmsInformationElement::TSmsInformationElementIdentifier id = CSmsInformationElement::ESmsIEMaximum;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   745
	    
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   746
	    // If function leaves, allow the error to propagate upwards
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   747
	    id = additionalAttributes->GetControlInformationElementL(category, i).Identifier();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   748
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   749
	    if (id == CSmsInformationElement::ESmsReplyAddressFormat)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   750
	        {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   751
	        TGsmuLex8 encodedAddress(additionalAttributes->GetControlInformationElementL(category, i).Data());
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   752
	        TRAPD(err,address->DecodeL(encodedAddress));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   753
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   754
	        if (err == KErrNone)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   755
	            {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   756
	            found = ETrue;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   757
	            break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   758
	            }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   759
	        else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   760
	            {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   761
	            User::Leave(KErrCorrupt);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   762
	            }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   763
	        }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   764
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   765
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   766
	HBufC* buf = NULL;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   767
	if (found)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   768
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   769
	    buf = HBufC::NewL(TGsmSmsTelNumberMaxLen); // 20 characters preceeded by '+'
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   770
	    *buf = address->Address();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   771
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   772
	else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   773
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   774
	    User::Leave(KErrNotFound);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   775
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   776
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   777
	CleanupStack::PopAndDestroy(address);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   778
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   779
	return buf;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   780
	} // CSmsReplyAddressOperations::GetReplyAddressL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   781
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   782
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   783
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   784
 *  @publishedAll
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   785
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   786
 *  Returns the reply address in ETSI format.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   787
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   788
 *  @return
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   789
 *  True, if the CSmsMessage contains a reply address.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   790
 *  False, otherwise
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   791
 *  @leave KErrNotSupported
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   792
 *  If the message version or type does not support this query.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   793
 *  @leave KErrCorrupt
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   794
 *  If the reply address is corrupt
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   795
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   796
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   797
EXPORT_C TInt  CSmsReplyAddressOperations::GetParsedReplyAddressL(TGsmSmsTelNumber& aParsedAddress) const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   798
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   799
	LOGGSMU1("CSmsReplyAddressOperations::GetParsedReplyAddressL");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   800
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   801
	ValidateOperationL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   802
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   803
	TBool rc = EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   804
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   805
	CSmsAddress* address = CSmsAddress::NewL(iCharacterSetConverter,iFs);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   806
	CleanupStack::PushL(address);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   807
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   808
	TSmsInformationElementCategories::TInformationElementCategory category;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   809
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   810
	if (TSmsInformationElementCategories::GetCategoryDefinition(CSmsInformationElement::ESmsReplyAddressFormat, category) == EFalse)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   811
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   812
		User::Leave(KErrArgument);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   813
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   814
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   815
	CSmsMessageAdditionalAttributes* additionalAttributes = (CSmsMessageAdditionalAttributes*) iMessage.AdditionalInfo();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   816
	TUint numberOfElements = additionalAttributes->NumberOfControlInformationElements(category);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   817
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   818
	for (TUint i = 0; i < numberOfElements; i++)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   819
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   820
	    CSmsInformationElement::TSmsInformationElementIdentifier id = CSmsInformationElement::ESmsIEMaximum;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   821
	    
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   822
	    // If function leaves, allow the error to propagate upwards
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   823
	    id = additionalAttributes->GetControlInformationElementL(category, i).Identifier();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   824
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   825
	    // CSmsAddress is used here for encoding the reply address into an IE.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   826
	    // It also used to encode the source / destination address in the CSmsMessage.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   827
	    // CSmsAddress::DecodeL expects internally that alphanumeric addresses will be size
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   828
	    // CSmsAddress::KSmsAddressMaxAddressValueLength=10.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   829
	    // Need to add padding bytes to bring the address field up to the maximum size.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   830
	    if (id == CSmsInformationElement::ESmsReplyAddressFormat)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   831
	        {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   832
	        TBuf8<CSmsAddress::KSmsAddressMaxAddressLength> data;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   833
	        data = additionalAttributes->GetControlInformationElementL(category, i).Data();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   834
	        TUint8 actualDataLength = data.Length();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   835
	        data.SetLength(CSmsAddress::KSmsAddressMaxAddressLength);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   836
	        for (TUint8 j = actualDataLength; j < CSmsAddress::KSmsAddressMaxAddressLength; j++)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   837
	            {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   838
	            data[j] = 0;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   839
	            }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   840
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   841
	        TGsmuLex8 encodedAddress(data);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   842
	        TRAPD(err,address->DecodeL(encodedAddress));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   843
	        if (err==KErrNone)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   844
	            {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   845
	            address->ParsedAddress(aParsedAddress);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   846
	            rc = ETrue;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   847
	            break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   848
	            }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   849
	        else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   850
	            {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   851
	            User::Leave(KErrCorrupt);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   852
	            }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   853
	        }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   854
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   855
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   856
	CleanupStack::PopAndDestroy(address);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   857
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   858
	return rc;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   859
	} // CSmsReplyAddressOperations::GetParsedReplyAddressL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   860
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   861
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   862
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   863
 *  @publishedAll
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   864
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   865
 *  Removes the reply address information element.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   866
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   867
 *  @leave KErrNotSupported
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   868
 *  If the message version or type does not support this query.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   869
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   870
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   871
EXPORT_C void  CSmsReplyAddressOperations::RemoveReplyAddressL() const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   872
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   873
	LOGGSMU1("CSmsReplyAddressOperations::RemoveReplyAddress");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   874
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   875
	ValidateOperationL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   876
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   877
	TSmsInformationElementCategories::TInformationElementCategory category;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   878
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   879
	if (TSmsInformationElementCategories::GetCategoryDefinition(CSmsInformationElement::ESmsReplyAddressFormat, category) == EFalse)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   880
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   881
		User::Leave(KErrArgument);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   882
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   883
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   884
	CSmsMessageAdditionalAttributes* additionalAttributes = (CSmsMessageAdditionalAttributes*) iMessage.AdditionalInfo();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   885
	TUint numberOfElements = additionalAttributes->NumberOfControlInformationElements(category);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   886
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   887
	for (TInt i = 0; i < numberOfElements; i++)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   888
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   889
	    CSmsInformationElement::TSmsInformationElementIdentifier id = CSmsInformationElement::ESmsIEMaximum;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   890
	    
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   891
	    // If function leaves, allow the error to propagate upwards
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   892
	    id = additionalAttributes->GetControlInformationElementL(category, i).Identifier();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   893
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   894
	    if (id == CSmsInformationElement::ESmsReplyAddressFormat)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   895
	        {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   896
	        additionalAttributes->DeleteControlInformationElement(category, i);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   897
	        break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   898
	        }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   899
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   900
	} // CSmsReplyAddressOperations::RemoveReplyAddressL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   901
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   902
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   903
CSmsReplyAddressOperations::CSmsReplyAddressOperations(CSmsInformationElement::TSmsInformationElementIdentifier aId,  CSmsMessage& aMessage,
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   904
                                                       CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) : CSmsCtrlOperation(aId, aMessage),
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   905
                                                       iCharacterSetConverter(aCharacterSetConverter), iFs(aFs)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   906
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   907
	//NOP
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   908
	} // CSmsReplyAddressOperations::CSmsReplyAddressOperations
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   909
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   910
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   911
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   912
 *  @internalComponent
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   913
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   914
 *  Identifies whether the message type or version supports this operation
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   915
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   916
 *  @leave
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   917
 *  If the message type or version does not support this operation.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   918
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   919
void CSmsSpecialSMSMessageOperations::ValidateOperationL() const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   920
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   921
	LOGGSMU1("CSmsSpecialSMSMessageOperations::ValidateOperationL()");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   922
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   923
	if (iMessage.Version() < CSmsMessage::ESmsMessageV1)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   924
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   925
	    LOGGSMU2("CSmsSpecialSMSMessageOperations::AddSpecialMessageIndicationL, Operation not supported, version %d", iMessage.Version());
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   926
	    User::Leave(KErrNotSupported);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   927
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   928
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   929
	if (!MessageTypeSupported())
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   930
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   931
	    LOGGSMU2("CSmsSpecialSMSMessageOperations::AddSpecialMessageIndicationL, Operation not supported by this PDU type, type = %d", iMessage.Type());
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   932
	    User::Leave(KErrNotSupported);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   933
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   934
	} // CSmsSpecialSMSMessageOperations::ValidateOperationL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   935
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   936
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   937
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   938
 *  @internalComponent
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   939
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   940
 *  Prevent clients from using the assignment operator by including it in the class definition
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   941
 *  but making it protected and not exporting it.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   942
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   943
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   944
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   945
void CSmsSpecialSMSMessageOperations::operator=(const CSmsSpecialSMSMessageOperations&)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   946
    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   947
    // Ignore in code coverage - not intended to be used
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   948
    BULLSEYE_OFF    
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   949
    LOGGSMU1("CSmsSpecialSMSMessageOperations::operator=");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   950
    Panic(KGsmuPanicMethodBodyNotImplemented1);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   951
    BULLSEYE_RESTORE
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   952
    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   953
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   954
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   955
 *  @internalComponent
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   956
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   957
 *  Prevent clients from using the equality operator by including it in the class definition
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   958
 *  but making it protected and not exporting it.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   959
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   960
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   961
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   962
TBool CSmsSpecialSMSMessageOperations::operator==(const CSmsSpecialSMSMessageOperations&)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   963
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   964
	LOGGSMU1("CSmsSpecialSMSMessageOperations::operator==");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   965
	Panic(KGsmuPanicMethodBodyNotImplemented1);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   966
	return EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   967
	} // CSmsSpecialSMSMessageOperations::operator
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   968
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   969
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   970
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   971
 *  @publishedAll
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   972
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   973
 *  Either adds a new or updates an existing special message indication information element.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   974
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   975
 *  @param aStore
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   976
 *  Indicates whether or not the message shall be stored.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   977
 *  @param aMessageIndicationType
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   978
 *  Indicates the basic message type
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   979
 *  @param aExtendedType
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   980
 *  Indicates the extended message type
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   981
 *  @param aProfile
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   982
 *  Indicates the profile ID of the Multiple Subscriber Profile
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   983
 *  @param aMessageCount
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   984
 *  Indicates the number of messages of the type specified in Octet 1 that are waiting
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   985
 *  @leave KErrNotSupported
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   986
 *  If the message version or type does not support this query.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   987
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   988
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   989
EXPORT_C void CSmsSpecialSMSMessageOperations::AddSpecialMessageIndicationL(TBool aStore,
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   990
                                                                            TSmsMessageIndicationType aMessageIndicationType,
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   991
                                                                            TExtendedSmsIndicationType aExtendedType,
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   992
                                                                            TSmsMessageProfileType aProfile,
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   993
                                                                            TUint8 aMessageCount) const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   994
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   995
	LOGGSMU1("CSmsSpecialSMSMessageOperations::AddSpecialMessageIndicationL");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   996
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   997
	ValidateOperationL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   998
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   999
	CSmsUserData& userData = iMessage.SmsPDU().UserData();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1000
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1001
	TBuf8<2> data;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1002
	data.SetLength(2);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1003
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1004
	data[0] = ( ((TUint8) aMessageIndicationType) +
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1005
	            ((TUint8) (aExtendedType << 2))   +
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1006
	            ((TUint8) (aProfile      << 5))   +
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1007
	            ((TUint8) (aStore        << 7)) );
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1008
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1009
	data[1] = aMessageCount;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1010
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1011
	CArrayFixFlat<TInt>* indices = new(ELeave) CArrayFixFlat<TInt>(4);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1012
	CleanupStack::PushL(indices);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1013
	userData.InformationElementIndicesL(CSmsInformationElement::ESmsIEISpecialSMSMessageIndication, *indices);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1014
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1015
	TBool found = EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1016
	TInt count = indices->Count();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1017
	for (TInt i=0; ((i<count) && (found==EFalse)); i++)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1018
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1019
		TUint index = indices->operator[](i);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1020
		CSmsInformationElement& ieAlreadyInWorkingPDU = userData.InformationElement(index);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1021
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1022
	    if (ieAlreadyInWorkingPDU.Data()[0] == data[0])
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1023
	        {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1024
	        ieAlreadyInWorkingPDU.Data()[1] = data[1];
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1025
	        found = ETrue;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1026
	        break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1027
	        }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1028
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1029
	CleanupStack::PopAndDestroy(indices);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1030
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1031
	if (found == EFalse)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1032
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1033
	    userData.AddInformationElementL(CSmsInformationElement::ESmsIEISpecialSMSMessageIndication,data);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1034
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1035
	} // CSmsSpecialSMSMessageOperations::AddSpecialMessageIndicationL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1036
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1037
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1038
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1039
 *  @publishedAll
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1040
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1041
 *  Gets a count of the number of special message indication information elements which
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1042
 *  are stored inside the user data.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1043
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1044
 *  @return The number of special message indication information elements which
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1045
 *  are stored inside the user data.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1046
 *  @leave KErrNotSupported
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1047
 *  If the message version or type does not support this query.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1048
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1049
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1050
EXPORT_C TUint CSmsSpecialSMSMessageOperations::GetCountOfSpecialMessageIndicationsL() const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1051
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1052
	LOGGSMU1("CSmsSpecialSMSMessageOperations::GetCountOfSpecialMessageIndicationsL()");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1053
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1054
	ValidateOperationL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1055
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1056
	CSmsUserData& userData = iMessage.SmsPDU().UserData();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1057
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1058
	CArrayFixFlat<TInt>* indices = new (ELeave) CArrayFixFlat<TInt>(8);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1059
	CleanupStack::PushL(indices);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1060
	userData.InformationElementIndicesL(CSmsInformationElement::ESmsIEISpecialSMSMessageIndication,*indices);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1061
	TUint  count = indices->Count();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1062
	CleanupStack::PopAndDestroy(indices);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1063
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1064
	return count;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1065
	} // CSmsSpecialSMSMessageOperations::GetCountOfSpecialMessageIndicationsL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1066
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1067
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1068
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1069
 *  @publishedAll
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1070
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1071
 *  Gets the attributes of the Special Message Indication specified by aIndex.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1072
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1073
 *  @param aIndex
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1074
 *  aIndex is a value less than GetCountOfSpecialMessageIndications().
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1075
 *  @param aStore
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1076
 *  Indicates whether or not the message shall be stored.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1077
 *  @param aMessageIndicationType
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1078
 *  Indicates the basic message type
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1079
 *  @param aExtendedType
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1080
 *  Indicates the extended message type
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1081
 *  @param aProfile
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1082
 *  Indicates the profile ID of the Multiple Subscriber Profile
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1083
 *  @param aMessageCount
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1084
 *  Indicates the number of messages of the type specified in Octet 1 that are waiting
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1085
 *  @leave KErrNotSupported
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1086
 *  If the message version or type does not support this query.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1087
 *  @leave KErrArgument
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1088
 *  If aIndex is >= GetCountOfSpecialMessageIndications()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1089
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1090
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1091
EXPORT_C void CSmsSpecialSMSMessageOperations::GetMessageIndicationIEL(TUint aIndex,
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1092
                                                                       TBool& aStore,
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1093
                                                                       TSmsMessageIndicationType& aMessageIndicationType,
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1094
                                                                       TExtendedSmsIndicationType& aExtendedType,
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1095
                                                                       TSmsMessageProfileType&  aProfile,
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1096
                                                                       TUint8& aMessageCount) const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1097
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1098
	LOGGSMU1("CSmsSpecialSMSMessageOperations::GetMessageIndicationIEL()");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1099
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1100
	ValidateOperationL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1101
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1102
	CSmsUserData& userData = iMessage.SmsPDU().UserData();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1103
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1104
	CArrayFixFlat<TInt>* indices = new (ELeave) CArrayFixFlat<TInt>(8);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1105
	CleanupStack::PushL(indices);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1106
	userData.InformationElementIndicesL(CSmsInformationElement::ESmsIEISpecialSMSMessageIndication,*indices);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1107
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1108
	if (aIndex < indices->Count())
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1109
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1110
	    CSmsInformationElement& informationElement = userData.InformationElement((*indices)[aIndex]);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1111
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1112
	    aMessageIndicationType =  (TSmsMessageIndicationType)   (informationElement.Data()[0]       & 0x03);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1113
	    aExtendedType          =  (TExtendedSmsIndicationType) ((informationElement.Data()[0] >> 2) & 0x07);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1114
	    aProfile               =  (TSmsMessageProfileType)     ((informationElement.Data()[0] >> 5) & 0x03);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1115
	    aStore                 =  (TBool)                      ((informationElement.Data()[0] >> 7) & 0x01);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1116
	    aMessageCount          =  (TUint8)                      (informationElement.Data()[1]);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1117
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1118
	else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1119
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1120
	    User::Leave(KErrArgument);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1121
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1122
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1123
	CleanupStack::PopAndDestroy(indices);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1124
	} // CSmsSpecialSMSMessageOperations::GetMessageIndicationIEL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1125
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1126
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1127
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1128
 *  @publishedAll
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1129
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1130
 *  Removes the Special Message Indication specified by the input attributes, provided it exists.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1131
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1132
 *  @param aMessageIndicationType
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1133
 *  Indicates the basic message type
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1134
 *  @param aExtendedType
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1135
 *  Indicates the extended message type
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1136
 *  @leave KErrNotSupported
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1137
 *  If the message version or type does not support this query.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1138
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1139
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1140
EXPORT_C void CSmsSpecialSMSMessageOperations::RemoveSpecialMessageIndicationL(TSmsMessageIndicationType aMessageIndicationType, TExtendedSmsIndicationType aExtendedType) const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1141
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1142
	LOGGSMU1("CSmsSpecialSMSMessageOperations::RemoveAllSpecialMessageIndications");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1143
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1144
	ValidateOperationL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1145
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1146
	CSmsUserData& userData = iMessage.SmsPDU().UserData();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1147
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1148
	CArrayFixFlat<TInt>* indices = new (ELeave) CArrayFixFlat<TInt>(8);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1149
	CleanupStack::PushL(indices);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1150
	userData.InformationElementIndicesL(CSmsInformationElement::ESmsIEISpecialSMSMessageIndication,*indices);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1151
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1152
	TUint i = indices->Count();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1153
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1154
	while (i-- != 0)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1155
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1156
	    CSmsInformationElement& informationElement = userData.InformationElement((*indices)[i]);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1157
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1158
	    TSmsMessageIndicationType          type = ((TSmsMessageIndicationType)   (informationElement.Data()[0]       & 0x03));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1159
	    TExtendedSmsIndicationType extendedType =  (TExtendedSmsIndicationType) ((informationElement.Data()[0] >> 2) & 0x07);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1160
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1161
	    if ( (aMessageIndicationType == type) &&
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1162
	         (aExtendedType == extendedType) )
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1163
	        {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1164
	        userData.RemoveInformationElement((*indices)[i]);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1165
	        break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1166
	        }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1167
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1168
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1169
	CleanupStack::PopAndDestroy(indices);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1170
	} // CSmsSpecialSMSMessageOperations::RemoveSpecialMessageIndicationL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1171
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1172
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1173
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1174
 *  @publishedAll
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1175
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1176
 *  Removes all Special Message Indications Information Elements contained in the message.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1177
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1178
 *  @leave KErrNotSupported
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1179
 *  If the message version or type does not support this query.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1180
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1181
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1182
EXPORT_C void CSmsSpecialSMSMessageOperations::RemoveAllSpecialMessageIndicationsL() const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1183
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1184
	LOGGSMU1("CSmsSpecialSMSMessageOperations::RemoveAllSpecialMessageIndicationsL");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1185
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1186
	ValidateOperationL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1187
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1188
	CSmsUserData& userData = iMessage.SmsPDU().UserData();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1189
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1190
	CArrayFixFlat<TInt>* indices = new (ELeave) CArrayFixFlat<TInt>(8);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1191
	CleanupStack::PushL(indices);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1192
	userData.InformationElementIndicesL(CSmsInformationElement::ESmsIEISpecialSMSMessageIndication,*indices);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1193
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1194
	TUint i = indices->Count();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1195
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1196
	while (i-- != 0)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1197
	   {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1198
	   userData.RemoveInformationElement((*indices)[i]);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1199
	   }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1200
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1201
	CleanupStack::PopAndDestroy(indices);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1202
	} // CSmsSpecialSMSMessageOperations::RemoveAllSpecialMessageIndicationsL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1203
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1204
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1205
CSmsSpecialSMSMessageOperations::CSmsSpecialSMSMessageOperations(CSmsInformationElement::TSmsInformationElementIdentifier aId, CSmsMessage& aMessage) : CSmsCtrlOperation(aId, aMessage)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1206
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1207
	//NOP
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1208
	} // CSmsSpecialSMSMessageOperations::CSmsSpecialSMSMessageOperations
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1209
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1210
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1211
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1212
 *  @internalComponent
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1213
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1214
 *  Prevent clients from using the assignment operator by including it in the class definition
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1215
 *  but making it protected and not exporting it.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1216
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1217
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1218
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1219
void CSmsEnhancedVoiceMailOperations::operator=(const CSmsEnhancedVoiceMailOperations&)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1220
    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1221
    // Ignore in code coverage - not intended to be used
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1222
    BULLSEYE_OFF    
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1223
    LOGGSMU1("CSmsEnhancedVoiceMailOperations::operator=");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1224
    Panic(KGsmuPanicMethodBodyNotImplemented1);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1225
    BULLSEYE_RESTORE
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1226
    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1227
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1228
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1229
 *  @internalComponent
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1230
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1231
 *  Prevent clients from using the equality operator by including it in the class definition
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1232
 *  but making it protected and not exporting it.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1233
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1234
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1235
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1236
TBool CSmsEnhancedVoiceMailOperations::operator==(const CSmsEnhancedVoiceMailOperations&)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1237
    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1238
    // Ignore in code coverage - not intended to be used
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1239
    BULLSEYE_OFF    
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1240
    LOGGSMU1("CSmsEnhancedVoiceMailOperations::operator==");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1241
    Panic(KGsmuPanicMethodBodyNotImplemented1);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1242
    return EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1243
    BULLSEYE_RESTORE
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1244
    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1245
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1246
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1247
 *  @internalComponent
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1248
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1249
 *  Identifies whether the message type or version supports this operation
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1250
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1251
 *  @leave
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1252
 *  If the message type or version does not support this operation.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1253
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1254
void CSmsEnhancedVoiceMailOperations::ValidateOperationL() const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1255
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1256
	LOGGSMU1("CSmsEnhancedVoiceMailOperations::ValidateOperationL()");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1257
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1258
	if (iMessage.Version() < CSmsMessage::ESmsMessageV1)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1259
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1260
	    LOGGSMU2("CSmsEnhancedVoiceMailInformation::AddEnhancedVoiceMailIEL, Operation not supported, Msg Version %d", iMessage.Version());
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1261
	    User::Leave(KErrNotSupported);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1262
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1263
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1264
	if (!MessageTypeSupported())
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1265
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1266
	    LOGGSMU2("CSmsSpecialSMSMessageOperations::AddEnhancedVoiceMailIEL, Operation not supported by this PDU type, type = %d", iMessage.Type());
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1267
	    User::Leave(KErrNotSupported);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1268
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1269
	} // CSmsEnhancedVoiceMailOperations::ValidateOperationL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1270
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1271
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1272
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1273
 *  @publishedAll
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1274
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1275
 *  Adds an Enhanced Voice Mail Information Element to the CSmsMessage.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1276
 *  The information element can be either an Enhanced Voice Mail Notification or
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1277
 *  an Enhanced Voice Mail Delete Confirmation. Enhanced Voice Mail Notifications
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1278
 *  and Enhanced Voice Mail Delete Confirmations are abstracted in classes derived
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1279
 *  from CEnhancedVoiceMailBoxInformation.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1280
 *  @param aEVMI
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1281
 *  A pointer to the Enhanced Voice Mail Information Element.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1282
 *  @leave KErrNotSupported
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1283
 *  If the message version or type does not support this query.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1284
 *  @leave KErrAlreadyExists
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1285
 *  If an Enhanced Voice Mail Information Element has already been installed.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1286
 *  @leave KErrArgument
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1287
 *  If the input parameter contains invalid parameters.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1288
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1289
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1290
EXPORT_C void CSmsEnhancedVoiceMailOperations::AddEnhancedVoiceMailIEL(const CEnhancedVoiceMailBoxInformation& aEVMI) const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1291
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1292
	LOGGSMU1("CSmsEnhancedVoiceMailInformation::AddEnhancedVoiceMailIEL");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1293
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1294
	ValidateOperationL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1295
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1296
	if (ContainsEnhancedVoiceMailIEL())
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1297
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1298
	    LOGGSMU1("CSmsEnhancedVoiceMailInformation::AddEnhancedVoiceMailIEL, Already Exists");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1299
	    User::Leave(KErrAlreadyExists);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1300
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1301
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1302
	CSmsMessageAdditionalAttributes& additionalAttributes = *((CSmsMessageAdditionalAttributes*) iMessage.AdditionalInfo());
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1303
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1304
	// The Enhanced Voice Mail Information Element must fit into a single PDU.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1305
	// The maximum size for its data field is therefore
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1306
	// the maximum size of the user data minus user data header length, the ie identifier byte and
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1307
	// ie length byte.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1308
	TBuf8<CEnhancedVoiceMailBoxInformation::KSmsMaxEnhancedVoiceMailSize> voiceMailInfo;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1309
	voiceMailInfo.SetLength(CEnhancedVoiceMailNotification::KSmsMaxEnhancedVoiceMailSize);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1310
	TUint8* startPtr = &voiceMailInfo[0];
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1311
	TUint8* endPtr = aEVMI.EncodeL(startPtr, iCharacterSetConverter, iFs);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1312
	TInt length = (TInt) (endPtr - startPtr);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1313
	voiceMailInfo.SetLength(length);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1314
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1315
	CSmsInformationElement* iE = CSmsInformationElement::NewL(CSmsInformationElement::CSmsInformationElement::ESmsEnhanceVoiceMailInformation, voiceMailInfo);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1316
	CleanupStack::PushL(iE);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1317
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1318
	additionalAttributes.AddControlInformationElementL(iE);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1319
	CleanupStack::Pop();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1320
	} // CSmsEnhancedVoiceMailOperations::AddEnhancedVoiceMailIEL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1321
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1322
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1323
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1324
 *  @publishedAll
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1325
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1326
 *  Removes the Enhanced Voice Mail Information Element from the CSmsMessage,
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1327
 *  provided it exists.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1328
 *  @leave KErrNotSupported
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1329
 *  If the message version or type does not support this query.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1330
 *  @leave KErrNotFound
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1331
 *  If the CSmsMessage does not contain an Enhanced Voice Mail Information Element
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1332
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1333
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1334
EXPORT_C CEnhancedVoiceMailBoxInformation* CSmsEnhancedVoiceMailOperations::RemoveEnhancedVoiceMailIEL() const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1335
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1336
	LOGGSMU1("CSmsEnhancedVoiceMailInformation::RemoveEnhancedVoiceMailIE");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1337
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1338
	ValidateOperationL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1339
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1340
	CEnhancedVoiceMailBoxInformation* voiceMailBoxInfo = NULL;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1341
	TBool deleteInformationElement = ETrue;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1342
	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1343
	// If function leaves, allow the error to propagate upwards
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1344
	voiceMailBoxInfo = GetEnhancedVoiceMailIEL(deleteInformationElement);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1345
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1346
	return voiceMailBoxInfo;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1347
	} // CSmsEnhancedVoiceMailOperations::RemoveEnhancedVoiceMailIEL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1348
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1349
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1350
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1351
 *  @publishedAll
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1352
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1353
 *  Copies the Enhanced Voice Mail Information Element contained in the CSmsMessage,
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1354
 *  provided one exists.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1355
 *  @leave KErrNotSupported
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1356
 *  If the message version or type does not support this query.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1357
 *  @leave KErrNotFound
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1358
 *  If the CSmsMessage does not contain an Enhanced Voice Mail Information Element to copy.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1359
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1360
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1361
EXPORT_C CEnhancedVoiceMailBoxInformation* CSmsEnhancedVoiceMailOperations::CopyEnhancedVoiceMailIEL() const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1362
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1363
	LOGGSMU1("CSmsEnhancedVoiceMailInformation::CopyEnhancedVoiceMailIEL");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1364
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1365
	ValidateOperationL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1366
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1367
	CEnhancedVoiceMailBoxInformation* voiceMailBoxInfo = NULL;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1368
	TBool deleteInformationElement = EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1369
	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1370
	// If function leaves, allow the error to propagate upwards
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1371
	voiceMailBoxInfo = GetEnhancedVoiceMailIEL(deleteInformationElement);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1372
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1373
	return voiceMailBoxInfo;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1374
	} // CSmsEnhancedVoiceMailOperations::CopyEnhancedVoiceMailIEL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1375
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1376
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1377
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1378
 *  @internalComponent
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1379
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1380
 *  Returns a copy of the Enhanced Voice Mail Information Element contained in the CSmsMessage,
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1381
 *  provided one exists. Optionally deletes the information element.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1382
 *  @param aRemove
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1383
 *  Indicates that the information element should be deleted once its contents have been copied.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1384
 *  @leave KErrNotFound
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1385
 *  If the CSmsMessage does not contain an Enhanced Voice Mail Information Element to copy.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1386
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1387
CEnhancedVoiceMailBoxInformation* CSmsEnhancedVoiceMailOperations::GetEnhancedVoiceMailIEL(TBool aRemove) const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1388
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1389
	LOGGSMU1("CSmsEnhancedVoiceMailOperations::GetEnhancedVoiceMailIEL()");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1390
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1391
	TBool found = EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1392
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1393
	CEnhancedVoiceMailBoxInformation* voiceMailBoxInfo = NULL;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1394
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1395
	TSmsInformationElementCategories::TInformationElementCategory category;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1396
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1397
	if (TSmsInformationElementCategories::GetCategoryDefinition(CSmsInformationElement::ESmsEnhanceVoiceMailInformation, category) == EFalse)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1398
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1399
		User::Leave(KErrArgument);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1400
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1401
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1402
	CSmsMessageAdditionalAttributes* additionalAttributes = (CSmsMessageAdditionalAttributes*) iMessage.AdditionalInfo();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1403
	TUint numberOfElements = additionalAttributes->NumberOfControlInformationElements(category);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1404
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1405
	for (TUint i = 0; i < numberOfElements; i++)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1406
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1407
	    CSmsInformationElement::TSmsInformationElementIdentifier id = CSmsInformationElement::ESmsIEMaximum;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1408
	    id = additionalAttributes->GetControlInformationElementL(category, i).Identifier();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1409
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1410
	    if (id == CSmsInformationElement::CSmsInformationElement::ESmsEnhanceVoiceMailInformation)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1411
	        {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1412
	        if (additionalAttributes->GetControlInformationElementL(category, i).Data()[0] & 0x01)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1413
	            {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1414
	            voiceMailBoxInfo = CEnhancedVoiceMailDeleteConfirmations::NewL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1415
	            }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1416
	        else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1417
	            {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1418
	            voiceMailBoxInfo = CEnhancedVoiceMailNotification::NewL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1419
	            }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1420
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1421
	        CleanupStack::PushL(voiceMailBoxInfo);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1422
	        TGsmuLex8 encodedVoiceMailBox(additionalAttributes->GetControlInformationElementL(category, i).Data());
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1423
	        voiceMailBoxInfo->DecodeL(encodedVoiceMailBox, iCharacterSetConverter, iFs);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1424
	        CleanupStack::Pop(voiceMailBoxInfo);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1425
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1426
	        if (aRemove)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1427
	            {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1428
	            additionalAttributes->DeleteControlInformationElement(category, i);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1429
	            }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1430
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1431
	        found = ETrue;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1432
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1433
	        break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1434
	        }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1435
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1436
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1437
	if (found == EFalse)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1438
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1439
	    User::Leave(KErrNotFound);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1440
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1441
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1442
	return voiceMailBoxInfo;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1443
	} // CSmsEnhancedVoiceMailOperations::GetEnhancedVoiceMailIEL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1444
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1445
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1446
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1447
 *  @publishedAll
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1448
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1449
 *  Determines whether the CSmsMessage contains an Enhanced Voice Mail Information Element.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1450
 *  @leave KErrNotSupported
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1451
 *  If the message version or type does not support this query.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1452
 *  @return
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1453
 *  True if the CSmsMessage contains an Enhanced Voice Mail Information Element.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1454
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1455
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1456
EXPORT_C TBool CSmsEnhancedVoiceMailOperations::ContainsEnhancedVoiceMailIEL() const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1457
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1458
	LOGGSMU1("CSmsEnhancedVoiceMailInformation::ContainsEnhancedVoiceMailIEL");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1459
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1460
	ValidateOperationL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1461
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1462
	TBool rc = EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1463
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1464
	TSmsInformationElementCategories::TInformationElementCategory category;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1465
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1466
	if (TSmsInformationElementCategories::GetCategoryDefinition(CSmsInformationElement::ESmsEnhanceVoiceMailInformation, category) == EFalse)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1467
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1468
		User::Leave(KErrArgument);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1469
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1470
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1471
	CSmsMessageAdditionalAttributes* additionalAttributes = (CSmsMessageAdditionalAttributes*) iMessage.AdditionalInfo();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1472
	TUint numberOfElements = additionalAttributes->NumberOfControlInformationElements(category);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1473
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1474
	for (TUint i = 0; i < numberOfElements; i++)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1475
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1476
	    CSmsInformationElement::TSmsInformationElementIdentifier id = CSmsInformationElement::ESmsIEMaximum;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1477
	    
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1478
	    // If function leaves, allow the error to propagate upwards
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1479
	    id = additionalAttributes->GetControlInformationElementL(category, i).Identifier();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1480
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1481
	    if (id == CSmsInformationElement::ESmsEnhanceVoiceMailInformation)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1482
	        {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1483
	        rc = ETrue;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1484
	        break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1485
	        }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1486
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1487
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1488
	return rc;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1489
	} // CSmsEnhancedVoiceMailOperations::ContainsEnhancedVoiceMailIEL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1490
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1491
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1492
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1493
 *  Status Reporting.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1494
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1495
 *  @note This should be the last thing that should be configured in CSmsMessage.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1496
 *  If anything is changed after this then the number of PDUs might change which
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1497
 *  will affect status reporting.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1498
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1499
CSmsEnhancedVoiceMailOperations::CSmsEnhancedVoiceMailOperations(CSmsInformationElement::TSmsInformationElementIdentifier aId,  CSmsMessage& aMessage,
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1500
                                                                 CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) : CSmsCtrlOperation(aId, aMessage),
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1501
                                                                 iCharacterSetConverter(aCharacterSetConverter), iFs(aFs)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1502
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1503
	// NOP
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1504
	} // CSmsEnhancedVoiceMailOperations::CSmsEnhancedVoiceMailOperations
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1505
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1506
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1507
CSmsSMSCCtrlParameterOperations::CSmsSMSCCtrlParameterOperations(CSmsInformationElement::TSmsInformationElementIdentifier aId, CSmsMessage& aMessage)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1508
: CSmsCtrlOperation(aId, aMessage)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1509
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1510
	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1511
	} // CSmsSMSCCtrlParameterOperations::CSmsSMSCCtrlParameterOperations
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1512
	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1513
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1514
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1515
 *  @internalComponent  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1516
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1517
 *  Prevent clients from using the assignment operator by including it in the class definition
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1518
 *  but making it protected and not exporting it.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1519
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1520
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1521
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1522
void CSmsSMSCCtrlParameterOperations::operator=(const CSmsSMSCCtrlParameterOperations&)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1523
    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1524
    // Ignore in code coverage - not intended to be used
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1525
    BULLSEYE_OFF    
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1526
    LOGGSMU1("CSmsSMSCCtrlParameterOperations::operator=");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1527
    Panic(KGsmuPanicMethodBodyNotImplemented1);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1528
    BULLSEYE_RESTORE
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1529
    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1530
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1531
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1532
 *  @internalComponent  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1533
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1534
 *  Prevent clients from using the equality operator by including it in the class definition
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1535
 *  but making it protected and not exporting it.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1536
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1537
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1538
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1539
TBool CSmsSMSCCtrlParameterOperations::operator==(const CSmsSMSCCtrlParameterOperations&)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1540
    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1541
    // Ignore in code coverage - not intended to be used
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1542
    BULLSEYE_OFF    
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1543
    LOGGSMU1("CSmsSMSCCtrlParameterOperations::operator==");
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1544
    Panic(KGsmuPanicMethodBodyNotImplemented1);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1545
    return EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1546
    BULLSEYE_RESTORE
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1547
    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1548
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1549
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1550
 *  @internalComponent
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1551
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1552
 *  Identifies whether the message type or version supports this operation
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1553
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1554
 *  @leave
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1555
 *  If the message type or version does not support this operation.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1556
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1557
void CSmsSMSCCtrlParameterOperations::ValidateOperationL() const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1558
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1559
	if (iMessage.Version() < CSmsMessage::ESmsMessageV2)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1560
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1561
	    LOGGSMU2("CSmsSMSCCtrlParameterOperations Operation not supported, Msg Version %d", iMessage.Version());
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1562
	    User::Leave(KErrNotSupported); 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1563
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1564
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1565
	if (!MessageTypeSupported())
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1566
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1567
	    LOGGSMU2("CSmsSMSCCtrlParameterOperations Operation not supported by this PDU type, type = %d", iMessage.Type());
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1568
	    User::Leave(KErrNotSupported);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1569
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1570
	} // CSmsSMSCCtrlParameterOperations::ValidateOperationL()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1571
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1572
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1573
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1574
 *  @internalComponent
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1575
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1576
 *  Checks that the octet passed to it has the valid bits set in it. If the bits which 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1577
 *  are not supported yet are set then reset it. 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1578
 *  This method is called by SetStatusReportL.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1579
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1580
 *  @param aSelectiveStatus
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1581
 *  The octet which needs to be set as the Selective Status for the report.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1582
 *  @return
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1583
 *  ETrue if the selective status is valid.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1584
 *  @leave KErrNotSupported
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1585
 *  If the last 4 bits are set as they are not supported.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1586
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1587
TBool CSmsSMSCCtrlParameterOperations::ValidateControlParametersL(TUint8& aSelectiveStatus) const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1588
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1589
	if (aSelectiveStatus & ESmsStatusReportForFutureUse1)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1590
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1591
		User::Leave(KErrNotSupported);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1592
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1593
		
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1594
	if (aSelectiveStatus & ESmsStatusReportForFutureUse2)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1595
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1596
		User::Leave(KErrNotSupported);	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1597
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1598
		
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1599
	if (aSelectiveStatus & ESmsStatusReportCancelRestSRR)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1600
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1601
		User::Leave(KErrNotSupported);	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1602
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1603
		
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1604
	if (aSelectiveStatus & ESmsStatusReportIncludeOriginalUDH)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1605
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1606
		User::Leave(KErrNotSupported);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1607
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1608
	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1609
	return ETrue;	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1610
	} // CSmsSMSCCtrlParameterOperations::ValidateControlParametersL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1611
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1612
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1613
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1614
 *  @publishedAll
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1615
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1616
 *  Sets the status report for a PDU. First the scheme is obtained by calling the 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1617
 *  GetStatusReportScheme and checked if it is the valid scheme. Then aSelectiveStatus is 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1618
 *  checked to see if it is the default value. If it is then nothing is done. But if 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1619
 *  aSelectiveStatus is non-default then it is appended to the array 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1620
 *  iControlParametersStatusReport along with the aSegmentSequenceNum 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1621
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1622
 *  @param aSegmentSequenceNum
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1623
 *  The segment sequence number of the PDU which needs to be updated.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1624
 *  @param aSelectiveStatus
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1625
 *  The octet which needs to be set as the Selective Status for the report.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1626
 *  @return KErrNone if the operation is successful.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1627
 *  KErrNotFound if the Segment Sequence Number is out of range or the scheme is inavlid.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1628
 *  KErrNotSupported if aSelectiveStatus is not valid.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1629
 *  @leave
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1630
 *  If ValidateOperationL or AppendL leaves.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1631
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1632
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1633
EXPORT_C TInt CSmsSMSCCtrlParameterOperations::SetStatusReportL(TUint aSegmentSequenceNum, TUint8 aSelectiveStatus)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1634
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1635
	ValidateOperationL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1636
	TBool validateStatus = ValidateControlParametersL(aSelectiveStatus);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1637
	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1638
	if(validateStatus)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1639
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1640
		CSmsMessageAdditionalAttributes& additionalAttributes = *((CSmsMessageAdditionalAttributes*) iMessage.AdditionalInfo());
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1641
		CSmsMessageAdditionalAttributes::CSmsStatusReportScheme& scheme = additionalAttributes.GetStatusReportScheme();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1642
		if (scheme.Id() == EControlParametersScheme)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1643
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1644
			CSmsMessageAdditionalAttributes::CControlParametersScheme& ctrlParamsScheme = (CSmsMessageAdditionalAttributes::CControlParametersScheme&)scheme;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1645
			if(aSegmentSequenceNum>=ctrlParamsScheme.iNumOfPDUs)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1646
				{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1647
				return KErrNotFound;	//	aSegmentSequenceNum out of range.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1648
				}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1649
			if (aSelectiveStatus == ctrlParamsScheme.iDefaultStatusReport)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1650
				{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1651
				return KErrNone;	// It's the same as default so need for any updation.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1652
				}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1653
			else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1654
				{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1655
				TInt count = (ctrlParamsScheme.iControlParametersStatusReport).Count();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1656
				TBool found(EFalse);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1657
				for (TInt ii=0; !found && ii<count; ii++)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1658
					{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1659
					if ((ctrlParamsScheme.iControlParametersStatusReport[ii]).iSegmentSequenceNum == aSegmentSequenceNum)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1660
						{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1661
						(ctrlParamsScheme.iControlParametersStatusReport[ii]).iSelectiveStatus = aSelectiveStatus;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1662
						found = ETrue;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1663
						break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1664
						}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1665
					}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1666
					
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1667
				if (!found)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1668
					{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1669
					CSmsMessageAdditionalAttributes::CControlParametersScheme::TSmsSMSCCtrlParameterStatus smscCtrlParameterStatus;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1670
					smscCtrlParameterStatus.iSegmentSequenceNum = aSegmentSequenceNum;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1671
					smscCtrlParameterStatus.iSelectiveStatus = aSelectiveStatus;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1672
					(ctrlParamsScheme.iControlParametersStatusReport).AppendL(smscCtrlParameterStatus);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1673
					}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1674
			
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1675
				return KErrNone;	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1676
				}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1677
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1678
		else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1679
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1680
			return KErrNotFound;	//	Scheme not valid.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1681
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1682
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1683
	else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1684
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1685
		return KErrNotSupported;	//	Invalid aSlectiveStatus.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1686
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1687
	} // CSmsSMSCCtrlParameterOperations::SetStatusReportL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1688
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1689
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1690
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1691
 *  @publishedAll
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1692
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1693
 *  Gets the selective status for a PDU if the scheme is set to the Control
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1694
 *  Parameters Scheme.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1695
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1696
 *  @param aSegmentSequenceNum
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1697
 *  The segment sequence number of the PDU whose status report is required.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1698
 *  @param aSelectiveStatus
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1699
 *  Returns the selective status octet for that PDU.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1700
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1701
 *  @return KErrNotFound if the segment sequence number or the scheme is invalid.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1702
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1703
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1704
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1705
EXPORT_C TInt CSmsSMSCCtrlParameterOperations::GetStatusReport(TUint aSegmentSequenceNum,
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1706
															   TUint8& aSelectiveStatus) const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1707
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1708
	CSmsMessageAdditionalAttributes* additionalAttributes = (CSmsMessageAdditionalAttributes*) iMessage.AdditionalInfo();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1709
	CSmsMessageAdditionalAttributes::CSmsStatusReportScheme& scheme = additionalAttributes->GetStatusReportScheme();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1710
	if (scheme.Id() == EControlParametersScheme)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1711
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1712
		CSmsMessageAdditionalAttributes::CControlParametersScheme& ctrlParamsScheme = (CSmsMessageAdditionalAttributes::CControlParametersScheme&)scheme;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1713
		
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1714
		if(aSegmentSequenceNum>=ctrlParamsScheme.iNumOfPDUs)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1715
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1716
			return KErrNotFound;	//	aSegmentSequenceNum out of range.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1717
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1718
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1719
		TInt count = (ctrlParamsScheme.iControlParametersStatusReport).Count();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1720
		
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1721
		for (TInt ii=0; ii<count; ii++)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1722
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1723
			if (ctrlParamsScheme.iControlParametersStatusReport[ii].iSegmentSequenceNum == aSegmentSequenceNum)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1724
				{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1725
				aSelectiveStatus = ctrlParamsScheme.iControlParametersStatusReport[ii].iSelectiveStatus;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1726
				return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1727
				}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1728
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1729
			
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1730
		aSelectiveStatus = ctrlParamsScheme.iDefaultStatusReport;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1731
		return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1732
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1733
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1734
	return KErrNotFound;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1735
	} // CSmsSMSCCtrlParameterOperations::GetStatusReport
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1736
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1737
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1738
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1739
 *  @publishedAll
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1740
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1741
 *  Sets the default value of the status report to aDefaultSelectiveStatus.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1742
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1743
 *  @param aDefaultSelectiveStatus
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1744
 *  The selective status to be used as default.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1745
 *  @leave KErrNotFound
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1746
 *  If the scheme is invalid.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1747
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1748
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1749
EXPORT_C void CSmsSMSCCtrlParameterOperations::SetDefaultL(TUint8 aDefaultSelectiveStatus)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1750
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1751
	CSmsMessageAdditionalAttributes& additionalAttributes = *((CSmsMessageAdditionalAttributes*) iMessage.AdditionalInfo());
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1752
	CSmsMessageAdditionalAttributes::CSmsStatusReportScheme& scheme = additionalAttributes.GetStatusReportScheme();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1753
	if (scheme.Id() == EControlParametersScheme)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1754
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1755
		CSmsMessageAdditionalAttributes::CControlParametersScheme& ctrlParamsScheme = (CSmsMessageAdditionalAttributes::CControlParametersScheme&)scheme;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1756
		if(aDefaultSelectiveStatus & ESmsSMSCControlParametersMask)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1757
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1758
			ctrlParamsScheme.iDefaultStatusReport = aDefaultSelectiveStatus;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1759
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1760
		else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1761
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1762
			ctrlParamsScheme.iDefaultStatusReport = 0x00;	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1763
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1764
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1765
	else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1766
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1767
		User::Leave(KErrNotFound);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1768
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1769
	} // CSmsSMSCCtrlParameterOperations::SetDefaultL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1770
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1771
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1772
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1773
 *  @publishedAll
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1774
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1775
 *  This method is called to set the scheme to Control Parameters Scheme.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1776
 *  First iStatusReportScheme, which is obtained by calling GetStatusReportScheme,
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1777
 *  is deleted and set to NULL. Then a new scheme is created and a default value is set.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1778
 *  This should be the last method to be called in a message sending process as all the 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1779
 *  operations in this interface depend on the number of PDUs being set.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1780
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1781
 *  @leave
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1782
 *  If ValidateOperationL or NumMessagePDUsL leaves.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1783
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1784
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1785
EXPORT_C void CSmsSMSCCtrlParameterOperations::SetSchemeL()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1786
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1787
	ValidateOperationL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1788
	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1789
	CSmsMessageAdditionalAttributes& additionalAttributes = *((CSmsMessageAdditionalAttributes*) iMessage.AdditionalInfo());
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1790
	additionalAttributes.SetStatusReportSchemeL(EControlParametersScheme);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1791
	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1792
	TBuf8 <1> buffer;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1793
	buffer.SetLength(1);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1794
	buffer[0] = 0;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1795
	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1796
	CSmsUserData& userData = iMessage.SmsPDU().UserData();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1797
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1798
	userData.AddInformationElementL(CSmsInformationElement::ESmsIEISMSCControlParameters,buffer);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1799
	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1800
	CSmsMessageAdditionalAttributes::CSmsStatusReportScheme& scheme = additionalAttributes.GetStatusReportScheme();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1801
	CSmsMessageAdditionalAttributes::CControlParametersScheme& ctrlParamsScheme = (CSmsMessageAdditionalAttributes::CControlParametersScheme&)scheme;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1802
	ctrlParamsScheme.iNumOfPDUs = iMessage.NumMessagePDUsL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1803
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1804
	SetDefaultL(0);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1805
	} // CSmsSMSCCtrlParameterOperations::SetSchemeL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1806
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1807
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1808
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1809
 *  @publishedAll
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1810
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1811
 *  Gets the current scheme being used.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1812
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1813
 *  @return
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1814
 *  EControlParametrsScheme is returned when Control Parameters Scheme is being used.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1815
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1816
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1817
EXPORT_C TSmsStatusReportScheme CSmsSMSCCtrlParameterOperations::GetScheme() const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1818
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1819
	CSmsMessageAdditionalAttributes* additionalAttributes = (CSmsMessageAdditionalAttributes*) iMessage.AdditionalInfo();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1820
		
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1821
	return (additionalAttributes->GetStatusReportScheme()).Id();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1822
	} // CSmsSMSCCtrlParameterOperations::GetScheme
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1823
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1824
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1825
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1826
 *  @publishedAll
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1827
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1828
 *  This method re-sets the scheme to the Default Scheme.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1829
 *  
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1830
 *  @capability None
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1831
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1832
EXPORT_C void CSmsSMSCCtrlParameterOperations::ResetSchemeL()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1833
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1834
	CSmsMessageAdditionalAttributes& additionalAttributes = *((CSmsMessageAdditionalAttributes*) iMessage.AdditionalInfo());
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1835
	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1836
	CSmsUserData& userData = iMessage.SmsPDU().UserData();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1837
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1838
	CArrayFixFlat<TInt>* indices = new (ELeave) CArrayFixFlat<TInt>(8);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1839
	CleanupStack::PushL(indices);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1840
	userData.InformationElementIndicesL(CSmsInformationElement::ESmsIEISMSCControlParameters,*indices);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1841
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1842
	TUint i = indices->Count();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1843
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1844
	while (i-- != 0)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1845
	    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1846
	    userData.RemoveInformationElement((*indices)[i]);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1847
	    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1848
    
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1849
    CleanupStack::PopAndDestroy(indices);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1850
    additionalAttributes.SetStatusReportSchemeL(EDefaultScheme);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1851
	} // CSmsSMSCCtrlParameterOperations::ResetSchemeL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1852