telutils/phoneparser/inc/CPhoneGsmOptionContainer.h
changeset 0 ff3b6d0fd310
child 19 7d48bed6ce0c
equal deleted inserted replaced
-1:000000000000 0:ff3b6d0fd310
       
     1 /*
       
     2 * Copyright (c) 2002 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:  It is container for options, boolean flags with identifiers.
       
    15 *                Using these flags, parsing process can be configured.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CPHONEGSMOPTIONCONTAINER_H
       
    21 #define CPHONEGSMOPTIONCONTAINER_H
       
    22 
       
    23 // INCLUDES
       
    24 #include    "CPhoneGsmOptionContainerBase.h"
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 
       
    28 // For two digit calling, some options are defined
       
    29 // elsewhere.
       
    30 class CPhoneGsmOptionContainerExt;
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35 * It is container for options. Each option is identified by 
       
    36 * a single uid and each option has a boolean status.
       
    37 *
       
    38 * @since 1.0
       
    39 * @lib phoneparser.lib
       
    40 */
       
    41 NONSHARABLE_CLASS( CPhoneGsmOptionContainer )
       
    42         : public CPhoneGsmOptionContainerBase    
       
    43     {
       
    44     public:  // Constructors and destructor      
       
    45         /**
       
    46         * Two-phased constructor.
       
    47         */
       
    48         static CPhoneGsmOptionContainer* NewL();
       
    49         
       
    50         /**
       
    51         * Destructor.
       
    52         */
       
    53         ~CPhoneGsmOptionContainer();
       
    54 
       
    55     public: // New functions
       
    56         
       
    57         /**
       
    58         * Checks if option is defined.
       
    59         * 
       
    60         * @param aOptionUid It is the uid of the option.
       
    61         * @return Returns ETrue, only if it is defined.
       
    62         */
       
    63         TBool IsOptionDefined( TInt aOptionUid ) const;
       
    64 
       
    65         /**
       
    66         * Defines an option.
       
    67         *
       
    68         * Method panics if option is already defined. Note that 
       
    69         * the method might leave.
       
    70         *
       
    71         * @param aOptionUid It is the uid of the new option.
       
    72         * @param aStatus It is the initial status for the option.
       
    73         */
       
    74         void DefineOptionL( TInt aOptionUid, TBool aStatus );
       
    75             
       
    76         /**
       
    77         * This method can be used to make overrides to definition of phone numbers.
       
    78         *
       
    79         * For example, there can be two digit emergency numbers which are normally
       
    80         * considered as ussd requests.
       
    81         *
       
    82         * Note: this can return directly EFalse in which case standard
       
    83         * GSM practices are applied.
       
    84         *
       
    85         * @param aNumber string to be checked.
       
    86         * @return ETrue if should be considered as phone number.
       
    87         */
       
    88         TBool IsEmergencyNumber( const TDesC& aNumber, TDes& aEmergencyNumber );
       
    89 
       
    90         /**
       
    91         * From CPhoneGsmOptionContainerBase. 
       
    92         * Sets status of option.
       
    93         *
       
    94         * Method panics if option is not defined.
       
    95         *
       
    96         * @param aOptionUid It is the uid of the option.
       
    97         * @param aStatus It is the new status for the option.
       
    98         */
       
    99         void SetOptionStatus( TInt aOptionUid, TBool aStatus );   
       
   100                 
       
   101         /**
       
   102         * From CPhoneGsmOptionContainerBase.
       
   103         * Finds status of option.
       
   104         *
       
   105         * Method panics if option is not defined.
       
   106         *
       
   107         * @param aOptionUid It is the uid of the option.
       
   108         * @return Returne status of the option.
       
   109         */
       
   110         TBool FindOptionStatus( TInt aOptionUid ) const;             
       
   111 
       
   112     private:
       
   113 
       
   114         /**
       
   115         * C++ default constructor.
       
   116         */
       
   117         CPhoneGsmOptionContainer();
       
   118 
       
   119         /**
       
   120         * Symbian OS constructor.
       
   121         */
       
   122         void ConstructL();
       
   123 
       
   124         /**
       
   125         * Creates key.
       
   126         */
       
   127         static TKeyArrayFix MakeKey();
       
   128 
       
   129         // By default, prohibit copy constructor
       
   130         CPhoneGsmOptionContainer( const CPhoneGsmOptionContainer& );
       
   131         // Prohibit assigment operator
       
   132         CPhoneGsmOptionContainer& operator= ( const CPhoneGsmOptionContainer& );
       
   133 
       
   134     private:    // Data
       
   135         
       
   136         /**
       
   137         * It is the structure containing information about single option.
       
   138         */
       
   139         class TOptionItem 
       
   140             {
       
   141             public:
       
   142                 TInt iUid;
       
   143                 TBool iStatus;
       
   144             };
       
   145 
       
   146         /**
       
   147         * It is the type for array of options.
       
   148         */
       
   149         typedef CArrayFixFlat< TOptionItem > COptionArray;
       
   150 
       
   151         // Owned: array of options.
       
   152         COptionArray* iOptions;
       
   153 
       
   154         // Owned: option extension for two digit calling.
       
   155         CPhoneGsmOptionContainerExt* iExtension;
       
   156 
       
   157     };
       
   158 
       
   159 #endif      // CPHONEGSMOPTIONCONTAINER_H
       
   160             
       
   161 // End of File