searcher/tsrc/cpixsearchertest/inc/cpixindexerterster.h
changeset 0 671dee74050a
child 1 6f2c1c46032b
equal deleted inserted replaced
-1:000000000000 0:671dee74050a
       
     1 /*
       
     2 * Copyright (c) 2010 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: 
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CPIXINDEXERTERSTER_H_
       
    19 #define CPIXINDEXERTERSTER_H_
       
    20 
       
    21 #include "RSearchServerSession.h"
       
    22 #include "MCPixIndexerObserver.h"
       
    23 #include "AOTestClass.h"
       
    24 
       
    25 class CCPixIndexer;
       
    26 class CCPixSearcher;
       
    27 
       
    28 class CHandleIndexingResultLeaves : public CBase,
       
    29                                     public MCPixIndexingRequestObserver
       
    30 {
       
    31 public:
       
    32     CHandleIndexingResultLeaves();
       
    33     ~CHandleIndexingResultLeaves();
       
    34     void HandleIndexingResultL( TInt aError );
       
    35 public:
       
    36     CActiveSchedulerWait* iWait;
       
    37 };
       
    38 
       
    39 class CTestIndexer : public CBase,
       
    40                      public MCPixOpenDatabaseRequestObserver,
       
    41                      public MCPixIndexingRequestObserver,
       
    42                      public MAOTestObserver,
       
    43                      public MCPixSetAnalyzerRequestObserver
       
    44 {   
       
    45 public:
       
    46     CTestIndexer(){}
       
    47 
       
    48 private:   
       
    49 
       
    50     void CreateFileIndexItemL(const TDesC& aFilename);
       
    51     TInt SearchForTextL(const TDesC& aQueryString, const TDesC& aDefaultField);
       
    52     TBool CheckBaseAppClassIsExpectedL(const TDesC& aExpectedAppClass, 
       
    53                                        const TDesC& aDocUid);
       
    54     
       
    55 
       
    56 public: // From MCPixOpenDatabaseRequestObserver
       
    57     void HandleOpenDatabaseResultL(TInt aError);
       
    58     //from MCPixSetAnalyzerRequestObserver
       
    59     void HandleSetAnalyzerResultL(TInt /*aError*/);
       
    60 
       
    61 public: // From MCPixIndexingRequestObserver
       
    62     void HandleIndexingResultL(TInt aError);
       
    63 
       
    64 public: // From MAOTestObserver
       
    65     void CallCompleted( int i );
       
    66 
       
    67 public:
       
    68     void setUp();
       
    69     void tearDown();
       
    70         
       
    71     void testOpenIndexDb();
       
    72     void testAddL();
       
    73     void testAsyncAddL();
       
    74     void testCancelAddL();
       
    75     void testUpdateL();
       
    76     void testAsyncUpdateL();
       
    77     void testDeleteL();
       
    78     void testAsyncDeleteL();
       
    79     void testResetL();
       
    80     void testFlushL();
       
    81     void testAsyncFlushL();
       
    82     void testAsyncResetL();
       
    83     void testHandleIndexingResultL_Leaves();
       
    84     void testSetAnalyzerAsync();
       
    85     void testSearchSession();
       
    86 
       
    87 private:
       
    88     CCPixIndexer* iIndexer;// CPix database 
       
    89     CCPixSearcher* iSearcher;
       
    90     RSearchServerSession iSession;
       
    91     TInt iCurrentIndex;
       
    92     CHandleIndexingResultLeaves* iHandleResultLeaves;
       
    93     CActiveSchedulerWait* iWait;
       
    94     CAOTestClass* iMyAOClass;
       
    95 };
       
    96 
       
    97 #endif /* CPIXINDEXERTERSTER_H_ */