CAknSearchField Class Reference

Link against: avkon.lib

Capability Information

Required Capabilities

None


#include <
aknsfld.h>

Inherits CAknControl.


Detailed Description

The CAknSearchField class implements a Search field control.

There are different styles for the search field defined by a TSearchFieldStyle.

Since:
Series 60 0.9

Public Types

enum  TSearchFieldStyle {
  ESearch, EInput, EUrl, EPhone,
  EPlain, EPopup, EPinb, EClockApp,
  EFixed, ESearchWithoutLine, EPopupWindow, EAdaptiveSearch,
  EAdaptive, EPopupAdaptiveSearch, EPopupAdaptiveSearchWindow
}
 Search field style. More...

Public Member Functions

IMPORT_C ~CAknSearchField ()
 Destructor.
IMPORT_C TInt TextLength () const
 Returns the length of search text.
IMPORT_C void GetSearchText (TDes &aSearchTxt) const
 Returns the text of search field by writing it into the buffer aSearchTxt.
IMPORT_C void SetSearchTextL (const TDesC &aSearchTxt)
 Sets text into search field.
IMPORT_C void SelectSearchTextL ()
 Selects the whole search text.
IMPORT_C void ResetL ()
 Clears text in the search field.
IMPORT_C void SetInfoTextL (const TDesC &aText)
 Sets additional info text to the search field.
IMPORT_C void ClipboardL (CEikEdwin::TClipboardFunc aClipboardFunc)
 Calls editor's ClipboardL() function.
IMPORT_C CAknSearchField::TSearchFieldStyle SearchFieldStyle () const
 Return search field style.
IMPORT_C void SetSkinEnabledL (const TBool aEnabled)
 Sets whether skins are enabled on this control.
void HandleControlEventL (CCoeControl *aControl, TCoeEvent aEventType)
 From MCoeControlObserver, Acts upon changes in the hosted control's state.
IMPORT_C TKeyResponse OfferKeyEventL (const TKeyEvent &aKeyEvent, TEventCode aType)
 From CCoeControl, Handles key event.
void HandlePointerEventL (const TPointerEvent &aPointerEvent)
 From CCoeControl, Handles pointer event.
IMPORT_C TSize MinimumSize ()
 From CCoeControl, Returns minimum size.
IMPORT_C void MakeVisible (TBool aVisible)
 Sets this control as visible or invisible.
IMPORT_C void SetLinePos (TInt aLinePos)
 Sets position of the line on main pane.
IMPORT_C CEikEdwinEditor () const
 Access to the edwin owned by the search field.
IMPORT_C void SetAdaptiveGridChars (const TDesC &aGridChars) const
 Set adaptive search grid characters.
IMPORT_C void ShowAdaptiveSearchGrid () const
 Show adaptive search grid.
IMPORT_C void SetListColumnFilterFlags (const TBitFlags32 aFlag)
 Set column filter flag for adaptive search grid.
IMPORT_C TBitFlags32 ListColumnFilterFlags () const
 Send column filter flag for adaptive search grid.
IMPORT_C void AddAdaptiveSearchTextObserverL (MAdaptiveSearchTextObserver *aObserver)
 Adds an adaptive search text observer.
IMPORT_C TBool RemoveAdaptiveSearchTextObserver (MAdaptiveSearchTextObserver *aObserver)
 Removes an adaptive search text observer.
IMPORT_C TBool AdaptiveSearchEnabled ()
 Returns information whether adaptive search is enabled or not.
IMPORT_C TBool LanguageChanged () const
 Notify client if input language changed in settings, for adaptive search.
void SetListbox (CEikListBox *aListBox)
 Sets a list box for this control.
void SetParentCtrl (CCoeControl *aParent)
 Sets the parent control for this control.
TBool IsPopup ()
 Indicates that is the control popup or not.
void SetOldItemIndex (TInt aOldItemIndex)
 Sets index, where listbox focus should return when popup findbox is canceled.
TInt OldItemIndex ()
 Returns index, where listbox focus should return when popup findbox is canceled.
void SetLanguageChangedFlag (TBool aLanguageChanged)
 Set the language changed flag, for adaptive search.
void HandleHWKeyboardModeChangeL ()
 Handle HW keyboard active/deactive event.

Static Public Member Functions

static IMPORT_C CAknSearchFieldNewL (const CCoeControl &aParent, TSearchFieldStyle aFieldStyle, CGulIcon *aIcon, TInt aTextLimit)
 Two-phased constructor.

Member Enumeration Documentation

enum CAknSearchField::TSearchFieldStyle
 

Search field style.

Enumerator:
ESearch  Use only ESearch in Series 60.
EInput  (Not used)
EUrl  (Not used)
EPhone  (Not used)
EPlain  (Not used)
EPopup  Use as popup search field.
EPinb  Use as pinb search field.
EClockApp  For Clock application/list_single_heading_pane.
EFixed  Same as ESearch, but using CreateWindowL().
ESearchWithoutLine  Layout where no line is used.
EPopupWindow  Popup window layout.
EAdaptiveSearch 
Since:
5.0
EAdaptive 
Since:
5.0
EPopupAdaptiveSearch 
Since:
5.0
EPopupAdaptiveSearchWindow 
Since:
5.0

Constructor & Destructor Documentation

IMPORT_C CAknSearchField::~CAknSearchField  ) 
 

Destructor.


Member Function Documentation

IMPORT_C TBool CAknSearchField::AdaptiveSearchEnabled  ) 
 

Returns information whether adaptive search is enabled or not.

Since:
5.0
Returns:
ETrue if adaptive search is enabled, EFalse otherwise.
IMPORT_C void CAknSearchField::AddAdaptiveSearchTextObserverL MAdaptiveSearchTextObserver aObserver  ) 
 

Adds an adaptive search text observer.

Duplicates are not checked (i.e. adding the same observer multiple times is not prevented).

Since:
5.0
Parameters:
aObserver Must be non-NULL.
IMPORT_C void CAknSearchField::ClipboardL CEikEdwin::TClipboardFunc  aClipboardFunc  ) 
 

Calls editor's ClipboardL() function.

Parameters:
aClipboardFunc Clipboard function.
IMPORT_C CEikEdwin& CAknSearchField::Editor  )  const
 

Access to the edwin owned by the search field.

Since:
Series 60 2.6
Returns:
Reference to the edwin owned by the search field.
IMPORT_C void CAknSearchField::GetSearchText TDes &  aSearchTxt  )  const
 

Returns the text of search field by writing it into the buffer aSearchTxt.

Parameters:
aSearchTxt Reference to the text buffer. Buffer size must be same or greater than maximum text length, which is given in constructor.
void CAknSearchField::HandleControlEventL CCoeControl *  aControl,
TCoeEvent  aEventType
 

From MCoeControlObserver, Acts upon changes in the hosted control's state.

This class's implementation is trivial and should be able to be safely re-implemented in directly client-derived classes. For non-base setting page classes, a call to the base class should be made.

Parameters:
aControl Control that caused the event. (not used in default implementation)
aEventType Type of the event.
void CAknSearchField::HandleHWKeyboardModeChangeL  ) 
 

Handle HW keyboard active/deactive event.

Since:
5.0
void CAknSearchField::HandlePointerEventL const TPointerEvent &  aPointerEvent  ) 
 

From CCoeControl, Handles pointer event.

Since:
5.0
Parameters:
aPointerEvent The pointer event. Invert adaptive search grid by tapping search field.
TBool CAknSearchField::IsPopup  ) 
 

Indicates that is the control popup or not.

Since:
Series 60 2.6
Returns:
ETrue if it is a popup, EFalse if not.
IMPORT_C TBool CAknSearchField::LanguageChanged  )  const
 

Notify client if input language changed in settings, for adaptive search.

Since:
5.0
Returns:
ETrue if language has changed, EFalse otherwise.
IMPORT_C TBitFlags32 CAknSearchField::ListColumnFilterFlags  )  const
 

Send column filter flag for adaptive search grid.

Since:
5.0
Returns:
aFlag The bit flag shows which columns take into account during filtering.
IMPORT_C void CAknSearchField::MakeVisible TBool  aVisible  ) 
 

Sets this control as visible or invisible.

Since:
S60 3.2
Parameters:
aVisible ETrue to make the control visible, EFalse to make it invisible.
IMPORT_C TSize CAknSearchField::MinimumSize  ) 
 

From CCoeControl, Returns minimum size.

Minimum size depends on zoom factor.

Returns:
Minimum size.
static IMPORT_C CAknSearchField* CAknSearchField::NewL const CCoeControl &  aParent,
TSearchFieldStyle  aFieldStyle,
CGulIcon *  aIcon,
TInt  aTextLimit
[static]
 

Two-phased constructor.

Parameters:
aParent Reference to parent control.
aFieldStyle Defines the UI style.
aIcon A pointer to the icon to be shown in the search box frame. Takes ownerships. Can be NULL.
aTextLimit Defines the maximum text length.
Returns:
A pointer to contructed CAknSearchField object.
IMPORT_C TKeyResponse CAknSearchField::OfferKeyEventL const TKeyEvent &  aKeyEvent,
TEventCode  aType
 

From CCoeControl, Handles key event.

Parameters:
aKeyEvent The key event.
aType The type of the event.
Returns:
Indicates whether the key event was used by this control or not.
TInt CAknSearchField::OldItemIndex  ) 
 

Returns index, where listbox focus should return when popup findbox is canceled.

Since:
Series 60 3.1
IMPORT_C TBool CAknSearchField::RemoveAdaptiveSearchTextObserver MAdaptiveSearchTextObserver aObserver  ) 
 

Removes an adaptive search text observer.

Since:
5.0
Parameters:
aObserver The observer to be removed.
Returns:
ETrue if removal ok, EFalse if observer was not removed (not found from the list of observers).
IMPORT_C void CAknSearchField::ResetL  ) 
 

Clears text in the search field.

IMPORT_C CAknSearchField::TSearchFieldStyle CAknSearchField::SearchFieldStyle  )  const
 

Return search field style.

Since:
5.0
Returns:
style of search field
IMPORT_C void CAknSearchField::SelectSearchTextL  ) 
 

Selects the whole search text.

IMPORT_C void CAknSearchField::SetAdaptiveGridChars const TDesC &  aGridChars  )  const
 

Set adaptive search grid characters.

Since:
5.0
Parameters:
aGridChars The characters for adaptive search grid.
IMPORT_C void CAknSearchField::SetInfoTextL const TDesC &  aText  ) 
 

Sets additional info text to the search field.

Parameters:
aText Reference to the text buffer.
void CAknSearchField::SetLanguageChangedFlag TBool  aLanguageChanged  ) 
 

Set the language changed flag, for adaptive search.

Since:
5.0
Parameters:
aLanguageChanged ETrue if language has changed, EFalse otherwise.
IMPORT_C void CAknSearchField::SetLinePos TInt  aLinePos  ) 
 

Sets position of the line on main pane.

Since:
Series 60 2.0
Parameters:
aLinePos The position as defined in TAknSeparatorLinePos
void CAknSearchField::SetListbox CEikListBox aListBox  ) 
 

Sets a list box for this control.

Since:
Series 60 2.6
Parameters:
aListBox A pointer to a list box object.
IMPORT_C void CAknSearchField::SetListColumnFilterFlags const TBitFlags32  aFlag  ) 
 

Set column filter flag for adaptive search grid.

Since:
5.0
Parameters:
aFlag The bit flag shows which columns take into account during filtering.
void CAknSearchField::SetOldItemIndex TInt  aOldItemIndex  ) 
 

Sets index, where listbox focus should return when popup findbox is canceled.

Since:
Series 60 3.1
void CAknSearchField::SetParentCtrl CCoeControl *  aParent  ) 
 

Sets the parent control for this control.

Since:
Series 60 2.6
Parameters:
aParent A pointer to the parent control.
IMPORT_C void CAknSearchField::SetSearchTextL const TDesC &  aSearchTxt  ) 
 

Sets text into search field.

Parameters:
aSearchTxt Reference to the text buffer.
IMPORT_C void CAknSearchField::SetSkinEnabledL const TBool  aEnabled  ) 
 

Sets whether skins are enabled on this control.

The default value is determined from global setting from CAknAppUi.

Since:
Series 60 2.0
Parameters:
aEnabled ETrue if skins are enabled, EFalse if not.
IMPORT_C void CAknSearchField::ShowAdaptiveSearchGrid  )  const
 

Show adaptive search grid.

Application can activate adaptive search grid from the option menu.

Since:
5.0
IMPORT_C TInt CAknSearchField::TextLength  )  const
 

Returns the length of search text.

Returns:
The length of search text.

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2007
Back to top