• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kdeui
 

kdeui

Public Slots | Public Member Functions | Protected Slots | Protected Member Functions | List of all members
KIconViewSearchLine Class Reference

#include <kiconviewsearchline.h>

Inheritance diagram for KIconViewSearchLine:
KLineEdit KCompletionBase

Public Slots

virtual void updateSearch (const TQString &s=TQString::null)
 
void setCaseSensitive (bool cs)
 
void setIconView (TQIconView *iv)
 
void clear ()
 
void iconDeleted (const TQString &filename)
 
- Public Slots inherited from KLineEdit
virtual void setReadOnly (bool)
 
void rotateText (KCompletionBase::KeyBindingType type)
 
virtual void setCompletedText (const TQString &)
 
void setCompletedItems (const TQStringList &items)
 
void setCompletedItems (const TQStringList &items, bool autoSuggest)
 
virtual void clear ()
 
void setSqueezedText (const TQString &text)
 
virtual void setText (const TQString &)
 

Public Member Functions

 KIconViewSearchLine (TQWidget *parent=0, TQIconView *iconView=0, const char *name=0)
 
 KIconViewSearchLine (TQWidget *parent, const char *name)
 
virtual ~KIconViewSearchLine ()
 
bool caseSensitive () const
 
TQIconView * iconView () const
 
- Public Member Functions inherited from KLineEdit
 KLineEdit (const TQString &string, TQWidget *parent, const char *name=0)
 
 KLineEdit (TQWidget *parent=0, const char *name=0)
 
virtual ~KLineEdit ()
 
void setURL (const KURL &url)
 
void cursorAtEnd ()
 
virtual void setCompletionMode (KGlobalSettings::Completion mode)
 
virtual void setContextMenuEnabled (bool showMenu)
 
bool isContextMenuEnabled () const
 
void setURLDropsEnabled (bool enable)
 
bool isURLDropsEnabled () const
 
void setTrapReturnKey (bool trap)
 
bool trapReturnKey () const
 
virtual bool eventFilter (TQObject *, TQEvent *)
 
KCompletionBox * completionBox (bool create=true)
 
virtual void setCompletionObject (KCompletion *, bool hsig=true)
 
virtual void copy () const
 
void setEnableSqueezedText (bool enable)
 
bool isSqueezedTextEnabled () const
 
TQString originalText () const
 
void setCompletionBox (KCompletionBox *box)
 
void setClickMessage (const TQString &msg)
 
TQString clickMessage () const
 
- Public Member Functions inherited from KCompletionBase
KCompletion * completionObject (bool hsig=true)
 
virtual void setHandleSignals (bool handle)
 
bool isCompletionObjectAutoDeleted () const
 
void setAutoDeleteCompletionObject (bool autoDelete)
 
void setEnableSignals (bool enable)
 
bool handleSignals () const
 
bool emitSignals () const
 
KGlobalSettings::Completion completionMode () const
 
bool setKeyBinding (KeyBindingType item, const KShortcut &key)
 
const KShortcut & getKeyBinding (KeyBindingType item) const
 
void useGlobalKeyBindings ()
 
virtual void setCompletedText (const TQString &text)=0
 
virtual void setCompletedItems (const TQStringList &items)=0
 
KCompletion * compObj () const
 

Protected Slots

void queueSearch (const TQString &s)
 
void activateSearch ()
 
- Protected Slots inherited from KLineEdit
virtual void makeCompletion (const TQString &)
 
void slotAboutToShow ()
 
void slotCancelled ()
 
void userCancelled (const TQString &cancelText)
 

Protected Member Functions

virtual bool itemMatches (const TQIconViewItem *item, const TQString &s) const
 
void init (TQIconView *iconView=0)
 
void hideItem (TQIconViewItem *item)
 
void showItem (TQIconViewItem *item)
 
- Protected Member Functions inherited from KLineEdit
virtual void resizeEvent (TQResizeEvent *)
 
virtual void keyPressEvent (TQKeyEvent *)
 
virtual void mousePressEvent (TQMouseEvent *)
 
virtual void mouseDoubleClickEvent (TQMouseEvent *)
 
virtual void mouseReleaseEvent (TQMouseEvent *)
 
virtual void contextMenuEvent (TQContextMenuEvent *)
 
virtual TQPopupMenu * createPopupMenu ()
 
virtual void drawContents (TQPainter *p)
 
virtual void dropEvent (TQDropEvent *)
 
virtual void setCompletedText (const TQString &, bool)
 
void setUserSelection (bool userSelection)
 
virtual void create (WId=0, bool initializeWindow=true, bool destroyOldWindow=true)
 
virtual void focusInEvent (TQFocusEvent *)
 
virtual void focusOutEvent (TQFocusEvent *)
 
bool autoSuggest () const
 
virtual void virtual_hook (int id, void *data)
 
- Protected Member Functions inherited from KCompletionBase
KeyBindingMap getKeyBindings () const
 
void setDelegate (KCompletionBase *delegate)
 
KCompletionBase * delegate () const
 

Additional Inherited Members

- Public Types inherited from KCompletionBase
enum  KeyBindingType
 
- Signals inherited from KLineEdit
void completionBoxActivated (const TQString &)
 
void returnPressed (const TQString &)
 
void completion (const TQString &)
 
void substringCompletion (const TQString &)
 
void textRotation (KCompletionBase::KeyBindingType)
 
void completionModeChanged (KGlobalSettings::Completion)
 
void aboutToShowContextMenu (TQPopupMenu *p)
 
- Public Attributes inherited from KCompletionBase
 TextCompletion
 
 PrevCompletionMatch
 
 NextCompletionMatch
 
 SubstringCompletion
 
- Properties inherited from KLineEdit
bool contextMenuEnabled
 
bool urlDropsEnabled
 
bool trapEnterKeyEvent
 
bool enableSqueezedText
 
TQString clickMessage
 

Detailed Description

This class makes it easy to add a search line for filtering the items in a iconview based on a simple text search.

No changes to the application other than instantiating this class with an appropriate TQIconView should be needed.

Since
3.3

Definition at line 38 of file kiconviewsearchline.h.

Constructor & Destructor Documentation

◆ KIconViewSearchLine() [1/2]

KIconViewSearchLine::KIconViewSearchLine ( TQWidget *  parent = 0,
TQIconView *  iconView = 0,
const char *  name = 0 
)

Constructs a KIconViewSearchLine with iconView being the TQIconView to be filtered.

If iconView is null then the widget will be disabled until a iconview is set with setIconView().

Definition at line 57 of file kiconviewsearchline.cpp.

◆ KIconViewSearchLine() [2/2]

KIconViewSearchLine::KIconViewSearchLine ( TQWidget *  parent,
const char *  name 
)

Constructs a KIconViewSearchLine without any TQIconView to filter.

The TQIconView object has to be set later with setIconView().

Definition at line 66 of file kiconviewsearchline.cpp.

◆ ~KIconViewSearchLine()

KIconViewSearchLine::~KIconViewSearchLine ( )
virtual

Destroys the KIconViewSearchLine.

Definition at line 73 of file kiconviewsearchline.cpp.

Member Function Documentation

◆ activateSearch

void KIconViewSearchLine::activateSearch ( )
protectedslot

When the timer started with queueSearch() expires this slot is called.

If there has been another timer started then this slot does nothing. However if there are no other pending searches this starts the icon view search.

See also
queueSearch()

Definition at line 237 of file kiconviewsearchline.cpp.

◆ caseSensitive()

bool KIconViewSearchLine::caseSensitive ( ) const

Returns true if the search is case sensitive.

This defaults to false.

See also
setCaseSensitive()

Definition at line 79 of file kiconviewsearchline.cpp.

◆ clear

void KIconViewSearchLine::clear ( )
slot

Clear line edit and empty hiddenItems, returning elements to iconView.

Definition at line 123 of file kiconviewsearchline.cpp.

◆ hideItem()

void KIconViewSearchLine::hideItem ( TQIconViewItem *  item)
protected

Hide item.

Definition at line 206 of file kiconviewsearchline.cpp.

◆ iconDeleted

void KIconViewSearchLine::iconDeleted ( const TQString &  filename)
slot

Should be called before updateSearch() whenever an icon is deleted.

Definition at line 143 of file kiconviewsearchline.cpp.

◆ iconView()

TQIconView * KIconViewSearchLine::iconView ( ) const

Returns the iconview that is currently filtered by the search.

See also
setIconView()

Definition at line 84 of file kiconviewsearchline.cpp.

◆ init()

void KIconViewSearchLine::init ( TQIconView *  iconView = 0)
protected

Do initialization common to both constructors.

Definition at line 186 of file kiconviewsearchline.cpp.

◆ itemMatches()

bool KIconViewSearchLine::itemMatches ( const TQIconViewItem *  item,
const TQString &  s 
) const
protectedvirtual

Returns true if item matches the search s.

This will be evaluated based on the value of caseSensitive(). This can be overridden in subclasses to implement more complicated matching schemes.

Definition at line 173 of file kiconviewsearchline.cpp.

◆ queueSearch

void KIconViewSearchLine::queueSearch ( const TQString &  s)
protectedslot

When keys are pressed a new search string is created and a timer is activated.

The most recent search is activated when this timer runs out if another key has not yet been pressed.

This method makes

Parameters
sthe most recent search and starts the timer.

Together with activateSearch() this makes it such that searches are not started until there is a short break in the users typing.

See also
activateSearch()

Definition at line 230 of file kiconviewsearchline.cpp.

◆ setCaseSensitive

void KIconViewSearchLine::setCaseSensitive ( bool  cs)
slot

Make the search case sensitive or case insensitive.

See also
caseSenstive()

Definition at line 147 of file kiconviewsearchline.cpp.

◆ setIconView

void KIconViewSearchLine::setIconView ( TQIconView *  iv)
slot

Sets the TQIconView that is filtered by this search line.

If lv is null then the widget will be disabled.

See also
iconView()

Definition at line 152 of file kiconviewsearchline.cpp.

◆ showItem()

void KIconViewSearchLine::showItem ( TQIconViewItem *  item)
protected

Show item.

Just unhide it, doesn't necessary show it on screen, for that use iconView->ensureItemVisible()

Definition at line 214 of file kiconviewsearchline.cpp.

◆ updateSearch

void KIconViewSearchLine::updateSearch ( const TQString &  s = TQString::null)
virtualslot

Updates search to only make visible the items that match s.

If s is null then the line edit's text will be used.

Definition at line 92 of file kiconviewsearchline.cpp.


The documentation for this class was generated from the following files:
  • kiconviewsearchline.h
  • kiconviewsearchline.cpp

kdeui

Skip menu "kdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdeui

Skip menu "kdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdeui by doxygen 1.9.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |