summaryrefslogtreecommitdiffstats
path: root/src/kile/includegraphicsdialog.h
blob: 57af43d3a483c0cda065fba721ec92400ed877a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/***************************************************************************
    date                 : Nov 02 2005
    version              : 0.23
    copyright            : (C) 2004-2005 by Holger Danielsson, 2004 Jeroen Wijnhout
    email                : holger.danielsson@t-online.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef INCLUDEGRAPHICSDIALOG_H
#define INCLUDEGRAPHICSDIALOG_H

#include <tqstring.h>

#include <kdialogbase.h>

/**
  *@author dani 
  */

class TQLabel;
class TQCheckBox;

class KileInfo;
class KLineEdit;
class KProcess;
class KShellProcess;

namespace KileDialog
{

class IncludeGraphics : public KDialogBase
{
	Q_OBJECT
  TQ_OBJECT

public:
	IncludeGraphics(TQWidget *parent,const TQString &startdir,KileInfo *ki);
	~IncludeGraphics();

	TQString getTemplate();
	TQString getFilename();

private slots:
	void chooseFile();
	void updateFigure();

	void slotProcessOutput(KProcess* proc,char* buffer,int buflen);
	void slotProcessExited(KProcess* proc);

	void slotOk();

private:
	void readConfig();
	void writeConfig();
	bool checkParameter();
	TQString getOptions();
	TQString getInfo();
	bool getPictureSize(int &wpx, int &hpx, TQString &dpi, TQString &wcm, TQString &hcm);
	void setInfo();

	TQLabel *infolabel;
	KLineEdit *edit_file, *edit_label, *edit_caption, *edit_width, *edit_height, *edit_angle, *edit_bb;
	TQCheckBox *cb_center, *cb_pdftex, *cb_figure, *cb_graphicspath;
	TQLabel *lb_label, *lb_caption;

	TQString m_startdir;  
	TQString m_output;

	// current picture
	int m_width,m_height;
	float m_resolution;

	// default
	bool m_imagemagick;
	bool m_boundingbox;
	float m_defaultresolution;

	void execute(const TQString &command);
	
	KileInfo *m_ki;
	KShellProcess* m_proc;
};

}

#endif