serviceproviders/sapi_messaging/tsrc/testing/tmessagingtest/get_message_async/inc/accessfolder.h
changeset 22 fc9cf246af83
equal deleted inserted replaced
19:989d2f495d90 22:fc9cf246af83
       
     1 /*
       
     2 * Copyright (c) 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 the License "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:   Defination of class CMessagingAccessFolder
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __ACCESSFOLDER_H
       
    21 #define __ACCESSFOLDER_H
       
    22 
       
    23 
       
    24 /**
       
    25  * This class provides function to get a list of measage header 
       
    26  * in a sorted order present in a folder . Message Headers are 
       
    27  * retrieved as per searching options provided by user. 
       
    28 */
       
    29 class CMessagingAccessFolder : public CBase
       
    30 	{
       
    31 
       
    32 	public:
       
    33 
       
    34 	    /**
       
    35 	     * Two-phased constructor.
       
    36 	     * @param aServerSession  Object of CMsvSession Class which
       
    37 	     *        represents a channel of communication between a client thread  
       
    38 	     *        and the Message Server thread.
       
    39 	     */
       
    40 		static CMessagingAccessFolder* NewL( CMsvSession& aServerSession );
       
    41 
       
    42 	    /**
       
    43 	    * Destructor.
       
    44 	    */
       
    45 		~CMessagingAccessFolder();
       
    46 	
       
    47 	private:
       
    48 
       
    49 	    /** 
       
    50 	     * Constructor.
       
    51 	     * @param aServerSession  Object of CMsvSession Class which
       
    52 	     *        represents a channel of communication between a client thread  
       
    53 	     *        and the Message Server thread .
       
    54 	     * @return void
       
    55 	     */
       
    56 		CMessagingAccessFolder( CMsvSession& aServerSession );
       
    57 
       
    58 
       
    59 	public:
       
    60 
       
    61 		/**
       
    62 		 * Gives Message id list of messages 
       
    63 		 * @param aFolderId  	 Folder to be used (Inbox/outbox/send/...)
       
    64 		 * @param aFilterParams  Filter parameters
       
    65 		 * @param aEntrySelection   output pararmeter for the result id array
       
    66 		*/ 				
       
    67 		void GetIdListL(TMsvId aFolderId ,
       
    68 									CFilterParamInfo* aFilterParams,
       
    69 								    CMsvEntrySelection*& aEntrySelection );
       
    70 	
       
    71 		/**
       
    72 		 * Gives next header based on inputs 
       
    73 		 * @param aFilterParams  Filter parameters
       
    74 		 * @param aEntrySelection array of message ids on which filteration to be done
       
    75 		 * @param aIndex      starting position on aEntrySelection to be start search
       
    76 		 * @param aHeader   output pararmeter for the result header
       
    77 		*/ 				
       
    78 		void GetNextHeaderL( CFilterParamInfo* aFilterParams,
       
    79 									CMsvEntrySelection* aEntrySelection,
       
    80 									TInt& aIndex, 
       
    81 									CMessageHeader*& aHeader );
       
    82 	private:
       
    83 
       
    84 		/**
       
    85 		 * Gives the list of message headers
       
    86 		 * @return void
       
    87 		*/ 
       
    88 		void GetListL();
       
    89 
       
    90 		/**
       
    91 		 * Gets next header which matches filter criteria
       
    92 		 * @param  aEntrySelection Message Id list to be filtered for headers
       
    93 		 * @param  aIndex starting position for filterting
       
    94 		 * @param  aHeader return parameter for message header
       
    95 		 * @return void
       
    96 		*/ 
       
    97 		void GetNextFilteredHeaderL( CMsvEntrySelection* aEntrySelection, 
       
    98 											TInt& aIndex, 
       
    99 											CMessageHeader*& aHeader );
       
   100 														
       
   101 		/**
       
   102 		 * Initializes the MtmID array by the Mtm string passed by user.\
       
   103 		*/ 
       
   104 		void  InitializeMtmArray();
       
   105 
       
   106 		/**
       
   107 		 * Checks whether filter on message id is set
       
   108 		 * @param  aMessageId The message id to which user want to apply filter
       
   109 		 * @return TBool ETrue if filter on message id is set and entry matches with filter
       
   110 		*/ 
       
   111 		TBool FilterId( const TMsvId aMessageId) const;
       
   112 
       
   113 		/**
       
   114 		 * Checks whether filter on Mtm is set
       
   115 		 * @param  aEntry The message entry to which user want to apply filter
       
   116 		 * @return  TBool ETrue if filter on mtm is set and entry matches with filter
       
   117 		*/ 
       
   118 		TBool FilterMtm( const TMsvEntry& aEntry ) const;
       
   119 
       
   120 		/**
       
   121 		 * Checks whether filter on sender is set
       
   122 		 * @param  aEntry The message entry to which user want to apply filter
       
   123 		 * @return TBool  ETrue if filter on sender is set and entry matches with filter
       
   124 		*/ 
       
   125 		TBool FilterFrom( const TMsvEntry& aEntry ) const;
       
   126 
       
   127 		/**
       
   128 		 * Checks whether filter on subject is set
       
   129 		 * @param  aEntry The message entry to which user want to apply filter
       
   130 		 * @return TBool  ETrue if filter on subject is set and entry matches with filter
       
   131 		*/ 
       
   132 		TBool FilterSubject( const TMsvEntry& aEntry ) const;
       
   133 
       
   134 		/**
       
   135 		 * Checks whether filter on date is set
       
   136 		 * @param  aEntry The message entry to which user want to apply filter
       
   137 		 * @return TBool ETrue if filter on date is set and entry matches with filter
       
   138 		*/ 
       
   139 		TBool FilterDate( const TMsvEntry& aEntry ) const;
       
   140 
       
   141 
       
   142 	private:
       
   143 
       
   144 		/**
       
   145 		 * Represents a channel of communication between a client thread 
       
   146 		 * and the Message Server thread
       
   147 		*/ 
       
   148 	 	CMsvSession& 			iServerSession;
       
   149 	 	
       
   150 		/**
       
   151 		 * Message Id list 
       
   152 		*/ 
       
   153 	 	CMsvEntrySelection*		iEntrySelection;
       
   154 
       
   155 		/**
       
   156 		 * Folder id from which list of message headers can be retrieved
       
   157 		*/ 
       
   158 		TMsvId 					iFolderId;
       
   159 
       
   160 		/**
       
   161 		 * Folder id from which list of message headers can be retrieved
       
   162 		*/ 
       
   163         RArray<TUid> 			iMtmArrayId;
       
   164 
       
   165 		/**
       
   166 		 * Filter variable
       
   167 		*/ 
       
   168         CFilterParamInfo*       iFilter;    
       
   169 
       
   170 	};
       
   171 
       
   172 #endif __ACCESSFOLDER_H