emailservices/emailstore/message_store/client/api/MsgStoreSearchCriteria.h
changeset 0 8466d47a6819
child 8 e1b6206813b4
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     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:  Message store search criteria.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __MSG_STORE_SEARCH_CRITERIA_H__
       
    21 #define __MSG_STORE_SEARCH_CRITERIA_H__
       
    22 
       
    23 //<cmail>
       
    24 #include "MsgStoreTypes.h"
       
    25 //</cmail>
       
    26 
       
    27 /** This class represents the criteria for a search request
       
    28 */
       
    29 class RMsgStoreSearchCriteria 
       
    30 	{
       
    31 
       
    32     public:
       
    33         /**
       
    34          * Consturctor()
       
    35          */
       
    36         IMPORT_C RMsgStoreSearchCriteria();
       
    37     
       
    38         /**
       
    39          * Close() must be called before this object goes out of scope
       
    40          */
       
    41         IMPORT_C void Close();
       
    42         
       
    43         /** Call this method to repeatly to specfy all the search strings.
       
    44          * 
       
    45          *  /note the logical expression among these search strings is: "AND".
       
    46          *        A message is consider match if each of the search string appears
       
    47          *        at least once in the any of the search fields.
       
    48          */
       
    49         IMPORT_C void AddSearchStringL( const TDesC& aSearchString );
       
    50         
       
    51         /** 
       
    52          * Stores the search field masks defined as TMsgStoreSearchFieldMasks.
       
    53          * By default, all search fields are enabled.
       
    54          * 
       
    55          * /note this field is not used in the current release.  The server searches all the fields
       
    56          *       defined in TMsgStoreSearchFieldMasks.
       
    57          */
       
    58         TUint iSearchFields;
       
    59         
       
    60         /** Specifies the sort field. Default value is EMsgStoreSortByReceivedDate.
       
    61          */
       
    62         TMsgStoreSortByField iSortBy;
       
    63         
       
    64         /** Specifies the sort order. Deafult value is EMsgStoreSortDescending.
       
    65          */
       
    66         TMsgStoreSortOrder   iSortOrder;
       
    67         
       
    68         /** When the iSortBy field is not EMsgStoreSortByReceivedDate, 
       
    69          *  the received date becomes secondary sorting field.  This
       
    70          *  specifies whether the secondary should be ascending or descending.
       
    71          * 
       
    72          *  Deafult value is EMsgStoreSortDescending.
       
    73          */
       
    74         TMsgStoreSortOrder   iSecondarySortOrder;  
       
    75     
       
    76         /** Call this method to repeatly to specify the folders to be searched.
       
    77          * 
       
    78          *  The order they are searched is the same as the order they are added.
       
    79          *  For example, to search the messages in "Inbox", "Sent Items", "Drafts"
       
    80          *  "Outbox", and other user-defined folders, add "Inbox" id first, followed by
       
    81          *  "Sent Item" id, than "Draft",etc., 
       
    82          * 
       
    83          */
       
    84         IMPORT_C void AddFolderId( TMsgStoreId aFolderId );
       
    85         
       
    86         /** Call this method to repeatly to specfy all the properties that the 
       
    87          *  search result should include. 
       
    88          * 
       
    89          *  For example, in the folder view, the UI may only want to display "sender",
       
    90          *  "subject", "received date", and "flags", and not to display the rest of 
       
    91          *  the properties.  In this case, only add KMsgStorePropertySender, 
       
    92          *  KMsgStorePropertySubject, KMsgStorePropertyReceivedAt, and 
       
    93          *  KMsgStorePropertyFlags to this list and the sorted results will only
       
    94          *  include these properties.
       
    95          */
       
    96         IMPORT_C void AddResultPropertyL( const TDesC8& aPropertyKey );
       
    97 
       
    98         /**
       
    99          * Internal use only, not exported
       
   100          */
       
   101         RArray<TMsgStoreId>& FolderIds() { return iFolderIds; }
       
   102         
       
   103         /**
       
   104          * Internal use only, not exported
       
   105          * Note, the return value should be a const, it's removed for unit testing purpose.
       
   106          */
       
   107         RPointerArray<TDesC>& SearchStrings() { return iSearchStrings; }
       
   108         
       
   109         /**
       
   110          * Internal use only, not exported
       
   111          */
       
   112         const RPointerArray<TDesC8>& PropertyKeys() { return iPropertyKeys; }
       
   113        
       
   114     private:
       
   115     
       
   116         RArray<TMsgStoreId>   iFolderIds;
       
   117         RPointerArray<TDesC>  iSearchStrings;
       
   118         RPointerArray<TDesC8> iPropertyKeys;
       
   119     
       
   120 	}; // end class RMsgStoreSearchCriteria
       
   121 
       
   122 #endif   //__MSG_STORE_SEARCH_CRITERIA_H__