summaryrefslogtreecommitdiffstats
path: root/src/gui/clientChatDialog.h
blob: 42bbb752bb5c8e2240ee48b93cc790d6cbf2c1f7 (plain) (blame)
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
/*
 # Copyright (c) 2009, 2010 - OpenSLX Project, Computer Center University of
 # Freiburg
 #
 # This program is free software distributed under the GPL version 2.
 # See http://openslx.org/COPYING
 #
 # If you have any feedback please consult http://openslx.org/feedback and
 # send your suggestions, praise, or complaints to feedback@openslx.org
 #
 # General information about OpenSLX can be found at http://openslx.org/
 */

#ifndef CLIENTCHATDIALOG_H_
#define CLIENTCHATDIALOG_H_

#include <QtGui>
#include "pvsinterface.h"
#include "clientFileSendDialog.h"
#include "ui_clientChatDialog.h"

class ClientChatDialog: public QDialog, private Ui::ClientChatDialogClass
{
Q_OBJECT

public:
    ClientChatDialog(QWidget *parent = 0);
    ~ClientChatDialog();
    void setTrayIcon(QSystemTrayIcon *trayIcon);

private Q_SLOTS:
    void send();
    void receive(QString nick_from, QString nick_to, QString msg);
    void addTab(QModelIndex i);
    void removeTab(int i);
    void addClient(QString nick);
    void removeClient(QString nick);
    void showMenu(QPoint p);
    void removeIcon(int i);
    void sendFile();
    void sendFile(QString filename);
    void connected();
    void disconnected();

protected:
    void dragEnterEvent(QDragEnterEvent *event);
    void dropEvent(QDropEvent *event);

private:
    QTextEdit* getTab(QString text);
    void printMsg(QString nick_from, QString msg, QTextEdit *t);
    void printEvent(QString msg);

    OrgOpenslxPvsInterface *_ifaceDBus;
    QHash<QString, QTextEdit*> *_hash;
    QSystemTrayIcon *_trayIcon;
    QString _nickname;
    QMenu *_menu;
    QAction *_sendFileAction;

};

#endif /* CLIENTCHATDIALOG_H_ */