mobilemessaging/unieditor/application/src/UniEditorAppUi.cpp
branchRCL_3
changeset 54 fa1df4b99609
parent 53 696bfeff199e
equal deleted inserted replaced
53:696bfeff199e 54:fa1df4b99609
   139 
   139 
   140 // Resource identifiers
   140 // Resource identifiers
   141 #include <UniEditor.rsg>
   141 #include <UniEditor.rsg>
   142 #include <MsgEditorAppUi.rsg>
   142 #include <MsgEditorAppUi.rsg>
   143 
   143 
       
   144 #include <akndiscreetpopup.h>
       
   145 #include <aknsconstants.hrh>
   144 
   146 
   145 #include "UniSendingSettings.h"
   147 #include "UniSendingSettings.h"
   146 #include "UniPluginApi.h"
   148 #include "UniPluginApi.h"
   147 #include "UniSmsPlugin.h"
   149 #include "UniSmsPlugin.h"
   148 #include "UniClientMtm.h"
   150 #include "UniClientMtm.h"
   263 CUniEditorAppUi::CUniEditorAppUi() :   
   265 CUniEditorAppUi::CUniEditorAppUi() :   
   264     iDisplaySize( -1 ),
   266     iDisplaySize( -1 ),
   265     iWaitResId( -1 ),
   267     iWaitResId( -1 ),
   266     iOriginalSlide( -1 ),
   268     iOriginalSlide( -1 ),
   267     iNextFocus( EMsgComponentIdNull ),
   269     iNextFocus( EMsgComponentIdNull ),
       
   270     iPopupChangedMmsBuffer(NULL),
       
   271     iPopupChangedSmsBuffer(NULL),
   268     iEditorFlags( EShowInfoPopups ),
   272     iEditorFlags( EShowInfoPopups ),
   269     iMskResId( R_UNIEDITOR_OPTIONS_CLOSE ),
   273     iMskResId( R_UNIEDITOR_OPTIONS_CLOSE ),
   270     iOptimizedFlow(EFalse),
   274     iOptimizedFlow(EFalse),
   271     iSingleJpegImageProcessing(EFalse)
   275     iSingleJpegImageProcessing(EFalse)
   272     {
   276     {
   449 #endif
   453 #endif
   450     	iLongTapDetector = CAknLongTapDetector::NewL( this );
   454     	iLongTapDetector = CAknLongTapDetector::NewL( this );
   451 		iLongTapDetector->SetTimeDelayBeforeAnimation( KUniLongTapStartDelay );
   455 		iLongTapDetector->SetTimeDelayBeforeAnimation( KUniLongTapStartDelay );
   452 		iLongTapDetector->SetLongTapDelay( KUniLongTapTimeDelay );
   456 		iLongTapDetector->SetLongTapDelay( KUniLongTapTimeDelay );
   453 		iTapConsumed = EFalse;
   457 		iTapConsumed = EFalse;
       
   458 
       
   459 		//Korean Req: 415-5434
       
   460 		if ( iEditorFlags & EShowInfoPopups )
       
   461      		{
       
   462 	        iPopupNote = CAknInfoPopupNoteController::NewL();
       
   463             iPopupNote->SetTimeDelayBeforeShow( 0 );
       
   464             iPopupNote->SetTimePopupInView( 3000 );
       
   465 
       
   466 			iPopupSmsSizeAboveLimitBuffer = StringLoader::LoadL( R_UNIEDITOR_POPUP_SMS_SIZE_ABOVE_LIMIT, Document()->SmsSizeWarningBytes(), iCoeEnv );
       
   467 			iPopupSmsSizeBelowLimitBuffer = StringLoader::LoadL( R_UNIEDITOR_POPUP_SMS_SIZE_UNDER_LIMIT, Document()->SmsSizeWarningBytes(), iCoeEnv );		
       
   468 	    	}
       
   469 
   454     }
   470     }
   455 
   471 
   456 
   472 
   457 // ---------------------------------------------------------
   473 // ---------------------------------------------------------
   458 // CUniEditorAppUi::~CUniEditorAppUi
   474 // CUniEditorAppUi::~CUniEditorAppUi
   792         VerifyAddressesL( unused );
   808         VerifyAddressesL( unused );
   793         }
   809         }
   794         
   810         
   795     if ( iEditorFlags & EShowInfoPopups )
   811     if ( iEditorFlags & EShowInfoPopups )
   796         {
   812         {
   797         iPopupNote = CAknInfoPopupNoteController::NewL();
       
   798         iPopupNote->SetTimeDelayBeforeShow( 0 );
       
   799         iPopupNote->SetTimePopupInView( 3000 );
       
   800 
       
   801         iPopupChangedMmsBuffer = StringLoader::LoadL( R_UNIEDITOR_POPUP_MSG_CHANGED_MMS, iCoeEnv );
   813         iPopupChangedMmsBuffer = StringLoader::LoadL( R_UNIEDITOR_POPUP_MSG_CHANGED_MMS, iCoeEnv );
   802         iPopupChangedSmsBuffer = StringLoader::LoadL( R_UNIEDITOR_POPUP_MSG_CHANGED_SMS, iCoeEnv );
   814 		iPopupChangedSmsBuffer = StringLoader::LoadL( R_UNIEDITOR_POPUP_MSG_CHANGED_SMS, iCoeEnv );
   803 
       
   804         //Korean Req: 415-5434        
       
   805         iPopupSmsSizeAboveLimitBuffer = StringLoader::LoadL( R_UNIEDITOR_POPUP_SMS_SIZE_ABOVE_LIMIT, Document()->SmsSizeWarningBytes(), iCoeEnv );
       
   806         iPopupSmsSizeBelowLimitBuffer = StringLoader::LoadL( R_UNIEDITOR_POPUP_SMS_SIZE_UNDER_LIMIT, Document()->SmsSizeWarningBytes(), iCoeEnv );
       
   807 
   815 
   808         }
   816         }
   809 
   817 
   810     CheckMaxRecipientsAndShowNoteL();
   818     CheckMaxRecipientsAndShowNoteL();
   811     
   819     
  1182                  
  1190                  
  1183                 if ( maxSmsCharacters <= 0 )
  1191                 if ( maxSmsCharacters <= 0 )
  1184                     {
  1192                     {
  1185                     // No absolute maximum characters defined -> Calculate
  1193                     // No absolute maximum characters defined -> Calculate
  1186                     // character maximum using maximum SMS part limit.
  1194                     // character maximum using maximum SMS part limit.
  1187                     maxSmsCharacters = maxSmsParts * lengthMany;
  1195 
       
  1196                     if( maxSmsParts > 1 )
       
  1197                         {
       
  1198                         maxSmsCharacters = maxSmsParts * lengthMany;
       
  1199                         }
       
  1200                     else
       
  1201                         {
       
  1202 						// for korean variant
       
  1203                         maxSmsCharacters = lengthOne;
       
  1204                         }
       
  1205 
  1188                     }
  1206                     }
  1189                 CalculateSMSMsgLen(charsLeft,msgsParts);
  1207                 CalculateSMSMsgLen(charsLeft,msgsParts);
  1190                 if( model->ObjectList().Count() == 0 &&
  1208                 if( model->ObjectList().Count() == 0 &&
  1191                     model->AttachmentList().Count() == 1 &&
  1209                     model->AttachmentList().Count() == 1 &&
  1192                     iSmilModel->SlideCount() == 1 &&
  1210                     iSmilModel->SlideCount() == 1 &&
  6335             
  6353             
  6336             switch ( iInsertingType )
  6354             switch ( iInsertingType )
  6337                 {
  6355                 {
  6338                 case EMsgMediaImage:
  6356                 case EMsgMediaImage:
  6339                     {
  6357                     {
  6340                     // Set focus always first to the image control...
  6358                     // Set the focus to Text field so that user will be able to
  6341                     iView->SetFocus( EMsgComponentIdImage );
  6359 					// Type the text when image height is too big
       
  6360                     CMsgBodyControl* bodyCtrl = BodyCtrl();
       
  6361                     if ( bodyCtrl )
       
  6362                         {
       
  6363 						// Put the cursor at the end of Text.
       
  6364                         bodyCtrl->SetCursorPosL( bodyCtrl->Editor().TextLength() );
       
  6365                         iView->SetFocus( EMsgComponentIdBody );                           
       
  6366                         }
  6342                     break;
  6367                     break;
  6343                     }
  6368                     }
  6344                 case EMsgMediaAudio:
  6369                 case EMsgMediaAudio:
  6345                     {
  6370                     {
  6346                     // Set focus always first to the audio control
  6371                     // Set focus always first to the audio control
  7874                     {
  7899                     {
  7875                     //set the bit to indicate limit exceeded and note shown
  7900                     //set the bit to indicate limit exceeded and note shown
  7876                     iEditorFlags |= ESmsSizeWarningNoteShown;
  7901                     iEditorFlags |= ESmsSizeWarningNoteShown;
  7877                     if( iPopupNote )
  7902                     if( iPopupNote )
  7878                         {
  7903                         {
  7879                         iPopupNote->SetTextL( iPopupSmsSizeAboveLimitBuffer->Des() );
  7904 						ShowDiscreetPopUpL(iPopupSmsSizeAboveLimitBuffer->Des());
  7880                         iPopupNote->ShowInfoPopupNote();
       
  7881                         }
  7905                         }
  7882                     }
  7906                     }
  7883                 }
  7907                 }
  7884             else
  7908             else
  7885                 {
  7909                 {
  7888                     {
  7912                     {
  7889                     //reset the bit to indicate size is below limit and note for transition is showed
  7913                     //reset the bit to indicate size is below limit and note for transition is showed
  7890                     iEditorFlags &= ~ESmsSizeWarningNoteShown;
  7914                     iEditorFlags &= ~ESmsSizeWarningNoteShown;
  7891                     if( iPopupNote )
  7915                     if( iPopupNote )
  7892                         {
  7916                         {
  7893                         iPopupNote->SetTextL( iPopupSmsSizeBelowLimitBuffer->Des() );
  7917                         ShowDiscreetPopUpL(iPopupSmsSizeBelowLimitBuffer->Des());
  7894                         iPopupNote->ShowInfoPopupNote();
       
  7895                         }                
  7918                         }                
  7896                     }
  7919                     }
  7897                 }          
  7920                 }          
  7898             }
  7921             }
  7899         
  7922         
  8587 // CUniEditorAppUi::ShowPopupNoteL
  8610 // CUniEditorAppUi::ShowPopupNoteL
  8588 // ---------------------------------------------------------
  8611 // ---------------------------------------------------------
  8589 //
  8612 //
  8590 void CUniEditorAppUi::ShowPopupNoteL( TBool aMms )
  8613 void CUniEditorAppUi::ShowPopupNoteL( TBool aMms )
  8591     {
  8614     {
  8592     if( iPopupNote )
  8615     if( iPopupNote && iPopupChangedMmsBuffer )
  8593         {
  8616         {
  8594         iPopupNote->SetTextL( aMms? iPopupChangedMmsBuffer->Des():
  8617         // additional check  iPopupChangedMmsBuffer is required as iPopupNote
  8595                                     iPopupChangedSmsBuffer->Des() );
  8618         // will be intialized in ConstructL but not iPopupChangedMmsBuffer.
  8596         iPopupNote->ShowInfoPopupNote();
  8619         // This change is done as part of Korean req.
       
  8620             ShowDiscreetPopUpL(aMms? iPopupChangedMmsBuffer->Des(): iPopupChangedSmsBuffer->Des());
  8597         }
  8621         }
  8598     }
  8622     }
  8599  
  8623  
  8600 // ---------------------------------------------------------
  8624 // ---------------------------------------------------------
  8601 // CUniEditorAppUi::PlayFocusedItemL
  8625 // CUniEditorAppUi::PlayFocusedItemL
 10024             }
 10048             }
 10025         }      
 10049         }      
 10026     return bCanSave;
 10050     return bCanSave;
 10027     }
 10051     }
 10028 
 10052 
       
 10053 // ---------------------------------------------------------
       
 10054 // CUniEditorAppUi::ShowDiscreetPopUpL
       
 10055 // Shows the Popup note in ITUT, when message size exceeds or deceeds 
       
 10056 // a certain limit or it changes from sms to mms and vice versa
       
 10057 // ---------------------------------------------------------
       
 10058 //
       
 10059 void CUniEditorAppUi::ShowDiscreetPopUpL(const TDesC& aMessage)
       
 10060 	{
       
 10061 	TInt  bitmapId = KErrNotFound;
       
 10062 	TInt  maskId = KErrNotFound;
       
 10063    
       
 10064    // No discreet popup => Uid 0
       
 10065    const TUid KDiscreetPopupUidNone =
       
 10066 	   {
       
 10067 	   0x0
       
 10068 	   };
       
 10069 	
       
 10070 	CAknDiscreetPopup::ShowGlobalPopupL(aMessage, // 1st text row
       
 10071 			KNullDesC, // second text row
       
 10072 			KAknsIIDDefault, // icon skin id
       
 10073 			KNullDesC, // bitmap file path
       
 10074 			bitmapId, // bitmap id
       
 10075 			maskId, // mask id
       
 10076 			KAknDiscreetPopupDurationLong, // flags
       
 10077 			0, // command id
       
 10078 			NULL, // command observer
       
 10079 			KDiscreetPopupUidNone, // application to be launched
       
 10080 			KDiscreetPopupUidNone); // view to be activated
       
 10081 	}
       
 10082 
 10029 // End of file
 10083 // End of file
 10030 
 10084