mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpaccesssingleton.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 31 Mar 2010 22:26:09 +0300
branchRCL_3
changeset 17 780c925249c1
parent 9 bee149131e4b
child 30 6f9f6e99a23e
permissions -rw-r--r--
Revision: 201011 Kit: 201013

/*
* 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:  Meta data Access Singleton
*
*/


#ifndef CMMMTPDPACCESSSINGLETON_H
#define CMMMTPDPACCESSSINGLETON_H

class CMmMtpDpMetadataAccessWrapper;
class MMTPDataProviderFramework;

class CMmMtpDpAccessSingleton : public CObject
    {
public:
    /**
     * Create Singleton instance
     * need Release(), if no use
     * @param aRFs RFs reference
     * @param aFramework framework reference
     */
    IMPORT_C static void CreateL( MMTPDataProviderFramework& aFramework );
    
    /**
     * release singleton instance
     */
    IMPORT_C static void Release();
    
    /**
     * get metadata access wrapper reference
     */
    IMPORT_C static CMmMtpDpMetadataAccessWrapper& GetAccessWrapperL();
    
    /**
     * do some special process with assess DBs when receives opensession command
     */
    IMPORT_C static void OpenSessionL();
    
    /**
     * do some special process with assess DBs when receives closesession command
     */
    IMPORT_C static void CloseSessionL();
    
private:
    /*
     * get singleton instance, for internal use
     */
    static CMmMtpDpAccessSingleton* Instance();
    
    /*
     * 2-phase construction
     */
    static CMmMtpDpAccessSingleton* NewL( MMTPDataProviderFramework& aFramework );
    
    /*
     * 2-phase construction
     */
    void ConstructL( MMTPDataProviderFramework& aFramework );
    /*
     * destruction
     */
    ~CMmMtpDpAccessSingleton();
    
private:
    CMmMtpDpMetadataAccessWrapper* iWrapper;

    };

#endif // CMMMTPDPACCESSSINGLETON_H