summaryrefslogtreecommitdiffstats
path: root/kdcop/kdcoplistview.h
blob: 4a14620cc515a7abee4a4bd29a5ac3551412fd3a (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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/*
 * Copyright (C) 2000 by Ian Reinhart Geiser <geiseri@kde.org>
 *
 * Licensed under the Artistic License.
 */

#ifndef __KDCOPLISTVIEW_H__
#define __KDCOPLISTVIEW_H__


#include <klistview.h>
class QDragObject;

class KDCOPListView : public KListView
{
  Q_OBJECT

  public:
  	KDCOPListView ( QWidget * parent = 0, const char * name = 0 );
	virtual ~KDCOPListView();
  	QDragObject *dragObject();
	void setMode(const QString &mode);
	QString getCurrentCode() const;

  private:
  	QString encode(QListViewItem *code);
	QString mode;

};

class DCOPBrowserItem : public QListViewItem
{
  public:

    enum Type { Application, Interface, Function };

    DCOPBrowserItem(QListView * parent, Type type);
    DCOPBrowserItem(QListViewItem * parent, Type type);

    virtual ~DCOPBrowserItem() {}

    Type type() const;

  private:

    Type type_;
};

class DCOPBrowserApplicationItem : public QObject, public DCOPBrowserItem
{
 Q_OBJECT
  public:

    DCOPBrowserApplicationItem(QListView * parent, const QCString & app);
    virtual ~DCOPBrowserApplicationItem() {}

    QCString app() const { return app_; }

    virtual void setOpen(bool o);

  protected:

    virtual void populate();

  private:

    QCString app_;
  private slots:
  /**
   * Theses two slots are used to get the icon of the application
   */
    void retreiveIcon(int callId, const QCString& replyType, const QByteArray &replyData);
	void slotGotWindowName(int callId, const QCString& replyType, const QByteArray &replyData);
};

class DCOPBrowserInterfaceItem : public QObject, public DCOPBrowserItem
{
  public:

    DCOPBrowserInterfaceItem
    (
     DCOPBrowserApplicationItem * parent,
     const QCString & app,
     const QCString & object,
     bool def
    );

    virtual ~DCOPBrowserInterfaceItem() {}

    QCString app() const { return app_; }
    QCString object() const { return object_; }

    virtual void setOpen(bool o);

  protected:

    virtual void populate();

  private:

    QCString app_;
    QCString object_;
};


class DCOPBrowserFunctionItem : public DCOPBrowserItem
{
  public:

    DCOPBrowserFunctionItem
    (
     DCOPBrowserInterfaceItem * parent,
     const QCString & app,
     const QCString & object,
     const QCString & function
    );

    virtual ~DCOPBrowserFunctionItem() {}

    QCString app() const { return app_; }
    QCString object() const { return object_; }
    QCString function() const { return function_; }

    virtual void setOpen(bool o);

  private:

    QCString app_;
    QCString object_;
    QCString function_;
};

#endif