calendarui/controller/src/calencmdlinelauncher.cpp
branchRCL_3
changeset 86 ed599363c2d7
parent 74 97232defd20e
equal deleted inserted replaced
78:356f28cd5ca0 86:ed599363c2d7
   149     TRACE_ENTRY_POINT;
   149     TRACE_ENTRY_POINT;
   150 
   150 
   151     // If aTail is set, other app starts Calendar
   151     // If aTail is set, other app starts Calendar
   152     if( aTail.Length() )
   152     if( aTail.Length() )
   153         {
   153         {
       
   154         
       
   155 
       
   156         // Interpret 8bit data as 16bit unicode data
       
   157         //lint -e{826} Disable the lint warning of the pointer sizes being different
       
   158         const TText* buf = reinterpret_cast<const TText*> (aTail.Ptr());
       
   159         TPtrC ptr(buf, aTail.Length() / (TInt) sizeof(TText));
       
   160 
       
   161         // create cmd line parser
       
   162         CCalenCmdLineParser* parser = CCalenCmdLineParser::NewL();
       
   163         CleanupStack::PushL(parser);
       
   164         // parse parameters
       
   165         parser->ParseCommandLineL(ptr);
       
   166         iCmdParameters = parser->CommandLineParameters();
       
   167         CleanupStack::PopAndDestroy(); // parser
       
   168         
       
   169         if( iCmdParameters.iCommandType == CCalenCmdLineParser::EStartTypeUidAlarmViewer 
       
   170                 || iCmdParameters.iCommandType == CCalenCmdLineParser::EStartTypeUidAlarmViewerNoSnooze)
       
   171                 
       
   172            {  
       
   173             // disable the MSK feature when the same events editor is opened whose alarm is expiring.
       
   174            if(iController.IsEditorActive())
       
   175                 {
       
   176                 TCalLocalUid uid( iCmdParameters.iLocalUid );
       
   177                 TCalCollectionId colId = iGlobalData->CalSessionL( iCmdParameters.iCalenFileName ).CollectionIdL();
       
   178       
       
   179                 // get the context
       
   180                 MCalenContext& context = iController.Services().Context();
       
   181                 TCalLocalUid entryUid = context.InstanceId().iEntryLocalUid;
       
   182                 TCalCollectionId collectionId  = context.InstanceId().iColId;
       
   183        
       
   184                 if(entryUid == uid && colId == collectionId)
       
   185                     {
       
   186                     return ETrue;
       
   187                     }
       
   188                 }
       
   189            }
       
   190         
       
   191         
       
   192         
   154         // If we are displaying a dialog, then Calendar is obviously already open
   193         // If we are displaying a dialog, then Calendar is obviously already open
   155         // If we have been launched with cmd line parameters, we need to close the
   194         // If we have been launched with cmd line parameters, we need to close the
   156         // open dialog and deal with the command line.  An example of this would be that
   195         // open dialog and deal with the command line.  An example of this would be that
   157         // Calendar is in the background with an open entry editor, and is then launched from
   196         // Calendar is in the background with an open entry editor, and is then launched from
   158         // the command line to open a new entry editor.  We need to close the old editor
   197         // the command line to open a new entry editor.  We need to close the old editor
   168             
   207             
   169             iShutter->Cancel();
   208             iShutter->Cancel();
   170             //close all open dialogs in asynchronous way
   209             //close all open dialogs in asynchronous way
   171             iShutter->ShutDialogsL();
   210             iShutter->ShutDialogsL();
   172             }
   211             }
   173 
       
   174         // Interpret 8bit data as 16bit unicode data
       
   175         //lint -e{826} Disable the lint warning of the pointer sizes being different
       
   176         const TText* buf = reinterpret_cast<const TText*> (aTail.Ptr());
       
   177         TPtrC ptr(buf, aTail.Length() / (TInt) sizeof(TText));
       
   178 
       
   179         // create cmd line parser
       
   180         CCalenCmdLineParser* parser = CCalenCmdLineParser::NewL();
       
   181         CleanupStack::PushL(parser);
       
   182         // parse parameters
       
   183         parser->ParseCommandLineL(ptr);
       
   184         iCmdParameters = parser->CommandLineParameters();
       
   185         CleanupStack::PopAndDestroy(); // parser
       
   186         }
   212         }
   187 
   213 
   188     // If we are launched to a specific view, find and activate it.
   214     // If we are launched to a specific view, find and activate it.
   189     // Any other launch types are handled in CalendarLaunchCallBack
   215     // Any other launch types are handled in CalendarLaunchCallBack
   190 
   216