~xavi-garcia-mena/unity-scopes-api/utils-qt

« back to all changes in this revision

Viewing changes to include/unity/scopes/qt/internal/QPreviewQueryBaseImpl.h

  • Committer: Xavi Garcia
  • Date: 2015-01-20 13:59:36 UTC
  • Revision ID: xavi.garcia.mena@canonical.com-20150120135936-cogxk8ok7g0gvo8g
Added Qt-bindings classes

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2015 Canonical Ltd
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify
 
5
 * it under the terms of the GNU Lesser General Public License version 3 as
 
6
 * published by the Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU Lesser General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU Lesser General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 *
 
16
 * Authored by: Xavi Garcia <xavi.garcia.mena@canonical.com>
 
17
 */
 
18
 
 
19
#pragma once
 
20
 
 
21
#include <unity/util/DefinesPtrs.h>
 
22
#include <unity/util/NonCopyable.h>
 
23
 
 
24
#include <unity/scopes/qt/QActionMetadata.h>
 
25
#include <unity/scopes/qt/QCannedQuery.h>
 
26
#include <unity/scopes/qt/QResult.h>
 
27
 
 
28
namespace unity
 
29
{
 
30
 
 
31
namespace scopes
 
32
{
 
33
 
 
34
class SearchMetadata;
 
35
class CannedQuery;
 
36
 
 
37
namespace qt
 
38
{
 
39
 
 
40
class QPreviewQueryBase;
 
41
class QPreviewQueryBaseAPI;
 
42
 
 
43
namespace internal
 
44
{
 
45
 
 
46
class QPreviewQueryBaseImpl
 
47
{
 
48
public:
 
49
    /// @cond
 
50
    NONCOPYABLE(QPreviewQueryBaseImpl);
 
51
    UNITY_DEFINES_PTRS(QPreviewQueryBaseImpl);
 
52
    /// @endcond
 
53
 
 
54
    QPreviewQueryBaseImpl();
 
55
    ~QPreviewQueryBaseImpl() = default;
 
56
 
 
57
    /**
 
58
     \brief Get result for this preview request.
 
59
     \throws unity::LogicException if result was not initialized (the default ctor was used).
 
60
     \return result
 
61
     */
 
62
    QResult result() const;
 
63
 
 
64
    /**
 
65
     \brief Get metadata for this preview request.
 
66
     \return search metadata
 
67
     \throws unity::LogicException if preview metadata was not initialized (the default ctor was used).
 
68
    */
 
69
    QActionMetadata action_metadata() const;
 
70
 
 
71
protected:
 
72
    QPreviewQueryBaseAPI* preview_api_;
 
73
 
 
74
private:
 
75
    void init(QPreviewQueryBaseAPI* preview_api);
 
76
 
 
77
    friend class unity::scopes::qt::QPreviewQueryBase;
 
78
};
 
79
 
 
80
}  // namespace internal
 
81
 
 
82
}  // namespace qt
 
83
 
 
84
}  // namespace scopes
 
85
 
 
86
}  // namespace unity