~ubuntu-branches/ubuntu/saucy/kopete/saucy-proposed

« back to all changes in this revision

Viewing changes to protocols/groupwise/libgroupwise/tasks/searchusertask.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-06-21 02:22:39 UTC
  • Revision ID: package-import@ubuntu.com-20130621022239-63l3zc8p0nf26pt6
Tags: upstream-4.10.80
ImportĀ upstreamĀ versionĀ 4.10.80

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Kopete Groupwise Protocol
 
3
    searchusertask.h - high level search for users on the server - spawns PollSearchResultsTasks
 
4
 
 
5
    Copyright (c) 2005      SUSE Linux Products GmbH             http://www.suse.com
 
6
    
 
7
    Based on Iris, Copyright (C) 2003  Justin Karneges <justin@affinix.com>
 
8
 
 
9
    Kopete (c) 2002-2005 by the Kopete developers <kopete-devel@kde.org>
 
10
 
 
11
    *************************************************************************
 
12
    *                                                                       *
 
13
    * This library is free software; you can redistribute it and/or         *
 
14
    * modify it under the terms of the GNU Lesser General Public            *
 
15
    * License as published by the Free Software Foundation; either          *
 
16
    * version 2 of the License, or (at your option) any later version.      *
 
17
    *                                                                       *
 
18
    *************************************************************************
 
19
*/
 
20
 
 
21
#ifndef SEARCHUSERTASK_H
 
22
#define SEARCHUSERTASK_H
 
23
 
 
24
#include "libgroupwise_export.h"
 
25
#include "requesttask.h"
 
26
 
 
27
class QTimer;
 
28
 
 
29
/**
 
30
This Task performs user searching on the server
 
31
 
 
32
@author SUSE AG
 
33
*/
 
34
class LIBGROUPWISE_EXPORT SearchUserTask : public RequestTask
 
35
{
 
36
Q_OBJECT
 
37
public:
 
38
    SearchUserTask(Task* parent);
 
39
 
 
40
    ~SearchUserTask();
 
41
        /**
 
42
         * Create the search query
 
43
         * @param query a list of search terms
 
44
         */
 
45
        void search( const QList<GroupWise::UserSearchQueryTerm> & query);
 
46
        /** 
 
47
         * If the query was accepted, start a timer to poll for results using PollSearchResultsTask
 
48
         */
 
49
        virtual bool take( Transfer * transfer );
 
50
        /**
 
51
         * Access the results of the search
 
52
         */
 
53
        QList< GroupWise::ContactDetails > results();
 
54
protected slots:
 
55
        void slotPollForResults();
 
56
        void slotGotPollResults();
 
57
private: 
 
58
        QString m_queryHandle;  // used to identify our query to the server, so we can poll for its results
 
59
        QTimer * m_resultsPollTimer;
 
60
        QList< GroupWise::ContactDetails > m_results;
 
61
        int m_polls;
 
62
};
 
63
 
 
64
#endif