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
|
2006-11-29 10:04:35 +00:00
|
|
|
|
* \author Peter K<EFBFBD>mmel
|
2006-03-05 17:24:44 +00:00
|
|
|
|
*
|
|
|
|
|
* 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;
|
2006-11-08 23:10:46 +00:00
|
|
|
|
class QMenu;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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-10-24 15:01:07 +00:00
|
|
|
|
*
|
|
|
|
|
* Note: any QObject emits a destroyed(QObject *) Qt signal when it
|
|
|
|
|
* is deleted.This might be useful for closing other dialogs
|
|
|
|
|
* depending on a given GuiView.
|
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
|
2006-10-23 16:29:24 +00:00
|
|
|
|
GuiView(int id);
|
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
|
|
|
|
virtual void init();
|
2006-10-23 16:29:24 +00:00
|
|
|
|
virtual void close();
|
2006-09-29 23:10:17 +00:00
|
|
|
|
virtual void setGeometry(
|
|
|
|
|
unsigned int width,
|
|
|
|
|
unsigned int height,
|
|
|
|
|
int posx, int posy,
|
2006-11-27 23:35:43 +00:00
|
|
|
|
bool maximize,
|
2006-11-29 16:45:38 +00:00
|
|
|
|
unsigned int iconSizeXY,
|
|
|
|
|
const std::string & geometryArg);
|
2006-10-23 16:29:24 +00:00
|
|
|
|
virtual void saveGeometry();
|
2006-10-26 13:29:10 +00:00
|
|
|
|
virtual void busy(bool);
|
2006-09-10 11:03:21 +00:00
|
|
|
|
Toolbars::ToolbarPtr makeToolbar(ToolbarBackend::Toolbar const & tbb);
|
2006-10-23 16:29:24 +00:00
|
|
|
|
virtual void updateStatusBar();
|
2006-09-11 08:54:10 +00:00
|
|
|
|
virtual void message(lyx::docstring const & str);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
virtual void clearMessage();
|
2006-10-23 16:29:24 +00:00
|
|
|
|
virtual bool hasFocus() const;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2006-10-31 14:12:46 +00:00
|
|
|
|
virtual void updateTab();
|
|
|
|
|
|
2006-10-23 16:29:24 +00:00
|
|
|
|
/// show - display the top-level window
|
|
|
|
|
void show();
|
2006-07-13 16:37:55 +00:00
|
|
|
|
|
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-10-31 14:12:46 +00:00
|
|
|
|
void initTab(QWidget* workArea);
|
2006-10-23 16:29:24 +00:00
|
|
|
|
|
2006-11-08 23:10:46 +00:00
|
|
|
|
QMenu* createPopupMenu();
|
|
|
|
|
|
2006-10-23 16:29:24 +00:00
|
|
|
|
Q_SIGNALS:
|
|
|
|
|
void closing(int);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
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 *);
|
|
|
|
|
|
2006-10-31 14:12:46 +00:00
|
|
|
|
void currentTabChanged (int index);
|
|
|
|
|
|
2006-11-29 10:04:35 +00:00
|
|
|
|
/// slots to change the icon size
|
|
|
|
|
void smallSizedIcons();
|
|
|
|
|
void normalSizedIcons();
|
|
|
|
|
void bigSizedIcons();
|
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
|
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-10-31 14:12:46 +00:00
|
|
|
|
|
2006-11-29 10:04:35 +00:00
|
|
|
|
void setIconSize(unsigned int size);
|
|
|
|
|
|
2006-10-31 14:12:46 +00:00
|
|
|
|
struct GuiViewPrivate;
|
|
|
|
|
GuiViewPrivate& d;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
2006-06-20 09:33:01 +00:00
|
|
|
|
#endif // GUIVIEW_H
|