messagingfw/biomsgfw/BioWatchers/Src/class0sms.cpp
changeset 62 db3f5fa34ec7
parent 0 8e480a14352b
equal deleted inserted replaced
60:9f5ae1728557 62:db3f5fa34ec7
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 
       
    17 #include <f32file.h>
       
    18 #include <barsc.h> 
       
    19 #include <barsread.h>
       
    20 #include <ecom/implementationproxy.h>
       
    21 #include <barsread.h>
       
    22 #include "class0sms.h"
       
    23 
       
    24 //UID for Class 0 SMS Notifier
       
    25 const TUid KUidClass0SmsNotifier = {0x2000C382};
       
    26 
       
    27 
       
    28 //
       
    29 // DLL Global Methods
       
    30 //
       
    31 
       
    32 const TImplementationProxy ImplementationTable[] = 
       
    33 	{
       
    34 		IMPLEMENTATION_PROXY_ENTRY(0x2000BDF1, CClass0Sms::NewL)
       
    35 	};
       
    36 
       
    37 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
       
    38 	{
       
    39 	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
       
    40 
       
    41 	return ImplementationTable;
       
    42 	}
       
    43 	
       
    44 
       
    45 CClass0Sms* CClass0Sms::NewL()
       
    46 	{
       
    47 	CClass0Sms* self= new (ELeave) CClass0Sms();
       
    48 	CleanupStack::PushL(self);
       
    49 	self->ConstructL();
       
    50 	CleanupStack::Pop();
       
    51 	return self;
       
    52 	}
       
    53 	
       
    54 //CClass0Sms constructor	
       
    55 CClass0Sms::CClass0Sms()
       
    56 	{
       
    57 	//nothing to do here
       
    58 	}
       
    59 	
       
    60 //CClass0Sms destructor
       
    61 CClass0Sms::~CClass0Sms()
       
    62 	{
       
    63 	//needs to close the notifier
       
    64 	iNotifier.Close();
       
    65     }
       
    66 	
       
    67 //CClass0Sms ConstructL
       
    68 void CClass0Sms::ConstructL()
       
    69 	{
       
    70 	//Connects to the RNotifier server. KErrNone, if it succeeds.
       
    71 	User::LeaveIfError(iNotifier.Connect());
       
    72 	}
       
    73 
       
    74 /**
       
    75 DisplayMessageHandler method wil calling the StartNotifier/UpdateNotifier according to aIsCompleteMsg flag. Here it passes the Class 0 SMS Message.
       
    76 @param aSmsMessage will contains Starting & Ending PDU position of decoded message,
       
    77     and boolean value indicates that, is this last incomplete message. And it contains Class0SMS data.
       
    78 	This needs be Internalize in client side, in the same order(i.e TInt aStartPos, TInt endPos, TBool aIsLastMessage, TPtr aSmsData).
       
    79 @param aComplete indicates, is it a partial messsage or full message.  
       
    80 */
       
    81 void CClass0Sms::DisplayMessageHandler(TDesC8& aSmsMessage, TBool aIsCompleteMsg)
       
    82 	{
       
    83 	TPckgBuf<TInt> 	response;
       
    84 	
       
    85 	if(aIsCompleteMsg)
       
    86 		{
       
    87 		iNotifier.StartNotifier(KUidClass0SmsNotifier, aSmsMessage);		
       
    88 		}
       
    89 	else
       
    90 		{
       
    91 		iNotifier.UpdateNotifier(KUidClass0SmsNotifier, aSmsMessage, response);
       
    92 		}
       
    93 	}