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

« back to all changes in this revision

Viewing changes to libunity-2d-private/Unity2d/workspaces.h

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2011-08-01 19:53:40 UTC
  • mfrom: (1.1.16 upstream)
  • Revision ID: james.westby@ubuntu.com-20110801195340-se0ukbsb0z3b6an1
Tags: 3.8.14-0ubuntu1
* New upstream release:
  - [launcher] Need to press Alt+F1 twice to show launcher (LP: #812787)
* debian/control:
  - build on latest libunity-core-4.0-dev and latest libnux-1.0-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2011 Canonical, Ltd.
3
 
 *
4
 
 * Authors:
5
 
 *  Ugo Riboni <ugo.riboni@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 WORKSPACES_H
21
 
#define WORKSPACES_H
22
 
 
23
 
#include <gio/gio.h>
24
 
 
25
 
#include "launcheritem.h"
26
 
 
27
 
#include <QAbstractListModel>
28
 
#include <QMetaType>
29
 
 
30
 
class Workspaces : public LauncherItem
31
 
{
32
 
    Q_OBJECT
33
 
 
34
 
public:
35
 
    Workspaces();
36
 
    Workspaces(const Workspaces& other);
37
 
    ~Workspaces();
38
 
 
39
 
    /* getters */
40
 
    virtual bool active() const;
41
 
    virtual bool running() const;
42
 
    virtual int windowCount() const;
43
 
    virtual bool urgent() const;
44
 
    virtual QString name() const;
45
 
    virtual QString icon() const;
46
 
    virtual bool launching() const;
47
 
 
48
 
    /* methods */
49
 
    Q_INVOKABLE virtual void activate();
50
 
    Q_INVOKABLE virtual void createMenuActions();
51
 
};
52
 
 
53
 
Q_DECLARE_METATYPE(Workspaces*)
54
 
 
55
 
/* This class wouldn't be necessary if the launcher were able
56
 
   to accept single LauncherItems instad of only groups of
57
 
   LauncherItems in a list model. */
58
 
class WorkspacesList : public QAbstractListModel
59
 
{
60
 
    Q_OBJECT
61
 
 
62
 
public:
63
 
    WorkspacesList(QObject* parent = 0);
64
 
    ~WorkspacesList();
65
 
 
66
 
    QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
67
 
    int rowCount(const QModelIndex& parent = QModelIndex()) const;
68
 
 
69
 
private:
70
 
    Workspaces* m_workspaces;
71
 
};
72
 
 
73
 
#endif // WORKSPACES_H
74