File: session.h

package info (click to toggle)
dc-qt 0.2.0.alpha-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,936 kB
  • ctags: 5,361
  • sloc: cpp: 28,936; makefile: 19
file content (73 lines) | stat: -rw-r--r-- 1,409 bytes parent folder | download | duplicates (4)
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
//
// C++ Interface: session
//
// Description: 
//
//
// Author: Rikard Bjorklind <olof@users.sourceforge.net>, (C) 2006
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef SESSION_H
#define SESSION_H

#include <boost/shared_ptr.hpp>

#include <QWidget>
#include "ui_hub.h"

class QMennu;

class UserListModel;
class User;

/**
	Holds the session ui.
	@author Rikard Bjorklind <olof@users.sourceforge.net>
*/
class Session : public QWidget
{
Q_OBJECT
public:
    Session(int aId,
			QWidget *parent = 0);
    ~Session();
	int getId() {return myId;}
	qint64 getTotalShared() {return shared;}
	
public slots:
	void onFailed(const QString&);
	void onPrivateChatMessage(const QString& from,const QString& msg);
	void onUsersUpdated(QList<User*> users);
	void onChatMessage(const QString&);
	void onUserRemoved(int id);
	void onHubStats(qint64 totshared);
	
	void onGetFileList();
	void onOpenChat() {}
	void onAddFav() {}
	
	// Auto-slots
	void on_chatEdit_returnPressed();
	void on_userView_doubleClicked( const QModelIndex& index);
	void on_userView_customContextMenuRequested( const QPoint& pos );
	
private:
	void createMenu();
	
	void getFileList( const QModelIndex& index );
	
	Ui::HubForm ui;
	UserListModel* userModel;
	
	boost::shared_ptr<QMenu> contextMenu;
	
	int myId;
	qint64 shared;	
signals:
	void sendChat(int,const QString&);
	void getUserFileList(int);
};

#endif