voicerecorder/RecViewSrc/TVRState.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 a data container for a single RecView visual (UI) state
       
    16 *     It is able to read its parameters from a resource file.
       
    17 *     The run-time size of a single TVRState instance is 152 bytes
       
    18 *     (unicode build)
       
    19 *
       
    20 */
       
    21 
       
    22 
       
    23 #ifndef __TVRSTATE_H__
       
    24 #define __TVRSTATE_H__
       
    25 
       
    26 // INCLUDES
       
    27 #include <e32def.h>
       
    28 #include "voicerecorder.hrh"
       
    29 
       
    30 // CONSTANTS
       
    31 const TInt KVRMaxButtons( 5 );	// defined by UI spec
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 class TResourceReader;
       
    35 
       
    36 // CLASS DEFINITION
       
    37 /**
       
    38 * This class is a data container for a single Voice Recorder visual (UI) state
       
    39 * It is able to read its parameters from a resource file.
       
    40 * The run-time size of a single TVRState instance is 152 bytes (unicode build)
       
    41 */
       
    42 class TVRState
       
    43 	{
       
    44 	private: // nested classes
       
    45 
       
    46 		// CLASS DEFINITION
       
    47 		/**
       
    48 		* This class is a data container for a single CVRButtonPanel button
       
    49 		* defeinition. It is able to read its parameters from a resource file.
       
    50 		* The run-time size of a single TButton instance is 12 bytes.
       
    51 		*/
       
    52 		class TButton
       
    53 			{
       
    54 			public: // new methods
       
    55 
       
    56 				/**
       
    57 				* Constructs this button from a VR_BUTTON resource
       
    58 				* @param aReader A resource reader object initialised
       
    59 				*		 to a resource.
       
    60 				*/
       
    61 				void ReadFromResource( TResourceReader& aReader );
       
    62 
       
    63 			public: // data
       
    64 
       
    65 				/**
       
    66 				* The command id of this button (for HandleCommandL use).
       
    67 				*/
       
    68 				TUint iCommandId;
       
    69 
       
    70 				/**
       
    71 				* The visual state of this button
       
    72 				* (see TVRButtonStates in VoiceRecorder.hrh)
       
    73 				*/ 
       
    74 				TUint8 iState;
       
    75 
       
    76 			};
       
    77 
       
    78 	public: // new methods
       
    79 
       
    80 		/**
       
    81 		* Constructs this state from a VR_STATE resource
       
    82 		* @param aReader A resource reader object initialised to a resource.
       
    83 		*/
       
    84 		void ReadFromResource( TResourceReader& aReader );
       
    85 
       
    86 		/**
       
    87 		* Returns the state of a button.
       
    88 		* @param aButtonId Identifies a button in iButtons array;
       
    89 		* @return The current state of this button. See TButton.
       
    90 		*/
       
    91 		TUint ButtonState( TInt aButtonId ) const;
       
    92 
       
    93 		/**
       
    94 		* Returns the command id of a button.
       
    95 		* @param aButtonId Identifies a button in iButtons array;
       
    96 		* @return The command id of this button. See TButton.
       
    97 		*/
       
    98 		TUint ButtonCommandId( TInt aButtonId ) const;
       
    99 
       
   100 	public: // data
       
   101 		
       
   102 		/**
       
   103 		* An unique identifier for this visual state.
       
   104 		*/	
       
   105 		TUint iStateId;
       
   106 		
       
   107 		/**
       
   108 		* An unique identifier for this state.
       
   109 		*/
       
   110 		TUint iId;
       
   111 
       
   112 		/**
       
   113 		* Identifies the menu bar resource for this state (or null).
       
   114 		*/
       
   115 		TUint iMenubarResourceId;
       
   116 
       
   117 		/**
       
   118 		* Identifies the softkey resource for this state (or null).
       
   119 		*/
       
   120 		TUint iCbaResourceId;
       
   121 
       
   122 		/**
       
   123 		* Identifies the button that should gain initial focus.
       
   124 		*/
       
   125 		TUint8 iFocusButtonId;
       
   126 
       
   127 		/**
       
   128 		* Nonzero if this state should have a volume control.
       
   129 		*/
       
   130 		TUint8 iHasVolumeControl;
       
   131 
       
   132 		/**
       
   133 		* Nonzero if this state should have a progress bar.
       
   134 		*/
       
   135 		TUint8 iHasProgressBar;
       
   136 
       
   137 		/**
       
   138 		* Identifies the set of labels for this state.
       
   139 		*/
       
   140 		TUint8 iLabelSetId;
       
   141 
       
   142 		/**
       
   143 		* The number of buttons in this state.
       
   144 		*/
       
   145 		TInt iButtonCount;
       
   146 
       
   147 		/**
       
   148 		* Status text for this state (or KNullDesc).
       
   149 		*/
       
   150 		TBuf< VRLABELMAXLENGTH > iStatus;
       
   151 
       
   152 	private: // data
       
   153 
       
   154 		/**
       
   155 		* An array of buttons in this state.
       
   156 		* The run-time size of iButtons is 60 bytes.
       
   157 		*/
       
   158 		TButton iButtons[ KVRMaxButtons ];
       
   159 
       
   160 	};
       
   161 
       
   162 #endif	// __TVRSTATE_H__