meetingui/meetingrequestviewers/inc/ProcessingStructs.h
changeset 0 f979ecb2b13e
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     1 /*
       
     2 * Copyright (c) 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: Definition for different structs used for handling meeting
       
    15 * request viewer requests
       
    16 */
       
    17 
       
    18 #ifndef PROCESSINGSTRUCTS_H
       
    19 #define PROCESSINGSTRUCTS_H
       
    20 
       
    21 #include "CMRUtilsInternal.h"
       
    22 #include <MAgnEntryUi.h>
       
    23 #include <calentry.h>
       
    24 
       
    25 // ENotSet means that the the particular field is not relevant in the
       
    26 // scenario, any value should match. Using value -1 is safer than 0
       
    27 // since some external enumerations start with 0 which would be 
       
    28 // colliding with ENotSet then.
       
    29 enum TNotSet
       
    30 	{
       
    31 	ENotSet = -1
       
    32 	};
       
    33 
       
    34 enum TCallingApp
       
    35 	{
       
    36 	ECallerMailApp,
       
    37 	ECallerBVApp,
       
    38 	ECallerCalendarApp
       
    39 	};
       
    40 
       
    41 enum TOpenedMailBox
       
    42 	{
       
    43 	EOpenedFromInbox,
       
    44 	EOpenedFromOutbox
       
    45 	};
       
    46 
       
    47 enum TMethodLevelValidity
       
    48     {
       
    49     EValidNeedsSave,
       
    50     EValidNoNeedSave,
       
    51     EInvalid
       
    52     };
       
    53 
       
    54 enum TMROperation
       
    55 	{
       
    56 	EErrorSituation = -100,     // generic error case		
       
    57 	EErrorUnexpectedViewOnly,   // unexpected (e.g. cancel when no
       
    58 	                            // request has been received)
       
    59 	EErrorObsoleteViewOnly,     // obsolete entry (newer exists)
       
    60 	EErrorRecurrenceViewOnly,   // bad recurrence id (e.g. originating entry
       
    61 	                            // doesn't exist in db)
       
    62 	ENullOp = 0,                // null value, not a real operation
       
    63 	EStoreEntryToCalendar,      // store entry to db
       
    64 	EUpdateStatusToCalendar,    // update status to db	
       
    65 	ELoadIdenticalEntryFromDB,  // identical exists in db -> use that
       
    66 	EEditExistingEntry,         // edit calendar's existing request
       
    67 	EViewExistingEntry,         // view only mode
       
    68 	EShowEmptyRequest,          // show empty request	
       
    69 	};
       
    70 
       
    71 
       
    72 static const TInt dataFieldCount = 7;
       
    73 
       
    74 // Note: The structure of these scenarios must match TScenarioData defined
       
    75 // in CMRProcessor header file. The order of scenarios in the array
       
    76 // determines their precedence, only the first match is considered
       
    77 
       
    78 // TODO: In future we might consider defining own Symbian resource structure.
       
    79 
       
    80 static const TInt meetingReqScenario_A1[dataFieldCount] = {
       
    81     CCalEntry::EMethodRequest,              //TMethod
       
    82     ENotSet,                                //TCallingApp
       
    83     ENotSet,                                //TOpenedMailBox
       
    84     MMRUtilsTombsExt::EErrorRecurrence,     //TMRUtilsDbResult
       
    85     ENotSet,                                //TMethodLevelValidity
       
    86     ENotSet,                                //TAgnEntryUiEditorMode                         
       
    87     EErrorRecurrenceViewOnly                //TMROperation
       
    88     };
       
    89 
       
    90 static const TInt meetingReqScenario_A2[dataFieldCount] = {
       
    91     CCalEntry::EMethodRequest,              //TMethod
       
    92     ENotSet,                                //TCallingApp
       
    93     ENotSet,                                //TOpenedMailBox
       
    94     MMRUtilsTombsExt::EErrorObsolete,       //TMRUtilsDbResult
       
    95     ENotSet,                                //TMethodLevelValidity
       
    96     ENotSet,                                //TAgnEntryUiEditorMode                         
       
    97     EErrorObsoleteViewOnly                  //TMROperation
       
    98     };
       
    99 
       
   100 static const TInt meetingReqScenario_A3[dataFieldCount] = {
       
   101     CCalEntry::EMethodRequest,              //TMethod
       
   102     ECallerMailApp,                         //TCallingApp
       
   103     EOpenedFromInbox,                       //TOpenedMailBox
       
   104     MMRUtilsTombsExt::ECheckedValidNew,     //TMRUtilsDbResult
       
   105     ENotSet,                                //TMethodLevelValidity
       
   106     MAgnEntryUi::EViewEntry,                //TAgnEntryUiEditorMode
       
   107     EStoreEntryToCalendar                   //TMROperation
       
   108     };
       
   109                                 
       
   110 static const TInt meetingReqScenario_A4[dataFieldCount] = {
       
   111     CCalEntry::EMethodRequest,              //TMethod
       
   112     ECallerMailApp,                         //TCallingApp
       
   113     EOpenedFromInbox,                       //TOpenedMailBox
       
   114     MMRUtilsTombsExt::ECheckedValidUpdate,  //TMRUtilsDbResult
       
   115     ENotSet,                                //TMethodLevelValidity
       
   116     MAgnEntryUi::EViewEntry,                //TAgnEntryUiEditorMode                         
       
   117     EStoreEntryToCalendar                   //TMROperation
       
   118     };
       
   119 
       
   120 static const TInt meetingReqScenario_A5[dataFieldCount] = {
       
   121     CCalEntry::EMethodRequest,              //TMethod
       
   122     ECallerMailApp,                         //TCallingApp
       
   123     EOpenedFromInbox,                       //TOpenedMailBox
       
   124     MMRUtilsTombsExt::EErrorIdenticalExists,//TMRUtilsDbResult
       
   125     ENotSet,                                //TMethodLevelValidity
       
   126     MAgnEntryUi::EViewEntry,                //TAgnEntryUiEditorMode                         
       
   127     ELoadIdenticalEntryFromDB               //TMROperation
       
   128     };
       
   129 
       
   130 static const TInt meetingReqScenario_A6[dataFieldCount] = {
       
   131     CCalEntry::EMethodRequest,              //TMethod
       
   132     ECallerMailApp,                         //TCallingApp
       
   133     EOpenedFromOutbox,                      //TOpenedMailBox
       
   134     ENotSet,                                //TMRUtilsDbResult
       
   135     ENotSet,                                //TMethodLevelValidity
       
   136     MAgnEntryUi::EViewEntry,                //TAgnEntryUiEditorMode                     
       
   137     EViewExistingEntry                      //TMROperation
       
   138     };
       
   139 
       
   140 static const TInt meetingReqScenario_A7[dataFieldCount] = {
       
   141     CCalEntry::EMethodRequest,              //TMethod
       
   142     ECallerCalendarApp,                     //TCallingApp
       
   143     ENotSet,                                //TOpenedMailBox                                
       
   144     ENotSet,                                //TMRUtilsDbResult
       
   145     ENotSet,                                //TMethodLevelValidity
       
   146     MAgnEntryUi::ECreateNewEntry,           //TAgnEntryUiEditorMode
       
   147     EShowEmptyRequest                       //TMROperation
       
   148     };
       
   149 
       
   150 static const TInt meetingReqScenario_A8[dataFieldCount] = {
       
   151     CCalEntry::EMethodRequest,              //TMethod
       
   152     ECallerCalendarApp,                     //TCallingApp
       
   153     ENotSet,                                //TOpenedMailBox                                
       
   154     ENotSet,                                //TMRUtilsDbResult
       
   155     ENotSet,                                //TMethodLevelValidity
       
   156     MAgnEntryUi::EEditExistingEntry,        //TAgnEntryUiEditorMode
       
   157     EEditExistingEntry                      //TMROperation
       
   158     };
       
   159 
       
   160 static const TInt meetingReqScenario_A9[dataFieldCount] = {
       
   161     CCalEntry::EMethodRequest,              //TMethod
       
   162     ECallerCalendarApp,                     //TCallingApp
       
   163     ENotSet,                                //TOpenedMailBox
       
   164     ENotSet,                                //TMRUtilsDbResult
       
   165     ENotSet,                                //TMethodLevelValidity
       
   166     MAgnEntryUi::EViewEntry,                //TAgnEntryUiEditorMode
       
   167     EViewExistingEntry                      //TMROperation
       
   168     };  
       
   169 
       
   170 static const TInt meetingReqScenario_A10[dataFieldCount] = {
       
   171     CCalEntry::EMethodRequest,              //TMethod
       
   172     ECallerBVApp,                           //TCallingApp
       
   173     ENotSet,                                //TOpenedMailBox
       
   174     ENotSet,                                //TMRUtilsDbResult
       
   175     ENotSet,                                //TMethodLevelValidity
       
   176     MAgnEntryUi::EViewEntry,                //TAgnEntryUiEditorMode
       
   177     EViewExistingEntry                      //TMROperation
       
   178     };  
       
   179     
       
   180 static const TInt meetingReqScenario_A11[dataFieldCount] = {
       
   181     CCalEntry::EMethodRequest,              //TMethod
       
   182     ENotSet,                                //TCallingApp
       
   183     ENotSet,                                //TOpenedMailBox
       
   184     ENotSet,                                //TMRUtilsDbResult
       
   185     ENotSet,                                //TMethodLevelValidity
       
   186     ENotSet,                                //TAgnEntryUiEditorMode                             
       
   187     EErrorSituation                         //TMROperation
       
   188     };
       
   189         
       
   190 // RESPONSE
       
   191 
       
   192 static const TInt meetingReqScenario_B1[dataFieldCount] = {
       
   193     CCalEntry::EMethodReply,                //TMethod
       
   194     ECallerMailApp,                         //TCallingApp
       
   195     EOpenedFromInbox,                       //TOpenedMailBox
       
   196     MMRUtilsTombsExt::ECheckedValidUpdate,  //TMRUtilsDbResult
       
   197     EValidNeedsSave,                        //TMethodLevelValidity
       
   198     MAgnEntryUi::EViewEntry,                //TAgnEntryUiEditorMode
       
   199     EUpdateStatusToCalendar                 //TMROperation
       
   200     };
       
   201 
       
   202 static const TInt meetingReqScenario_B2[dataFieldCount] = {
       
   203     CCalEntry::EMethodReply,                //TMethod
       
   204     ECallerMailApp,                         //TCallingApp
       
   205     EOpenedFromInbox,                       //TOpenedMailBox
       
   206     MMRUtilsTombsExt::ECheckedValidUpdate,  //TMRUtilsDbResult
       
   207     EValidNoNeedSave,                       //TMethodLevelValidity
       
   208     MAgnEntryUi::EViewEntry,                //TAgnEntryUiEditorMode
       
   209     EViewExistingEntry                      //TMROperation
       
   210     };
       
   211 
       
   212 static const TInt meetingReqScenario_B3[dataFieldCount] = {
       
   213     CCalEntry::EMethodReply,                //TMethod
       
   214     ECallerMailApp,                         //TCallingApp
       
   215     EOpenedFromInbox,                       //TOpenedMailBox
       
   216     MMRUtilsTombsExt::EErrorHasBeenDeleted, //TMRUtilsDbResult
       
   217     ENotSet,                                //TMethodLevelValidity
       
   218     MAgnEntryUi::EViewEntry,                //TAgnEntryUiEditorMode
       
   219     EViewExistingEntry                      //TMROperation
       
   220     };
       
   221 
       
   222 static const TInt meetingReqScenario_B4[dataFieldCount] = {
       
   223     CCalEntry::EMethodReply,                //TMethod
       
   224     ENotSet,                                //TCallingApp
       
   225     ENotSet,                                //TOpenedMailBox
       
   226     ENotSet,                                //TMRUtilsDbResult
       
   227     ENotSet,                                //TMethodLevelValidity
       
   228     ENotSet,                                //TAgnEntryUiEditorMode
       
   229     EErrorSituation                         //TMROperation
       
   230     };
       
   231             
       
   232 // TODO: handle response from bva
       
   233             
       
   234 // CANCEL
       
   235 
       
   236 static const TInt meetingReqScenario_C1[dataFieldCount] = {
       
   237     CCalEntry::EMethodCancel,               //TMethod
       
   238     ECallerMailApp,                         //TCallingApp
       
   239     EOpenedFromInbox,                       //TOpenedMailBox
       
   240     MMRUtilsTombsExt::ECheckedValidUpdate,  //TMRUtilsDbResult
       
   241     ENotSet,                                //TMethodLevelValidity
       
   242     MAgnEntryUi::EViewEntry,                //TAgnEntryUiEditorMode                     
       
   243     EStoreEntryToCalendar                   //TMROperation
       
   244     };
       
   245 
       
   246 // TODO: handle cancel from bva
       
   247 
       
   248 static const TInt meetingReqScenario_C2[dataFieldCount] = {
       
   249     CCalEntry::EMethodCancel,               //TMethod
       
   250     ENotSet,                                //TCallingApp
       
   251     ENotSet,                                //TOpenedMailBox
       
   252     MMRUtilsTombsExt::ECheckedValidNew,     //TMRUtilsDbResult
       
   253     ENotSet,                                //TMethodLevelValidity
       
   254     ENotSet,                                //TAgnEntryUiEditorMode                 
       
   255     EErrorUnexpectedViewOnly                //TMROperation
       
   256     };                              
       
   257 
       
   258 static const TInt meetingReqScenario_C3[dataFieldCount] = {
       
   259     CCalEntry::EMethodCancel,               //TMethod
       
   260     ENotSet,                                //TCallingApp
       
   261     ENotSet,                                //TOpenedMailBox
       
   262     ENotSet,                                //TMRUtilsDbResult
       
   263     ENotSet,                                //TMethodLevelValidity
       
   264     ENotSet,                                //TAgnEntryUiEditorMode                 
       
   265     EErrorSituation                         //TMROperation
       
   266     };
       
   267 								
       
   268 static const TInt scenarioCount = 18;
       
   269 
       
   270 static const TInt* const scenarioArray[scenarioCount] = {
       
   271 	meetingReqScenario_A1,
       
   272 	meetingReqScenario_A2,
       
   273 	meetingReqScenario_A3,
       
   274 	meetingReqScenario_A4,
       
   275 	meetingReqScenario_A5,
       
   276 	meetingReqScenario_A6,
       
   277 	meetingReqScenario_A7,
       
   278 	meetingReqScenario_A8,
       
   279 	meetingReqScenario_A9,
       
   280 	meetingReqScenario_A10,
       
   281 	meetingReqScenario_A11,	
       
   282 	meetingReqScenario_B1,
       
   283 	meetingReqScenario_B2,
       
   284 	meetingReqScenario_B3,
       
   285 	meetingReqScenario_B4,
       
   286 	meetingReqScenario_C1,
       
   287 	meetingReqScenario_C2,
       
   288 	meetingReqScenario_C3,
       
   289     };
       
   290 
       
   291 #endif