lyx_mirror/src/frontends/qt4/GuiImplementation.h
Abdelrazak Younes f4857dab04 new LFUN_WINDOW_CLOSE
* LyXFunc:
  - dispatch(): transfer assertion on lyx_view_ to each LFUN on a case by case basis.
  - dispatch(): new LFUN_WINDOW_CLOSE
  - getStatus(): special treatment for LFUN_LYX_QUIT

* LyX:
  - views_, addLyXView(): deleted
  - quit(): call saveGeometry() on each LyXView before exiting.

* GuiApplication:
  - is now a QObject.
  - quitLyX(): new Qt slot for lastWindowClosed signal.

* Gui.h:
  - destroyView(), destroyWorkArea(): deleted
  - viewIds(): new method

* GuiImplementation:
  - implement above changes.
  - GuiImplementation is now a QObject
  - cleanupViews(): new private slot.
  - buildViewIds(): new helper method
  - views_ and work_areas_ are now maps of raw pointers instead of schared_ptr.

* LyXView
  - now stores its id.
  - dispatch(): special treatment for LFUN_WINDOW_CLOSE.
  - workAreaIds(): new method.
  - close(): new pure virtual method.
  - saveGeometry(): new pure virtual method.

* GuiView:
  - implements above changes.
  - GuiView(): set WA_DeleteOnClose and Qt::WA_QuitOnClose to let Qt manage the destruction on close().
  - closeEvent(): session stuff transfered to saveGeometry()

* WorkArea
  - now store its id.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15514 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-23 16:29:24 +00:00

78 lines
1.4 KiB
C++

// -*- C++ -*-
/**
* \file GuiImplementation.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author John Levon
* \author Abdelrazak Younes
*
* Full author contact details are available in file CREDITS.
*/
#ifndef GUI_H
#define GUI_H
#include "frontends/Gui.h"
#include <QObject>
#include <map>
class LyXView;
namespace lyx {
namespace frontend {
class GuiWorkArea;
class GuiView;
/**
* The GuiImplementation class is the interface to all Qt4 components.
*/
class GuiImplementation: public QObject, public Gui
{
Q_OBJECT
public:
GuiImplementation();
virtual ~GuiImplementation() {}
int newView();
LyXView& view(int id);
int newWorkArea(unsigned int width, unsigned int height, int view_id);
WorkArea& workArea(int id);
private Q_SLOTS:
///
void cleanupViews(QObject * view);
private:
///
void buildViewIds();
/// Multiple views container.
/**
* Warning: This must not be a smart pointer as the destruction of the
* object is handled by Qt when the view is closed
* \sa Qt::WA_DeleteOnClose attribute.
*/
std::map<int, GuiView *> views_;
/// Multiple workareas container.
/**
* Warning: This must not be a smart pointer as the destruction of the
* object is handled by Qt when its parent view is closed.
*/
std::map<int, GuiWorkArea *> work_areas_;
///
size_t max_view_id_;
///
size_t max_wa_id_;
};
} // namespace frontend
} // namespace lyx
#endif // GUI_H