mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 13:46:43 +00:00
b7c9ae4931
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6351 a592a061-630c-0410-9148-cb99ea01b6c8
188 lines
4.4 KiB
C++
188 lines
4.4 KiB
C++
// -*- C++ -*-
|
|
/**
|
|
* \file Dialogs.h
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
* \author Allan Rae
|
|
*
|
|
* Full author contact details are available in file CREDITS
|
|
*/
|
|
|
|
#ifndef DIALOGS_H
|
|
#define DIALOGS_H
|
|
|
|
|
|
#include "LString.h"
|
|
|
|
#include <boost/utility.hpp>
|
|
#include <boost/scoped_ptr.hpp>
|
|
#include <boost/signals/signal0.hpp>
|
|
#include <boost/signals/signal1.hpp>
|
|
|
|
class Dialog;
|
|
class InsetBase;
|
|
class LyXView;
|
|
|
|
class InsetFloat;
|
|
class InsetWrap;
|
|
class InsetGraphics;
|
|
class InsetInclude;
|
|
class InsetInfo;
|
|
class InsetMinipage;
|
|
class Paragraph;
|
|
class InsetTabular;
|
|
|
|
/** Container of all dialogs and signals a LyXView needs or uses to access them
|
|
The list of dialog signals isn't comprehensive but should be a good guide
|
|
for any future additions. Remember don't go overboard -- think minimal.
|
|
*/
|
|
class Dialogs : boost::noncopyable
|
|
{
|
|
public:
|
|
///
|
|
Dialogs(LyXView &);
|
|
/// Define an empty d-tor out-of-line to keep boost::scoped_ptr happy.
|
|
~Dialogs();
|
|
|
|
/** Redraw all visible dialogs because, for example, the GUI colours
|
|
* have been re-mapped.
|
|
*
|
|
* Note that static boost signals break some compilers, so we return a
|
|
* reference to some hidden magic ;-)
|
|
*/
|
|
static boost::signal0<void> & redrawGUI();
|
|
|
|
/// Toggle tooltips on/off in all dialogs.
|
|
static void toggleTooltips();
|
|
|
|
/// Are the tooltips on or off?
|
|
static bool tooltipsEnabled();
|
|
|
|
/// Signals slated to go
|
|
//@{
|
|
boost::signal0<void> hideAllSignal;
|
|
boost::signal0<void> hideBufferDependentSignal;
|
|
boost::signal1<void, bool> updateBufferDependentSignal;
|
|
//@}
|
|
|
|
/// Hide all visible dialogs
|
|
void hideAll() const;
|
|
/// Hide any dialogs that require a buffer for them to operate
|
|
void hideBufferDependent() const;
|
|
/** Update visible, buffer-dependent dialogs
|
|
If the bool is true then a buffer change has occurred
|
|
else its still the same buffer.
|
|
*/
|
|
void updateBufferDependent(bool) const ;
|
|
|
|
/**@name Dialog Access Signals.
|
|
Put into some sort of alphabetical order */
|
|
//@{
|
|
///
|
|
void showAboutlyx();
|
|
///
|
|
void showCharacter();
|
|
/// connected to the character dialog also
|
|
void setUserFreeFont();
|
|
///
|
|
void showDocument();
|
|
/// show the contents of a file.
|
|
void showFile(string const &);
|
|
///
|
|
void showFloat(InsetFloat *);
|
|
///
|
|
void showWrap(InsetWrap *);
|
|
/// show all forked child processes
|
|
void showForks();
|
|
///
|
|
void showGraphics(InsetGraphics *);
|
|
/// show the details of a LyX file include inset
|
|
void showInclude(InsetInclude *);
|
|
/// show the LaTeX log or build file
|
|
void showLogFile();
|
|
/// display the top-level maths panel
|
|
void showMathPanel();
|
|
/// show the merge changes dialog
|
|
void showMergeChanges();
|
|
///
|
|
void showMinipage(InsetMinipage *);
|
|
///
|
|
void updateMinipage(InsetMinipage *);
|
|
///
|
|
void showParagraph();
|
|
///
|
|
void updateParagraph();
|
|
///
|
|
void showPreamble();
|
|
///
|
|
void showPreferences();
|
|
///
|
|
void showPrint();
|
|
///
|
|
void showSearch();
|
|
///
|
|
void showSendto();
|
|
/// bring up the spellchecker
|
|
void showSpellchecker();
|
|
///
|
|
void showTabular(InsetTabular *);
|
|
///
|
|
void updateTabular(InsetTabular *);
|
|
///
|
|
void showTabularCreate();
|
|
/// show the TexInfo
|
|
void showTexinfo();
|
|
/// show the thesaurus dialog
|
|
void showThesaurus(string const &);
|
|
/// show the version control log
|
|
void showVCLogFile();
|
|
//@}
|
|
|
|
/** name == "bibtex", "citation" etc
|
|
data is generated by the Inset::write method, to be read by the
|
|
Inset::read method in the frontends.
|
|
inset is stored. On a subsequent Apply from the frontends, the
|
|
stored inset will be modified. If no inset is stored, then a
|
|
new one will be created at the current cursor position.
|
|
*/
|
|
void show(string const & name, string const & data, InsetBase * inset);
|
|
/** name == "citation", "bibtex" etc.
|
|
Update the contents of the dialog.
|
|
*/
|
|
void update(string const & name, string const & data);
|
|
///
|
|
void Dialogs::hide(string const & name);
|
|
///
|
|
void disconnect(string const & name);
|
|
///
|
|
InsetBase * getOpenInset(string const & name) const;
|
|
private:
|
|
///
|
|
void redraw() const;
|
|
///
|
|
bool isValidName(string const & name) const;
|
|
///
|
|
Dialog * find(string const & name);
|
|
///
|
|
Dialog * build(string const & name);
|
|
|
|
///
|
|
LyXView & lyxview_;
|
|
///
|
|
std::map<string, InsetBase *> open_insets_;
|
|
|
|
///
|
|
typedef boost::shared_ptr<Dialog> DialogPtr;
|
|
///
|
|
std::map<string, DialogPtr> dialogs_;
|
|
|
|
/// the stuff below is slated to go...
|
|
void init_pimpl();
|
|
///
|
|
class Impl;
|
|
///
|
|
Impl * pimpl_;
|
|
};
|
|
|
|
#endif
|