javaextensions/pim/framework/inc.s60/cpimstringmatcher.h
changeset 21 2a9601315dfc
equal deleted inserted replaced
18:e8e63152f320 21:2a9601315dfc
       
     1 /*
       
     2 * Copyright (c) 2008 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:  An item string value matcher.
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPIMSTRINGMATCHER_H
       
    20 #define CPIMSTRINGMATCHER_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include "pimcommon.h"
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CPIMItem;
       
    28 class MPIMAdapterManager;
       
    29 class CPIMValidator;
       
    30 
       
    31 // CLASS DECLARATION
       
    32 /**
       
    33  * Class for matching an item against multiple items for a match
       
    34  * defined in the PIM API PIMList.items( aMatchingItem ) method.
       
    35  * See MatchL() method.
       
    36  */
       
    37 NONSHARABLE_CLASS(CPIMStringMatcher): public CBase
       
    38 {
       
    39 public: // Constructors and destructor
       
    40 
       
    41     /**
       
    42      * C++ constructor.
       
    43      *
       
    44      * @param aValidator The validator by which the string fields
       
    45      *        are distinguished from other fields.
       
    46      */
       
    47     CPIMStringMatcher(const CPIMValidator& aValidator);
       
    48 
       
    49     /**
       
    50      * Destructor.
       
    51      */
       
    52     virtual ~CPIMStringMatcher();
       
    53 
       
    54 public: // New functions
       
    55 
       
    56     /**
       
    57      * Matches given item against given string value.
       
    58      *
       
    59      * @return \c ETrue if \a aMatchingValue is a substring in
       
    60      *         some of the string field values of \a aTestedItem,
       
    61      *         case-insensitive; \c EFalse otherwise.
       
    62      */
       
    63     TBool MatchL(
       
    64         const TDesC& aMatchingValue,
       
    65         const CPIMItem& aTestedItem) const;
       
    66 
       
    67 private: // Data
       
    68 
       
    69     /** Validator. Not owned. */
       
    70     const CPIMValidator& iValidator;
       
    71 
       
    72 };
       
    73 
       
    74 #endif // CPIMSTRINGMATCHER_H
       
    75 // End of File