calendarui/inc/calencustomisation.h
branchRCL_3
changeset 65 12af337248b1
equal deleted inserted replaced
60:96907930389d 65:12af337248b1
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Interface for Calendar customisation plugins
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CALENCUSTOMISATION_H
       
    20 #define CALENCUSTOMISATION_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <ecom/ecom.h>
       
    25 
       
    26 // CONSTANTS
       
    27 const TUid KCalenCustomisationInterfaceUid = { 0x2002EA3B };
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CalenView;
       
    31 class MCalenServices;
       
    32 class MCalenCommandHandler;
       
    33 class HbWidget;
       
    34 class QString;
       
    35 class HbMenu;
       
    36 
       
    37 /**
       
    38  * CCalenCustomisation is the base class for
       
    39  * creating customised calendar plugins.
       
    40  */
       
    41 class CCalenCustomisation : public CBase
       
    42     {
       
    43     public:
       
    44         static CCalenCustomisation* CreateImplementationL( TUid aUid, MCalenServices* aServices );
       
    45         virtual ~CCalenCustomisation();
       
    46 
       
    47     public: 
       
    48         
       
    49         virtual HbWidget* InfobarL() = 0; 
       
    50 		virtual MCalenCommandHandler* CommandHandlerL(TInt aCommand) = 0;
       
    51 		virtual QString* InfobarTextL() = 0;
       
    52 		virtual void CustomiseMenu(HbMenu* aHbMenu) = 0;
       
    53         
       
    54 
       
    55     private:
       
    56         /**
       
    57          * Instance identifier key. When instance of an implementation is
       
    58          * created by ECOM framework, the framework will assign a UID for
       
    59          * it. The UID is used in the destructor to notify framework that
       
    60          * this instance is being destroyed and resources can be released.
       
    61          * Plugin implementations should leave this untouched, as the inline
       
    62          * destructor and constructor method take care of ECom releasing.
       
    63          */
       
    64         TUid iDtor_ID_Key;
       
    65     };
       
    66 
       
    67 inline CCalenCustomisation* CCalenCustomisation::CreateImplementationL( TUid aUid, MCalenServices* aServices )
       
    68     {
       
    69     TAny* ptr = REComSession::CreateImplementationL( aUid, _FOFF( CCalenCustomisation, iDtor_ID_Key ) , aServices);
       
    70     CCalenCustomisation* impl = static_cast<CCalenCustomisation*> (ptr);
       
    71     return impl;
       
    72     }
       
    73 
       
    74 inline CCalenCustomisation::~CCalenCustomisation()
       
    75     {
       
    76     REComSession::DestroyedImplementation( iDtor_ID_Key );
       
    77     }
       
    78 
       
    79 
       
    80 
       
    81 #endif  // CALENCUSTOMISATION_H