mobilemessaging/mmsui/viewerinc/UniMmsViewerAppUi.h
changeset 0 72b543305e3a
child 2 0bf1d54f37d9
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2002-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:  
       
    15 *     CMmsViewerAppUi class definition.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef MMSVIEWERAPPUI_H
       
    22 #define MMSVIEWERAPPUI_H
       
    23 
       
    24 // INCLUDES
       
    25 #include <finditemengine.h>
       
    26 
       
    27 #ifdef RD_SCALABLE_UI_V2
       
    28 #include <akntoolbarobserver.h>
       
    29 #endif
       
    30 
       
    31 #include <MuiuMessageIterator.h>
       
    32 
       
    33 #include <MsgEditorAppUi.h>             // CMsgEditorAppUi
       
    34 
       
    35 #include <cenrepnotifyhandler.h>
       
    36 #include <DRMCommon.h>
       
    37 
       
    38 #include <msgasynccontrolobserver.h>    //MMsgMediaControlObserver
       
    39 #include <uniobject.h>
       
    40 #include <unidrminfo.h>                 // CUniDrmInfo
       
    41 #include <AknNaviDecoratorObserver.h>
       
    42 
       
    43 #include "MmsViewer.hrh"                // enumerations
       
    44 #include "MmsViewerOperation.h"
       
    45 #include "UniMmsSvkEvents.h"               // MMmsSvkEventsObserver
       
    46 
       
    47 // FUNCTION PROTOTYPES
       
    48 GLREF_C void Panic( TMmsViewerExceptions aPanic ); 
       
    49 
       
    50 // FORWARD DECLARATIONS
       
    51 #ifndef RD_MSG_NAVIPANE_IMPROVEMENT
       
    52 class CAknNavigationDecorator;
       
    53 #endif
       
    54 class CAknNavigationControlContainer;
       
    55 class CAknTitlePane;
       
    56 class CAknWaitDialog;
       
    57 class CMdaAudioPlayerUtility;
       
    58 class MVideoControlStateObserver;
       
    59 class CFindItemMenu;
       
    60 class CFindItemEngine;
       
    61 class CDocumentHandler;
       
    62 class CDRMRights;
       
    63 
       
    64 class CAknLocalScreenClearer;
       
    65 class CMmsViewerLaunchOperation;
       
    66 class CMmsViewerChangeSlideOperation;
       
    67 class CMmsViewerHeader;
       
    68 class CMmsViewerSendReadReportOperation;
       
    69 
       
    70 class CMsgMediaInfo;
       
    71 class CMsgMediaControl;
       
    72 class CMsgAudioControl;
       
    73 class CMsgVideoControl;
       
    74 class CMsgImageControl;
       
    75 #ifdef RD_SVGT_IN_MESSAGING
       
    76 class CMsgSvgControl;
       
    77 #endif
       
    78 class CMmsConformance;
       
    79 class CUniSlideLoader;
       
    80 class CUniSmilModel;
       
    81 class CUniObjectList;
       
    82 
       
    83 class CRepository;
       
    84 class CSendingServiceInfo;
       
    85 class CMsgVoIPExtension;
       
    86 class CAknInputBlock;
       
    87 class CPeriodic;
       
    88 class CAknVolumeControl;
       
    89 class CAknInputBlock;
       
    90 class CAknToolbar;
       
    91 
       
    92 // CLASS DECLARATION
       
    93 
       
    94 /**
       
    95 *  CMmsViewerAppUi
       
    96 *  Inherited from CMsgEditorAppUi
       
    97 */
       
    98 class CMmsViewerAppUi :
       
    99     public CMsgEditorAppUi,
       
   100     public MCenRepNotifyHandlerCallback,
       
   101     public MMsgAsyncControlObserver,
       
   102     public MMmsViewerOperationObserver,     // ViewerOperationEvent
       
   103     public MMmsSvkEventsObserver,           // MmsSvkChangeVolumeL
       
   104     public MAknServerAppExitObserver,       // for image viewer
       
   105 #ifdef RD_SCALABLE_UI_V2
       
   106 #ifndef RD_MSG_NAVIPANE_IMPROVEMENT
       
   107     public MAknNaviDecoratorObserver,       //for navidecorator
       
   108 #endif
       
   109     public MAknToolbarObserver,             //toolbar
       
   110 #endif
       
   111     public MCoeControlObserver,              // of CAknVolumeControl
       
   112     public MUniObjectObserver
       
   113     {
       
   114     public:  // Constructors and destructor
       
   115         
       
   116         /**
       
   117         * C++ default constructor.
       
   118         */
       
   119         CMmsViewerAppUi();
       
   120 
       
   121         /**
       
   122         * Destructor.
       
   123         */
       
   124         virtual ~CMmsViewerAppUi();
       
   125         
       
   126     protected: 
       
   127     
       
   128         /**
       
   129          * Prepare to exit.
       
   130          * from CEikAppUi
       
   131          */
       
   132         void PrepareToExit();
       
   133 
       
   134     private: // New functions        
       
   135         
       
   136         /**
       
   137         * Calls InitNavipaneL, PrepareHeaderL and PrepareBodyL
       
   138         * and does some validity checks.
       
   139         */
       
   140         void DrawSlideL();
       
   141         
       
   142         /**
       
   143         * Set waiting note.
       
   144         */
       
   145         void SetPendingNote(    TInt                aResourceId, 
       
   146                                 CUniObject*         aObject = NULL,
       
   147                                 TInt                aError = KErrNone );
       
   148 
       
   149         /**
       
   150         * Shows notes related to message opening, 
       
   151         * which could not shown until loading was complete
       
   152         */
       
   153         void ShowPendingNoteL();
       
   154 
       
   155         /**
       
   156         * Changes slide. Calls ResetViewL and DrawSlideL. Creates
       
   157         * a screen blanker to hide the view operations from the user.
       
   158         * @param aSlideNumber The number of the slide to be shown next.
       
   159         * @param aScreenClearer Screen clearer is run
       
   160         */
       
   161         void ChangeSlideL( TInt aSlideNumber, TBool aScreenClearer );
       
   162 
       
   163         /**
       
   164         * Initializes navipane according to message content
       
   165         */
       
   166         void InitNavipaneL();
       
   167         
       
   168         /**
       
   169         * Sub function for InitNavipaneL();
       
   170         * @param aText string in the right hand side of navipane
       
   171         */
       
   172 #ifndef RD_MSG_NAVIPANE_IMPROVEMENT
       
   173         void CreateTabGroupL( const TDesC& aText );
       
   174 #endif 
       
   175         /**
       
   176         * Resets the message view. This function is called
       
   177         * when moving from slide to slide.
       
   178         * @param TBool ETrue -> only body reseted
       
   179         *              EFalse -> body and header reseted
       
   180         */
       
   181         void ResetViewL();
       
   182 
       
   183 
       
   184         // Command functions
       
   185         
       
   186         /**
       
   187         * Implements reply commands.
       
   188         * Launches MMS Editor for replying/forwarding.
       
   189         * @param aCase either EReplyToSender or EReplyToAll
       
   190         */
       
   191         void DoReplyL( TInt aCase );
       
   192 
       
   193         /**
       
   194         * Implements forward command.
       
   195         * Launches MMS Editor for replying/forwarding.
       
   196         */
       
   197         void DoForwardL();
       
   198 
       
   199         TBool CanForwardL( TInt& aResourceId );
       
   200         TBool CanForwardObjectsL( TInt& aResourceId );
       
   201         void CanForwardObjectsInListL( 
       
   202                                         CUniObjectList* aObjectList, 
       
   203                                         TInt& aSdCount, 
       
   204                                         TInt& aFlCount, 
       
   205                                         TInt& aNonConfCount, 
       
   206                                         TInt& aNormalCount,
       
   207                                         TInt& aResourceId ) const;
       
   208 
       
   209         /**
       
   210         * Implements reply via SMS/Audio message command.
       
   211         * Launches SMS/Audio message/Email Editor by utilising SendUI.
       
   212         * @param aCase EMmsViewerReplyViaAudio or EMmsViewerReplyViaMail
       
   213         */
       
   214         void DoReplyViaL( TInt aCase);
       
   215 
       
   216         /**
       
   217         * Implements the view image command.
       
   218         * Launches PhotoAlbum's ImageViewer.
       
   219         */
       
   220         void DoViewImageL();
       
   221 
       
   222         /**
       
   223         * Implements the objects command.
       
   224         * Opens the Objects view where the user can access
       
   225         * individual media elements in a list format.
       
   226         */
       
   227         void DoObjectsL();
       
   228 
       
   229         /**
       
   230         * Implements the move command.
       
   231         * Shows a folder selection dialog
       
   232         * (CMsgFolderSelectionDialog), moves the message
       
   233         * entry into selected folder and exits the viewer.
       
   234         */
       
   235         void DoMoveMessageL();
       
   236         
       
   237         /**
       
   238         * Implements the "Send" key functionality.
       
   239         * Uses MsvUiServiceUtilities::CallServiceL to create a call.
       
   240         */
       
   241         void DoHandleSendKeyL();
       
   242         
       
   243         /**
       
   244         * Implements the message info command.
       
   245         * Opens message info dialog provided by MMS ui mtm.
       
   246         */
       
   247         void DoMessageInfoL();
       
   248         
       
   249         /**
       
   250         * Start SMIL presentation
       
   251         */
       
   252         void DoShowPresentationL();
       
   253 
       
   254         /**
       
   255         * Implements the delete command.
       
   256         * Shows a confirmation query, deletes the message
       
   257         * entry and exits the viewer.
       
   258         */
       
   259         void DoDeleteAndExitL();
       
   260 
       
   261         /**
       
   262         * Sets qtn_drm_preview_msg into waiting queue ( SetPendingNote() ),
       
   263         * if needed.
       
   264         */ 
       
   265         void ResolveDrmWaitingNotes();
       
   266         
       
   267         //Audio related functions:
       
   268         //
       
   269         
       
   270         /**
       
   271         * Cancels the automatic play of an audio (or a video)
       
   272         * file.
       
   273         */
       
   274         void CancelAutoplay();
       
   275                   
       
   276         /**
       
   277         * State of an control on the UI has changed
       
   278         * @param aControl control
       
   279         * @param aState new state
       
   280         * @param aState previous state
       
   281         */
       
   282         void MsgAsyncControlStateChanged(   
       
   283                                     CMsgBaseControl& aControl,
       
   284                                     TMsgAsyncControlState aNewState,
       
   285                                     TMsgAsyncControlState aOldState );
       
   286         void DoMsgMediaControlStateChangedL(   
       
   287                                     CMsgMediaControl& aControl,
       
   288                                     TMsgAsyncControlState aNewState,
       
   289                                     TMsgAsyncControlState aOldState );
       
   290         
       
   291         /**
       
   292         * Asynchronous control on the UI has received resource change event.
       
   293         *
       
   294         * @param aControl control
       
   295         * @param aType event type
       
   296         */
       
   297         void MsgAsyncControlResourceChanged( CMsgBaseControl& aControl, TInt aType );
       
   298         
       
   299         void DoVideoStateChangeL( TInt aState );
       
   300         void DoAudioStateChangeL( TInt aState );
       
   301 
       
   302         /**
       
   303         * Handles the actual navipane and softkey updating according
       
   304         * to the state of audio playback. This function does not set 
       
   305         * volume control visible, it is done using ShowVolumeL( ).
       
   306         * When playing starts empties the navi pane.
       
   307         * Hides the volume control when playing stops.
       
   308         */
       
   309         void UpdatePanesL( TBool aAudioPlaying, TBool aVideoPlaying );
       
   310 
       
   311         /**
       
   312         * From MCenRepNotifyHandlerCallback
       
   313         */
       
   314         void HandleNotifyInt(TUint32 aId, TInt aNewValue);
       
   315         void HandleNotifyError(TUint32 aId, TInt error, CCenRepNotifyHandler* aHandler);
       
   316         void HandleNotifyGeneric(TUint32 aId);
       
   317 
       
   318         /**
       
   319         * From MMessageIteratorObserver. 
       
   320         * @param See documentation of MMessateIteratorObserver
       
   321         */
       
   322 #ifndef RD_MSG_NAVIPANE_IMPROVEMENT
       
   323         void HandleIteratorEventL(TMessageIteratorEvent aEvent);
       
   324 #endif        
       
   325         /**
       
   326         * Returns ETrue if the message is self composed and
       
   327         * EFalse otherwise (a received message).
       
   328         * @return ETrue if message is self composed,
       
   329         *         EFalse otherwise (received)
       
   330         */
       
   331         TBool IsOwnMessage() const;
       
   332                 
       
   333         /**
       
   334         * Returns ETrue if the message has a sender, EFalse
       
   335         * otherwise (either self composed message or received
       
   336         * from a secret number).
       
   337         * @return ETrue if message has sender
       
   338         *         EFalse otherwise
       
   339         */
       
   340         TBool HasSender() const;
       
   341         
       
   342         /**
       
   343         * Checks whether Reply->To all should be shown.
       
   344         * For received messages checks that there is more
       
   345         * than one recipient. For sent messages checks that
       
   346         * there is at least one recipient.
       
   347         * @return ETrue if Reply->To all should be shown
       
   348         *         EFalse otherwise
       
   349         */
       
   350         TBool ShowReplyToAll() const;
       
   351 
       
   352         /**
       
   353         * Checks whether Reply menu should be shown at all.
       
   354         * @return ETrue if Reply menu should be shown
       
   355         *         EFalse otherwise
       
   356         */
       
   357         TBool ShowReplyMenu() const;
       
   358         
       
   359         // Notes:
       
   360 
       
   361         /**
       
   362         * Show an information note
       
   363         * @param aResourceId The resource if of the note to be shown
       
   364         */
       
   365         void ShowInformationNoteL( TInt aResourceId );
       
   366         
       
   367         /**
       
   368         * Show an information note
       
   369         * @param aResourceId The resource if of the note to be shown
       
   370         */
       
   371         void ShowErrorNoteL( TInt aResourceId );
       
   372         
       
   373         /**
       
   374         * Show a confirmation query
       
   375         * @param aResourceId The resource if of the query to be shown
       
   376         */
       
   377         TInt ShowConfirmationQueryL( TInt aResourceId ) const;
       
   378 
       
   379         TInt ShowConfirmationQueryL(   TInt            aResourceId,
       
   380                                         const TDesC&    aString) const;
       
   381 
       
   382         /**
       
   383         * Auxiliary function. Shows a confirmation query if it is not shown before. 
       
   384         *
       
   385         * @param aResourceID
       
   386         * @return the return value returned by CAknQueryDialog::ExecuteLD
       
   387         */  
       
   388         TInt ShowGuidedModeConfirmationQueryL( TInt aResourceID );
       
   389 
       
   390         /**
       
   391         * Shows "Out of disk" error note if disk space would
       
   392         * go below critical level when allocating aSize
       
   393         * @param aSize Bytes wanted to allocate
       
   394         * @return ETrue if below critical after allocation
       
   395         *         EFalse if allocation OK
       
   396         */
       
   397         TBool ShowOutOfDiskNoteIfBelowCriticalLevelL( TInt aSize );
       
   398 
       
   399         /**
       
   400         * Return a pointer to document-object
       
   401         * @return CMmsViewerDocument*
       
   402         */        
       
   403         CMmsViewerDocument* Document() const;
       
   404 
       
   405         /**
       
   406         * Shows any DRM related notes that are related to
       
   407         * message opening:
       
   408         * - "No rights" query
       
   409         * - "Expired rights" query
       
   410         * - "Preview rights" note
       
   411         */
       
   412         void ResolveDRMNotesL();
       
   413 
       
   414         /**
       
   415         * Returns the control id of the currently focused control.
       
   416         * @return Control id of the focused control or
       
   417         *         EMsgComponentIdNull if no control focused
       
   418         */
       
   419         TInt FocusedControlId();
       
   420 
       
   421         /**
       
   422         * Sets automatic highlighting on/off.
       
   423         * @param aEnable if ETrue sets automatic highlighting on,
       
   424         *                if EFalse sets automatic highlighting off
       
   425         */
       
   426         void SetFindModeL( TBool aEnable );
       
   427 
       
   428  
       
   429         /**
       
   430         * Starts to play/display media including image.
       
   431         * @param aControl control to be played
       
   432         */         
       
   433         void MediaPlayL(CMsgMediaControl* aControl);
       
   434 
       
   435         /**
       
   436         * Handle selection key for media object ( excluding 3gpp presentation )
       
   437         * This function is entered when Options menu->Play is selected.
       
   438         * Resulting action is one of the following: play, embedded play, activate or get rights.
       
   439         * @param aMedia control to be be handled
       
   440         */         
       
   441         void MediaOpenL( CMsgMediaControl* aMedia );
       
   442 
       
   443         /**
       
   444         * Stops playing media. Does not stop animations. 
       
   445         */         
       
   446         void MediaStop();
       
   447 
       
   448         /**
       
   449         * Stops playing single media.
       
   450         * @param aControl control to be played
       
   451         */         
       
   452         void MediaStop(CMsgMediaControl* aControl);
       
   453 
       
   454         /**
       
   455         * Closes every media control. Closing means freeing file
       
   456         * specific resources that other application can use the file.
       
   457         */         
       
   458         void MediaClose();
       
   459 
       
   460         /**
       
   461         * Closes single media.
       
   462         * @param aControl control to be played
       
   463         */         
       
   464         void MediaClose(CMsgMediaControl* aControl);
       
   465 
       
   466         /**
       
   467         * Reloads slide
       
   468         */
       
   469         void ReloadSlideL();
       
   470 
       
   471         /**
       
   472         * Resets every control. Frees all resources
       
   473         */         
       
   474         void MediaReset();
       
   475 
       
   476         /**
       
   477         * Resets single control. Frees all resources
       
   478         */         
       
   479         void MediaReset(CMsgMediaControl* aControl);
       
   480 
       
   481         /**
       
   482         * Checks whether media is initialised and media control can be
       
   483         * selected. 
       
   484         * This function returns ETrue, if media is DRM protected and
       
   485         * no rights exist.
       
   486         */         
       
   487         TBool MediaInitializedL( CMsgMediaControl*   aMedia );
       
   488 
       
   489         /**
       
   490         * Checks whether media can be played or tried to be played.
       
   491         * This function returns EFalse, if media is DRM protected and
       
   492         * no rights exist.
       
   493         */         
       
   494         TBool CMmsViewerAppUi::MediaCanPlay(const CMsgMediaControl* aMedia,
       
   495                                             const CUniObject* aMmsObject ) const;
       
   496 
       
   497 
       
   498         /**
       
   499         * Checks whether media can be stopped or tried to be played
       
   500         */         
       
   501         TBool MediaCanStop(CMsgMediaControl* aMedia);
       
   502 
       
   503         /**
       
   504         * Checks whether media can be paused.
       
   505         * This means also that media is really playing.
       
   506         */         
       
   507         TBool MediaIsRunning(CMsgMediaControl* aMedia);
       
   508 
       
   509         /**
       
   510         * Returns UI control id
       
   511         * @param aControl TMmsContolIds only
       
   512         */         
       
   513         CMsgMediaControl* MediaControlById(TInt aControl);
       
   514 
       
   515         /**
       
   516         * Starts animation
       
   517         */
       
   518         void StartAnimationL();
       
   519         
       
   520         /**
       
   521          * Stops animation
       
   522          */
       
   523         void StopAnimation();
       
   524         
       
   525         /**
       
   526         * Implements saving text or media object into file system from
       
   527         * mms viewer. Saves pure text files directly and otherwise 
       
   528         * for multimedia and xHTML files calls DoSaveObjectL()
       
   529         */
       
   530         void SaveObjectL();
       
   531  
       
   532         /**
       
   533         * Implements multimedia objects and xhtml into file system from
       
   534         * mms viewer.
       
   535         */
       
   536         void DoSaveObjectL(CUniObject& aObject );
       
   537  
       
   538         /**
       
   539         * Shows "Upload" list query and if an item is selected, send the message
       
   540         * as upload.
       
   541         */
       
   542         void UploadL();
       
   543         
       
   544         /** 
       
   545         * From CEikAppUi
       
   546         */
       
   547         void HandleResourceChangeL(TInt aType);
       
   548 
       
   549         /**
       
   550         * Opens image into (embedded) image viewer
       
   551         */
       
   552         void ViewImageL( CMsgMediaControl& aMediaCtrl );
       
   553 
       
   554         /**
       
   555         * Consumes DRM rights, if DRM protected media. If no DRM rights left 
       
   556         * or other error occurs during consuming rights, updates icon
       
   557         * @return   ETrue: media was not DRM protected or DRM rights were 
       
   558         *                   consumed successfully
       
   559         *           EFalse: media was DRM protected and no rights were left 
       
   560         *                   or other error occurred
       
   561         */
       
   562         TBool HandleConsumeRightsL( CMsgMediaControl& aMedia ); 
       
   563 
       
   564 
       
   565         /**
       
   566         * If image has not rights, error note must be shown.
       
   567         * This function handles the situation.
       
   568         */
       
   569         void HandleImageNoRightsInLaunch( );
       
   570 
       
   571 
       
   572     private: // Functions from base classes
       
   573         
       
   574         /**
       
   575         * From MsgEditorAppUi
       
   576         */
       
   577         void DoMsgSaveExitL();
       
   578             
       
   579         /**
       
   580         * From MMsgEditorLauncher.
       
   581         * Part of the function is implemented in the DoFinaliseLaunchViewL()
       
   582         */
       
   583         void LaunchViewL();
       
   584     
       
   585         /**
       
   586         * The actual implementation of LaunchViewL
       
   587         */
       
   588         void DoLaunchViewL();
       
   589 
       
   590         /**
       
   591         * From MMsgEditorObserver
       
   592         * @param See documentation of MMsgEditorObserver
       
   593         */
       
   594         CMsgBaseControl* CreateCustomControlL( TInt aControlType );
       
   595         
       
   596         /**
       
   597         * From MMsgEditorObserver
       
   598         * @param See documentation of MMsgEditorObserver
       
   599         */
       
   600         void EditorObserver(TMsgEditorObserverFunc aFunc, TAny* aArg1, TAny* aArg2, TAny* aArg3);
       
   601 
       
   602         void DoEditorObserverL(TMsgEditorObserverFunc aFunc, TAny* aArg1, TAny* aArg2, TAny* aArg3);
       
   603 
       
   604         /**
       
   605         * From CCoeAppUi
       
   606         * @param See documentation of CCoeAppUi
       
   607         * @return TKeyResponse
       
   608         */
       
   609         TKeyResponse HandleKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
   610 
       
   611         /**
       
   612         * From CCoeAppUi
       
   613         * @param See documentation of CCoeAppUi
       
   614         */
       
   615         void HandleWsEventL(const TWsEvent& aEvent,CCoeControl* aDestination);
       
   616         
       
   617         /**
       
   618         * From CEikAppUi
       
   619         * @param See documentation of CEikAppUi
       
   620         */
       
   621         void HandleCommandL( TInt aCommand );
       
   622 
       
   623         /**
       
   624         * From CAknAppUi
       
   625         * @param See documentation of CAknAppUi
       
   626         */
       
   627         void ProcessCommandL( TInt aCommand );
       
   628 
       
   629         /**
       
   630         * From MEikMenuObserver
       
   631         * @param See documentation of MEikMenuObserver
       
   632         */
       
   633         void DynInitMenuPaneL( TInt aMenuId, CEikMenuPane* aMenuPane );
       
   634 
       
   635         /**
       
   636         * From MAknServerAppExitObserver. Must not leave.
       
   637         * DoHandleServerAppExitL
       
   638         */
       
   639         void HandleServerAppExit(TInt aReason);        
       
   640 
       
   641         /**
       
   642         * From MAknNaviDecoratorObserver
       
   643         * Handles the events coming from arrow presses
       
   644         *  related to next/previous message
       
   645         */
       
   646 #ifdef RD_SCALABLE_UI_V2
       
   647 #ifndef RD_MSG_NAVIPANE_IMPROVEMENT
       
   648         void HandleNaviDecoratorEventL( TInt aEventID );   
       
   649 #endif
       
   650 #endif
       
   651         /**
       
   652         * From CCoeControl
       
   653         * Handles volume changes from volume of navi pane.
       
   654         * When Pen enabled volume can change many steps at one tap.
       
   655         */
       
   656         void HandleControlEventL(CCoeControl* aControl, TCoeEvent aEventType);
       
   657    
       
   658 #ifdef RD_SCALABLE_UI_V2
       
   659         /**
       
   660          * From MAknToolbarObserver
       
   661          * Should be used to set the properties of some toolbar components 
       
   662          * before it is drawn.
       
   663          * @param aResourceId The resource ID for particular toolbar
       
   664          * @param aToolbar The toolbar object pointer
       
   665          */
       
   666         virtual void DynInitToolbarL(   TInt            aResourceId, 
       
   667                                         CAknToolbar*    aToolbar );
       
   668         
       
   669         /**
       
   670          * From MAknToolbarObserver
       
   671          * Handles toolbar events for a certain toolbar item.
       
   672          * @param aCommand The command ID of some toolbar item.
       
   673          */
       
   674         virtual void OfferToolbarEventL( TInt aCommand );
       
   675 #endif
       
   676    
       
   677     private:
       
   678 
       
   679         /**
       
   680         * By default Symbian OS constructor is private.
       
   681         */
       
   682         void ConstructL(); 
       
   683 
       
   684         /** 
       
   685         * Launches help application
       
   686         */
       
   687         void LaunchHelpL();
       
   688 
       
   689         /** 
       
   690         * Gets help context
       
   691         */
       
   692         
       
   693         CArrayFix<TCoeHelpContext>* HelpContextL() const;          
       
   694 
       
   695         void ViewerOperationEvent(  TMmsViewerOperationType     aOperation,
       
   696                                     TMmsViewerOperationEvent    aEvent,
       
   697                                     TInt                        aError );
       
   698         void DoViewerOperationEventL(   TMmsViewerOperationType     aOperation,
       
   699                                         TMmsViewerOperationEvent    aEvent );
       
   700 
       
   701             /// loading slide has completed
       
   702         void DoViewerOperationEventSlideL();
       
   703             /// loading launch has completed
       
   704         void DoViewerOperationEventLaunchL( );
       
   705 
       
   706         TUint32 ObjectsAvailable();
       
   707 
       
   708         void BeginActiveWait( CMmsViewerOperation* aOperation );
       
   709         void EndActiveWait();
       
   710 
       
   711         /**
       
   712         * Launches wait dialog.
       
   713         * @param aParam if slide change operation, this is index of new slide
       
   714         */
       
   715         void LaunchWaitDialogL( TInt aParam = 0 );
       
   716 
       
   717         /**
       
   718         * Executes part of the launching. See LaunchViewL()
       
   719         */
       
   720         void DoFinaliseLaunchViewL();
       
   721 
       
   722         /**
       
   723         * Gets focused CUniObject. 
       
   724         * Object is returned only,if is EMsgImageControlId, EMsgVideoControlId, or EMsgAudioControlId.
       
   725         * iFocusedObjectType is applicable always.
       
   726         * @since 3.0
       
   727         */
       
   728         CUniObject* GetFocusedMmsObject();
       
   729 
       
   730         /**
       
   731         * Checks whether silent ringing type is selected.
       
   732         * @ret ETrue, silence set
       
   733         *      EFalse, silence not set
       
   734         */
       
   735         TBool IsSilenceL();
       
   736         
       
   737         /**
       
   738         * Calls mms mtm ui to launch delivery status dialog after user has choosed EMmsViewerDeliveryStatus from the options menu.
       
   739         *
       
   740         * @since    3.0
       
   741         */
       
   742         void OpenDeliveryPopupL( );
       
   743     
       
   744         void PrintNeededControls( );
       
   745 
       
   746         /*
       
   747         * @return ETrue, editor is properly initialised to receive commands
       
   748         *         EFalse, editor is not yet properly initialised to receive commands
       
   749         */
       
   750         TBool IsLaunched() const;
       
   751 
       
   752         CUniObject* ObjectByMediaControl( CMsgMediaControl& aControl);
       
   753         CUniObject* ObjectByBaseControl( CMsgBaseControl& aControl );
       
   754 
       
   755         /*
       
   756         * Checks whether description exists in the stored message.
       
   757         * If it doesn't exist, description is saved into message store 
       
   758         * from first found. Uses SetAndSaveDescriptionL() 
       
   759         */ 
       
   760         void CheckAndSetDescriptionL();
       
   761         
       
   762         /*
       
   763         * Saves description into received message from
       
   764         * given text object. Existence of description is no more
       
   765         * checked. 
       
   766         * aText text object from which description is saved
       
   767         */ 
       
   768         void SetAndSaveDescriptionL(const CPlainText& aText);
       
   769 
       
   770         /*
       
   771         * Update icon or text of MSK CBA button
       
   772         */ 
       
   773         void UpdateMskL( );
       
   774         
       
   775         void WaitReleaseOfImageL( CUniObject& aObject );
       
   776 
       
   777         /*
       
   778         * Check whether media object is lacking rights.
       
   779         * If media has no rights 
       
   780         * @param aMedia media to check 
       
   781         * @return KErrNone, valid drm rights exits or media is not drm protected
       
   782         *         other value, no drm rights
       
   783         * @since 3.2
       
   784         */ 
       
   785         TInt MediaHasNoDrmRights( CMsgMediaControl* aMedia );
       
   786 
       
   787         /**
       
   788         * Implements HandleCommandL()
       
   789         * @param See documentation of CEikAppUi
       
   790         */
       
   791         void DoHandleCommandL( TInt aCommand );
       
   792 
       
   793         /**
       
   794         * Sends read report if permitted and asked
       
   795         */
       
   796         void SendReadReportL(   TMmsViewerOperationType     aOperation,
       
   797                                 TMmsViewerOperationEvent    aEvent );
       
   798 
       
   799         /**
       
   800         * The function must be called when the volume is changed. 
       
   801         * Any checks are not needed from caller of this function.
       
   802         * This function changes the volume even, if volume control is not visible 
       
   803         * in the navi pane.
       
   804         * If changing volume level makes sense this function
       
   805         * - changes the volume level into cenrep
       
   806         * - show the new volume on the volume control of the navi pane.
       
   807         * ( To check exact conditions when volume control is visible in the navi pane, 
       
   808         * see .cpp file)
       
   809         *         *
       
   810         * This function resolves itself only whether the audio or video is playing.
       
   811         * Then DoChangeVolumeL() is called, if applicable.
       
   812         * After that to show the new volume level in the navi pane ShowVolumeL() is called.
       
   813         *
       
   814         * @param aVolume: indicates either absolute value, if aChange is EFalse
       
   815         *                 or change of volume, if aChange is ETrue.
       
   816         * @param aChange: indicates whether aVolume is absolute value or change of 
       
   817         *                 the current volume.
       
   818         */
       
   819         void ChangeVolumeL( TInt aVolume, TBool aChange );
       
   820 
       
   821         /**
       
   822         * Otherwise like ChangeVolumeL but either audio or video must be playing.
       
   823         * This function saves the new volume level into CenRep, if applicable.
       
   824         * Sets the new level into audio or video player.
       
   825         * ( To check exact conditions when volume control is visible in the navi pane, 
       
   826         * see .cpp file)
       
   827         *
       
   828         * If volume set is set before playback this function can be called as follows
       
   829         * DoChangeVolumeL( 0 , ETrue, * )
       
   830         * @param aVolume: indicates either absolute value, if aChange is Efalse
       
   831         *                 or change of volume, if aChange is Etrue.
       
   832         * @param aChange: indicates whether aVolume is absolute value or change of 
       
   833         *                 the current volume.
       
   834         * @param aAudioPlaying  ETrue audio is playing
       
   835         *                       EFalse video is playing
       
   836         * @return TInt new absolute volume level
       
   837         *              KErrNotFound, if volume level is not known.
       
   838         *              In this case ShowVolumeL should not be called
       
   839         *              
       
   840         */
       
   841         TInt DoChangeVolumeL( TInt aVolume, TBool aChange, TBool aAudioPlaying );
       
   842 
       
   843         /**
       
   844         * Set volume control visible into navi pane, if applicable. 
       
   845         * Either audio or video must be playing.
       
   846         * ( To check exact conditions when volume control is visible in the navi pane, 
       
   847         * see .cpp file)
       
   848         *
       
   849         * @param aNewVolume: new volume level
       
   850         * @param aAudioPlaying  ETrue audio is playing
       
   851         *                       EFalse video is playing
       
   852         */
       
   853         void ShowVolumeL(   TInt  aNewVolume,
       
   854                             TBool aAudioPlaying );
       
   855 
       
   856         /** 
       
   857         * Enables receiving events changes in foreground application status.
       
   858         * Resolves those Window groups id, which do no stop animation, audio or
       
   859         * video playback. The workgroup ids are assigned to member variables */
       
   860         void GetNonStoppingWgIds( );
       
   861 
       
   862         /** 
       
   863         * After receiving event in change of foreground application status,
       
   864         * checks whether new foreground application causes stopping animation,
       
   865         * playback of audio or video.
       
   866         * Result is set to iIsStopPlaybackWgId.
       
   867         */
       
   868         void ResolveCurrentWgIdL( );
       
   869 
       
   870         /**
       
   871         * Activates input blocker properly.
       
   872         *
       
   873         * @param aActiveObjectToCancel Pointer to an active object that is called when 
       
   874         *                              input blocker is cancelled. Can be NULL.
       
   875         */
       
   876         void ActivateInputBlockerL( CActive* aActiveObjectToCancel );
       
   877         
       
   878         /**
       
   879         * Deactivates input blocker properly.
       
   880         */
       
   881         void DeactivateInputBlocker();
       
   882 
       
   883         /**
       
   884         * Resets flags to enter normal operation state e.g. accept commands
       
   885         */
       
   886         void ResetOperationState();
       
   887 
       
   888         /**
       
   889         * Handles delayed (external) exit 
       
   890         * @param aDelayTime in microsecods
       
   891         */        
       
   892         void DoDelayedExit( TInt aDelayTime );
       
   893 
       
   894         /**
       
   895         * To check whether asyncronous controls are ready and wait note dismissed
       
   896         * @return TBool
       
   897         */        
       
   898         TBool AreControlsReadyAndWaitNoteDismissedL( );
       
   899         
       
   900 #ifdef RD_SCALABLE_UI_V2
       
   901         /**
       
   902         * Sets tool bar item visibilities
       
   903         * @return TBool
       
   904         */        
       
   905         void SetToolBarItemVisibilities();
       
   906 #endif
       
   907 
       
   908         /**
       
   909         * Checks whether DRM rights have been consumed
       
   910         * @return TBool
       
   911         */                
       
   912         TBool IsRightsConsumed( CUniObject& aObject ) const;
       
   913 
       
   914         /**
       
   915         * Checks whether objects has drm rights left just now
       
   916         * @return TBool
       
   917         */                
       
   918         TBool IsRightsNow( CUniObject& aObject ) const;
       
   919 
       
   920         /**
       
   921         * Checks whether object has drm rights when downloaded to the current slide
       
   922         * @return TBool
       
   923         */                
       
   924         TBool IsDrmRightsWhenLoaded( CUniObject& aObject ) const;
       
   925 
       
   926         /// MUniObjectObserver
       
   927         void HandleUniObjectEvent(  CUniObject&  aUniObject,
       
   928                                     TUniObjectEvent aUniEvent );
       
   929         void SimulateUniObjectEventL( );
       
   930         /**
       
   931         * Reloads one control without need to reload whole slide.
       
   932         *
       
   933         * @since S60 5.0
       
   934         *
       
   935         * @param aMediaControl Control which needs to be reloaded.
       
   936         * @param aObject Object related to the control
       
   937         */
       
   938         void ReloadControlL( CMsgMediaControl* aControl, CUniObject& aObject );
       
   939 
       
   940         /**
       
   941         * Resolve CUniObject related to media control.
       
   942         *
       
   943         * @since S60 5.0
       
   944         * @param aControl control for which CUniObjects is needed
       
   945         * @return CUniObject related to the given control
       
   946         */
       
   947         CMsgMediaControl* MediaControlByObject( CUniObject&    aUniObject );
       
   948 
       
   949         /**
       
   950         * Sets title of the mms viewer app into status pane
       
   951         */
       
   952         void SetTitleIconL();
       
   953         
       
   954         /**
       
   955         * Check whether video call is active or not
       
   956         */
       
   957         TBool IsVideoCall();
       
   958 
       
   959     private:     // From MMmsSvkEventsObserver
       
   960                 /**
       
   961         * Called when volume level should be changed.
       
   962         * Set volume control visible into navi pane.
       
   963         * This function calls ChangeVolumeL
       
   964         * @param aVolumeChange: +1 change volume up
       
   965         *                       -1 change volume down
       
   966         */
       
   967         void MmsSvkChangeVolumeL( TInt aVolumeChange );
       
   968         
       
   969         /**
       
   970         * Callback for CPeriodic
       
   971         */        
       
   972         static TInt DelayedExitL( TAny* aThis );
       
   973                             
       
   974     private:     // Data
       
   975 
       
   976         enum TMmsViewerFlags
       
   977             {
       
   978             ELaunchSuccessful           = 0x0010,
       
   979 			EPresentationHasAudio       = 0x0020,   
       
   980 			// Two more videos in the same message with smil is now supported 
       
   981 			// ENoPresentationPlaying      = 0x0040,
       
   982             ESuspiciousSmil             = 0x0080,
       
   983             EShowGuidedConf             = 0x0100,
       
   984             EAutohighLightEnabled       = 0x0200,
       
   985             EProhibitNonDrmMusic        = 0x0400,
       
   986             EVideoHasAudio              = 0x0800,
       
   987             EUploadInitialized          = 0x1000,
       
   988             // Character key events are sent to application first, which sets the volume into volume control. 
       
   989             // When touch enabled volume control of navi pane is supported, touch events are sent to volume control first.
       
   990             // And sets its new volume itself. The latter case is indicated by following flag
       
   991             EVolumeControlTriggered     = 0x2000,
       
   992             EViewerExiting              = 0x4000,
       
   993             EInObjectsView              = 0x8000,
       
   994             EInitialFlags = EVideoHasAudio
       
   995             };
       
   996 
       
   997         enum TViewerState
       
   998             {
       
   999             ENormal = 0,
       
  1000             EBusy,
       
  1001             EReseted
       
  1002             };
       
  1003 
       
  1004         enum TReplyForwardCase
       
  1005             {
       
  1006             EReplyToSender,
       
  1007             EReplyToAll
       
  1008             };
       
  1009             
       
  1010             // determines which errors are shown during/after phase completion
       
  1011         enum TOpeningPhase
       
  1012             {
       
  1013             EOpeningNone    = 0,
       
  1014             EOpeningMessage,    
       
  1015             EOpeningSlide
       
  1016 			};
       
  1017 
       
  1018         //Reference pointers:
       
  1019         CUniSmilModel*              iSmilModel;
       
  1020 
       
  1021         CMmsClientMtm*              iMtm;
       
  1022         CAknNavigationControlContainer* iNaviPane;
       
  1023         CEikButtonGroupContainer*   iButtonGroup;
       
  1024 
       
  1025         //Owned pointers:
       
  1026 #ifndef RD_MSG_NAVIPANE_IMPROVEMENT
       
  1027         CAknNavigationDecorator*    iNaviDecorator; // Overrides the variable in base class
       
  1028 #endif
       
  1029         CAknNavigationDecorator*    iVolumeDecorator;
       
  1030 
       
  1031         CUniSlideLoader*            iSlideLoader;
       
  1032         
       
  1033         CMmsViewerHeader*           iHeader;
       
  1034         CMmsViewerLaunchOperation*  iLaunchOperation;
       
  1035         CMmsViewerChangeSlideOperation* iChangeSlideOperation;
       
  1036         CAknLocalScreenClearer*     iScreenClearer;
       
  1037 
       
  1038         CAknWaitDialog*             iWaitDialog;
       
  1039         CUniObject*                 iPendingNoteObject;
       
  1040         TInt                        iPendingNoteError;
       
  1041         TInt                        iPendingNoteResource;
       
  1042         TInt                        iPendingNotePriority;
       
  1043        
       
  1044         CFindItemMenu*              iFindItemMenu;
       
  1045         
       
  1046         CDocumentHandler*           iDocHandler;
       
  1047 
       
  1048         CCenRepNotifyHandler*       iNotifyHandler;
       
  1049         CRepository*                iCUiRepository;
       
  1050         CRepository*                iMmsRepository;
       
  1051 
       
  1052         TInt                        iViewerFlags;
       
  1053         TUint32                     iReleasedObjects;
       
  1054         TViewerState                iViewerState;
       
  1055 
       
  1056 		TInt                        iSupportedFeatures;
       
  1057 
       
  1058         CActiveSchedulerWait        iWait;
       
  1059 
       
  1060         CMsgImageControl*           iImage;
       
  1061             /// if 3gpp presentation, this is not set
       
  1062         CMsgAudioControl*           iAudio;
       
  1063         CMsgVideoControl*           iVideo;
       
  1064 #ifdef RD_SVGT_IN_MESSAGING
       
  1065         CMsgSvgControl*            iSvgt;
       
  1066 #endif        
       
  1067         TInt                        iNewSlide;
       
  1068             /// enum TOpeningPhase
       
  1069         TInt                        iOpeningState;
       
  1070         RPointerArray<CSendingServiceInfo> iUploadServices;
       
  1071         
       
  1072         // Own: Contains information of the VoIP profiles.
       
  1073         CMsgVoIPExtension*          iMmsVoIPExtension;        
       
  1074         // Events from SVK keys 
       
  1075         CMmsSvkEvents*              iSvkEvents;
       
  1076 		CAknInputBlock*				iInputBlocker;
       
  1077         CMmsConformance*            iMmsConformance;
       
  1078         
       
  1079         /// save focused control for restoring the focus later
       
  1080         TInt                        iFocusedControlId;
       
  1081         /// current resource of MSK CBA button
       
  1082         TInt                        iMskId;
       
  1083         CMmsViewerOperation*        iActiveOperation;
       
  1084         CPeriodic*                  iIdle;
       
  1085 
       
  1086         // Pen Support: Target of last pointer event
       
  1087         CMsgBaseControl*            iPointerTarget;
       
  1088 
       
  1089         /** 
       
  1090         * When Objects view is entered, iNoTitlePaneUpdate is set to ETrue.
       
  1091         * If layout change takes place during objects view, title must not 
       
  1092         * be set into title pane. 
       
  1093         */
       
  1094 #ifndef RD_MSG_NAVIPANE_IMPROVEMENT
       
  1095         TBool                       iNoTitlePaneUpdate;
       
  1096 #endif
       
  1097         CGulIcon*                   iTitleIcon;
       
  1098         
       
  1099         // Contains prohibit mime types.
       
  1100         HBufC*                      iProhibitMimeTypeBuffer;
       
  1101         
       
  1102         /// Sends read report
       
  1103         CMmsViewerSendReadReportOperation* iSendReadReportOperation;        
       
  1104 
       
  1105         /** applications, which should not stop playback of animation, audio or video        
       
  1106         * Wg=Window Group
       
  1107         */
       
  1108         TInt                        iFastSwapWgId;   
       
  1109         TInt                        iSysWgId;
       
  1110         TInt                        iAknNotifyServerWgId;
       
  1111         TInt                        iMmsViewerWgId;
       
  1112         TInt                        iScreenSaverWgId;	
       
  1113         // Whether playback needs to be stopped
       
  1114         TBool                       iIsStopPlaybackWgId;
       
  1115         CAknToolbar*                iToolbar;
       
  1116         TInt                        iMaxForwardSlideCount;
       
  1117         CAknTitlePane*              iTitlePane; 
       
  1118         CGulIcon*                   iAppIcon;
       
  1119     };
       
  1120 
       
  1121 #endif      //  MMSVIEWERAPPUI_H
       
  1122 
       
  1123 // End of File