pimappservices/calendar/client/src/caluser.cpp
changeset 0 f979ecb2b13e
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include "caluserimpl.h"
       
    17 
       
    18 /** Constructor.
       
    19 @internalComponent
       
    20 */
       
    21 CCalUser::CCalUser(CCalUserImpl* aImpl)
       
    22 	: iImpl(aImpl)
       
    23 	{
       
    24 	}
       
    25 
       
    26 /** Constructor.
       
    27 All variables are implicitly set to default values due to CBase derivation.
       
    28 iRole set to TCalRole::EReqParticipant.
       
    29 iStatus set to TCalStatus::ENeedsAction.
       
    30 The default value must be at index position 0 of the enum.
       
    31 @internalComponent
       
    32 */
       
    33 CCalUser::CCalUser()
       
    34 	{
       
    35 	}
       
    36 
       
    37 /** Destructor.
       
    38 
       
    39 @publishedAll
       
    40 @released
       
    41 @capability None
       
    42 */
       
    43 EXPORT_C CCalUser::~CCalUser()
       
    44 	{
       
    45 	delete iImpl;
       
    46 	}
       
    47 
       
    48 /** Allocates and constructs a new user with the specified email address.
       
    49 
       
    50 @param aAddress The address of the user.
       
    51 @return The newly constructed object.
       
    52 
       
    53 @publishedAll
       
    54 @released
       
    55 @capability None
       
    56 */
       
    57 EXPORT_C CCalUser* CCalUser::NewL(const TDesC& aAddress)
       
    58 	{
       
    59 	CCalUser* self = new (ELeave) CCalUser();
       
    60 	CleanupStack::PushL(self);
       
    61 	self->ConstructL(aAddress);
       
    62 	CleanupStack::Pop(self);
       
    63 	return self;
       
    64 	}
       
    65 
       
    66 /** Allocates and constructs a new user with the specified email address and sender.
       
    67 
       
    68 @param aAddress The address of the user.
       
    69 @param aSentBy The sender.
       
    70 @return The newly constructed object.
       
    71 
       
    72 @publishedAll
       
    73 @released
       
    74 @capability None
       
    75 */
       
    76 EXPORT_C CCalUser* CCalUser::NewL(const TDesC& aAddress, const TDesC& aSentBy)
       
    77 	{
       
    78 	CCalUser* self = new (ELeave) CCalUser();
       
    79 	CleanupStack::PushL(self);
       
    80 	self->ConstructL(aAddress, aSentBy);
       
    81 	CleanupStack::Pop(self);
       
    82 	return self;
       
    83 	}
       
    84 // Takes ownership of the implementation class
       
    85 CCalUser* CCalUser::NewL(CCalUserImpl* aImpl)
       
    86 	{
       
    87 	CCalUser* self = new (ELeave) CCalUser(aImpl);
       
    88 	return self;
       
    89 	}
       
    90 
       
    91 /** Second phase constructor.
       
    92 @internalComponent
       
    93 */
       
    94 void CCalUser::ConstructL(const TDesC& aAddress)
       
    95 	{
       
    96 	iImpl = CCalUserImpl::NewL(aAddress);
       
    97 	}
       
    98 
       
    99 /** Second phase constructor.
       
   100 @internalComponent
       
   101 */
       
   102 void CCalUser::ConstructL(const TDesC& aAddress, const TDesC& aSentBy)
       
   103 	{
       
   104 	iImpl = CCalUserImpl::NewL(aAddress, aSentBy);
       
   105 	}
       
   106 
       
   107 /** Gets the email address of the user.
       
   108 
       
   109 @return The address.
       
   110 
       
   111 @publishedAll
       
   112 @released
       
   113 @capability None
       
   114 */
       
   115 EXPORT_C const TDesC& CCalUser::Address() const
       
   116 	{
       
   117 	return iImpl->Address();
       
   118 	}
       
   119 
       
   120 /** Gets the iCalendar-defined common name (CN) of the user.
       
   121 
       
   122 @return The common name.
       
   123 
       
   124 @publishedAll
       
   125 @released
       
   126 @capability None
       
   127 */
       
   128 EXPORT_C const TDesC& CCalUser::CommonName() const
       
   129 	{
       
   130 	return iImpl->CommonName();
       
   131 	}
       
   132 
       
   133 /** Gets the sender of the user.
       
   134 
       
   135 @return The sender.
       
   136 
       
   137 @publishedAll
       
   138 @released
       
   139 @capability None
       
   140 */
       
   141 EXPORT_C const TDesC& CCalUser::SentBy() const
       
   142 	{
       
   143 	return iImpl->SentBy();
       
   144 	}
       
   145 
       
   146 CCalUserImpl* CCalUser::Impl() const
       
   147 	{
       
   148 	return iImpl;
       
   149 	}
       
   150 
       
   151 /** Sets the iCalendar-defined common name (CN) of the user.
       
   152 
       
   153 @param aCommonName The common name.
       
   154 
       
   155 @publishedAll
       
   156 @released
       
   157 @capability None
       
   158 */
       
   159 EXPORT_C void CCalUser::SetCommonNameL(const TDesC& aCommonName)
       
   160 	{
       
   161 	iImpl->SetCommonNameL(aCommonName);
       
   162 	}
       
   163 
       
   164 CCalAttendee::CCalAttendee()
       
   165 	{
       
   166 	}
       
   167 
       
   168 CCalAttendee::CCalAttendee(CCalUserImpl* aImpl)
       
   169 	: CCalUser(aImpl)
       
   170 	{
       
   171 	}
       
   172 
       
   173 /** Allocates and constructs a new attendee with the specified email address.
       
   174 
       
   175 @param aAddress The address of the attendee.
       
   176 @return Pointer to newly constructed object
       
   177 @publishedAll
       
   178 @released
       
   179 @capability None
       
   180 */
       
   181 EXPORT_C CCalAttendee* CCalAttendee::NewL(const TDesC& aAddress)
       
   182 
       
   183 	{
       
   184 	CCalAttendee* self = new (ELeave) CCalAttendee();
       
   185 	CleanupStack::PushL(self);
       
   186 	self->ConstructL(aAddress);
       
   187 	CleanupStack::Pop(self);
       
   188 	return self;
       
   189 	}
       
   190 
       
   191 /** Allocates and constructs a new attendee with the specified email address and sender.
       
   192 
       
   193 @param aAddress The address of the attendee.
       
   194 @param aSentby The sender.
       
   195 @return Pointer to newly constructed object
       
   196 @publishedAll
       
   197 @released
       
   198 @capability None
       
   199 */
       
   200 EXPORT_C CCalAttendee* CCalAttendee::NewL(const TDesC& aAddress, const TDesC& aSentBy)
       
   201 	{
       
   202 	CCalAttendee* self = new (ELeave) CCalAttendee();
       
   203 	CleanupStack::PushL(self);
       
   204 	self->ConstructL(aAddress, aSentBy);
       
   205 	CleanupStack::Pop(self);
       
   206 	return self;
       
   207 	}
       
   208 
       
   209 
       
   210 CCalAttendee* CCalAttendee::NewL(CCalUserImpl* aImpl)
       
   211 	{
       
   212 	CCalAttendee* self = new (ELeave) CCalAttendee(aImpl);
       
   213 	return self;
       
   214 	}
       
   215 
       
   216 /** Get the role of this attendee.
       
   217 
       
   218 @return The role.
       
   219 
       
   220 @publishedAll
       
   221 @released
       
   222 @capability None
       
   223 */
       
   224 EXPORT_C CCalAttendee::TCalRole CCalAttendee::RoleL() const
       
   225 	{
       
   226 	return iImpl->RoleL();
       
   227 	}
       
   228 
       
   229 /** Get the status of this attendee.
       
   230 
       
   231 @return The status.
       
   232 
       
   233 @publishedAll
       
   234 @released
       
   235 @capability None
       
   236 */
       
   237 EXPORT_C CCalAttendee::TCalStatus CCalAttendee::StatusL() const
       
   238 	{
       
   239 	return iImpl->StatusL();
       
   240 	}
       
   241 
       
   242 /** Gets whether or not a response was requested for this attendee.
       
   243 @publishedAll
       
   244 @released
       
   245 @capability None
       
   246 @return ETrue if a response was requested, EFalse if not. */
       
   247 EXPORT_C TBool CCalAttendee::ResponseRequested() const
       
   248 	{
       
   249 	return iImpl->ResponseRequested();
       
   250 	}
       
   251 
       
   252 /** Set the role of this attendee.
       
   253 
       
   254 @param aRole The role.
       
   255 
       
   256 @publishedAll
       
   257 @released
       
   258 @capability None
       
   259 */
       
   260 EXPORT_C void CCalAttendee::SetRoleL(TCalRole aRole)
       
   261 	{
       
   262 	iImpl->SetRoleL(aRole);
       
   263 	}
       
   264 
       
   265 /** Set the status of this attendee.
       
   266 
       
   267 @param aStatus The status.
       
   268 
       
   269 @publishedAll
       
   270 @released
       
   271 @capability None
       
   272 */
       
   273 EXPORT_C void CCalAttendee::SetStatusL(TCalStatus aStatus)
       
   274 	{
       
   275 	iImpl->SetStatusL(aStatus);
       
   276 	}
       
   277 
       
   278 /** Sets whether or not a response was requested for this attendee.
       
   279 
       
   280 @param aRsvp ETrue if a response was requested, EFalse if not.
       
   281 
       
   282 @publishedAll
       
   283 @released
       
   284 @capability None
       
   285 */
       
   286 EXPORT_C void CCalAttendee::SetResponseRequested(TBool aRsvp)
       
   287 	{
       
   288 	iImpl->SetResponseRequested(aRsvp);
       
   289 	}
       
   290 
       
   291 /** Sets the expected response of this attendee.
       
   292 This property is supported in vCalendar only.
       
   293 @param aExpected The expected response.
       
   294 
       
   295 @publishedAll
       
   296 @released
       
   297 @capability None
       
   298 */
       
   299 EXPORT_C void CCalAttendee::SetVCalExpect(TVCalExpect aExpected)
       
   300 	{
       
   301 	iImpl->SetVCalExpect(aExpected);
       
   302 	}
       
   303 	
       
   304 /** Gets the expected response of this attendee.
       
   305 This property is supported in vCalendar only.
       
   306 @return The expected response.
       
   307 
       
   308 @publishedAll
       
   309 @released
       
   310 @capability None
       
   311 */
       
   312 EXPORT_C CCalAttendee::TVCalExpect CCalAttendee::VCalExpect() const
       
   313 	{
       
   314 	return iImpl->VCalExpect();
       
   315 	}
       
   316