2007-03-12 14:23:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file DockView.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Abdelrazak Younes
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DOCK_VIEW_H
|
|
|
|
#define DOCK_VIEW_H
|
|
|
|
|
2007-10-07 08:55:20 +00:00
|
|
|
#include "Dialog.h"
|
2007-09-08 16:04:25 +00:00
|
|
|
|
|
|
|
#include <QDockWidget>
|
2007-03-12 14:23:44 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
|
|
|
/// Dock Widget container for LyX dialogs.
|
2007-12-10 13:05:00 +00:00
|
|
|
/**
|
|
|
|
* This template class that encapsulates a given Widget inside a
|
|
|
|
* QDockWidget and presents a Dialog interface
|
|
|
|
* FIXME: create a DockView.cpp file
|
|
|
|
**/
|
2007-10-09 21:21:01 +00:00
|
|
|
class DockView : public QDockWidget, public Dialog
|
2007-03-12 14:23:44 +00:00
|
|
|
{
|
2016-09-28 21:33:44 +02:00
|
|
|
Q_OBJECT
|
|
|
|
|
2007-03-12 14:23:44 +00:00
|
|
|
public:
|
2016-09-28 21:33:44 +02:00
|
|
|
DockView(GuiView & parent, ///< the main window where to dock.
|
|
|
|
QString const & name, ///< dialog identifier.
|
|
|
|
QString const & title, ///< dialog title.
|
2021-02-13 15:22:26 +01:00
|
|
|
Qt::DockWidgetArea area = Qt::LeftDockWidgetArea, ///< Position of the dock
|
|
|
|
/// (and also drawer)
|
|
|
|
Qt::WindowFlags flags = {});
|
2007-10-08 20:14:58 +00:00
|
|
|
|
|
|
|
virtual ~DockView() {}
|
2007-03-12 14:23:44 +00:00
|
|
|
|
2020-10-01 10:42:11 +03:00
|
|
|
QWidget * asQWidget() override { return this; }
|
|
|
|
QWidget const * asQWidget() const override { return this; }
|
2007-12-09 22:35:04 +00:00
|
|
|
|
2008-10-03 13:34:10 +00:00
|
|
|
/// We don't want to restore geometry session for dock widgets.
|
2020-10-01 10:42:11 +03:00
|
|
|
void restoreSession() override {}
|
2008-10-03 13:34:10 +00:00
|
|
|
|
2020-10-03 15:42:14 +03:00
|
|
|
void keyPressEvent(QKeyEvent * ev) override;
|
2016-09-28 21:33:44 +02:00
|
|
|
|
2007-09-08 16:04:25 +00:00
|
|
|
/// Dialog inherited methods
|
2007-03-12 14:23:44 +00:00
|
|
|
//@{
|
2020-10-01 10:42:11 +03:00
|
|
|
void applyView() override {}
|
|
|
|
bool isClosing() const override { return false; }
|
|
|
|
bool needBufferOpen() const override { return false; }
|
2007-03-12 14:23:44 +00:00
|
|
|
//@}
|
2016-09-28 21:33:44 +02:00
|
|
|
|
|
|
|
protected Q_SLOTS:
|
2020-10-01 10:42:11 +03:00
|
|
|
void onBufferViewChanged() override {}
|
2007-03-12 14:23:44 +00:00
|
|
|
};
|
|
|
|
|
2017-07-23 13:11:54 +02:00
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
2007-03-12 14:23:44 +00:00
|
|
|
|
2007-09-08 16:04:25 +00:00
|
|
|
#endif // DOCK_VIEW_H
|