pushmtm/MtmCliSrvSrc/PushMtmClient.cpp
branchRCL_3
changeset 48 8e6fa1719340
parent 0 84ad3b177aa3
equal deleted inserted replaced
47:6385c4c93049 48:8e6fa1719340
       
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Client Mtm class definition
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 
       
    22 #include "PushMtmClient.h"
       
    23 #include "PushMtmCommands.hrh"
       
    24 #include "PushMtmProgress.h"
       
    25 #include "PushMtmCliSrvPanic.h"
       
    26 #include "PushMtmGcOperation.h"
       
    27 #include <msvids.h>
       
    28 #include <msvapi.h>
       
    29 #include <MTMStore.h>
       
    30 #include <mtudcbas.h>
       
    31 
       
    32 // LOCAL CONSTANTS AND MACROS
       
    33 
       
    34 
       
    35 // ================= MEMBER FUNCTIONS =======================
       
    36 
       
    37 // ---------------------------------------------------------
       
    38 // CPushMtmClient::NewL
       
    39 // ---------------------------------------------------------
       
    40 //
       
    41 EXPORT_C CPushMtmClient* CPushMtmClient::NewL
       
    42                          ( CRegisteredMtmDll& aRegisteredMtmDll, 
       
    43                            CMsvSession& aMsvSession )
       
    44     {
       
    45     CPushMtmClient* client =
       
    46         new (ELeave) CPushMtmClient( aRegisteredMtmDll, aMsvSession );
       
    47     CleanupStack::PushL( client );
       
    48     client->ConstructL();
       
    49     CleanupStack::Pop();    // client
       
    50     return client;
       
    51     }
       
    52 
       
    53 // ---------------------------------------------------------
       
    54 // CPushMtmClient::~CPushMtmClient
       
    55 // ---------------------------------------------------------
       
    56 //
       
    57 CPushMtmClient::~CPushMtmClient()
       
    58     {
       
    59     }
       
    60 
       
    61 // ---------------------------------------------------------
       
    62 // CPushMtmClient::CPushMtmClient
       
    63 // ---------------------------------------------------------
       
    64 //
       
    65 CPushMtmClient::CPushMtmClient( CRegisteredMtmDll& aRegisteredMtmDll, 
       
    66                                 CMsvSession& aMsvSession ) 
       
    67 :   CBaseMtm( aRegisteredMtmDll, aMsvSession )
       
    68     {
       
    69     }
       
    70 
       
    71 // ---------------------------------------------------------
       
    72 // CPushMtmClient::ConstructL
       
    73 // ---------------------------------------------------------
       
    74 //
       
    75 void CPushMtmClient::ConstructL()
       
    76     {
       
    77     SwitchCurrentEntryL( KMsvRootIndexEntryId );
       
    78     }
       
    79 
       
    80 // ---------------------------------------------------------
       
    81 // CPushMtmClient::SaveMessageL
       
    82 // ---------------------------------------------------------
       
    83 //
       
    84 void CPushMtmClient::SaveMessageL()
       
    85     {
       
    86     User::Leave( KErrNotSupported );
       
    87     }
       
    88 
       
    89 // ---------------------------------------------------------
       
    90 // CPushMtmClient::LoadMessageL
       
    91 // ---------------------------------------------------------
       
    92 //
       
    93 void CPushMtmClient::LoadMessageL()
       
    94     {
       
    95     User::Leave( KErrNotSupported );
       
    96     }
       
    97 
       
    98 // ---------------------------------------------------------
       
    99 // CPushMtmClient::ReplyL
       
   100 // ---------------------------------------------------------
       
   101 //
       
   102 CMsvOperation* CPushMtmClient::ReplyL
       
   103         (
       
   104         TMsvId /*aReplyEntryId*/,
       
   105         TMsvPartList /*aPartlist*/,
       
   106         TRequestStatus& /*aCompletionStatus*/
       
   107         )
       
   108     {
       
   109     User::Leave( KErrNotSupported );
       
   110     return NULL;
       
   111     }
       
   112 
       
   113 // ---------------------------------------------------------
       
   114 // CPushMtmClient::ForwardL
       
   115 // ---------------------------------------------------------
       
   116 //
       
   117 CMsvOperation* CPushMtmClient::ForwardL
       
   118         (
       
   119         TMsvId /*aForwardEntryId*/,
       
   120         TMsvPartList /*aPartList*/,
       
   121         TRequestStatus& /*aCompletionStatus*/
       
   122         )
       
   123     {
       
   124     User::Leave( KErrNotSupported );
       
   125     return NULL;
       
   126     }
       
   127 
       
   128 // ---------------------------------------------------------
       
   129 // CPushMtmClient::AddAddresseeL
       
   130 // ---------------------------------------------------------
       
   131 //
       
   132 void CPushMtmClient::AddAddresseeL( const TDesC& /*aRealAddress*/ )
       
   133     {
       
   134     User::Leave( KErrNotSupported );
       
   135     }
       
   136 
       
   137 // ---------------------------------------------------------
       
   138 // CPushMtmClient::AddAddresseeL
       
   139 // ---------------------------------------------------------
       
   140 //
       
   141 void CPushMtmClient::AddAddresseeL( const TDesC& /*aRealAddress*/, 
       
   142                                     const TDesC& /*aAlias*/ )
       
   143     {
       
   144     User::Leave( KErrNotSupported );
       
   145     }
       
   146 
       
   147 // ---------------------------------------------------------
       
   148 // CPushMtmClient::RemoveAddressee
       
   149 // ---------------------------------------------------------
       
   150 //
       
   151 void CPushMtmClient::RemoveAddressee( TInt /*aIndex*/ )
       
   152     {
       
   153     // Not suppored.
       
   154     }
       
   155 
       
   156 // ---------------------------------------------------------
       
   157 // CPushMtmClient::ValidateMessage
       
   158 // ---------------------------------------------------------
       
   159 //
       
   160 TMsvPartList CPushMtmClient::ValidateMessage( TMsvPartList /*aPartList*/ )
       
   161     {
       
   162 	// Not supported. KErrNone means that the current context is valid.
       
   163     return KErrNone;
       
   164     }
       
   165 
       
   166 // ---------------------------------------------------------
       
   167 // CPushMtmClient::Find
       
   168 // ---------------------------------------------------------
       
   169 //
       
   170 TMsvPartList CPushMtmClient::Find( const TDesC& /*aTextToFind*/, 
       
   171                                    TMsvPartList /*aPartList*/ )
       
   172     {
       
   173 	// Not supported.
       
   174     return 0;
       
   175     }
       
   176 
       
   177 // ---------------------------------------------------------
       
   178 // CPushMtmClient::QueryCapability
       
   179 // ---------------------------------------------------------
       
   180 //
       
   181 TInt CPushMtmClient::QueryCapability( TUid /*aCapability*/, TInt& /*aResponse*/ )
       
   182     {
       
   183     return KErrNotSupported; // No supported capabilities here.
       
   184     }
       
   185 
       
   186 // ---------------------------------------------------------
       
   187 // CPushMtmClient::InvokeSyncFunctionL
       
   188 // ---------------------------------------------------------
       
   189 //
       
   190 void CPushMtmClient::InvokeSyncFunctionL( 
       
   191         TInt aFunctionId, 
       
   192         const CMsvEntrySelection& aSelection, 
       
   193         TDes8& /*aParameter*/ )
       
   194 	{
       
   195     if ( aFunctionId == EPushMtmCmdCollectGarbage )
       
   196         {
       
   197         TRequestStatus dummyStat; // We call the sync op.
       
   198         CPushMtmGcOperation* op = CPushMtmGcOperation::NewL( 
       
   199                                             Session(), 
       
   200                                             aSelection.Count() ? 
       
   201                                                 aSelection.At( 0 ) : 
       
   202                                                 KMsvNullIndexEntryId, 
       
   203                                             dummyStat );
       
   204         CleanupStack::PushL( op );
       
   205         op->DoSyncL();
       
   206         CleanupStack::PopAndDestroy( op ); // op
       
   207         }
       
   208     else
       
   209         {
       
   210         User::Leave( KErrNotSupported );
       
   211         }
       
   212 	}
       
   213 
       
   214 // ---------------------------------------------------------
       
   215 // CPushMtmClient::InvokeAsyncFunctionL
       
   216 // ---------------------------------------------------------
       
   217 //
       
   218 CMsvOperation* CPushMtmClient::InvokeAsyncFunctionL(
       
   219         TInt aFunctionId,
       
   220         const CMsvEntrySelection& aSelection,
       
   221         TDes8& /*aParameter*/,
       
   222         TRequestStatus& aCompletionStatus )
       
   223 	{
       
   224 	CMsvOperation* operation = NULL;
       
   225 
       
   226 	switch ( aFunctionId )
       
   227 		{
       
   228         case EPushMtmCmdCollectGarbage:
       
   229             {
       
   230             CPushMtmGcOperation* 
       
   231                 op = CPushMtmGcOperation::NewL( Session(), 
       
   232                                                 aSelection.Count() ? 
       
   233                                                     aSelection.At( 0 ) : 
       
   234                                                     KMsvNullIndexEntryId, 
       
   235                                                 aCompletionStatus );
       
   236             CleanupStack::PushL( op );
       
   237             op->StartL();
       
   238             operation = op;
       
   239             CleanupStack::Pop( op ); // op
       
   240             break;
       
   241             }
       
   242 
       
   243 		default:
       
   244             {
       
   245             User::Leave( KErrNotSupported );
       
   246 			break;
       
   247             }
       
   248 		}
       
   249 
       
   250 	return operation;
       
   251 	}
       
   252 
       
   253 // ---------------------------------------------------------
       
   254 // CPushMtmClient::ContextEntrySwitched
       
   255 // ---------------------------------------------------------
       
   256 //
       
   257 void CPushMtmClient::ContextEntrySwitched() 
       
   258 	{
       
   259     // Does nothing 
       
   260 	}
       
   261 
       
   262 // End of file.