ncdengine/inc/ncdsearchfilter.h
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2006 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 
       
    19 #ifndef M_NCD_SEARCH_FILTER_H
       
    20 #define M_NCD_SEARCH_FILTER_H
       
    21 
       
    22 #include <e32cmn.h>
       
    23 #include <bamdesca.h>
       
    24 
       
    25 #include "ncditempurpose.h"
       
    26 
       
    27 
       
    28 
       
    29 /**
       
    30  *  Search filter interface.
       
    31  *
       
    32  *  Allows setting of keywords and/or content types to limit searches.
       
    33  *
       
    34  *  @note Default implementation class can be found in ncdutils.h.
       
    35  *  
       
    36  */
       
    37 class MNcdSearchFilter
       
    38     {
       
    39 public:
       
    40 
       
    41     /**
       
    42      * Search mode
       
    43      */
       
    44     enum TSearchMode 
       
    45         {
       
    46         /**
       
    47          * Normal search
       
    48          *
       
    49          * Items returned by the server in the search response are ignored. 
       
    50          * This mode should be used always when doing recursive searches
       
    51          */
       
    52         ENormal = 0,
       
    53         
       
    54         /**
       
    55          * Accept items in the search response
       
    56          *
       
    57          * This mode should be used if the server returns items in its
       
    58          * search responses.
       
    59          * @note Recursive searching is discouraged because it can cause
       
    60          * performance issues.
       
    61          */
       
    62         EAcceptItems
       
    63         };
       
    64 public:
       
    65 
       
    66     /**
       
    67      * Returns keywords set for the filter. Items must match all keywords in order
       
    68      * to be included in search results.
       
    69      *
       
    70      * 
       
    71      * @return Array of keywords. If empty, all items match for keywords.
       
    72      */
       
    73     virtual const MDesCArray& Keywords() const = 0;
       
    74 
       
    75     /**
       
    76      * Returns content types set for the filter. Items must match one of the types
       
    77      * in order to be included in search results.
       
    78      *  
       
    79      * 
       
    80      * @return Bit field defining the content type(s) to search for. TNcdItemPurpose
       
    81      *  defines the bit values used.
       
    82      * @see TNcdItemPurpose
       
    83      */
       
    84     virtual TUint ContentPurposes() const = 0;
       
    85     
       
    86     
       
    87     /**
       
    88      * Returns search mode
       
    89      *
       
    90      * 
       
    91      * @return Search mode
       
    92      */
       
    93     virtual TSearchMode SearchMode() const = 0;
       
    94     
       
    95     
       
    96     /**
       
    97      * Depth of recursion
       
    98      *
       
    99      * @return Depth of recursion
       
   100      */
       
   101     virtual TUint RecursionDepth() const = 0;
       
   102 
       
   103 protected:
       
   104 
       
   105     /**
       
   106      * Destructor.
       
   107      *
       
   108      */
       
   109     virtual ~MNcdSearchFilter() {}
       
   110 
       
   111     };
       
   112 	
       
   113 	
       
   114 #endif //  M_NCD_SEARCH_FILTER_H