File indexing completed on 2024-04-28 16:26:20

0001 /***************************************************************************
0002     date                 : Nov 02 2005
0003     version              : 0.23
0004     copyright            : 2004-2005  Holger Danielsson <holger.danielsson@t-online.de>
0005                            2004       Jeroen Wijnhout
0006                            2015       Andreas Cord-Landwehr <cordlandwehr@kde.org>
0007  ***************************************************************************/
0008 
0009 /***************************************************************************
0010  *                                                                         *
0011  *   This program is free software; you can redistribute it and/or modify  *
0012  *   it under the terms of the GNU General Public License as published by  *
0013  *   the Free Software Foundation; either version 2 of the License, or     *
0014  *   (at your option) any later version.                                   *
0015  *                                                                         *
0016  ***************************************************************************/
0017 
0018 #ifndef INCLUDEGRAPHICSDIALOG_H
0019 #define INCLUDEGRAPHICSDIALOG_H
0020 
0021 #include <QDialog>
0022 #include <QProcess>
0023 
0024 #include "ui_includegraphicsdialog_base.h"
0025 
0026 class QDialogButtonBox;
0027 class KProcess;
0028 class KileInfo;
0029 
0030 /**
0031   *@author dani
0032   */
0033 namespace KileDialog
0034 {
0035 
0036 class IncludeGraphics : public QDialog
0037 {
0038     Q_OBJECT
0039 
0040 public:
0041     IncludeGraphics(QWidget *parent, const QString &startdir, KileInfo *ki);
0042     virtual ~IncludeGraphics();
0043 
0044     QString getTemplate();
0045     QString getFilename();
0046 
0047 private Q_SLOTS:
0048     void onChooseFilter();
0049     void onUrlSelected(const QUrl &url);
0050     void onTextChanged(const QString& string);
0051     void onProcessOutput();
0052     void onProcessExited(int exitCode, QProcess::ExitStatus exitStatus);
0053 
0054     void onWrapFigureSelected(bool state);
0055     void onFigureSelected(bool state);
0056     void onAccepted();
0057 
0058 private:
0059     void readConfig();
0060     void writeConfig();
0061     QString getOptions();
0062     QString getInfo();
0063     bool getPictureSize(int &wpx, int &hpx, QString &dpi, QString &wcm, QString &hcm);
0064     void setInfo();
0065 
0066     QDialogButtonBox *m_buttonBox;
0067     Ui::IncludeGraphicsWidget m_widget;
0068 
0069     QString m_startdir;
0070     QString m_output;
0071 
0072     // current picture
0073     int m_width, m_height;
0074     float m_resolution;
0075 
0076     // default
0077     bool m_imagemagick;
0078     bool m_boundingbox;
0079     float m_defaultresolution;
0080 
0081     void execute(const QString &command);
0082 
0083     KileInfo *m_ki;
0084     KProcess* m_proc;
0085 };
0086 
0087 }
0088 
0089 #endif