2006-03-05 17:24:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2007-08-31 05:53:55 +00:00
|
|
|
* \file GuiExternal.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-07 08:55:20 +00:00
|
|
|
* \author Asger Alstrup
|
2006-03-05 17:24:44 +00:00
|
|
|
* \author John Levon
|
2007-10-07 08:55:20 +00:00
|
|
|
* \author Angus Leeming
|
2006-03-05 17:24:44 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
#ifndef GUIEXTERNAL_H
|
|
|
|
#define GUIEXTERNAL_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_ExternalUi.h"
|
2007-04-25 08:42:22 +00:00
|
|
|
|
2007-10-07 08:55:20 +00:00
|
|
|
#include "support/types.h"
|
|
|
|
|
|
|
|
#include "insets/InsetExternal.h"
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2006-03-05 17:24:44 +00:00
|
|
|
#include <map>
|
|
|
|
|
|
|
|
namespace lyx {
|
2007-10-07 08:55:20 +00:00
|
|
|
|
|
|
|
namespace external {
|
|
|
|
|
|
|
|
class Template;
|
|
|
|
class RotationDataType;
|
|
|
|
|
|
|
|
} // namespace external
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
namespace frontend {
|
|
|
|
|
2007-10-09 19:34:27 +00:00
|
|
|
class GuiExternal : public GuiDialog, public Ui::ExternalUi
|
2007-08-31 22:16:11 +00:00
|
|
|
{
|
2007-04-25 08:42:22 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
public:
|
2007-10-07 08:55:20 +00:00
|
|
|
GuiExternal(LyXView & lv);
|
2007-09-05 20:33:29 +00:00
|
|
|
|
|
|
|
private Q_SLOTS:
|
|
|
|
void bbChanged();
|
|
|
|
void browseClicked();
|
|
|
|
void change_adaptor();
|
|
|
|
void editClicked();
|
|
|
|
void extraChanged(const QString&);
|
|
|
|
void formatChanged(const QString&);
|
|
|
|
void getbbClicked();
|
|
|
|
void sizeChanged();
|
|
|
|
void templateChanged();
|
|
|
|
void widthUnitChanged();
|
2007-04-25 08:42:22 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
public:
|
2007-10-07 08:55:20 +00:00
|
|
|
///
|
|
|
|
typedef std::map<std::string, QString> MapType;
|
|
|
|
|
|
|
|
private:
|
2007-09-05 20:33:29 +00:00
|
|
|
void closeEvent(QCloseEvent * e);
|
|
|
|
//
|
|
|
|
bool activateAspectratio() const;
|
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
|
2007-09-11 18:33:42 +00:00
|
|
|
void updateContents();
|
2006-03-05 17:24:44 +00:00
|
|
|
/// Helper function called when the template is changed.
|
|
|
|
void updateTemplate();
|
|
|
|
/// get bounding box from file
|
|
|
|
void getBB();
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
///
|
2006-03-05 17:24:44 +00:00
|
|
|
MapType extra_;
|
2007-10-07 08:55:20 +00:00
|
|
|
///
|
|
|
|
bool initialiseParams(std::string const & data);
|
|
|
|
/// clean-up on hide.
|
|
|
|
void clearParams();
|
|
|
|
/// clean-up on hide.
|
|
|
|
void dispatchParams();
|
|
|
|
///
|
|
|
|
bool isBufferDependent() const { return true; }
|
|
|
|
|
|
|
|
///
|
|
|
|
void editExternal();
|
|
|
|
///
|
|
|
|
std::vector<std::string> const getTemplates() const;
|
|
|
|
///
|
|
|
|
int getTemplateNumber(std::string const &) const;
|
|
|
|
///
|
|
|
|
external::Template getTemplate(int) const;
|
|
|
|
///
|
|
|
|
std::string const
|
|
|
|
getTemplateFilters(std::string const & template_name) const;
|
|
|
|
///
|
|
|
|
docstring const browse(docstring const & input_file,
|
|
|
|
docstring const & template_name) const;
|
|
|
|
|
|
|
|
/// Read the Bounding Box from a eps or ps-file
|
|
|
|
std::string const readBB(std::string const & file);
|
|
|
|
///
|
|
|
|
private:
|
|
|
|
///
|
|
|
|
InsetExternalParams params_;
|
|
|
|
bool bbChanged_;
|
2006-03-05 17:24:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
#endif // GUIEXTERNAL_H
|