emailservices/emailstore/base_plugin/inc/BaseMrInfoObject.h
changeset 0 8466d47a6819
child 8 e1b6206813b4
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Meeting request support.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __BASEMRINFOOBJECT_H__
       
    20 #define __BASEMRINFOOBJECT_H__
       
    21 
       
    22 #include <e32std.h>
       
    23 #include "CFSMailCommon.h"
       
    24 #include "mmrinfoobject.h"
       
    25 #include "mmrorganizer.h"
       
    26 #include "mmrattendee.h"
       
    27 #include "mmrattachment.h"
       
    28 #include "mmrinfoprocessor.h"
       
    29 #include "mmrrecurrencerule.h"
       
    30 
       
    31 
       
    32 class CBasePlugin;
       
    33 
       
    34 
       
    35 const TUint KIcalNormalPriority = 5; 
       
    36 
       
    37 
       
    38 /**
       
    39  * Use where you need an attendee and/or an organizer.
       
    40  */
       
    41 class CBaseMrAttendee :
       
    42     public CBase,
       
    43     public MMRAttendee
       
    44     {
       
    45 
       
    46     public:
       
    47         IMPORT_C static CBaseMrAttendee* NewL();
       
    48         IMPORT_C static CBaseMrAttendee* NewL(
       
    49             const MMRAttendee& aAttendee );
       
    50         IMPORT_C static CBaseMrAttendee* NewL(
       
    51             const MMROrganizer& aOrganizer );
       
    52         IMPORT_C virtual ~CBaseMrAttendee();
       
    53 
       
    54     private:
       
    55         CBaseMrAttendee();
       
    56         void ConstructL();
       
    57         void ConstructL(
       
    58             const MMRAttendee& aAttendee );
       
    59         void ConstructL(
       
    60             const MMROrganizer& aOrganizer );
       
    61 
       
    62 
       
    63     // MRAttendee //
       
    64     public:
       
    65 
       
    66         IMPORT_C void SetAttendeeRoleL(
       
    67             TAttendeeRole aRole );
       
    68      
       
    69         IMPORT_C TAttendeeRole AttendeeRole() const;
       
    70     
       
    71         IMPORT_C void SetAttendeeStatusL(
       
    72             TAttendeeStatus& aStatus );
       
    73     
       
    74         IMPORT_C TAttendeeStatus AttendeeStatus() const;
       
    75     
       
    76         IMPORT_C void SetResponseRequestedL(
       
    77             TBool aRsvp );
       
    78     
       
    79         IMPORT_C TBool ResponseRequested() const;
       
    80 
       
    81 
       
    82     // MMROrganizer //
       
    83     public:
       
    84         IMPORT_C void SetAddressL(  
       
    85             const TDesC& aAddress );
       
    86 
       
    87         IMPORT_C const TDesC& Address() const;
       
    88     
       
    89         IMPORT_C void SetCommonNameL(
       
    90             const TDesC& aCommonName );
       
    91     
       
    92         IMPORT_C const TDesC& CommonName() const;
       
    93         
       
    94     protected:
       
    95         HBufC* iAddress;
       
    96         HBufC* iCommonName;
       
    97         TAttendeeRole iRole;
       
    98         TAttendeeStatus iStatus;
       
    99         TBool iRsvp;
       
   100     };
       
   101 
       
   102 
       
   103 /**
       
   104  *
       
   105  */
       
   106 class CBaseMrRecurrenceRule :
       
   107     public CBase,
       
   108     public MRRecurrenceRule
       
   109     {
       
   110 
       
   111     public:
       
   112 
       
   113         IMPORT_C static CBaseMrRecurrenceRule* NewL();
       
   114 
       
   115         IMPORT_C static CBaseMrRecurrenceRule* NewL(
       
   116             const MRRecurrenceRule& aRrule );
       
   117 
       
   118         IMPORT_C virtual ~CBaseMrRecurrenceRule();
       
   119 
       
   120 
       
   121     private:
       
   122         CBaseMrRecurrenceRule();
       
   123         CBaseMrRecurrenceRule(
       
   124             const MRRecurrenceRule& aRrule );
       
   125         void ConstructL();
       
   126         void ConstructL(
       
   127             const MRRecurrenceRule& aRrule );
       
   128 
       
   129     // MRRecurrenceRule //
       
   130     public:
       
   131         IMPORT_C void SetRecurrenceTypeL(
       
   132             TMRRecurrenceType aType );
       
   133 
       
   134         IMPORT_C TMRRecurrenceType Type() const;
       
   135 
       
   136         IMPORT_C void SetRecurrenceStartTimeL(
       
   137             TTime aStartTime );
       
   138 
       
   139         IMPORT_C TTime RecurrenceStartTime() const;
       
   140 
       
   141         IMPORT_C void SetRecurrenceUntilL(
       
   142             TTime aUntilTime );
       
   143 
       
   144         IMPORT_C TTime RecurrentUntil() const;
       
   145     
       
   146         IMPORT_C void SetRecurrentInterval(
       
   147             TInt aInterval );
       
   148     
       
   149         IMPORT_C TInt RecurrentInterval() const;
       
   150     
       
   151         IMPORT_C void SetRecurrentCountL(
       
   152             TInt aCount );
       
   153     
       
   154         IMPORT_C TUint RecurrentCount() const;
       
   155     
       
   156         IMPORT_C void SetRecurrentWeekDaysL(
       
   157             RArray<TMRRecurrentDay>& aDays );
       
   158     
       
   159         IMPORT_C const RArray<TMRRecurrentDay>& RecurrentWeekDays() const;
       
   160     
       
   161         IMPORT_C void SetRecurrentMonthDaysL(
       
   162             RArray<TInt>& aDays );
       
   163     
       
   164         IMPORT_C const RArray<TInt>& RecurrentMonthDays() const;
       
   165 
       
   166 	    IMPORT_C void SetRecurrentDaysofMonthL(
       
   167 	        RArray<TRecurrentDaysofMonth>& aDaysosMonth );
       
   168 		
       
   169 	    IMPORT_C const RArray<TRecurrentDaysofMonth>& RecurrentDaysofMonth() const;
       
   170 
       
   171         IMPORT_C void SetRecurrentMonthsL(
       
   172             RArray<TMRRecurrenceMonth>& aMonths );
       
   173     
       
   174         IMPORT_C const RArray<TMRRecurrenceMonth>& RecurrentMonths() const;
       
   175         
       
   176     protected:
       
   177         RArray<TRecurrentDaysofMonth> iDaysofMonth;
       
   178         RArray<TMRRecurrentDay> iWeekDays;
       
   179         RArray<TInt> iMonthDays;
       
   180         RArray<TMRRecurrenceMonth> iMonths;
       
   181         TTime iStartTime;
       
   182         TTime iUntilTime;
       
   183         TMRRecurrenceType iType;
       
   184         TInt iInterval;
       
   185         TInt iCount;
       
   186     };
       
   187 
       
   188 
       
   189 /**
       
   190  *
       
   191  */
       
   192 class CBaseMrInfoObject :
       
   193     public CBase,
       
   194     public MMRInfoObject
       
   195 
       
   196     {
       
   197     
       
   198     public:
       
   199         IMPORT_C static CBaseMrInfoObject* NewL();
       
   200         IMPORT_C static CBaseMrInfoObject* NewL(
       
   201             MMRInfoObject& aMrInfo );
       
   202         IMPORT_C virtual ~CBaseMrInfoObject();
       
   203 
       
   204     private:
       
   205         CBaseMrInfoObject();
       
   206         void ConstructL();
       
   207         void ConstructL(
       
   208             MMRInfoObject& aMrInfo );
       
   209 
       
   210     public:
       
   211         IMPORT_C void SetUidL(
       
   212             const TDesC& aUid );
       
   213         IMPORT_C void SetUidL(
       
   214             HBufC* aUid );
       
   215         IMPORT_C void SetMethod(
       
   216             TMRMethod aMethod );
       
   217         IMPORT_C void SetMRSequenceNumber(
       
   218         	TInt aSeqNo );
       
   219         
       
   220     // MMRInfoObject //
       
   221     public:
       
   222 
       
   223         IMPORT_C TInt SupportedFields(
       
   224             RArray<TESMRInfoField>& aFields ) const;
       
   225     
       
   226         IMPORT_C const TDesC& UidL() const;
       
   227     
       
   228         IMPORT_C TInt MRSequenceNumberL() const;
       
   229         
       
   230         IMPORT_C TMRMethod MRMethodL() const;
       
   231         
       
   232         IMPORT_C MMROrganizer& MROrganizerL();
       
   233         
       
   234         IMPORT_C void AddAttendeeL(
       
   235             MMRAttendee* aAttendee );
       
   236         
       
   237         IMPORT_C RPointerArray<MMRAttendee>& AttendeesL();
       
   238     
       
   239         IMPORT_C void SetCreationTimeInUtcL(
       
   240             TTime aTime );
       
   241     
       
   242         IMPORT_C TTime CreationTimeInUtcL() const;
       
   243         
       
   244         IMPORT_C void SetStartTimeInUtcL(
       
   245             TTime aTime );
       
   246     
       
   247         IMPORT_C TTime StartTimeInUtcL() const;
       
   248         
       
   249         IMPORT_C void SetEndTimeInUtcL(
       
   250             TTime aTime );
       
   251         
       
   252         IMPORT_C TTime EndTimeInUtcL() const;
       
   253         
       
   254         IMPORT_C void SetAlarmInUtcL(
       
   255             TTime aTime );    
       
   256         
       
   257         IMPORT_C TTime AlarmInUtcL() const;
       
   258         
       
   259         IMPORT_C void SetLocationL(
       
   260             const TDesC& aLocation );
       
   261         
       
   262         IMPORT_C const TDesC& LocationL() const;
       
   263         
       
   264         IMPORT_C void SetDescriptionL(
       
   265             const TDesC& aDescription );    
       
   266         
       
   267         IMPORT_C const TDesC& DescriptionL() const;
       
   268         
       
   269         IMPORT_C void SetSubjectL(
       
   270             const TDesC& aSubject );       
       
   271         
       
   272         IMPORT_C const TDesC& SubjectL() const;    
       
   273         
       
   274         IMPORT_C void SetRecurrenceRuleL(
       
   275             const MRRecurrenceRule& aRRule );
       
   276         
       
   277         IMPORT_C const MRRecurrenceRule& RecurrenceRuleL() const;
       
   278 
       
   279         IMPORT_C void AddRecurrenceExceptionL(
       
   280             MMRInfoObject* aException );
       
   281         
       
   282         IMPORT_C const RPointerArray<MMRInfoObject>& RecurrenceExceptionsL() const;
       
   283         
       
   284         IMPORT_C void SetPriorityL(
       
   285             TUint aPriority );
       
   286             
       
   287         IMPORT_C TUint PriorityL() const;
       
   288         
       
   289         IMPORT_C const RPointerArray<MMRAttachment>& AttachmentsL() const;
       
   290         
       
   291         IMPORT_C void AddAttachmentsL(
       
   292             MMRAttachment* aAttachment );
       
   293         
       
   294         IMPORT_C TAny* ExtensionL(
       
   295             TUid aExtensionUid );
       
   296 
       
   297         IMPORT_C void SetMRResponseL(
       
   298             TResponse aResponse );
       
   299     
       
   300         IMPORT_C TResponse MRResponse() const;
       
   301 
       
   302         IMPORT_C void SetMRRecurrenceIdL(
       
   303             TTime aRecId );
       
   304         
       
   305         IMPORT_C TTime MRRecurrenceId() const;
       
   306 
       
   307 
       
   308     protected:
       
   309         RPointerArray<MMRInfoObject> iExceptions;
       
   310         RPointerArray<MMRAttachment> iAttachments;
       
   311         RPointerArray<MMRAttendee> iAttendees;
       
   312         MMRAttendee* iOrganizer;
       
   313         const MRRecurrenceRule* /*ref*/ iRrule;
       
   314         HBufC* iUid;
       
   315         HBufC* iLocation;
       
   316         HBufC* iSubject;
       
   317         HBufC* iDescription;        
       
   318         TTime iCreationTime;
       
   319         TTime iStartTime;
       
   320         TTime iEndTime;
       
   321         TTime iAlarmTime;
       
   322         TTime iRecurrenceId;
       
   323         TInt iSequenceNumber;
       
   324         TUint iPriority;
       
   325         TMRMethod iMethod;
       
   326         TResponse iResponse;
       
   327     };
       
   328 
       
   329 
       
   330 /**
       
   331  *
       
   332  */
       
   333 class CBaseMrInfoProcessor :
       
   334     public CBase,
       
   335     public MMRInfoProcessor
       
   336     {
       
   337 
       
   338     public:
       
   339         IMPORT_C static CBaseMrInfoProcessor* NewL(
       
   340             CBasePlugin& aPlugin );
       
   341         IMPORT_C virtual ~CBaseMrInfoProcessor();
       
   342 
       
   343     private:
       
   344         CBaseMrInfoProcessor(
       
   345             CBasePlugin& aPlugin );
       
   346         void ConstructL();
       
   347 
       
   348 
       
   349     public:
       
   350         IMPORT_C virtual void ReplyToMeetingRequestL(
       
   351             const TFSMailMsgId& aMailBoxId,
       
   352             const TFSMailMsgId& aMessageId,
       
   353             MMRInfoObject& aMeetingRequest,
       
   354             TMRInfoResponseMode& aResponseMode,
       
   355             const TDesC& aResponseText = KNullDesC() );
       
   356             
       
   357     private:
       
   358         CBasePlugin& iPlugin;
       
   359     };
       
   360 
       
   361 
       
   362 #endif // __BASEMRINFOOBJECT_H__