|
1 /* |
|
2 * Copyright (c) 2006 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: Implementation of CCmListItem |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <eikdef.h> |
|
19 #include "cmlistitem.h" |
|
20 |
|
21 // --------------------------------------------------------- |
|
22 // CCmListItem::NewLC |
|
23 // --------------------------------------------------------- |
|
24 // |
|
25 CCmListItem* CCmListItem::NewLC( TUint32 aUid, |
|
26 HBufC* aName, |
|
27 TInt aPriority, |
|
28 TUint aIconIndex, |
|
29 TBool aIsProtected, |
|
30 TBool aIsVpnOverDestination, |
|
31 TBool aIsSingleLine, |
|
32 TBool aIsDefault ) |
|
33 { |
|
34 |
|
35 CCmListItem* db = new( ELeave ) CCmListItem( aName ); |
|
36 CleanupStack::PushL( db ); |
|
37 db->ConstructL( aUid, |
|
38 aPriority, |
|
39 aIconIndex, |
|
40 aIsProtected, |
|
41 aIsVpnOverDestination, |
|
42 aIsSingleLine, |
|
43 aIsDefault ); |
|
44 return db; |
|
45 } |
|
46 // --------------------------------------------------------- |
|
47 // CCmListItem::~CCmListItem |
|
48 // --------------------------------------------------------- |
|
49 // |
|
50 CCmListItem::~CCmListItem() |
|
51 { |
|
52 delete iName; |
|
53 } |
|
54 |
|
55 // --------------------------------------------------------- |
|
56 // CCmListItem::CCmListItem |
|
57 // --------------------------------------------------------- |
|
58 // |
|
59 CCmListItem::CCmListItem( HBufC* aName ) |
|
60 : iName( aName ) |
|
61 { |
|
62 } |
|
63 |
|
64 // --------------------------------------------------------- |
|
65 // CCmListItem::ConstructL |
|
66 // --------------------------------------------------------- |
|
67 // |
|
68 void CCmListItem::ConstructL( TUint32 aUid, |
|
69 TInt aPriority, |
|
70 TUint aIconIndex, |
|
71 TBool aIsProtected, |
|
72 TBool aIsVpnOverDestination, |
|
73 TBool aIsSingleLine, |
|
74 TBool aIsDefault ) |
|
75 { |
|
76 iPriority = aPriority; |
|
77 iIconIndex = aIconIndex; |
|
78 iIsProtected = aIsProtected; |
|
79 iIsSingleLine = aIsSingleLine; |
|
80 iIsDefault = aIsDefault; |
|
81 iIsVpnOverDestination = aIsVpnOverDestination; |
|
82 |
|
83 iUid = aUid; |
|
84 } |
|
85 // --------------------------------------------------------- |
|
86 // CCmListItem::Name |
|
87 // --------------------------------------------------------- |
|
88 // |
|
89 const TDesC& CCmListItem::Name() |
|
90 { |
|
91 return *iName; |
|
92 } |
|
93 |
|
94 |
|
95 // --------------------------------------------------------- |
|
96 // CCmListItem::Uid |
|
97 // --------------------------------------------------------- |
|
98 // |
|
99 TUint32 CCmListItem::Uid() |
|
100 { |
|
101 return iUid; |
|
102 } |
|
103 |
|
104 // --------------------------------------------------------- |
|
105 // CCmListItem::IconIndex |
|
106 // --------------------------------------------------------- |
|
107 // |
|
108 TUint CCmListItem::IconIndex() |
|
109 { |
|
110 return iIconIndex; |
|
111 } |
|
112 |
|
113 // --------------------------------------------------------- |
|
114 // CCmListItem::Priority |
|
115 // --------------------------------------------------------- |
|
116 // |
|
117 TInt CCmListItem::Priority() |
|
118 { |
|
119 return iPriority; |
|
120 } |
|
121 |
|
122 // --------------------------------------------------------- |
|
123 // CCmListItem::IsProtected |
|
124 // --------------------------------------------------------- |
|
125 // |
|
126 TBool CCmListItem::IsProtected() |
|
127 { |
|
128 return iIsProtected; |
|
129 } |
|
130 |
|
131 // --------------------------------------------------------- |
|
132 // CCmListItem::IsSingleLine |
|
133 // --------------------------------------------------------- |
|
134 // |
|
135 TBool CCmListItem::IsSingleLine() |
|
136 { |
|
137 return iIsSingleLine; |
|
138 } |
|
139 |
|
140 // --------------------------------------------------------- |
|
141 // CCmListItem::IsDefault |
|
142 // --------------------------------------------------------- |
|
143 // |
|
144 TBool CCmListItem::IsDefault() |
|
145 { |
|
146 return iIsDefault; |
|
147 } |
|
148 |
|
149 // --------------------------------------------------------- |
|
150 // CCmListItem::IsVpnOverDestination |
|
151 // --------------------------------------------------------- |
|
152 // |
|
153 TBool CCmListItem::IsVpnOverDestination() |
|
154 { |
|
155 return iIsVpnOverDestination; |
|
156 } |
|
157 |
|
158 |