emailservices/emailframework/commonlib/inc/mmrinfoobject.h
changeset 0 8466d47a6819
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2007-2008 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:  Meeting Request Info object processor
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef M_MRINFOOBJECT_H
       
    20 #define M_MRINFOOBJECT_H
       
    21 
       
    22 #include <e32base.h>
       
    23 //<cmail>
       
    24 #include "mmrattachment.h"
       
    25 //</cmail>
       
    26 
       
    27 // Forward declaration
       
    28 class MMROrganizer;
       
    29 class MMRAttendee;
       
    30 class MRRecurrenceRule;
       
    31 
       
    32 /**
       
    33  * MMRInfoObject defines meeting request interface.
       
    34  *
       
    35  * MMRInfoObject can be fetched from ES Email framework, when
       
    36  * meeting request is received in flattened format.
       
    37  *
       
    38  *  @lib FSFWCommonLib
       
    39  *  @since S60 v3.1
       
    40  */
       
    41 class MMRInfoObject
       
    42     {
       
    43 
       
    44 public: // Datatypes and definitions
       
    45 
       
    46     /**  Meeting request fields */
       
    47     enum TESMRInfoField
       
    48         {
       
    49         /** Meeting request ID field */
       
    50         EESMRInfoFieldId,
       
    51         /** Meeting request sequence number field */
       
    52         EESMRInfoFieldSeqNo,
       
    53         /** Meeting request method field */
       
    54         EESMRInfoFieldMethod,
       
    55         /** Meeting request status field */
       
    56         EESMRInfoFieldMStatus,
       
    57         /** Meeting request creation time field */
       
    58         EESMRInfoFieldCreationDateTime,
       
    59         /** Meeting request organizer field */
       
    60         EESMRInfoFieldOrganizer,
       
    61         /** Meeting request attendee field */
       
    62         EESMRInfoFieldAttendee,
       
    63         /** Meeting request optional attendee field */
       
    64         EESMRInfoFieldOptAttendee,
       
    65         /** Meeting request start time field */
       
    66         EESMRInfoFieldStartDateTime,
       
    67         /** Meeting request end time field */
       
    68         EESMRInfoFieldStopDateTime,
       
    69         /** Meeting request location field */
       
    70         EESMRInfoFieldLocation,
       
    71         /** Meeting request alarm field */
       
    72         EESMRInfoFieldAlarm,
       
    73         /** Meeting request subject field */
       
    74         EESMRInfoFieldSubject,
       
    75         /** Meeting request description field */
       
    76         EESMRInfoFieldDescription,
       
    77         /** Meeting request recurrence */
       
    78         EESMRInfoFieldRecurrence,
       
    79         /** Priority field */
       
    80         EESMRInfoFieldPriority,
       
    81         };
       
    82 
       
    83     /** Definition for meeting request method */
       
    84     enum TMRMethod
       
    85         {
       
    86         /** Meeting request request method */
       
    87         EMRMethodRequest,
       
    88         /** Meeting request cancel method */
       
    89         EMRMethodCancel,
       
    90         /** Meeting request response method */
       
    91         EMRMethodResponse
       
    92         };
       
    93 
       
    94 	enum TResponse
       
    95 		{     
       
    96       		EMrCmdResponseAccept,
       
    97 			EMrCmdResponseTentative,
       
    98 			EMrCmdResponseDecline
       
    99 		};    
       
   100 
       
   101 public: // Destruction
       
   102 
       
   103     /**
       
   104      * Virtual destructor.
       
   105      */
       
   106     virtual ~MMRInfoObject()  { }
       
   107 
       
   108 public: // Interface
       
   109 
       
   110     /**
       
   111      * Fetches the supported fields. Supported fields are stored to array 
       
   112      * given as parameter. Array defines the fields that can be fetched 
       
   113      * from meeting request info object
       
   114      *
       
   115      * @param aFields Reference to fields table.
       
   116      * @return KErrNone if successful, otherwise system wide error code.
       
   117      */
       
   118     virtual TInt SupportedFields( RArray<TESMRInfoField>& aFields ) const = 0;
       
   119 
       
   120     /**
       
   121      * Fetches meeting request id. 
       
   122      * @return Meeting request id.
       
   123      * @exception KErrNotFound, if field cannot be fetched.
       
   124      */
       
   125     virtual const TDesC& UidL() const = 0;
       
   126 
       
   127     /**
       
   128      * Fetches meeting request sequence number. 
       
   129      * @return Meeting request sequence number.
       
   130      * @exception KErrNotFound, if field cannot be fetched.
       
   131      */
       
   132     virtual TInt MRSequenceNumberL() const = 0;
       
   133     
       
   134     /**
       
   135      * Fetches meeting request method. 
       
   136      * @return Meeting request method. 
       
   137      * @exception KErrNotFound, if field cannot be fetched.
       
   138      */
       
   139     virtual TMRMethod MRMethodL() const = 0;
       
   140     
       
   141     /**
       
   142      * Fetches reference to MR Organizer.
       
   143      * @return Reference to MR Organizer.
       
   144      * @exception KErrNotFound, if field cannot be fetched.
       
   145      */
       
   146     virtual MMROrganizer& MROrganizerL() = 0;
       
   147     
       
   148     /**
       
   149      * Adds attendee to meeting request. Ownership is transferred
       
   150      * from caller.
       
   151      * @param aAttandee Pointer to added attendee.
       
   152      * @exception System wide error code.
       
   153      */
       
   154     virtual void AddAttendeeL( MMRAttendee* aAttendee ) = 0;
       
   155     
       
   156     /**
       
   157      * Fetches Meeting request attendees.
       
   158      * @return Reference to MR attendees.
       
   159      * @exception KErrNotFound, if field cannot be fetched.
       
   160      */
       
   161     virtual RPointerArray<MMRAttendee>& AttendeesL() = 0;
       
   162 
       
   163     /**
       
   164      * Sets creation time.
       
   165      * @param aTime MR creation time in utc format.
       
   166      * @exception System wide error code.
       
   167      */
       
   168     virtual void SetCreationTimeInUtcL( TTime aTime ) = 0;
       
   169 
       
   170     /**
       
   171      * Fetches meeting request utc creation time. 
       
   172      * @return MR creation time in utc format.
       
   173      * @exception KErrNotFound, if field cannot be fetched.
       
   174      */
       
   175     virtual TTime CreationTimeInUtcL() const = 0;
       
   176     
       
   177     /**
       
   178      * Sets start time.
       
   179      * @param aTime MR start time in utc format.
       
   180      * @exception System wide error code.
       
   181      */
       
   182     virtual void SetStartTimeInUtcL( TTime aTime ) = 0;
       
   183 
       
   184     /**
       
   185      * Fetches meeting request utc start time. 
       
   186      * @return MR start time in utc format.
       
   187      * @exception KErrNotFound, if field cannot be fetched.
       
   188      */
       
   189     virtual TTime StartTimeInUtcL() const = 0;
       
   190     
       
   191     /**
       
   192      * Sets end time.
       
   193      * @param aTime MR end time in utc format.
       
   194      * @exception System wide error code.
       
   195      */
       
   196     virtual void SetEndTimeInUtcL( TTime aTime ) = 0;
       
   197     
       
   198     /**
       
   199      * Fetches meeting request utc end time. 
       
   200      * @return MR end time in utc format.
       
   201      * @exception KErrNotFound, if field cannot be fetched.
       
   202      */
       
   203     virtual TTime EndTimeInUtcL() const = 0;
       
   204     
       
   205     /**
       
   206      * Sets alarm time.
       
   207      * @param aTime MR alarm time in utc format.
       
   208      * @exception System wide error code.
       
   209      */
       
   210     virtual void SetAlarmInUtcL( TTime aTime ) = 0;    
       
   211     
       
   212     /*
       
   213      * Fetches meeting request utc alarm time.
       
   214      * @return MR alarm time in utc format.
       
   215      * @exception KErrNotFound, if field cannot be fetched.     
       
   216      */
       
   217     virtual TTime AlarmInUtcL() const = 0;
       
   218     
       
   219     /**
       
   220      * Sets meeting request location.
       
   221      * @param aLocation Reference to location.
       
   222      * @exception System wide error code.
       
   223      */
       
   224     virtual void SetLocationL( const TDesC& aLocation ) = 0;
       
   225     
       
   226     /**
       
   227      * Fetches meeting request location.
       
   228      * @return Reference to MR location.
       
   229      * @exception KErrNotFound, if field cannot be fetched.
       
   230      */
       
   231     virtual const TDesC& LocationL() const = 0;
       
   232     
       
   233     /**
       
   234      * Sets meeting request description.
       
   235      * @param aLocation Reference to description.
       
   236      * @exception System wide error code.
       
   237      */
       
   238     virtual void SetDescriptionL( const TDesC& aDescription ) = 0;    
       
   239     
       
   240     /**
       
   241      * Fetches meeting request description.
       
   242      * @return Reference to MR description.
       
   243      * @exception KErrNotFound, if field cannot be fetched.
       
   244      */
       
   245     virtual const TDesC& DescriptionL() const = 0;
       
   246     
       
   247     /**
       
   248      * Sets meeting request subject.
       
   249      * @param aLocation Reference to subject.
       
   250      * @exception System wide error code.
       
   251      */
       
   252     virtual void SetSubjectL( const TDesC& aSubject ) = 0;       
       
   253     
       
   254     /**
       
   255      * Fetches meeting request subject.
       
   256      * @return Reference to MR subject.
       
   257      * @exception KErrNotFound, if field cannot be fetched.
       
   258      */
       
   259     virtual const TDesC& SubjectL() const = 0;    
       
   260 
       
   261     /**
       
   262      * meeting request response mutator
       
   263      * 
       
   264      */
       
   265     virtual void SetMRResponseL( TResponse aResponse ) = 0;
       
   266     
       
   267     /**
       
   268      * meeting request response accessor
       
   269      * 
       
   270      */
       
   271     virtual TResponse MRResponse() const = 0;
       
   272     
       
   273     /**
       
   274      * meeting request recurrence start time mutator
       
   275      * 
       
   276      */
       
   277     virtual void SetMRRecurrenceIdL( TTime aRecId ) = 0;
       
   278     
       
   279     /**
       
   280      * meeting request recurrence start time accessor
       
   281      * 
       
   282      */
       
   283     virtual TTime MRRecurrenceId() const = 0;
       
   284     
       
   285     /**
       
   286      * Sets recurrence rule information.
       
   287      * @return Reference to MR recurrence information.
       
   288      * @exception System wide error code.
       
   289      */
       
   290     virtual void SetRecurrenceRuleL(const MRRecurrenceRule& aRRule) = 0;
       
   291     
       
   292     /**
       
   293      * Fetches recurrence rule information.
       
   294      * @return Reference to MR recurrence information.
       
   295      * @exception KErrNotFound, if field cannot be fetched.
       
   296      */
       
   297     virtual const MRRecurrenceRule& RecurrenceRuleL() const = 0;
       
   298     
       
   299     /**
       
   300      * Adds recurrence exception to this meeting request. Ownership is transferred
       
   301      * from caller.
       
   302      * @param aRule Reference to MR recurrence exception information.
       
   303      * @exception System wide error code.
       
   304      */
       
   305     virtual void AddRecurrenceExceptionL( MMRInfoObject* aException ) = 0;
       
   306     
       
   307     /**
       
   308      * Fetches recurrence exception information. 
       
   309      * @return Reference to MR recurrence exception information.
       
   310      * @exception KErrNotFound, if field cannot be fetched.
       
   311      */
       
   312     virtual const RPointerArray<MMRInfoObject>& RecurrenceExceptionsL() const = 0;
       
   313     
       
   314     /**
       
   315      * Sets MR priority.
       
   316      * @param aPriority MR priority.
       
   317      * @exception System wide error code.
       
   318      */    
       
   319     virtual void SetPriorityL( TUint aPriority ) = 0;
       
   320         
       
   321     /**
       
   322      * Fetches MR priority.
       
   323      * @return MR priority.
       
   324      * @exception KErrNotFound, if field cannot be fetched.
       
   325      */
       
   326     virtual TUint PriorityL() const = 0;
       
   327     
       
   328     /**
       
   329      * Fetches meeting request attachments.
       
   330      * @return MR attachments.
       
   331      * @exception KErrNotFound, if field cannot be fetched.
       
   332      */
       
   333     virtual const RPointerArray<MMRAttachment>& AttachmentsL() const = 0;
       
   334     
       
   335     /**
       
   336      * Adds meeting request attachment. Ownership is transferred.
       
   337      * @param aAttachment Attacment to be added.
       
   338      * @exception System wide error code.
       
   339      */
       
   340     virtual void AddAttachmentsL(MMRAttachment* aAttachment) = 0;
       
   341     
       
   342     /**
       
   343      * Fetches MMRInfoObject extension interface. Caller is responsible
       
   344      * for casting returned parameter. Ownership is not transferred to 
       
   345      * caller.
       
   346      * @param aExtensionUid
       
   347      * @return Pointer to MMRInfoObject extension interface.
       
   348      */
       
   349     virtual TAny* ExtensionL( TUid aExtensionUid ) = 0;
       
   350     };
       
   351 
       
   352 #endif // M_MRINFOOBJECT_H