|
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: Profile names array implementation. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CPROFILESNAMESARRAYIMPL_H |
|
21 #define CPROFILESNAMESARRAYIMPL_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <MProfilesNamesArray.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CProfileNameImpl; |
|
29 |
|
30 // CLASS DECLARATION |
|
31 |
|
32 /** |
|
33 * Profile names array implementation. |
|
34 * This class implements MProfilesNamesArray interface. |
|
35 * |
|
36 * @lib ?library |
|
37 * @since 2.0 |
|
38 */ |
|
39 NONSHARABLE_CLASS(CProfilesNamesArrayImpl) : public CBase, |
|
40 public MProfilesNamesArray |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 |
|
44 /** |
|
45 * Two-phased constructor. |
|
46 */ |
|
47 static CProfilesNamesArrayImpl* NewL(); |
|
48 |
|
49 /** |
|
50 * Two-phased constructor. |
|
51 */ |
|
52 static CProfilesNamesArrayImpl* NewLC(); |
|
53 |
|
54 /** |
|
55 * Destructor. |
|
56 */ |
|
57 virtual ~CProfilesNamesArrayImpl(); |
|
58 |
|
59 public: // New functions |
|
60 |
|
61 /** |
|
62 * Insert profile name in array, sort by ID. |
|
63 * @since 2.0 |
|
64 * @param aProfileName Profile name instance |
|
65 * @return System error code |
|
66 */ |
|
67 TInt InsertInOrder( const CProfileNameImpl* aProfileName ); |
|
68 |
|
69 /** |
|
70 * Append profile names in array. |
|
71 * @since 2.0 |
|
72 * @param aProfileName Profile name instance |
|
73 * @return System error code |
|
74 */ |
|
75 TInt Append( const CProfileNameImpl* aProfileName ); |
|
76 |
|
77 /** |
|
78 * Find profile name by ID. |
|
79 * @since 2.0 |
|
80 * @param aId Profile ID |
|
81 * @return Profile name |
|
82 */ |
|
83 const TDesC& FindNameById( TInt aId ); |
|
84 |
|
85 public: // Functions from base classes |
|
86 |
|
87 /** |
|
88 * From MProfilesNamesArray. |
|
89 */ |
|
90 virtual const MProfileName* ProfileName( TInt aIndex ) const; |
|
91 |
|
92 /** |
|
93 * From MProfilesNamesArray. |
|
94 */ |
|
95 virtual TInt FindById( TInt aId ) const; |
|
96 |
|
97 /** |
|
98 * From MProfilesNamesArray. |
|
99 */ |
|
100 virtual TInt FindByName( const TDesC& aProfileName ) const; |
|
101 |
|
102 /** |
|
103 * From MDesCArray. |
|
104 */ |
|
105 virtual TInt MdcaCount() const; |
|
106 |
|
107 /** |
|
108 * From MDesCArray. |
|
109 */ |
|
110 virtual TPtrC MdcaPoint( TInt aIndex ) const; |
|
111 |
|
112 private: |
|
113 |
|
114 /** |
|
115 * C++ default constructor. |
|
116 */ |
|
117 CProfilesNamesArrayImpl(); |
|
118 |
|
119 private: // Data |
|
120 |
|
121 // Own: Profiles names array |
|
122 RPointerArray<CProfileNameImpl> iProfilesNames; |
|
123 |
|
124 // Own: Empty name |
|
125 TBuf<1> iNullName; |
|
126 |
|
127 }; |
|
128 |
|
129 #endif // CPROFILESNAMESARRAYIMPL_H |
|
130 |
|
131 // End of File |