phonebookengines/VirtualPhonebook/VPbkSimStoreImpl/inc/CNumberMatchOperation.h
branchRCL_3
changeset 20 f4a778e096c2
parent 0 e686773b3f54
equal deleted inserted replaced
19:5b6f26637ad3 20:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 2002-2007 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:  A command that finds the contacts that matches to given number
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef VPBKSIMSTOREIMPL_CNUMBERMATCHOPERATION_H
       
    21 #define VPBKSIMSTOREIMPL_CNUMBERMATCHOPERATION_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include "MVPbkSimStoreOperation.h"
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class MVPbkSimFindObserver;
       
    29 class MVPbkSimCntStore;
       
    30 
       
    31 namespace VPbkSimStoreImpl {
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 class CSimPhoneNumberIndex;
       
    35 
       
    36 // CLASS DECLARATION
       
    37 
       
    38 /**
       
    39 *  A command that finds the contacts that matches to given number
       
    40 *
       
    41 */
       
    42 NONSHARABLE_CLASS(CNumberMatchOperation) : public CActive,
       
    43                         public MVPbkSimStoreOperation
       
    44     {
       
    45     public:  // Constructors and destructor
       
    46         
       
    47         /**
       
    48         * Two-phased constructor.
       
    49         * @param aObserver the observer to notify results
       
    50         * @param aSimPhoneNumberIndex the index of phone numbers
       
    51         * @param aPhoneNumber the number to search for
       
    52         * @param aNumDigits the number of digits from the end of the number
       
    53         *        to match
       
    54         * @param aStore the sim store
       
    55         * @return a new instance of this class
       
    56         */
       
    57         static CNumberMatchOperation* NewL( MVPbkSimFindObserver& aObserver,
       
    58             CSimPhoneNumberIndex& aSimPhoneNumberIndex,
       
    59             const TDesC& aPhoneNumber, TInt aNumDigits,
       
    60             MVPbkSimCntStore& aStore );
       
    61         
       
    62         /**
       
    63         * Destructor.
       
    64         */
       
    65         ~CNumberMatchOperation();
       
    66 
       
    67     public: // New functions
       
    68         
       
    69         /**
       
    70         * Executes the operation.
       
    71         */
       
    72         void Execute();
       
    73         
       
    74     public: // Functions from base classes
       
    75 
       
    76         /**
       
    77         * From CActive
       
    78         */
       
    79         void RunL();
       
    80 
       
    81         /**
       
    82         * From CActive
       
    83         */
       
    84         void DoCancel();
       
    85 
       
    86         /**
       
    87         * From CActive
       
    88         */
       
    89         TInt RunError( TInt aError );
       
    90 
       
    91     private:
       
    92 
       
    93         /**
       
    94         * C++ default constructor.
       
    95         */
       
    96         CNumberMatchOperation( MVPbkSimFindObserver& aObserver,
       
    97             CSimPhoneNumberIndex& aSimPhoneNumberIndex, TInt aNumDigits,
       
    98             MVPbkSimCntStore& aStore );
       
    99 
       
   100         /**
       
   101         * By default Symbian 2nd phase constructor is private.
       
   102         */
       
   103         void ConstructL( const TDesC& aPhoneNumber );
       
   104 
       
   105     private:    // Data
       
   106         /// The observer to notify when ready
       
   107         MVPbkSimFindObserver& iObserver;
       
   108         /// The phone number index
       
   109         CSimPhoneNumberIndex& iNumberIndex;
       
   110         /// The number to search for
       
   111         HBufC* iPhoneNumber; 
       
   112         /// The number of digits from the end of the number to match
       
   113         TInt iNumDigits;
       
   114         /// The store that is used to find
       
   115         MVPbkSimCntStore& iStore;
       
   116     };
       
   117 } // namespace VPbkSimStoreImpl
       
   118 #endif      // VPBKSIMSTOREIMPL_CNUMBERMATCHOPERATION_H
       
   119             
       
   120 // End of File