basemode.h 2.5 KB
Newer Older
1
/**************************************************************************
con's avatar
con committed
2
3
4
**
** This file is part of Qt Creator
**
hjk's avatar
hjk committed
5
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
con's avatar
con committed
6
**
7
** Contact: Nokia Corporation (qt-info@nokia.com)
con's avatar
con committed
8
**
9
** Commercial Usage
10
**
11
12
13
14
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
15
**
16
** GNU Lesser General Public License Usage
17
**
18
19
20
21
22
23
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24
**
25
** If you are unsure which license is appropriate for your use, please
hjk's avatar
hjk committed
26
** contact the sales department at http://qt.nokia.com/contact.
con's avatar
con committed
27
**
28
**************************************************************************/
hjk's avatar
hjk committed
29

con's avatar
con committed
30
31
32
33
34
35
36
#ifndef BASEMODE_H
#define BASEMODE_H

#include "core_global.h"
#include "imode.h"

#include <QtCore/QObject>
37

38
#include <QtGui/QIcon>
con's avatar
con committed
39

40
41
42
43
QT_BEGIN_NAMESPACE
class QWidget;
QT_END_NAMESPACE

con's avatar
con committed
44
45
46
47
48
49
50
51
52
53
54
55
namespace Core {

class CORE_EXPORT BaseMode
  : public IMode
{
    Q_OBJECT

public:
    BaseMode(QObject *parent = 0);
    ~BaseMode();

    // IMode
56
    QString displayName() const { return m_displayName; }
con's avatar
con committed
57
58
59
    QIcon icon() const { return m_icon; }
    int priority() const { return m_priority; }
    QWidget *widget() { return m_widget; }
60
    QString id() const { return m_id; }
con's avatar
con committed
61
    QList<int> context() const { return m_context; }
Daniel Molkentin's avatar
Daniel Molkentin committed
62
    QString contextHelpId() const { return m_helpId; }
con's avatar
con committed
63

64
    void setDisplayName(const QString &name) { m_displayName = name; }
con's avatar
con committed
65
66
67
    void setIcon(const QIcon &icon) { m_icon = icon; }
    void setPriority(int priority) { m_priority = priority; }
    void setWidget(QWidget *widget) { m_widget = widget; }
68
    void setId(const QString &id) { m_id = id; }
Daniel Molkentin's avatar
Daniel Molkentin committed
69
    void setContextHelpId(const QString &helpId) { m_helpId = helpId; }
con's avatar
con committed
70
71
72
    void setContext(const QList<int> &context) { m_context = context; }

private:
73
    QString m_displayName;
con's avatar
con committed
74
75
76
    QIcon m_icon;
    int m_priority;
    QWidget *m_widget;
77
    QString m_id;
Daniel Molkentin's avatar
Daniel Molkentin committed
78
    QString m_helpId;
con's avatar
con committed
79
80
81
82
83
84
    QList<int> m_context;
};

} // namespace Core

#endif // BASEMODE_H