Rename GuiViewBase to GuiView.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21436 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-11-05 13:52:37 +00:00
parent c1afc30a8a
commit ff189f6c70
21 changed files with 90 additions and 90 deletions

View File

@ -27,7 +27,7 @@ namespace lyx {
namespace frontend {
Action::Action(GuiViewBase & lyxView, QIcon const & icon,
Action::Action(GuiView & lyxView, QIcon const & icon,
QString const & text, FuncRequest const & func,
QString const & tooltip)
: QAction(&lyxView), func_(func), lyxView_(lyxView)

View File

@ -22,7 +22,7 @@ class FuncRequest;
namespace frontend {
class GuiViewBase;
class GuiView;
/**
* Action - Qt interface with LyX' FuncRequest.
@ -34,7 +34,7 @@ class Action : public QAction
Q_OBJECT
public:
Action(GuiViewBase & lyxView, QIcon const & icon, QString const & text,
Action(GuiView & lyxView, QIcon const & icon, QString const & text,
FuncRequest const & func, QString const & tooltip);
void update();
@ -48,7 +48,7 @@ private Q_SLOTS:
private:
FuncRequest const & func_ ;
GuiViewBase & lyxView_;
GuiView & lyxView_;
};

View File

@ -36,7 +36,7 @@ class DialogView : public QDialog, public Dialog
{
public:
DialogView(
GuiViewBase & parent, ///< the main window where to dock.
GuiView & parent, ///< the main window where to dock.
std::string const & name, ///< dialog identifier.
bool modal = false, ///< Window modality.
Qt::WindowFlags flags = 0

View File

@ -29,7 +29,7 @@ class DockView : public QDockWidget, public Dialog
{
public:
DockView(
GuiViewBase & parent, ///< the main window where to dock.
GuiView & parent, ///< the main window where to dock.
std::string const & name, ///< dialog identifier.
Qt::DockWidgetArea area = Qt::LeftDockWidgetArea, ///< Position of the dock (and also drawer)
Qt::WindowFlags flags = 0

View File

@ -88,7 +88,7 @@ protected:
} // end of anon
GuiCommandBuffer::GuiCommandBuffer(GuiViewBase * view)
GuiCommandBuffer::GuiCommandBuffer(GuiView * view)
: view_(view), lv_(*view), history_pos_(history_.end())
{
transform(lyxaction.func_begin(), lyxaction.func_end(),

View File

@ -26,7 +26,7 @@ namespace lyx {
namespace frontend {
class LyXView;
class GuiViewBase;
class GuiView;
class GuiCommandEdit;
class GuiCommandBuffer : public QWidget
@ -34,7 +34,7 @@ class GuiCommandBuffer : public QWidget
Q_OBJECT
public:
GuiCommandBuffer(GuiViewBase * view);
GuiCommandBuffer(GuiView * view);
public Q_SLOTS:
/// cancel command compose
@ -53,7 +53,7 @@ public Q_SLOTS:
void hideParent();
private:
/// owning view
GuiViewBase * view_;
GuiView * view_;
///
LyXView & lv_;
/// command widget

View File

@ -48,7 +48,7 @@ LyXView& GuiImplementation::createRegisteredView()
int id = 0;
while (views_.find(id) != views_.end())
id++;
views_.insert(std::pair<int, GuiViewBase *>(id, new GuiViewBase(id)));
views_.insert(std::pair<int, GuiView *>(id, new GuiView(id)));
updateIds(views_, view_ids_);
return *views_[id];
}
@ -60,7 +60,7 @@ bool GuiImplementation::unregisterView(int id)
BOOST_ASSERT(views_.find(id) != views_.end());
BOOST_ASSERT(views_[id]);
std::map<int, GuiViewBase *>::iterator it;
std::map<int, GuiView *>::iterator it;
for (it = views_.begin(); it != views_.end(); ++it) {
if (it->first == id) {
views_.erase(id);
@ -82,8 +82,8 @@ bool GuiImplementation::closeAllViews()
return true;
}
std::map<int, GuiViewBase*> const cmap = views_;
std::map<int, GuiViewBase*>::const_iterator it;
std::map<int, GuiView*> const cmap = views_;
std::map<int, GuiView*>::const_iterator it;
for (it = cmap.begin(); it != cmap.end(); ++it)
{
// TODO: return false when close event was ignored

View File

@ -22,7 +22,7 @@
namespace lyx {
namespace frontend {
class GuiViewBase;
class GuiView;
class LyXView;
/**
@ -50,7 +50,7 @@ private:
* object is handled by Qt when the view is closed
* \sa Qt::WA_DeleteOnClose attribute.
*/
std::map<int, GuiViewBase *> views_;
std::map<int, GuiView *> views_;
};
} // namespace frontend

View File

@ -38,7 +38,7 @@ namespace frontend {
// MacOSX specific stuff is at the end.
GuiMenubar::GuiMenubar(LyXView * view, MenuBackend & mbe)
: owner_(static_cast<GuiViewBase*>(view)), menubackend_(mbe)
: owner_(static_cast<GuiView*>(view)), menubackend_(mbe)
{
macxMenuBarInit();

View File

@ -24,7 +24,7 @@ class MenuBackend;
namespace frontend {
class GuiViewBase;
class GuiView;
class GuiPopupMenu;
class LyXView;
@ -40,7 +40,7 @@ public:
void openByName(QString const & name);
/// return the owning view
GuiViewBase * view() { return owner_; }
GuiView * view() { return owner_; }
/// return the menu controller
MenuBackend const & backend() { return menubackend_; }
@ -56,7 +56,7 @@ private:
void macxMenuBarInit();
/// owning view
GuiViewBase * owner_;
GuiView * owner_;
/// menu controller
MenuBackend & menubackend_;

View File

@ -332,7 +332,7 @@ LyXAlignment GuiParagraph::alignDefault() const
Dialog * createGuiParagraph(LyXView & lv)
{
#if 0
GuiViewBase & guiview = static_cast<GuiViewBase &>(lv);
GuiView & guiview = static_cast<GuiView &>(lv);
#ifdef USE_DOCK_WIDGET
return new DockView<ControlParagraph, GuiParagraph>(guiview, "paragraph",
Qt::TopDockWidgetArea);

View File

@ -43,7 +43,7 @@ using std::string;
namespace lyx {
namespace frontend {
GuiToc::GuiToc(GuiViewBase & parent, Qt::DockWidgetArea area, Qt::WindowFlags flags)
GuiToc::GuiToc(GuiView & parent, Qt::DockWidgetArea area, Qt::WindowFlags flags)
: DockView(parent, "toc", area, flags), params_(TOC_CODE)
{
widget_ = new TocWidget(*this);
@ -236,7 +236,7 @@ void GuiToc::dispatchParams()
Dialog * createGuiToc(LyXView & lv)
{
GuiViewBase & guiview = static_cast<GuiViewBase &>(lv);
GuiView & guiview = static_cast<GuiView &>(lv);
#ifdef Q_WS_MACX
// On Mac show as a drawer at the right
return new GuiToc(guiview, Qt::RightDockWidgetArea, Qt::Drawer);

View File

@ -40,7 +40,7 @@ class GuiToc : public DockView
public:
///
GuiToc(
GuiViewBase & parent, ///< the main window where to dock.
GuiView & parent, ///< the main window where to dock.
Qt::DockWidgetArea area = Qt::LeftDockWidgetArea, ///< Position of the dock (and also drawer)
Qt::WindowFlags flags = 0);

View File

@ -238,7 +238,7 @@ static TextClass const & textClass(LyXView const & lv)
//
/////////////////////////////////////////////////////////////////////
GuiLayoutBox::GuiLayoutBox(GuiViewBase & owner)
GuiLayoutBox::GuiLayoutBox(GuiView & owner)
: owner_(owner)
{
setSizeAdjustPolicy(QComboBox::AdjustToContents);
@ -324,7 +324,7 @@ void GuiLayoutBox::selected(const QString & str)
/////////////////////////////////////////////////////////////////////
GuiToolbar::GuiToolbar(ToolbarInfo const & tbinfo, GuiViewBase & owner)
GuiToolbar::GuiToolbar(ToolbarInfo const & tbinfo, GuiView & owner)
: QToolBar(qt_(tbinfo.gui_name), &owner), owner_(owner),
layout_(0), command_buffer_(0)
{

View File

@ -29,7 +29,7 @@ class ToolbarItem;
namespace frontend {
class GuiCommandBuffer;
class GuiViewBase;
class GuiView;
class Action;
@ -37,7 +37,7 @@ class GuiLayoutBox : public QComboBox
{
Q_OBJECT
public:
GuiLayoutBox(GuiViewBase &);
GuiLayoutBox(GuiView &);
/// select the right layout in the combobox.
void set(docstring const & layout);
@ -48,7 +48,7 @@ private Q_SLOTS:
void selected(const QString & str);
private:
GuiViewBase & owner_;
GuiView & owner_;
};
@ -56,7 +56,7 @@ class GuiToolbar : public QToolBar
{
Q_OBJECT
public:
GuiToolbar(ToolbarInfo const &, GuiViewBase &);
GuiToolbar(ToolbarInfo const &, GuiView &);
/// Add a button to the bar.
void add(ToolbarItem const & item);
@ -77,7 +77,7 @@ private:
Action * addItem(ToolbarItem const & item);
QList<Action *> actions_;
GuiViewBase & owner_;
GuiView & owner_;
GuiLayoutBox * layout_;
GuiCommandBuffer * command_buffer_;

View File

@ -40,7 +40,7 @@ namespace frontend {
#define TurnOnFlag(x) flags |= ToolbarInfo::x
#define TurnOffFlag(x) flags &= ~ToolbarInfo::x
GuiToolbars::GuiToolbars(GuiViewBase & owner)
GuiToolbars::GuiToolbars(GuiView & owner)
: owner_(owner),
layout_(0),
last_textclass_(TextClassPtr())

View File

@ -26,13 +26,13 @@ namespace frontend {
class GuiLayoutBox;
class GuiToolbar;
class GuiViewBase;
class GuiView;
class GuiToolbars
{
public:
///
GuiToolbars(GuiViewBase & owner);
GuiToolbars(GuiView & owner);
/// Initialize the toolbars using the backend database.
void init();
@ -88,7 +88,7 @@ private:
void initFlags(ToolbarInfo & tbinfo);
/// The parent window.
GuiViewBase & owner_;
GuiView & owner_;
/** The layout box is actually owned by whichever toolbar
* contains it. All the Toolbars class needs is a means of

View File

@ -124,7 +124,7 @@ private:
};
struct GuiViewBase::GuiViewPrivate
struct GuiView::GuiViewPrivate
{
string cur_title;
@ -149,7 +149,7 @@ struct GuiViewBase::GuiViewPrivate
// static needed by "New Window"
static unsigned int lastIconSize;
QMenu * toolBarPopup(GuiViewBase * parent)
QMenu * toolBarPopup(GuiView * parent)
{
// FIXME: translation
QMenu * menu = new QMenu(parent);
@ -204,10 +204,10 @@ struct GuiViewBase::GuiViewPrivate
};
unsigned int GuiViewBase::GuiViewPrivate::lastIconSize = 0;
unsigned int GuiView::GuiViewPrivate::lastIconSize = 0;
GuiViewBase::GuiViewBase(int id)
GuiView::GuiView(int id)
: QMainWindow(), LyXView(id), quitting_by_menu_(false),
d(*new GuiViewPrivate)
{
@ -247,7 +247,7 @@ GuiViewBase::GuiViewBase(int id)
}
GuiViewBase::~GuiViewBase()
GuiView::~GuiView()
{
delete d.menubar_;
delete d.toolbars_;
@ -255,7 +255,7 @@ GuiViewBase::~GuiViewBase()
}
void GuiViewBase::close()
void GuiView::close()
{
quitting_by_menu_ = true;
d.tab_widget_->closeAll();
@ -264,20 +264,20 @@ void GuiViewBase::close()
}
void GuiViewBase::setFocus()
void GuiView::setFocus()
{
if (d.tab_widget_->count())
d.tab_widget_->currentWidget()->setFocus();
}
QMenu* GuiViewBase::createPopupMenu()
QMenu* GuiView::createPopupMenu()
{
return d.toolBarPopup(this);
}
void GuiViewBase::init()
void GuiView::init()
{
// GuiToolbars *must* be initialised before GuiMenubar.
d.toolbars_ = new GuiToolbars(*this);
@ -297,7 +297,7 @@ void GuiViewBase::init()
}
void GuiViewBase::closeEvent(QCloseEvent * close_event)
void GuiView::closeEvent(QCloseEvent * close_event)
{
// we may have been called through the close window button
// which bypasses the LFUN machinery.
@ -332,7 +332,7 @@ void GuiViewBase::closeEvent(QCloseEvent * close_event)
}
void GuiViewBase::dragEnterEvent(QDragEnterEvent * event)
void GuiView::dragEnterEvent(QDragEnterEvent * event)
{
if (event->mimeData()->hasUrls())
event->accept();
@ -342,7 +342,7 @@ void GuiViewBase::dragEnterEvent(QDragEnterEvent * event)
}
void GuiViewBase::dropEvent(QDropEvent* event)
void GuiView::dropEvent(QDropEvent* event)
{
QList<QUrl> files = event->mimeData()->urls();
if (files.isEmpty())
@ -359,7 +359,7 @@ void GuiViewBase::dropEvent(QDropEvent* event)
}
void GuiViewBase::saveGeometry()
void GuiView::saveGeometry()
{
static bool done = false;
if (done)
@ -373,7 +373,7 @@ void GuiViewBase::saveGeometry()
// http://www.trolltech.com/developer/task-tracker/index_html?id=119684+&method=entry
// Then also the moveEvent, resizeEvent, and the
// code for floatingGeometry_ can be removed;
// adjust GuiViewBase::setGeometry()
// adjust GuiView::setGeometry()
QRect normal_geometry;
int maximized;
@ -424,7 +424,7 @@ void GuiViewBase::saveGeometry()
}
void GuiViewBase::setGeometry(unsigned int width,
void GuiView::setGeometry(unsigned int width,
unsigned int height,
int posx, int posy,
int maximized,
@ -534,7 +534,7 @@ void GuiViewBase::setGeometry(unsigned int width,
}
void GuiViewBase::setWindowTitle(docstring const & t, docstring const & it)
void GuiView::setWindowTitle(docstring const & t, docstring const & it)
{
QString title = windowTitle();
QString new_title = toqstr(t);
@ -548,7 +548,7 @@ void GuiViewBase::setWindowTitle(docstring const & t, docstring const & it)
}
void GuiViewBase::message(docstring const & str)
void GuiView::message(docstring const & str)
{
statusBar()->showMessage(toqstr(str));
statusbar_timer_.stop();
@ -556,38 +556,38 @@ void GuiViewBase::message(docstring const & str)
}
void GuiViewBase::clearMessage()
void GuiView::clearMessage()
{
update_view_state_qt();
}
void GuiViewBase::setIconSize(unsigned int size)
void GuiView::setIconSize(unsigned int size)
{
d.lastIconSize = size;
QMainWindow::setIconSize(QSize(size, size));
}
void GuiViewBase::smallSizedIcons()
void GuiView::smallSizedIcons()
{
setIconSize(d.smallIconSize);
}
void GuiViewBase::normalSizedIcons()
void GuiView::normalSizedIcons()
{
setIconSize(d.normalIconSize);
}
void GuiViewBase::bigSizedIcons()
void GuiView::bigSizedIcons()
{
setIconSize(d.bigIconSize);
}
void GuiViewBase::update_view_state_qt()
void GuiView::update_view_state_qt()
{
if (!hasFocus())
return;
@ -597,7 +597,7 @@ void GuiViewBase::update_view_state_qt()
}
void GuiViewBase::on_currentWorkAreaChanged(GuiWorkArea * wa)
void GuiView::on_currentWorkAreaChanged(GuiWorkArea * wa)
{
disconnectBuffer();
disconnectBufferView();
@ -616,7 +616,7 @@ void GuiViewBase::on_currentWorkAreaChanged(GuiWorkArea * wa)
}
void GuiViewBase::updateStatusBar()
void GuiView::updateStatusBar()
{
// let the user see the explicit message
if (statusbar_timer_.isActive())
@ -626,19 +626,19 @@ void GuiViewBase::updateStatusBar()
}
void GuiViewBase::activated(FuncRequest const & func)
void GuiView::activated(FuncRequest const & func)
{
dispatch(func);
}
bool GuiViewBase::hasFocus() const
bool GuiView::hasFocus() const
{
return qApp->activeWindow() == this;
}
QRect GuiViewBase::updateFloatingGeometry()
QRect GuiView::updateFloatingGeometry()
{
QDesktopWidget& dw = *qApp->desktop();
QRect desk = dw.availableGeometry(dw.primaryScreen());
@ -650,19 +650,19 @@ QRect GuiViewBase::updateFloatingGeometry()
}
void GuiViewBase::resizeEvent(QResizeEvent *)
void GuiView::resizeEvent(QResizeEvent *)
{
updateFloatingGeometry();
}
void GuiViewBase::moveEvent(QMoveEvent *)
void GuiView::moveEvent(QMoveEvent *)
{
updateFloatingGeometry();
}
bool GuiViewBase::event(QEvent * e)
bool GuiView::event(QEvent * e)
{
switch (e->type())
{
@ -719,14 +719,14 @@ bool GuiViewBase::event(QEvent * e)
}
bool GuiViewBase::focusNextPrevChild(bool /*next*/)
bool GuiView::focusNextPrevChild(bool /*next*/)
{
setFocus();
return true;
}
void GuiViewBase::showView()
void GuiView::showView()
{
QMainWindow::setWindowTitle(qt_("LyX"));
QMainWindow::show();
@ -734,7 +734,7 @@ void GuiViewBase::showView()
}
void GuiViewBase::setBusy(bool yes)
void GuiView::setBusy(bool yes)
{
GuiWorkArea * wa = d.tab_widget_->currentWorkArea();
if (wa) {
@ -752,7 +752,7 @@ void GuiViewBase::setBusy(bool yes)
}
GuiToolbar * GuiViewBase::makeToolbar(ToolbarInfo const & tbinfo, bool newline)
GuiToolbar * GuiView::makeToolbar(ToolbarInfo const & tbinfo, bool newline)
{
GuiToolbar * toolBar = new GuiToolbar(tbinfo, *this);
@ -799,13 +799,13 @@ GuiToolbar * GuiViewBase::makeToolbar(ToolbarInfo const & tbinfo, bool newline)
}
WorkArea * GuiViewBase::workArea(Buffer & buffer)
WorkArea * GuiView::workArea(Buffer & buffer)
{
return d.tab_widget_->workArea(buffer);
}
WorkArea * GuiViewBase::addWorkArea(Buffer & buffer)
WorkArea * GuiView::addWorkArea(Buffer & buffer)
{
GuiWorkArea * wa = new GuiWorkArea(buffer, *this);
wa->setUpdatesEnabled(false);
@ -819,19 +819,19 @@ WorkArea * GuiViewBase::addWorkArea(Buffer & buffer)
}
WorkArea * GuiViewBase::currentWorkArea()
WorkArea * GuiView::currentWorkArea()
{
return d.tab_widget_->currentWorkArea();
}
WorkArea const * GuiViewBase::currentWorkArea() const
WorkArea const * GuiView::currentWorkArea() const
{
return d.tab_widget_->currentWorkArea();
}
void GuiViewBase::setCurrentWorkArea(WorkArea * work_area)
void GuiView::setCurrentWorkArea(WorkArea * work_area)
{
BOOST_ASSERT(work_area);
@ -845,7 +845,7 @@ void GuiViewBase::setCurrentWorkArea(WorkArea * work_area)
}
void GuiViewBase::removeWorkArea(WorkArea * work_area)
void GuiView::removeWorkArea(WorkArea * work_area)
{
BOOST_ASSERT(work_area);
if (work_area == currentWorkArea()) {
@ -869,25 +869,25 @@ void GuiViewBase::removeWorkArea(WorkArea * work_area)
}
void GuiViewBase::showMiniBuffer(bool visible)
void GuiView::showMiniBuffer(bool visible)
{
d.toolbars_->showCommandBuffer(visible);
}
void GuiViewBase::openMenu(docstring const & name)
void GuiView::openMenu(docstring const & name)
{
d.menubar_->openByName(toqstr(name));
}
void GuiViewBase::openLayoutList()
void GuiView::openLayoutList()
{
d.toolbars_->openLayoutList();
}
void GuiViewBase::updateLayoutChoice()
void GuiView::updateLayoutChoice()
{
// Don't show any layouts without a buffer
if (!buffer()) {
@ -910,12 +910,12 @@ void GuiViewBase::updateLayoutChoice()
}
bool GuiViewBase::isToolbarVisible(std::string const & id)
bool GuiView::isToolbarVisible(std::string const & id)
{
return d.toolbars_->visible(id);
}
void GuiViewBase::updateToolbars()
void GuiView::updateToolbars()
{
WorkArea * wa = currentWorkArea();
if (wa) {
@ -936,13 +936,13 @@ void GuiViewBase::updateToolbars()
}
ToolbarInfo * GuiViewBase::getToolbarInfo(string const & name)
ToolbarInfo * GuiView::getToolbarInfo(string const & name)
{
return d.toolbars_->getToolbarInfo(name);
}
void GuiViewBase::toggleToolbarState(string const & name, bool allowauto)
void GuiView::toggleToolbarState(string const & name, bool allowauto)
{
// it is possible to get current toolbar status like this,...
// but I decide to obey the order of ToolbarBackend::flags

View File

@ -46,14 +46,14 @@ QWidget * mainWindow();
* is deleted. This might be useful for closing other dialogs
* depending on a given GuiView.
*/
class GuiViewBase : public QMainWindow, public LyXView
class GuiView : public QMainWindow, public LyXView
{
Q_OBJECT
public:
/// create a main window of the given dimensions
GuiViewBase(int id);
GuiView(int id);
~GuiViewBase();
~GuiView();
virtual void init();
virtual void close();

View File

@ -88,7 +88,7 @@ void ViewSourceWidget::update(bool full_source)
}
GuiViewSource::GuiViewSource(GuiViewBase & parent, Qt::DockWidgetArea area, Qt::WindowFlags flags)
GuiViewSource::GuiViewSource(GuiView & parent, Qt::DockWidgetArea area, Qt::WindowFlags flags)
: DockView(parent, "view-source", area, flags)
{
widget_ = new ViewSourceWidget(*this);
@ -172,7 +172,7 @@ QString GuiViewSource::title() const
Dialog * createGuiViewSource(LyXView & lv)
{
return new GuiViewSource(static_cast<GuiViewBase &>(lv));
return new GuiViewSource(static_cast<GuiView &>(lv));
}

View File

@ -63,7 +63,7 @@ class GuiViewSource : public DockView
public:
GuiViewSource(
GuiViewBase & parent, ///< the main window where to dock.
GuiView & parent, ///< the main window where to dock.
Qt::DockWidgetArea area = Qt::BottomDockWidgetArea, ///< Position of the dock (and also drawer)
Qt::WindowFlags flags = 0);