phoneapp/phoneuiutils/inc/tphonecmdparamquery.h
changeset 37 ba76fc04e6c2
child 51 f39ed5e045e0
equal deleted inserted replaced
36:2eacb6118286 37:ba76fc04e6c2
       
     1 /*
       
     2 * Copyright (c) 2005 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:  Parameter class for query dialogs.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __TPHONECMDPARAMQUERY_H
       
    19 #define __TPHONECMDPARAMQUERY_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include "tphonecommandparam.h"
       
    23 #include "tcbacommandmapping.h"
       
    24 #include "mphonequerycommandobserver.h"
       
    25 #include <bamdesca.h>
       
    26 
       
    27 // DATA TYPES
       
    28 enum TPhoneQueryType
       
    29     {
       
    30     EPhoneQueryDialog,
       
    31     EPhoneTextQueryDialog,
       
    32     EPhoneGlobalQueryDialog,  
       
    33     EPhoneDtmfListQueryDialog,
       
    34     EPhoneDtmfTextQuery,
       
    35     EPhoneContactsListQuery,
       
    36     EPhoneGlobalMsgQuery,
       
    37     EPhoneGenericTextQuery,
       
    38     EPhoneGlobalWaitNote, // This is special case cause its note with softkeys
       
    39     EPhoneCustomListQueryDialog // Custom list query.
       
    40     };
       
    41 
       
    42 /** Maximum number of configurable CBA command mappings.*/
       
    43 const TInt KMaxNumberOfCbaCommandMappings = 4;
       
    44 
       
    45 // CLASS DECLARATION
       
    46 
       
    47 /**
       
    48 *  A concrete parameter class for query dialogs.
       
    49 *  
       
    50 */
       
    51 class TPhoneCmdParamQuery : public TPhoneUICommandParam
       
    52     {
       
    53     public:
       
    54         
       
    55         /**
       
    56          * C++ default constructor.
       
    57          */
       
    58         IMPORT_C TPhoneCmdParamQuery();
       
    59         
       
    60         /**
       
    61          * C++ copy constructor.
       
    62          */
       
    63         IMPORT_C TPhoneCmdParamQuery( const TPhoneCmdParamQuery& aParam );
       
    64         
       
    65         /**
       
    66          * C++ assignment operator.
       
    67          */
       
    68         IMPORT_C TPhoneCmdParamQuery& operator=( 
       
    69             const TPhoneCmdParamQuery& aParam );
       
    70         
       
    71     public: 
       
    72         
       
    73         /**
       
    74         * Sets the resource id for dialog
       
    75         * @param aDialogResourceId is integer value
       
    76         */
       
    77         IMPORT_C void SetQueryResourceId( TInt aDialogResourceId );
       
    78 
       
    79         /**
       
    80         * Returns the dialog resource id.
       
    81         * @return Returns the carried resource id
       
    82         */
       
    83         IMPORT_C TInt QueryResourceId() const;
       
    84         
       
    85         /**
       
    86         * Sets the dialog prompt
       
    87         * @param aDialogPrompt is dialog prompt text
       
    88         */
       
    89         IMPORT_C void SetQueryPrompt( const TDesC& aDialogPrompt );
       
    90 
       
    91         /**
       
    92         * Returns the dialog prompt.
       
    93         * @return Returns the dialog prompt text
       
    94         */
       
    95         IMPORT_C const TDesC& QueryPrompt() const;
       
    96         
       
    97         /**
       
    98         * Sets the default cba resource
       
    99         * @param aCbaResourceId is integer value
       
   100         */
       
   101         IMPORT_C void SetDefaultCba( TInt aCbaResourceId );
       
   102         
       
   103         /**
       
   104         * Returns the default CBA's resource id
       
   105         * @return Returns the carried default CBA resource id
       
   106         */
       
   107         IMPORT_C TInt DefaultCba() const;
       
   108         
       
   109         /**
       
   110         * Sets the content cba resource.
       
   111         * These CBAs get displayed when there is some text/numbers in the the dialog.
       
   112         * @param aCbaResourceId is integer value
       
   113         */
       
   114         IMPORT_C void SetContentCba( TInt aCbaResourceId );
       
   115         
       
   116         /**
       
   117         * Returns the content CBA's resource id
       
   118         * @return Returns the carried content CBA resource id
       
   119         */
       
   120         IMPORT_C TInt ContentCba() const;
       
   121         
       
   122         /**
       
   123         * Sets the data text for dialog
       
   124         * @param aDataText is TDes pointer
       
   125         */
       
   126         IMPORT_C void SetDataText( TDes* aDataText );
       
   127         
       
   128         /**
       
   129         * Returns the data text
       
   130         * @return Returns the pointer to data text
       
   131         */
       
   132         IMPORT_C TDes* DataText() const;
       
   133         
       
   134         /**
       
   135         * Sets the query type
       
   136         * @param query type
       
   137         */
       
   138         IMPORT_C void SetQueryType( TPhoneQueryType aQueryType );
       
   139         
       
   140         /**
       
   141         * Returns the query type
       
   142         * @return query type
       
   143         */
       
   144         IMPORT_C TPhoneQueryType QueryType() const;
       
   145 
       
   146         /**
       
   147         * Sets the send key enable status.
       
   148         * @param aSendKeyEnabled is ETrue if the send key can be
       
   149         *  processed by the query.
       
   150         */
       
   151         IMPORT_C void SetSendKeyEnabled( TBool aSendKeyEnabled );
       
   152 
       
   153         /**
       
   154         * Returns the send key enabled status.
       
   155         * @return Returns ETrue if the send key can be processed by the query 
       
   156         */
       
   157         IMPORT_C TBool SendKeyEnabled() const;
       
   158         
       
   159         /**
       
   160         * Sets the command param id.
       
   161         * @param aParamId command id
       
   162         */
       
   163         IMPORT_C void SetCommandParamId( TPhoneCommandParam::TPhoneParamId aParamId );
       
   164 
       
   165         /**
       
   166         * Sets the timeout in milliseconds.
       
   167         * Query will destroyed after this time 
       
   168         * @param aTimeOut is integer value
       
   169         */
       
   170         IMPORT_C void SetTimeOut( TInt aTimeOut );
       
   171 
       
   172         /**
       
   173         * Gets the timeout of global query.
       
   174         */
       
   175         IMPORT_C TInt TimeOut() const;
       
   176 
       
   177         /**
       
   178         * Sets query dialog tone identifier.
       
   179         * @param    aTone   Identifier for a tone to play with dialog.
       
   180         */
       
   181         IMPORT_C void SetTone( TInt aTone );
       
   182         
       
   183         /**
       
   184         * Gets query dialog tone identifier.
       
   185         * @return   Identifier for a tone to play with dialog. 
       
   186         */
       
   187         IMPORT_C TInt Tone() const;
       
   188         
       
   189         /**
       
   190          * Sets mapping from CBA command to customized one.
       
   191          * @param    aCbaCommandId      CBA command identifier.
       
   192          * @param    aCustomCommandId   Custom command identifier.
       
   193          */
       
   194         IMPORT_C void SetCbaCommandMapping( 
       
   195             TInt aCbaCommandId, TInt aCustomCommandId );
       
   196         
       
   197         /**
       
   198          * Returns custom command mapped to given CBA command. 
       
   199          * If mapping is not defined, CBA command is returned.
       
   200          * @return  Custom command identifier for CBA command.
       
   201          */
       
   202         IMPORT_C TInt CbaCommandMapping( TInt aCbaCommandId ) const;
       
   203 
       
   204         /**
       
   205          * Sets custom command to be used if query time outs.
       
   206          * @param    aCustomCommandId   Custom command identifier.
       
   207          */
       
   208         IMPORT_C void SetCustomCommandForTimeOut( TInt aCustomCommandId );
       
   209         
       
   210         /**
       
   211          * Gets custom command to use if query time outs.
       
   212          * @param   aCustomCommandId    Custom command, if defined. 
       
   213          * @return  KErrNotFound if not defined, KErrNone otherwise.
       
   214          */
       
   215         IMPORT_C TInt GetCustomCommandForTimeOut( TInt& aCustomCommandId ) const;
       
   216         
       
   217 
       
   218         /**
       
   219          * Sets observer for query commands.
       
   220          * @param    aObserver   Command Observer. Ownership NOT
       
   221          *                       transferred.
       
   222          */
       
   223         IMPORT_C void SetQueryCommandObserver( 
       
   224                 MPhoneQueryCommandObserver& aObserver );
       
   225 
       
   226         /**
       
   227          * Returns observer for query commands.
       
   228          * @return    Query command observer (NULL if not setted). 
       
   229          *            Ownership NOT transferred.
       
   230          */
       
   231         IMPORT_C MPhoneQueryCommandObserver* QueryCommandObserver();
       
   232         
       
   233         /**
       
   234          * Sets item text array for custom list query.
       
   235          * @param    aItemTextArray   Item text array.
       
   236          */
       
   237         IMPORT_C void SetItemTextArrayForListQuery( 
       
   238                 MDesCArray& aItemTextArray );
       
   239 
       
   240         /**
       
   241          * Returns item text array for custom list query.
       
   242          * @return    Item text array (NULL if not setted). 
       
   243          */
       
   244         IMPORT_C MDesCArray* ItemTextArrayForListQuery() const;
       
   245         
       
   246     private:   
       
   247 
       
   248         /**
       
   249         * The dialog resource id
       
   250         */
       
   251         TInt iDialogResourceId;
       
   252         
       
   253         /**
       
   254         * The dialog prompt
       
   255         */
       
   256         TPtrC iDialogPrompt;
       
   257 
       
   258         /**
       
   259         * The default CBA resource id
       
   260         */
       
   261         TInt iDefaultCbaResourceId;
       
   262         
       
   263         /**
       
   264         * The content CBA resource id
       
   265         */
       
   266         TInt iContentCbaResourceId;
       
   267         
       
   268         /**
       
   269         * The data text
       
   270         */
       
   271         TDes* iDataText;
       
   272         
       
   273         /**
       
   274         * Query type
       
   275         */
       
   276         TPhoneQueryType iQueryType;
       
   277 
       
   278         /**
       
   279         * The send key enabled status
       
   280         */
       
   281         TBool iSendKeyEnabled;
       
   282 
       
   283         /**
       
   284         * The timeout
       
   285         */
       
   286         TInt iTimeOut;
       
   287         
       
   288         /**
       
   289          * Query dialog tone.
       
   290          */
       
   291         TInt iTone;
       
   292         
       
   293         /**
       
   294          * CBA command <-> custom command mappings.
       
   295          */
       
   296         TFixedArray<TCbaCommandMapping, KMaxNumberOfCbaCommandMappings> 
       
   297             iCbaCommandMappings;
       
   298         
       
   299         /**
       
   300          * Custom command to be used if query time outs.
       
   301          */
       
   302         TInt iCustomCmdForTimeOut;
       
   303 
       
   304         /**
       
   305          * Query command observer.
       
   306          * Not own.
       
   307          */
       
   308         MPhoneQueryCommandObserver* iCommandObserver;
       
   309 
       
   310         /**
       
   311          * Item text array for custom list query.
       
   312          * Not own.
       
   313          */
       
   314         MDesCArray* iItemTextArray;
       
   315     };
       
   316 
       
   317 #endif      // __TPHONECMDPARAMQUERY_H   
       
   318             
       
   319 // End of File