idlehomescreen/xmluicontroller/inc/contentpublisher.h
branchRCL_3
changeset 83 5456b4e8b3a8
equal deleted inserted replaced
82:5f0182e07bfb 83:5456b4e8b3a8
       
     1 /*
       
     2 * Copyright (c) 2009 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: 
       
    15 *
       
    16 */
       
    17 /*
       
    18 * ==============================================================================
       
    19 *  Name        : contentpublisher.h
       
    20 *  Part of     : 
       
    21 *  Interface   : Implemetation of CContentPublisher
       
    22 *  Description :
       
    23 *  Version     :
       
    24 
       
    25 */
       
    26 
       
    27 #ifndef CONTENTPUBLISHER_H
       
    28 #define CONTENTPUBLISHER_H
       
    29 
       
    30 #include <e32base.h>
       
    31 #include <liwcommon.h>
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 class CLiwGenericParamList;
       
    35 class CLiwServiceHandler;
       
    36 class MLiwInterface;
       
    37 
       
    38 namespace AiXmlUiController
       
    39 {
       
    40 class CXmlUiController;
       
    41 
       
    42 /**
       
    43  *  @ingroup group_xmluicontroller
       
    44  * 
       
    45  *  Interface to publish data to Content Publishing Service
       
    46  * 
       
    47  *  @since S60 5.1
       
    48  */
       
    49 class CContentPublisher : public CBase, public MLiwNotifyCallback
       
    50     {
       
    51     public:
       
    52         /**
       
    53         * Two-phased constructor.
       
    54         */
       
    55         static CContentPublisher* NewL(CXmlUiController& aUiController);
       
    56 
       
    57         /**
       
    58         * Destructor.
       
    59         */
       
    60         virtual ~CContentPublisher();
       
    61         
       
    62     private:
       
    63         CContentPublisher(CXmlUiController& aUiController);
       
    64         void ConstructL();
       
    65 
       
    66     public:  //from MLiwNotifyCallbackc
       
    67         
       
    68         /**
       
    69         * Handles notifications caused by an asynchronous Execute*CmdL call
       
    70         * or an event.
       
    71         *
       
    72         * @param aCmdId The service command associated to the event.
       
    73         * @param aEventId occurred event, see LiwCommon.hrh.
       
    74         * @param aEventParamList Event parameters, if any, as defined per
       
    75         *        each event.
       
    76         * @param aInParamList Input parameters, if any, given in the
       
    77         *        related HandleCommmandL.
       
    78         * @return Error code for the call back.
       
    79         */
       
    80         virtual TInt HandleNotifyL(
       
    81             TInt aCmdId,
       
    82             TInt /*aEventId*/,
       
    83             CLiwGenericParamList& aEventParamList,
       
    84             const CLiwGenericParamList& /*aInParamList*/);
       
    85         
       
    86     public: // New functions
       
    87     	
       
    88 		/**
       
    89 		* Sets given values to Content Publisher Service.
       
    90 		* @since Series 60 5.1
       
    91 		* @param aElementName The name of the element, which values are set.
       
    92 		* @param aWidth Width of the element
       
    93 		* @param aHeight Height of the element
       
    94 		*/    
       
    95 		void PublishSizeL( const TDesC& aElementName,
       
    96 				TInt aWidth, TInt aHeight );
       
    97     
       
    98     private:
       
    99     	
       
   100         void InitCpsInterfaceL();
       
   101         void AddDataL( const TDesC& aPublisherId,
       
   102                 const TDesC& aContentType, const TDesC& aContentId,
       
   103                 const TInt aData1, const TDesC8& aDataKey1,
       
   104                 const TInt aData2, const TDesC8& aDataKey2 );
       
   105         
       
   106         void GetDataL( const TDesC& aPublisherId, const TDesC& aContentType, 
       
   107         		const TDesC& aContentId, CLiwDefaultMap* aOutDataMap);
       
   108         
       
   109         void HandlePublisherInfoL( const TDesC& aPubInfo);
       
   110         void RegisterListenerL();
       
   111         void UnRegisterListenerL();
       
   112         
       
   113     private:
       
   114 		MLiwInterface* iCpsInterface;
       
   115 		CLiwServiceHandler* iServiceHandler;
       
   116 		
       
   117 	    /**
       
   118 	     * Reference to XML ui controller.
       
   119 	     */
       
   120 	    CXmlUiController& iUiController;
       
   121     };
       
   122 
       
   123 }// namespace AiXmlUiController
       
   124 #endif //CONTENTPUBLISHER_H
       
   125 
       
   126 
       
   127 
       
   128 
       
   129