pimappservices/calendar/client/src/calcategory.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 "calcategoryimpl.h"
       
    17 
       
    18 CCalCategory::CCalCategory(CCalCategoryImpl* aImpl)
       
    19 	{
       
    20 	iCalCategoryImpl = aImpl;
       
    21 	}
       
    22 
       
    23 CCalCategory::CCalCategory()
       
    24 	{
       
    25 	}
       
    26 
       
    27 void CCalCategory::ConstructL(CCalCategory::TCalCategoryType aCategoryType)
       
    28 	{
       
    29 	iCalCategoryImpl = CCalCategoryImpl::NewL(aCategoryType);
       
    30 	}
       
    31 
       
    32 void CCalCategory::ConstructL(const TDesC& aExtendedName)
       
    33 	{
       
    34 	iCalCategoryImpl = CCalCategoryImpl::NewL(aExtendedName);
       
    35 	}
       
    36 
       
    37 CCalCategoryImpl* CCalCategory::Impl() const
       
    38 	{
       
    39 	return iCalCategoryImpl;
       
    40 	}
       
    41 
       
    42 CCalCategory* CCalCategory::NewL(CCalCategoryImpl* aImpl)
       
    43 	{
       
    44 	return new (ELeave) CCalCategory(aImpl);;
       
    45 	}
       
    46 
       
    47 /** Allocates and constructs a category object of one of the standard types.
       
    48 @publishedAll
       
    49 @released
       
    50 @capability None
       
    51 @param aCategoryType The category type.
       
    52 @return Pointer to newly created category object.
       
    53 */
       
    54 EXPORT_C CCalCategory* CCalCategory::NewL(CCalCategory::TCalCategoryType aCategoryType)
       
    55 	{
       
    56 	CCalCategory* self = new (ELeave) CCalCategory();
       
    57 	CleanupStack::PushL(self);
       
    58 	self->ConstructL(aCategoryType);
       
    59 	CleanupStack::Pop(self);
       
    60 	return self;
       
    61 	}
       
    62 
       
    63 /** Allocates and constructs a category object of user-defined type with specified category name.
       
    64 @publishedAll
       
    65 @released
       
    66 @capability None
       
    67 @param aExtendedName The extended category name.
       
    68 @return Pointer to newly created category object.
       
    69 */
       
    70 EXPORT_C CCalCategory* CCalCategory::NewL(const TDesC& aExtendedName)
       
    71 	{
       
    72 	CCalCategory* self = new (ELeave) CCalCategory();
       
    73 	CleanupStack::PushL(self);
       
    74 	self->ConstructL(aExtendedName);
       
    75 	CleanupStack::Pop(self);
       
    76 	return self;
       
    77 	}
       
    78 
       
    79 /** The destructor frees all resources owned by the category, prior to its destruction.
       
    80 @publishedAll
       
    81 @released
       
    82 @capability None
       
    83 */
       
    84 EXPORT_C CCalCategory::~CCalCategory()
       
    85 
       
    86 	{
       
    87 	delete iCalCategoryImpl;
       
    88 	}
       
    89 
       
    90 /** Gets the category type.
       
    91 @publishedAll
       
    92 @released
       
    93 @capability None
       
    94 @return The category type.
       
    95 */
       
    96 EXPORT_C CCalCategory::TCalCategoryType CCalCategory::Category() const
       
    97 
       
    98 	{
       
    99 	return iCalCategoryImpl->CategoryType();
       
   100 	}
       
   101 
       
   102 /** Gets the extended category name.
       
   103 @publishedAll
       
   104 @released
       
   105 @capability None
       
   106 @return The extended category name if there is one, otherwise an empty descriptor.
       
   107 */
       
   108 EXPORT_C const TDesC& CCalCategory::ExtendedCategoryName() const
       
   109 	{
       
   110 	return iCalCategoryImpl->ExtendedCategoryName();
       
   111 	}