email/mail/UtilsSrc/CMailViewFactory.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 14 Sep 2010 21:11:56 +0300
branchRCL_3
changeset 28 fc3320e39880
parent 0 72b543305e3a
permissions -rw-r--r--
Revision: 201033 Kit: 201035

/*
* Copyright (c) 2004 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:  CMailViewFactory can be used to create mail view plugins.
*
*/


#ifndef CMAILVIEWFACTORY_H
#define CMAILVIEWFACTORY_H

// INCLUDES
#include <e32base.h>
#include <CMailMessageView.h>

// FORWARD DECLARATIONS
class CImplementationInformation;

//  CLASS DEFINITION

/**
*  Factory class for mail view plugins.
*
*  @lib 
*  @since 3.0
*/
class MailViewFactory 
    {
    public:
        /**
        * Creates all adapters and stores them in an array.
        * @return Array of adapters. Ownership is transferred.
        */
        IMPORT_C static CArrayPtr<CMailMessageView>* CreateViewPluginsL();

    private:

        /**
        * ResetAndDestroy() cleanup for an RImplInfoPtrArray.
        * @param aAny Array
        */
        static void CleanupImplArray( TAny* aAny );

        /**
        * ResetAndDestroy() cleanup for a CArrayPtr<CWPAdapter>.
        * @param aAny Array
        */
        static void CleanupAdapterArray( TAny* aAny );

        /** 
        * Comparator for two implementation information entries.
        * Compares the opaque data as a string.
        * @param aImpl1 First implementation to compare
        * @param aImpl2 Second implementation to compare
        */
        static TInt Compare( 
            const CImplementationInformation& aImpl1, 
            const CImplementationInformation& aImpl2 );
    };

#endif /* CMAILVIEWFACTORY_H */

// End of File