calendarui/controller/src/calencmdlinelauncher.cpp
branchRCL_3
changeset 13 1984aceb8774
parent 11 0f07cd1b5772
child 14 21239b3bcd78
equal deleted inserted replaced
11:0f07cd1b5772 13:1984aceb8774
    25 #include <calinstanceview.h>
    25 #include <calinstanceview.h>
    26 #include <calencontext.h>
    26 #include <calencontext.h>
    27 #include <caleninstanceid.h>            // TCalenInstanceId
    27 #include <caleninstanceid.h>            // TCalenInstanceId
    28 #include <calenactionuiutils.h>
    28 #include <calenactionuiutils.h>
    29 #include <aknappui.h>
    29 #include <aknappui.h>
       
    30 #include <AknDlgShut.h> 
    30 #include "calenviewmanager.h"
    31 #include "calenviewmanager.h"
    31 #include "calencmdlinelauncher.h"
    32 #include "calencmdlinelauncher.h"
    32 #include "calencontroller.h"            // CCalenController
    33 #include "calencontroller.h"            // CCalenController
    33 #include "calencmdlineparser.h"         // CCalCmdLineParser
    34 #include "calencmdlineparser.h"         // CCalCmdLineParser
    34 #include "CalenUid.h"
    35 #include "CalenUid.h"
   144         // Calendar is in the background with an open entry editor, and is then launched from
   145         // Calendar is in the background with an open entry editor, and is then launched from
   145         // the command line to open a new entry editor.  We need to close the old editor
   146         // the command line to open a new entry editor.  We need to close the old editor
   146         // using the same 'try and save whatever we can' logic that is used on a forced close
   147         // using the same 'try and save whatever we can' logic that is used on a forced close
   147         // and then open the new editor.  We also have to prevent the focus state being updated
   148         // and then open the new editor.  We also have to prevent the focus state being updated
   148         // and highlighting the old entry in the day view.
   149         // and highlighting the old entry in the day view.
   149         while( AppUi().IsDisplayingDialog() )
   150         if( AppUi().IsDisplayingDialog() )
   150             {
   151             {
   151             iIsExitOnDlgClose = EFalse;
   152             iIsExitOnDlgClose = EFalse;
   152             // Tell the editui that whatever it was doing, it should not alter
   153             // Tell the editui that whatever it was doing, it should not alter
   153             // the focus state
   154             // the focus state
   154             iController.IssueCommandL( ECalenNotifyFocusChange );
   155             iController.IssueCommandL( ECalenNotifyFocusChange );
   155 
   156 
   156             // Send a key event to the currently open dialog (viewer / editor)
   157             // Send a key event to the currently open dialog (viewer / editor)
   157             // to dismiss it
   158             // to dismiss it
   158             TKeyEvent key;
   159             /*TKeyEvent key;
   159             key.iRepeats = 0;
   160             key.iRepeats = 0;
   160             key.iCode = EKeyEscape;
   161             key.iCode = EKeyEscape;
   161             key.iModifiers = 0;
   162             key.iModifiers = 0;
   162             CCoeEnv::Static()->SimulateKeyEventL( key, EEventKey );
   163             CCoeEnv::Static()->SimulateKeyEventL( key, EEventKey );*/
   163             
   164             AknDialogShutter::ShutDialogsL( *CEikonEnv::Static() );
   164             // Break is added to close the messaging editor as the messagng editor is not 
   165             // Break is added to close the messaging editor as the messagng editor is not 
   165             // consuming the escape key event.
   166             // consuming the escape key event.
   166             if( iGlobalData->CalenSendL().IsMessagingEditorOpen() )
   167             /*if( iGlobalData->CalenSendL().IsMessagingEditorOpen() )
   167                 {
   168                 {
   168             break;
   169             break;
   169                 }
   170                 }*/
   170                  
   171                  
   171             }
   172             }
   172 
   173 
   173         // Interpret 8bit data as 16bit unicode data
   174         // Interpret 8bit data as 16bit unicode data
   174         //lint -e{826} Disable the lint warning of the pointer sizes being different
   175         //lint -e{826} Disable the lint warning of the pointer sizes being different
   175         const TText* buf = reinterpret_cast<const TText*>(aTail.Ptr());
   176         const TText* buf = reinterpret_cast<const TText*> (aTail.Ptr());
   176         TPtrC ptr(buf, aTail.Length() / (TInt) sizeof(TText));
   177         TPtrC ptr(buf, aTail.Length() / (TInt) sizeof(TText));
   177 
   178 
   178         // create cmd line parser
   179         // create cmd line parser
   179         CCalenCmdLineParser* parser = CCalenCmdLineParser::NewL();
   180         CCalenCmdLineParser* parser = CCalenCmdLineParser::NewL();
   180         CleanupStack::PushL( parser );
   181         CleanupStack::PushL(parser);
   181         // parse parameters
   182         // parse parameters
   182         parser->ParseCommandLineL( ptr );
   183         parser->ParseCommandLineL(ptr);
   183         iCmdParameters = parser->CommandLineParameters();
   184         iCmdParameters = parser->CommandLineParameters();
   184         CleanupStack::PopAndDestroy(); // parser
   185         CleanupStack::PopAndDestroy(); // parser
   185         }
   186         }
   186 
   187 
   187     // If we are launched to a specific view, find and activate it.
   188     // If we are launched to a specific view, find and activate it.