1 /***************************************************************************
3 * This program is free software; you can redistribute it and/or modify *
4 * it under the terms of the GNU General Public License as published by *
5 * the Free Software Foundation; either version 2 of the License, or *
6 * (at your option) any later version. *
8 ***************************************************************************/
19 #include "dccManagerbase.h"
20 #include "klistview.h"
27 class dccItem
: public QObject
,
51 dccItem( K3ListView
*, dccManager
*, enum dccType
, const QString
&file
, const QString
&who
, enum dccStatus
, unsigned int size
);
52 dccItem( K3ListViewItem
*, dccManager
*, enum dccType
, const QString
&file
, const QString
&who
, enum dccStatus
, unsigned int size
);
55 void changeStatus(enum dccStatus
);
56 void setReceivedBytes(int bytes
);
58 void setWhoPostfix(const QString
&post
);
59 void changeFilename(const QString
&file
);
60 void changeWho(const QString
&who
);
62 const QString
who() { return m_who
; }
63 const QString
file() { return m_file
; }
64 enum dccStatus
status() { return m_status
; }
65 enum dccType
type() { return m_type
; }
66 double getPercent() { return m_percent
; }
71 void statusChanged(Q3ListViewItem
*);
72 void itemRenamed(dccItem
*, QString oldNick
, QString oldFile
);
75 QString
enumToStatus(enum dccStatus
);
77 virtual void okRename ( int col
);
78 virtual void cancelRename ( int col
);
82 dccManager
*m_manager
;
88 enum dccStatus m_status
;
89 const enum dccType m_type
;
97 class dccManager
: public dccManagerbase
102 dccManager( QWidget
*parent
= 0, const char *name
= 0 );
105 dccItem
*newSendItem(QString file
, QString who
, enum dccItem::dccStatus
, unsigned int size
);
106 dccItem
*newGetItem(QString file
, QString who
, enum dccItem::dccStatus
, unsigned int size
);
107 dccItem
*newChatItem(QString who
, enum dccItem::dccStatus
);
109 void doChanged() { emit
changed(false, QString("dcc activity")); };
112 virtual void kpbNew_clicked();
113 virtual void kpbConnect_clicked();
114 virtual void kpbResume_clicked();
115 virtual void kpbRename_clicked();
116 virtual void kpbAbort_clicked();
119 void outputLine(QByteArray
);
120 void changed(bool, QString
);
121 void dccConnectClicked(dccItem
*);
122 void dccResumeClicked(dccItem
*);
123 void dccRenameClicked(dccItem
*);
124 void dccAbortClicked(dccItem
*);
127 virtual void getSelChange(Q3ListViewItem
*);
128 virtual void sendSelChange(Q3ListViewItem
*);
129 virtual void dccNewAccepted(int type
, QString nick
, QString file
);
133 K3ListViewItem
*m_getit
;
134 K3ListViewItem
*m_sendit
;
135 K3ListViewItem
*m_chatit
;
137 dccNew
*dccNewDialog
;