2006-03-05 17:24:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2007-08-31 05:53:55 +00:00
|
|
|
* \file GuiInclude.h
|
2006-03-05 17:24:44 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
2007-10-06 12:03:13 +00:00
|
|
|
* \author Alejandro Aguilar Sierra
|
|
|
|
* \author Angus Leeming
|
2006-03-05 17:24:44 +00:00
|
|
|
* \author John Levon
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
#ifndef GUIINCLUDE_H
|
|
|
|
#define GUIINCLUDE_H
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
#include "GuiDialog.h"
|
2007-08-11 15:48:15 +00:00
|
|
|
#include "ui_IncludeUi.h"
|
2007-04-25 10:57:54 +00:00
|
|
|
|
2008-04-20 09:24:14 +00:00
|
|
|
#include "insets/InsetCommandParams.h"
|
|
|
|
|
2007-10-06 12:03:13 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2008-04-20 09:24:14 +00:00
|
|
|
class GuiInclude : public GuiDialog, public Ui::IncludeUi
|
2007-09-05 20:33:29 +00:00
|
|
|
{
|
2007-04-25 10:57:54 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
public:
|
2007-11-23 09:44:02 +00:00
|
|
|
GuiInclude(GuiView & lv);
|
2007-04-25 10:57:54 +00:00
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
private Q_SLOTS:
|
|
|
|
void change_adaptor();
|
2007-10-06 12:03:13 +00:00
|
|
|
/// edit the child document, .lyx file will be opened in lyx
|
|
|
|
/// other formats will be edited by external applications.
|
|
|
|
void edit();
|
|
|
|
/// browse for a file
|
|
|
|
void browse();
|
|
|
|
///
|
2007-09-05 20:33:29 +00:00
|
|
|
void typeChanged(int v);
|
2007-07-27 18:17:00 +00:00
|
|
|
/// AFAIK, QValidator only works for QLineEdit so
|
|
|
|
/// I have to validate listingsED (QTextEdit) manually.
|
|
|
|
/// This function displays a hint or error message returned by
|
|
|
|
/// validate_listings_params
|
2009-05-23 09:06:50 +00:00
|
|
|
void setListingsMsg();
|
2007-04-25 10:57:54 +00:00
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
private:
|
2008-04-20 09:24:14 +00:00
|
|
|
///
|
|
|
|
bool initialiseParams(std::string const & data);
|
2008-08-08 15:29:26 +00:00
|
|
|
///
|
|
|
|
void paramsToDialog(InsetCommandParams const & params_);
|
2008-04-20 09:24:14 +00:00
|
|
|
/// clean-up on hide.
|
|
|
|
void clearParams() { params_.clear(); }
|
|
|
|
/// clean-up on hide.
|
|
|
|
void dispatchParams();
|
|
|
|
///
|
|
|
|
bool isBufferDependent() const { return true; }
|
|
|
|
|
2007-10-29 16:51:07 +00:00
|
|
|
///
|
|
|
|
enum Type {
|
|
|
|
///
|
|
|
|
INPUT,
|
|
|
|
///
|
|
|
|
VERBATIM,
|
|
|
|
///
|
|
|
|
INCLUDE,
|
|
|
|
///
|
|
|
|
LISTINGS,
|
|
|
|
};
|
|
|
|
///
|
2007-09-05 20:33:29 +00:00
|
|
|
void updateLists();
|
|
|
|
/// validate listings parameters and return an error message, if any
|
|
|
|
docstring validate_listings_params();
|
2007-10-06 12:03:13 +00:00
|
|
|
///
|
2007-09-05 20:33:29 +00:00
|
|
|
bool isValid();
|
2006-03-05 17:24:44 +00:00
|
|
|
/// Apply changes
|
2007-09-05 20:33:29 +00:00
|
|
|
void applyView();
|
2006-03-05 17:24:44 +00:00
|
|
|
/// update
|
2008-09-03 18:30:05 +00:00
|
|
|
void updateContents() {}
|
2007-10-06 12:03:13 +00:00
|
|
|
/// Browse for a file
|
2008-03-06 00:07:19 +00:00
|
|
|
QString browse(QString const &, Type) const;
|
2008-04-20 09:24:14 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
///
|
|
|
|
InsetCommandParams params_;
|
2006-03-05 17:24:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
#endif // GUIINCLUDE_H
|