00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __AKNSFLD_H__
00024 #define __AKNSFLD_H__
00025
00026
00027 #include <AknControl.h>
00028 #include <gulicon.h>
00029 #include <eikgted.h>
00030 #include <aknappui.h>
00031
00032
00033 class CEikEdwin;
00034 class CGlobalText;
00035 class CAknInputFrame;
00036 class CAknSearchFieldIndicator;
00037 class CAknsListBoxBackgroundControlContext;
00038 class CAknsFrameBackgroundControlContext;
00039 class CEikListBox;
00040
00041
00042
00043
00050 NONSHARABLE_CLASS(CAknSearchField) : public CAknControl,
00051 public MCoeControlObserver,
00052 public MEikCommandObserver
00053 {
00054 public:
00055
00059 enum TSearchFieldStyle
00060 {
00062 ESearch,
00064 EInput,
00066 EUrl,
00068 EPhone,
00070 EPlain,
00072 EPopup,
00074 EPinb,
00076 EClockApp,
00078 EFixed,
00080 ESearchWithoutLine,
00082 EPopupWindow
00083 };
00084 public:
00085
00089 IMPORT_C ~CAknSearchField();
00090
00100 IMPORT_C static CAknSearchField* NewL(const CCoeControl& aParent, TSearchFieldStyle aFieldStyle, CGulIcon* aIcon, TInt aTextLimit);
00101
00102 public:
00107 IMPORT_C TInt TextLength() const;
00108
00116 IMPORT_C void GetSearchText(TDes& aSearchTxt) const;
00117
00122 IMPORT_C void SetSearchTextL(const TDesC& aSearchTxt);
00123
00127 IMPORT_C void SelectSearchTextL();
00128
00132 IMPORT_C void ResetL();
00133
00138 IMPORT_C void SetInfoTextL(const TDesC& aText);
00139
00144 IMPORT_C void ClipboardL(CEikEdwin::TClipboardFunc aClipboardFunc);
00145
00146 public:
00147
00154 IMPORT_C void SetSkinEnabledL( const TBool aEnabled );
00155
00156 public:
00157
00166 void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
00167
00168 public:
00169
00176 IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
00177
00183 IMPORT_C TSize MinimumSize();
00184
00192 IMPORT_C void MakeVisible( TBool aVisible );
00193
00194 public:
00195
00201 IMPORT_C void SetLinePos(TInt aLinePos);
00202
00208 IMPORT_C CEikEdwin& Editor() const;
00209
00210 private:
00211 TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
00212 private:
00213 TInt CountComponentControls() const;
00214 CCoeControl* ComponentControl(TInt aIndex) const;
00215 void SizeChanged();
00216 void FocusChanged(TDrawNow aDrawNow);
00217 private:
00218 void ConstructL(const CCoeControl& aParent, TSearchFieldStyle aFieldStyle, CGulIcon* aIcon, TInt aTextLimit);
00219 CAknSearchField();
00220 private:
00221 void ZoomEditorL();
00222 private:
00223 IMPORT_C void ProcessCommandL(TInt aCommandId);
00224
00225 private:
00226 void UpdatePopupCBAL();
00227 void RestorePopupCBA();
00228 void SetupSkinContextL();
00229 public:
00230
00236 void SetListbox(CEikListBox* aListBox);
00237
00243 void SetParentCtrl(CCoeControl* aParent);
00244
00250 TBool IsPopup();
00251
00258 void SetOldItemIndex( TInt aOldItemIndex );
00259
00266 TInt OldItemIndex();
00267
00268 private:
00269 CEikEdwin* iEditor;
00270 CGlobalText* iGlobalText;
00271 CAknInputFrame* iInputFrame;
00272 CAknSearchFieldIndicator* iIndicator;
00273 CAknsListBoxBackgroundControlContext* iSkinContext;
00274 TInt iFlags;
00275 TInt iLinePos;
00276 CAknsFrameBackgroundControlContext* iInputContext;
00277 TBool iIsPopup;
00278 TBool iCBAObserverUpdated;
00279 CEikListBox *iListBox;
00280 CCoeControl *iParent;
00281 CEikButtonGroupContainer *iCba;
00282 TInt iOldItemIndex;
00283 CAknAppUi* iBackedAppUi;
00284 };
00285
00286 #endif
00287
00288