wvuing/wvuieng/EngSrc/CCASearchData.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2002-2005 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:  Represents the searched data
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CCASEARCHDATA_H
       
    20 #define CCASEARCHDATA_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include    "MCASearchData.h"
       
    24 
       
    25 #include    <e32base.h>
       
    26 #include    <badesca.h>
       
    27 
       
    28 // CLASS DECLARATION
       
    29 
       
    30 /**
       
    31 *  This class represents the searched data.
       
    32 *
       
    33 *
       
    34 *  @lib CAEngine.lib
       
    35 *  @since 1.2
       
    36 */
       
    37 class CCASearchData : public CBase,
       
    38             public MCASearchData
       
    39     {
       
    40     public:  // Constructors and destructor
       
    41 
       
    42 
       
    43         /**
       
    44         * Two-phased constructor.
       
    45         */
       
    46         static CCASearchData* NewL();
       
    47 
       
    48         /**
       
    49         * Destructor.
       
    50         */
       
    51         virtual ~CCASearchData();
       
    52 
       
    53     public: // Functions derived from MCASearchData
       
    54 
       
    55         /**
       
    56         * From MCASearchData.
       
    57         * @see MCASearchData::NoMoreResultsAvailable.
       
    58         */
       
    59         IMPORT_C TBool NoMoreResultsAvailable() const;
       
    60 
       
    61         /**
       
    62         * From MCASearchData.
       
    63         * @see MCASearchData::SearchResultType.
       
    64         */
       
    65         IMPORT_C TImpsSearchResultType SearchResultType() const;
       
    66 
       
    67         /**
       
    68         * From MCASearchData.
       
    69         * @see MCASearchData::SearchData.
       
    70         */
       
    71         IMPORT_C TPtrC SearchData( TInt aIndex ) const;
       
    72 
       
    73         /**
       
    74         * From MCASearchData.
       
    75         * @see MCASearchData::SearchDataCount.
       
    76         */
       
    77         IMPORT_C TInt SearchDataCount() const;
       
    78 
       
    79         /**
       
    80         * From MCASearchData.
       
    81         * @see MCASearchData::HowManyResultsAvailable.
       
    82         */
       
    83         IMPORT_C TInt HowManyResultsAvailable() const;
       
    84 
       
    85 
       
    86     public: // New functions
       
    87 
       
    88         /**
       
    89         * Needed in search continue. This is the next index to the server.
       
    90         * @return Next search index.
       
    91         */
       
    92         TInt NextSearchIndex() const;
       
    93 
       
    94         /**
       
    95         * Updates the searched data.
       
    96         * @param aIndex specifies the next search index.
       
    97         * @param aCompleted ETrue if no more results is available and
       
    98         *        EFalse if available.
       
    99         * @param aType is the type of the results
       
   100         * @param aResults are the results.
       
   101         * @param aSearchLimit is the amount of data observer wants.
       
   102         */
       
   103         void UpdateDataL( TInt                    aIndex,
       
   104                           TBool                   aCompleted,
       
   105                           TImpsSearchResultType   aType,
       
   106                           MDesCArray*             aResults,
       
   107                           TInt                    aSearchLimit );
       
   108 
       
   109         /**
       
   110         * Empties all the search information.
       
   111         * Used in stopping search.
       
   112         */
       
   113         void ClearResults();
       
   114 
       
   115         /**
       
   116         * Used search next. No need to initiate web transactions if
       
   117         * we already have the data.
       
   118         * @param aNextIndex is the next place to search.
       
   119         * @return ETrue if we have and EFalse if we do not have.
       
   120         */
       
   121         TBool WeHaveData( TInt aNextIndex ) const;
       
   122 
       
   123         /**
       
   124         * Updates the maximum available results.
       
   125         * @param aMaxResults is the new available results.
       
   126         */
       
   127         void UpdateMaximumPossibleResults( TInt aMaxResults );
       
   128 
       
   129     private:
       
   130 
       
   131         /**
       
   132         * C++ default constructor.
       
   133         */
       
   134         CCASearchData();
       
   135 
       
   136 
       
   137         /**
       
   138         * By default Symbian OS constructor is private.
       
   139         */
       
   140         void ConstructL();
       
   141 
       
   142     private:    // Data
       
   143 
       
   144         // Is the search completed or is there more data
       
   145         TBool iCompleted;
       
   146 
       
   147         // Owns: Search result array
       
   148         CDesCArrayFlat* iResults;
       
   149 
       
   150         // Index from the next search can start in the server side
       
   151         TInt iServerNextIndex;
       
   152 
       
   153         //result type of the search
       
   154         TImpsSearchResultType iSearchResultType;
       
   155 
       
   156         // The amount of results that subsequent searches can retrieve.
       
   157         TInt iMaximumResultsAvailable;
       
   158     };
       
   159 
       
   160 #endif      // CCASEARCHDATA_H
       
   161 
       
   162 // End of File