aknsfld.h

Go to the documentation of this file.
00001 /*
00002 * ============================================================================
00003 *  Name     : AknSfld.h
00004 *  Part of  : Avkon
00005 *
00006 *  Description:
00007 *  Search Field support. 
00008 *
00009 *  Version: %version:  e003sa02#42 %
00010 *
00011 *  Copyright © 2002 Nokia Corporation.
00012 *  This material, including documentation and any related 
00013 *  computer programs, is protected by copyright controlled by 
00014 *  Nokia Corporation. All rights are reserved. Copying, 
00015 *  including reproducing, storing,  adapting or translating, any 
00016 *  or all of this material requires the prior written consent of 
00017 *  Nokia Corporation. This material also contains confidential 
00018 *  information which may not be disclosed to others without the 
00019 *  prior written consent of Nokia Corporation.
00020 * ============================================================================
00021 */
00022 
00023 #ifndef __AKNSFLD_H__
00024 #define __AKNSFLD_H__
00025 
00026 // INCLUDES
00027 #include <AknControl.h>
00028 #include <gulicon.h>
00029 #include <eikgted.h>
00030 #include <aknappui.h>
00031 #include <e32property.h>  // for subscriber/publisher
00032 
00033 // FORWARD DECLARATIONS
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 // CLASS DECLARATION
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:                 // for search string manipulation
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: // new methods for Avkon Skins support
00194 
00201     IMPORT_C void SetSkinEnabledL( const TBool aEnabled );
00202 
00203 public: // from MCoeControlObserver
00204 
00213     void HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType );
00214 
00215 public: // From CCoeControl
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: // from MObjectProvider
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: // from MEikCommandObserver
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     // The bit flag shows which collumns take into account during filltering  
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; // not owned
00410     CCoeControl *iParent; // not owned
00411     CEikButtonGroupContainer *iCba; // this is only for checking whether cba changed 
00412     TInt iOldItemIndex;
00413     CAknAppUi* iBackedAppUi;
00414     CAknAdaptiveSearch* iAdaptiveSearch; 
00415     TSearchFieldStyle iStyle;    
00416     TBool iLanguageChanged; // flag shows was input language changed or not
00417 
00418     // For hybird keyborad
00419     RProperty iHwKeyboardPro;
00420     CHwKbSubscriber* iHwKbSub;
00421     };
00422 
00423 #endif
00424 
00425 

Copyright © Nokia Corporation 2001-2007
Back to top