meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/resmrpluginextensionstatic.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 31 Mar 2010 21:08:33 +0300
branchRCL_3
changeset 12 4ce476e64c59
parent 8 e1b6206813b4
child 16 b5fbb9b25d57
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:  Static Tls data storage for plugin extension
 *
*/


#ifndef RESMRPLUGINEXTENSIONSTATIC_H
#define RESMRPLUGINEXTENSIONSTATIC_H

#include <e32base.h>
//<cmail>
#include "CFSMailClient.h"
//</cmail>

class TESMRPluginExtensionData;

/*
 * Proxy class to access TLS stored data
 */
NONSHARABLE_CLASS( RESMRPluginExtensionStatic )
    {
public:
    /**
     *  C++ constructor
     */
    RESMRPluginExtensionStatic();

    /**
     * C++ destructor
     */
    ~RESMRPluginExtensionStatic();

    /*
     * Retrieves stored data pointer from Tls, or creates new one
     * if called first time. Must be called before using this class.
     */
    void ConnectL();

    /*
     * Closes this instance of static data handler.
     */
    void Close();

    /**
     * Returns global instance of default CFSMailBox.
     * @return Reference to CFSMailBox object
     */
    CFSMailBox& DefaultFSMailBoxL();

    /**
     * Returns mail box instance for given email address.
     * Ownership of mail box is transferred to caller.
     * 
     * @param aEmailAddress email address of the desired mail box
     * @return CFSMailBox instance. Ownership is transferred to caller.
     */
    CFSMailBox* MailBoxL( const TDesC& aEmailAddress );

private: // Implementation

    /**
      * Returns global instance of CFSMailClient
      * @return Global reference to CFSMailClient
      */
    CFSMailClient& FSMailClientL();

private: // Data
    /*
     * Pointer to Tls stored data pointer
     */
    TESMRPluginExtensionData* iStaticData;

    /*
     * Used pointer types
     */
    TInt iUsedTypes;
    };

#endif //RESMRPLUGINEXTENSIONSTATIC_H

// EOF