aboutsummaryrefslogtreecommitdiff
path: root/tests/script/dbusmenuscript.h
blob: 03c5ad3583930f5c739030c6dd2cb8afa68993a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
 * Copyright 2012 Canonical Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; version 3.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Authors:
 *      Renato Araujo Oliveira Filho <renato@canonical.com>
 */

#ifndef DBUSMENUSCRIPT_H
#define DBUSMENUSCRITP_H

#include <QObject>
#include <QDBusInterface>
#include <QPair>

#define SCRIPT_SERVICE_NAME     "org.ayatana.test"
#define SCRIPT_OBJECT_PATH      "/org/ayatana/test/menuscript"
#define SCRIPT_INTERFACE_NAME   "org.ayatana.test.menuscript"

#define MENU_SERVICE_NAME       SCRIPT_SERVICE_NAME ".menu"
#define MENU_OBJECT_PATH        SCRIPT_OBJECT_PATH "/menu"


class DBusMenuScript
{
public:
    DBusMenuScript();
    ~DBusMenuScript();

    bool connect();
    void quit();

    void walk(int steps = 1);
    void run();

    void publishMenu();
    void unpublishMenu();

    QPair<QString, QVariant> popActivatedAction();

private:
    QDBusInterface *m_script;
};

#endif