mobilemessaging/audiomsg/inc/audiomessageappui.h
changeset 0 72b543305e3a
child 1 d09ac5c1e252
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2005-2006 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:   Provides audiomessage appui prototypes
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef _AUDIOMESSAGEAPPUI_H
       
    22 #define _AUDIOMESSAGEAPPUI_H
       
    23 
       
    24 // includes needed by inline functions:
       
    25 #include <MsgEditorView.h>          // CMsgEditorView
       
    26 #include <MsgAddressControl.h>      // CMsgAddressControl
       
    27 #include <MsgExpandableControl.h>   // CMsgExpandableControl
       
    28 #include <MsgBodyControl.h>         // CMsgBodyControl
       
    29 #include "audiomessagedocument.h"   // CAudioMessageDocument
       
    30 
       
    31 #include <unimodelconst.h>
       
    32 #include <MsgEditorAppUi.h>         // CMsgEditorAppUi
       
    33 #include <cenrepnotifyhandler.h>    // MCenRepNotifyHandlerCallback
       
    34 #include <MMGFetchVerifier.h>        // MMGFetchVerifier
       
    35 #include "amsoperationobserver.h"   // MAmsOperationObserver
       
    36 #include "amsvolobserver.h"         // MAmsVolumeObserver
       
    37 
       
    38 #include "audiomessage.hrh"
       
    39 #include <AknNaviDecoratorObserver.h>
       
    40 #include <eikedwob.h>                   // for MEikEdwinObserver
       
    41 #include <AknProgressDialog.h>          // for MProgressDialogCallback
       
    42 #ifdef RD_SCALABLE_UI_V2
       
    43 #include <akntoolbarobserver.h>
       
    44 #endif
       
    45 
       
    46 
       
    47 GLREF_C void Panic( TAmsEditorPanic aPanic ); 
       
    48 
       
    49 class CAknTitlePane;
       
    50 class CFindItemMenu;
       
    51 class CMsgVoIPExtension;
       
    52 class CMsgExpandableControl;
       
    53 class CAudioMessageInsertOperation;
       
    54 class CAudioMessageLaunchOperation;
       
    55 class CAudioMessageSaveOperation;
       
    56 class CAudioMessageSendOperation;
       
    57 class CAudioMessageProgressDialog;
       
    58 class CAknNavigationControlContainer;
       
    59 class CAknNavigationDecorator;
       
    60 class CAknIconArray;
       
    61 class CAknIndicatorContainer;
       
    62 class CMessageData;
       
    63 class CSendUi;
       
    64 class CAknLocalScreenClearer;
       
    65 class CAknInputBlock;
       
    66 class CAudioMessageSendReadReportOperation;
       
    67 class CMsgMediaInfo;
       
    68 class CUniAddressHandler;
       
    69 #ifdef RD_SCALABLE_UI_V2
       
    70 class CAknToolbar;
       
    71 #endif
       
    72 
       
    73 
       
    74 /**
       
    75 * CAudioMessageAppUi
       
    76 *
       
    77 * @lib AudioMessage.exe
       
    78 * @since S60 v3.1
       
    79 */
       
    80 class CAudioMessageAppUi : 
       
    81     public CMsgEditorAppUi,
       
    82     public MCenRepNotifyHandlerCallback,
       
    83     public MMGFetchVerifier,
       
    84     public MAmsOperationObserver,
       
    85     public MAmsVolumeObserver,
       
    86     public MAknNaviDecoratorObserver,
       
    87     public MEikEdwinObserver,
       
    88     public MProgressDialogCallback,
       
    89 #ifdef RD_SCALABLE_UI_V2    
       
    90     public MAknToolbarObserver             //toolbar    
       
    91 #endif    
       
    92     {
       
    93 
       
    94    private:     // Enumerations
       
    95 
       
    96 	    enum TAmsEditorFlags
       
    97 	        {
       
    98 	        ELaunchSuccessful       = 0x0001,
       
    99 	        ERunAppShutterAtExit    = 0x0002,
       
   100 	        EEditorClosing          = 0x0004,
       
   101 	        EAutohighLightEnabled   = 0x0008,
       
   102 	        EProgressInUse			= 0x0010,
       
   103 	        EEditorExiting          = 0x0020
       
   104 	        };
       
   105 
       
   106 	    enum TAmsNaviType
       
   107 			{
       
   108 			EAmsOnlyLength=0,
       
   109 			EAmsTextEditorAndLength,
       
   110 			EAmsMsgArrows
       
   111 			};
       
   112 
       
   113 
       
   114     public:  // Constructors and destructor
       
   115         
       
   116         /**
       
   117          * C++ default constructor.
       
   118          */
       
   119         CAudioMessageAppUi();
       
   120 
       
   121         /**
       
   122          * Destructor.
       
   123          */
       
   124         virtual ~CAudioMessageAppUi();
       
   125  				void HandleWsEventL( const TWsEvent& aEvent,CCoeControl* aDestination );
       
   126 
       
   127         /**
       
   128          * Removes audiofile.
       
   129          */
       
   130         void RemoveAudioL(  );
       
   131 
       
   132         /**
       
   133          * From MAmsVolumeObserver.
       
   134          *
       
   135          * Audio volume changed. Called for by CAudioMessageProgressDlg
       
   136          */
       
   137    		void UpdateNaviVol( TInt aCurrentVolumeValue ) ;
       
   138    		TInt GetVolume();
       
   139         /**
       
   140          * From MAmsVolumeObserver.
       
   141          *
       
   142          * Audio routing change. Called for by CAudioMessageProgressDlg
       
   143          */
       
   144    		void SetSpeakerOutput( TBool aEarpiece );
       
   145 
       
   146         /**
       
   147          * Saves, if needed and exits
       
   148          */        
       
   149         void ExitAndSaveL( );
       
   150 
       
   151         /**
       
   152          * Wrapper on the FetchFileL function of Base Editor.
       
   153          * Called by "Insert" functions.
       
   154          */
       
   155 		TBool FetchFileL( TFileName &aFileName );
       
   156    		
       
   157         /**
       
   158          * Fetchs voice file handle from msgstore. 
       
   159          * Gets duration from CAudioMessageRecorder 
       
   160          * and puts it in document object.
       
   161          */
       
   162 		void FetchAudioFileDataL(  ) ;
       
   163 
       
   164         /**
       
   165          * Callback for CPeriodic
       
   166          */        
       
   167 		static TInt DelayedExit( TAny* aThis );
       
   168 
       
   169         /**
       
   170     	 * Tries to exit the application. Called for example by CIdle
       
   171      	 */
       
   172     	void DoExternalExit( );
       
   173         
       
   174         /**
       
   175         * Callback for MProgressDialogCallback
       
   176         */        
       
   177         void DialogDismissedL( TInt /*dismissed*/ );
       
   178  		
       
   179  		// Functions from base classes    		
       
   180     public:
       
   181     
       
   182         /**
       
   183          * From MMsgEditorObserver. Calls DoEditorObserverL()
       
   184          *
       
   185          * For passing events from Base Editor to AudioMessage
       
   186          */
       
   187         void EditorObserver(
       
   188             TMsgEditorObserverFunc aFunc,
       
   189             TAny* aArg1,
       
   190             TAny* aArg2,
       
   191             TAny* aArg3 );
       
   192         void DoEditorObserverL(
       
   193             TMsgEditorObserverFunc aFunc,
       
   194             TAny* aArg1,
       
   195             TAny* aArg2,
       
   196             TAny* aArg3 );
       
   197 
       
   198         /**
       
   199          * From MMGFetchVerifier
       
   200          */
       
   201         TBool VerifySelectionL( const MDesCArray* aSelectedFiles );
       
   202 
       
   203         /**
       
   204         * From MAknNaviDecoratorObserver
       
   205         * Handles the events coming from arrow presses
       
   206         *  related to next/previous message
       
   207         */
       
   208         void HandleNaviDecoratorEventL( TInt aEventID );
       
   209         
       
   210         /**
       
   211         * From MEikEdwinObserver
       
   212         */
       
   213     	void HandleEdwinEventL( CEikEdwin* aEdwin, TEdwinEvent aEventType );
       
   214 	    
       
   215 	     /**
       
   216         * From MMessageIteratorObserver
       
   217         * @param See documentation of MMessageIteratorObserver
       
   218         */
       
   219 #ifndef RD_MSG_NAVIPANE_IMPROVEMENT
       
   220         void HandleIteratorEventL( TMessageIteratorEvent aEvent );
       
   221 #endif   
       
   222 
       
   223     private:
       
   224         
       
   225         /**
       
   226          *     Notification from central repository
       
   227          */
       
   228        	void HandleNotifyInt( TUint32 aId, TInt aNewValue );
       
   229 
       
   230         void DoUpdateSoftKeysL( TInt aSk );
       
   231         void UpdateSoftKeysL(  );
       
   232         /**
       
   233         * Sets automatic highlighting on/off.
       
   234         * @param aEnable if ETrue sets automatic highlighting on,
       
   235         *                if EFalse sets automatic highlighting off
       
   236         */
       
   237         void SetFindMode( TBool aEnable );
       
   238 	      
       
   239 	    /**
       
   240          * From MMsgEditorLauncher
       
   241          */
       
   242         void LaunchViewL();
       
   243 
       
   244 	    /**
       
   245 	     * Route key events to view.
       
   246 	     * @param aKeyEvent key event
       
   247 	     * @param aType     event type
       
   248 	     * @return          response
       
   249 	     * from CCoeAppUi
       
   250 	     */
       
   251         TKeyResponse HandleKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
   252 
       
   253         /**
       
   254         * From CEikAppUi 
       
   255         */
       
   256         void HandleCommandL( TInt aCommand );
       
   257 
       
   258 	    /**
       
   259 	     * Inits the main menu options
       
   260 	     * @param aMenuId
       
   261 	     * @parem aMenuPane
       
   262 	     */
       
   263         void DynInitMenuPaneL( TInt aMenuId, CEikMenuPane* aMenuPane );
       
   264 
       
   265 	    /**
       
   266 	     * From MAmsOperationObserver
       
   267 	     * Calls DoEditorObserverL()
       
   268 	     */
       
   269         void EditorOperationEvent(
       
   270             TAmsOperationType aOperation,
       
   271             TAmsOperationEvent aEvent );
       
   272 	    /**
       
   273 	     * Checks the result of the event and shows possible error note.
       
   274 	     * Calls right function to finalize operation.
       
   275 	     */
       
   276         void DoEditorOperationEventL(
       
   277             TAmsOperationType aOperation,
       
   278             TAmsOperationEvent aEvent );
       
   279             
       
   280 	    /**
       
   281 	     * Called when insert operation finishes. Removes wait note.
       
   282 	     * Updates navipane, fetch clip duration and so on.
       
   283 	     * Focuses the right object.
       
   284 	     */
       
   285         void DoInsertCompleteL( TBool aErrorNone );
       
   286 
       
   287 	    /**
       
   288 	     * Called when launch operation finishes. Removes wait note.
       
   289 	     * Updates navipane, voice clip icon and duration of the clip.
       
   290 	     * Focuses the right object.
       
   291 	     */
       
   292         void DoLaunchCompleteL( TAmsOperationEvent aEvent );
       
   293 	    /**
       
   294 	     * Called when save operation finishes. 
       
   295 	     */
       
   296         void DoSaveCompleteL();
       
   297 	    
       
   298 	    /**
       
   299 	     * Called after DoSaveComplete or DialogDismissed 
       
   300 	     */
       
   301 	    void DoOpComplete2ndPhaseL();
       
   302 	    
       
   303 	    /**
       
   304 	     * Called when send operation finishes. After that application exit
       
   305 	     */
       
   306         void DoSendCompleteL();
       
   307 	    /**
       
   308 	     * Called when remove operation finishes. Removes wait note, clean
       
   309 	     * duration and change icon for clipstatus
       
   310 	     */
       
   311         void DoRemoveCompleteL();
       
   312         
       
   313 	    /**
       
   314 		 * Reports errors that appears during insertion to appui
       
   315 	     */
       
   316         void ShowInsertErrorsL();
       
   317 
       
   318     private:
       
   319 
       
   320         /**
       
   321          * By default Symbian OS constructor is private.
       
   322          */
       
   323         void ConstructL(); 
       
   324 
       
   325     private: // New functions
       
   326           
       
   327         /**
       
   328          * Check if message has any data i.e. either in header ("To"),
       
   329          * in message body or as attachments.
       
   330          *
       
   331          * @return ETrue, message empty,
       
   332          *         EFalse, message not empty
       
   333          */        
       
   334         TBool IsMessageEmpty() const;
       
   335    
       
   336         /**
       
   337          * Updates the address size to CAudioMessageDocument
       
   338          */
       
   339         void SetAddressSize();
       
   340         
       
   341         /**
       
   342          * Updates the address size to CAudioMessageDocument
       
   343          */
       
   344         void SetBodySize();
       
   345 
       
   346         /**
       
   347          * Checks message content and if ok send message
       
   348          */        
       
   349         void DoUserSendL();
       
   350  
       
   351         /**
       
   352          * Handles message saving after exit 
       
   353          */        
       
   354         void DoMsgSaveExitL();
       
   355 
       
   356         /**
       
   357          * Handles delayed (external) exit 
       
   358          */        
       
   359         void DoDelayedExitL( TInt aDelayTime );
       
   360 
       
   361         /**
       
   362          * Handles message saving after user has pressed close.
       
   363          */        
       
   364         void DoBackSaveL();
       
   365 
       
   366         /**
       
   367          * Does actual saving of message to DRAFT folder.
       
   368          */        
       
   369         void DoSaveL();
       
   370 
       
   371         /**
       
   372          * Handles user message info command. 
       
   373          */        
       
   374         void DoUserMessageInfoL();
       
   375 
       
   376         /**
       
   377          * Handles user sending settings command. 
       
   378          */        
       
   379         //void DoUserSendingOptionsL();
       
   380  
       
   381         /**
       
   382          * Handles audio clip play command
       
   383          * @param none 
       
   384          */ 
       
   385         void PlayAudioL();       
       
   386         
       
   387         /**
       
   388          * Handles Delete message commands using by 
       
   389          * object CAudioMessaegeInsertOperation.
       
   390          * @param none 
       
   391          */ 
       
   392         void DeleteMessageL();
       
   393         
       
   394         void DoCallToSenderL();
       
   395  
       
   396         /**
       
   397          * Creates a media info object from given file and
       
   398          * performs a preliminary check whether it is ok to 
       
   399          * insert the given media file.
       
   400          *
       
   401          * The media info object is created to "iInsertingMedia"
       
   402          * member variable.
       
   403          *
       
   404          * @param aFileName  Media file to be checked
       
   405          * @return ETrue if media info object was created
       
   406          *         EFalse otherwise
       
   407          */        
       
   408         TBool CreateMediaInfoForInsertL( const TDesC& aFileName );
       
   409 
       
   410         /**
       
   411          * Checks whether the media object in "iInsertingMedia"
       
   412          * member variable is SuperDistributable or not. If yes
       
   413          * and Full OMA DRM is supported gives "Send without 
       
   414          * rights query".
       
   415          *
       
   416          * Deletes the "iInsertingMedia" variable if query is
       
   417          * not accepted.
       
   418          *
       
   419          * @return ETrue, if it is ok to insert the media
       
   420          *         EFalse, otherwise (iInsertingMedia deleted!)
       
   421          */
       
   422         TBool SuperDistributionCheckForInsertL();
       
   423 
       
   424         /**
       
   425          * Draws navipane at launch time for viewer mode.
       
   426          */
       
   427         void InitViewerNaviPaneL();
       
   428 
       
   429         /**
       
   430          * Draws navipane at launch time for editor mode.
       
   431          */
       
   432         void InitEditorNaviPaneL();
       
   433   
       
   434         /**
       
   435          * Auxiliary function. Shows a infomation note using notewrappers. 
       
   436          *
       
   437          * @param aResourceID
       
   438          * @param aWaiting, is note waiting or not.
       
   439          */  
       
   440         void ShowInformationNoteL(TInt aResourceID, TBool aWaiting );
       
   441 
       
   442         /**
       
   443          * Auxiliary function. Shows an eror note using notewrappers. 
       
   444          *
       
   445          * @param aResourceID
       
   446          * @param aWaiting, is note waiting or not.
       
   447          */  
       
   448         void ShowErrorNoteL(TInt aResourceID, TBool aWaiting );
       
   449 
       
   450         /**
       
   451          * Auxiliary function. 
       
   452          * Shows a confirmation query.
       
   453          *
       
   454          * @param aResourceID
       
   455          * @return the return value returned by CAknQueryDialog::ExecuteLD
       
   456          */  
       
   457         TInt ShowConfirmationQueryL( TInt aResourceID );
       
   458 
       
   459   
       
   460         /**
       
   461          * Shows wait note using CAknWaitDialog.
       
   462          *
       
   463          * @param aResourceID
       
   464          */
       
   465         TBool ShowWaitNoteL( TInt aResourceId );
       
   466         
       
   467         /**
       
   468          * Remove wait note from screen.
       
   469          */
       
   470         void RemoveWaitNote();
       
   471 
       
   472         /** 
       
   473          * Handles text addition to model when needed, updates size
       
   474          * when addreses or bodytext edited.
       
   475          */        
       
   476         void HandleCharInputL();
       
   477 
       
   478    
       
   479         /**
       
   480          * Check if message is forwarded.
       
   481          *
       
   482          * @return ETrue, if is forward.
       
   483          */
       
   484         TBool IsForward() const;
       
   485 
       
   486         /**
       
   487          * Message size according to TS 23.140 v5.5.0
       
   488          *
       
   489          * @return size in bytes
       
   490          */
       
   491         TInt MessageSizeInBytes();
       
   492 
       
   493         /**
       
   494          * Handles selection key press.
       
   495          */
       
   496         void DoSelectionKeyL();
       
   497 
       
   498         /**
       
   499          *
       
   500          */
       
   501         void FinalizeLaunchL();
       
   502         
       
   503         /**
       
   504          *  
       
   505          */
       
   506         TBool ShowLaunchErrorsL( TInt aError );
       
   507 
       
   508         /**
       
   509          * Sets an error resource id to be handled later
       
   510          * (usually after LaunchViewL).
       
   511          *
       
   512          * @param aStoreId   IN/OUT  The correct id is stored here
       
   513          * @param aNewId     IN      Error id
       
   514          */
       
   515         void SetErrorResource( TInt& aStoreId, TInt aNewId );
       
   516         
       
   517  
       
   518         /**
       
   519          * Determines error "priority"
       
   520          */
       
   521         TInt ErrorPriority( TInt aErrorId );
       
   522 
       
   523 
       
   524         /**
       
   525          * Checks if phone is in offline mode or not
       
   526          *
       
   527          * @return ETrue if phone is in offline mode
       
   528          *         Otherwise EFalse.
       
   529          */
       
   530         TBool IsPhoneOfflineL() const;
       
   531 
       
   532         /**
       
   533          * Checks whether there's enough disk space
       
   534          * to save the message.
       
   535          *
       
   536          * @return ETrue if there is enough disk space.
       
   537          *         Otherwise EFalse.
       
   538          */
       
   539         TBool CanSaveMessageL() const;
       
   540         
       
   541         /**
       
   542          * Handles user add recipient command. 
       
   543          */        
       
   544         void DoUserAddRecipientL();
       
   545         
       
   546         /**
       
   547          * Set sender to "from" -field in viewer.
       
   548          */        
       
   549         void SetSenderL();
       
   550 
       
   551         /**
       
   552          * Set sender to "subject" -field in viewer.
       
   553          */        
       
   554         void SetSubjectL();
       
   555         
       
   556         /**
       
   557          * Set recipient(s) to "to" -field in viewer.
       
   558          */        
       
   559         void InsertRecipientL();
       
   560         
       
   561         /**
       
   562          * Implements reply commands.
       
   563          * Launches AMS/SMS/MMS Editor by utilising SendUI.
       
   564          * @param aCase EReplyViaAMS, EReplyViaSMS or EReplyViaMMS
       
   565          */
       
   566         void DoReplyViaL( TInt aCase );
       
   567 
       
   568         void DoDoReplyViaMessageL( );
       
   569 
       
   570 
       
   571         /**
       
   572          * Implements forward command.
       
   573          * Launches MMS Editor for replying/forwarding.
       
   574          */
       
   575         void DoForwardL();
       
   576 
       
   577         /** 
       
   578          * Launches help application
       
   579          */
       
   580         void LaunchHelpL();
       
   581 
       
   582         /** 
       
   583          * Gets help context
       
   584          */
       
   585         CArrayFix<TCoeHelpContext>* HelpContextL() const;          
       
   586 
       
   587         /**
       
   588          * Converts number-strings to/from arabic-indic <-> western 
       
   589          * NOTE : Leaves string to CleanupStack
       
   590          * @param aOrigNumber contains the number to be converted
       
   591          * @param aDirection EFalse -> western, ETrue -> arabic-indic if needed
       
   592          * @return HBufC* buffer contains converted string
       
   593          */
       
   594         HBufC* NumberConversionLC( const TDesC& aOrigNumber, TBool aDirection );
       
   595 
       
   596        	/**
       
   597          * Calls mms mtm ui to launch delivery status dialog after user has choosed
       
   598          * EMmsViewerDeliveryStatus from the options menu.
       
   599          */
       
   600         void OpenDeliveryPopupL( );
       
   601         
       
   602         /**
       
   603          * Implements the move command.
       
   604          * Shows a folder selection dialog
       
   605          * (CMsgFolderSelectionDialog), moves the message
       
   606          * entry into selected folder and exits the viewer.
       
   607          */
       
   608         void DoMoveMessageL();
       
   609         
       
   610         /**
       
   611          * Returns the control id of the currently focused control.
       
   612          * @return Control id of the focused control or
       
   613          *         EMsgComponentIdNull if no control focused
       
   614          */
       
   615         TInt FocusedControlId();
       
   616 
       
   617         /**
       
   618          *  Active scheduler start for saving
       
   619          */
       
   620         void BeginActiveWait();
       
   621 
       
   622         /**
       
   623          *  Active scheduler stop for saving
       
   624          */
       
   625         void EndActiveWait();
       
   626   
       
   627         /**
       
   628          * Creates tabgroup, puts inbox arrows and possible 
       
   629          * priority flags
       
   630          * @param aText string in the navipane
       
   631          *        
       
   632          */       
       
   633 #ifndef RD_MSG_NAVIPANE_IMPROVEMENT        
       
   634         void CreateTabGroupL( const TDesC& aText );   
       
   635 #endif   //!RD_MSG_NAVIPANE_IMPROVEMENT 
       
   636         /**
       
   637          * Checks silent mode.
       
   638          * @return ETrue if handset is silent.
       
   639          */
       
   640         TBool IsSilentModeL();
       
   641 
       
   642         /**
       
   643          * Updates navipane content.
       
   644          */
       
   645   		void UpdateViewerNaviFieldL( );
       
   646   		
       
   647   		/**
       
   648          * Updates navipane content.
       
   649          * @param EAmsOnlyLength=0,EAmsTextEditorAndLength,
       
   650 	     *        EAmsMsgArrows
       
   651          */
       
   652   		void UpdateEditorNaviFieldL( TAmsNaviType aNaviType);
       
   653 
       
   654 
       
   655         /** 
       
   656          * Makes to- field check
       
   657          * @param aModified
       
   658          * @return ETrue if to-fiels is valid, EFalse otherwise
       
   659          */        
       
   660 	   	TBool CheckNamesL( TBool& aModified );
       
   661 	   
       
   662 	   	/**
       
   663          * Shows address info (error) note
       
   664          *
       
   665          * @param aAddress
       
   666          * @param aAlias
       
   667          */
       
   668         void ShowAddressInfoNoteL( const TDesC& aAddress, const TDesC& aAlias );
       
   669         
       
   670                 /**
       
   671         * Handles resource change events.
       
   672         */
       
   673         void HandleResourceChangeL(TInt aType);
       
   674         
       
   675         void SetTitleIconL();
       
   676         void SetTitleIconSize();
       
   677   	protected:
       
   678 	    /**
       
   679 	     * Deletes current entry and then exits.
       
   680 	     */
       
   681 	    void DeleteAndExitL();
       
   682 	
       
   683 	    /**
       
   684 	     * Deletes current entry.
       
   685 	     */
       
   686 	    void DeleteCurrentEntryL();
       
   687 	    
       
   688 	    /**
       
   689 	    * Verifies addresses in address control.
       
   690 	     *
       
   691 	     * @return ETrue, if verify successful,
       
   692 	     *         EFalse otherwise
       
   693 	     */        
       
   694 	    TBool VerifyAddressesL( TBool& aModified );
       
   695 
       
   696     private:
       
   697          
       
   698         /**
       
   699 	     * real command handling
       
   700 	     */ 
       
   701         void DoHandleCommandL(TInt aCommand);
       
   702         
       
   703     	/**
       
   704          * Handles user insert audio command. Creates atta and draws audio 
       
   705          * (indicator) to display.
       
   706          *
       
   707          * @param aStatus, 	EAudioInsert =0,EAudioInserted	
       
   708          */        
       
   709     	void SetAudioClipIconL( TAmsRecordIconStatus aStatus );
       
   710 
       
   711 	    /**
       
   712 	     * Saves messages audioclip to user selected folder
       
   713 	     */
       
   714 		void SaveAudioClipL();
       
   715 
       
   716 	    /**
       
   717 	     * Call FetchFileL with right parameter
       
   718          * @param aNew, ETrue for recording a new audio clip,
       
   719          *              EFalse for fetching an existing one.
       
   720 	     */        
       
   721 	    void InsertAudioL( TBool aNew );
       
   722         void DoInsertAudioL( TFileName &aCmdFileName );
       
   723         
       
   724         /** 
       
   725          * Accessor
       
   726          * Returns To field control 
       
   727          * @return Pointer to To control or
       
   728          *         NULL if To control does not exist
       
   729          */
       
   730         CMsgAddressControl* ToCtrl() const;
       
   731          
       
   732         /** 
       
   733          * Get pointer to From ctrl instance
       
   734          *
       
   735          * @return Pointer to from control or
       
   736          *         NULL if from control does not exist
       
   737          */
       
   738         CMsgAddressControl* FromCtrl() const; 
       
   739 		
       
   740 		void SetNaviPaneL();
       
   741 		
       
   742 		void DoEditAmsPriorityL( );
       
   743 		
       
   744         CAknIconArray* RadioButtonArrayL( );
       
   745         
       
   746         void UpdateIndicatorIcons( TMmsMessagePriority aPriority );
       
   747         
       
   748         TBool UnsupportedCallTypeOngoing( /*TBool aShowNote*/ );
       
   749 		
       
   750 		TBool CheckIncomingCall(  );
       
   751 		
       
   752 		TBool DoEnterKeyL();
       
   753 		// Inline functions:
       
   754  
       
   755         /** 
       
   756          * Get pointer to Subject ctrl instance
       
   757          *
       
   758          * @return Pointer to subject control or
       
   759          *         NULL if subject control does not exist
       
   760          */
       
   761         inline CMsgExpandableControl* SubjectCtrl() const;
       
   762    
       
   763         /** 
       
   764          * Get pointer to body control
       
   765          *
       
   766          * @return Pointer to body control or
       
   767          *         NULL if body control does not exist
       
   768          */
       
   769         inline CMsgBodyControl* BodyCtrl() const;
       
   770         
       
   771         /** 
       
   772          * Get pointer to document instance
       
   773          *
       
   774          * @return Pointer to AudioMessageDocument
       
   775          */
       
   776         inline CAudioMessageDocument* Document() const;
       
   777 
       
   778         /**
       
   779          * Check if message header is empty
       
   780          *
       
   781          * @return ETrue, to field is empty,
       
   782          *         EFalse, to field has text
       
   783          */        
       
   784         inline TBool IsHeaderEmpty() const;
       
   785 
       
   786         /**
       
   787          * Check if message body is empty
       
   788          *
       
   789          * @return ETrue, message body empty,
       
   790          *         EFalse, message body not empty
       
   791          */        
       
   792         inline TBool IsBodyEmpty() const;
       
   793 
       
   794         /**
       
   795          * Get reference to file session
       
   796          *
       
   797          * @return Reference to file session
       
   798          */        
       
   799         inline RFs& FsSession() const;
       
   800 
       
   801         /**
       
   802          * Get senders type
       
   803          *
       
   804          * @return ESenderTypePhoneNumber, ESenderTypeMailAddress,
       
   805          *          ESenderTypeNone
       
   806 		 */
       
   807 		inline TAmsSenderType SenderType();
       
   808         
       
   809         /**
       
   810         * Sends read report, if message if new and launch was complete.
       
   811         */
       
   812         void SendReadReportL( TAmsOperationEvent aEvent );
       
   813         
       
   814         /*
       
   815         *  Handles zoom change
       
   816         */
       
   817         void DoHandleLocalZoomChangeL( TInt aCommand );
       
   818         
       
   819 #ifdef RD_SCALABLE_UI_V2
       
   820         /**
       
   821          * From MAknToolbarObserver
       
   822          * Should be used to set the properties of some toolbar components 
       
   823          * before it is drawn.
       
   824          * @param aResourceId The resource ID for particular toolbar
       
   825          * @param aToolbar The toolbar object pointer
       
   826          */
       
   827         virtual void DynInitToolbarL(   TInt            aResourceId, 
       
   828                                         CAknToolbar*    aToolbar );
       
   829         
       
   830         /**
       
   831          * From MAknToolbarObserver
       
   832          * Handles toolbar events for a certain toolbar item.
       
   833          * @param aCommand The command ID of some toolbar item.
       
   834          */
       
   835         virtual void OfferToolbarEventL( TInt aCommand );
       
   836 #endif
       
   837 
       
   838 #ifdef RD_SCALABLE_UI_V2
       
   839         /**
       
   840         * Sets tool bar item visibilities
       
   841         * @return TBool
       
   842         */        
       
   843         void SetViewerToolBarItemVisibilities();
       
   844         
       
   845          /**
       
   846         * Sets tool bar item visibilities
       
   847         * @return TBool
       
   848         */        
       
   849         void SetEditorToolBarItemVisibilities();
       
   850         
       
   851         /**
       
   852         * Returns ETrue if the message is self composed and
       
   853         * EFalse otherwise (a received message).
       
   854         * @return ETrue if message is self composed,
       
   855         *         EFalse otherwise (received)
       
   856         */  
       
   857         TBool IsOwnMessage( ) const;
       
   858         
       
   859         TBool HasSender( ) const;
       
   860         
       
   861         void SetFixedToolbarL( const TInt aResId );
       
   862         
       
   863 #endif
       
   864        
       
   865 
       
   866     private:     // Data
       
   867    		/**
       
   868    		* For absorbing keypresses
       
   869    		* Own.  
       
   870    		*/
       
   871         CAknInputBlock* iAbsorber;
       
   872         
       
   873         /**
       
   874    		* For delayed exit
       
   875    		* Own.  
       
   876 		*/
       
   877 		CPeriodic* iIdle;
       
   878         CMmsClientMtm* iMtm;  
       
   879         CAknWaitDialog* iWaitDialog;
       
   880         TInt iWaitResId;
       
   881    	  	/**
       
   882      	* Titlepane
       
   883      	* Own.  
       
   884 		*/
       
   885         CAknTitlePane* iTitlePane;
       
   886         CRepository* iSettingsRepository;
       
   887         CRepository* iAudioMesseageRepository;
       
   888         TUint32 iEditorFlags;
       
   889         TInt iSupportedFeatures;
       
   890         
       
   891         /**
       
   892    		* For inserting voice
       
   893    		* Own.  
       
   894 		*/
       
   895         CAudioMessageInsertOperation* iInsertOperation;
       
   896 
       
   897         /**
       
   898      	* For launching
       
   899      	* Own.  
       
   900 		*/
       
   901         CAudioMessageLaunchOperation* iLaunchOperation;
       
   902 
       
   903         /**
       
   904      	* For saving message
       
   905      	* Own.  
       
   906 		*/
       
   907         CAudioMessageSaveOperation* iSaveOperation;
       
   908 
       
   909         /**
       
   910      	* For sending message
       
   911      	* Own.  
       
   912 		*/
       
   913         CAudioMessageSendOperation* iSendOperation;
       
   914 
       
   915         CMsgMediaInfo* iInsertingMedia;
       
   916 
       
   917         CFindItemMenu* iFindItemMenu;
       
   918 
       
   919         CActiveSchedulerWait iWait;
       
   920        	CAudioMessageProgressDialog* iProgressDlg;
       
   921 
       
   922         CUniAddressHandler* iAddressHandler;
       
   923         CAknLocalScreenClearer*    iScreenClearer;
       
   924         
       
   925         TAmsSenderType iSenderType;
       
   926         HBufC* iAlias;
       
   927         CAknNavigationControlContainer* iNaviPane;
       
   928 		TInt iNaviFlags;
       
   929  
       
   930 		CAknIndicatorContainer* iNavi_length;
       
   931 #ifndef RD_MSG_NAVIPANE_IMPROVEMENT        
       
   932         CAknNavigationDecorator* iNavi_next_prev_msg_arrows; 
       
   933 #endif        
       
   934         CAknNavigationDecorator* iIhfVolumeControl;
       
   935         CAknNavigationDecorator* iHeadsetVolumeControl;
       
   936         CAknNavigationDecorator* iActiveVolumeControl;		
       
   937 		TInt iCurrentVolume;
       
   938         CCenRepNotifyHandler* iNotifyHandler;
       
   939         CRepository* iCUiRepository;
       
   940         TInt iMyWgId; // Window group id for AudioMessage
       
   941         TInt iFSWindowGroupId;// Window group id for FastSwapWindow
       
   942         TInt iAknNfySrvUi;
       
   943         TInt iSysWgId;
       
   944         TInt32 iVoiceKeyHandle; // Voice key capture handle, must be released
       
   945 		TBool iSpeakerEarpiece;
       
   946 		TBool iInserting;
       
   947         CMsgVoIPExtension* iMsgVoIPExtension;      
       
   948       	HBufC* iTimeDuratBase;
       
   949       	HBufC* iClipFileName;
       
   950         /// Sends read report
       
   951         CAudioMessageSendReadReportOperation* iSendReadReportOperation;
       
   952         TInt iCurrentSkResId;
       
   953         
       
   954         CGulIcon* iAppIcon;
       
   955         
       
   956 #ifdef RD_SCALABLE_UI_V2
       
   957         CAknToolbar*                iToolbar;
       
   958 #endif
       
   959     };
       
   960     
       
   961 #include "audiomessageappui.inl"
       
   962 
       
   963 #endif      //  _AUDIOMESSAGEAPPUI_H
       
   964