williamr@2: // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@4: // under the terms of "Eclipse Public License v1.0" williamr@2: // which accompanies this distribution, and is available williamr@4: // at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // Defines mix-in interace to break dependencey of Eikon Application UI williamr@2: // on controls williamr@2: // williamr@2: // williamr@2: williamr@2: #ifndef __EIKAUFTY_H__ williamr@2: #define __EIKAUFTY_H__ williamr@2: williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: williamr@2: #include williamr@2: williamr@2: class CEikHotKeyTable; williamr@2: class CEikMenuBar; williamr@2: class CEikMenuPane; williamr@2: class CEikCommandButton; williamr@2: class CEikToolBar; williamr@2: class CEikButtonGroupContainer; williamr@2: class CEikAppUi; williamr@2: class CEikonEnv; williamr@2: class CEikStatusPane; williamr@2: williamr@2: williamr@2: /** This class defines a mixin interface to break the dependency of the Uikon Application williamr@2: User Interface on controls. williamr@2: williamr@2: @publishedAll williamr@2: @released */ williamr@2: class MEikAppUiFactory : public MObjectProvider williamr@2: { williamr@2: public: williamr@2: virtual void CreateResourceIndependentFurnitureL(CEikAppUi* aAppUi) =0; williamr@2: virtual TRect ClientRect() = 0; williamr@2: virtual void ReadAppInfoResourceL(TInt aResourceFileOffset,CEikAppUi* aAppUi) = 0; williamr@2: virtual void LaunchPopupMenuL( TInt aResourceId, williamr@2: const TPoint& aTargetPos, williamr@2: TPopupTargetPosType aTargetType, williamr@2: const CEikHotKeyTable* aHotKeyTable, williamr@2: CEikAppUi* aAppUi) = 0; williamr@2: williamr@2: virtual void DoLaunchPopupL(TInt aResourceId,const TPoint& aTargetPos, const CEikHotKeyTable* aHotKeyTable, williamr@2: TPopupTargetPosType aTargetType,CEikAppUi* aAppUi) = 0; williamr@2: williamr@2: virtual void ClosePopup(CEikAppUi* aAppUi) = 0; williamr@2: virtual void StopDisplayingMenuBar() = 0; williamr@2: virtual void HandleSideBarMenuL(TInt aResourceId,const TPoint& aPos, williamr@2: const CEikHotKeyTable* aHotKeyTable,CEikAppUi* aAppUi) = 0; williamr@2: virtual void CreateHotKeyControlL(TInt aResourceId, CEikAppUi* aAppUi) = 0; williamr@2: /** Gets a pointer to the menu bar. williamr@2: williamr@2: @return Pointer to the menu bar. */ williamr@2: virtual CEikMenuBar* MenuBar() const = 0; williamr@2: /** Replaces or clears a menu bar, returning a pointer to the replaced menu bar. williamr@2: williamr@2: @param aMenu The new menu bar. This can be NULL to clear an existing menu bar. williamr@2: @return Pointer to the replaced menu bar. */ williamr@2: virtual CEikMenuBar* SwapMenuBar(CEikMenuBar* aMenu) = 0; williamr@2: virtual CEikMenuPane* Popup() const = 0; williamr@2: /** Gets a pointer to the tool bar. williamr@2: williamr@2: @return Pointer to the tool bar. */ williamr@2: virtual CEikButtonGroupContainer* ToolBar() const = 0; williamr@2: /** Replaces or clears a button group, returning a pointer to the replaced button williamr@2: group. williamr@2: williamr@2: @param aNewGroup The new button group. This can be NULL to clear an existing williamr@2: button group. williamr@2: @return Pointer to the replaced button group. */ williamr@2: virtual CEikButtonGroupContainer* SwapButtonGroup(CEikButtonGroupContainer* aNewGroup) = 0; williamr@2: /** Gets a pointer to the tool band. williamr@2: williamr@2: @return Pointer to the tool band. */ williamr@2: virtual CEikToolBar* ToolBand() const = 0; williamr@2: /** Gets a pointer to the title band. williamr@2: williamr@2: @return Pointer to the title band. */ williamr@2: virtual CEikToolBar* TitleBand() const = 0; williamr@2: /** Gets a pointer to the status pane. williamr@2: williamr@2: @return Pointer to the status pane */ williamr@2: virtual CEikStatusPane* StatusPane() const = 0; williamr@2: /** Gets a pointer to the CBA. williamr@2: williamr@2: @return Pointer to the CBA */ williamr@2: virtual CEikButtonGroupContainer* Cba() const = 0; williamr@2: inline CEikToolBar* SwapToolBand(CEikToolBar* aToolBand); williamr@2: inline CEikToolBar* SwapTitleBand(CEikToolBar* aTitleBand); williamr@2: /** Creates a standard tab button. williamr@2: williamr@2: @return Pointer to the created tab button. */ williamr@2: virtual CEikCommandButton* CreateStandardTabButtonL() const = 0; williamr@2: virtual void CreateEmbeddedL(CEikonEnv& aEikonEnv) = 0; williamr@2: virtual void DestroyEmbedded(CEikonEnv& aEikonEnv) = 0; williamr@2: virtual void HandleResourceChangeL(TInt aType) = 0; williamr@2: protected: williamr@2: /** Defines the type of tool bar. */ williamr@2: enum TToolBarType williamr@2: { williamr@2: /** Defines a band tool bar. */ williamr@2: EBand, williamr@2: /** Defines a title tool bar. */ williamr@2: ETitle williamr@2: }; williamr@2: private: williamr@2: virtual CEikToolBar* SwapToolBar(CEikToolBar* aToolBar,TToolBarType aType) = 0; williamr@2: }; williamr@2: williamr@2: williamr@2: williamr@2: /** Replaces or clears a tool band, returning a pointer to the replaced tool band. williamr@2: williamr@2: @param aToolBand The new tool band. This can be NULL to clear an existing williamr@2: tool band. williamr@2: @return Pointer to the replaced tool band. */ williamr@2: inline CEikToolBar* MEikAppUiFactory::SwapToolBand(CEikToolBar* aToolBand) williamr@2: {return SwapToolBar(aToolBand,EBand);} williamr@2: williamr@2: williamr@2: /** Replaces or clears a title band, returning a pointer to the replaced title williamr@2: band. williamr@2: williamr@2: @param aTitleBand The new title band. This can be NULL to clear an existing williamr@2: title band. williamr@2: @return Pointer to the replaced title band. */ williamr@2: inline CEikToolBar* MEikAppUiFactory::SwapTitleBand(CEikToolBar* aTitleBand) williamr@2: {return SwapToolBar(aTitleBand,ETitle);} williamr@2: williamr@2: #endif // __EIKAUFTY_H__