voicerecorder/RecViewSrc/CVRRecViewModel.h
branchRCL_3
changeset 20 072a5fa0c63b
parent 19 2f5c9ee7098c
child 21 c6bafb5162d8
equal deleted inserted replaced
19:2f5c9ee7098c 20:072a5fa0c63b
     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 *     This class is the data model and state machine of the Recorder View.
       
    16 *     The state machine is defined by a VR_STATEMACHINE resource structure.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef __CVRRECVIEWMODEL_H__
       
    22 #define __CVRRECVIEWMODEL_H__
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32base.h>
       
    26 #include <e32std.h>
       
    27 #include <e32property.h> 
       
    28 #include <AknNotifyStd.h>
       
    29 #include <badesca.h>
       
    30 
       
    31 #include "MVRIHFObserver.h"
       
    32 #include "MVRKeyObserver.h"
       
    33 #include "MVRDecoratorModel.h"
       
    34 #include "MVRButtonPanelModel.h"
       
    35 #include "MVRStateInfoModel.h"
       
    36 #include "MVRObserver.h"
       
    37 #include "MVRSelectionProvider.h"
       
    38 #include "MVRVolumeChangeObserver.h"
       
    39 
       
    40 #include "MVRSystemEventObserver.h"
       
    41 #include "MVRMediaRemovalObserver.h"
       
    42 
       
    43 
       
    44 #include "TVRContext.h"
       
    45 #include "voicerecorder.hrh"
       
    46 
       
    47 #include "MVRStateInfoObserver.h"
       
    48 
       
    49 // FORWARD DECLARATIONS
       
    50 class CAknGlobalNote;
       
    51 class CSendUi;
       
    52 class MVRMdaRecorder;
       
    53 class CVRMemo;
       
    54 class MVRObserver;
       
    55 class TResourceReader;
       
    56 class TVRState;
       
    57 class CVRSystemEventHandler;
       
    58 class CVRMediaRemovalMonitor;
       
    59 
       
    60 
       
    61 // CLASS DEFINITION
       
    62 /**
       
    63 * This class is the data model and state machine of the Recorder View.
       
    64 * The state machine is defined by a VR_STATEMACHINE resource structure.
       
    65 */
       
    66 NONSHARABLE_CLASS( CVRRecViewModel ): 
       
    67 	  public CBase,
       
    68 	  public MVRDecoratorModel, public MVRButtonPanelModel,
       
    69 	  public MVRStateInfoModel, public MVRObserver,
       
    70 	  public MVRKeyObserver, public MVRVolumeChangeObserver,
       
    71       public MVRSystemEventObserver,
       
    72       public MVRMediaRemovalObserver      
       
    73 	{
       
    74 	private:	// nested classes
       
    75 
       
    76 		class TVRLabelLayoutLink
       
    77 			{
       
    78 			public:
       
    79 				/**
       
    80 				* Constructs this object from a VR_LABEL_LINK resource
       
    81 				* @param aReader A resource reader object initialised
       
    82 				*		 to a resource.
       
    83 				*/
       
    84 				void ReadFromResource( TResourceReader& aReader );
       
    85 			public:
       
    86 
       
    87 				// Link to the latin layout
       
    88 				TInt iEuroId;
       
    89 				
       
    90 				// Link to the APAC layout
       
    91 				TInt iApacId;
       
    92 				
       
    93 				// Link to the A/H layout
       
    94 				TInt iArabicHebrewId;
       
    95 			};
       
    96 		
       
    97 	public: // Constructors and destructor
       
    98 
       
    99 		/**
       
   100 		* Default constructor.
       
   101 		*/
       
   102 		CVRRecViewModel();
       
   103 
       
   104 		/**
       
   105 		* Destructor
       
   106 		*/
       
   107 		~CVRRecViewModel();
       
   108 
       
   109 		/**
       
   110 		* Constructs the model from a VR_STATEMACHINE resource.
       
   111 		* @param aReader A resource reader object initialised to a resource.
       
   112 		*/
       
   113 		void ConstructFromResourceL( TResourceReader& aReader );
       
   114 
       
   115 	public: // from MVRKeyObserver
       
   116 
       
   117 		/**
       
   118 		* This function is called when a subject wants to report a key event.
       
   119 		* @param aKeyEvent The key event.
       
   120 		* @param aType The type of key event: EEventKey, EEventKeyUp
       
   121 		*              or EEventKeyDown
       
   122 		* @return Indicates whether or not the key event was used.
       
   123 		*/
       
   124 		TBool ProcessKeyEventL( const TKeyEvent& aKeyEvent,
       
   125 								const TEventCode aType );
       
   126 
       
   127 	public: // from MVRDecoratorModel
       
   128 
       
   129 		/**
       
   130 		* Returns the resource id for current softkeys
       
   131 		* @return Softkey resource identifier
       
   132 		*/
       
   133 		TInt CbaResourceId() const;
       
   134 
       
   135 		/**
       
   136 		* Returns the resource id for current menu bar
       
   137 		* @return Menu bar resource identifier.
       
   138 		*/
       
   139 		TInt MenuBarResourceId() const;
       
   140 
       
   141 		/**
       
   142 		* Used to get the state of the volume control component.
       
   143 		*/
       
   144 		void GetVolumeControlState( TVRVolumeControlState& aState,
       
   145 											TInt& aVolume );
       
   146 
       
   147 		/**
       
   148 		* Specifies the current help context.
       
   149 		* @param aContext the context IDs are placed here
       
   150 		*/
       
   151 		void GetHelpContext( TCoeHelpContext& aContext ) const;
       
   152 
       
   153 
       
   154 		/**
       
   155 		* Registers an observer for receiving
       
   156 		* update notifications from this interface.
       
   157 		* @param aObserver The observer object.
       
   158 		*/
       
   159 		void SetDecoratorObserver( MVRObserver* aObserver );
       
   160 		
       
   161 		/**
       
   162 		* Tells in return value if CBA Buttons should be enabled or not
       
   163 		* @return ETrue if buttons should be enabled, EFalse otherwise
       
   164 		*/
       
   165 		TBool CBAEnabled() const;
       
   166 		
       
   167 	public: // from MVRButtonPanelModel
       
   168 
       
   169 		/**
       
   170 		* Returns the number of buttons.
       
   171 		* @return number of buttons (>=0)
       
   172 		*/
       
   173 		TInt ButtonCount() const;
       
   174 
       
   175 		/**
       
   176 		* Returns the state of a specific button.
       
   177 		* @param aButtonId Button identifier
       
   178 		* @return ENormal or EDimmed
       
   179 		*/
       
   180 		TInt ButtonState( TInt aButtonId ) const;
       
   181 
       
   182 		/**
       
   183 		* Returns the command id of a specific button.
       
   184 		* @param aButtonId Button identifier
       
   185 		* @return One of TVRCommands
       
   186 		*/
       
   187 		TInt CommandId( TInt aButtonId ) const;
       
   188 
       
   189 		/**
       
   190 		* Returns the id of the button that should have initial focus.
       
   191 		* @return Button identifier
       
   192 		*/
       
   193 		TInt InitialFocusButtonId() const;
       
   194 
       
   195 		/**
       
   196 		* Registers an observer for receiving
       
   197 		* update notifications from this interface.
       
   198 		* @param aObserver The observer object.
       
   199 		*/
       
   200 		void SetButtonPanelObserver( MVRObserver* aObserver );
       
   201 
       
   202 		/**
       
   203 		* Checks if button panel model needs to reset the focus
       
   204 		* for example after a state change
       
   205 		* @return Is reset needed
       
   206 		*/		
       
   207 		TBool ResetNeeded();
       
   208 		
       
   209 		/**
       
   210 		* Returns an ID of the current visual state.
       
   211 		* @returns Visual state Id.
       
   212 		*/
       
   213 		TUint VisualStateId() const;
       
   214 		
       
   215         /**
       
   216 		* Checks if there is a call incoming at the moment
       
   217 		* @return ETrue if call incoming, EFalse otherwise
       
   218 		*/
       
   219         TBool IncomingCall() const;	
       
   220 
       
   221 		/**
       
   222 		* Checks if model is in a state where it can take and handle
       
   223 		* new commands
       
   224 		* @return Can model handle new commands
       
   225 		*/
       
   226 		TBool CanHandleCommands() const;
       
   227 
       
   228 	public: // from MVRStateInfoModel
       
   229 
       
   230 		/**
       
   231 		* Returns the length of the current memo
       
   232 		* @return The duration in microseconds.
       
   233 		*/
       
   234 		TTimeIntervalMicroSeconds Duration() const;
       
   235 
       
   236 		/**
       
   237 		* Returns the playing or recording position of the current memo.
       
   238 		* @return The position in microseconds.
       
   239 		*/
       
   240 		TTimeIntervalMicroSeconds Position() const;
       
   241 
       
   242 		/**
       
   243 		* Returns the text content for a label.
       
   244 		* @param aName Returned text is placed in this descriptor
       
   245 		* @param aLabelIndex Label identifier (>=0)
       
   246 		*/
       
   247 		void GetLabel( TDes& aName, TInt aLabelIndex ) const;
       
   248 
       
   249 		/**
       
   250 		* Returns the resource id for a label.
       
   251 		* @param aLabelIndex Label identifier (>=0)
       
   252 		* @return The resource id for the specified label
       
   253 		*/
       
   254 		TInt ResourceIdForLabel( TInt aLabelIndex, TAknLayoutId aLayout ) const;
       
   255 
       
   256 		/**
       
   257 		* Registers an observer for receiving
       
   258 		* update notifications from this interface.
       
   259 		* @param aObserver The observer object.
       
   260 		*/
       
   261 		void SetStateInfoObserver( MVRObserver* aObserver );
       
   262 		
       
   263 		/**
       
   264 		* Determines if model has a progress bar
       
   265 		* @return ETrue, if model has a progress bar, otherwise EFalse
       
   266 		*/
       
   267 		TBool HasProgressBar() const;
       
   268 		
       
   269 		/**
       
   270 		* Determines if model has a volume control in this state
       
   271 		* @return ETrue, if model has a volume control, otherwise EFalse
       
   272 		*/
       
   273 		TBool HasVolumeControl() const;
       
   274 		
       
   275 		/**
       
   276 		* Registers an observer to communicate about the changes in InfoPanel. 
       
   277 		* @param aObserver The observer object.
       
   278 		*/
       
   279 		void SetStateInfoPanelObserver( MVRStateInfoObserver* aObserver );
       
   280 
       
   281 	public: // from MVRObserver
       
   282 
       
   283 		/**
       
   284 		* Called to notify a change in the observed subject's state.
       
   285 		*/
       
   286 		void Update( TVRUpdateCommand aCommand );
       
   287 
       
   288 	public: // from MVRSelectionProvider
       
   289 
       
   290 		/**
       
   291 		* Returns the current memo name in an array
       
   292 		* Ownership is transferred. Caller must destroy the returned array.
       
   293 		* @return The array containing 0 or 1 names.
       
   294 		*/
       
   295 		MDesCArray* GetSelectedFilesLC() const;
       
   296 
       
   297 	public: // from MVRVolumeChangeObserver
       
   298 
       
   299 		/**
       
   300 		* Called to notify a change in volume settings.
       
   301 		* @param aStep Volume level in steps
       
   302 		* @param aMaxSteps How many steps there are (10 usually).
       
   303 		*/
       
   304 		void SetVolume( TInt aStep, TInt aMaxSteps );
       
   305 
       
   306 		/***
       
   307 		* Indicates if volume can be set, because rinto tone
       
   308 		* volume change has no effect if the tone is playing.
       
   309 		*/
       
   310 		TBool CanSetVolume();
       
   311 
       
   312 	public: // CVRSystemEventObserver
       
   313 	
       
   314 		void HandleSystemEventL();
       
   315 
       
   316 		void HandleMMCEjectEventL();
       
   317 		
       
   318 	public: // new methods
       
   319 
       
   320 		/**
       
   321 		* Handles a option menu / command button / softkey command.
       
   322 		* @param aCommandId Command identifier, one of TVRCommands
       
   323 		*/
       
   324 		void HandleCommandL( TInt aCommandId );
       
   325 		
       
   326 		/**
       
   327 		* Returns iInRecording flag
       
   328 		* @return True or False
       
   329 		*/
       
   330         TBool GetInRecordingFlag();
       
   331         
       
   332        /**
       
   333 		* set iInRecording flag
       
   334 		* 
       
   335 		*/
       
   336         void SetInRecordingFlag(TBool);
       
   337 
       
   338 
       
   339 		/**
       
   340 		* Check if stop has been called before
       
   341 		* @return True or False
       
   342 		*/
       
   343         TBool GetIfStopCalled();
       
   344 
       
   345 
       
   346 		/**
       
   347 		* Enters a new state machine context.
       
   348 		* Executes the initial state transition defined by the context.
       
   349 		* @param aContext Identifies the new context.
       
   350 		*/
       
   351 		void EnterContextL( const TVRRecViewContexts& aContext );
       
   352 
       
   353 		/**
       
   354 		* Leaves the current state machine context.
       
   355 		*/
       
   356 		void LeaveContext();
       
   357 
       
   358 		/**
       
   359 		* Sets the memo name. Forwards the call to CVRMemo.
       
   360 		* @param aFilename The new file name
       
   361 		*/
       
   362 		void SetMemoName( const TDesC& aFilename );
       
   363 
       
   364 		/**
       
   365 		* Sets the memo name to a new, unique, one.
       
   366 		* Forwards the call to CVRMemo.
       
   367 		*/
       
   368 		void SetMemoNameNewL( TBool aEmbedded = EFalse );
       
   369 
       
   370 		/**
       
   371 		* Sets the path to directory where memos will be saved.
       
   372 		* Forwards the call to CVRMemo.
       
   373 		*/
       
   374 		void SetSavingLocationL( const TDesC& aPath );
       
   375 
       
   376 		/**
       
   377 		* Returns the complete file name (path and everything).
       
   378 		* @return Reference to the memo name.
       
   379 		*/
       
   380 		const TDesC& Filename() const;
       
   381 
       
   382 		/**
       
   383 		* Returns embedding status.
       
   384 		* @param ETrue if the current context is an embedded one.
       
   385 		*/
       
   386 		TBool IsEmbedded() const;
       
   387 
       
   388 		/**
       
   389 		* Indicates if we are in a state that can accept
       
   390 		* more commands (i.e. all async calls have completed).
       
   391 		* @return ETrue if it's ok to proceed calling methods.
       
   392 		*/
       
   393 		TBool CanAcceptCommands() const;
       
   394 
       
   395 		/**
       
   396 		* Sends the current memo via MMS/Infra/Bluetooth/Email
       
   397 		* @param aSendUi The CSendUi object used for sending
       
   398 		*/
       
   399 		void SendViaL( CSendUi* aSendUi );
       
   400 
       
   401 		/**
       
   402 		* Activates the recorder view model
       
   403 		*/
       
   404 		void ActivateL();
       
   405 
       
   406 		/**
       
   407 		* Deactivates the recorder view model
       
   408 		*/
       
   409 		void Deactivate();
       
   410 
       
   411         /**
       
   412         * Sets the file handle to record into
       
   413         */
       
   414         void SetFileHandle( RFile& aFile );
       
   415 
       
   416         /**
       
   417         * Returns the active file handle of CVRMemo object
       
   418         */
       
   419         RFile& MemoFileHandle();
       
   420         
       
   421         /**
       
   422         * Enables or disables the Volume Control drawing in current
       
   423         * visual state
       
   424         * @param aVolumeControl ETrue if Volume Control should be enabled
       
   425         * 						EFalse if disabled 
       
   426         */
       
   427         void EnableVolumeControl( TBool aVolumeControl );
       
   428         
       
   429         /**
       
   430 		* Returns the active quality setting.
       
   431 		* @return Quality setting of the active memo
       
   432 		*/
       
   433 		TVRQuality Quality() const;
       
   434 		
       
   435         /**
       
   436          * Send exit event to UI
       
   437          */
       
   438         void SendExitEvent();
       
   439         
       
   440         /**
       
   441         * Set the value of iIsDriveReady.
       
   442         * @param The new value of iIsDriveReady.
       
   443         */
       
   444         void SetIsDriveReady(TBool aIsDriveReady);
       
   445                 
       
   446         /**
       
   447         * Get the value of iIsDriveReady.
       
   448         * @return The value of iIsDriveReady.
       
   449         */
       
   450         TBool GetIsDriveReady();
       
   451 
       
   452 	private: // new methods
       
   453 
       
   454 		/**
       
   455 		* Enters a new state.
       
   456 		* Executes a function identified by the state transition.
       
   457 		* Notifies all registered observers.
       
   458 		* @param aNewState identifies the new state.
       
   459 		* @param aForce force change state (even if new is same as old)
       
   460 		*/
       
   461 		void ChangeState( TUint aNewState, TBool aForced = EFalse );
       
   462 
       
   463 		/**
       
   464 		* Retrieves transition information to the given transition object.
       
   465 		* @param aTransition Transition to be filled in.
       
   466 		* @param aCommandId The command that triggered this transition.
       
   467 		*/
       
   468 		void GetTransition( TVRContext::TTransition& aTransition,
       
   469 							TUint aCommandId ) const;
       
   470 
       
   471 		/**
       
   472 		* Retrieves transition information to the given transition object.
       
   473 		* This is used the retrieve the initial transition of a state.
       
   474 		* @param aTransition Transition to be filled in.
       
   475 		*/
       
   476 		void GetTransition( TVRContext::TTransition& aTransition ) const;
       
   477 
       
   478 		/**
       
   479 		* Calls the specified function.
       
   480 		* @param aFunctionId Function identifier (TVRFunctions)
       
   481 		* @return EFalse if the function want's to cancel the state change
       
   482 		*/
       
   483 		TBool CallFunctionByIdL( TInt aFunctionId );
       
   484 
       
   485 		/**
       
   486 		* Returns the text content for a label.
       
   487 		* This is a leaving variant of GetLabel(). It is called by
       
   488 		* GetLabel() inside a TRAP.
       
   489 		* @param aName Returned text is placed in this descriptor
       
   490 		* @param aLabelIndex Label identifier (>=0)
       
   491 		*/
       
   492 		void GetLabelL( TDes& aName, TInt aLabelIndex ) const;
       
   493 
       
   494 		/**
       
   495 		* Stops recording and saves the memo.
       
   496 		* The specified note text is displayed while saving.
       
   497 		* @param aResourceId  Identifies the note text.
       
   498 		*/
       
   499 		void StopAndSaveL( TInt aResourceId );
       
   500 
       
   501 		/**
       
   502 		* Stops recording and saves the memo.
       
   503 		* The specified note text is displayed while saving.
       
   504 		* Leaves the memo detached so that application can be closed.
       
   505 		* @param aResourceId  Identifies the note text.
       
   506 		*/
       
   507 		void StopAndCloseL( TInt aResourceId );
       
   508 
       
   509 		/**
       
   510 		* Shows a global note.
       
   511 		* @param aResourceId Identifies the note text.
       
   512 		* @param aNoteType Identifies the note type.
       
   513 		*/
       
   514 		void ShowNoteL( TInt aResourceId, TAknGlobalNoteType aNoteType );
       
   515 
       
   516 		/**
       
   517 		* Loads the volume settings (IHF & ear piece) from VoiceRecorder.ini
       
   518 		*/
       
   519 		void LoadVolumeSettingsL();
       
   520 
       
   521 		/**
       
   522 		* Saves the volume settings (IHF & ear piece) to VoiceRecorder.ini
       
   523 		* Note: This method is non-leaving and ignores all errors, because
       
   524 		* it's called inside the destructor. LoadVolumeSettingsL() has
       
   525 		* sanity checking so the situation isn't fatal if the saving fails.
       
   526 		*/
       
   527 		void SaveVolumeSettings();
       
   528 
       
   529 		/**
       
   530 		* Sets IHF on/off, if the phone is not in voice on alerting state
       
   531 		* @param aIhf ETrue == set IHF on, EFalse == set IHF off
       
   532 		*/
       
   533 		void SetIHFIfCallNotActive( TBool aIhf );
       
   534 
       
   535 		/*
       
   536 		* Checks if the current default speaker is loudspeaker or earpiece
       
   537 		*/
       
   538 		void CheckIhfState();
       
   539 
       
   540 		/**
       
   541 		* Sets the volume on the media server client object according
       
   542 		* to the current active IHF setting.
       
   543 		*/
       
   544 		void SetRecorderVolume();
       
   545 
       
   546 		/**
       
   547 		* Reads the default speaker setting and sets iIhfState accordingly
       
   548 		*/
       
   549 		void ReadDefaultSpeakerL();
       
   550 
       
   551 		/*
       
   552 		* Handles error in Update method.
       
   553 		* @param aErr Id of the error
       
   554 		*/
       
   555 		void HandleUpdateErrorL( TInt aErr );
       
   556 
       
   557 		/*
       
   558 		* Formats time to R_QTN_TIME_DURAT_LONG or 
       
   559 		* R_QTN_TIME_DURAT_MIN_SEC_WITH_ZERO depending of time value
       
   560 		* @param aTime Time that is formatted
       
   561 		* @param aString Buffer that holds the formatted time
       
   562 		*/
       
   563 		void FormatTimeL( const TTime& aTime, TDes& aString ) const;
       
   564 		
       
   565 		/*
       
   566 		* Generates an array of services that should be dimmed from the 
       
   567 		* options menu "Send" selection list
       
   568 		* @return A pointer to an array that consists of the service Uids 
       
   569 		* 		that should be dimmed
       
   570 		*/
       
   571 		CArrayFixFlat<TUid>* SendViaServicesToDimLC();
       
   572 
       
   573 	private: // data
       
   574 
       
   575 		/**
       
   576 		* The state machine structure.
       
   577 		*/
       
   578 		TVRContext iContexts[ ENumContexts ];
       
   579 
       
   580 		/**
       
   581 		* The current context.
       
   582 		*/
       
   583 		TVRRecViewContexts iContext;
       
   584 
       
   585 		/**
       
   586 		* Pointer to the current state. Contained in iContexts.
       
   587 		*/
       
   588 		TVRState* iState;
       
   589 
       
   590 		/**
       
   591 		* Pointer to the voice memo object. Owned
       
   592 		*/
       
   593 		CVRMemo* iMemo;
       
   594 
       
   595 		/**
       
   596 		* Pointer to the recorder object. Owned
       
   597 		*/
       
   598 		MVRMdaRecorder* iRecorder;
       
   599 
       
   600 		/**
       
   601 		* Pointer to a global information note object. Owned
       
   602 		*/
       
   603 		CAknGlobalNote* iGlobalNote;
       
   604 
       
   605 		/**
       
   606 		* Pointer to an array of UI states. Owned
       
   607 		*/
       
   608 		CArrayFixSeg< TVRState > iStateArray;
       
   609 
       
   610 		/**
       
   611 		* Pointer to an array of label sets. Owned.
       
   612 		*/
       
   613 		CArrayPtrSeg< CDesCArray > iLabelSets;
       
   614 
       
   615 		/**
       
   616 		* Pointer to an array of label resource ids. Owned.
       
   617 		*/
       
   618 		TVRLabelLayoutLink* iLabelLayoutLinks;
       
   619 
       
   620 		/**
       
   621 		* Pointer to the button panel observer. Not owned.
       
   622 		*/
       
   623 		MVRObserver* iButtonPanelObserver;
       
   624 
       
   625 		/**
       
   626 		* Pointer to the decorator observer. Not owned.
       
   627 		*/
       
   628 		MVRObserver* iDecoratorObserver;
       
   629 
       
   630 		/**
       
   631 		* Pointer to the state info observer. Not owned.
       
   632 		*/
       
   633 		MVRObserver* iStateInfoObserver;
       
   634 
       
   635 		/**
       
   636 		* Format string placeholder.
       
   637 		* R_QTN_DATE_USUAL_WITH_ZERO is loaded to it in construction.
       
   638 		*/
       
   639 		TBuf< VRLABELMAXLENGTH > iDateUsualWithZero;
       
   640 
       
   641 		/**
       
   642 		* Format string placeholder.
       
   643 		* R_QTN_TIME_USUAL_WITH_ZERO is loaded to it in construction.
       
   644 		*/
       
   645 		TBuf< VRLABELMAXLENGTH > iTimeUsualWithZero;
       
   646 
       
   647 		/**
       
   648 		* Format string placeholder.
       
   649 		* R_QTN_TIME_DURAT_MIN_SEC_WITH_ZERO is loaded to it in construction.
       
   650 		*/
       
   651 		TBuf< VRLABELMAXLENGTH > iTimeDuratMinSecWithZero;
       
   652 		
       
   653 		/**
       
   654 		* Format string placeholder.
       
   655 		* R_QTN_TIME_DURAT_LONG is loaded to it in construction.
       
   656 		*/		
       
   657 		TBuf< VRLABELMAXLENGTH > iTimeDuratLong;
       
   658 
       
   659 		/**
       
   660 		* ETrue if the model has succesfully entered a context.
       
   661 		*/
       
   662 		TBool iContextEntered;
       
   663 
       
   664 		/**
       
   665 		* For listening call events. Owned.
       
   666 		*/
       
   667 		CVRSystemEventHandler* iCurrentCallHandler;
       
   668 
       
   669 		CVRMediaRemovalMonitor* iCurrentMMCEjectHandler;
       
   670 
       
   671 
       
   672 		/**
       
   673 		* Current logical state (i.e. what the user sees, not the actual
       
   674 		* state of the HW) of the IHF
       
   675 		*/
       
   676 		TBool iIhfState;
       
   677 
       
   678 		/**
       
   679 		* Prefered volume of the IHF
       
   680 		*/
       
   681 		TInt iIhfVolume;
       
   682 
       
   683 		/**
       
   684 		* Used to tell the IHF change event listener, that the next IHF
       
   685 		* change is not made with voice key and is to be ignored
       
   686 		*/
       
   687 		TBool iIgnoreNextIhfChange;
       
   688 
       
   689 		/**
       
   690 		* Indicates if the view is actually active, so that the model
       
   691 		* knows when to ignore IHF change events
       
   692 		*/
       
   693 		TBool iActive;
       
   694 
       
   695 		/**
       
   696 		* Default speaker when playing
       
   697 		*/
       
   698 		TVRSpeaker iDefaultSpeaker;
       
   699 
       
   700 		/**
       
   701 		* Indicates if End key is pressed so view deactivation can trigger 
       
   702 		* right operation ( paused memo is saved as well )
       
   703 		*/
       
   704 		TBool iIsEndKey;
       
   705 
       
   706 		/*
       
   707 		* Id for canceling waitnote
       
   708 		*/
       
   709 		TInt iNoteId;
       
   710 
       
   711 		/*
       
   712 		*
       
   713 		*/
       
   714 		TBool iIsNoteLaunched;
       
   715 
       
   716 		/**
       
   717 		* Default audio format for recording audio clip
       
   718 		*/
       
   719 		TInt iVRAudioFormat;
       
   720 
       
   721 		/**
       
   722 		* Allow In-call recording functionality
       
   723 		*/
       
   724 		TInt iVRAllowInCallRecording;
       
   725 
       
   726 
       
   727 		/**
       
   728 		* The call state retrieved on previous notification
       
   729 		*/
       
   730 		TInt iPreviousCallState;
       
   731 		
       
   732 		/**
       
   733 		* Should the button panel reset itself on update
       
   734 		*/
       
   735 		TBool iResetButtons;
       
   736 		
       
   737 		/**
       
   738 		* If model can handle commands. i.e. no critical command handling
       
   739 		* just ongoing, e.g. waiting start tone play before starting
       
   740 		* recording
       
   741 		*/
       
   742 		TBool iCanHandleCommands;
       
   743 		
       
   744 		/**
       
   745 		* Pointer to the state info panel observer. Not owned.
       
   746 		*/
       
   747 		MVRStateInfoObserver* iStateInfoPanelObserver;
       
   748 		
       
   749 		/**
       
   750 		* State of the CBA buttons. If EFalse LSK/RSK deliver ECmdNOP which
       
   751 		* causes no action.
       
   752 		*/
       
   753 		TBool iCBAEnabled;
       
   754 		
       
   755 	    /**
       
   756 	     * To judge whether the current drive is ready for recording
       
   757 	     */
       
   758 	    TBool iIsDriveReady;
       
   759 	};
       
   760 
       
   761 #endif // __CVRRECVIEWMODEL_H__