|
1 /* |
|
2 * Copyright (c) 1999 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 #ifndef __EIKDPSEL_H__ |
|
20 #define __EIKDPSEL_H__ |
|
21 |
|
22 #include <gulbordr.h> |
|
23 #include <coeccntx.h> |
|
24 #include <coecobs.h> |
|
25 #include <coecntrl.h> |
|
26 #include <AknTabObserver.h> |
|
27 |
|
28 |
|
29 // |
|
30 // Forward declarations. |
|
31 // |
|
32 |
|
33 class CEikDialogPageContainer; |
|
34 class CEikCaptionedControl; |
|
35 class MEikDialogPageObserver; |
|
36 |
|
37 |
|
38 class CAknTabGroup ; |
|
39 class MAknNavigationContainerInterface ; |
|
40 class CAknNavigationControlContainer; |
|
41 class MAknNavigationDecoratorInterface ; |
|
42 class CAknNavigationDecorator; |
|
43 class CEikTabPreStore ; |
|
44 |
|
45 // This Class manages tool tips for the dialog. |
|
46 // Tips are displayed in the NaviPane if there is nothing else there. |
|
47 // Tips are only displayed for single page dialogs containing forms. |
|
48 NONSHARABLE_CLASS(CEikDlgToolTipMgr) : public CBase |
|
49 { |
|
50 public: |
|
51 CEikDlgToolTipMgr(CEikonEnv* aEikonEnv) ; |
|
52 ~CEikDlgToolTipMgr() ; |
|
53 |
|
54 void DisplayTipL( const TDesC* aTipText ) ; |
|
55 void HideTip() ; |
|
56 void EnableTips( TBool aShowTips ) ; |
|
57 |
|
58 private: |
|
59 MAknNavigationContainerInterface* iNaviContainer ; |
|
60 MAknNavigationDecoratorInterface* iToolTip ; |
|
61 |
|
62 TBool iShowTips ; |
|
63 TBool iIsTipShowing ; |
|
64 |
|
65 }; |
|
66 |
|
67 |
|
68 |
|
69 /** |
|
70 * The CEikDialogPageSelector class manages a dialog's pages and tabs. |
|
71 * |
|
72 * @internal |
|
73 * @since ER5U |
|
74 */ |
|
75 NONSHARABLE_CLASS(CEikDialogPageSelector) : public CCoeControl,public MCoeControlContext,public MCoeControlObserver, public MAknTabObserver |
|
76 { |
|
77 public: |
|
78 ~CEikDialogPageSelector(); |
|
79 static CEikDialogPageSelector* NewL(const CCoeControl& aParent,CEikDialog* aDialog); |
|
80 static CEikDialogPageSelector* NewLC(const CCoeControl& aParent,CEikDialog* aDialog); |
|
81 static CEikDialogPageSelector* NewL(const CCoeControl& aParent,TResourceReader& aReader,CEikDialog* aDialog); |
|
82 static CEikDialogPageSelector* NewLC(const CCoeControl& aParent,TResourceReader& aReader,CEikDialog* aDialog); |
|
83 TSize PreferredSize(const TSize& aMaxSize) const; |
|
84 void SetActivePageByIdL(TInt aPageId); |
|
85 void SetActivePageByIndexL(TInt aPageIndex); |
|
86 void ActivateFirstPageL(); |
|
87 void SetInitialFocus(); |
|
88 void AddPageL(TResourceReader& aReader); |
|
89 void AddPageL(TInt aPageId,const TDesC& aTabText); |
|
90 void AddPageL(TInt aPageId,const TDesC& aTabText,TResourceReader& aReader); |
|
91 CEikCaptionedControl* Line(TInt aControlId) const; |
|
92 CEikCaptionedControl* LineOrNull(TInt aControlId) const; |
|
93 CEikCaptionedControl* CurrentLine() const; |
|
94 void SetPageDensePacked(TInt aPageId,TBool aDensePacked); |
|
95 void SetAllPagesDensePacked(TBool aDensePacked); |
|
96 void SetPageDimmed(TInt aPageId,TBool aDimmed,TDrawNow aDrawNow); |
|
97 TInt LineId(const CCoeControl& aControl) const; |
|
98 void DeleteLine(TInt aLineId,TBool aRedraw); |
|
99 void InsertLineL(TInt aPosition,TInt aPageId,TInt aResourceId); |
|
100 void AdjustAllIds(TInt aPageId,TInt aControlIdDelta); |
|
101 CCoeControl* CreateLineByTypeL(const TDesC& aCaption,TInt aControlId,TInt aControlType,TAny* aReturnValue); |
|
102 CCoeControl* CreateLineByTypeL(const TDesC& aCaption,TInt aPageId,TInt aControlId,TInt aControlType,TAny* aReturnValue); |
|
103 void FocusLineL(TInt aLineId); |
|
104 TInt FocusedLineId() const; |
|
105 void GetAutoValues(); |
|
106 TInt ActivePageId() const; |
|
107 TInt ActivePageIndex() const; |
|
108 void ResetLineMinimumSizes(); |
|
109 TInt FindLineIndex(const CCoeControl& aControl) const; |
|
110 TBool RotateFocusByL(TInt aDelta); |
|
111 TKeyResponse OfferHotKeysKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
112 TBool TakesEnterKey(); |
|
113 void SetEditableL( TBool aEditable) ; // This should only be used for form resource |
|
114 TInt NumPages() const ; |
|
115 CEikDialogPageContainer* PageContainer(); |
|
116 |
|
117 |
|
118 public: // from CCoeControl |
|
119 virtual TSize MinimumSize(); |
|
120 virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
121 public: // from MCoeControlContext |
|
122 virtual void PrepareContext(CWindowGc& aGc) const; |
|
123 public: // from MCoeControlObserver |
|
124 virtual void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType); |
|
125 public: |
|
126 void SetDialg(CEikDialog* aDialg); |
|
127 CEikDialog* Dialg() const; |
|
128 public: |
|
129 TBool IsForm() const; |
|
130 protected: |
|
131 void RegisterPageSelectorWithPageContainer(); |
|
132 |
|
133 protected: // from CCoeControl |
|
134 virtual void SizeChanged(); |
|
135 virtual TInt CountComponentControls() const; |
|
136 virtual CCoeControl* ComponentControl(TInt aIndex) const; |
|
137 virtual void WriteInternalStateL(RWriteStream& aWriteStream) const; |
|
138 private: |
|
139 virtual void Draw(const TRect& aRect) const; |
|
140 void DrawBorder(const TRect& aRect) const; |
|
141 void DrawBackground(const TRect& aRect) const; |
|
142 virtual void Reserved_2(); |
|
143 private: |
|
144 CEikDialogPageSelector(); |
|
145 void ConstructL(MEikDialogPageObserver* aPageObserver); |
|
146 void ConstructFromResourceL(TResourceReader& aReader,MEikDialogPageObserver* aPageObserver); |
|
147 void PrepareForFocusTransitionL(); |
|
148 void HandleRequestFocusL(CCoeControl* aControl); |
|
149 void HandleTabStateChangedL(CAknTabGroup* aTabContainer); |
|
150 void PassOnEventL(CCoeControl* aControl,MCoeControlObserver::TCoeEvent aEvent); |
|
151 |
|
152 void AddFormToPageL( TInt aPageId,TResourceReader& aReader ) ; |
|
153 |
|
154 void CreatePreStoredTabL(); |
|
155 void CreateTabContainerL(); |
|
156 void DestroyTabContainer() ; |
|
157 |
|
158 public: |
|
159 // From MAknTabObserver |
|
160 void TabChangedL(TInt aIndex); |
|
161 |
|
162 private: |
|
163 CEikDialogPageContainer* iPageContainer; |
|
164 |
|
165 CAknTabGroup* iTabContainer ; |
|
166 CAknNavigationDecorator* iNaviDecorator ; |
|
167 CAknNavigationControlContainer* iNaviContainer ; |
|
168 TBool iEditable ; |
|
169 TBool iTabsVisible ; |
|
170 TBool iIsForm ; |
|
171 TGulBorder iBorder; |
|
172 CEikDialog* iDialg; |
|
173 CEikTabPreStore* iTabPreStore; |
|
174 TBool iFirstTabContainsText; |
|
175 }; |
|
176 |
|
177 |
|
178 #endif |
|
179 |