2013-05-07 14:02:08 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** Copyright (C) 2015 The Qt Company Ltd.
|
|
|
|
|
** Contact: http://www.qt.io/licensing
|
2013-05-07 14:02:08 +02:00
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2015-01-14 18:07:15 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms and
|
|
|
|
|
** conditions see http://www.qt.io/terms-conditions. For further information
|
2014-10-01 13:21:18 +02:00
|
|
|
** use the contact form at http://www.qt.io/contact-us.
|
2013-05-07 14:02:08 +02:00
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
2014-10-01 13:21:18 +02:00
|
|
|
** General Public License version 2.1 or version 3 as published by the Free
|
|
|
|
|
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
|
|
|
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
|
|
|
** following information to ensure the GNU Lesser General Public License
|
|
|
|
|
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2013-05-07 14:02:08 +02:00
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** In addition, as a special exception, The Qt Company gives you certain additional
|
|
|
|
|
** rights. These rights are described in The Qt Company LGPL Exception
|
2013-05-07 14:02:08 +02:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
2013-06-17 13:55:31 +02:00
|
|
|
#ifndef DIFFEDITOR_H
|
|
|
|
|
#define DIFFEDITOR_H
|
2013-05-07 14:02:08 +02:00
|
|
|
|
|
|
|
|
#include "diffeditor_global.h"
|
2013-12-16 16:19:40 +01:00
|
|
|
#include "diffeditorcontroller.h"
|
2013-05-07 14:02:08 +02:00
|
|
|
|
|
|
|
|
#include <coreplugin/editormanager/ieditor.h>
|
|
|
|
|
#include <coreplugin/idocument.h>
|
|
|
|
|
|
2013-05-23 13:36:27 +02:00
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QComboBox;
|
2014-02-13 16:43:28 +01:00
|
|
|
class QToolBar;
|
2014-01-30 17:04:54 +01:00
|
|
|
class QToolButton;
|
2014-02-13 16:43:28 +01:00
|
|
|
class QStackedWidget;
|
2013-05-23 13:36:27 +02:00
|
|
|
QT_END_NAMESPACE
|
2013-05-07 14:02:08 +02:00
|
|
|
|
2014-09-26 11:37:54 +02:00
|
|
|
namespace TextEditor { class TextEditorWidget; }
|
2014-01-30 17:04:54 +01:00
|
|
|
|
2013-05-07 14:02:08 +02:00
|
|
|
namespace DiffEditor {
|
|
|
|
|
|
2015-01-30 14:33:39 +01:00
|
|
|
namespace Internal {
|
|
|
|
|
class DescriptionEditorWidget;
|
2014-02-11 13:00:35 +01:00
|
|
|
class DiffEditorDocument;
|
2015-01-30 14:33:39 +01:00
|
|
|
} // namespace Internal
|
|
|
|
|
|
2014-02-24 11:10:17 +01:00
|
|
|
class DiffEditorGuiController;
|
2014-02-11 13:00:35 +01:00
|
|
|
class SideBySideDiffEditorWidget;
|
2014-02-13 16:43:28 +01:00
|
|
|
class UnifiedDiffEditorWidget;
|
2013-05-07 14:02:08 +02:00
|
|
|
|
2013-05-30 12:15:22 +02:00
|
|
|
class DIFFEDITOR_EXPORT DiffEditor : public Core::IEditor
|
2013-05-07 14:02:08 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2014-08-21 21:12:04 +02:00
|
|
|
|
2013-05-07 14:02:08 +02:00
|
|
|
public:
|
2015-01-30 14:33:39 +01:00
|
|
|
DiffEditor(const QSharedPointer<Internal::DiffEditorDocument> &doc);
|
2014-08-21 21:12:04 +02:00
|
|
|
~DiffEditor();
|
2013-05-07 14:02:08 +02:00
|
|
|
|
|
|
|
|
public:
|
2014-02-11 13:00:35 +01:00
|
|
|
DiffEditorController *controller() const;
|
2013-05-23 13:36:27 +02:00
|
|
|
|
2014-01-31 09:01:49 +01:00
|
|
|
Core::IEditor *duplicate();
|
|
|
|
|
|
2014-02-13 16:43:28 +01:00
|
|
|
bool open(QString *errorString,
|
|
|
|
|
const QString &fileName,
|
|
|
|
|
const QString &realFileName);
|
2013-05-07 14:02:08 +02:00
|
|
|
Core::IDocument *document();
|
|
|
|
|
|
|
|
|
|
QWidget *toolBar();
|
|
|
|
|
|
2013-05-23 13:36:27 +02:00
|
|
|
public slots:
|
|
|
|
|
void activateEntry(int index);
|
|
|
|
|
|
|
|
|
|
private slots:
|
2014-02-11 13:00:35 +01:00
|
|
|
void slotCleared(const QString &message);
|
2014-02-13 16:43:28 +01:00
|
|
|
void slotDiffFilesChanged(const QList<FileData> &diffFileList,
|
|
|
|
|
const QString &workingDirectory);
|
2013-05-23 13:36:27 +02:00
|
|
|
void entryActivated(int index);
|
2014-01-30 17:04:54 +01:00
|
|
|
void slotDescriptionChanged(const QString &description);
|
|
|
|
|
void slotDescriptionVisibilityChanged();
|
2014-11-06 13:23:40 +01:00
|
|
|
void slotReloaderChanged();
|
2014-02-13 16:43:28 +01:00
|
|
|
void slotDiffEditorSwitched();
|
2013-05-07 14:02:08 +02:00
|
|
|
|
|
|
|
|
private:
|
2013-05-23 13:36:27 +02:00
|
|
|
void updateEntryToolTip();
|
2014-02-13 16:43:28 +01:00
|
|
|
void showDiffEditor(QWidget *newEditor);
|
|
|
|
|
void updateDiffEditorSwitcher();
|
|
|
|
|
QWidget *readLegacyCurrentDiffEditorSetting();
|
|
|
|
|
QWidget *readCurrentDiffEditorSetting();
|
|
|
|
|
void writeCurrentDiffEditorSetting(QWidget *currentEditor);
|
2013-05-23 13:36:27 +02:00
|
|
|
|
2015-01-30 14:33:39 +01:00
|
|
|
QSharedPointer<Internal::DiffEditorDocument> m_document;
|
2015-01-28 13:45:02 +01:00
|
|
|
Internal::DescriptionEditorWidget *m_descriptionWidget;
|
2014-02-13 16:43:28 +01:00
|
|
|
QStackedWidget *m_stackedWidget;
|
|
|
|
|
SideBySideDiffEditorWidget *m_sideBySideEditor;
|
|
|
|
|
UnifiedDiffEditorWidget *m_unifiedEditor;
|
|
|
|
|
QWidget *m_currentEditor;
|
2014-02-24 11:10:17 +01:00
|
|
|
DiffEditorGuiController *m_guiController;
|
2014-01-31 09:01:49 +01:00
|
|
|
QToolBar *m_toolBar;
|
2013-05-23 13:36:27 +02:00
|
|
|
QComboBox *m_entriesComboBox;
|
2014-10-24 14:11:12 +02:00
|
|
|
QAction *m_whitespaceButtonAction;
|
|
|
|
|
QAction *m_contextLabelAction;
|
|
|
|
|
QAction *m_contextSpinBoxAction;
|
2014-01-30 17:04:54 +01:00
|
|
|
QAction *m_toggleDescriptionAction;
|
2014-07-04 13:55:51 +02:00
|
|
|
QAction *m_reloadAction;
|
2014-02-13 16:43:28 +01:00
|
|
|
QToolButton *m_diffEditorSwitcher;
|
2013-05-07 14:02:08 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace DiffEditor
|
|
|
|
|
|
2013-06-17 13:55:31 +02:00
|
|
|
#endif // DIFFEDITOR_H
|