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
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* 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"
|
2003-09-19 10:16:33 +00:00
|
|
|
#include "insets/insetcommandparams.h"
|
2001-03-23 17:09:34 +00:00
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
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-10-06 15:43:21 +00:00
|
|
|
virtual bool initialiseParams(std::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-09-19 10:16:33 +00:00
|
|
|
InsetCommandParams const & params() const { return params_; }
|
2003-03-05 14:59:37 +00:00
|
|
|
///
|
2003-09-19 10:16:33 +00:00
|
|
|
void setParams(InsetCommandParams const &);
|
2001-03-23 17:09:34 +00:00
|
|
|
|
2001-03-30 09:51:46 +00:00
|
|
|
/// Browse for a file
|
2004-01-08 10:59:51 +00:00
|
|
|
std::string const browse(std::string const &, Type) const;
|
2001-03-23 17:09:34 +00:00
|
|
|
|
2001-07-25 12:37:43 +00:00
|
|
|
/// load a file
|
2003-10-06 15:43:21 +00:00
|
|
|
void load(std::string const & file);
|
2001-07-25 12:37:43 +00:00
|
|
|
|
2002-01-21 10:47:19 +00:00
|
|
|
/// test if file exist
|
2003-10-06 15:43:21 +00:00
|
|
|
bool fileExists(std::string const & file);
|
2001-03-23 17:09:34 +00:00
|
|
|
private:
|
2003-03-05 14:59:37 +00:00
|
|
|
///
|
2003-09-19 10:16:33 +00:00
|
|
|
InsetCommandParams params_;
|
2001-03-23 17:09:34 +00:00
|
|
|
};
|
2003-03-05 14:59:37 +00:00
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
2001-03-23 17:09:34 +00:00
|
|
|
#endif // CONTROLINCLUDE_H
|