2000-06-12 11:55:12 +00:00
|
|
|
// -*- C++ -*-
|
2002-08-14 19:19:47 +00:00
|
|
|
/**
|
|
|
|
* \file Dialogs.h
|
2002-09-05 15:14:23 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-09-05 14:10:50 +00:00
|
|
|
* \author Allan Rae
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS
|
2000-06-12 11:55:12 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DIALOGS_H
|
|
|
|
#define DIALOGS_H
|
|
|
|
|
2002-08-14 19:19:47 +00:00
|
|
|
|
2000-06-12 11:55:12 +00:00
|
|
|
#include "LString.h"
|
2002-05-22 01:16:37 +00:00
|
|
|
|
2000-10-02 00:55:02 +00:00
|
|
|
#include <boost/utility.hpp>
|
2002-08-15 17:48:53 +00:00
|
|
|
#include <boost/scoped_ptr.hpp>
|
2002-05-29 16:21:03 +00:00
|
|
|
#include <boost/signals/signal0.hpp>
|
|
|
|
#include <boost/signals/signal1.hpp>
|
2000-06-12 11:55:12 +00:00
|
|
|
|
2003-02-25 14:51:38 +00:00
|
|
|
class Dialog;
|
|
|
|
class InsetBase;
|
2000-06-12 11:55:12 +00:00
|
|
|
class LyXView;
|
2003-02-25 14:51:38 +00:00
|
|
|
|
2000-06-12 11:55:12 +00:00
|
|
|
class InsetInfo;
|
2001-06-25 00:06:33 +00:00
|
|
|
class Paragraph;
|
2002-08-14 19:19:47 +00:00
|
|
|
class InsetTabular;
|
2000-06-12 11:55:12 +00:00
|
|
|
|
|
|
|
/** 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.
|
|
|
|
*/
|
2001-04-17 14:02:45 +00:00
|
|
|
class Dialogs : boost::noncopyable
|
2000-06-12 11:55:12 +00:00
|
|
|
{
|
|
|
|
public:
|
2001-03-15 13:37:04 +00:00
|
|
|
///
|
2002-08-15 17:48:53 +00:00
|
|
|
Dialogs(LyXView &);
|
|
|
|
/// Define an empty d-tor out-of-line to keep boost::scoped_ptr happy.
|
|
|
|
~Dialogs();
|
2001-03-15 13:37:04 +00:00
|
|
|
|
2001-04-03 14:30:58 +00:00
|
|
|
/** Redraw all visible dialogs because, for example, the GUI colours
|
2002-08-15 17:48:53 +00:00
|
|
|
* 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();
|
2000-11-10 17:29:47 +00:00
|
|
|
|
2002-03-11 09:54:42 +00:00
|
|
|
/// Toggle tooltips on/off in all dialogs.
|
2002-08-15 17:48:53 +00:00
|
|
|
static void toggleTooltips();
|
2002-03-11 09:54:42 +00:00
|
|
|
|
|
|
|
/// Are the tooltips on or off?
|
|
|
|
static bool tooltipsEnabled();
|
|
|
|
|
2003-02-25 14:51:38 +00:00
|
|
|
/// Signals slated to go
|
2000-06-12 11:55:12 +00:00
|
|
|
//@{
|
2003-02-25 14:51:38 +00:00
|
|
|
boost::signal0<void> hideAllSignal;
|
|
|
|
boost::signal0<void> hideBufferDependentSignal;
|
|
|
|
boost::signal1<void, bool> updateBufferDependentSignal;
|
|
|
|
//@}
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2003-02-25 14:51:38 +00:00
|
|
|
/// Hide all visible dialogs
|
|
|
|
void hideAll() const;
|
2000-10-13 05:57:05 +00:00
|
|
|
/// Hide any dialogs that require a buffer for them to operate
|
2003-02-25 14:51:38 +00:00
|
|
|
void hideBufferDependent() const;
|
2000-10-13 05:57:05 +00:00
|
|
|
/** Update visible, buffer-dependent dialogs
|
|
|
|
If the bool is true then a buffer change has occurred
|
|
|
|
else its still the same buffer.
|
|
|
|
*/
|
2003-02-25 14:51:38 +00:00
|
|
|
void updateBufferDependent(bool) const ;
|
2000-06-12 11:55:12 +00:00
|
|
|
|
2000-09-22 15:09:51 +00:00
|
|
|
/**@name Dialog Access Signals.
|
|
|
|
Put into some sort of alphabetical order */
|
2000-06-12 11:55:12 +00:00
|
|
|
//@{
|
2001-07-13 14:03:48 +00:00
|
|
|
///
|
2002-06-18 15:44:30 +00:00
|
|
|
void showAboutlyx();
|
2000-06-12 11:55:12 +00:00
|
|
|
///
|
2002-06-18 15:44:30 +00:00
|
|
|
void showCharacter();
|
2001-06-15 16:18:43 +00:00
|
|
|
/// connected to the character dialog also
|
2002-06-18 15:44:30 +00:00
|
|
|
void setUserFreeFont();
|
2000-06-12 11:55:12 +00:00
|
|
|
///
|
2002-06-18 15:44:30 +00:00
|
|
|
void showDocument();
|
2001-10-09 15:20:10 +00:00
|
|
|
/// show the contents of a file.
|
2002-06-18 15:44:30 +00:00
|
|
|
void showFile(string const &);
|
2002-02-18 19:13:48 +00:00
|
|
|
/// show all forked child processes
|
2002-06-18 15:44:30 +00:00
|
|
|
void showForks();
|
2001-02-06 17:41:42 +00:00
|
|
|
/// show the LaTeX log or build file
|
2002-06-18 15:44:30 +00:00
|
|
|
void showLogFile();
|
2002-03-21 21:21:28 +00:00
|
|
|
/// display the top-level maths panel
|
2002-06-18 15:44:30 +00:00
|
|
|
void showMathPanel();
|
2003-02-08 19:18:01 +00:00
|
|
|
/// show the merge changes dialog
|
|
|
|
void showMergeChanges();
|
2000-09-22 15:09:51 +00:00
|
|
|
///
|
2002-06-18 15:44:30 +00:00
|
|
|
void showParagraph();
|
2001-06-15 16:18:43 +00:00
|
|
|
///
|
2002-08-15 17:48:53 +00:00
|
|
|
void updateParagraph();
|
2001-06-15 16:18:43 +00:00
|
|
|
///
|
2002-06-18 15:44:30 +00:00
|
|
|
void showPreamble();
|
2000-09-22 15:09:51 +00:00
|
|
|
///
|
2002-06-18 15:44:30 +00:00
|
|
|
void showPreferences();
|
2000-09-22 15:09:51 +00:00
|
|
|
///
|
2002-06-18 15:44:30 +00:00
|
|
|
void showPrint();
|
2000-07-07 07:46:37 +00:00
|
|
|
///
|
2002-06-18 15:44:30 +00:00
|
|
|
void showSearch();
|
2002-03-07 15:06:57 +00:00
|
|
|
///
|
2002-06-18 15:44:30 +00:00
|
|
|
void showSendto();
|
2001-07-13 11:50:39 +00:00
|
|
|
/// bring up the spellchecker
|
2002-06-18 15:44:30 +00:00
|
|
|
void showSpellchecker();
|
2000-08-08 13:55:26 +00:00
|
|
|
///
|
2002-06-18 15:44:30 +00:00
|
|
|
void showTabular(InsetTabular *);
|
2000-09-22 15:09:51 +00:00
|
|
|
///
|
2002-06-18 15:44:30 +00:00
|
|
|
void updateTabular(InsetTabular *);
|
2000-09-22 15:09:51 +00:00
|
|
|
///
|
2002-06-18 15:44:30 +00:00
|
|
|
void showTabularCreate();
|
2001-10-09 15:20:10 +00:00
|
|
|
/// show the TexInfo
|
2002-06-18 15:44:30 +00:00
|
|
|
void showTexinfo();
|
2001-07-29 10:42:11 +00:00
|
|
|
/// show the thesaurus dialog
|
2002-06-18 15:44:30 +00:00
|
|
|
void showThesaurus(string const &);
|
2001-06-15 16:18:43 +00:00
|
|
|
/// show the version control log
|
2002-06-18 15:44:30 +00:00
|
|
|
void showVCLogFile();
|
2000-06-12 11:55:12 +00:00
|
|
|
//@}
|
2002-08-15 17:48:53 +00:00
|
|
|
|
2003-02-25 14:51:38 +00:00
|
|
|
/** 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;
|
2002-08-15 17:48:53 +00:00
|
|
|
private:
|
2003-02-25 14:51:38 +00:00
|
|
|
///
|
|
|
|
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();
|
|
|
|
///
|
2002-08-20 19:41:13 +00:00
|
|
|
class Impl;
|
2003-02-25 14:51:38 +00:00
|
|
|
///
|
|
|
|
Impl * pimpl_;
|
2000-06-12 11:55:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|