Logo Search packages:      
Sourcecode: dc-qt version File versions  Download package

SearchManager Class Reference

#include <searchmanager.h>

Inheritance diagram for SearchManager:

List of all members.


Detailed Description

Manages the search dialog and subwidgets.

This class acts as a facade to the search interface. It receives search results and updates the current search widget, which it owns. It also performs searches using the BackendConnection that is assigned during construction. Furthermore, it implements the search dialog/dockwidget switching.

Definition at line 122 of file SearchManager.h.


Public Types

enum  DisplayMode { SHOW_AS_DIALOG, SHOW_AS_DOCKWINDOW }
 Display modes.
enum  Priority { IDLE = 1, LOW = 1, NORMAL = 0, HIGH = -1 }
enum  SizeModes { SIZE_DONTCARE = 0x00, SIZE_ATLEAST = 0x01, SIZE_ATMOST = 0x02 }
enum  TypeModes {
  TYPE_ANY = 0, TYPE_AUDIO, TYPE_COMPRESSED, TYPE_DOCUMENT,
  TYPE_EXECUTABLE, TYPE_PICTURE, TYPE_VIDEO, TYPE_DIRECTORY,
  TYPE_TTH
}

Public Slots

void search (int session, qint64 size, int sizeMode, int typeMode, const QString &search, SearchWidget *originator)
 Call to execute a search.
void searchResults (int, QList< SearchEntry > &)
 Called when new search results arrive.
void show (QMainWindow *)
 Called to show the search UI.

Public Member Functions

void addListener (Listener *aListener)
void disconnect () throw ()
template<typename T0, class T1, class T2, class T3, class T4, class T5, class T6>
void fire (T0 type, const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6) throw ()
template<typename T0, class T1, class T2, class T3, class T4, class T5>
void fire (T0 type, const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5) throw ()
template<typename T0, class T1, class T2, class T3, class T4>
void fire (T0 type, const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4) throw ()
template<typename T0, class T1, class T2, class T3>
void fire (T0 type, const T1 &p1, const T2 &p2, const T3 &p3) throw ()
template<typename T0, class T1, class T2>
void fire (T0 type, const T1 &p1, const T2 &p2) throw ()
template<typename T0, class T1>
void fire (T0 type, const T1 &p1) throw ()
template<typename T0>
void fire (T0 type) throw ()
short getPort ()
void join () throw ()
bool okToSearch ()
void onSearchResult (const string &aLine)
void removeListener (Listener *aListener)
void removeListeners ()
void respond (const AdcCommand &cmd)
void search (StringList &who, const string &aName, const string &aSize, TypeModes aTypeMode, SizeModes aSizeMode, const string &aToken)
void search (StringList &who, const string &aName, int64_t aSize, TypeModes aTypeMode, SizeModes aSizeMode, const string &aToken)
void search (const string &aName, const string &aSize, TypeModes aTypeMode, SizeModes aSizeMode, const string &aToken)
void search (const string &aName, int64_t aSize, TypeModes aTypeMode, SizeModes aSizeMode, const string &aToken)
 SearchManager (boost::shared_ptr< BackendConnection > aConnection, QObject *parent=0)
 constructor
void setPort (short aPort) throw (SocketException)
void setThreadPriority (Priority p)
void start () throw (ThreadException)
int32_t timeToSearch ()
 ~SearchManager ()
 destructor

Static Public Member Functions

static string clean (const string &aSearchString)
static void deleteInstance ()
static T * getInstance ()
static void newInstance ()
static long safeDec (volatile long &v)
static long safeInc (volatile long &v)
static void sleep (u_int32_t millis)
static void yield ()

Protected Attributes

CriticalSection listenerCS
ListenerList listeners
ListenerList tmp

Static Protected Attributes

static T * instance = NULL

Private Slots

void onCloseCurrentSearch ()

Private Member Functions

bool isSearchForActiveWidget (const QString &searchStr) const
SearchWidgetnewSearchWidget (const QString &name)
void onData (const u_int8_t *buf, size_t aLen, const string &address)
virtual int run ()
void setupUi (QMainWindow *)

Private Attributes

SearchWidgetactiveSearch
 Search results will be sent to this widget.
QString activeSearchString
 Set to the string of the last made search, used for filtering.
int activeSearchType
 Set to the search type of the last search, used for filtering.
boost::shared_ptr
< BackendConnection
backendConnection
QPointer< QDialog > dialog
DisplayMode displayMode
QPointer< QDockWidget > dock
bool dockWidgetAdded
u_int32_t lastSearch
short port
QTabWidget * searchTabs
QStringList searchTokens
Socket * socket
bool stop

Friends

class Singleton< SearchManager >

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

Generated by  Doxygen 1.6.0   Back to index