--- a/meetingrequest/mrtasks/src/cesmrtaskextensionimpl.cpp Mon Mar 15 12:39:10 2010 +0200
+++ b/meetingrequest/mrtasks/src/cesmrtaskextensionimpl.cpp Wed Mar 31 21:08:33 2010 +0300
@@ -23,7 +23,6 @@
//<cmail>
#include "cesmrpolicymanager.h"
//</cmail>
-#include "cesmrentryprocessor.h"
#include "mesmrmeetingrequestentry.h"
#include "cesmrtaskfactory.h"
#include "mesmrtask.h"
@@ -34,17 +33,8 @@
// CESMRTaskExtenstionImpl::CESMRTaskExtenstionImpl
// ---------------------------------------------------------------------------
//
-CESMRTaskExtenstionImpl::CESMRTaskExtenstionImpl(
- MESMRCalDbMgr& aCalDBMgr,
- CMRMailboxUtils& aMRMailboxUtils,
- CESMRPolicyManager& aPolicyManager,
- CESMREntryProcessor& aEntryProcessor,
- MESMRTaskFactory& aTaskFactory )
-: iCalDBMgr( aCalDBMgr ),
- iMRMailboxUtils( aMRMailboxUtils),
- iPolicyManager( aPolicyManager ),
- iEntryProcessor( aEntryProcessor),
- iTaskFactory( aTaskFactory )
+CESMRTaskExtenstionImpl::CESMRTaskExtenstionImpl( MESMRTaskFactory& aTaskFactory )
+ : iTaskFactory( aTaskFactory )
{
FUNC_LOG;
//do nothing
@@ -66,20 +56,11 @@
// ---------------------------------------------------------------------------
//
EXPORT_C CESMRTaskExtenstionImpl* CESMRTaskExtenstionImpl::NewL(
- MESMRCalDbMgr& aCalDBMgr,
- CMRMailboxUtils& aMRMailboxUtils,
- CESMRPolicyManager& aPolicyManager,
- CESMREntryProcessor& aEntryProcessor,
MESMRTaskFactory& aTaskFactory )
{
FUNC_LOG;
CESMRTaskExtenstionImpl* self =
- new (ELeave) CESMRTaskExtenstionImpl(
- aCalDBMgr,
- aMRMailboxUtils,
- aPolicyManager,
- aEntryProcessor,
- aTaskFactory );
+ new (ELeave) CESMRTaskExtenstionImpl( aTaskFactory );
CleanupStack::PushL( self );
self->ConstructL();
CleanupStack::Pop( self );
@@ -102,32 +83,35 @@
//
void CESMRTaskExtenstionImpl::SendAndStoreResponseL(
TESMRCommand aCommand,
- MESMRMeetingRequestEntry& aEntry )
+ MESMRCalEntry& aEntry )
{
FUNC_LOG;
+
// First do possible command conversion
- if ( EESMRAcceptWithoutAttachmentCheck == aCommand )
- {
- aCommand = EESMRCmdAcceptMR;
- }
- else if ( EESMRTentativeWithoutAttachmentCheck == aCommand )
- {
- aCommand = EESMRCmdTentativeMR;
- }
- else if ( EESMRDeclineWithoutAttachmentCheck == aCommand )
+
+ switch ( aCommand )
{
- aCommand = EESMRCmdDeclineMR;
+ case EESMRAcceptWithoutAttachmentCheck:
+ {
+ aCommand = EESMRCmdAcceptMR;
+ break;
+ }
+ case EESMRTentativeWithoutAttachmentCheck:
+ {
+ aCommand = EESMRCmdTentativeMR;
+ break;
+ }
+ case EESMRDeclineWithoutAttachmentCheck:
+ {
+ aCommand = EESMRCmdDeclineMR;
+ break;
+ }
+ default:
+ {
+ break;
+ }
}
-
- // Check that command is valid
- if ( !( EESMRCmdAcceptMR == aCommand ||
- EESMRCmdTentativeMR == aCommand ||
- EESMRCmdDeclineMR == aCommand ) )
- {
- // Invalid command --> Leave
- User::Leave( KErrArgument );
- }
-
+
CreateAndExecuteTaskL( aCommand, aEntry );
}
@@ -137,37 +121,10 @@
//
void CESMRTaskExtenstionImpl::SendAndStoreMRL(
TESMRCommand aCommand,
- MESMRMeetingRequestEntry& aEntry )
+ MESMRCalEntry& aEntry )
{
FUNC_LOG;
- // Check that command is valid
- if ( !( EESMRCmdSendMR == aCommand ||
- EESMRCmdSendMRUpdate == aCommand) )
- {
- // Invalid command --> Leave
- User::Leave( KErrArgument );
- }
-
- CreateAndExecuteTaskL( aCommand, aEntry );
- }
-
-// ---------------------------------------------------------------------------
-// CESMRTaskExtenstionImpl::SendAndStoreMRL
-// ---------------------------------------------------------------------------
-//
-void CESMRTaskExtenstionImpl::DeleteMRFromLocalDBL(
- TESMRCommand aCommand,
- MESMRMeetingRequestEntry& aEntry )
- {
- FUNC_LOG;
- // Check that command is valid
- if ( EESMRCmdDeleteMR != aCommand )
- {
- // Invalid command --> Leave
- User::Leave( KErrArgument );
- }
-
- // Create and execute task
+
CreateAndExecuteTaskL( aCommand, aEntry );
}
@@ -177,57 +134,39 @@
//
void CESMRTaskExtenstionImpl::DeleteAndSendMRL(
TESMRCommand aCommand,
- MESMRMeetingRequestEntry& aEntry )
+ MESMRCalEntry& aEntry )
{
FUNC_LOG;
- // Check that command is valid
- if ( EESMRCmdDeleteMR == aCommand ||
- EESMRCmdRemoveFromCalendar == aCommand ||
- EESMRCmdMailDelete == aCommand )
- {
- // Create And execute task
- CreateAndExecuteTaskL( aCommand, aEntry );
- }
- else
- {
- // Invalid command --> Leave
- User::Leave( KErrArgument );
- }
+
+ // Create And execute task
+ CreateAndExecuteTaskL( aCommand, aEntry );
}
// ---------------------------------------------------------------------------
-// CESMRTaskExtenstionImpl::StoreMRToLocalDBL
+// CESMRTaskExtenstionImpl::StoreEntryToLocalDBL
// ---------------------------------------------------------------------------
//
-void CESMRTaskExtenstionImpl::StoreMRToLocalDBL(
+void CESMRTaskExtenstionImpl::StoreEntryToLocalDBL(
TESMRCommand aCommand,
- MESMRMeetingRequestEntry& aEntry )
+ MESMRCalEntry& aEntry )
{
FUNC_LOG;
- if ( EESMRCmdSaveMR != aCommand )
- {
- // Invalid command --> Leave
- User::Leave( KErrArgument );
- }
+
+ // Create And exexute task
CreateAndExecuteTaskL( aCommand, aEntry );
}
+
// ---------------------------------------------------------------------------
// CESMRTaskExtenstionImpl::ForwardMRAsEmailL
// ---------------------------------------------------------------------------
//
void CESMRTaskExtenstionImpl::ForwardMRAsEmailL(
TESMRCommand aCommand,
- MESMRMeetingRequestEntry& aEntry )
+ MESMRCalEntry& aEntry )
{
FUNC_LOG;
- // Check that command is valid
- if ( EESMRCmdForwardAsMail != aCommand )
- {
- // Invalid command --> Leave
- User::Leave( KErrArgument );
- }
-
+
// Create And exexute task
CreateAndExecuteTaskL( aCommand, aEntry );
}
@@ -238,27 +177,77 @@
//
void CESMRTaskExtenstionImpl::ReplyAsEmailL(
TESMRCommand aCommand,
- MESMRMeetingRequestEntry& aEntry )
+ MESMRCalEntry& aEntry )
+ {
+ FUNC_LOG;
+
+ // Create And exexute task
+ CreateAndExecuteTaskL( aCommand, aEntry );
+ }
+
+// ---------------------------------------------------------------------------
+// CESMRTaskExtenstionImpl::DeleteEntryFromLocalDBL
+// ---------------------------------------------------------------------------
+//
+void CESMRTaskExtenstionImpl::DeleteEntryFromLocalDBL(
+ TESMRCommand aCommand,
+ MESMRCalEntry& aEntry )
+ {
+ FUNC_LOG;
+
+ // Create And exexute task
+ CreateAndExecuteTaskL( aCommand, aEntry );
+ }
+
+// ---------------------------------------------------------------------------
+// CESMRTaskExtenstionImpl::MarkTodoAsDoneL
+// ---------------------------------------------------------------------------
+//
+void CESMRTaskExtenstionImpl::MarkTodoAsDoneL(
+ TESMRCommand aCommand,
+ MESMRCalEntry& aEntry )
{
FUNC_LOG;
- // Check that command is valid
- if ( EESMRCmdReply != aCommand && EESMRCmdReplyAll != aCommand)
- {
- // Invalid command --> Leave
- User::Leave( KErrArgument );
- }
+
+ // Create And execute task
+ CreateAndExecuteTaskL( aCommand, aEntry );
+ }
+// ---------------------------------------------------------------------------
+// CESMRTaskExtenstionImpl::MarkTodoAsNotDoneL
+// ---------------------------------------------------------------------------
+//
+void CESMRTaskExtenstionImpl::MarkTodoAsNotDoneL(
+ TESMRCommand aCommand,
+ MESMRCalEntry& aEntry )
+ {
+ FUNC_LOG;
+
// Create And exexute task
CreateAndExecuteTaskL( aCommand, aEntry );
}
// ---------------------------------------------------------------------------
+// CESMRTaskExtenstionImpl::MoveEntryToCurrentDBL
+// ---------------------------------------------------------------------------
+//
+void CESMRTaskExtenstionImpl::MoveEntryToCurrentDBL(
+ TESMRCommand /*aCommand*/,
+ MESMRCalEntry& aEntry )
+ {
+ FUNC_LOG;
+
+ // Create And exexute task
+ CreateAndExecuteTaskL( EESMRCmdCalendarChange, aEntry );
+ }
+
+// ---------------------------------------------------------------------------
// CESMRTaskExtenstionImpl::CreateAndExecuteTaskL
// ---------------------------------------------------------------------------
//
void CESMRTaskExtenstionImpl::CreateAndExecuteTaskL(
TESMRCommand aCommand,
- MESMRMeetingRequestEntry& aEntry )
+ MESMRCalEntry& aEntry )
{
FUNC_LOG;
MESMRTask* task = iTaskFactory.CreateTaskL( aCommand, aEntry );
@@ -267,7 +256,7 @@
{
CleanupDeletePushL( task );
task->ExecuteTaskL();
- CleanupStack::PopAndDestroy(); // task;
+ CleanupStack::PopAndDestroy( task ); // task;
}
else
{