uiutils/Findutil/inc/FindUtilJapanese.h
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2002-2004 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:         Japanese Find Utilities header file. 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 #ifndef FINDUTILJAPANESE_H
       
    28 #define FINDUTILJAPANESE_H
       
    29 
       
    30 //  INCLUDES
       
    31 #include <e32base.h>
       
    32 #include "FindUtilBase.h"
       
    33 
       
    34 
       
    35 // FUNCTION PROTOTYPES
       
    36 // Factory function at first ordinal
       
    37 IMPORT_C MFindUtil* FindUtilFactoryFunctionL();
       
    38 
       
    39 // CLASS DECLARATION
       
    40 
       
    41 /**
       
    42 *  It's a Japanese Find Utility class.
       
    43 *  The class is only used in FindUtil.dll.
       
    44 *
       
    45 *  @since 2.6
       
    46 */
       
    47 NONSHARABLE_CLASS(CFindUtilJapanese) : public CFindUtilBase
       
    48     {
       
    49     public:  // Constructors and destructor
       
    50         /**
       
    51         * C++ default constructor.
       
    52         */
       
    53         CFindUtilJapanese();
       
    54 
       
    55         /**
       
    56         * Destructor.
       
    57         */
       
    58         virtual ~CFindUtilJapanese();
       
    59 
       
    60     private: // New functions
       
    61         /**
       
    62         * Returns whether aCh is a word separator or not.
       
    63         * @since 2.6
       
    64         * @param aCh is a character which is tested.
       
    65         * @return ETrue: aCh is a word separator.
       
    66         */
       
    67         TBool IsFindWordSeparator(TChar aCh);
       
    68 
       
    69         /**
       
    70         * Removes the word spearators and the wild card charcters.
       
    71         * @since 2.6
       
    72         * @param aSearchPtr is modifed if it has the word spearators and 
       
    73         *        the wild card characters.
       
    74         */
       
    75         void RemoveWordSeparatorsAndWildChars(TDes16& aSearchPtr);
       
    76 
       
    77         /**
       
    78         * Tests a partial matching.
       
    79         * @since 2.6
       
    80         * @param aItemString is a Contact field string
       
    81         * @param aSearchText is a search string
       
    82         * @return If aSearchText has been found in aItemString, 
       
    83         *         ETrue is returned.
       
    84         */
       
    85         TBool IsMatch(const TDesC& aItemString, const TDesC& aSearchText);
       
    86 
       
    87         /**
       
    88         * Higarana which aDes has converts to Katakana.
       
    89         * @since 2.6
       
    90         * @param aDes is a convrsion text is specified.
       
    91         */
       
    92         void CnvKatakana(TDes& aDes);
       
    93 
       
    94     private:  // From MFindUtil
       
    95         /**
       
    96         * From MFindUtil It tests a matching.
       
    97         * @since 2.6
       
    98         * @param aContactsField is a contact field string.
       
    99         * @param aWord is a search string.
       
   100         * @return If aWord has been matched with aContactsField, 
       
   101         *         ETrue is returned.
       
   102         */
       
   103         TBool Match(const TDesC& aContactsField, const TDesC& aWord);
       
   104 
       
   105         /**
       
   106         * From MFindUtil It tests a partial matching.
       
   107         * @since 2.6
       
   108         * @param aItemString is a Contact field string
       
   109         * @param aSearchText is a search string
       
   110         * @return If aSearchText has been found in aItemString, 
       
   111         *         ETrue is returned.
       
   112         */
       
   113         TBool MatchRefineL( const TDesC& aItemString, const TDesC &aSearchText);
       
   114 
       
   115         /**
       
   116         * From MFindUtil It checks whether aWord is valid.
       
   117         * @since 2.6
       
   118         * @param aWord 
       
   119         * @return ETrue is returned always.
       
   120         */
       
   121         TBool IsWordValidForMatching(const TDesC& aWord);
       
   122 
       
   123         /**
       
   124          * From MFindUtil
       
   125          * Current input text is handled by this model 
       
   126          *
       
   127          * @since S60 v3.2.3
       
   128          * @param aItemString Reference to the searching target
       
   129          * @param aSearchText Reference to text in find pane
       
   130          * @param aPolicy Reference to identify the different match policy
       
   131          * @param aConverter Reference to the converter interface, with which the aSearchText 
       
   132          *  will be converted into other kind of str, such numeric string according to
       
   133          *  the ITUT keyboard key map
       
   134          * @return ETrue for handling by this model; otherwise EFalse
       
   135          */
       
   136         virtual TBool MatchRefineL( const TDesC& aItemString, const TDesC& aSearchText, 
       
   137                                     TMatchPolicy aPolicy, MFindStringConverter* aConverter);
       
   138         
       
   139         /**
       
   140         * Find the search string.
       
   141         * @since 2.6
       
   142         * @param aItemString item string
       
   143         * @param aSearchText search string
       
   144         * @return KErrNotFound is returned if cannot find.
       
   145         */
       
   146         TInt MyFindC(const TDesC &aItemString, const TDesC &aSearchText);
       
   147      
       
   148         /**
       
   149          * From MFindUtil It tests a partial matching.
       
   150          * @since 5.0
       
   151          * @param aItemString is a field string
       
   152          * @param aSearchText is a search string
       
   153          * @param aNextChars is a reference to buffer where next possible characters are saved. 
       
   154          *        The HBufC buffer may be re-allocated by this method. 
       
   155          *        In that case the pointer reference is modified to point to the re-allocated object.                              
       
   156          * @return If aSearchText has been found in aItemString, 
       
   157          *         ETrue is returned.
       
   158          */
       
   159         TBool MatchAdaptiveRefineL( const TDesC& aItemString, 
       
   160         							const TDesC& aSearchText, 
       
   161         							HBufC*& aNextChars);
       
   162     };
       
   163 
       
   164 #endif      // FINDUTILJAPANESE_H
       
   165 
       
   166 // End of File