os/mm/devsoundextensions/ciextnfactoryplugins/ciplatformmsghndlrplugin/src/ciplatformmsghndlrplugin.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
/*
sl@0
     2
* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
sl@0
     3
* All rights reserved.
sl@0
     4
* This component and the accompanying materials are made available
sl@0
     5
* under the terms of "Eclipse Public License v1.0"
sl@0
     6
* which accompanies this distribution, and is available
sl@0
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
*
sl@0
     9
* Initial Contributors:
sl@0
    10
* Nokia Corporation - initial contribution.
sl@0
    11
*
sl@0
    12
* Contributors:
sl@0
    13
*
sl@0
    14
* Description:   Header definition of plugin class implementing message handler
sl@0
    15
*                interface.
sl@0
    16
*
sl@0
    17
*/
sl@0
    18
sl@0
    19
sl@0
    20
sl@0
    21
#ifndef CIPLATFORMMSGHNDLRPLUGIN_H
sl@0
    22
#define CIPLATFORMMSGHNDLRPLUGIN_H
sl@0
    23
sl@0
    24
// Include files
sl@0
    25
#include <e32base.h>
sl@0
    26
#include <cimsghndlrintfc.h>
sl@0
    27
#include <mmfcontrollerframework.h>
sl@0
    28
#include <MCustomInterfaceCustomCommandImplementor.h>
sl@0
    29
#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
sl@0
    30
#include <mmfcontroller.h>
sl@0
    31
#include <mmf/common/mmfcustomcommandparsermanager.h>
sl@0
    32
#endif
sl@0
    33
sl@0
    34
// Forward declarations
sl@0
    35
class CMMFObjectContainer;
sl@0
    36
class CMMFCustomCommandParserManager;
sl@0
    37
class CCustomInterfaceBuilder;
sl@0
    38
sl@0
    39
/**
sl@0
    40
 *  Plugin class implementing MCIMsgHndlrIntfc
sl@0
    41
 *
sl@0
    42
 *  An instance of this class is created when CCIExtnServerPlugin is created.
sl@0
    43
 *  When CCIExtnClientPlugin receives HandleMessageL() message, it is
sl@0
    44
 *  forwarded to each instace of the plugin in its list.
sl@0
    45
 *
sl@0
    46
 *  Several instances this plugin can exist in the system. Platform provides a
sl@0
    47
 *  default plugin.
sl@0
    48
 *
sl@0
    49
 *  This class is intended to be used by CCIExtnServerPlugin.
sl@0
    50
 *
sl@0
    51
 *  @since S60 v3.2
sl@0
    52
 *
sl@0
    53
 */
sl@0
    54
class CCIPlatformMsgHndlrPlugin : public CBase,
sl@0
    55
                                  public MCIMsgHndlrIntfc,
sl@0
    56
                                  public MCustomInterfaceCustomCommandImplementor
sl@0
    57
    {
sl@0
    58
public:
sl@0
    59
sl@0
    60
    /**
sl@0
    61
     * Two-phased constructor.
sl@0
    62
     * Called by ECom framework.
sl@0
    63
     */
sl@0
    64
    static MCIMsgHndlrIntfc* NewL();
sl@0
    65
    /**
sl@0
    66
    * Destructor.
sl@0
    67
    */
sl@0
    68
    ~CCIPlatformMsgHndlrPlugin();
sl@0
    69
sl@0
    70
    // From MCIMsgHndlrIntfc begins
sl@0
    71
    // Called by framework when plugin is constructed
sl@0
    72
    TInt Initialize( MCustomInterface& aCustomInterface, TUid aDestructorKey );
sl@0
    73
    // Called by framework when to know plugin implementation uid
sl@0
    74
    TUid ImplementationUid();
sl@0
    75
    // Called by framework forwarding request to handle aMessage
sl@0
    76
    TBool HandleMessage( const RMmfIpcMessage& aMessage );
sl@0
    77
    // Called by framework when plugin is to be deleted
sl@0
    78
    void Close();
sl@0
    79
    // From MCIMsgHndlrIntfc ends
sl@0
    80
sl@0
    81
    // From MCustomInterfaceCustomCommandImplementor begins
sl@0
    82
    // Called by framework to get handle to custom interface builder
sl@0
    83
    const TMMFMessageDestination& GetCustomInterfaceBuilderL();
sl@0
    84
    // From MCustomInterfaceCustomCommandImplementor ends
sl@0
    85
sl@0
    86
private:
sl@0
    87
sl@0
    88
    /**
sl@0
    89
     * Constructor.
sl@0
    90
     */
sl@0
    91
    CCIPlatformMsgHndlrPlugin();
sl@0
    92
sl@0
    93
    /**
sl@0
    94
     * Second phase constructor.
sl@0
    95
     */
sl@0
    96
    void ConstructL();
sl@0
    97
sl@0
    98
    /**
sl@0
    99
     * Initializes objects required for Custom Interface Framework.
sl@0
   100
     *
sl@0
   101
     * Leaves on error.
sl@0
   102
     */
sl@0
   103
    void InitializeCIFWObjectsL();
sl@0
   104
sl@0
   105
private:
sl@0
   106
sl@0
   107
    /**
sl@0
   108
     * Reference to MCustomInterface interface
sl@0
   109
     * Not own.
sl@0
   110
     */
sl@0
   111
    MCustomInterface*               iMCustomInterface;
sl@0
   112
sl@0
   113
    /**
sl@0
   114
     * Uid of the plugin object passed by the framework via Initialize()
sl@0
   115
     */
sl@0
   116
    TUid                            iDestructorKey;
sl@0
   117
sl@0
   118
    /**
sl@0
   119
     * Holds ETrue of objects required for CIFW is initialized else EFalse
sl@0
   120
     * This is used for lazy initialization. Plugins may be loaded during
sl@0
   121
     * FW initailization time and not all instances of FW may use CIFW
sl@0
   122
     */
sl@0
   123
    TBool                           iCIFWObjectsInitialized;
sl@0
   124
sl@0
   125
    /**
sl@0
   126
     * MMF object container. Container for Custom Interface builder
sl@0
   127
     * and message handlers created by it.
sl@0
   128
     *
sl@0
   129
     * Own.
sl@0
   130
     */
sl@0
   131
    CMMFObjectContainer*            iMMFObjectContainer;
sl@0
   132
sl@0
   133
    /**
sl@0
   134
     * Custom Command Parser Manager. Container for Custom Interface
sl@0
   135
     * Custom Command Parser object.
sl@0
   136
     *
sl@0
   137
     * Own.
sl@0
   138
     */
sl@0
   139
    CMMFCustomCommandParserManager* iCustomCommandParserManager;
sl@0
   140
sl@0
   141
    /**
sl@0
   142
     * Pointer to the custom interface builder. This is just a reference.
sl@0
   143
     * plugin instance does not own even though it creates this.
sl@0
   144
     * Ownership is transfered to iMMFObjectContainer.
sl@0
   145
     *
sl@0
   146
     * Not own.
sl@0
   147
     */
sl@0
   148
    CCustomInterfaceBuilder*        iCustomInterfaceBuilder;
sl@0
   149
    };
sl@0
   150
sl@0
   151
#endif // CIPLATFORMMSGHNDLRPLUGIN_H