~liu-xiao-guo/debiantrial/dianpianclient1

« back to all changes in this revision

Viewing changes to include/scope/scope.h

  • Committer: XiaoGuo, Liu
  • Date: 2014-11-14 08:55:36 UTC
  • Revision ID: xiaoguo.liu@canonical.com-20141114085536-clcivi81l1e85h8i
Initial release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef SCOPE_SCOPE_H_
 
2
#define SCOPE_SCOPE_H_
 
3
 
 
4
#include <api/config.h>
 
5
 
 
6
#include <unity/scopes/ScopeBase.h>
 
7
#include <unity/scopes/QueryBase.h>
 
8
#include <unity/scopes/ReplyProxyFwd.h>
 
9
#include <unity/scopes/QueryBase.h>
 
10
#include <unity/scopes/PreviewQueryBase.h>
 
11
 
 
12
namespace scope {
 
13
 
 
14
/**
 
15
 * Defines the lifecycle of scope plugin, and acts as a factory
 
16
 * for Query and Preview objects.
 
17
 *
 
18
 * Note that the #preview and #search methods are each called on
 
19
 * different threads, so some form of interlocking is required
 
20
 * if shared data structures are used.
 
21
 */
 
22
class Scope: public unity::scopes::ScopeBase {
 
23
public:
 
24
    /**
 
25
     * Called once at startup
 
26
     */
 
27
    void start(std::string const&) override;
 
28
 
 
29
    /**
 
30
     * Called at shutdown
 
31
     */
 
32
    void stop() override;
 
33
 
 
34
    /**
 
35
     * Called each time a new preview is requested
 
36
     */
 
37
    unity::scopes::PreviewQueryBase::UPtr preview(const unity::scopes::Result&,
 
38
                                                  const unity::scopes::ActionMetadata&) override;
 
39
 
 
40
    /**
 
41
     * Called each time a new query is requested
 
42
     */
 
43
    unity::scopes::SearchQueryBase::UPtr search(
 
44
            unity::scopes::CannedQuery const& q,
 
45
            unity::scopes::SearchMetadata const&) override;
 
46
 
 
47
protected:
 
48
    api::Config::Ptr config_;
 
49
};
 
50
 
 
51
}
 
52
 
 
53
#endif // SCOPE_SCOPE_H_
 
54