creator/engine/src/creator_calendar.cpp
changeset 51 b048e15729d6
parent 28 4cc0d1a608c1
child 52 36d60d12b4af
equal deleted inserted replaced
44:5db69f4c3d06 51:b048e15729d6
    24 #include "creator_scriptentry.h"
    24 #include "creator_scriptentry.h"
    25 #include <e32base.h>
    25 #include <e32base.h>
    26 #include <e32math.h>
    26 #include <e32math.h>
    27 #include <calrrule.h> 
    27 #include <calrrule.h> 
    28 #include <calalarm.h>
    28 #include <calalarm.h>
       
    29 #include "creator_contactsetcache.h"
       
    30 #include "creator_phonebook.h"
    29 
    31 
    30 static const TInt KCalendarFieldLength = 128;
    32 static const TInt KCalendarFieldLength = 128;
    31 
    33 
    32 
    34 
    33 CCreatorCalenderAttendee::CCreatorCalenderAttendee() 
    35 CCreatorCalenderAttendee::CCreatorCalenderAttendee() 
   813         	attendee->SetResponseRequested(ETrue);
   815         	attendee->SetResponseRequested(ETrue);
   814         	aCalEntry.AddAttendeeL(attendee);
   816         	aCalEntry.AddAttendeeL(attendee);
   815         	CleanupStack::Pop(); // attendee
   817         	CleanupStack::Pop(); // attendee
   816         	}
   818         	}
   817         }
   819         }
       
   820     // linked attendees:
       
   821      for( TInt i = 0; i < parameters->iAttendeeLinkIds.Count(); ++i )
       
   822         {
       
   823         CCreatorPhonebook* phonebook = dynamic_cast<CCreatorPhonebook*>(iEngine->GetPhonebook());
       
   824         User::LeaveIfNull( phonebook );
       
   825         CCreatorPhonebookWrapper* phonebookWrapper = phonebook->GetPhonebookWrapper();
       
   826         
       
   827         TLinkIdParam attendeeLinkId = parameters->iAttendeeLinkIds[i];
       
   828         const CCreatorContactSet& set = ContactLinkCache::Instance()->ContactSet(attendeeLinkId.iLinkId);
       
   829         const RArray<TUint32> links = set.ContactLinks();
       
   830         TInt numberOfExplicitLinks = links.Count(); // Number of defined contacts in contact-set
       
   831         for( TInt j = 0; j < numberOfExplicitLinks; ++j )
       
   832             {
       
   833             TBuf<128> email;
       
   834             TBuf<128> name;
       
   835             TBuf<128> phoneNumber;
       
   836             phonebookWrapper->GetContactDetailsL( links[j], name, phoneNumber, email );
       
   837             CCalAttendee* attendee = CCalAttendee::NewL( email );
       
   838             CleanupStack::PushL(attendee);
       
   839             if( name.Length() > 0 )
       
   840                 attendee->SetCommonNameL( name );
       
   841             attendee->SetResponseRequested(ETrue);
       
   842             aCalEntry.AddAttendeeL(attendee);
       
   843             CleanupStack::Pop(); // attendee
       
   844             }
       
   845         }
   818     }
   846     }
   819 //----------------------------------------------------------------------------
   847 //----------------------------------------------------------------------------
   820 
   848 
   821 TInt CCreatorInterimCalendar::CreateEventEntryL (
   849 TInt CCreatorInterimCalendar::CreateEventEntryL (
   822         CCreatorModuleBaseParameters *aParameters )
   850         CCreatorModuleBaseParameters *aParameters )