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