summaryrefslogtreecommitdiffstats
path: root/src/kile/texdocdialog.h
blob: 39049739c5bac5174d2a16c065502299a93502b7 (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
95
96
97
98
99
100
/***************************************************************************
                         texdocdialog.h
                         --------------
    date                 : Feb 15 2007
    version              : 0.14
    copyright            : (C) 2005-2007 by Holger Danielsson
    email                : holger.danielsson@versanet.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 TEXDOCDIALOG_H
#define TEXDOCDIALOG_H

#include <kdialogbase.h>
#include <klineedit.h>
#include <kpushbutton.h>
#include <kprocess.h>
#include <tdetempfile.h>
#include <tdelistview.h>

#include <tqlabel.h>
#include <tqstringlist.h>
#include <tqmap.h>

namespace KileDialog
{

class TexDocDialog : public KDialogBase  
{
	Q_OBJECT
  

public:
	TexDocDialog(TQWidget *parent=0, const char *name=0);
	~TexDocDialog();

private:	
	TDEListView *m_texdocs;
	KLineEdit *m_leKeywords;
	KPushButton *m_pbSearch;

	TQString m_texmfPath, m_texmfdocPath, m_texdoctkPath;
	
	TQStringList m_tocList,m_tocSearchList;
	TQMap<TQString,TQString> m_dictDocuments;
	TQMap<TQString,TQString> m_dictStyleCodes;
	
	void readToc();
	void showToc(const TQString &caption,const TQStringList &doclist, bool toc=true);

	TQString m_filename;
	TQString m_output;
	
	KTempFile *m_tempfile;
	KShellProcess *m_proc;
	
	void callSearch();
	void executeScript(const TQString &command);
	void showFile(const TQString &filename);

	TQString searchFile(const TQString &docfilename,const TQString &listofpathes, 
	                   const TQString &subdir=TQString());
	void decompressFile(const TQString &docfile,const TQString &command);
	void showStyleFile(const TQString &filename,const TQString &stylecode);
	
	TQString getMimeType(const TQString &filename);
	TQString getIconName(const TQString &filename);

protected:
	bool eventFilter(TQObject *o, TQEvent *e); 

signals:
	void processFinished();

protected slots:
	void slotHelp(); 
	
private slots:
	void slotListViewDoubleClicked(TQListViewItem *item,const TQPoint &,int); 
	void slotTextChanged(const TQString &text);
	void slotSearchClicked();
	
	void slotProcessOutput(TDEProcess*,char* buf,int len);
	void slotProcessExited (TDEProcess *proc);

	void slotInitToc();
	void slotShowFile();
};

}

#endif