2006-03-05 17:24:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2006-06-20 09:33:01 +00:00
|
|
|
* \file GuiView.h
|
2006-03-05 17:24:44 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Lars Gullik Bjornes
|
|
|
|
* \author John Levon
|
|
|
|
* \author Abdelrazak Younes
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
2006-06-26 16:55:35 +00:00
|
|
|
#ifndef GUI_VIEW_H
|
|
|
|
#define GUI_VIEW_H
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
// Must be here because of moc.
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include "frontends/LyXView.h"
|
|
|
|
#include "funcrequest.h"
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QTimer>
|
|
|
|
#include <QAction>
|
|
|
|
#include <QCloseEvent>
|
|
|
|
|
|
|
|
class QToolBar;
|
|
|
|
|
|
|
|
//class FuncRequest;
|
|
|
|
|
|
|
|
//class string;
|
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
|
|
|
class QCommandBuffer;
|
|
|
|
|
2006-06-04 20:49:09 +00:00
|
|
|
QWidget* mainWindow();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
/**
|
2006-06-20 09:33:01 +00:00
|
|
|
* GuiView - Qt4 implementation of LyXView
|
2006-03-05 17:24:44 +00:00
|
|
|
*
|
2006-06-26 16:55:35 +00:00
|
|
|
* qt4-private implementation of the main LyX window.
|
2006-03-05 17:24:44 +00:00
|
|
|
*/
|
2006-06-20 09:33:01 +00:00
|
|
|
class GuiView : public QMainWindow, public LyXView {
|
2006-03-05 17:24:44 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2006-06-26 16:55:35 +00:00
|
|
|
/// create a main window of the given dimensions
|
|
|
|
GuiView(Gui & owner);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2006-06-20 09:33:01 +00:00
|
|
|
~GuiView();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2006-06-26 16:55:35 +00:00
|
|
|
/// initialize the object
|
|
|
|
virtual void init();
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
/// show - display the top-level window
|
|
|
|
void show();
|
|
|
|
|
|
|
|
/// show busy cursor
|
|
|
|
virtual void busy(bool) const;
|
|
|
|
|
2006-09-10 11:03:21 +00:00
|
|
|
Toolbars::ToolbarPtr makeToolbar(ToolbarBackend::Toolbar const & tbb);
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
/// display a status message
|
2006-09-11 08:54:10 +00:00
|
|
|
virtual void message(lyx::docstring const & str);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
/// clear status message
|
|
|
|
virtual void clearMessage();
|
|
|
|
|
2006-07-13 16:37:55 +00:00
|
|
|
/// update the status bar
|
|
|
|
virtual void updateStatusBar();
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
/// add the command buffer
|
|
|
|
void addCommandBuffer(QToolBar * toolbar);
|
|
|
|
|
|
|
|
/// menu item has been selected
|
|
|
|
void activated(FuncRequest const &);
|
|
|
|
|
2006-06-26 16:55:35 +00:00
|
|
|
/// returns true if this view has the focus.
|
2006-03-05 17:24:44 +00:00
|
|
|
virtual bool hasFocus() const;
|
|
|
|
|
2006-06-30 14:37:33 +00:00
|
|
|
public Q_SLOTS:
|
2006-03-05 17:24:44 +00:00
|
|
|
/// idle timeout
|
|
|
|
void update_view_state_qt();
|
|
|
|
|
|
|
|
/// populate a toplevel menu and all its children on demand
|
|
|
|
void updateMenu(QAction *);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
/// make sure we quit cleanly
|
|
|
|
virtual void closeEvent(QCloseEvent * e);
|
2006-06-21 10:30:32 +00:00
|
|
|
|
|
|
|
///
|
|
|
|
virtual void resizeEvent(QResizeEvent * e);
|
|
|
|
|
|
|
|
///
|
|
|
|
virtual void moveEvent(QMoveEvent * e);
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
private:
|
|
|
|
/// focus the command buffer widget
|
|
|
|
void focus_command_widget();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* setWindowTitle - set title of window
|
|
|
|
* @param t main window title
|
|
|
|
* @param it iconified (short) title
|
|
|
|
*/
|
2006-09-11 08:54:10 +00:00
|
|
|
virtual void setWindowTitle(lyx::docstring const & t, lyx::docstring const & it);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
QTimer statusbar_timer_;
|
|
|
|
|
|
|
|
/// command buffer
|
|
|
|
QCommandBuffer * commandbuffer_;
|
2006-06-04 20:49:09 +00:00
|
|
|
|
2006-06-21 10:30:32 +00:00
|
|
|
///
|
|
|
|
void updateFloatingGeometry();
|
|
|
|
///
|
|
|
|
QRect floatingGeometry_;
|
2006-03-05 17:24:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
2006-06-20 09:33:01 +00:00
|
|
|
#endif // GUIVIEW_H
|