creator/engine/src/creator_calendar.cpp
changeset 48 da3ec8478e66
parent 23 c9bf25a20c9f
child 52 36d60d12b4af
--- a/creator/engine/src/creator_calendar.cpp	Thu Sep 02 20:27:24 2010 +0300
+++ b/creator/engine/src/creator_calendar.cpp	Fri Sep 17 08:29:47 2010 +0300
@@ -26,6 +26,8 @@
 #include <e32math.h>
 #include <calrrule.h> 
 #include <calalarm.h>
+#include "creator_contactsetcache.h"
+#include "creator_phonebook.h"
 
 static const TInt KCalendarFieldLength = 128;
 
@@ -815,6 +817,32 @@
         	CleanupStack::Pop(); // attendee
         	}
         }
+    // linked attendees:
+     for( TInt i = 0; i < parameters->iAttendeeLinkIds.Count(); ++i )
+        {
+        CCreatorPhonebook* phonebook = dynamic_cast<CCreatorPhonebook*>(iEngine->GetPhonebook());
+        User::LeaveIfNull( phonebook );
+        CCreatorPhonebookWrapper* phonebookWrapper = phonebook->GetPhonebookWrapper();
+        
+        TLinkIdParam attendeeLinkId = parameters->iAttendeeLinkIds[i];
+        const CCreatorContactSet& set = ContactLinkCache::Instance()->ContactSet(attendeeLinkId.iLinkId);
+        const RArray<TUint32> links = set.ContactLinks();
+        TInt numberOfExplicitLinks = links.Count(); // Number of defined contacts in contact-set
+        for( TInt j = 0; j < numberOfExplicitLinks; ++j )
+            {
+            TBuf<128> email;
+            TBuf<128> name;
+            TBuf<128> phoneNumber;
+            phonebookWrapper->GetContactDetailsL( links[j], name, phoneNumber, email );
+            CCalAttendee* attendee = CCalAttendee::NewL( email );
+            CleanupStack::PushL(attendee);
+            if( name.Length() > 0 )
+                attendee->SetCommonNameL( name );
+            attendee->SetResponseRequested(ETrue);
+            aCalEntry.AddAttendeeL(attendee);
+            CleanupStack::Pop(); // attendee
+            }
+        }
     }
 //----------------------------------------------------------------------------