2001-06-13 14:33:31 +00:00
|
|
|
// -*- C++ -*-
|
2001-03-23 17:09:34 +00:00
|
|
|
/**
|
|
|
|
* \file ControlInclude.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.
|
2001-03-23 17:09:34 +00:00
|
|
|
*
|
|
|
|
* \author Alejandro Aguilar Sierra
|
2002-09-05 14:10:50 +00:00
|
|
|
* \author John Levon
|
|
|
|
* \author Angus Leeming
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS
|
2001-03-23 17:09:34 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CONTROLINCLUDE_H
|
|
|
|
#define CONTROLINCLUDE_H
|
|
|
|
|
|
|
|
|
2003-03-05 14:59:37 +00:00
|
|
|
#include "Dialog.h"
|
2001-03-23 17:09:34 +00:00
|
|
|
#include "insets/insetinclude.h" // InsetIncludeParams
|
|
|
|
|
2003-03-05 14:59:37 +00:00
|
|
|
|
2001-03-23 17:09:34 +00:00
|
|
|
/** A controller for the Include file dialog.
|
|
|
|
*/
|
2003-03-05 14:59:37 +00:00
|
|
|
class ControlInclude : public Dialog::Controller {
|
2001-03-23 17:09:34 +00:00
|
|
|
public:
|
2001-03-30 09:51:46 +00:00
|
|
|
///
|
|
|
|
enum Type {
|
|
|
|
///
|
|
|
|
INPUT,
|
|
|
|
///
|
|
|
|
VERBATIM,
|
|
|
|
///
|
|
|
|
INCLUDE
|
|
|
|
};
|
2001-03-23 17:09:34 +00:00
|
|
|
///
|
2003-03-05 14:59:37 +00:00
|
|
|
ControlInclude(Dialog &);
|
|
|
|
|
|
|
|
///
|
2003-03-14 00:20:42 +00:00
|
|
|
virtual bool initialiseParams(string const & data);
|
2003-03-05 14:59:37 +00:00
|
|
|
/// clean-up on hide.
|
|
|
|
virtual void clearParams();
|
|
|
|
/// clean-up on hide.
|
|
|
|
virtual void dispatchParams();
|
|
|
|
///
|
|
|
|
virtual bool isBufferDependent() const { return true; }
|
|
|
|
|
|
|
|
///
|
2003-03-14 00:20:42 +00:00
|
|
|
InsetInclude::Params const & params() const
|
2003-03-05 14:59:37 +00:00
|
|
|
{ return inset_->params(); }
|
|
|
|
///
|
|
|
|
void setParams(InsetInclude::Params const &);
|
2001-03-23 17:09:34 +00:00
|
|
|
|
2001-03-30 09:51:46 +00:00
|
|
|
/// Browse for a file
|
|
|
|
string const Browse(string const &, Type);
|
2001-03-23 17:09:34 +00:00
|
|
|
|
2001-07-25 12:37:43 +00:00
|
|
|
/// load a file
|
2002-03-21 21:21:28 +00:00
|
|
|
void load(string const & file);
|
2001-07-25 12:37:43 +00:00
|
|
|
|
2002-01-21 10:47:19 +00:00
|
|
|
/// test if file exist
|
2002-03-21 21:21:28 +00:00
|
|
|
bool fileExists(string const & file);
|
2001-03-23 17:09:34 +00:00
|
|
|
private:
|
2003-03-05 14:59:37 +00:00
|
|
|
///
|
|
|
|
boost::scoped_ptr<InsetInclude> inset_;
|
2001-03-23 17:09:34 +00:00
|
|
|
};
|
2003-03-05 14:59:37 +00:00
|
|
|
|
2001-03-23 17:09:34 +00:00
|
|
|
#endif // CONTROLINCLUDE_H
|