~sil2100/unity-2d/precise-security

« back to all changes in this revision

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

  • Committer: Aurelien Gateau
  • Date: 2010-11-10 08:57:29 UTC
  • mto: This revision was merged to the branch mainline in revision 284.
  • Revision ID: aurelien.gateau@canonical.com-20101110085729-fl1ye7impkqhm0w6
Added a section about const correct-ness

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2010 Canonical, Ltd.
3
 
 *
4
 
 * Authors:
5
 
 *  Olivier Tilloy <olivier.tilloy@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 LAUNCHERDEVICE_H
21
 
#define LAUNCHERDEVICE_H
22
 
 
23
 
#include <gio/gio.h>
24
 
 
25
 
#include "launcheritem.h"
26
 
 
27
 
#include <QObject>
28
 
#include <QString>
29
 
#include <QMetaType>
30
 
 
31
 
class LauncherDevice : public LauncherItem
32
 
{
33
 
    Q_OBJECT
34
 
 
35
 
public:
36
 
    LauncherDevice();
37
 
    LauncherDevice(const LauncherDevice& other);
38
 
    ~LauncherDevice();
39
 
 
40
 
    /* getters */
41
 
    virtual bool active() const;
42
 
    virtual bool running() const;
43
 
    virtual int windowCount() const;
44
 
    virtual bool urgent() const;
45
 
    virtual QString name() const;
46
 
    virtual QString icon() const;
47
 
    virtual bool launching() const;
48
 
 
49
 
    /* methods */
50
 
    Q_INVOKABLE virtual void activate();
51
 
    Q_INVOKABLE GVolume* getVolume();
52
 
    Q_INVOKABLE void setVolume(GVolume* volume);
53
 
    Q_INVOKABLE void open();
54
 
    Q_INVOKABLE void unmount(GMountOperation* mountOperation);
55
 
    Q_INVOKABLE void eject();
56
 
    Q_INVOKABLE void stop();
57
 
 
58
 
    Q_INVOKABLE virtual void createMenuActions();
59
 
 
60
 
private Q_SLOTS:
61
 
    void onEjectTriggered();
62
 
    void onStopTriggered();
63
 
 
64
 
private:
65
 
    GVolume* m_volume;
66
 
 
67
 
    static void onVolumeMounted(GVolume* volume, GAsyncResult* res);
68
 
    static void onVolumeEjected(GVolume* volume, GAsyncResult* res);
69
 
    static void onDriveStopped(GDrive* drive, GAsyncResult* res);
70
 
    static void onMountUnmounted(GMount* mount, GAsyncResult* res);
71
 
};
72
 
 
73
 
Q_DECLARE_METATYPE(LauncherDevice*)
74
 
 
75
 
#endif // LAUNCHERDEVICE_H
76