~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to khotkeys/kcm_hotkeys/hotkeys_context_menu.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef HOTKEYS_CONTEXT_MENU_H
 
2
#define HOTKEYS_CONTEXT_MENU_H
 
3
/**
 
4
 * Copyright (C) 2009 Michael Jansen <kde@michael-jansen.biz>
 
5
 *
 
6
 * This library is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the GNU Library General Public
 
8
 * License as published by the Free Software Foundation; either
 
9
 * version 2 of the License, or (at your option) any later version.
 
10
 *
 
11
 * This library 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 GNU
 
14
 * Library General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU Library General Public License
 
17
 * along with this library; see the file COPYING.LIB. If not, write to
 
18
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
19
 * Boston, MA 02110-1301, USA.
 
20
 */
 
21
 
 
22
#include "triggers/triggers.h"
 
23
#include "actions/actions.h"
 
24
 
 
25
#include "libkhotkeysfwd.h"
 
26
 
 
27
#include <QtGui/QMenu>
 
28
#include <QtCore/QModelIndex>
 
29
 
 
30
 
 
31
class HotkeysTreeView;
 
32
 
 
33
class QModelIndex;
 
34
class QSignalMapper;
 
35
 
 
36
 
 
37
class HotkeysTreeViewContextMenu : public QMenu
 
38
    {
 
39
    Q_OBJECT
 
40
 
 
41
public:
 
42
 
 
43
    HotkeysTreeViewContextMenu( const QModelIndex &index, HotkeysTreeView *parent = 0 );
 
44
    HotkeysTreeViewContextMenu( HotkeysTreeView *parent = 0 );
 
45
 
 
46
    virtual ~HotkeysTreeViewContextMenu();
 
47
 
 
48
    //! Create a submenu per allowed trigger type
 
49
    void createTriggerMenus(
 
50
        KHotKeys::Trigger::TriggerTypes triggerTypes,
 
51
        KHotKeys::Action::ActionTypes actionTypes);
 
52
 
 
53
    //! Populate a trigger menu
 
54
    void populateTriggerMenu(QMenu *menu, QSignalMapper *mapper, KHotKeys::Action::ActionTypes types);
 
55
 
 
56
private Q_SLOTS:
 
57
 
 
58
    void slotAboutToShow();
 
59
    void slotAboutToShowForCurrent();
 
60
    void deleteAction();
 
61
 
 
62
    void exportAction();
 
63
    void importAction();
 
64
 
 
65
    void newGlobalShortcutActionAction(int);
 
66
    void newWindowTriggerActionAction(int);
 
67
    void newMouseGestureTriggerActionAction(int);
 
68
    void newGroupAction();
 
69
 
 
70
private:
 
71
 
 
72
    KHotKeys::Action* createActionFromType(
 
73
            int type,
 
74
            KHotKeys::SimpleActionData *data) const;
 
75
 
 
76
    QModelIndex _index;
 
77
    HotkeysTreeView *_view;
 
78
    };
 
79
 
 
80
 
 
81
 
 
82
#endif /* HOTKEYS_CONTEXT_MENU_H */
 
83