2001-06-13 14:33:31 +00:00
|
|
|
// -*- C++ -*-
|
2001-03-23 17:09:34 +00:00
|
|
|
/**
|
|
|
|
* \file ControlInclude.h
|
|
|
|
* See the file COPYING
|
|
|
|
*
|
|
|
|
* \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
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "ControlInset.h"
|
|
|
|
#include "insets/insetinclude.h" // InsetIncludeParams
|
|
|
|
|
|
|
|
/** A controller for the Include file dialog.
|
|
|
|
*/
|
|
|
|
class ControlInclude
|
|
|
|
: public ControlInset<InsetInclude, InsetInclude::Params>
|
|
|
|
{
|
|
|
|
public:
|
2001-03-30 09:51:46 +00:00
|
|
|
///
|
|
|
|
enum Type {
|
|
|
|
///
|
|
|
|
INPUT,
|
|
|
|
///
|
|
|
|
VERBATIM,
|
|
|
|
///
|
|
|
|
INCLUDE
|
|
|
|
};
|
2001-03-23 17:09:34 +00:00
|
|
|
///
|
|
|
|
ControlInclude(LyXView &, Dialogs &);
|
|
|
|
|
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);
|
2002-01-21 10:47:19 +00:00
|
|
|
|
2001-03-23 17:09:34 +00:00
|
|
|
private:
|
|
|
|
/// Dispatch the changed parameters to the kernel.
|
|
|
|
virtual void applyParamsToInset();
|
|
|
|
/// Should be used but currently isn't
|
|
|
|
virtual void applyParamsNoInset() {}
|
|
|
|
/// get the parameters from the string passed to createInset.
|
|
|
|
virtual InsetInclude::Params const getParams(string const &)
|
|
|
|
{ return InsetInclude::Params(); }
|
|
|
|
/// get the parameters from the inset passed to showInset.
|
|
|
|
virtual InsetInclude::Params const getParams(InsetInclude const & inset)
|
|
|
|
{ return inset.params(); }
|
|
|
|
};
|
|
|
|
#endif // CONTROLINCLUDE_H
|