idlehomescreen/xmluicontroller/inc/contentpublisher.h
changeset 0 f72a12da539e
child 1 5315654608de
equal deleted inserted replaced
-1:000000000000 0:f72a12da539e
       
     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 class CAknGlobalConfirmationQuery;
       
    38 
       
    39 namespace AiXmlUiController
       
    40 {
       
    41 class CXmlUiController;
       
    42 class CGlobalQueryHandler;
       
    43 
       
    44 
       
    45 /**
       
    46  *  @ingroup group_xmluicontroller
       
    47  * 
       
    48  *  Interface to publish data to Content Publishing Service
       
    49  * 
       
    50  *  @since S60 5.1
       
    51  */
       
    52 class CContentPublisher : public CBase, public MLiwNotifyCallback
       
    53     {
       
    54     public:
       
    55         /**
       
    56         * Two-phased constructor.
       
    57         */
       
    58         static CContentPublisher* NewL(CXmlUiController& aUiController);
       
    59 
       
    60         /**
       
    61         * Destructor.
       
    62         */
       
    63         virtual ~CContentPublisher();
       
    64         
       
    65     private:
       
    66         CContentPublisher(CXmlUiController& aUiController);
       
    67         void ConstructL();
       
    68 
       
    69     public:  //from MLiwNotifyCallbackc
       
    70         
       
    71         /**
       
    72         * Handles notifications caused by an asynchronous Execute*CmdL call
       
    73         * or an event.
       
    74         *
       
    75         * @param aCmdId The service command associated to the event.
       
    76         * @param aEventId occurred event, see LiwCommon.hrh.
       
    77         * @param aEventParamList Event parameters, if any, as defined per
       
    78         *        each event.
       
    79         * @param aInParamList Input parameters, if any, given in the
       
    80         *        related HandleCommmandL.
       
    81         * @return Error code for the call back.
       
    82         */
       
    83         virtual TInt HandleNotifyL(
       
    84             TInt aCmdId,
       
    85             TInt /*aEventId*/,
       
    86             CLiwGenericParamList& aEventParamList,
       
    87             const CLiwGenericParamList& /*aInParamList*/);
       
    88         
       
    89     public: // New functions
       
    90     	
       
    91 		/**
       
    92 		* Sets given values to Content Publisher Service.
       
    93 		* @since Series 60 5.1
       
    94 		* @param aElementName The name of the element, which values are set.
       
    95 		* @param aWidth Width of the element
       
    96 		* @param aHeight Height of the element
       
    97 		*/    
       
    98 		void PublishSizeL( const TDesC& aElementName,
       
    99 				TInt aWidth, TInt aHeight );
       
   100     
       
   101     private:
       
   102     	
       
   103         void InitCpsInterfaceL();
       
   104         void AddDataL( const TDesC& aPublisherId,
       
   105                 const TDesC& aContentType, const TDesC& aContentId,
       
   106                 const TInt aData1, const TDesC8& aDataKey1,
       
   107                 const TInt aData2, const TDesC8& aDataKey2 );
       
   108         
       
   109         void GetDataL( const TDesC& aPublisherId, const TDesC& aContentType, 
       
   110         		const TDesC& aContentId, CLiwDefaultMap* aOutDataMap);
       
   111         
       
   112         void HandlePublisherInfoL( const TDesC& aPubInfo);
       
   113         void RegisterListenerL();
       
   114         void UnRegisterListenerL();
       
   115         
       
   116         /**
       
   117          * Displayes global query for 'go online' or 'go offline' confirmations
       
   118          * @param aResourceId resource id for the text string
       
   119          * @param aSetOnline if ETrue then set widgets online if confirmation accepted,
       
   120          *     if EFalse then set widgets offline if confirmation accepted 
       
   121          */
       
   122         void ShowGlobalQueryL( TInt aResourceId, TBool aSetOnline );
       
   123         
       
   124     private:
       
   125 		MLiwInterface* iCpsInterface;
       
   126 		CLiwServiceHandler* iServiceHandler;
       
   127 		
       
   128 	    /**
       
   129 	     * Reference to XML ui controller.
       
   130 	     */
       
   131 	    CXmlUiController& iUiController;
       
   132 	    
       
   133 	    CGlobalQueryHandler* iGlobalQueryHandler;
       
   134 	    CAknGlobalConfirmationQuery* iGlobalConfirmationQuery;
       
   135 	    
       
   136     };
       
   137 
       
   138 }// namespace AiXmlUiController
       
   139 #endif //CONTENTPUBLISHER_H
       
   140 
       
   141 
       
   142 
       
   143 
       
   144