|
1 /* |
|
2 * Copyright (c) 2004 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 * Declares the connection array. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef DDLG_CONNECTION_ARRAY_H |
|
21 #define DDLG_CONNECTION_ARRAY_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 |
|
26 // CONSTANTS |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CConnectionInfo; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 |
|
34 /** |
|
35 * Contains CConnectionInfo instances. |
|
36 */ |
|
37 NONSHARABLE_CLASS( CConnectionCArray ) : public CBase |
|
38 { |
|
39 public: // Constructors and destructor |
|
40 |
|
41 /** |
|
42 * Constructor. |
|
43 */ |
|
44 static CConnectionCArray* NewL(); |
|
45 |
|
46 /** |
|
47 * Destructor. |
|
48 */ |
|
49 virtual ~CConnectionCArray(); |
|
50 |
|
51 private: // Constructors |
|
52 |
|
53 /** |
|
54 * Constructor. |
|
55 */ |
|
56 CConnectionCArray(); |
|
57 |
|
58 /** |
|
59 * Constructor. |
|
60 */ |
|
61 void ConstructL(); |
|
62 |
|
63 public: // New functions |
|
64 |
|
65 /** |
|
66 * Returns the number of connection added to the connection array |
|
67 * @return number of active connections |
|
68 */ |
|
69 TInt Count() const; |
|
70 |
|
71 /** |
|
72 * Add only new connection to the array |
|
73 * @param aConnId id of connection to be added to the array |
|
74 * @return - |
|
75 */ |
|
76 void AppendL( const CConnectionInfo* aInfo ); |
|
77 |
|
78 /** |
|
79 * Destroys the connection array |
|
80 */ |
|
81 void ResetAndDestroy(); |
|
82 |
|
83 /** |
|
84 * Returns info object of connection given by index value in the array |
|
85 * @param aIndex index value of connection in the array |
|
86 * @return CConnectionInfo* pointer to the connection info object |
|
87 */ |
|
88 CConnectionInfo* At( TInt aIndex ) const; |
|
89 |
|
90 /** |
|
91 * Returns the index of the given connection |
|
92 * @param aConnectionId connection id |
|
93 * @return index value of connection in the array, or -1 if there |
|
94 * is no connection the given Id |
|
95 */ |
|
96 TInt GetArrayIndex( TUint aConnectionId ) const; |
|
97 |
|
98 /** |
|
99 * Sorts the array according to the connection start times |
|
100 * @param - |
|
101 * @return - |
|
102 */ |
|
103 void Sort() const; |
|
104 |
|
105 private: // data |
|
106 /** |
|
107 * Contains CConectionInfo instances |
|
108 */ |
|
109 CArrayPtrFlat<CConnectionInfo>* iConnArray; |
|
110 }; |
|
111 |
|
112 #endif // DDLG_CONNECTION_ARRAY_H |
|
113 |
|
114 // End Of File |