messagingfw/wappushfw/pushmtm/src/pushclientmtm.cpp
changeset 62 db3f5fa34ec7
parent 0 8e480a14352b
equal deleted inserted replaced
60:9f5ae1728557 62:db3f5fa34ec7
       
     1 // Copyright (c) 2000-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 #include <msvreg.h>
       
    17 #include <msvapi.h>
       
    18 #include <mtmdef.h>
       
    19 #include <mtclbase.h>
       
    20 #include <msvftext.h>
       
    21 #include "pushclientmtm.h"
       
    22 
       
    23 
       
    24 /**
       
    25  Standard static factory function.
       
    26  @param aRegisteredMtmDll of type CRegisteredMtmDll
       
    27  @param aSession of type CMsvSession
       
    28  @return pointer to a new instance of the class CWapPushClientMtm
       
    29 */
       
    30 
       
    31 EXPORT_C CWapPushClientMtm* CWapPushClientMtm::NewL(CRegisteredMtmDll& aRegisteredMtmDll, CMsvSession& aSession)
       
    32 	{
       
    33 	CWapPushClientMtm* self=new(ELeave) CWapPushClientMtm(aRegisteredMtmDll, aSession);
       
    34 	return self;
       
    35 	}
       
    36 
       
    37 /**
       
    38  * Class destructor
       
    39  */
       
    40 CWapPushClientMtm::~CWapPushClientMtm()
       
    41 	{
       
    42 	}
       
    43 
       
    44 
       
    45 /**
       
    46  * Constructor
       
    47  */
       
    48 CWapPushClientMtm::CWapPushClientMtm(CRegisteredMtmDll& aRegisteredMtmDll, CMsvSession& aSession)
       
    49 : CBaseMtm(aRegisteredMtmDll, aSession)
       
    50 	{
       
    51 	}
       
    52 
       
    53 /**
       
    54  * MTM API Not Supported
       
    55  */
       
    56 void CWapPushClientMtm::SaveMessageL()
       
    57 	{
       
    58 	User::Leave(KErrNotSupported);
       
    59 	}
       
    60 
       
    61 /**
       
    62  * MTM API Not Supported
       
    63  */
       
    64 void CWapPushClientMtm::LoadMessageL()
       
    65 	{
       
    66 	User::Leave(KErrNotSupported);
       
    67 	}
       
    68 
       
    69 
       
    70 /**
       
    71  * MTM API Not Supported
       
    72  */
       
    73 CMsvOperation* CWapPushClientMtm::ReplyL  (TMsvId /*aDestination*/, TMsvPartList /*aPartlist*/, TRequestStatus& /*aCompletionStatus*/)
       
    74 	{
       
    75 	User::Leave(KErrNotSupported);
       
    76 	return NULL;
       
    77 	}
       
    78 
       
    79 /**
       
    80  * MTM API Not Supported
       
    81  */
       
    82 CMsvOperation* CWapPushClientMtm::ForwardL(TMsvId /*aDestination*/, TMsvPartList /*aPartList*/, TRequestStatus& /*aCompletionStatus*/)
       
    83 	{
       
    84 	User::Leave(KErrNotSupported);
       
    85 	return NULL;
       
    86 	}
       
    87 
       
    88 /**
       
    89  * MTM API Not Supported
       
    90  */
       
    91 TMsvPartList CWapPushClientMtm::ValidateMessage(TMsvPartList /*aPartList*/)
       
    92 	{
       
    93 	return KMsvMessagePartNone;
       
    94 	}
       
    95 
       
    96 /**
       
    97  * Derived API for finding text in a stored Message
       
    98  * @param aTextToFind
       
    99  * @param aPartList
       
   100  */
       
   101 TMsvPartList CWapPushClientMtm::Find(const TDesC& aTextToFind, TMsvPartList aPartList)
       
   102 	{
       
   103 	TMsvPartList retList = KMsvMessagePartNone;
       
   104 
       
   105 	TRAP_IGNORE(retList = DoFindL(aTextToFind, aPartList));
       
   106 
       
   107 	return retList;
       
   108 	}
       
   109 
       
   110 /**
       
   111  * Leaving function for finding text in a stored Message
       
   112  * @param aTextToFind
       
   113  * @param aPartList
       
   114  */
       
   115 TMsvPartList CWapPushClientMtm::DoFindL(const TDesC& aTextToFind, TMsvPartList aPartList)
       
   116 	{
       
   117 	TMsvPartList  retList = KMsvMessagePartNone;
       
   118 	CMsvFindText* text    = CMsvFindText::NewL();
       
   119 
       
   120 	CleanupStack::PushL(text);
       
   121 
       
   122 	if (aPartList & KMsvMessagePartBody)
       
   123 		{
       
   124 		if (text->FindRichTextL(aTextToFind, Body(), aPartList))
       
   125 			retList |= KMsvMessagePartBody;
       
   126 		}
       
   127 	if (aPartList & KMsvMessagePartOriginator) 
       
   128 		{
       
   129 		if (text->FindTextL(aTextToFind, iMsvEntry->Entry().iDetails, aPartList))
       
   130 			retList |= KMsvMessagePartOriginator;
       
   131 		}
       
   132 	if (aPartList & KMsvMessagePartDescription)	
       
   133 		{
       
   134 		if (text->FindTextL(aTextToFind, iMsvEntry->Entry().iDescription, aPartList))
       
   135 			retList |= KMsvMessagePartDescription;
       
   136 		}
       
   137 
       
   138 	CleanupStack::PopAndDestroy();// text
       
   139 	return retList;
       
   140 	}
       
   141 
       
   142 #ifndef __MESSAGING_API_V2__
       
   143 const CDesCArray& CWapPushClientMtm::AddresseeList()
       
   144 	{
       
   145 	return *iAddresseeList;
       
   146 	}
       
   147 #endif	// __MESSAGING_API_V2__
       
   148 
       
   149 /**
       
   150  * MTM API Not Supported
       
   151  */
       
   152 void CWapPushClientMtm::AddAddresseeL(const TDesC& /*aRealAddress*/)
       
   153 	{
       
   154 	User::Leave(KErrNotSupported);
       
   155 	}
       
   156 
       
   157 /**
       
   158  * MTM API Not Supported
       
   159  */
       
   160 void CWapPushClientMtm::AddAddresseeL(const TDesC& /*aRealAddress*/, const TDesC& /*aAlias*/)
       
   161 	{
       
   162 	User::Leave(KErrNotSupported);
       
   163 	}
       
   164 
       
   165 
       
   166 /**
       
   167  * MTM API Not Supported
       
   168  */
       
   169 void CWapPushClientMtm::RemoveAddressee(TInt /*aIndex*/)
       
   170 	{
       
   171 	}
       
   172 
       
   173 /**
       
   174  * MTM API Not Supported
       
   175  */
       
   176 void CWapPushClientMtm::ContextEntrySwitched()
       
   177 	{
       
   178 	}
       
   179 
       
   180 /**
       
   181  * MTM API Not Supported
       
   182  */
       
   183 void CWapPushClientMtm::InvokeSyncFunctionL(TInt /*aFunctionId*/,const CMsvEntrySelection& /*aSelection*/, TDes8& /*aParameter*/)
       
   184 	{
       
   185 	User::Leave(KErrNotSupported);
       
   186 	}
       
   187 
       
   188 /**
       
   189  * MTM API Not Supported
       
   190  */
       
   191 CMsvOperation* CWapPushClientMtm::InvokeAsyncFunctionL(TInt /*aFunctionId*/,const CMsvEntrySelection& /*aSelection*/, TDes8& /*aParameter*/, TRequestStatus& /*aCompletionStatus*/)
       
   192 	{
       
   193 	User::Leave(KErrNotSupported);
       
   194 	return NULL;
       
   195 	}
       
   196 
       
   197