1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
16 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25 ** In addition, as a special exception, Nokia gives you certain additional
26 ** rights. These rights are described in the Nokia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 ** If you have questions regarding the use of this file, please contact
30 ** Nokia at qt-info@nokia.com.
32 **************************************************************************/
34 #ifndef BINEDITORPLUGIN_H
35 #define BINEDITORPLUGIN_H
37 #include <extensionsystem/iplugin.h>
38 #include <coreplugin/editormanager/ieditorfactory.h>
39 #include <coreplugin/icontext.h>
41 #include <QtCore/QtPlugin>
42 #include <QtCore/QPointer>
43 #include <QtCore/QStringList>
44 #include <QtGui/QAction>
49 class BinEditorFactory;
52 class BinEditorPlugin : public ExtensionSystem::IPlugin
60 bool initialize(const QStringList &arguments, QString *error_message = 0);
61 void extensionsInitialized();
63 // Connect editor to settings changed signals.
64 void initializeEditor(BinEditor *editor);
70 void selectAllAction();
73 void updateCurrentEditor(Core::IContext *object);
76 Core::Context m_context;
77 QAction *registerNewAction(const QString &id, const QString &title = QString());
78 QAction *registerNewAction(const QString &id, QObject *receiver, const char *slot,
79 const QString &title = QString());
80 QAction *m_undoAction;
81 QAction *m_redoAction;
82 QAction *m_copyAction;
83 QAction *m_selectAllAction;
85 friend class BinEditorFactory;
86 Core::IEditor *createEditor(QWidget *parent);
88 BinEditorFactory *m_factory;
89 QPointer<BinEditor> m_currentEditor;
92 class BinEditorFactory : public Core::IEditorFactory
97 explicit BinEditorFactory(BinEditorPlugin *owner);
99 virtual QStringList mimeTypes() const;
101 Core::IEditor *createEditor(QWidget *parent);
103 QString displayName() const;
104 Core::IFile *open(const QString &fileName);
107 const QStringList m_mimeTypes;
108 BinEditorPlugin *m_owner;
111 } // namespace Internal
112 } // namespace BINEditor
114 #endif // BINEDITORPLUGIN_H