epoc32/include/accmonitorinfo.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 /*
     2 * Copyright (c) 2006 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:  Accessory information is encapsulated to this class.
    15 *
    16 */
    17 
    18 
    19 
    20 #ifndef ACCMONITORINFO_H
    21 #define ACCMONITORINFO_H
    22 
    23 // INCLUDES
    24 #include <e32base.h>
    25 #include <accmonitorcapabilities.h>
    26 
    27 // FORWARD DECLARATIONS
    28 class CAccMonitorInfo;
    29 
    30 // EXTERNAL DATA TYPES
    31 /**
    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.
    35 */
    36 typedef RPointerArray<CAccMonitorInfo>  RConnectedAccessories;
    37 
    38 /**
    39 * Type definition RAccMonCapabilityArray consist of an array of accessory
    40 * capabilities.
    41 */
    42 typedef RArray<TAccMonCapability>   RAccMonCapabilityArray;
    43 
    44 // CLASSES
    45 /**
    46 * CAccMonitorInfo is a container for single accessory information.
    47 *
    48 * CAccMonitorInfo holds accessory capabilities and other accessory related
    49 * information. The data members of this class can be accessed with methods in
    50 * in this class.
    51 *
    52 * @see CAccMonitor for examples.
    53 * @lib AccMonitor
    54 * @since S60 5.0
    55 */
    56 class CAccMonitorInfo : public CBase
    57     {
    58     
    59 public:
    60     
    61     /**
    62     * Symbian two phased constructor.
    63     */
    64     static IMPORT_C CAccMonitorInfo* NewL();
    65     
    66     /**
    67     * Symbian two phased constructor.
    68     */
    69     static IMPORT_C CAccMonitorInfo* NewLC();
    70     
    71     /**
    72     * Symbian two phased constructor.
    73     */
    74     static IMPORT_C CAccMonitorInfo* NewL( const CAccMonitorInfo* aAccMonInfo );
    75     
    76     /**
    77     * Symbian two phased constructor.
    78     */
    79     static IMPORT_C CAccMonitorInfo* NewLC( const CAccMonitorInfo* aAccMonInfo );
    80     
    81     /**
    82     * Reset the instance values.
    83     */
    84     inline void Reset();
    85     
    86     /**
    87     * Gets the accessory device type defined for this connected accessory.
    88     *
    89     * @return The accessory device type.
    90     */
    91     inline TAccMonCapability AccDeviceType() const;
    92     
    93     /**
    94     * Gets the accessory physical connection defined for this connected
    95     * accessory.
    96     *
    97     * @return The accessory physical connection.
    98     */
    99     inline TAccMonCapability AccPhysicalConnection() const;
   100     
   101     /**
   102     * Gets the accessory device address defined for this connected
   103     * accessory.
   104     *
   105     * @return This accessory's device address.
   106     */
   107     inline TUint64 AccDeviceAddress() const;
   108     
   109     /**
   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.
   113     *
   114     * @param aIndex is the index where some capability needs to be getted.
   115     * @return TAccMonCapability the capability in that index.
   116     */
   117     inline TAccMonCapability AccCapabilityAtIndex( TInt aIndex ) const;
   118     
   119     /**
   120     * Gets the count of objects in the array.
   121     *
   122     * @return TInt the size of array.
   123     */
   124     inline TInt Count() const;
   125     
   126     /**
   127     * Checks if some capability is defined in this connected accessory.
   128     *
   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.
   132     */
   133     inline TBool Exists( TAccMonCapability aCapability ) const;
   134     
   135     /**
   136     * Checks if a group of capabilities are defined for this accessory.
   137     * aCapabilityArray is the array of capabilities that need to be checked.
   138     *
   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.
   142     */
   143     IMPORT_C TBool Exists( RAccMonCapabilityArray& aCapabilityArray ) const;
   144     
   145     /**
   146     * Copy function for this class.
   147     *
   148     * @param    aAccMonInfo is the instance from what the copy needs to be made of.
   149     * @return   CAccMonitorInfo the copy of this class.
   150     */
   151     IMPORT_C void CopyL( const CAccMonitorInfo* aAccMonInfo );
   152     
   153     /**
   154     * Comparison function for this class.
   155     *
   156     * @param    aAccMonInfo is the instance what needs to be compared.
   157     * @return   ETrue if comparison matches.
   158     */
   159     IMPORT_C TBool CompareL( const CAccMonitorInfo* aAccMonInfo ) const;
   160     
   161     /**
   162     * Destructor
   163     */
   164     virtual ~CAccMonitorInfo();
   165       
   166 private:  
   167     
   168     friend class CAccMonitorContainer;
   169     
   170     /**
   171     * Default Constructor 
   172     */
   173     CAccMonitorInfo();
   174     
   175     /**
   176     * Symbian OS 2nd phase constructor 
   177     */
   178     void ConstructL();
   179     
   180     /**
   181     * Symbian OS 2nd phase constructor 
   182     */
   183     void ConstructL( const CAccMonitorInfo* aAccMonInfo );
   184     
   185     /**
   186     * Assignment operator is hidden so that clients cannot use the
   187     * assignement to this class. Instead the CopyL method should be used.
   188     */
   189     void operator=( CAccMonitorInfo aAccInfo );
   190     
   191 private:
   192     
   193     // An array to hold the capabilities for this instance
   194     RAccMonCapabilityArray iAccCapabilityArray;
   195     
   196     // Defines device type for this accessory
   197     TAccMonCapability iAccessoryDeviceType;
   198     
   199     // Defines physical connection for this accessory
   200     TAccMonCapability iAccessoryPhysicalConnection;
   201     
   202     // Defines device address for this accessory, not defined allways
   203     TUint64 iDeviceAddress;
   204     
   205     // A numerical definition to point the correct accessory
   206     TInt iAccessoryID;
   207     
   208     // A reserved member variable for future use.
   209     TInt iReserved1;
   210     
   211     // A reserved member variable for future use.
   212     TInt iReserved2;
   213     };
   214     
   215 #include <accmonitorinfo.inl>    
   216 
   217 #endif // ACCMONITORINFO_H
   218 
   219 // End of File