meetingrequest/mrtasks/src/cesmrtaskextensionimpl.cpp
branchRCL_3
changeset 64 3533d4323edc
equal deleted inserted replaced
63:d189ee25cf9d 64:3533d4323edc
       
     1 /*
       
     2 * Copyright (c) 2007-2009 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 "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:  ESMR task extension implementation
       
    15 *
       
    16 */
       
    17 
       
    18 #include "emailtrace.h"
       
    19 #include "cesmrtaskextensionimpl.h"
       
    20 
       
    21 #include <caluser.h>
       
    22 #include "esmrinternaluid.h"
       
    23 //<cmail>
       
    24 #include "cesmrpolicymanager.h"
       
    25 //</cmail>
       
    26 #include "mesmrmeetingrequestentry.h"
       
    27 #include "cesmrtaskfactory.h"
       
    28 #include "mesmrtask.h"
       
    29 
       
    30 // ======== MEMBER FUNCTIONS ========
       
    31 
       
    32 // ---------------------------------------------------------------------------
       
    33 // CESMRTaskExtenstionImpl::CESMRTaskExtenstionImpl
       
    34 // ---------------------------------------------------------------------------
       
    35 //
       
    36 CESMRTaskExtenstionImpl::CESMRTaskExtenstionImpl( MESMRTaskFactory& aTaskFactory )
       
    37     : iTaskFactory( aTaskFactory )
       
    38     {
       
    39     FUNC_LOG;
       
    40     //do nothing
       
    41     }
       
    42 
       
    43 
       
    44 // ---------------------------------------------------------------------------
       
    45 // CESMRTaskExtenstionImpl::~CESMRTaskExtenstionImpl
       
    46 // ---------------------------------------------------------------------------
       
    47 //
       
    48 EXPORT_C CESMRTaskExtenstionImpl::~CESMRTaskExtenstionImpl()
       
    49     {
       
    50     FUNC_LOG;
       
    51     //do nothing
       
    52     }
       
    53 
       
    54 // ---------------------------------------------------------------------------
       
    55 // CESMRTaskExtenstionImpl::NewL
       
    56 // ---------------------------------------------------------------------------
       
    57 //
       
    58 EXPORT_C CESMRTaskExtenstionImpl* CESMRTaskExtenstionImpl::NewL(
       
    59         MESMRTaskFactory& aTaskFactory )
       
    60     {
       
    61     FUNC_LOG;
       
    62     CESMRTaskExtenstionImpl* self =
       
    63         new (ELeave) CESMRTaskExtenstionImpl( aTaskFactory );
       
    64     CleanupStack::PushL( self );
       
    65     self->ConstructL();
       
    66     CleanupStack::Pop( self );
       
    67     return self;
       
    68     }
       
    69 
       
    70 // ---------------------------------------------------------------------------
       
    71 // CESMRTaskExtenstionImpl::ConstructL
       
    72 // ---------------------------------------------------------------------------
       
    73 //
       
    74 void CESMRTaskExtenstionImpl::ConstructL()
       
    75     {
       
    76     FUNC_LOG;
       
    77     //do nothing
       
    78     }
       
    79 
       
    80 // ---------------------------------------------------------------------------
       
    81 // CESMRTaskExtenstionImpl::SendAndStoreResponseL
       
    82 // ---------------------------------------------------------------------------
       
    83 //
       
    84 void CESMRTaskExtenstionImpl::SendAndStoreResponseL(
       
    85         TESMRCommand aCommand,
       
    86         MESMRCalEntry& aEntry )
       
    87     {
       
    88     FUNC_LOG;
       
    89     
       
    90     // First do possible command conversion
       
    91 
       
    92     switch ( aCommand )
       
    93         {
       
    94         case EESMRAcceptWithoutAttachmentCheck:
       
    95             {
       
    96             aCommand = EESMRCmdAcceptMR;
       
    97             break;
       
    98             }
       
    99         case EESMRTentativeWithoutAttachmentCheck:
       
   100             {
       
   101             aCommand = EESMRCmdTentativeMR;
       
   102             break;
       
   103             }
       
   104         case EESMRDeclineWithoutAttachmentCheck:
       
   105             {
       
   106             aCommand = EESMRCmdDeclineMR;
       
   107             break;
       
   108             }
       
   109         default:
       
   110             {
       
   111             break;
       
   112             }
       
   113         }
       
   114     
       
   115     CreateAndExecuteTaskL( aCommand, aEntry );
       
   116     }
       
   117 
       
   118 // ---------------------------------------------------------------------------
       
   119 // CESMRTaskExtenstionImpl::SendAndStoreMRL
       
   120 // ---------------------------------------------------------------------------
       
   121 //
       
   122 void CESMRTaskExtenstionImpl::SendAndStoreMRL(
       
   123         TESMRCommand aCommand,
       
   124         MESMRCalEntry& aEntry )
       
   125     {
       
   126     FUNC_LOG;
       
   127     
       
   128     CreateAndExecuteTaskL( aCommand, aEntry );
       
   129     }
       
   130 
       
   131 // ---------------------------------------------------------------------------
       
   132 // CESMRTaskExtenstionImpl::SendAndStoreMRL
       
   133 // ---------------------------------------------------------------------------
       
   134 //
       
   135 void CESMRTaskExtenstionImpl::DeleteAndSendMRL(
       
   136         TESMRCommand aCommand,
       
   137         MESMRCalEntry& aEntry )
       
   138     {
       
   139     FUNC_LOG;
       
   140     
       
   141     // Create And execute task
       
   142     CreateAndExecuteTaskL( aCommand, aEntry );
       
   143     }
       
   144 
       
   145 // ---------------------------------------------------------------------------
       
   146 // CESMRTaskExtenstionImpl::StoreEntryToLocalDBL
       
   147 // ---------------------------------------------------------------------------
       
   148 //
       
   149 void CESMRTaskExtenstionImpl::StoreEntryToLocalDBL(
       
   150             TESMRCommand aCommand,
       
   151             MESMRCalEntry& aEntry )
       
   152     {
       
   153     FUNC_LOG;
       
   154     
       
   155     // Create And exexute task
       
   156     CreateAndExecuteTaskL( aCommand, aEntry );
       
   157     }
       
   158 
       
   159 
       
   160 // ---------------------------------------------------------------------------
       
   161 // CESMRTaskExtenstionImpl::ForwardMRAsEmailL
       
   162 // ---------------------------------------------------------------------------
       
   163 //
       
   164 void CESMRTaskExtenstionImpl::ForwardMRAsEmailL(
       
   165             TESMRCommand aCommand,
       
   166             MESMRCalEntry& aEntry )
       
   167     {
       
   168     FUNC_LOG;
       
   169     
       
   170     // Create And exexute task
       
   171     CreateAndExecuteTaskL( aCommand, aEntry );
       
   172     }
       
   173 
       
   174 // ---------------------------------------------------------------------------
       
   175 // CESMRTaskExtenstionImpl::ReplyAsEmailL
       
   176 // ---------------------------------------------------------------------------
       
   177 //
       
   178 void CESMRTaskExtenstionImpl::ReplyAsEmailL(
       
   179             TESMRCommand aCommand,
       
   180             MESMRCalEntry& aEntry )
       
   181     {
       
   182     FUNC_LOG;
       
   183     
       
   184     // Create And exexute task
       
   185     CreateAndExecuteTaskL( aCommand, aEntry );
       
   186     }
       
   187 
       
   188 // ---------------------------------------------------------------------------
       
   189 // CESMRTaskExtenstionImpl::DeleteEntryFromLocalDBL
       
   190 // ---------------------------------------------------------------------------
       
   191 //
       
   192 void CESMRTaskExtenstionImpl::DeleteEntryFromLocalDBL(
       
   193             TESMRCommand aCommand,
       
   194             MESMRCalEntry& aEntry )
       
   195     {
       
   196     FUNC_LOG;
       
   197     
       
   198     // Create And exexute task
       
   199     CreateAndExecuteTaskL( aCommand, aEntry );
       
   200     }
       
   201 
       
   202 // ---------------------------------------------------------------------------
       
   203 // CESMRTaskExtenstionImpl::MarkTodoAsDoneL
       
   204 // ---------------------------------------------------------------------------
       
   205 //
       
   206 void CESMRTaskExtenstionImpl::MarkTodoAsDoneL(
       
   207             TESMRCommand aCommand,
       
   208             MESMRCalEntry& aEntry )
       
   209     {
       
   210     FUNC_LOG;
       
   211     
       
   212     // Create And execute task
       
   213     CreateAndExecuteTaskL( aCommand, aEntry );
       
   214     }
       
   215 
       
   216 // ---------------------------------------------------------------------------
       
   217 // CESMRTaskExtenstionImpl::MarkTodoAsNotDoneL
       
   218 // ---------------------------------------------------------------------------
       
   219 //
       
   220 void CESMRTaskExtenstionImpl::MarkTodoAsNotDoneL(
       
   221             TESMRCommand aCommand,
       
   222             MESMRCalEntry& aEntry )
       
   223     {
       
   224     FUNC_LOG;
       
   225     
       
   226     // Create And exexute task
       
   227     CreateAndExecuteTaskL( aCommand, aEntry );
       
   228     }
       
   229 
       
   230 // ---------------------------------------------------------------------------
       
   231 // CESMRTaskExtenstionImpl::MoveEntryToCurrentDBL
       
   232 // ---------------------------------------------------------------------------
       
   233 //
       
   234 void CESMRTaskExtenstionImpl::MoveEntryToCurrentDBL(
       
   235             TESMRCommand /*aCommand*/,
       
   236             MESMRCalEntry& aEntry )
       
   237     {
       
   238     FUNC_LOG;
       
   239         
       
   240     // Create And exexute task
       
   241     CreateAndExecuteTaskL( EESMRCmdCalendarChange, aEntry );
       
   242     }
       
   243 
       
   244 // ---------------------------------------------------------------------------
       
   245 // CESMRTaskExtenstionImpl::CreateAndExecuteTaskL
       
   246 // ---------------------------------------------------------------------------
       
   247 //
       
   248 void CESMRTaskExtenstionImpl::CreateAndExecuteTaskL(
       
   249             TESMRCommand aCommand,
       
   250             MESMRCalEntry& aEntry )
       
   251     {
       
   252     FUNC_LOG;
       
   253     MESMRTask* task = iTaskFactory.CreateTaskL( aCommand, aEntry );
       
   254 
       
   255     if (task )
       
   256         {
       
   257         CleanupDeletePushL( task );
       
   258         task->ExecuteTaskL();
       
   259         CleanupStack::PopAndDestroy( task ); // task;
       
   260         }
       
   261     else
       
   262         {
       
   263         // Task cannot be constructed --> Leave
       
   264 
       
   265         User::Leave( KErrNotSupported );
       
   266         }
       
   267     }
       
   268 
       
   269 //EOF
       
   270