mtpfws/mtpfw/dataproviders/devdp/inc/cmtpdevicedp.h
changeset 0 d0791faffa3f
child 2 4843bb5893b6
equal deleted inserted replaced
-1:000000000000 0:d0791faffa3f
       
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalComponent
       
    19 */
       
    20 
       
    21 #ifndef CMTPDEVICEDP_H
       
    22 #define CMTPDEVICEDP_H
       
    23 
       
    24 #include <mtp/cmtpdataproviderplugin.h>
       
    25 #include "mtpdebug.h"
       
    26 #include "mmtpenumerationcallback.h"
       
    27 #include "rmtpdevicedpsingletons.h"
       
    28 #include "rmtpdpsingletons.h"
       
    29 #include "mextndevplugincallback.h"
       
    30 #include "mmtpdevdpextn.h"
       
    31 
       
    32 #include "cmtpgetdevicepropdesc.h"
       
    33 #include "cmtpdevicedatastore.h"
       
    34 #include "cmtpdevdpextnmap.h"
       
    35 #include <mtp/tmtptypeevent.h>
       
    36 
       
    37 class CMTPDevDpExclusionMgr;
       
    38 class CMTPFSEnumerator;
       
    39 class CMTPStorageWatcher;
       
    40 class MMTPRequestProcessor;
       
    41 class CMtpExtnDevicePropPlugin;
       
    42 class CMTPDeviceDataStore;
       
    43 
       
    44 /** 
       
    45 Implements the MTP device data provider plug-in.
       
    46 @internalComponent
       
    47 */
       
    48 class CMTPDeviceDataProvider : 
       
    49 	public CMTPDataProviderPlugin,
       
    50 	public MMTPEnumerationCallback , public MExtnDevPluginCallback
       
    51     {
       
    52 private:
       
    53 	enum TEnumerationState
       
    54 		{
       
    55 		EUndefined,
       
    56 		EEnumeratingDeviceDataStore,
       
    57 		EEnumeratingFolders,
       
    58 		EEnumerationComplete,
       
    59 		};
       
    60     
       
    61 public:
       
    62 
       
    63     static TAny* NewL(TAny* aParams);
       
    64     ~CMTPDeviceDataProvider();
       
    65     
       
    66 private: // From CMTPDataProviderPlugin
       
    67 
       
    68     void Cancel();
       
    69     void ProcessEventL(const TMTPTypeEvent& aEvent, MMTPConnection& aConnection);
       
    70     void ProcessNotificationL(TMTPNotification aNotification, const TAny* aParams);
       
    71     void ProcessRequestPhaseL(TMTPTransactionPhase aPhase, const TMTPTypeRequest& aRequest, MMTPConnection& aConnection);
       
    72     void StartObjectEnumerationL(TUint32 aStorageId, TBool aPersistentFullEnumeration);
       
    73     void StartStorageEnumerationL();
       
    74     void Supported(TMTPSupportCategory aCategory, RArray<TUint>& aArray) const;
       
    75 
       
    76 private: // MMTPEnumerationCallback
       
    77 
       
    78 	void NotifyEnumerationCompleteL(TUint32 aStorageId, TInt aError);
       
    79 
       
    80 private:
       
    81     
       
    82     CMTPDeviceDataProvider(TAny* aParams);
       
    83     void ConstructL();
       
    84     
       
    85     TInt LocateRequestProcessorL(const TMTPTypeRequest& aRequest, MMTPConnection& aConnection);
       
    86     TInt LocateRequestProcessorL(const TMTPTypeEvent& aEvent, MMTPConnection& aConnection);    
       
    87     void SessionClosedL(const TMTPNotificationParamsSessionChange& aSession);
       
    88     void SessionOpenedL(const TMTPNotificationParamsSessionChange& aSession);
       
    89     TInt FindExtnPlugin(TUint aOpcode);
       
    90     void LoadExtnPluginsL();
       
    91    
       
    92    public:
       
    93     //from MExtnDevPluginCallback
       
    94     void OnDevicePropertyChangedL (TMTPDevicePropertyCode& aPropCode);
       
    95 	
       
    96     /**
       
    97       * This method return reference MMTPDataProviderFramework
       
    98       */
       
    99     MMTPDataProviderFramework& DataProviderFramework ();
       
   100     
       
   101 private: // Owned
       
   102 
       
   103     /**
       
   104     FLOGGER debug trace member variable.
       
   105     */
       
   106     __FLOG_DECLARATION_MEMBER_MUTABLE;
       
   107 
       
   108     /**
       
   109     The active request processors table. Multiple request processors may be 
       
   110     active in a multi-session MTP environment.
       
   111     */
       
   112     RPointerArray<MMTPRequestProcessor> iActiveProcessors;
       
   113     
       
   114     /**
       
   115     The device DP singletons.
       
   116     */
       
   117     RMTPDeviceDpSingletons              iDevDpSingletons;
       
   118     
       
   119     /**
       
   120     The dp utilities singleton.
       
   121     */
       
   122     RMTPDpSingletons					iDpSingletons;
       
   123     
       
   124     /**
       
   125     The device dp object enumeration state.
       
   126     */
       
   127     TEnumerationState					iEnumeratingState;
       
   128     
       
   129     /**
       
   130     The device dp folder enumerator.
       
   131     */
       
   132     CMTPFSEnumerator*					iEnumerator;
       
   133     
       
   134     /**
       
   135     The device dp exlusion manager. 
       
   136     */
       
   137     CMTPDevDpExclusionMgr*				iExclusionMgr;
       
   138     
       
   139     /**
       
   140     The list of storages to be enumerated.
       
   141     */	
       
   142     RArray<TUint32>                     iPendingEnumerations;
       
   143     
       
   144     /**
       
   145     The system storages watcher.
       
   146     */
       
   147     CMTPStorageWatcher*                 iStorageWatcher;
       
   148     
       
   149     /**
       
   150     The device Dp extension plugin map array.
       
   151     */   
       
   152     RPointerArray<CDevDpExtnPluginMap> iExtnPluginMapArray;//2113
       
   153   
       
   154     /**
       
   155     The event dataset.
       
   156     */     
       
   157     TMTPTypeEvent                   iEvent;
       
   158     
       
   159     //not owned by this class
       
   160     CMTPDeviceDataStore *iPtrDataStore;
       
   161     
       
   162     TInt								iActiveProcessor;
       
   163     TBool								iActiveProcessorRemoved;
       
   164 
       
   165    
       
   166     };
       
   167     
       
   168 #endif // CMTPDEVICEDP_H