|
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Defines mix-in interace to break dependencey of Eikon Application UI |
|
15 // on controls |
|
16 // |
|
17 // |
|
18 |
|
19 #ifndef __EIKAUFTY_H__ |
|
20 #define __EIKAUFTY_H__ |
|
21 |
|
22 #include <f32file.h> |
|
23 #include <e32base.h> |
|
24 #include <eikdef.h> |
|
25 |
|
26 #include <coemop.h> |
|
27 |
|
28 class CEikHotKeyTable; |
|
29 class CEikMenuBar; |
|
30 class CEikMenuPane; |
|
31 class CEikCommandButton; |
|
32 class CEikToolBar; |
|
33 class CEikButtonGroupContainer; |
|
34 class CEikAppUi; |
|
35 class CEikonEnv; |
|
36 class CEikStatusPane; |
|
37 |
|
38 |
|
39 /** This class defines a mixin interface to break the dependency of the Uikon Application |
|
40 User Interface on controls. |
|
41 |
|
42 @publishedAll |
|
43 @released */ |
|
44 class MEikAppUiFactory : public MObjectProvider |
|
45 { |
|
46 public: |
|
47 virtual void CreateResourceIndependentFurnitureL(CEikAppUi* aAppUi) =0; |
|
48 virtual TRect ClientRect() = 0; |
|
49 virtual void ReadAppInfoResourceL(TInt aResourceFileOffset,CEikAppUi* aAppUi) = 0; |
|
50 virtual void LaunchPopupMenuL( TInt aResourceId, |
|
51 const TPoint& aTargetPos, |
|
52 TPopupTargetPosType aTargetType, |
|
53 const CEikHotKeyTable* aHotKeyTable, |
|
54 CEikAppUi* aAppUi) = 0; |
|
55 |
|
56 virtual void DoLaunchPopupL(TInt aResourceId,const TPoint& aTargetPos, const CEikHotKeyTable* aHotKeyTable, |
|
57 TPopupTargetPosType aTargetType,CEikAppUi* aAppUi) = 0; |
|
58 |
|
59 virtual void ClosePopup(CEikAppUi* aAppUi) = 0; |
|
60 virtual void StopDisplayingMenuBar() = 0; |
|
61 virtual void HandleSideBarMenuL(TInt aResourceId,const TPoint& aPos, |
|
62 const CEikHotKeyTable* aHotKeyTable,CEikAppUi* aAppUi) = 0; |
|
63 virtual void CreateHotKeyControlL(TInt aResourceId, CEikAppUi* aAppUi) = 0; |
|
64 /** Gets a pointer to the menu bar. |
|
65 |
|
66 @return Pointer to the menu bar. */ |
|
67 virtual CEikMenuBar* MenuBar() const = 0; |
|
68 /** Replaces or clears a menu bar, returning a pointer to the replaced menu bar. |
|
69 |
|
70 @param aMenu The new menu bar. This can be NULL to clear an existing menu bar. |
|
71 @return Pointer to the replaced menu bar. */ |
|
72 virtual CEikMenuBar* SwapMenuBar(CEikMenuBar* aMenu) = 0; |
|
73 virtual CEikMenuPane* Popup() const = 0; |
|
74 /** Gets a pointer to the tool bar. |
|
75 |
|
76 @return Pointer to the tool bar. */ |
|
77 virtual CEikButtonGroupContainer* ToolBar() const = 0; |
|
78 /** Replaces or clears a button group, returning a pointer to the replaced button |
|
79 group. |
|
80 |
|
81 @param aNewGroup The new button group. This can be NULL to clear an existing |
|
82 button group. |
|
83 @return Pointer to the replaced button group. */ |
|
84 virtual CEikButtonGroupContainer* SwapButtonGroup(CEikButtonGroupContainer* aNewGroup) = 0; |
|
85 /** Gets a pointer to the tool band. |
|
86 |
|
87 @return Pointer to the tool band. */ |
|
88 virtual CEikToolBar* ToolBand() const = 0; |
|
89 /** Gets a pointer to the title band. |
|
90 |
|
91 @return Pointer to the title band. */ |
|
92 virtual CEikToolBar* TitleBand() const = 0; |
|
93 /** Gets a pointer to the status pane. |
|
94 |
|
95 @return Pointer to the status pane */ |
|
96 virtual CEikStatusPane* StatusPane() const = 0; |
|
97 /** Gets a pointer to the CBA. |
|
98 |
|
99 @return Pointer to the CBA */ |
|
100 virtual CEikButtonGroupContainer* Cba() const = 0; |
|
101 inline CEikToolBar* SwapToolBand(CEikToolBar* aToolBand); |
|
102 inline CEikToolBar* SwapTitleBand(CEikToolBar* aTitleBand); |
|
103 /** Creates a standard tab button. |
|
104 |
|
105 @return Pointer to the created tab button. */ |
|
106 virtual CEikCommandButton* CreateStandardTabButtonL() const = 0; |
|
107 virtual void CreateEmbeddedL(CEikonEnv& aEikonEnv) = 0; |
|
108 virtual void DestroyEmbedded(CEikonEnv& aEikonEnv) = 0; |
|
109 virtual void HandleResourceChangeL(TInt aType) = 0; |
|
110 protected: |
|
111 /** Defines the type of tool bar. */ |
|
112 enum TToolBarType |
|
113 { |
|
114 /** Defines a band tool bar. */ |
|
115 EBand, |
|
116 /** Defines a title tool bar. */ |
|
117 ETitle |
|
118 }; |
|
119 private: |
|
120 virtual CEikToolBar* SwapToolBar(CEikToolBar* aToolBar,TToolBarType aType) = 0; |
|
121 }; |
|
122 |
|
123 |
|
124 |
|
125 /** Replaces or clears a tool band, returning a pointer to the replaced tool band. |
|
126 |
|
127 @param aToolBand The new tool band. This can be NULL to clear an existing |
|
128 tool band. |
|
129 @return Pointer to the replaced tool band. */ |
|
130 inline CEikToolBar* MEikAppUiFactory::SwapToolBand(CEikToolBar* aToolBand) |
|
131 {return SwapToolBar(aToolBand,EBand);} |
|
132 |
|
133 |
|
134 /** Replaces or clears a title band, returning a pointer to the replaced title |
|
135 band. |
|
136 |
|
137 @param aTitleBand The new title band. This can be NULL to clear an existing |
|
138 title band. |
|
139 @return Pointer to the replaced title band. */ |
|
140 inline CEikToolBar* MEikAppUiFactory::SwapTitleBand(CEikToolBar* aTitleBand) |
|
141 {return SwapToolBar(aTitleBand,ETitle);} |
|
142 |
|
143 #endif // __EIKAUFTY_H__ |