williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@4
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@4
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description: Accessory information is encapsulated to this class.
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
*/
|
williamr@2
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
|
williamr@2
|
20 |
#ifndef ACCMONITORINFO_H
|
williamr@2
|
21 |
#define ACCMONITORINFO_H
|
williamr@2
|
22 |
|
williamr@2
|
23 |
// INCLUDES
|
williamr@2
|
24 |
#include <e32base.h>
|
williamr@4
|
25 |
#include <accmonitorcapabilities.h>
|
williamr@2
|
26 |
|
williamr@2
|
27 |
// FORWARD DECLARATIONS
|
williamr@2
|
28 |
class CAccMonitorInfo;
|
williamr@2
|
29 |
|
williamr@2
|
30 |
// EXTERNAL DATA TYPES
|
williamr@2
|
31 |
/**
|
williamr@2
|
32 |
* Type definition RConnectedAccessories consist of connected accessories
|
williamr@2
|
33 |
* definitions which are defined in CAccMonitorInfo class.
|
williamr@4
|
34 |
* Note: If Pushed onto Cleanup stack, make sure to use ResetAndDestroy Array API just before PopAndDestroy Cleanup stack API, else it causes array elements to leak its memory.
|
williamr@2
|
35 |
*/
|
williamr@2
|
36 |
typedef RPointerArray<CAccMonitorInfo> RConnectedAccessories;
|
williamr@2
|
37 |
|
williamr@2
|
38 |
/**
|
williamr@2
|
39 |
* Type definition RAccMonCapabilityArray consist of an array of accessory
|
williamr@2
|
40 |
* capabilities.
|
williamr@2
|
41 |
*/
|
williamr@2
|
42 |
typedef RArray<TAccMonCapability> RAccMonCapabilityArray;
|
williamr@2
|
43 |
|
williamr@2
|
44 |
// CLASSES
|
williamr@2
|
45 |
/**
|
williamr@2
|
46 |
* CAccMonitorInfo is a container for single accessory information.
|
williamr@2
|
47 |
*
|
williamr@2
|
48 |
* CAccMonitorInfo holds accessory capabilities and other accessory related
|
williamr@2
|
49 |
* information. The data members of this class can be accessed with methods in
|
williamr@2
|
50 |
* in this class.
|
williamr@2
|
51 |
*
|
williamr@2
|
52 |
* @see CAccMonitor for examples.
|
williamr@2
|
53 |
* @lib AccMonitor
|
williamr@2
|
54 |
* @since S60 5.0
|
williamr@2
|
55 |
*/
|
williamr@2
|
56 |
class CAccMonitorInfo : public CBase
|
williamr@2
|
57 |
{
|
williamr@2
|
58 |
|
williamr@2
|
59 |
public:
|
williamr@2
|
60 |
|
williamr@2
|
61 |
/**
|
williamr@2
|
62 |
* Symbian two phased constructor.
|
williamr@2
|
63 |
*/
|
williamr@2
|
64 |
static IMPORT_C CAccMonitorInfo* NewL();
|
williamr@2
|
65 |
|
williamr@2
|
66 |
/**
|
williamr@2
|
67 |
* Symbian two phased constructor.
|
williamr@2
|
68 |
*/
|
williamr@2
|
69 |
static IMPORT_C CAccMonitorInfo* NewLC();
|
williamr@2
|
70 |
|
williamr@2
|
71 |
/**
|
williamr@2
|
72 |
* Symbian two phased constructor.
|
williamr@2
|
73 |
*/
|
williamr@2
|
74 |
static IMPORT_C CAccMonitorInfo* NewL( const CAccMonitorInfo* aAccMonInfo );
|
williamr@2
|
75 |
|
williamr@2
|
76 |
/**
|
williamr@2
|
77 |
* Symbian two phased constructor.
|
williamr@2
|
78 |
*/
|
williamr@2
|
79 |
static IMPORT_C CAccMonitorInfo* NewLC( const CAccMonitorInfo* aAccMonInfo );
|
williamr@2
|
80 |
|
williamr@2
|
81 |
/**
|
williamr@2
|
82 |
* Reset the instance values.
|
williamr@2
|
83 |
*/
|
williamr@2
|
84 |
inline void Reset();
|
williamr@2
|
85 |
|
williamr@2
|
86 |
/**
|
williamr@2
|
87 |
* Gets the accessory device type defined for this connected accessory.
|
williamr@2
|
88 |
*
|
williamr@2
|
89 |
* @return The accessory device type.
|
williamr@2
|
90 |
*/
|
williamr@2
|
91 |
inline TAccMonCapability AccDeviceType() const;
|
williamr@2
|
92 |
|
williamr@2
|
93 |
/**
|
williamr@2
|
94 |
* Gets the accessory physical connection defined for this connected
|
williamr@2
|
95 |
* accessory.
|
williamr@2
|
96 |
*
|
williamr@2
|
97 |
* @return The accessory physical connection.
|
williamr@2
|
98 |
*/
|
williamr@2
|
99 |
inline TAccMonCapability AccPhysicalConnection() const;
|
williamr@2
|
100 |
|
williamr@2
|
101 |
/**
|
williamr@2
|
102 |
* Gets the accessory device address defined for this connected
|
williamr@2
|
103 |
* accessory.
|
williamr@2
|
104 |
*
|
williamr@2
|
105 |
* @return This accessory's device address.
|
williamr@2
|
106 |
*/
|
williamr@2
|
107 |
inline TUint64 AccDeviceAddress() const;
|
williamr@2
|
108 |
|
williamr@2
|
109 |
/**
|
williamr@2
|
110 |
* Gets a capability that is defined in the array for this connected
|
williamr@2
|
111 |
* accessory. If the array of this class is empty and this function is
|
williamr@2
|
112 |
* used this function will panic.
|
williamr@2
|
113 |
*
|
williamr@2
|
114 |
* @param aIndex is the index where some capability needs to be getted.
|
williamr@2
|
115 |
* @return TAccMonCapability the capability in that index.
|
williamr@2
|
116 |
*/
|
williamr@2
|
117 |
inline TAccMonCapability AccCapabilityAtIndex( TInt aIndex ) const;
|
williamr@2
|
118 |
|
williamr@2
|
119 |
/**
|
williamr@2
|
120 |
* Gets the count of objects in the array.
|
williamr@2
|
121 |
*
|
williamr@2
|
122 |
* @return TInt the size of array.
|
williamr@2
|
123 |
*/
|
williamr@2
|
124 |
inline TInt Count() const;
|
williamr@2
|
125 |
|
williamr@2
|
126 |
/**
|
williamr@2
|
127 |
* Checks if some capability is defined in this connected accessory.
|
williamr@2
|
128 |
*
|
williamr@2
|
129 |
* @param aCapability is the capability definition that needs to be
|
williamr@2
|
130 |
* checked if it is defined for this accessory.
|
williamr@2
|
131 |
* @return ETrue if this capability is defined.
|
williamr@2
|
132 |
*/
|
williamr@2
|
133 |
inline TBool Exists( TAccMonCapability aCapability ) const;
|
williamr@2
|
134 |
|
williamr@2
|
135 |
/**
|
williamr@2
|
136 |
* Checks if a group of capabilities are defined for this accessory.
|
williamr@2
|
137 |
* aCapabilityArray is the array of capabilities that need to be checked.
|
williamr@2
|
138 |
*
|
williamr@2
|
139 |
* @param aCapabilityArray is the array of capability definitionion that need to be
|
williamr@2
|
140 |
* checked if they are defined for this accessory.
|
williamr@2
|
141 |
* @return ETrue if these capabilities is defined.
|
williamr@2
|
142 |
*/
|
williamr@2
|
143 |
IMPORT_C TBool Exists( RAccMonCapabilityArray& aCapabilityArray ) const;
|
williamr@2
|
144 |
|
williamr@2
|
145 |
/**
|
williamr@2
|
146 |
* Copy function for this class.
|
williamr@2
|
147 |
*
|
williamr@2
|
148 |
* @param aAccMonInfo is the instance from what the copy needs to be made of.
|
williamr@2
|
149 |
* @return CAccMonitorInfo the copy of this class.
|
williamr@2
|
150 |
*/
|
williamr@2
|
151 |
IMPORT_C void CopyL( const CAccMonitorInfo* aAccMonInfo );
|
williamr@2
|
152 |
|
williamr@2
|
153 |
/**
|
williamr@2
|
154 |
* Comparison function for this class.
|
williamr@2
|
155 |
*
|
williamr@2
|
156 |
* @param aAccMonInfo is the instance what needs to be compared.
|
williamr@2
|
157 |
* @return ETrue if comparison matches.
|
williamr@2
|
158 |
*/
|
williamr@2
|
159 |
IMPORT_C TBool CompareL( const CAccMonitorInfo* aAccMonInfo ) const;
|
williamr@2
|
160 |
|
williamr@2
|
161 |
/**
|
williamr@2
|
162 |
* Destructor
|
williamr@2
|
163 |
*/
|
williamr@2
|
164 |
virtual ~CAccMonitorInfo();
|
williamr@2
|
165 |
|
williamr@2
|
166 |
private:
|
williamr@2
|
167 |
|
williamr@2
|
168 |
friend class CAccMonitorContainer;
|
williamr@2
|
169 |
|
williamr@2
|
170 |
/**
|
williamr@2
|
171 |
* Default Constructor
|
williamr@2
|
172 |
*/
|
williamr@2
|
173 |
CAccMonitorInfo();
|
williamr@2
|
174 |
|
williamr@2
|
175 |
/**
|
williamr@2
|
176 |
* Symbian OS 2nd phase constructor
|
williamr@2
|
177 |
*/
|
williamr@2
|
178 |
void ConstructL();
|
williamr@2
|
179 |
|
williamr@2
|
180 |
/**
|
williamr@2
|
181 |
* Symbian OS 2nd phase constructor
|
williamr@2
|
182 |
*/
|
williamr@2
|
183 |
void ConstructL( const CAccMonitorInfo* aAccMonInfo );
|
williamr@2
|
184 |
|
williamr@2
|
185 |
/**
|
williamr@2
|
186 |
* Assignment operator is hidden so that clients cannot use the
|
williamr@2
|
187 |
* assignement to this class. Instead the CopyL method should be used.
|
williamr@2
|
188 |
*/
|
williamr@2
|
189 |
void operator=( CAccMonitorInfo aAccInfo );
|
williamr@2
|
190 |
|
williamr@2
|
191 |
private:
|
williamr@2
|
192 |
|
williamr@2
|
193 |
// An array to hold the capabilities for this instance
|
williamr@2
|
194 |
RAccMonCapabilityArray iAccCapabilityArray;
|
williamr@2
|
195 |
|
williamr@2
|
196 |
// Defines device type for this accessory
|
williamr@2
|
197 |
TAccMonCapability iAccessoryDeviceType;
|
williamr@2
|
198 |
|
williamr@2
|
199 |
// Defines physical connection for this accessory
|
williamr@2
|
200 |
TAccMonCapability iAccessoryPhysicalConnection;
|
williamr@2
|
201 |
|
williamr@2
|
202 |
// Defines device address for this accessory, not defined allways
|
williamr@2
|
203 |
TUint64 iDeviceAddress;
|
williamr@2
|
204 |
|
williamr@2
|
205 |
// A numerical definition to point the correct accessory
|
williamr@2
|
206 |
TInt iAccessoryID;
|
williamr@2
|
207 |
|
williamr@2
|
208 |
// A reserved member variable for future use.
|
williamr@2
|
209 |
TInt iReserved1;
|
williamr@2
|
210 |
|
williamr@2
|
211 |
// A reserved member variable for future use.
|
williamr@2
|
212 |
TInt iReserved2;
|
williamr@2
|
213 |
};
|
williamr@2
|
214 |
|
williamr@4
|
215 |
#include <accmonitorinfo.inl>
|
williamr@2
|
216 |
|
williamr@2
|
217 |
#endif // ACCMONITORINFO_H
|
williamr@2
|
218 |
|
williamr@2
|
219 |
// End of File
|