2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Accessory information is encapsulated to this class.
20 #ifndef ACCMONITORINFO_H
21 #define ACCMONITORINFO_H
25 #include <accmonitorcapabilities.h>
27 // FORWARD DECLARATIONS
28 class CAccMonitorInfo;
30 // EXTERNAL DATA TYPES
32 * Type definition RConnectedAccessories consist of connected accessories
33 * definitions which are defined in CAccMonitorInfo class.
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.
36 typedef RPointerArray<CAccMonitorInfo> RConnectedAccessories;
39 * Type definition RAccMonCapabilityArray consist of an array of accessory
42 typedef RArray<TAccMonCapability> RAccMonCapabilityArray;
46 * CAccMonitorInfo is a container for single accessory information.
48 * CAccMonitorInfo holds accessory capabilities and other accessory related
49 * information. The data members of this class can be accessed with methods in
52 * @see CAccMonitor for examples.
56 class CAccMonitorInfo : public CBase
62 * Symbian two phased constructor.
64 static IMPORT_C CAccMonitorInfo* NewL();
67 * Symbian two phased constructor.
69 static IMPORT_C CAccMonitorInfo* NewLC();
72 * Symbian two phased constructor.
74 static IMPORT_C CAccMonitorInfo* NewL( const CAccMonitorInfo* aAccMonInfo );
77 * Symbian two phased constructor.
79 static IMPORT_C CAccMonitorInfo* NewLC( const CAccMonitorInfo* aAccMonInfo );
82 * Reset the instance values.
87 * Gets the accessory device type defined for this connected accessory.
89 * @return The accessory device type.
91 inline TAccMonCapability AccDeviceType() const;
94 * Gets the accessory physical connection defined for this connected
97 * @return The accessory physical connection.
99 inline TAccMonCapability AccPhysicalConnection() const;
102 * Gets the accessory device address defined for this connected
105 * @return This accessory's device address.
107 inline TUint64 AccDeviceAddress() const;
110 * Gets a capability that is defined in the array for this connected
111 * accessory. If the array of this class is empty and this function is
112 * used this function will panic.
114 * @param aIndex is the index where some capability needs to be getted.
115 * @return TAccMonCapability the capability in that index.
117 inline TAccMonCapability AccCapabilityAtIndex( TInt aIndex ) const;
120 * Gets the count of objects in the array.
122 * @return TInt the size of array.
124 inline TInt Count() const;
127 * Checks if some capability is defined in this connected accessory.
129 * @param aCapability is the capability definition that needs to be
130 * checked if it is defined for this accessory.
131 * @return ETrue if this capability is defined.
133 inline TBool Exists( TAccMonCapability aCapability ) const;
136 * Checks if a group of capabilities are defined for this accessory.
137 * aCapabilityArray is the array of capabilities that need to be checked.
139 * @param aCapabilityArray is the array of capability definitionion that need to be
140 * checked if they are defined for this accessory.
141 * @return ETrue if these capabilities is defined.
143 IMPORT_C TBool Exists( RAccMonCapabilityArray& aCapabilityArray ) const;
146 * Copy function for this class.
148 * @param aAccMonInfo is the instance from what the copy needs to be made of.
149 * @return CAccMonitorInfo the copy of this class.
151 IMPORT_C void CopyL( const CAccMonitorInfo* aAccMonInfo );
154 * Comparison function for this class.
156 * @param aAccMonInfo is the instance what needs to be compared.
157 * @return ETrue if comparison matches.
159 IMPORT_C TBool CompareL( const CAccMonitorInfo* aAccMonInfo ) const;
164 virtual ~CAccMonitorInfo();
168 friend class CAccMonitorContainer;
171 * Default Constructor
176 * Symbian OS 2nd phase constructor
181 * Symbian OS 2nd phase constructor
183 void ConstructL( const CAccMonitorInfo* aAccMonInfo );
186 * Assignment operator is hidden so that clients cannot use the
187 * assignement to this class. Instead the CopyL method should be used.
189 void operator=( CAccMonitorInfo aAccInfo );
193 // An array to hold the capabilities for this instance
194 RAccMonCapabilityArray iAccCapabilityArray;
196 // Defines device type for this accessory
197 TAccMonCapability iAccessoryDeviceType;
199 // Defines physical connection for this accessory
200 TAccMonCapability iAccessoryPhysicalConnection;
202 // Defines device address for this accessory, not defined allways
203 TUint64 iDeviceAddress;
205 // A numerical definition to point the correct accessory
208 // A reserved member variable for future use.
211 // A reserved member variable for future use.
215 #include <accmonitorinfo.inl>
217 #endif // ACCMONITORINFO_H