summaryrefslogtreecommitdiffstats
path: root/klinkstatus/src/global.h
blob: a91d3b6d55594833989565e776cca525b4a10eab (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
//
// C++ Interface: global
//
// Description:
//
//
// Author: Paulo Moura Guedes <moura@kdewebdev.org>, (C) 2004
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef GLOBAL_H
#define GLOBAL_H

#include <tqobject.h>
class TQCString;

class DCOPClient;
class KURL;
class TDEProcess;

/**
@author Paulo Moura Guedes
*/
class Global : public TQObject
{
    Q_OBJECT
  
public:
    static Global* self();
    ~Global();

    static bool isKLinkStatusEmbeddedInQuanta();
    static bool isQuantaRunningAsUnique();
    static bool isQuantaAvailableViaDCOP();
    static TQCString quantaDCOPAppId();
    static KURL urlWithQuantaPreviewPrefix(KURL const& url);
    
    //static void setLoopStarted(bool flag);
    static void openQuanta(TQStringList const& args);
    
private:
    Global(TQObject *parent = 0, const char *name = 0);
    static void execCommand(TQString const& command);

private slots:
    void slotGetScriptOutput(TDEProcess* process, char* buffer, int buflen);
    void slotGetScriptError(TDEProcess* process, char* buffer, int buflen);
    void slotProcessExited(TDEProcess* process);
    void slotProcessTimeout();

private:
    static Global* m_self_;

    DCOPClient* dcop_client_;
    bool loop_started_;
    TQString script_output_;
    TDEProcess* process_PS_;
};

#endif