|
1 /* |
|
2 * Copyright (c) 2002 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: |
|
15 * Declaration of the CDestSelect class. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CDESTLISTITEM_H |
|
21 #define CDESTLISTITEM_H |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <cmmanagerdef.h> |
|
25 |
|
26 /** |
|
27 * Representation of a destinations list item. |
|
28 * This class is used to hold the main information of a destination. |
|
29 * |
|
30 * @lib cmmanager.lib |
|
31 * @since S60 v3.2 |
|
32 */ |
|
33 NONSHARABLE_CLASS( CDestListItem ) : public CBase |
|
34 { |
|
35 public: // Constructors and destructor |
|
36 |
|
37 /** |
|
38 * Two-phased constructor. Leaves on failure, places instance |
|
39 * on cleanup stack. |
|
40 * @param aUid The ID of the destination |
|
41 * @param aName The name of the destination |
|
42 * @param aNumOfCMs the number of connection methods belonging to the destination |
|
43 * @param aIconIndex The icon index of the destination |
|
44 * @param aIsProtected Whether the given item is read-only or not |
|
45 * @return The constructed CDestListItem. |
|
46 */ |
|
47 static CDestListItem* NewLC( TUint32 aUid, |
|
48 HBufC* aName, |
|
49 TInt aNumOfCMs, |
|
50 TUint aIconIndex, |
|
51 CMManager::TProtectionLevel aProtectionLevel, |
|
52 TBool aIsDefault ); |
|
53 |
|
54 /** |
|
55 * Destructor. |
|
56 */ |
|
57 virtual ~CDestListItem(); |
|
58 |
|
59 protected: // Constructors |
|
60 |
|
61 /** |
|
62 * C++ default constructor. |
|
63 */ |
|
64 CDestListItem( HBufC* aName ); |
|
65 |
|
66 /** |
|
67 * Second-phase constructor. |
|
68 * @param aUid The ID of the destination |
|
69 * @param aNumOfCMs the number of connection methods belonging to the destination |
|
70 * @param aIconIndex The icon index of the destination |
|
71 * @param aIsProtected Whether the given item is read-only or not |
|
72 * @return The constructed CDestListItem. |
|
73 */ |
|
74 void ConstructL( TUint32 aUid, |
|
75 TInt aNumOfCMs, |
|
76 TUint aIconIndex, |
|
77 CMManager::TProtectionLevel aProtectionLevel, |
|
78 TBool aIsDefault ); |
|
79 public: // New functions |
|
80 |
|
81 /** |
|
82 * Gets the name of the 'current' destination |
|
83 * Ownership of the returned text is not passed. |
|
84 * @return The name of the current destination |
|
85 */ |
|
86 const TDesC& Name(); |
|
87 |
|
88 /** |
|
89 * Gets the UID of the current destination |
|
90 * @return The UID of the current destination |
|
91 */ |
|
92 TUint32 Uid(); |
|
93 |
|
94 /** |
|
95 * Gets the number of connection mehtods belonging to the current destination |
|
96 * @return The number of connection mehtods belonging to the current destination |
|
97 */ |
|
98 TInt NumOfCMs(); |
|
99 |
|
100 /** |
|
101 * Gets the IconIndex of the current destination |
|
102 * @return The IconIndex of the current destination |
|
103 */ |
|
104 TUint IconIndex(); |
|
105 |
|
106 /** |
|
107 * Returns the destination's protected flag |
|
108 * @return ETrue if the destination is protected |
|
109 */ |
|
110 TUint IsProtected(); |
|
111 /** |
|
112 * Returns the Protection Level |
|
113 * @return TProtectionLevel |
|
114 */ |
|
115 CMManager::TProtectionLevel GetProtectionLevel(); |
|
116 TUint IsDefault(); |
|
117 |
|
118 private: // Data |
|
119 |
|
120 TUint32 iUid; ///< The ID of the destination |
|
121 HBufC* iName; ///< The name of the destination |
|
122 TInt iNumOfCMs; ///< The number of connection mehtods belonging to the |
|
123 //// destination |
|
124 TUint iIconIndex; ///< The iIconIndex of the destination |
|
125 TBool iIsProtected; ///< The IsProtected flag of the destination |
|
126 TBool iIsDefault; ///< The IsDefault flag of the destination |
|
127 CMManager::TProtectionLevel iProtectionLevel; |
|
128 }; |
|
129 |
|
130 #endif // CDESTLISTITEM_H |