OSDN Git Service

It's 2011 now.
[qt-creator-jp/qt-creator-jp.git] / src / plugins / imageviewer / imagevieweractionhandler.h
1 /**************************************************************************
2 **
3 ** This file is part of Qt Creator
4 **
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
6 ** Copyright (c) 2010 Denis Mingulov.
7 **
8 ** Contact: Nokia Corporation (qt-info@nokia.com)
9 **
10 ** No Commercial Usage
11 **
12 ** This file contains pre-release code and may not be distributed.
13 ** You may use this file in accordance with the terms and conditions
14 ** contained in the Technology Preview License Agreement accompanying
15 ** this package.
16 **
17 ** GNU Lesser General Public License Usage
18 **
19 ** Alternatively, this file may be used under the terms of the GNU Lesser
20 ** General Public License version 2.1 as published by the Free Software
21 ** Foundation and appearing in the file LICENSE.LGPL included in the
22 ** packaging of this file.  Please review the following information to
23 ** ensure the GNU Lesser General Public License version 2.1 requirements
24 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25 **
26 ** In addition, as a special exception, Nokia gives you certain additional
27 ** rights.  These rights are described in the Nokia Qt LGPL Exception
28 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 **
30 ** If you have questions regarding the use of this file, please contact
31 ** Nokia at qt-info@nokia.com.
32 **
33 **************************************************************************/
34
35 #ifndef IMAGEVIEWERACTIONHANDLER_H
36 #define IMAGEVIEWERACTIONHANDLER_H
37
38 #include "coreplugin/icontext.h"
39
40 #include <QtCore/QObject>
41 #include <QtCore/QScopedPointer>
42
43 QT_BEGIN_NAMESPACE
44 class QAction;
45 class QKeySequence;
46 QT_END_NAMESPACE
47
48 namespace ImageViewer {
49 namespace Internal {
50
51 class ImageViewerActionHandler : public QObject
52 {
53     Q_OBJECT
54 public:
55     explicit ImageViewerActionHandler(QObject *parent = 0);
56     ~ImageViewerActionHandler();
57
58     void createActions();
59
60 signals:
61
62 public slots:
63     void actionTriggered(int supportedAction);
64
65 protected:
66     /*!
67       \brief Create a new action and register this action in the action manager.
68       \param actionId Action's internal id
69       \param id Command id
70       \param title Action's title
71       \param context Current context
72       \param key Key sequence for the command
73       \return Created and registered action, 0 if something goes wrong
74      */
75     QAction *registerNewAction(int actionId, const QString &id, const QString &title,
76                                const Core::Context &context, const QKeySequence &key);
77
78 private:
79     QScopedPointer<struct ImageViewerActionHandlerPrivate> d_ptr;
80 };
81
82 } // namespace Internal
83 } // namespace ImageViewer
84
85
86 #endif // IMAGEVIEWERACTIONHANDLER_H