phonesrv_plat/phone_client_utility_api/inc/PhCltUtils.h
changeset 46 2fa1fa551b0b
parent 42 35488577e233
child 48 78df25012fda
equal deleted inserted replaced
42:35488577e233 46:2fa1fa551b0b
     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 provides functionality to check if character is valid and 
       
    15 *                remove invalid characters.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef PHCLTUTILS_H
       
    21 #define PHCLTUTILS_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32std.h>
       
    25 
       
    26 // CLASS DECLARATION
       
    27 
       
    28 /**
       
    29 *  It contains utility methods.
       
    30 *
       
    31 *  This class can be used to remove illegal characters from descriptors
       
    32 *  before dialing. However, it shouldn't be done before you have ensured
       
    33 *  that string is acceptable by application specific grammar.
       
    34 *  
       
    35 *  Thus, you should process as follows:
       
    36 *       1. Check that string is acceptable. (application specific)
       
    37 *       2. If not, stop. Otherwise continue.
       
    38 *       3. Convert to string acceptable by phoneclient -
       
    39 *          typically, you just have to remove invalid characters.
       
    40 *       4. Do whatever you wish with the string, e.g. dial.
       
    41 *
       
    42 *  @lib phoneclient.lib
       
    43 *  @since 1.0
       
    44 */
       
    45 class PhCltUtils
       
    46     {
       
    47     public:  // New functions
       
    48 
       
    49         /**
       
    50         * Checks if character is acceptable.
       
    51         *
       
    52         * @param aChar character.
       
    53         * @return ETrue iff characters is ok.
       
    54         */
       
    55         IMPORT_C static TBool IsValidChar( TChar aChar );
       
    56 
       
    57         /**
       
    58         * Removes all illegal characters from descriptor.
       
    59         *
       
    60         * @param aString string from which those characters are removed.
       
    61         */
       
    62         IMPORT_C static void RemoveInvalidChars( TDes& aString );
       
    63 
       
    64         /**
       
    65         * Removes SIP prefixses and domain part from descriptor.
       
    66         *
       
    67         * @since 3.0
       
    68         * @param aString string from which those characters are removed.
       
    69         */        
       
    70         IMPORT_C static void RemoveURIPrefixdAndDomainChars( TDes& aString );
       
    71     };
       
    72         
       
    73 #endif      // PHCLTUTILS_H   
       
    74             
       
    75 // End of File