phoneengine/PhoneCntFinder/inc/CPhoneRawMatchNumberExtractor.h
changeset 0 5f000ab63145
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     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:  This class extracts phone number for comparison.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CCNTRAWPHONENUMBEREXTRACTOR_H
       
    21 #define CCNTRAWPHONENUMBEREXTRACTOR_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32std.h>
       
    25 #include <e32base.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CContactPhoneNumberParser;
       
    29 class CCntNumberParser;
       
    30 
       
    31 // CONSTANTS
       
    32 const TInt KPhMatcherMaximumPhoneNumberLength = 150;
       
    33 const TInt KPhMatcherNumberCount = 7;
       
    34 
       
    35 
       
    36 // CLASS DECLARATION
       
    37 
       
    38 /**
       
    39 *  MRawPhoneNumberExtractor
       
    40 *
       
    41 *  Abstact class for extraction.
       
    42 *
       
    43 *  @lib PhoneCntFinder
       
    44 *  @since 1.0
       
    45 */
       
    46 class MRawPhoneNumberExtractor 
       
    47     {
       
    48     public: // New functions
       
    49         /**
       
    50         * This should be called when instance is not needed any more.
       
    51         */
       
    52         virtual void Release() = 0;
       
    53         
       
    54         /**
       
    55         * DEPRECATED.
       
    56         */
       
    57         virtual TUint ExtractRawNumber(
       
    58             const TDesC& aTextualNumber ) = 0;
       
    59         
       
    60         /**
       
    61         * Extracts the given number for comparsion.
       
    62         * @param aTextualNumber Number to match for. 7 digits count.
       
    63         * @param aRawNumber Extracted number in descriptor.
       
    64         * @return Extracted number in integer (extra char at beginning).
       
    65         *         Equals extra char if given number is not taken to comparsion.
       
    66         */
       
    67         virtual TUint ExtractRawNumber(
       
    68             const TDesC& aTextualNumber, 
       
    69             TDes& aRawNumber ) = 0;
       
    70         
       
    71         /**
       
    72         * DEPRECATED.
       
    73         */
       
    74         virtual TChar ExtraChar() const = 0;
       
    75     };
       
    76 
       
    77 
       
    78 
       
    79 /**
       
    80 *  CCntRawPhoneNumberExtractor
       
    81 *
       
    82 *  Concrete extarctor class. 
       
    83 *
       
    84 *  @lib PhoneCntFinder
       
    85 *  @since 1.0
       
    86 */
       
    87 class CCntRawPhoneNumberExtractor 
       
    88     : public CBase, 
       
    89       public MRawPhoneNumberExtractor 
       
    90     {
       
    91     public: // Constructor
       
    92 
       
    93         /**
       
    94         * Constructor.
       
    95         */
       
    96         IMPORT_C CCntRawPhoneNumberExtractor();
       
    97 
       
    98         /**
       
    99         * Symbian OS constructor.
       
   100         */
       
   101         void ConstructL();
       
   102         
       
   103     public: // Functions from base classes
       
   104 
       
   105         /**
       
   106         * From MRawPhoneNumberExtractor
       
   107         */
       
   108         void Release();
       
   109         
       
   110         /**
       
   111         * From MRawPhoneNumberExtractor
       
   112         * DEPRECTED - Do not use.
       
   113         */
       
   114         TUint ExtractRawNumber( 
       
   115             const TDesC& aTextualNumber );
       
   116         
       
   117         /**
       
   118         * From MRawPhoneNumberExtractor
       
   119         */
       
   120         TUint ExtractRawNumber( 
       
   121             const TDesC& aTextualNumber, 
       
   122             TDes& aRawNumber );
       
   123         
       
   124         /**
       
   125         * From MRawPhoneNumberExtractor
       
   126         * DEPRECTED - Do not use.
       
   127         */
       
   128         TChar ExtraChar() const;
       
   129 
       
   130     private:
       
   131 
       
   132         /**
       
   133         * Destructor.
       
   134         */
       
   135         ~CCntRawPhoneNumberExtractor();
       
   136         
       
   137     private:    // Data
       
   138         // Buffer for data
       
   139         TBuf<KPhMatcherMaximumPhoneNumberLength> iMatchBuffer;
       
   140 
       
   141         // DEPRECATED.
       
   142         const TChar iKPhoneNumberExtraChar;
       
   143 
       
   144         // Parser library
       
   145         RLibrary iParserLibrary;
       
   146 
       
   147         // Parser itself
       
   148         CContactPhoneNumberParser* iParser;
       
   149 
       
   150         // Pointer to CCntNumberParser
       
   151         CCntNumberParser* iNumberParser;
       
   152     };
       
   153 
       
   154 
       
   155 #endif //CCNTRAWPHONENUMBEREXTRACTOR_H
       
   156 
       
   157 // End of File