|
1 /* |
|
2 * Copyright (c) 2008-2009 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: Collection info class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #include "glxcollectioninfo.h" |
|
22 |
|
23 // ----------------------------------------------------------------------------- |
|
24 // NewL |
|
25 // ----------------------------------------------------------------------------- |
|
26 // |
|
27 EXPORT_C CGlxCollectionInfo* CGlxCollectionInfo::NewL(TUint32 aCollectionId) |
|
28 { |
|
29 CGlxCollectionInfo* self = new (ELeave) CGlxCollectionInfo(aCollectionId); |
|
30 CleanupStack::PushL(self); |
|
31 self->ConstructL(); |
|
32 CleanupStack::Pop(self); |
|
33 return self; |
|
34 } |
|
35 |
|
36 // ----------------------------------------------------------------------------- |
|
37 // Destructor |
|
38 // ----------------------------------------------------------------------------- |
|
39 // |
|
40 EXPORT_C CGlxCollectionInfo::~CGlxCollectionInfo() |
|
41 { |
|
42 delete iTitle; |
|
43 } |
|
44 |
|
45 // ----------------------------------------------------------------------------- |
|
46 // Id |
|
47 // ----------------------------------------------------------------------------- |
|
48 // |
|
49 EXPORT_C TUint32 CGlxCollectionInfo::Id() const |
|
50 { |
|
51 return iItemId; |
|
52 } |
|
53 |
|
54 // ----------------------------------------------------------------------------- |
|
55 // Exists |
|
56 // ----------------------------------------------------------------------------- |
|
57 // |
|
58 EXPORT_C TBool CGlxCollectionInfo::Exists() const |
|
59 { |
|
60 return iExists; |
|
61 } |
|
62 |
|
63 // ----------------------------------------------------------------------------- |
|
64 // Title |
|
65 // ----------------------------------------------------------------------------- |
|
66 // |
|
67 EXPORT_C const TDesC& CGlxCollectionInfo::Title() const |
|
68 { |
|
69 if (iTitle) |
|
70 { |
|
71 return *iTitle; |
|
72 } |
|
73 else |
|
74 { |
|
75 return KNullDesC; |
|
76 } |
|
77 } |
|
78 |
|
79 // ----------------------------------------------------------------------------- |
|
80 // SetExists |
|
81 // ----------------------------------------------------------------------------- |
|
82 // |
|
83 void CGlxCollectionInfo::SetExists(TBool aExists) |
|
84 { |
|
85 iExists = aExists; |
|
86 } |
|
87 |
|
88 // ----------------------------------------------------------------------------- |
|
89 // SetTitleL |
|
90 // ----------------------------------------------------------------------------- |
|
91 // |
|
92 void CGlxCollectionInfo::SetTitleL(const TDesC& aTitle) |
|
93 { |
|
94 delete iTitle; |
|
95 iTitle = NULL; |
|
96 iTitle = aTitle.AllocL(); |
|
97 } |
|
98 |
|
99 // ----------------------------------------------------------------------------- |
|
100 // Constructor |
|
101 // ----------------------------------------------------------------------------- |
|
102 // |
|
103 CGlxCollectionInfo::CGlxCollectionInfo(TInt aCollectionId) |
|
104 : iItemId(aCollectionId) |
|
105 { |
|
106 } |
|
107 |
|
108 // ----------------------------------------------------------------------------- |
|
109 // Second stage constructor |
|
110 // ----------------------------------------------------------------------------- |
|
111 // |
|
112 void CGlxCollectionInfo::ConstructL() |
|
113 { |
|
114 } |