2006-03-05 17:24:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2007-08-31 05:53:55 +00:00
|
|
|
* \file GuiGraphics.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
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author Herbert Voß
|
2007-10-06 22:16:14 +00:00
|
|
|
* \author Baruch Even
|
|
|
|
* \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 GUIGRAPHICS_H
|
|
|
|
#define GUIGRAPHICS_H
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
#include "GuiDialog.h"
|
|
|
|
#include "ui_GraphicsUi.h"
|
2007-02-13 18:27:46 +00:00
|
|
|
|
2008-05-06 15:18:50 +00:00
|
|
|
#include "insets/InsetGraphicsParams.h"
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
class QString;
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
namespace lyx {
|
2007-10-06 22:16:14 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
namespace frontend {
|
|
|
|
|
2007-10-09 19:34:27 +00:00
|
|
|
class GuiGraphics : public GuiDialog, public Ui::GraphicsUi
|
2007-08-31 22:16:11 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2007-10-06 22:16:14 +00:00
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
public:
|
2007-11-23 09:44:02 +00:00
|
|
|
GuiGraphics(GuiView & lv);
|
2007-09-05 20:33:29 +00:00
|
|
|
void setAutoText();
|
2007-10-06 22:16:14 +00:00
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
private Q_SLOTS:
|
|
|
|
void change_adaptor();
|
2009-05-23 08:01:38 +00:00
|
|
|
void changeGroup(int);
|
|
|
|
void changeBB();
|
2009-01-16 14:54:25 +00:00
|
|
|
void on_newGroupPB_clicked();
|
2007-09-05 20:33:29 +00:00
|
|
|
void on_browsePB_clicked();
|
|
|
|
void on_getPB_clicked();
|
|
|
|
void on_scaleCB_toggled(bool);
|
|
|
|
void on_WidthCB_toggled(bool);
|
|
|
|
void on_HeightCB_toggled(bool);
|
2015-01-04 09:05:42 +00:00
|
|
|
void updateAspectRatioStatus();
|
|
|
|
void on_aspectratio_toggled(bool);
|
2007-09-05 20:33:29 +00:00
|
|
|
void on_angle_textChanged(const QString &);
|
2007-10-06 22:16:14 +00:00
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
private:
|
2008-02-17 20:16:14 +00:00
|
|
|
///
|
2007-09-05 20:33:29 +00:00
|
|
|
bool isValid();
|
2008-05-06 15:18:50 +00:00
|
|
|
/// Dialog inherited methods
|
|
|
|
//@{
|
2007-09-05 20:33:29 +00:00
|
|
|
void applyView();
|
2008-05-06 15:18:50 +00:00
|
|
|
void updateContents() {}
|
2007-10-06 22:16:14 +00:00
|
|
|
bool initialiseParams(std::string const & data);
|
|
|
|
void clearParams();
|
|
|
|
void dispatchParams();
|
|
|
|
bool isBufferDependent() const { return true; }
|
2008-05-06 15:18:50 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
///
|
|
|
|
void paramsToDialog(InsetGraphicsParams const & params);
|
2007-10-06 22:16:14 +00:00
|
|
|
|
2008-05-06 15:18:50 +00:00
|
|
|
/// get bounding box from file
|
|
|
|
void getBB();
|
2007-10-06 22:16:14 +00:00
|
|
|
/// Browse for a file
|
2008-03-06 00:07:19 +00:00
|
|
|
QString browse(QString const &) const;
|
2007-10-06 22:16:14 +00:00
|
|
|
/// Read the Bounding Box from a eps or ps-file
|
2008-04-18 18:53:43 +00:00
|
|
|
std::string readBoundingBox(std::string const & file);
|
2007-10-06 22:16:14 +00:00
|
|
|
/// test if file exist
|
2008-04-18 18:53:43 +00:00
|
|
|
bool isFileNameValid(std::string const & fname) const;
|
2007-10-06 22:16:14 +00:00
|
|
|
|
2008-05-06 15:18:50 +00:00
|
|
|
/// Control the bb
|
|
|
|
bool bbChanged;
|
|
|
|
/// Store the LaTeX names for the rotation origins.
|
|
|
|
std::vector<std::string> origin_ltx;
|
2007-10-06 22:16:14 +00:00
|
|
|
///
|
|
|
|
InsetGraphicsParams params_;
|
2009-01-17 08:02:52 +00:00
|
|
|
/// the current graphics group
|
|
|
|
std::string current_group_;
|
2006-03-05 17:24:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
#endif // GUIGRAPHICS_H
|