gloox  0.9.9.12
Public Member Functions | List of all members
Search Class Reference

#include <search.h>

Inheritance diagram for Search:
Inheritance graph
[legend]
Collaboration diagram for Search:
Collaboration graph
[legend]

Public Member Functions

 Search (ClientBase *parent)
 ~Search ()
void fetchSearchFields (const JID &directory, SearchHandler *sh)
void search (const JID &directory, const DataForm &form, SearchHandler *sh)
void search (const JID &directory, int fields, const SearchFieldStruct &values, SearchHandler *sh)
virtual bool handleIq (Stanza *stanza)
virtual bool handleIqID (Stanza *stanza, int context)
- Public Member Functions inherited from IqHandler
virtual ~IqHandler ()

Detailed Description

An implementation of XEP-0055 (Jabber Search)

To perform a search in a directory (e.g., a User Directory):

Author
Jakob Schroeter js@ca.nosp@m.maya.nosp@m..net
Since
0.8.5

Definition at line 47 of file search.h.

Constructor & Destructor Documentation

Search ( ClientBase parent)

Creates a new Search object.

Parameters
parentThe ClientBase to use.

Definition at line 23 of file search.cpp.

~Search ( )

Virtual Destructor.

Definition at line 28 of file search.cpp.

Member Function Documentation

void fetchSearchFields ( const JID directory,
SearchHandler sh 
)

Use this function to check which fields the directory supports.

Parameters
directoryThe (user) directory to fetch the available/searchable fields from.
shThe SearchHandler to notify about the results.

Definition at line 33 of file search.cpp.

virtual bool handleIq ( Stanza stanza)
inlinevirtual

Reimplement this function if you want to be notified about incoming IQs.

Parameters
stanzaThe complete Stanza.
Returns
Indicates whether a request of type 'get' or 'set' has been handled. This includes the obligatory 'result' answer. If you return false, a 'error' will be sent.

Implements IqHandler.

Definition at line 90 of file search.h.

bool handleIqID ( Stanza stanza,
int  context 
)
virtual

Reimplement this function if you want to be notified about incoming IQs with a specific value of the id attribute. You have to enable tracking of those IDs using Client::trackID(). This is usually useful for IDs that generate a positive reply, i.e. <iq type='result' id='reg'/> where a namespace filter wouldn't work.

Parameters
stanzaThe complete Stanza.
contextA value to restore context, stored with ClientBase::trackID().
Returns
Indicates whether a request of type 'get' or 'set' has been handled. This includes the obligatory 'result' answer. If you return false, a 'error' will be sent.

Implements IqHandler.

Definition at line 100 of file search.cpp.

void search ( const JID directory,
const DataForm form,
SearchHandler sh 
)

Initiates a search on the given directory, with the given data form. The given SearchHandler is notified about the results.

Parameters
directoryThe (user) directory to search.
formThe DataForm contains the phrases the user wishes to search for.
shThe SearchHandler to notify about the results.

Definition at line 52 of file search.cpp.

void search ( const JID directory,
int  fields,
const SearchFieldStruct values,
SearchHandler sh 
)

Initiates a search on the given directory, with the given phrases. The given SearchHandler is notified about the results.

Parameters
directoryThe (user) directory to search.
fieldsBit-wise ORed FieldEnum values describing the valid (i.e., set) fields in the values parameter.
valuesContains the phrases to search for.
shThe SearchHandler to notify about the results.

Definition at line 72 of file search.cpp.


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