idlefw/inc/framework/aieventhandler.h
branchRCL_3
changeset 9 d0529222e3f0
equal deleted inserted replaced
4:1a2a00e78665 9:d0529222e3f0
       
     1 /*
       
     2 * Copyright (c) 2005-2006 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:  Content plugin event handler class for Active idle framework.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef _AIEVENTHANDLER_H
       
    21 #define _AIEVENTHANDLER_H
       
    22 
       
    23 // System includes
       
    24 #include <e32base.h>
       
    25 
       
    26 // User includes
       
    27 #include <hscontentpublisher.h>
       
    28 
       
    29 // Forward declarations
       
    30 class MAiPluginTool;
       
    31 class CAiPluginFactory;
       
    32 class CHsContentPublisher;
       
    33 class THsPublisherInfo;
       
    34 
       
    35 // Class declaration
       
    36 /**
       
    37  * @ingroup group_aifw
       
    38  * 
       
    39  *  Content plugin eventhandler class for Active idle framework.
       
    40  *
       
    41  *  @lib aifw
       
    42  *  @since S60 5.2
       
    43  */
       
    44 NONSHARABLE_CLASS( CAiEventHandler ) : public CBase                                              
       
    45 	{
       
    46 public: // Constructor and destructor	        	
       
    47 		
       
    48     static CAiEventHandler* NewL( CAiPluginFactory& aFactory );
       
    49                                               
       
    50     ~CAiEventHandler();
       
    51 		    
       
    52 public: // New functions
       
    53     
       
    54     /**
       
    55      * Forward plugin event to plugins.
       
    56      *
       
    57      * @since S60 5.2
       
    58      * @param aParam event string.
       
    59      */
       
    60     void HandlePluginEvent( const TDesC& aParam );
       
    61 
       
    62     /**
       
    63      * Forward plugin event to plugins.
       
    64      *
       
    65      * @since S60 5.2
       
    66      * @param aPublisherInfo publisher info.
       
    67      * @param aParam event string.
       
    68      */
       
    69     void HandlePluginEventL( 
       
    70         const THsPublisherInfo& aPublisherInfo, const TDesC& aParam ); 
       
    71             
       
    72     /**
       
    73      * Queries wheter a plugin has a menuitem or not.
       
    74      * 
       
    75      * @since S60 5.2
       
    76      * @param aPublisherInfo publisher info.
       
    77      * @param aMenuItem menuitem to query. 
       
    78      * @return ETrue if exists, EFalse otherwise
       
    79      */
       
    80     TBool HasMenuItemL( 
       
    81         const THsPublisherInfo& aPublisherInfo, const TDesC& aMenuItem );
       
    82 
       
    83     /**
       
    84      * Requests a Content publisher plug-in to refresh a content item.
       
    85      * 
       
    86      * @since S60 5.2
       
    87      * @param aContentCid Content id to refresh     
       
    88      * @return ETrue if succesful, EFalse otherwise      
       
    89      */
       
    90     TBool RefreshContent( const TDesC& aContentCid );
       
    91 
       
    92     /**
       
    93      * Requests a Content publisher plug-in to refresh a content item.
       
    94      * 
       
    95      * @since S60 5.2
       
    96      * @param aPublisherInfo publisher info.
       
    97      * @param aContentCid Content id to refresh              
       
    98      * @return ETrue if succesful, EFalse otherwise      
       
    99      */    
       
   100     TBool RefreshContent( 
       
   101         const THsPublisherInfo& aPublisherInfo, const TDesC& aContentCid );
       
   102         
       
   103     /**
       
   104      * Requests a Content publisher plug-in to suspend a content item.
       
   105      * 
       
   106      * @since S60 5.2
       
   107      * @param aPublisherInfo publisher info.
       
   108      * @param aContentCid Content id to suspend
       
   109      * @return ETrue if succesful, EFalse otherwise      
       
   110      */        
       
   111     TBool SuspendContent( 
       
   112         const THsPublisherInfo& aPublisherInfo, const TDesC& aContentCid );
       
   113             
       
   114 private: 
       
   115     // Constructors
       
   116 
       
   117     /**
       
   118      * C++ default contructor
       
   119      */
       
   120     CAiEventHandler( CAiPluginFactory& aFactory );
       
   121                              
       
   122     /**
       
   123      * 2nd phase contructor
       
   124      */
       
   125     void ConstructL();
       
   126 
       
   127 private: 
       
   128     // new functions
       
   129                                         
       
   130     void GetIdL( CHsContentPublisher& aContentPublisher,
       
   131         CHsContentPublisher::TProperty aProperty, const TDesC& aName, TInt& aId );            
       
   132                               
       
   133     TInt RefreshContentL( const TDesC& aContentCid );
       
   134 
       
   135 private: 
       
   136     // data
       
   137 
       
   138     /** Plugin factory, Not owned */
       
   139     CAiPluginFactory& iFactory;
       
   140     /** Plugin tool from utility lib, Owned */
       
   141     MAiPluginTool* iPluginTool;     
       
   142 
       
   143 private:
       
   144     // friend classes
       
   145     
       
   146 #ifdef _AIFW_UNIT_TEST
       
   147     class UT_AiEventHandler;
       
   148 #endif
       
   149 	};
       
   150 
       
   151 #endif // _AIEVENTHANDLER_H
       
   152 
       
   153 // End of File.