mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/cgetobjectproplist.h
changeset 0 a2952bb97e68
child 14 05b0d2323768
equal deleted inserted replaced
-1:000000000000 0:a2952bb97e68
       
     1 /*
       
     2 * Copyright (c) 2009 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:  Get object proplist operation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CGETOBJECTPROPLIST_H
       
    20 #define CGETOBJECTPROPLIST_H
       
    21 
       
    22 #include "crequestprocessor.h"
       
    23 #include "cmmmtpdpperflog.h"
       
    24 
       
    25 // forward declaration
       
    26 class CMTPTypeArray;
       
    27 class CMTPTypeObjectPropList;
       
    28 class MMmMtpDpConfig;
       
    29 class CMTPTypeObjectPropListElement;
       
    30 
       
    31 /**
       
    32 * Defines GetObjectPropList request processor
       
    33 */
       
    34 class CGetObjectPropList : public CRequestProcessor
       
    35     {
       
    36 public:
       
    37     /**
       
    38     * Destructor
       
    39     */
       
    40     IMPORT_C virtual ~CGetObjectPropList();
       
    41 
       
    42 protected:
       
    43     /**
       
    44     * Standard C++ Constructor
       
    45     * @param aFramework, The data provider framework
       
    46     * @param aConnection, The connection from which the request comes
       
    47     * @param aDpConfig, The interface of dataprovider configuration
       
    48     */
       
    49     IMPORT_C CGetObjectPropList( MMTPDataProviderFramework& aFramework,
       
    50         MMTPConnection& aConnection,
       
    51         MMmMtpDpConfig& aDpConfig );
       
    52 
       
    53     /**
       
    54     * 2nd Phase Constructor
       
    55     */
       
    56     IMPORT_C void ConstructL();
       
    57 
       
    58 protected:
       
    59     // from CRequestProcessor
       
    60     /**
       
    61     * Service a request at request phase
       
    62     */
       
    63     IMPORT_C void ServiceL();
       
    64 
       
    65     /**
       
    66     * Check the current request
       
    67     * @return EMTPRespCodeOK if the reqeust is good, otherwise,
       
    68     *     one of the error response codes
       
    69     */
       
    70     IMPORT_C TMTPResponseCode CheckRequestL();
       
    71 
       
    72     // From CActive
       
    73     /**
       
    74     * Cancel the enumeration process
       
    75     */
       
    76     IMPORT_C void DoCancel();
       
    77 
       
    78     /**
       
    79     * Handle completed request
       
    80     */
       
    81     IMPORT_C void RunL();
       
    82 
       
    83     /**
       
    84     * Ignore the error, continue with the next one
       
    85     */
       
    86     IMPORT_C TInt RunError( TInt aError );
       
    87 
       
    88 protected:
       
    89     // new virtuals
       
    90     virtual TInt ServiceSpecificObjectPropertyL( TUint16 aPropCode, TUint32 aHandle ) = 0;
       
    91 
       
    92 private:
       
    93     /**
       
    94     * Ensures the object format operation parameter is valid
       
    95     * (done for CheckRequestL)
       
    96     * @return Response code of the check result
       
    97     */
       
    98     TMTPResponseCode CheckFormatL() const;
       
    99 
       
   100     /**
       
   101     * Ensures the object prop code operation parameter is valid
       
   102     * (done for CheckRequestL)
       
   103     * @return Response code of the check
       
   104     */
       
   105     TMTPResponseCode CheckPropCodeL() const;
       
   106 
       
   107     /**
       
   108     * Ensures the depth operation parameter is valid (done for CheckRequestL)
       
   109     * @return Response code of the check
       
   110     */
       
   111     TMTPResponseCode CheckDepth() const;
       
   112 
       
   113     /**
       
   114     * Gets the handles for the objects that we want the properties for
       
   115     */
       
   116     void GetObjectHandlesL();
       
   117 
       
   118     /**
       
   119     * Gets all object handles (for GetObjectHandlesL)
       
   120     * @param aStorageId, storage ID
       
   121     * @param aParentHandle, parent handle
       
   122     * @param aFormat, format
       
   123     */
       
   124     void GetObjectHandlesL( TUint32 aStorageId, TUint32 aParentHandle, TUint16 aFormat = 0x0000 );
       
   125 
       
   126     /**
       
   127     * Gets the handles of all objects on the root (for GetObjectHandlesL)
       
   128     * @param aDepth, depth of file structure
       
   129     * @param aFormat, format
       
   130     */
       
   131     void GetRootObjectHandlesL( TUint32 aDepth, TUint16 aFormat );
       
   132 
       
   133     /**
       
   134     * Gets a folder object handle (for GetObjectHandlesL)
       
   135     * @param aDepth, depth of file structure
       
   136     * @param aParentHandle, parent handle
       
   137     */
       
   138     void GetFolderObjectHandlesL( TUint32 aDepth, TUint32 aParentHandle );
       
   139 
       
   140     /**
       
   141     * Gets a specified object handle (for GetObjectHandlesL)
       
   142     * @param aHandle, object handler
       
   143     */
       
   144 //    void GetSpecificObjectHandlesL( TUint32 aHandle );
       
   145 
       
   146     /**
       
   147     * Gets the object property information for the required object
       
   148     * @param aHandle, object handler
       
   149     * @param aPropCode, property code
       
   150     * @return error code
       
   151     */
       
   152     TInt ServiceOneObjectPropertyL( TUint32 aHandle, TUint16 aPropCode );
       
   153 
       
   154     /**
       
   155     * Gets a list of all the properties supported
       
   156     * @param aHandle, object handler
       
   157     */
       
   158     TInt ServiceAllPropertiesL( TUint32 aHandle );
       
   159 
       
   160     TInt ServiceGroupPropertiesL( TUint32 aHandle );
       
   161 
       
   162     void GetPropertiesL( RArray<TUint>& aPropArray, TUint32 aGroupCode, TUint16 aFormatCode ) const;
       
   163 
       
   164     void SetSubFormatCodeL();
       
   165 
       
   166 protected:
       
   167     CMTPTypeObjectPropListElement* iPropertyElement;  // used by media DP directly
       
   168 
       
   169     // object which is prepare for PC
       
   170     CMTPObjectMetaData* iObject;
       
   171 
       
   172     // Array of the object handles to get object properties about
       
   173     RArray<TUint> iHandles;
       
   174 
       
   175     // Final object property array to send back
       
   176     CMTPTypeObjectPropList* iPropertyList;
       
   177 
       
   178     MMmMtpDpConfig& iDpConfig;
       
   179 
       
   180     mutable RArray<TUint> iPropertyArray;
       
   181 
       
   182     mutable TUint32 iHandle;
       
   183     mutable TUint32 iDepth;
       
   184     mutable TUint32 iPropCode;
       
   185     mutable TUint32 iFormatCode;
       
   186 
       
   187 #if defined(_DEBUG) || defined(MMMTPDP_PERFLOG)
       
   188     CMmMtpDpPerfLog* iPerfLog;
       
   189 #endif
       
   190 
       
   191     };
       
   192 
       
   193 #endif // CGETOBJECTPROPLIST_H