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:
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 
00032 // FORWARD DECLARATIONS
00033 class CEikEdwin;
00034 class CGlobalText;
00035 class CAknInputFrame;
00036 class CAknSearchFieldIndicator;
00037 class CAknsListBoxBackgroundControlContext;
00038 class CAknsFrameBackgroundControlContext;
00039 class CEikListBox;
00040 
00041  
00042 // CLASS DECLARATION
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:                 // for search string manipulation
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: // new methods for Avkon Skins support
00147 
00154     IMPORT_C void SetSkinEnabledL( const TBool aEnabled );
00155 
00156 public: // from MCoeControlObserver
00157 
00166     void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
00167 
00168 public: // From CCoeControl
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: // from MObjectProvider
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: // from MEikCommandObserver
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;  // was TBool iUseSkinContext;
00275     TInt iLinePos;
00276     CAknsFrameBackgroundControlContext* iInputContext;
00277     TBool iIsPopup;
00278     TBool iCBAObserverUpdated;
00279     CEikListBox *iListBox; // not owned
00280     CCoeControl *iParent; // not owned
00281     CEikButtonGroupContainer *iCba; // this is only for checking whether cba changed while we're storing modifications in it.
00282     TInt iOldItemIndex;
00283     CAknAppUi* iBackedAppUi;
00284     };
00285 
00286 #endif
00287 
00288 

Copyright © Nokia Corporation 2001-2008
Back to top