~ubuntu-branches/ubuntu/precise/unity-2d/precise-updates

« back to all changes in this revision

Viewing changes to libunity-2d-private/src/filters.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2011-08-25 18:16:57 UTC
  • mfrom: (1.1.19 upstream)
  • Revision ID: james.westby@ubuntu.com-20110825181657-opb29rqsxae3i98f
Tags: 4.2.0-0ubuntu1
* New upstream release:
  - [panel] application menus do not appear on first hover after dismissal
    (lp: #825262)
  - [dash] Lens icons badly scaled (lp: #825368)
  - [panel] indicators are shifted offscreen to the right (lp: #827673)
  - [panel] scrubbing from system indicators to menubar should be possible
    (lp: #706903)
  - [launcher] Closed applications don't get their launcher counts cleared
    (lp: #767367)
  - [dash] selected item should not be underlined but use the same 
    treatment as unity (lp: #817456)
  - [dash] categories should be collapsed by default (lp: #827214)
  - [dash] Ratings filter (lp: #831855)
  - [dash] Multirange filter (lp: #831856)
  - [dash] ToggleButton filter (lp: #831857)
  - [dash] Icon size must be bigger to match the mockups (lp: #831858)
  - [dash] "Refine search" right margin should be 15 pixels (lp: #832058)
  - [dash] "Refine search" should be "Filter results" (lp: #832060)
  - [dash] Font sizes should match new design (lp: #832114)
  - [panel] Glitch: application menu appearing when pressing the BFB 
    (lp: #825060)
  - [panel] Glitch: application menus are quickly opened after a drag gesture
    (lp: #825267)
  - [dash] File thumbnails aspect ratio is not respected (lp: #832204)
* debian/control: require current the current versions of nux and unity

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2011 Canonical, Ltd.
 
3
 *
 
4
 * Authors:
 
5
 *  Florian Boucault <florian.boucault@canonical.com>
 
6
 *
 
7
 * This program is free software; you can redistribute it and/or modify
 
8
 * it under the terms of the GNU General Public License as published by
 
9
 * the Free Software Foundation; version 3.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
18
 */
 
19
 
 
20
#ifndef FILTERS_H
 
21
#define FILTERS_H
 
22
 
 
23
// Qt
 
24
#include <QAbstractListModel>
 
25
#include <QList>
 
26
 
 
27
// libunity-core
 
28
#include <UnityCore/Filters.h>
 
29
#include <UnityCore/Filter.h>
 
30
 
 
31
 
 
32
class Filter;
 
33
 
 
34
class Filters : public QAbstractListModel
 
35
{
 
36
    Q_OBJECT
 
37
 
 
38
    Q_ENUMS(Roles)
 
39
 
 
40
public:
 
41
    explicit Filters(unity::dash::Filters::Ptr unityFilters, QObject *parent = 0);
 
42
    ~Filters();
 
43
 
 
44
    enum Roles {
 
45
        RoleFilter
 
46
    };
 
47
 
 
48
    QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
 
49
    int rowCount(const QModelIndex& parent = QModelIndex()) const;
 
50
 
 
51
private:
 
52
    unity::dash::Filters::Ptr m_unityFilters;
 
53
    QList<Filter*> m_filters;
 
54
 
 
55
    void onFilterAdded(unity::dash::Filter::Ptr unityFilter);
 
56
    void onFilterChanged(unity::dash::Filter::Ptr unityFilter);
 
57
    void onFilterRemoved(unity::dash::Filter::Ptr unityFilter);
 
58
 
 
59
    void addFilter(unity::dash::Filter::Ptr unityFilter, int index);
 
60
    void removeFilter(int index);
 
61
 
 
62
    int indexForFilter(unity::dash::Filter::Ptr unityFilter);
 
63
};
 
64
 
 
65
Q_DECLARE_METATYPE(Filters*)
 
66
 
 
67
#endif // FILTERS_H