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

« back to all changes in this revision

Viewing changes to include/unity/scopes/qt/internal/QCategoryImpl.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/Category.h>
 
25
 
 
26
#include <QtCore/QString>
 
27
#include <QtCore/QVariantMap>
 
28
 
 
29
namespace unity
 
30
{
 
31
 
 
32
namespace scopes
 
33
{
 
34
 
 
35
namespace qt
 
36
{
 
37
 
 
38
namespace internal
 
39
{
 
40
class QCategorisedResultImpl;
 
41
 
 
42
class QCategoryImpl
 
43
{
 
44
public:
 
45
    /// @cond
 
46
    NONCOPYABLE(QCategoryImpl);
 
47
    UNITY_DEFINES_PTRS(QCategoryImpl);
 
48
 
 
49
    QCategoryImpl(unity::scopes::Category::SCPtr category);
 
50
 
 
51
    virtual ~QCategoryImpl();
 
52
    /// @endcond
 
53
 
 
54
    /**
 
55
     \brief Get identifier of this Category
 
56
     \return The category identifier.
 
57
    */
 
58
    QString id() const;
 
59
 
 
60
    /**
 
61
     \brief Get title of this Category
 
62
     \return The category title.
 
63
    */
 
64
    QString title() const;
 
65
 
 
66
    /**
 
67
     \brief Get icon of this Category
 
68
     \return The category icon.
 
69
    */
 
70
    QString icon() const;
 
71
 
 
72
    /**
 
73
     \brief Query to perform when this category is expanded
 
74
     \return The expansion query or nullptr.
 
75
    */
 
76
    CannedQuery::SCPtr query() const;
 
77
 
 
78
    /**
 
79
     \brief Get renderer template of this Category
 
80
     \return The category renderer template.
 
81
     */
 
82
    CategoryRenderer const& renderer_template() const;
 
83
 
 
84
    // @cond
 
85
    QVariantMap serialize() const;
 
86
 
 
87
private:
 
88
    unity::scopes::Category::SCPtr api_category_;
 
89
    friend class QCategorisedResultImpl;
 
90
};
 
91
 
 
92
}  // namespace internal
 
93
 
 
94
}  // namespace qt
 
95
 
 
96
}  // namespace scopes
 
97
 
 
98
}  // namespace unity