Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OCompletionMatches Class Reference

List for keeping matches returned from OCompletion. More...

#include </home/clem/local/src/opie/libopie2/qt3/opiecore/ocompletion.h>

Inheritance diagram for OCompletionMatches:

Inheritance graph
[legend]
Collaboration diagram for OCompletionMatches:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 OCompletionMatches (bool sort)
 OCompletionMatches (const OCompletionMatchesWrapper &matches)
 ~OCompletionMatches ()
void removeDuplicates ()
QStringList list (bool sort=true) const
bool sorting () const

Private Attributes

bool _sorting
OCompletionMatchesPrivate * d

Detailed Description

List for keeping matches returned from OCompletion.

This structure is returned by OCompletion::allWeightedMatches . It also keeps the weight of the matches, allowing you to modify some matches or merge them with matches from another call to allWeightedMatches(), and sort the matches after that in order to have the matches ordered correctly

Example (a simplified example of what Oonqueror's completion does):

 OCompletionMatches matches = completion->allWeightedMatches( location );
 if( !location.startsWith( "www." ))
       matches += completion->allWeightedmatches( "www." + location" );
 matches.removeDuplicates();
 QStringList list = matches.list();
 

Definition at line 569 of file ocompletion.h.


Constructor & Destructor Documentation

OCompletionMatches::OCompletionMatches bool  sort  ) 
 

Definition at line 932 of file ocompletion.cpp.

OCompletionMatches::OCompletionMatches const OCompletionMatchesWrapper matches  ) 
 

For internal use only.

Definition at line 937 of file ocompletion.cpp.

References QValueList< T >::begin(), QValueList< T >::end(), l, OCompletionMatchesWrapper::list(), QValueList< OSortableItem< QString, int > >::operator=(), QValueList< OSortableItem< T, Key > >::prepend(), and OCompletionMatchesWrapper::sortedList.

OCompletionMatches::~OCompletionMatches  ) 
 

Definition at line 951 of file ocompletion.cpp.


Member Function Documentation

QStringList OCompletionMatches::list bool  sort = true  )  const
 

Returns the matches as a QStringList.

Parameters:
sort if false, the matches won't be sorted before the conversion, use only if you're sure the sorting is not needed

Definition at line 955 of file ocompletion.cpp.

References _sorting, QValueList< OSortableItem< T, Key > >::begin(), QValueList< OSortableItem< T, Key > >::end(), and QValueList< T >::prepend().

void OCompletionMatches::removeDuplicates  ) 
 

Removes duplicate matches. Needed only when you merged several matches results and there's a possibility of duplicates.

Definition at line 966 of file ocompletion.cpp.

References QValueList< OSortableItem< T, Key > >::begin(), QValueList< OSortableItem< T, Key > >::end(), and QValueList< OSortableItem< T, Key > >::remove().

bool OCompletionMatches::sorting  )  const [inline]
 

If sorting() returns false, the matches aren't sorted by their weight, even if true is passed to list().

Definition at line 594 of file ocompletion.h.

References _sorting.


Member Data Documentation

bool OCompletionMatches::_sorting [private]
 

Definition at line 598 of file ocompletion.h.

Referenced by list(), and sorting().

OCompletionMatchesPrivate* OCompletionMatches::d [private]
 

Definition at line 599 of file ocompletion.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:41:56 2005 for OPIE by  doxygen 1.4.2