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 "GuiView.h"
|
|
|
|
|
|
|
|
#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
|
|
|
{
|
|
|
|
public:
|
|
|
|
DockView(
|
2007-11-05 13:52:37 +00:00
|
|
|
GuiView & parent, ///< the main window where to dock.
|
2007-09-08 16:31:28 +00:00
|
|
|
std::string const & name, ///< dialog identifier.
|
2007-05-29 11:38:28 +00:00
|
|
|
Qt::DockWidgetArea area = Qt::LeftDockWidgetArea, ///< Position of the dock (and also drawer)
|
|
|
|
Qt::WindowFlags flags = 0
|
2007-09-10 22:32:59 +00:00
|
|
|
)
|
2007-11-23 10:45:14 +00:00
|
|
|
: QDockWidget(&parent, flags), Dialog(parent, name)
|
2007-03-12 14:23:44 +00:00
|
|
|
{
|
2007-05-29 11:38:28 +00:00
|
|
|
if (flags & Qt::Drawer)
|
|
|
|
setFeatures(QDockWidget::NoDockWidgetFeatures);
|
2007-09-08 16:04:25 +00:00
|
|
|
parent.addDockWidget(area, this);
|
2007-03-12 14:23:44 +00:00
|
|
|
}
|
2007-10-08 20:14:58 +00:00
|
|
|
|
|
|
|
virtual ~DockView() {}
|
2007-03-12 14:23:44 +00:00
|
|
|
|
2007-12-09 22:35:04 +00:00
|
|
|
virtual QWidget * asQWidget() { return this; }
|
|
|
|
virtual QWidget const * asQWidget() const { return this; }
|
|
|
|
|
2007-09-08 16:04:25 +00:00
|
|
|
/// Dialog inherited methods
|
2007-03-12 14:23:44 +00:00
|
|
|
//@{
|
2007-09-03 20:28:26 +00:00
|
|
|
void applyView() {}
|
2007-09-10 22:32:59 +00:00
|
|
|
bool isClosing() const { return false; }
|
2007-03-12 14:23:44 +00:00
|
|
|
//@}
|
|
|
|
};
|
|
|
|
|
|
|
|
} // frontend
|
|
|
|
} // lyx
|
|
|
|
|
2007-09-08 16:04:25 +00:00
|
|
|
#endif // DOCK_VIEW_H
|