diff -r c743ef5928ba -r f966699dea19 idlehomescreen/xmluicontroller/inc/contentrenderer.h --- a/idlehomescreen/xmluicontroller/inc/contentrenderer.h Tue Feb 02 00:04:13 2010 +0200 +++ b/idlehomescreen/xmluicontroller/inc/contentrenderer.h Fri Feb 19 22:42:37 2010 +0200 @@ -19,17 +19,22 @@ #ifndef C_CONTENTRENDERER_H #define C_CONTENTRENDERER_H +// System includes #include #include + +// User includes #include "xnnewsticker.h" +#include "aicontentobserver.h" #include "xnproperty.h" -#include "aicontentobserver.h" +// Forward declarations class TXnUiEngineAppIf; class CXnNodeAppIf; class CGulIcon; class MAiFwEventHandler; -struct TAiPublisherInfo; +class CHsContentPublisher; +class THsPublisherInfo; namespace AiUtility { @@ -50,7 +55,6 @@ class TAiPolicyElement; } - namespace AiXmlUiController { @@ -62,15 +66,19 @@ * @lib AiXmlUiMain */ class CContentRenderer : public CBase, - public MAiContentObserver, - public XnNewstickerInterface::MXnNewstickerCallbackInterface + public MAiContentObserver, + public XnNewstickerInterface::MXnNewstickerCallbackInterface { -public: // Constructors and destructor +public: + // Constructors and destructor static CContentRenderer* NewL( CAppUi& aAppUi ); - virtual ~CContentRenderer(); + ~CContentRenderer(); +public: + // New functions + /** * Sets event handler. * @@ -79,138 +87,158 @@ void SetEventHandler( MAiFwEventHandler& aFwEventHandler ); /** - * Resets content renderer for new theme. - */ - void Reset(); - - /** * Cleans all content items published by aPlugin. */ - void CleanPluginFromUi( MAiPropertyExtension& aPlugin ); + void CleanPluginFromUi( CHsContentPublisher& aPlugin ); -// Functions from MAiContentObserver +public: + // from MAiContentObserver + /** + * @see MAiContentObserver + */ TInt StartTransaction( TInt aTxId ); + /** + * @see MAiContentObserver + */ TInt Commit( TInt aTxId ); + /** + * @see MAiContentObserver + */ TInt CancelTransaction( TInt aTxId ); - TBool CanPublish( MAiPropertyExtension& aPlugin, - TInt aContent, - TInt aIndex ); - - TInt Publish( MAiPropertyExtension& aPlugin, - TInt aContent, - TInt aResource, - TInt aIndex ); + /** + * @see MAiContentObserver + */ + TBool CanPublish( CHsContentPublisher& aPlugin, + TInt aContent, TInt aIndex ); + + /** + * @see MAiContentObserver + */ + TInt Publish( CHsContentPublisher& aPlugin, + TInt aContent, TInt aResource, TInt aIndex ); + + /** + * @see MAiContentObserver + */ + TInt Publish( CHsContentPublisher& aPlugin, + TInt aContent, const TDesC16& aText, TInt aIndex ); - TInt Publish( MAiPropertyExtension& aPlugin, - TInt aContent, - const TDesC16& aText, - TInt aIndex ); + /** + * @see MAiContentObserver + */ + TInt Publish( CHsContentPublisher& aPlugin, + TInt aContent, const TDesC8& aBuf, TInt aIndex ); - TInt Publish( MAiPropertyExtension& aPlugin, - TInt aContent, - const TDesC8& aBuf, - TInt aIndex ); + /** + * @see MAiContentObserver + */ + TInt Publish( CHsContentPublisher& aPlugin, + TInt aContent, RFile& aFile, TInt aIndex ); - TInt Publish( MAiPropertyExtension& aPlugin, - TInt aContent, - RFile& aFile, - TInt aIndex ); + /** + * @see MAiContentObserver + */ + TInt Clean( CHsContentPublisher& aPlugin, + TInt aContent, TInt aIndex ); - TInt Clean( MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex ); - + /** + * @see MAiContentObserver + */ TAny* Extension( TUid aUid ); - TBool RequiresSubscription( const TAiPublisherInfo& aPublisherInfo ) const; - - TInt SetProperty(MAiPropertyExtension& aPlugin, - const TDesC8& aElementId, - const TDesC8& aPropertyName, - const TDesC8& aPropertyValue ); + /** + * @see MAiContentObserver + */ + TBool RequiresSubscription( + const THsPublisherInfo& aPublisherInfo ) const; + + /** + * @see MAiContentObserver + */ + TInt SetProperty( CHsContentPublisher& aPlugin, + const TDesC8& aElementId, const TDesC8& aPropertyName, + const TDesC8& aPropertyValue ); - TInt SetProperty(MAiPropertyExtension& aPlugin, - const TDesC8& aElementId, - const TDesC8& aPropertyName, - const TDesC8& aPropertyValue, - MAiContentObserver::TValueType aValueType); + /** + * @see MAiContentObserver + */ + TInt SetProperty( CHsContentPublisher& aPlugin, + const TDesC8& aElementId, const TDesC8& aPropertyName, + const TDesC8& aPropertyValue, + MAiContentObserver::TValueType aValueType ); + +private: + // Constructors - CXnDomPropertyValue::TPrimitiveValueType - DomPropertyValueType(MAiContentObserver::TValueType aValueType); - -private: - + /** + * C++ default constructor + */ CContentRenderer( CAppUi& aAppUi ); + /** + * 2nd phase constructor + */ void ConstructL(); +private: + // New functions + void DoStartTransactionL( TInt aTxId ); - TInt CanPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - TInt aIndex ); - - TInt DoPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - TInt aResource, - TInt aIndex); + TInt CanPublishL( CHsContentPublisher& aPlugin, + TInt aContent, TInt aIndex ); + + TInt DoPublishL( CHsContentPublisher& aPlugin, + TInt aContent, TInt aResource, TInt aIndex ); - TInt DoPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - const TDesC16& aText, - TInt aIndex ); + TInt DoPublishL( CHsContentPublisher& aPlugin, + TInt aContent, const TDesC16& aText, TInt aIndex ); - TInt DoPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - const TDesC8& aBuf, - TInt aIndex ); - - TInt DoPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - RFile& aFile, - TInt aIndex ); - - TInt DoCleanL( MAiPropertyExtension& aPlugin, - TInt aContent, - TInt aIndex ); - + TInt DoPublishL( CHsContentPublisher& aPlugin, + TInt aContent, const TDesC8& aBuf, TInt aIndex ); + + TInt DoPublishL( CHsContentPublisher& aPlugin, + TInt aContent, RFile& aFile, TInt aIndex ); + + TInt DoCleanL( CHsContentPublisher& aPlugin, + TInt aContent, TInt aIndex ); + void SetImmediateMode( TBool aImmediateMode ); TBool IsImmediateMode() const; - void ProcessTransactionElementL( MTransactionElement* aElement ); + void ProcessTransactionElementL( + MTransactionElement* aElement ); + + CXnNodeAppIf* FindNodeByClassL( + const TDesC& aCid, TInt aIndex, const TDesC8& aNs ); - CXnNodeAppIf* FindNodeByClassL( const TDesC& aCid, - TInt aIndex, - const TDesC8& aNs ); + CXnNodeAppIf* FindNodeByIdL( + const TDesC& aCid, const TDesC& aNs = KNullDesC ); - CXnNodeAppIf* FindNodeByIdL( const TDesC& aCid, const TDesC& aNs = KNullDesC ); - - CXnNodeAppIf* FindNodeByIdL( const TDesC8& aCid, const TDesC8& aNs = KNullDesC8 ); + CXnNodeAppIf* FindNodeByIdL( + const TDesC8& aCid, const TDesC8& aNs = KNullDesC8 ); - TInt PublishIconL( MAiPropertyExtension& aPlugin, - const TDesC& aCid, - CGulIcon* aIcon, - TInt aIndex, - CXnNodeAppIf* aResource = NULL ); + TInt PublishIconL( CHsContentPublisher& aPlugin, + const TDesC& aCid, CGulIcon* aIcon, TInt aIndex, + CXnNodeAppIf* aResource = NULL ); - TInt PublishDataL( MAiPropertyExtension& aPlugin, - const TDesC& aCid, - const TDesC8& aData, - const TDesC8& aContentType, - TInt aIndex, - CXnNodeAppIf* aResource = NULL ); + TInt PublishDataL( CHsContentPublisher& aPlugin, + const TDesC& aCid, const TDesC8& aData, + const TDesC8& aContentType, TInt aIndex, + CXnNodeAppIf* aResource = NULL ); - TBool AllowPublishByPriority( CXnNodeAppIf& aUiElement, - TInt aNewPriority ) const; - + TBool AllowPublishByPriority( + CXnNodeAppIf& aUiElement, TInt aNewPriority ) const; + void StartContentRefresh(); - TInt RefreshContentL( HBufC* aUiElementId, - TInt aOldPriority ); - + TInt RefreshContentL( HBufC* aUiElementId, TInt aOldPriority ); + static TInt RefreshContentCallback( TAny* aContentRenderer ); void SendRefreshContentEventL(); @@ -218,97 +246,55 @@ TBool IsParentNewsticker( CXnNodeAppIf& aTarget ); void RegisterNewstickerCallbackInterfaceL( CXnNodeAppIf& aTarget ); + + void ProcessContentChangesL( MTransaction& aTr ); + void ProcessContentChangeL( TAiPolicyElement& aElement ); - TInt SetPropertyL(MAiPropertyExtension& aPlugin, - const TDesC8& aElementId, - const TDesC8& aPropertyName, - const TDesC8& aPropertyValue, - MAiContentObserver::TValueType aValueType); - -// From XnNewstickerInterface::MXnNewstickerCallbackInterface + TInt SetPropertyL( CHsContentPublisher& aPlugin, + const TDesC8& aElementId, const TDesC8& aPropertyName, + const TDesC8& aPropertyValue, MAiContentObserver::TValueType aValueType ); + + CXnDomPropertyValue::TPrimitiveValueType DomPropertyValueType( + MAiContentObserver::TValueType aValueType ); + +private: + // From XnNewstickerInterface::MXnNewstickerCallbackInterface void TitleScrolled(TInt aTitleIndex); void TitleToScroll(TInt aTitleIndex); - void CleanPluginFromUiL( MAiPropertyExtension& aPlugin ); - - void ProcessContentChangesL( MTransaction& aTr ); - void ProcessContentChangeL( TAiPolicyElement& aElement ); - -private: // Data - - /** - * Transaction stack. Own. - */ - CActiveTransactionStack* iStack; - - /** - * Factory for transacations. Own. - */ - CTransactionFactoryImpl* iFactory; - - /** - * Immediate mode flag. Own. - */ - TBool iImmediateMode; - - /** - * App UI - */ - CAppUi& iAppUi; - - /** - * Node lookup id generator. Own. - */ - CXmlNodeIdGenerator* iNodeIdGenerator; - - /** - * Content priority map. Own. - */ - AiUtility::CContentPriorityMap* iContentPriorityMap; +private: + // data - /** - * Map of refreshable ui elements. - */ - RPtrHashMap< TDesC, TInt > iRefreshableUiElements; - - /** - * Timer for asynchronous content refreshing - */ - CPeriodic* iTimer; - - /** - * Fw event handler needed for content refresh event notifications. - * Not own. - */ + /** Transaction stack, Owned. */ + CActiveTransactionStack* iStack; + /** Factory for transacations, Owned. */ + CTransactionFactoryImpl* iFactory; + /** Immediate mode flag, Owned. */ + TBool iImmediateMode; + /** AppUI, Not owned. */ + CAppUi& iAppUi; + /** Node lookup id generator, Owned. */ + CXmlNodeIdGenerator* iNodeIdGenerator; + /** Content priority map, Owned. */ + AiUtility::CContentPriorityMap* iContentPriorityMap; + /** Map of refreshable ui elements. */ + RPtrHashMap< TDesC, TInt > iRefreshableUiElements; + /** Timer for asynchronous content refreshing, Owned. */ + CPeriodic* iTimer; + /** Fw event handler, Not owned. */ MAiFwEventHandler* iFwEventHandler; - - /** - * Newsticker callback handler - */ - CNewstickerCallbackHandler* iCallbackHandler; - - /** - * Pointer descriptor to newsticker plugin name - */ - TPtrC iNTPublisher; - - /** - * Newsticker element property class. - */ - HBufC* iNTClass; - - /** - * CSS property map. Own - */ - CCssPropertyMap* iPropertyMap; - - /** - * Publishing policy evaluator. Own. - */ + /** Newsticker callback handler, Owned */ + CNewstickerCallbackHandler* iCallbackHandler; + /** Pointer descriptor to newsticker plugin name */ + TPtrC iNTPublisher; + /** Newsticker element property class, Owned */ + HBufC* iNTClass; + /** CSS property map, Owned. */ + CCssPropertyMap* iPropertyMap; + /** Publishing policy evaluator, Owned. */ CPolicyEvaluator* iPolicyEvaluator; - }; } // namespace AiXmlUiController