epoc32/include/accmonitorinfo.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 accmonitorinfo.h
     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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.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 */
       
    35 typedef RPointerArray<CAccMonitorInfo>  RConnectedAccessories;
       
    36 
       
    37 /**
       
    38 * Type definition RAccMonCapabilityArray consist of an array of accessory
       
    39 * capabilities.
       
    40 */
       
    41 typedef RArray<TAccMonCapability>   RAccMonCapabilityArray;
       
    42 
       
    43 // CLASSES
       
    44 /**
       
    45 * CAccMonitorInfo is a container for single accessory information.
       
    46 *
       
    47 * CAccMonitorInfo holds accessory capabilities and other accessory related
       
    48 * information. The data members of this class can be accessed with methods in
       
    49 * in this class.
       
    50 *
       
    51 * @see CAccMonitor for examples.
       
    52 * @lib AccMonitor
       
    53 * @since S60 5.0
       
    54 */
       
    55 class CAccMonitorInfo : public CBase
       
    56     {
       
    57     
       
    58 public:
       
    59     
       
    60     /**
       
    61     * Symbian two phased constructor.
       
    62     */
       
    63     static IMPORT_C CAccMonitorInfo* NewL();
       
    64     
       
    65     /**
       
    66     * Symbian two phased constructor.
       
    67     */
       
    68     static IMPORT_C CAccMonitorInfo* NewLC();
       
    69     
       
    70     /**
       
    71     * Symbian two phased constructor.
       
    72     */
       
    73     static IMPORT_C CAccMonitorInfo* NewL( const CAccMonitorInfo* aAccMonInfo );
       
    74     
       
    75     /**
       
    76     * Symbian two phased constructor.
       
    77     */
       
    78     static IMPORT_C CAccMonitorInfo* NewLC( const CAccMonitorInfo* aAccMonInfo );
       
    79     
       
    80     /**
       
    81     * Reset the instance values.
       
    82     */
       
    83     inline void Reset();
       
    84     
       
    85     /**
       
    86     * Gets the accessory device type defined for this connected accessory.
       
    87     *
       
    88     * @return The accessory device type.
       
    89     */
       
    90     inline TAccMonCapability AccDeviceType() const;
       
    91     
       
    92     /**
       
    93     * Gets the accessory physical connection defined for this connected
       
    94     * accessory.
       
    95     *
       
    96     * @return The accessory physical connection.
       
    97     */
       
    98     inline TAccMonCapability AccPhysicalConnection() const;
       
    99     
       
   100     /**
       
   101     * Gets the accessory device address defined for this connected
       
   102     * accessory.
       
   103     *
       
   104     * @return This accessory's device address.
       
   105     */
       
   106     inline TUint64 AccDeviceAddress() const;
       
   107     
       
   108     /**
       
   109     * Gets a capability that is defined in the array for this connected
       
   110     * accessory. If the array of this class is empty and this function is
       
   111     * used this function will panic.
       
   112     *
       
   113     * @param aIndex is the index where some capability needs to be getted.
       
   114     * @return TAccMonCapability the capability in that index.
       
   115     */
       
   116     inline TAccMonCapability AccCapabilityAtIndex( TInt aIndex ) const;
       
   117     
       
   118     /**
       
   119     * Gets the count of objects in the array.
       
   120     *
       
   121     * @return TInt the size of array.
       
   122     */
       
   123     inline TInt Count() const;
       
   124     
       
   125     /**
       
   126     * Checks if some capability is defined in this connected accessory.
       
   127     *
       
   128     * @param    aCapability is the capability definition that needs to be
       
   129     *           checked if it is defined for this accessory.
       
   130     * @return   ETrue if this capability is defined.
       
   131     */
       
   132     inline TBool Exists( TAccMonCapability aCapability ) const;
       
   133     
       
   134     /**
       
   135     * Checks if a group of capabilities are defined for this accessory.
       
   136     * aCapabilityArray is the array of capabilities that need to be checked.
       
   137     *
       
   138     * @param    aCapabilityArray is the array of capability definitionion that need to be
       
   139     *           checked if they are defined for this accessory.
       
   140     * @return   ETrue if these capabilities is defined.
       
   141     */
       
   142     IMPORT_C TBool Exists( RAccMonCapabilityArray& aCapabilityArray ) const;
       
   143     
       
   144     /**
       
   145     * Copy function for this class.
       
   146     *
       
   147     * @param    aAccMonInfo is the instance from what the copy needs to be made of.
       
   148     * @return   CAccMonitorInfo the copy of this class.
       
   149     */
       
   150     IMPORT_C void CopyL( const CAccMonitorInfo* aAccMonInfo );
       
   151     
       
   152     /**
       
   153     * Comparison function for this class.
       
   154     *
       
   155     * @param    aAccMonInfo is the instance what needs to be compared.
       
   156     * @return   ETrue if comparison matches.
       
   157     */
       
   158     IMPORT_C TBool CompareL( const CAccMonitorInfo* aAccMonInfo ) const;
       
   159     
       
   160     /**
       
   161     * Destructor
       
   162     */
       
   163     virtual ~CAccMonitorInfo();
       
   164       
       
   165 private:  
       
   166     
       
   167     friend class CAccMonitorContainer;
       
   168     
       
   169     /**
       
   170     * Default Constructor 
       
   171     */
       
   172     CAccMonitorInfo();
       
   173     
       
   174     /**
       
   175     * Symbian OS 2nd phase constructor 
       
   176     */
       
   177     void ConstructL();
       
   178     
       
   179     /**
       
   180     * Symbian OS 2nd phase constructor 
       
   181     */
       
   182     void ConstructL( const CAccMonitorInfo* aAccMonInfo );
       
   183     
       
   184     /**
       
   185     * Assignment operator is hidden so that clients cannot use the
       
   186     * assignement to this class. Instead the CopyL method should be used.
       
   187     */
       
   188     void operator=( CAccMonitorInfo aAccInfo );
       
   189     
       
   190 private:
       
   191     
       
   192     // An array to hold the capabilities for this instance
       
   193     RAccMonCapabilityArray iAccCapabilityArray;
       
   194     
       
   195     // Defines device type for this accessory
       
   196     TAccMonCapability iAccessoryDeviceType;
       
   197     
       
   198     // Defines physical connection for this accessory
       
   199     TAccMonCapability iAccessoryPhysicalConnection;
       
   200     
       
   201     // Defines device address for this accessory, not defined allways
       
   202     TUint64 iDeviceAddress;
       
   203     
       
   204     // A numerical definition to point the correct accessory
       
   205     TInt iAccessoryID;
       
   206     
       
   207     // A reserved member variable for future use.
       
   208     TInt iReserved1;
       
   209     
       
   210     // A reserved member variable for future use.
       
   211     TInt iReserved2;
       
   212     };
       
   213     
       
   214 #include <AccMonitorInfo.inl>    
       
   215 
       
   216 #endif // ACCMONITORINFO_H
       
   217 
       
   218 // End of File