mtpdataproviders/mtpimagedp/inc/cmtpimagedpmdeobserver.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 02 Feb 2010 01:11:40 +0200
changeset 0 d0791faffa3f
child 2 4843bb5893b6
permissions -rw-r--r--
Revision: 201003 Kit: 201005

// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
//

/**
 @file
 @internalTechnology
*/

#ifndef CMTPIMAGEDPMDEOBSERVER_H
#define CMTPIMAGEDPMDEOBSERVER_H

#include <e32cmn.h>
#include <e32base.h>
#include <e32def.h>

#include <comms-infras/commsdebugutility.h>

#include "rmediasyncserver.h"
#include "cmtpimagedpobjectpropertymgr.h"

class MMTPDataProviderFramework;
class CMTPImageDataProvider;

/** 
Implements the observer interfaces of MDE.
@internalComponent
*/
class CMTPImageDpMdeObserver : public CBase, 
                               public MMdEObjectObserver
    {
public:

    static CMTPImageDpMdeObserver* NewL(MMTPDataProviderFramework& aFramework, CMTPImageDataProvider& aDataProvider);
    ~CMTPImageDpMdeObserver();
    
public:
    // From MMdEObjectObserver
    void HandleObjectNotification(CMdESession& aSession,
                                 TObserverNotificationType aType,
                                 const RArray<TItemId>& aObjectIdArray);
    
    void SubscribeForChangeNotificationL();
    void UnsubscribeForChangeNotificationL();
    
private:
    CMTPImageDpMdeObserver(MMTPDataProviderFramework& aFramework, CMTPImageDataProvider& aDataProvider);
    void ConstructL();   
    
private:    
    void HandleObjectNotificationL(CMdESession& aSession,
                                   TObserverNotificationType aType,
                                   const RArray<TItemId>& aObjectIdArray);
            
    void ProcessMdeNotificationL(const RArray<TItemId>& aObjectIdArray, TObserverNotificationType aType);     
    void CreateMetadataL(const CMdEObject& aMdeObject, CMTPObjectMetaData& aMetaData); 
    
private:
    /**
    FLOGGER debug trace member variable.
    */
    __FLOG_DECLARATION_MEMBER_MUTABLE;
    
    MMTPDataProviderFramework&    iFramework;    
    CMTPImageDataProvider&        iDataProvider;
    TBool                         iSubscribed;
    TInt                          iNewPics;
    };

#endif // CMTPIMAGEDPMDEOBSERVER_H