satui/satapp/SATUIInc/CSatUiActionPerformer.h
branchRCL_3
changeset 19 7d48bed6ce0c
parent 18 594d59766373
child 20 987c9837762f
equal deleted inserted replaced
18:594d59766373 19:7d48bed6ce0c
     1 /*
       
     2 * Copyright (c) 2002-2008 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:  This class handles the communication between server and user 
       
    15 *                   interface
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CSATUIACTIONPERFORMER_H
       
    21 #define CSATUIACTIONPERFORMER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <msatuiobserver.h>
       
    25 #include <rsatuisession.h>
       
    26 #include <rsatsession.h>
       
    27 
       
    28 #include <cenrepnotifyhandler.h>
       
    29 
       
    30 // CONSTANTS
       
    31 //256 max length-header information fields
       
    32 const TInt KAdditionalInfoMaxSize = 244;      
       
    33 const TInt KMaxPlayToneLength = 50;
       
    34 
       
    35 enum TIconCommand
       
    36     {
       
    37     EIconSetUpMenuContext = 1,
       
    38     EIconSetUpMenuItems,
       
    39     EIconDisplayText,
       
    40     EIconGetInput,
       
    41     EIconGetInkey,
       
    42     EIconGetYesNo,
       
    43     EIconPlayTone,
       
    44     EIconNotification,
       
    45     EIconConfirmCommand
       
    46     };
       
    47 
       
    48 // FORWARD DECLARATIONS
       
    49 class MSatUiAdapter;
       
    50 class MSatUiActionImplementer;
       
    51 class CPhoneGsmHandlerContainer;
       
    52 class CSatUiSsAdditionalInfoHandler;
       
    53 class CSatUiSsRequestCompleteHandler;
       
    54 class CCenRepNotifyHandler;
       
    55 class CSatUiIconHandler;
       
    56 class CRepository;
       
    57 
       
    58 
       
    59 // CLASS DECLARATION
       
    60 
       
    61 /**
       
    62 *  This class implements the methods specified in the MSatUiObserver.
       
    63 */
       
    64 
       
    65 class CSatUiActionPerformer : public CBase, 
       
    66     public MCenRepNotifyHandlerCallback,
       
    67     public MSatUiObserver
       
    68     {
       
    69     public:  // Constructors and destructor
       
    70 
       
    71         /**
       
    72         * Two-phased constructor.
       
    73         */
       
    74         static CSatUiActionPerformer* NewL();
       
    75 
       
    76         /**
       
    77         * Destructor.
       
    78         */
       
    79         virtual ~CSatUiActionPerformer();
       
    80 
       
    81     public: // New functions
       
    82 
       
    83         /**
       
    84         * Sets the UI.
       
    85         * @param aImplementer Pointer to be set.
       
    86         */
       
    87         void SetImplementer(MSatUiActionImplementer* aImplementer);
       
    88 
       
    89         /**
       
    90         * Returns the adapter provided by SatCli.
       
    91         */
       
    92         MSatUiAdapter* Adapter();
       
    93 
       
    94     public: // Functions from base classes
       
    95 
       
    96          /**
       
    97         * From MSatUiObserver Notification of the SAT Display Text command.
       
    98         * @param aText The text string to be displayed.
       
    99         * @param aSimApplicationName  Sim Application name
       
   100         * @param aIconId The id of icon.
       
   101         * @param aRequestedIconDisplayed Informs if icon is not used.
       
   102         * @param aSustainedText Indicates is this text sustained ie. no timers
       
   103         *        used if ETrue.
       
   104         * @param aDuration Duration for showing the text
       
   105         * @param aWaitUserToClear Indication if user is needed to clear 
       
   106         *        message        
       
   107         * @return The response to this command.
       
   108         */
       
   109         TSatUiResponse DisplayTextL( const TDesC& aText,
       
   110             const TDesC& aSimApplicationName, 
       
   111             const TSatIconId& aIconId,
       
   112             TBool& aRequestedIconDisplayed,
       
   113             const TBool aSustainedText,
       
   114             const TTimeIntervalSeconds aDuration,
       
   115             const TBool aWaitUserToClear );
       
   116 
       
   117         /**
       
   118         * From MSatUiObserver Notification of the SAT Get Inkey command.
       
   119         * @param aText The query text.
       
   120         * @param aCharacterSet The character range allowed.
       
   121         * @param aInput The input character.
       
   122         * @param aHelpIsAvailable A flag indicating  if SAT help is available
       
   123         * @param aIconId The id of icon.
       
   124         * @param aRequestedIconDisplayed Informs if icon is not used.
       
   125         * @param aDuration Duration for showing the dialog.
       
   126         * @param aImmediateDigitResponse Indication if Immediate digit response
       
   127         *        is needed.
       
   128         * @return The response of to this command.
       
   129         */
       
   130         TSatUiResponse GetInkeyL( const TDesC& aText,
       
   131             const TSatCharacterSet aCharacterSet, TChar& aInput,
       
   132             const TBool aHelpIsAvailable,
       
   133             const TSatIconId& aIconId,
       
   134             TBool& aRequestedIconDisplayed,
       
   135             TUint& aDuration,
       
   136             const TBool aImmediateDigitResponse );
       
   137 
       
   138         /**
       
   139         * From MSatUiObserver Notification of the SAT Get Input command.
       
   140         * @param aText The query text.
       
   141         * @param aCharacterSet The character range allowed.
       
   142         * @param aInput The input string.
       
   143         * @param aMinLength The minimum length of the input allowed.
       
   144         * @param aMaxLength The maximum length of the input allowed.
       
   145         * @param aHideInput A flag indicating if the input should be hidden.
       
   146         * @param aHelpIsAvailable A flag indicating if SAT help is available.
       
   147         * @param aIconId The id of icon.
       
   148         * @param aRequestedIconDisplayed Informs if icon is not used.
       
   149         * @return The response to this command.
       
   150         */
       
   151         TSatUiResponse GetInputL( const TDesC& aText, 
       
   152             const TSatCharacterSet aCharacterSet, TDes& aInput,
       
   153             const TInt aMinLength, const TInt aMaxLength, 
       
   154             const TBool aHideInput,
       
   155             const TBool aHelpIsAvailable,
       
   156             const TSatIconId& aIconId,
       
   157             TBool& aRequestedIconDisplayed );
       
   158 
       
   159         /**
       
   160         * From MSatUiObserver Notification of the SAT Set Up Menu command.
       
   161         * @param aText The title text.
       
   162         * @param aMenuItems The array of menu item captions.
       
   163         * @param aMenuItemNextActions The array of menu item next action 
       
   164         * indicator codes.
       
   165         * @param aHelpIsAvailable A flag indicating if SAT help is available.
       
   166         * @param aIconId The id of title icon.
       
   167         * @param aMenuIcons List of icon identifiers for menu items.
       
   168         * @param aIconListQualifier Indicates how to use icons in the icon list.
       
   169         * @param aSelectionPreference Specifies is the soft keys preferred.
       
   170         * @return The response to this command.
       
   171         */
       
   172         TSatUiResponse SetUpMenuL( const TDesC& aText, 
       
   173             const MDesCArray& aMenuItems, 
       
   174             const CArrayFixFlat<TSatAction>* aMenuItemNextActions,
       
   175             const TBool aHelpIsAvailable,
       
   176             const TSatIconId& aIconId,
       
   177             const CArrayFixFlat<TInt>* aMenuIcons,
       
   178             const enum TSatIconQualifier aIconListQualifier,
       
   179             const enum TSatSelectionPreference aSelectionPreference );
       
   180 
       
   181         /**
       
   182         * From MSatUiObserver Notification of the SAT Select Item command.
       
   183         * @param aText The title text.
       
   184         * @param aMenuItems The array of menu item captions.
       
   185         * @param aMenuItemNextActions The array of menu item next action 
       
   186         * indicator codes.
       
   187         * @param aDefaultItem The item selected by default.
       
   188         * @param aSelection The item index selected by the user.
       
   189         * @param aHelpIsAvailable A flag indicating if help is available.
       
   190         * @param aIconId The id of title icon.
       
   191         * @param aMenuIcons List of icon identifiers for menu items.
       
   192         * @param aIconListQualifier Indicates how to use icons in the icon list.
       
   193         * @param aRequestedIconDisplayed Informs if icon is not used.
       
   194         * @param aSelectionPreference Specifies is the soft keys preferred.
       
   195         * @return The response to this command.
       
   196         */
       
   197         TSatUiResponse SelectItemL( const TDesC& aText, 
       
   198             const MDesCArray& aMenuItems, 
       
   199             const CArrayFixFlat<TSatAction>* aMenuItemNextActions,
       
   200             const TInt aDefaultItem, TUint8& aSelection,
       
   201             const TBool aHelpIsAvailable,
       
   202             const TSatIconId& aIconId,
       
   203             const CArrayFixFlat<TInt>* aMenuIcons,
       
   204             const enum TSatIconQualifier aIconListQualifier,
       
   205             TBool& aRequestedIconDisplayed,
       
   206             const enum TSatSelectionPreference aSelectionPreference );
       
   207 
       
   208         /**
       
   209         * From MSatUiObserver Notification of the SAT Play Tone command.
       
   210         * @param aText The text to be displayed.
       
   211         * @param aTone The tone to be played.
       
   212         * @param aDuration The duration of the tone to be played.
       
   213         * @param aIconId The id of icon.
       
   214         * @param aRequestedIconDisplayed Informs if icon is not used.
       
   215         * @return The response to this command.
       
   216         */
       
   217         TSatUiResponse PlayTone( const TDesC& aText, 
       
   218             const TSatTone aTone, 
       
   219             const TTimeIntervalMicroSeconds aDuration,
       
   220             const TSatIconId& aIconId,
       
   221             TBool& aRequestedIconDisplayed );
       
   222 
       
   223         /**
       
   224         * From MSatUiObserver General confirmation request
       
   225         * @param aCommandId ID of the quering command
       
   226         * @param aAlphaIdStatus Alpha Identifier status
       
   227         * @param aText The text to be displayed.
       
   228         * @param aAdditionalText Additional text to be used in queries.
       
   229         * @param aActionAccepted Indicates whether the command was accepted.
       
   230         * @param aIconId The id of icon.
       
   231         * @param aRequestedIconDisplayed Informs if icon is not used.
       
   232         * @param aTerminatedByUser Informs if end key is used.
       
   233         */
       
   234         void ConfirmCommand(
       
   235             const TSatSQueryCommand aCommandId,
       
   236             const TSatAlphaIdStatus aAlphaIdStatus,
       
   237             const TDesC& aText,
       
   238             const TDesC& aAdditionalText,
       
   239             TBool& aActionAccepted,
       
   240             const TSatIconId& aIconId,
       
   241             TBool& aRequestedIconDisplayed,
       
   242             TBool& aTerminatedByUser );
       
   243             
       
   244         /**
       
   245         * From MSatUiObserver General notification
       
   246         * @param aCommandId ID of the notifying command
       
   247         * @param aAlphaIdStatus Alpha Identifier status
       
   248         * @param aText Alpha Identifier
       
   249         * @param aIconId The id of icon.
       
   250         * @param aRequestedIconDisplayed Informs if icon is not used.
       
   251         * @param aControlResult Control result of the MoSm and CallControl
       
   252         * @return The response of the UI to this command.
       
   253         */
       
   254         TSatUiResponse Notification(
       
   255             const TSatSNotifyCommand aCommandId,
       
   256             const TSatAlphaIdStatus aAlphaIdStatus,
       
   257             const TDesC& aText,
       
   258             const TSatIconId& aIconId,
       
   259             TBool& aRequestedIconDisplayed,
       
   260             const TSatControlResult aControlResult );
       
   261 
       
   262         /**
       
   263         * From MSatUiObserverGeneral event notification. Used for example to
       
   264         * tell UI that command has completed its execution.
       
   265         * @param aEventId, identifies the event
       
   266         * @param aEventStatus, status of the event, used as additional info for
       
   267         *        the event
       
   268         * @param aError, possible error code that may affect on event handling. 
       
   269         *        This is also used as additional info
       
   270         */
       
   271         void EventNotification( 
       
   272             const TSatSEvent aEventId,
       
   273             const TSatSEventStatus aEventStatus,
       
   274             const TInt aError );
       
   275 
       
   276     private:
       
   277 
       
   278         /**
       
   279         * C++ default constructor.
       
   280         */
       
   281         CSatUiActionPerformer();
       
   282 
       
   283         /**
       
   284         * Symbian OS constructor.
       
   285         */
       
   286         void ConstructL();
       
   287 
       
   288         /**
       
   289         * Fetch icon information.
       
   290         * @param aIconId Id for icons
       
   291         * @param aIconCommand Command type for icon.
       
   292         * @return Pointer to selected FbsBitmap icon
       
   293         */
       
   294         CFbsBitmap* FetchIcon( const TUint8 aIconId, 
       
   295             const enum TIconCommand aIconCommand );
       
   296 
       
   297         /**
       
   298         * Gets default text's resource id
       
   299         * @param aCommandId Identifies the command
       
   300         * @param aControl Used only for MoSm and Call Control
       
   301         * @return Resource id for the default text
       
   302         */
       
   303         TInt DefaultAlphaIdL(
       
   304             const TSatSNotifyCommand aCommandId,
       
   305             const TSatControlResult aControlResult) const;
       
   306         
       
   307         /** 
       
   308         * Get size for the icon in popup window.
       
   309         * @param aSize Reference to the size of icon place.
       
   310         * @param aIconCommand Dialog information
       
   311         * @return TBool Returns EFalse if popup window is not supported
       
   312         *               in current layout.
       
   313         */
       
   314         TBool GetPopUpWindowIconSize( TSize& aSize,
       
   315              const TIconCommand  aIconCommand );
       
   316         
       
   317         /** 
       
   318         * Creates scalable bitmap.
       
   319         * @param aBitMapToConvert Reference icon to be scaled.
       
   320         * @param aIconCommand Dialog information
       
   321         */
       
   322         void GetScalableBitmapL( CFbsBitmap*& aBitMapToConvert, 
       
   323             const TIconCommand  aIconCommand );
       
   324             
       
   325         /** 
       
   326         * Handles scalable bitmap.
       
   327         * @param aBitMapToConvert Reference icon to be scaled.
       
   328         * @param aIconCommand Dialog information
       
   329         * @param aRequestedIconDisplayed Informs if icon is not shown.
       
   330         */
       
   331         void GetScalableBitmap(
       
   332             CFbsBitmap*& aBitMapToConvert, 
       
   333             const TIconCommand  aIconCommand,
       
   334             TBool& aRequestedIconDisplayed );
       
   335         
       
   336         /** 
       
   337         * Handles scalable bitmap.
       
   338         * @param aBitMapToConvert Reference icon to be scaled.
       
   339         * @param aIconCommand Dialog information
       
   340         */
       
   341         void GetScalableBitmap(
       
   342             CFbsBitmap*& aBitMapToConvert, 
       
   343             const TIconCommand  aIconCommand );
       
   344 
       
   345     public: // Data
       
   346 
       
   347         //wait scheduler
       
   348         CActiveSchedulerWait iWait;
       
   349 
       
   350     private: // Data
       
   351 
       
   352         // play tone sequence
       
   353         TBuf8<KMaxPlayToneLength> iSequence;
       
   354 
       
   355 
       
   356         //Ref: Interface to the UI-part
       
   357         MSatUiActionImplementer* iActionImplementer;
       
   358 
       
   359         // own: used with refresh started and finished
       
   360         TBool iRefresh;
       
   361 
       
   362         // own: session to sat client
       
   363         RSatUiSession iSat;
       
   364 
       
   365         //Ref: Adapter provided by SAT Client
       
   366         MSatUiAdapter* iAdapter;
       
   367 
       
   368         //Own: Session
       
   369         RSatSession iSatSession;
       
   370         
       
   371         //Own: Current Iconididentifier
       
   372         TInt iIconIdIdentifier;
       
   373        
       
   374         //Own: SetupMenu and SelectItem items icon
       
   375         CAknIconArray* iItemIcons;
       
   376 
       
   377         //Own: Icon fetching handler
       
   378         CSatUiIconHandler* iIconHandler;
       
   379         
       
   380         // own: used to signal that icons are supported
       
   381         TBool iIconSupport;
       
   382         
       
   383         //Own: used to indicate if ESatSClearScreenEvent occurs
       
   384         TBool iClearScreenEvent;
       
   385 
       
   386     };
       
   387 
       
   388 #endif    // CSATUIACTIONPERFORMER_H
       
   389 
       
   390 //  End of File