summaryrefslogtreecommitdiffstats
path: root/src/kile/kilelyxserver.h
blob: eee1749761f60ca8b160ffefdfe24e48734ed928 (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
/***************************************************************************
    begin                : Sat Sept 9 2003
    copyright            : (C) 2003 by Jeroen Wijnhout
    email                : Jeroen.Wijnhout@kdemail.net
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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 _LYXSERVER_H_
#define _LYXSERVER_H_

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <tqobject.h>
#include <tqptrlist.h>
#include <tqintdict.h>
#include <tqstringlist.h>
#include <ktempdir.h>

#include <sys/types.h>

/**
 * @short Simple server that impersonates as LyX to work with gBib, pyBibliographer etc.
 * @author Jeroen Wijnhout <Jeroen.Wijnhout@kdemail.net>
 * @author Thomas Braun
 * @version 0.2
 */

class TQFile;
class TQSocketNotifier;
namespace KileAction { class TagData; }

class KileLyxServer : public TQObject
{
	Q_OBJECT
  TQ_OBJECT

public:
	KileLyxServer(bool start = true);
	~KileLyxServer();

	bool isRunning() { return m_running; }

public slots:
	bool start();
	void stop();

private slots:
	void receive(int);
	
private:
	bool openPipes();
	void removePipes();
	void processLine(const TQString &);

signals:
	void insert(const KileAction::TagData &);

private:
	mode_t 				m_perms;
	KTempDir			*m_tempDir;
	TQPtrList<TQFile>			m_pipeIn;
	TQPtrList<TQSocketNotifier>	m_notifier;
	TQIntDict<TQFile>			m_file;
	bool				m_running;
	TQStringList 			m_links,m_pipes;
};

#endif // _LYXSERVER_H_