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.
|
|
|
|
*
|
|
|
|
* \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-08-31 05:53:55 +00:00
|
|
|
#include "GuiDialogView.h"
|
2007-08-31 22:16:11 +00:00
|
|
|
#include "ControlInclude.h"
|
2007-08-11 15:48:15 +00:00
|
|
|
#include "ui_IncludeUi.h"
|
2007-04-25 10:57:54 +00:00
|
|
|
|
|
|
|
#include <QDialog>
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
class GuiInclude;
|
2007-04-25 10:57:54 +00:00
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
class GuiIncludeDialog : public QDialog, public Ui::IncludeUi {
|
2007-04-25 10:57:54 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2007-08-31 05:53:55 +00:00
|
|
|
GuiIncludeDialog(GuiInclude * form);
|
2007-04-25 10:57:54 +00:00
|
|
|
|
|
|
|
void updateLists();
|
|
|
|
|
2007-09-03 20:28:26 +00:00
|
|
|
virtual void showView();
|
2007-07-27 18:17:00 +00:00
|
|
|
/// validate listings parameters and return an error message, if any
|
|
|
|
docstring validate_listings_params();
|
2007-04-25 10:57:54 +00:00
|
|
|
protected Q_SLOTS:
|
|
|
|
virtual void change_adaptor();
|
2007-08-07 18:39:34 +00:00
|
|
|
virtual void editClicked();
|
2007-04-25 10:57:54 +00:00
|
|
|
virtual void browseClicked();
|
|
|
|
virtual 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
|
|
|
|
void set_listings_msg();
|
2007-04-25 10:57:54 +00:00
|
|
|
protected:
|
|
|
|
virtual void closeEvent(QCloseEvent * e);
|
|
|
|
private:
|
2007-08-31 05:53:55 +00:00
|
|
|
GuiInclude * form_;
|
2007-04-25 10:57:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
class GuiInclude : public GuiView<GuiIncludeDialog>
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
///
|
2007-08-31 05:53:55 +00:00
|
|
|
friend class GuiIncludeDialog;
|
2006-03-05 17:24:44 +00:00
|
|
|
///
|
2007-09-03 05:59:32 +00:00
|
|
|
GuiInclude(GuiDialog &);
|
2007-08-31 22:16:11 +00:00
|
|
|
/// parent controller
|
|
|
|
ControlInclude & controller()
|
|
|
|
{ return static_cast<ControlInclude &>(this->getController()); }
|
|
|
|
/// parent controller
|
|
|
|
ControlInclude const & controller() const
|
|
|
|
{ return static_cast<ControlInclude const &>(this->getController()); }
|
2006-03-05 17:24:44 +00:00
|
|
|
protected:
|
|
|
|
virtual bool isValid();
|
|
|
|
private:
|
|
|
|
/// Apply changes
|
2007-09-03 20:28:26 +00:00
|
|
|
virtual void applyView();
|
2006-03-05 17:24:44 +00:00
|
|
|
/// update
|
|
|
|
virtual void update_contents();
|
|
|
|
/// build the dialog
|
|
|
|
virtual void build_dialog();
|
|
|
|
|
2007-08-07 18:39:34 +00:00
|
|
|
/// edit the child document, .lyx file will be opened in lyx
|
|
|
|
/// other formats will be edited by external applications.
|
|
|
|
void edit();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
/// browse for a file
|
|
|
|
void browse();
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
#endif // GUIINCLUDE_H
|