serviceproviders/sapi_messaging/tsrc/testing/tmessagingtest/get_message_async/inc/messageheader.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:   Support for header information retrieval 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __MESSAGEHEADER_H
       
    21 #define __MESSAGEHEADER_H
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <msvstd.h>
       
    25 #include <msvapi.h>
       
    26 #include <cmsvrecipientlist.h>
       
    27 
       
    28 class CMsvAttachment;
       
    29 class CRecipientList;
       
    30 
       
    31 const TInt KArrayGranularity = 4;
       
    32 
       
    33 _LIT(KMessageTypeMMS, 	"MMS");
       
    34 _LIT(KMessageTypeSMS, 	"SMS");
       
    35 _LIT(KUnknown, 			"unknown");
       
    36 _LIT(KPriorityHigh, 	"High");
       
    37 _LIT(KPriorityMedium, 	"Medium");
       
    38 _LIT(KPriorityLow, 		"Low");
       
    39 
       
    40 /**
       
    41  * TMessageStatusFlag enum for status of message
       
    42 */
       
    43 enum TMessageStatusFlag
       
    44 	{
       
    45 	EUnread = 0,
       
    46 	EReplied,
       
    47 	EForward,
       
    48 	EDelete
       
    49 	};
       
    50 	
       
    51 /**
       
    52  * TNotificationType enum for notification of new arrival of message 
       
    53 */
       
    54 enum TNotificationType
       
    55 	{
       
    56 	ENewMessage = 0
       
    57 	};
       
    58 
       
    59 /**
       
    60  * TMessageFilter enum is provided to filtering out search options 
       
    61 */
       
    62 enum TMessageFilter
       
    63 	{
       
    64 	EFilterId = 		0x1,
       
    65 	EFilterMtm = 		0x2,
       
    66 	EFilterFrom = 		0x4,
       
    67 	EFilterSubject = 	0x8,
       
    68 	EFilterStartDate = 	0x10,
       
    69 	EFilterEndDate = 	0x20
       
    70 	};
       
    71 
       
    72 /**
       
    73  * CFilterParamInfo  Contains filter and sorting information required for getting header list
       
    74 */
       
    75 class CFilterParamInfo : public CBase
       
    76 	{
       
    77 	public:
       
    78 	
       
    79 		/**
       
    80 		 * Two Phase Constructor
       
    81 		*/ 
       
    82 		IMPORT_C static CFilterParamInfo* NewL();
       
    83 	
       
    84 		/**
       
    85 		 * Destructor
       
    86 		*/ 
       
    87 		~CFilterParamInfo();
       
    88 		
       
    89 		/**
       
    90 		 * Adds the sender address as a filter
       
    91 		 * @param aFrom It is sender address 
       
    92 		 * @return void
       
    93 		*/ 
       
    94 		IMPORT_C void AddFromL( const TDesC& aFrom );
       
    95 
       
    96 		/**
       
    97 		 * Gets the sender address list
       
    98 		 * @return CDesCArray*
       
    99 		*/ 
       
   100 		IMPORT_C const CDesCArray* From() const ;
       
   101 
       
   102 		/**
       
   103 		 * Adds the mtm as a filter
       
   104 		 * @param aMtm It is mtm type
       
   105 		 * @return void
       
   106 		*/ 
       
   107 		IMPORT_C TInt AddMtmL( const TDesC& aMtm );
       
   108 
       
   109 		/**
       
   110 		 * Gets the mtm list
       
   111 		 * @return CDesCArray*
       
   112 		*/ 
       
   113 		IMPORT_C const CDesCArray* Mtm() const;
       
   114 
       
   115 		/**
       
   116 		 * Sets the subject filter
       
   117 		 * @param aSubject It is the subject which user want to set as filter
       
   118 		 * @return void
       
   119 		*/ 
       
   120 		IMPORT_C void SetSubjectL( const TDesC& aSubject );
       
   121 
       
   122 		/**
       
   123 		 * Gets the subject filter
       
   124 		 * @return TPtrC
       
   125 		*/ 
       
   126 		IMPORT_C TPtrC Subject() const;
       
   127 
       
   128 		/**
       
   129 		 * Sets the sorting order
       
   130 		 * @param aSortType It could be { @c EMsvSortByNone , @c EMsvSortByDate ,@c EMsvSortByDateReverse ,
       
   131 		                      @c EMsvSortBySize ,@c  EMsvSortBySizeReverse, @c  EMsvSortByDetails ,
       
   132 		                      @c EMsvSortByDetailsReverse ,@c EMsvSortByDescription ,@c EMsvSortByDescriptionReverse ,
       
   133 		                      @c EMsvSortById ,@c EMsvSortByIdReverse } defined in @c MSVSTD.H 
       
   134 		 * @return void		                      
       
   135 		*/ 
       
   136 		IMPORT_C void SetSortType( const TMsvSorting aSortType );
       
   137 
       
   138 		/**
       
   139 		 * Gets the sorting order
       
   140 		 * @return TMsvSorting		                      
       
   141 		*/ 
       
   142 		IMPORT_C TMsvSorting SortType() const;
       
   143 
       
   144 		/**
       
   145 		 * Sets the message id as filter
       
   146 		 * @param aMessageId It is the message id which user want to set as filter
       
   147 		 * @return void
       
   148 		*/ 
       
   149 		IMPORT_C void SetMessageIdFilter( const TMsvId aMessageId );
       
   150 		
       
   151 		/**
       
   152 		 * Gets the message id filter
       
   153 		 * @return TMsvId
       
   154 		*/ 
       
   155 		IMPORT_C TMsvId MessageId() const;
       
   156 
       
   157 		/**
       
   158 		 * Sets the starting date for date range as a filter
       
   159 		 * @param aStartDate It is the date to which we want 
       
   160 		 *                   to set as starting date for date range
       
   161 		 * @return void
       
   162 		*/ 
       
   163 		IMPORT_C void SetStartDateFilter( const TTime& aStartDate );
       
   164 		
       
   165 		/**
       
   166 		 * Gets the starting date for date range as a filter
       
   167 		 * @return TTime&
       
   168 		*/ 
       
   169 		IMPORT_C const TTime& StartDate() const;
       
   170 
       
   171 		/**
       
   172 		 * Sets the ending date for date range as a filter
       
   173 		 * @param aEndDate It is the date to which we want 
       
   174 		 *                 to set as ending date for date range
       
   175 		 * @return void
       
   176 		*/ 
       
   177 		IMPORT_C void SetEndDate( const TTime& aEndDate );
       
   178 
       
   179 		/**
       
   180 		 * Gets the ending date for date range as a filter
       
   181 		 * @return TTime&
       
   182 		*/ 
       
   183 		IMPORT_C const TTime& EndDate() const;
       
   184 
       
   185 		/**
       
   186 		 * Gives the iFilter 
       
   187 		 * @return TInt 
       
   188 		*/ 
       
   189 		IMPORT_C TInt Filter() const;
       
   190 
       
   191 		/**
       
   192 		 * Resets the filterinfo object
       
   193 		 * @return void 
       
   194 		*/ 
       
   195 		IMPORT_C  void Reset();
       
   196 		
       
   197         /** 
       
   198         * Assignment operator. 
       
   199         * @param aFilterParamInfo Item to assign.
       
   200         * @return The source object.
       
   201         */
       
   202 		CFilterParamInfo& operator=(const CFilterParamInfo& aFilterParamInfo);
       
   203 		
       
   204 	private:
       
   205 		
       
   206 		/**
       
   207 		 * Constructor
       
   208 		*/ 
       
   209 		CFilterParamInfo();
       
   210 		
       
   211 
       
   212 	private:	
       
   213 
       
   214 		/**
       
   215 		 * Sender Array  
       
   216 		*/ 
       
   217 		CDesCArray* 			iFromArray;
       
   218 
       
   219 		/**
       
   220 		 * Mtm Array
       
   221 		*/ 
       
   222 		CDesCArray* 			iMtmArray;
       
   223 
       
   224 		/**
       
   225 		 * Subject 
       
   226 		*/ 
       
   227 		HBufC* 					iSubject;
       
   228 
       
   229 		/**
       
   230 		 * Sort type
       
   231 		*/ 
       
   232 		TMsvSorting				iSortType;
       
   233 
       
   234 		/**
       
   235 		 * Message Id
       
   236 		*/ 
       
   237 		TMsvId					iMessageId;
       
   238 
       
   239 		/**
       
   240 		 * Starting date of date range
       
   241 		*/ 
       
   242 		TTime 					iStartDate;
       
   243 
       
   244 		/**
       
   245 		 * End date of date range
       
   246 		*/ 
       
   247 		TTime					iEndDate;
       
   248 
       
   249 		/**
       
   250 		 * Filter options
       
   251 		*/ 
       
   252 		TInt					iFilter;
       
   253 	};
       
   254 	
       
   255 	
       
   256 /**
       
   257  * CMessageAttachInfo  Structure for attachment information
       
   258 */
       
   259 class CMessageAttachInfo : public CBase
       
   260 	{
       
   261 	public: 
       
   262 	
       
   263 		/**
       
   264 		 * Two Phase Constructor
       
   265 		*/ 
       
   266 		IMPORT_C static CMessageAttachInfo* NewL();
       
   267 
       
   268 		/**
       
   269 		 * Destructor
       
   270 		*/ 
       
   271 		~CMessageAttachInfo();
       
   272 		
       
   273 	    /** 
       
   274 	     * Sets the Attachment Name
       
   275 	     * @param aName Attachment Name
       
   276 	     * @return void
       
   277 	    */
       
   278 		IMPORT_C void SetNameL(const TDesC& aName);
       
   279 		
       
   280 	    /** 
       
   281 	     * Gets the Attachment Name
       
   282 	     * @return TPtrC Attachment Name
       
   283 	    */
       
   284 		IMPORT_C const TPtrC Name() const;
       
   285 
       
   286 	    /** 
       
   287 	     * Sets the File handle
       
   288 	     * @param aFile File handle
       
   289 	     * @return void
       
   290 	    */
       
   291 		IMPORT_C void SetFileHandle( RFile aFile);
       
   292 		
       
   293 	    /** 
       
   294 	     * Gets the File handle
       
   295 	     * @return RFile File handle
       
   296 	    */
       
   297 		IMPORT_C RFile FileHandle() const;
       
   298 
       
   299 	    /** 
       
   300 	     * Sets the File size
       
   301 	     * @param aSize File size
       
   302 	     * @return void
       
   303 	    */
       
   304 		IMPORT_C void SetSize( TInt32 aSize);
       
   305 		
       
   306 	    /** 
       
   307 	     * Gets the File size
       
   308 	     * @return File size
       
   309 	    */
       
   310 		IMPORT_C TInt32 Size() const;
       
   311 
       
   312 	    /** 
       
   313 	     * Sets the Mime type
       
   314 	     * @param aMimeType Mime type
       
   315 	     * @return void
       
   316 	    */
       
   317 		IMPORT_C void SetMimeTypeL(const TDesC& aMimeType);
       
   318 		
       
   319 	    /** 
       
   320 	     * Gets the Mime type
       
   321 	     * @return TPtrC Mime type
       
   322 	    */
       
   323 		IMPORT_C const TPtrC MimeType() const;
       
   324 
       
   325 	
       
   326 	private:
       
   327 	
       
   328 		/**
       
   329 		 * Constructor
       
   330 		*/ 
       
   331 		CMessageAttachInfo();
       
   332 		
       
   333 	private:
       
   334 		
       
   335 		/**
       
   336 		 * Attachment name
       
   337 		*/ 
       
   338 		HBufC* 					iName;
       
   339 
       
   340 		/**
       
   341 		 * File Handle for attachment
       
   342 		*/ 
       
   343 		RFile					iFile;
       
   344 
       
   345 		/**
       
   346 		 * Size of attachment
       
   347 		*/ 
       
   348 		TInt32					iSize;
       
   349 
       
   350 		/**
       
   351 		 * Mimetype
       
   352 		*/ 
       
   353 		HBufC* 					iMimeType;
       
   354 	};	
       
   355 	
       
   356 /**
       
   357  * CMessageDetailInfo  Structure for message detail  information
       
   358 */
       
   359 class CMessageDetailInfo : public CBase
       
   360 	{
       
   361 	public:
       
   362 
       
   363 		/**
       
   364 		 * Two Phase Constructor
       
   365 		*/ 
       
   366 		IMPORT_C static CMessageDetailInfo* NewL();
       
   367 
       
   368 		/**
       
   369 		 * Destructor
       
   370 		*/ 
       
   371 		~CMessageDetailInfo();
       
   372 		
       
   373 	    /**
       
   374 	     * Adds Recipient 
       
   375 	     * @param aRecipient recipient address
       
   376 	     * @param aType recipient type
       
   377 	    */
       
   378 		IMPORT_C void AddRecipientL( const TDesC& aRecipient, 
       
   379 										TMsvRecipientType aType = EMsvRecipientTo );
       
   380 
       
   381 		/**
       
   382 		 * Gives the receipient array
       
   383 		 * @return CRecipientList*
       
   384 		*/ 
       
   385 		IMPORT_C const CRecipientList* RecipientArray() const;
       
   386 
       
   387 	    /** 
       
   388 	     * Sets the sender address
       
   389 	     * @param aFrom Sender address
       
   390 	     * @return void
       
   391 	    */
       
   392 		IMPORT_C void SetFromL(const TDesC& aFrom);
       
   393 		
       
   394 	    /** 
       
   395 	     * Gets the sender address
       
   396 	     * @return TPtrC Sender address
       
   397 	    */
       
   398 		IMPORT_C const TPtrC From() const;
       
   399 
       
   400 	    /**
       
   401 	     * Sets the body for message
       
   402 	     * @param aMsg Body for message
       
   403 	    */
       
   404 		IMPORT_C void SetBodyTextL( const TDesC& aMsg );
       
   405 
       
   406 	    /**
       
   407 	     * Gets the body text 
       
   408 	     * @return  TPtrC 
       
   409 	    */
       
   410 		IMPORT_C const TPtrC BodyText() const;
       
   411 		
       
   412 	    /** 
       
   413 	     * Sets the message id
       
   414 	     * @param aMessageID Message ID
       
   415 	     * @return void
       
   416 	    */
       
   417 		IMPORT_C void SetMessageId(const TMsvId aMessageID);
       
   418 		
       
   419 	    /** 
       
   420 	     * Gets the message id
       
   421 	     * @return TMsvId Message ID
       
   422 	    */
       
   423 		IMPORT_C TMsvId MessageId() const;
       
   424 		
       
   425 	    /**
       
   426 	     * Adds attachment 
       
   427 	     * @param aAttachment attachment information
       
   428 	    */
       
   429 		IMPORT_C void AddAttachmentInfoL( CMessageAttachInfo* aAttachment );
       
   430 
       
   431 		/**
       
   432 		 * Gives the attachment array
       
   433 		 * @return CArrayPtr<CMsvAttachment>*
       
   434 		*/ 
       
   435 		IMPORT_C const CArrayPtr<CMessageAttachInfo>* AttachmentInfoArray();
       
   436 
       
   437 	private:
       
   438 	
       
   439 		/**
       
   440 		 * Constructor
       
   441 		*/ 
       
   442 		CMessageDetailInfo();
       
   443 		
       
   444 	private:	
       
   445 
       
   446 		/**
       
   447 		 * Message ID
       
   448 		*/ 
       
   449 		TMsvId 					iMessageId;
       
   450 
       
   451 		/**
       
   452 		 * Message Body text
       
   453 		*/ 
       
   454 		HBufC* 					iBodyText;
       
   455 
       
   456 		/**
       
   457 		 * Sender address
       
   458 		*/ 
       
   459 		HBufC*					iFrom;
       
   460 
       
   461 		/**
       
   462 		 * Receipient List
       
   463 		*/ 
       
   464 		CRecipientList*			iRecipientList;
       
   465 
       
   466 		/**
       
   467 		 * Array of Attachments
       
   468 		*/ 
       
   469 		CArrayPtr<CMessageAttachInfo>* iAttachEntries;
       
   470 	};
       
   471 	
       
   472 /**
       
   473  * CSendMessageParams  Contains parameters required for sending a message
       
   474 */	
       
   475 class CSendMessageParams : public CBase
       
   476 	{
       
   477 	public:	
       
   478 
       
   479 		/**
       
   480 		 * Two Phase Constructor
       
   481 		*/ 
       
   482 		IMPORT_C static CSendMessageParams* NewL();
       
   483 
       
   484 		/**
       
   485 		 * Destructor
       
   486 		*/ 
       
   487 		~CSendMessageParams();
       
   488 		
       
   489 	    /**
       
   490 	     * Adds Recipient 
       
   491 	     * @param aRecipient recipient address
       
   492 	     * @param aType recipient type
       
   493 	    */
       
   494 		IMPORT_C void AddRecipientL( const TDesC& aRecipient, 
       
   495 									TMsvRecipientType aType = EMsvRecipientTo );
       
   496 
       
   497 		/**
       
   498 		 * Gives the receipient array
       
   499 		 * @return CRecipientList*
       
   500 		*/ 
       
   501 		IMPORT_C const CRecipientList* RecipientArray() const;
       
   502 
       
   503 	    /**
       
   504 	     * Adds attachment 
       
   505 	     * @param aAttachment attachment information
       
   506 	    */
       
   507 		IMPORT_C void AddAttachmentL( CMsvAttachment* aAttachment );
       
   508 
       
   509 		/**
       
   510 		 * Gives the attachment array
       
   511 		 * @return CArrayPtr<CMsvAttachment>*
       
   512 		*/ 
       
   513 		IMPORT_C const CArrayPtr<CMsvAttachment>* AttachmentArray();
       
   514 
       
   515 	    /**
       
   516 	     * Sets the message subject
       
   517 	     * @param aSubject Message Subject 
       
   518 	    */
       
   519 		IMPORT_C void SetSubjectL( const TDesC& aSubject );
       
   520 
       
   521 	    /**
       
   522 	     * Gives message subject 
       
   523 	     * @return  TPtrC 
       
   524 	    */
       
   525 		IMPORT_C const TPtrC Subject() const;
       
   526 
       
   527 	    /**
       
   528 	     * Sets the body for message
       
   529 	     * @param aMsg Body for message
       
   530 	    */
       
   531 		IMPORT_C void SetBodyTextL( const TDesC& aMsg );
       
   532 
       
   533 	    /**
       
   534 	     * Appends the message to the existing bodytext
       
   535 	     * @param aMsg Body for message
       
   536 	    */
       
   537 		void AppendBodyTextL( const TDesC& aMsg );
       
   538 
       
   539 	    /**
       
   540 	     * Gets the body text 
       
   541 	     * @return  TPtrC 
       
   542 	    */
       
   543 		IMPORT_C const TPtrC BodyText() const;
       
   544 
       
   545 	    /**
       
   546 	     * Sets the templateid  
       
   547 	     * @param aTemplateId template id
       
   548 	    */
       
   549 		IMPORT_C void SetTemplateId( const TMsvId aTemplateId );
       
   550 
       
   551 	    /**
       
   552 	     * Gets the template id
       
   553 	     * @return  TMsvId 
       
   554 	    */
       
   555 		IMPORT_C TMsvId TemplateId() const;
       
   556 
       
   557 	    /**
       
   558 	     * Sets paramter to launch editor depends on argument value
       
   559 	     * if ETrue then launches editor or if EFalse the don't launch editor.
       
   560 	     * @param aLaunchEditor Boolean param 
       
   561 	    */
       
   562 		IMPORT_C void SetLaunchEditor( const TBool aLaunchEditor = ETrue );
       
   563 
       
   564 	    /**
       
   565 	     * Gets the LaunchEditor value
       
   566 	     * @return  TBool
       
   567 	    */
       
   568 		IMPORT_C TBool LaunchEditor() const;
       
   569 
       
   570 	    /**
       
   571 	     * Sets the message type
       
   572 	     * @param aMessageType Describing message type (SMS/MMS)
       
   573 	    */
       
   574 		IMPORT_C TInt SetMessageTypeL( const TDesC& aMessageType );
       
   575 
       
   576 	    /**
       
   577 	     * Gets the messagetype
       
   578 	     * @return TUid 
       
   579 	    */
       
   580 		IMPORT_C TUid MessageType() const;
       
   581 
       
   582         /** 
       
   583         * Assignment operator. 
       
   584         * @param aSendMessageParams Item to assign.
       
   585         * @return The source object.
       
   586         */
       
   587 		CSendMessageParams& operator=(const CSendMessageParams& aSendMessageParams);
       
   588 		
       
   589 	private:
       
   590 	
       
   591 	    /**
       
   592 	     * Constructor
       
   593 	    */
       
   594 		CSendMessageParams();	
       
   595 	
       
   596 	private:	
       
   597 	
       
   598 	    /**
       
   599 	     * Message Type
       
   600 	    */
       
   601 		TUid 					iMessageType;
       
   602 
       
   603 	    /**
       
   604 	     * Template id
       
   605 	    */
       
   606 		TMsvId 					iTemplateId;
       
   607 
       
   608 	    /**
       
   609 	     * Receipient Array
       
   610 	    */
       
   611 		CRecipientList* 		iRecipientArray;
       
   612 
       
   613 	    /**
       
   614 	     * Attachment Array
       
   615 	    */
       
   616 		CArrayPtr<CMsvAttachment>* iAttachmentArray;
       
   617 
       
   618 	    /**
       
   619 	     * Subject of message
       
   620 	    */
       
   621 		HBufC* 					iSubject;
       
   622 
       
   623 	    /**
       
   624 	     * Bpodytext
       
   625 	    */
       
   626 		HBufC* 					iBodyText;
       
   627 
       
   628 	    /**
       
   629 	     * Launch editor variable
       
   630 	    */
       
   631 		TBool 					iLaunchEditor;
       
   632 	};	
       
   633 	
       
   634 /**
       
   635  * Contains recipients information
       
   636 */
       
   637 class CRecipientList : public CBase
       
   638 {
       
   639 	public:
       
   640 
       
   641 	    /**
       
   642 	     * Two-phased constructor.
       
   643 	     * @return CRecipientList*
       
   644 	    */
       
   645 		IMPORT_C static CRecipientList* CRecipientList::NewL();
       
   646 
       
   647 	    /**
       
   648 	     * Destructor.
       
   649 	    */
       
   650 		~CRecipientList();
       
   651 
       
   652 	    /** 
       
   653 	     * Appends the recipient type 
       
   654 	     * @param  aValue Recipient Type
       
   655 	     * @param  aPtr recipient address
       
   656 	     * @return void
       
   657 	    */
       
   658 		IMPORT_C void AppendL(TMsvRecipientType aType, const TDesC& aRecipient);
       
   659 
       
   660 	    /**
       
   661 	     * Gives the number of elements in recipient list
       
   662 	     * @return TInt 
       
   663 	    */
       
   664 		IMPORT_C TInt Count() const;
       
   665 		
       
   666 	    /**
       
   667 	     * Gives the recipient type
       
   668 	     * @param aPos position 
       
   669 	     * @return TMsvRecipientType 
       
   670 	    */
       
   671 		IMPORT_C TMsvRecipientType Type(TInt aPos) const;
       
   672 		
       
   673 	    /**
       
   674 	     * Gives the recipient address
       
   675 	     * @param aIndex index 
       
   676 	     * @return TDesC recipient address
       
   677 	    */		
       
   678 		IMPORT_C const TDesC& operator[](TInt aIndex) const;
       
   679 		
       
   680 	    /**
       
   681 	     * Resets the recipient list
       
   682 	     * @return void
       
   683 	    */		
       
   684 		IMPORT_C void Reset();
       
   685 	
       
   686 	private: 
       
   687 
       
   688 	    /**
       
   689 	     * Symbian Constructor.
       
   690 	    */
       
   691 		void ConstructL();
       
   692 
       
   693 	    /**
       
   694 	     * Constructor
       
   695 	    */
       
   696 		CRecipientList();
       
   697 		
       
   698 	
       
   699 	private:
       
   700 
       
   701 	    /**
       
   702 	     * Recipient type 
       
   703 	    */
       
   704 		RArray<TMsvRecipientType> iRecipientType;
       
   705 
       
   706 	    /**
       
   707 	     * Recipients
       
   708 	    */
       
   709 		CDesCArrayFlat*	iRecipients;
       
   710 };
       
   711 
       
   712 /**
       
   713  * Gives Message header 
       
   714 */
       
   715 class CMessageHeader : public CBase
       
   716 	{
       
   717 	public:
       
   718 	
       
   719 	    /**
       
   720 	     * Two-phased constructor.
       
   721 	     * @return CMessageHeader*
       
   722 	    */
       
   723 		IMPORT_C static CMessageHeader* NewL();
       
   724 	
       
   725 	    /**
       
   726 	    * Destructor.
       
   727 	    */
       
   728 		virtual ~CMessageHeader();
       
   729 		
       
   730 	private:
       
   731 
       
   732 	    /** 
       
   733 	     * Symbain   constructor.
       
   734 	    */
       
   735 		CMessageHeader();
       
   736 		
       
   737 	public:
       
   738 		
       
   739 	    /** 
       
   740 	     * Sets the unread flag
       
   741 	     * @param  aUnread unread flag
       
   742 	     * @return void
       
   743 	    */
       
   744 		IMPORT_C void SetUnreadFlag(const TBool aUnread);
       
   745 
       
   746 	    /** 
       
   747 	     * Gets the unread flag
       
   748 	     * @param aUnead Unread flag	    
       
   749 	     * @return void
       
   750 	    */
       
   751 		IMPORT_C void GetUnreadFlag(TBool& aUnread) const;
       
   752 
       
   753 	    /** 
       
   754 	     * Gets the unread flag
       
   755 	     * @return TBool unread flag	    
       
   756 	    */
       
   757 		IMPORT_C TBool UnreadFlag() const;
       
   758 
       
   759 	    /** 
       
   760 	     * Sets the attahment flag
       
   761 	     * @param aAttachment Attachment flag
       
   762 	     * @return void
       
   763 	    */
       
   764 		IMPORT_C void SetAttachFlag(const TBool aAttachment);
       
   765 
       
   766 	    /** 
       
   767 	     * Gets the attachment flag
       
   768 	     * @param aAttachment Attachment flag	    
       
   769 	     * @return void
       
   770 	    */
       
   771 		IMPORT_C void GetAttachFlag(TBool& aAttachment) const;
       
   772 
       
   773 	    /** 
       
   774 	     * Gets the Attachment flag
       
   775 	     * @return TBool Attachment flag	    
       
   776 	    */
       
   777 		IMPORT_C TBool AttachFlag() const;
       
   778 
       
   779 	    /** 
       
   780 	     * Sets the priority flag
       
   781 	     * @param aPriority Priority flag	    
       
   782 	     * @return void
       
   783 	    */
       
   784 		IMPORT_C void SetPriorityFlag(const TMsvPriority aPriority);
       
   785 
       
   786 	    /** 
       
   787 	     * Gets the priority flag
       
   788 	     * @param aPriority Priority flag	    	    
       
   789 	     * @return void
       
   790 	    */
       
   791 		IMPORT_C void GetPriorityFlag(TMsvPriority& aPriority) const;
       
   792 
       
   793 	    /** 
       
   794 	     * Gets the priority 
       
   795 	     * @return TPtrC Priority 	    	    
       
   796 	    */
       
   797 		IMPORT_C TPtrC Priority() const;
       
   798 
       
   799 	    /** 
       
   800 	     * Sets the mtm type
       
   801 	     * @param aMtm Mtm id
       
   802 	     * @return void
       
   803 	    */
       
   804 		IMPORT_C void SetMtmId(const TUid aMtm);
       
   805 		
       
   806 	    /** 
       
   807 	     * Gets the mtm type
       
   808 	     * @param aMtm Mtm id
       
   809 	     * @return void
       
   810 	    */
       
   811 		IMPORT_C void GetMtmId(TUid& aMtm) const;
       
   812 		
       
   813 	    /** 
       
   814 	     * Gets the mtm type
       
   815 	     * @return TPtrC Message Type
       
   816 	    */
       
   817 		IMPORT_C TPtrC Mtm() const;
       
   818 
       
   819 	    /** 
       
   820 	     * Sets the message id
       
   821 	     * @param aMessageID Message ID
       
   822 	     * @return void
       
   823 	    */
       
   824 		IMPORT_C void SetMessageId(const TMsvId aMessageID);
       
   825 		
       
   826 	    /** 
       
   827 	     * Gets the message id
       
   828 	     * @param aMessageID Message ID
       
   829 	     * @return void
       
   830 	    */
       
   831 		IMPORT_C void GetMessageId(TMsvId& aMessageID) const;
       
   832 		
       
   833 	    /** 
       
   834 	     * Gets the message id
       
   835 	     * @return TMsvId Message ID
       
   836 	    */
       
   837 		IMPORT_C TMsvId MessageId() const;
       
   838 		
       
   839 	    /** 
       
   840 	     * Sets the time 
       
   841 	     * @param aTime Time 
       
   842 	     * @return void
       
   843   	  */
       
   844 		IMPORT_C void SetTime(const TTime& aTime);
       
   845 		
       
   846 	    /** 
       
   847 	     * Gets the time
       
   848 	     * @param aTime Time 
       
   849 	     * @return void
       
   850 	    */
       
   851 		IMPORT_C void GetTime(TTime& aTime) const;
       
   852 		
       
   853 	    /** 
       
   854 	     * Gets the time
       
   855 	     * @return TTime 
       
   856 	    */
       
   857 		IMPORT_C const TTime& Time() const;
       
   858 		
       
   859 	    /** 
       
   860 	     * Sets the sender address
       
   861 	     * @param aFrom Sender address
       
   862 	     * @return void
       
   863 	    */
       
   864 		IMPORT_C void SetFromL(const TDesC& aFrom);
       
   865 		
       
   866 	    /** 
       
   867 	     * Gets the sender address
       
   868 	     * @return TPtrC Sender address
       
   869 	    */
       
   870 		IMPORT_C const TPtrC From() const;
       
   871 		
       
   872 	    /** 
       
   873 	     * Sets the message subject
       
   874 	     * @param aSubject Subject of message
       
   875 	     * @return void
       
   876 	    */
       
   877 		IMPORT_C void SetSubjectL(const TDesC& aSubject);
       
   878 		
       
   879 	    /** 
       
   880 	     * Gets the message 
       
   881 	     * @return TPtrC Subject of message	     
       
   882 	    */
       
   883 		IMPORT_C const TPtrC Subject() const;
       
   884 
       
   885 	private:
       
   886 		
       
   887 	    /** 
       
   888 	     * Unread flag
       
   889 	    */
       
   890 		TBool			iUnread;
       
   891 		
       
   892 	    /** 
       
   893 	     * Attachment flag
       
   894 	    */
       
   895 		TBool			iAttachment;
       
   896 		
       
   897 	    /** 
       
   898 	     * Priority
       
   899 	    */
       
   900 		TMsvPriority	iPriority;
       
   901 		
       
   902 	    /** 
       
   903 	     * Priority as string
       
   904 	    */
       
   905 		HBufC* 			iPriAsString;	
       
   906 
       
   907 	    /** 
       
   908 	     * Mtm
       
   909 	    */
       
   910 		TUid 			iMtm;
       
   911 
       
   912 	    /** 
       
   913 	     * Mtm
       
   914 	    */
       
   915 		HBufC* 			iMtmAsString;
       
   916 		
       
   917 	    /** 
       
   918 	     * Message subject
       
   919 	    */
       
   920 		HBufC* 			iSubject;
       
   921 		
       
   922 	    /** 
       
   923 	     * Address of sender
       
   924 	    */
       
   925 		HBufC* 			iFrom;
       
   926 		
       
   927 	    /** 
       
   928 	     * Time
       
   929 	    */
       
   930 		TTime 			iTime;
       
   931 			
       
   932 	    /** 
       
   933 	     * Entry id of message
       
   934 	    */
       
   935 		TMsvId 			iMessageID;
       
   936 	}; 
       
   937 
       
   938 /**
       
   939  * Messaging Callback base class
       
   940 */
       
   941 class CMsgCallbackBase : public CBase
       
   942 	{
       
   943 	public:
       
   944 
       
   945 	/**
       
   946 	   * Gives the result
       
   947 	   * @param aErrCode Error code
       
   948 	   * @param aResult Result 
       
   949 	   * @return void
       
   950   	*/
       
   951 		virtual void NotifyResultL(TInt aErrCode, TAny* aResult) = 0;
       
   952 
       
   953 		/**
       
   954 	   * Input param 
       
   955   	*/		
       
   956 		const TAny* iPtrInParamList; 
       
   957 
       
   958 		/**
       
   959 	   * Callback 
       
   960   	*/		
       
   961 		TAny* iPtrNotifyCallback; 
       
   962 		
       
   963 		/**
       
   964 	   * Transaction Id
       
   965   	*/		
       
   966 		TInt32 iTransactionId;
       
   967 	};
       
   968 	
       
   969 /**
       
   970  * Interface used to get callback notification from async request module 
       
   971  *	about completion of request. Implemented by the CMessagingService class, 
       
   972  *  which is used by the service modules to notify about request completion.
       
   973 */
       
   974 class MAsyncRequestObserver	
       
   975 	{
       
   976 	public:
       
   977 
       
   978 	/**
       
   979 	   * Notifies Messaging service about the completeion of the request
       
   980 	   * @param aTransactionId Asynchronous request transaction ID
       
   981 	   * @return void
       
   982   	*/
       
   983 		virtual void RequestComplete( TInt32 aTransactionId ) = 0;
       
   984 	};
       
   985 
       
   986 	
       
   987 /**
       
   988  * Structure for storing transaction id and associated active object.
       
   989 */
       
   990 struct TAsyncRequestInfo
       
   991 	{
       
   992 
       
   993     /**
       
   994      * TransactionId
       
   995     */
       
   996 	TInt32 iTransactionId;
       
   997 
       
   998     /**
       
   999      * Active object pointer
       
  1000     */
       
  1001 	CActive* iAsyncObj;
       
  1002 	};
       
  1003 	
       
  1004 
       
  1005 
       
  1006 #endif __MESSAGEHEADER_H