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 #include <e32property.h>
00032
00033
00034 class CEikEdwin;
00035 class CGlobalText;
00036 class CAknInputFrame;
00037 class CAknSearchFieldIndicator;
00038 class CAknsListBoxBackgroundControlContext;
00039 class CAknsFrameBackgroundControlContext;
00040 class CEikListBox;
00041 class CAknAdaptiveSearch;
00042 class MAdaptiveSearchTextObserver;
00043 class CAknSearchField;
00044 class CHwKbSubscriber;
00045
00055 class MAdaptiveSearchTextObserver
00056 {
00057 public:
00063 virtual void AdaptiveSearchTextChanged( CAknSearchField* aSearchField ) = 0;
00064 };
00065
00066
00067
00068
00075 NONSHARABLE_CLASS(CAknSearchField) : public CAknControl,
00076 public MCoeControlObserver,
00077 public MEikCommandObserver
00078 {
00079 public:
00083 enum TSearchFieldStyle
00084 {
00086 ESearch,
00088 EInput,
00090 EUrl,
00092 EPhone,
00094 EPlain,
00096 EPopup,
00098 EPinb,
00100 EClockApp,
00102 EFixed,
00104 ESearchWithoutLine,
00106 EPopupWindow,
00109 EAdaptiveSearch,
00113 EAdaptive,
00117 EPopupAdaptiveSearch,
00121 EPopupAdaptiveSearchWindow
00122 };
00123
00124 public:
00125
00129 IMPORT_C ~CAknSearchField();
00130
00140 IMPORT_C static CAknSearchField* NewL( const CCoeControl& aParent, TSearchFieldStyle aFieldStyle, CGulIcon* aIcon, TInt aTextLimit );
00141
00142 public:
00147 IMPORT_C TInt TextLength() const;
00148
00156 IMPORT_C void GetSearchText( TDes& aSearchTxt ) const;
00157
00162 IMPORT_C void SetSearchTextL( const TDesC& aSearchTxt );
00163
00167 IMPORT_C void SelectSearchTextL();
00168
00172 IMPORT_C void ResetL();
00173
00178 IMPORT_C void SetInfoTextL( const TDesC& aText );
00179
00184 IMPORT_C void ClipboardL( CEikEdwin::TClipboardFunc aClipboardFunc );
00185
00191 IMPORT_C CAknSearchField::TSearchFieldStyle SearchFieldStyle() const;
00192
00193 public:
00194
00201 IMPORT_C void SetSkinEnabledL( const TBool aEnabled );
00202
00203 public:
00204
00213 void HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType );
00214
00215 public:
00216
00223 IMPORT_C TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,TEventCode aType );
00224
00231 void HandlePointerEventL( const TPointerEvent& aPointerEvent );
00232
00238 IMPORT_C TSize MinimumSize();
00239
00247 IMPORT_C void MakeVisible( TBool aVisible );
00248
00249 public:
00250
00256 IMPORT_C void SetLinePos( TInt aLinePos );
00257
00263 IMPORT_C CEikEdwin& Editor() const;
00264
00270 IMPORT_C void SetAdaptiveGridChars( const TDesC& aGridChars ) const;
00271
00277 IMPORT_C void ShowAdaptiveSearchGrid() const;
00278
00285 IMPORT_C void SetListColumnFilterFlags( const TBitFlags32 aFlag );
00286
00293 IMPORT_C TBitFlags32 ListColumnFilterFlags() const;
00294
00301 IMPORT_C void AddAdaptiveSearchTextObserverL( MAdaptiveSearchTextObserver* aObserver );
00302
00310 IMPORT_C TBool RemoveAdaptiveSearchTextObserver( MAdaptiveSearchTextObserver* aObserver );
00311
00317 IMPORT_C TBool AdaptiveSearchEnabled();
00318
00324 IMPORT_C TBool LanguageChanged() const;
00325
00326 private:
00327 TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
00328 private:
00329 TInt CountComponentControls() const;
00330 CCoeControl* ComponentControl( TInt aIndex ) const;
00331 void SizeChanged();
00332 void FocusChanged( TDrawNow aDrawNow );
00333 private:
00334 void ConstructL( const CCoeControl& aParent, TSearchFieldStyle aFieldStyle, CGulIcon* aIcon, TInt aTextLimit );
00335 CAknSearchField();
00336 private:
00337 void ZoomEditorL();
00338 private:
00339 IMPORT_C void ProcessCommandL( TInt aCommandId );
00340 private:
00341 void UpdatePopupCBAL();
00342 void RestorePopupCBA();
00343 void SetupSkinContextL();
00344 public:
00345
00351 void SetListbox( CEikListBox* aListBox );
00352
00358 void SetParentCtrl( CCoeControl* aParent );
00359
00365 TBool IsPopup();
00366
00373 void SetOldItemIndex( TInt aOldItemIndex );
00374
00381 TInt OldItemIndex();
00382
00388 void SetLanguageChangedFlag( TBool aLanguageChanged );
00389
00394 void HandleHWKeyboardModeChangeL();
00395
00396 private:
00397
00398 TBitFlags32 iColumnFlag;
00399 CEikEdwin* iEditor;
00400 CGlobalText* iGlobalText;
00401 CAknInputFrame* iInputFrame;
00402 CAknSearchFieldIndicator* iIndicator;
00403 CAknsListBoxBackgroundControlContext* iSkinContext;
00404 TInt iFlags;
00405 TInt iLinePos;
00406 CAknsFrameBackgroundControlContext* iInputContext;
00407 TBool iIsPopup;
00408 TBool iCBAObserverUpdated;
00409 CEikListBox *iListBox;
00410 CCoeControl *iParent;
00411 CEikButtonGroupContainer *iCba;
00412 TInt iOldItemIndex;
00413 CAknAppUi* iBackedAppUi;
00414 CAknAdaptiveSearch* iAdaptiveSearch;
00415 TSearchFieldStyle iStyle;
00416 TBool iLanguageChanged;
00417
00418
00419 RProperty iHwKeyboardPro;
00420 CHwKbSubscriber* iHwKbSub;
00421 };
00422
00423 #endif
00424
00425