KVIrc  4.9.2
DeveloperAPIs
FileTransferWindow.h
Go to the documentation of this file.
1 #ifndef _FILETRANSFERWINDOW_H_
2 #define _FILETRANSFERWINDOW_H_
3 //=============================================================================
4 //
5 // File : FileTransferWindow.h
6 // Creation date : Mon Apr 21 2003 23:14:12 CEST by Szymon Stefanek
7 //
8 // This file is part of the KVIrc IRC client distribution
9 // Copyright (C) 2003-2010 Szymon Stefanek (pragma at kvirc dot net)
10 //
11 // This program is FREE software. You can redistribute it and/or
12 // modify it under the terms of the GNU General Public License
13 // as published by the Free Software Foundation; either version 2
14 // of the License, or (at your option) any later version.
15 //
16 // This program is distributed in the HOPE that it will be USEFUL,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 // See the GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, write to the Free Software Foundation,
23 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 //
25 //=============================================================================
26 
27 #include "KviWindow.h"
28 #include "KviCString.h"
29 #include "KviIrcSocket.h"
30 #include "KviIrcServerParser.h"
31 #include "KviConsoleWindow.h"
32 #if 0
33 #include "KviModuleExtension.h"
34 #endif
35 #include "KviFileTransfer.h"
36 #include "KviDynamicToolTip.h"
37 #include "KviTalTableWidget.h"
39 
40 #include <QTimer>
41 #include <QPixmap>
42 #include <QMenu>
43 
44 class FileTransferItem;
45 
47 {
49  Q_OBJECT
50  Q_PROPERTY(int TransparencyCapable READ dummyRead)
51 public:
52  FileTransferWidget(QWidget * pParent);
54  void paintEvent(QPaintEvent * event);
55  int dummyRead() const { return 0; };
56 protected:
57  void mousePressEvent(QMouseEvent * e);
58  void mouseDoubleClickEvent(QMouseEvent * e);
59 signals:
60  void rightButtonPressed(FileTransferItem *, QPoint pnt);
61  void doubleClicked(FileTransferItem *, QPoint pnt);
62 };
63 
65 {
66 public:
69 
70 protected:
72  KviTalTableWidgetItem * col1Item; //item on the second column
73  KviTalTableWidgetItem * col2Item; //item on the third column
74 public:
76  virtual QString key(int column, bool bAcending) const;
77  virtual void displayUpdate();
78 };
79 
81 {
82  Q_OBJECT
83 public:
84  FileTransferItemDelegate(QAbstractItemView * pWidget = 0)
87  QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const;
88  void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const;
89 };
90 
92 #if 0
93  ,public KviModuleExtension
94 #endif
95 {
96  friend class FileTransferItem;
98  Q_OBJECT
99 public:
101 #if 0
103 #endif
104  );
106 
107 protected:
108  QSplitter * m_pVertSplitter;
110  QAbstractItemDelegate * m_pItemDelegate;
114  QTimer * m_pTimer;
115  int m_iLineSpacing; // cached fm value
116 public: // Methods
117  virtual void die();
118 
119 protected:
120  virtual QPixmap * myIconPtr();
121  virtual void fillCaptionBuffers();
122  virtual void applyOptions();
123  virtual void resizeEvent(QResizeEvent * e);
124  virtual void getBaseLogFileName(QString & buffer);
126  void fillTransferView();
128  bool eventFilter(QObject * obj, QEvent * ev);
129 
130 public:
131  virtual QSize sizeHint() const;
132  int lineSpacing() { return m_iLineSpacing; };
133 protected slots:
136  void rightButtonPressed(FileTransferItem * it, const QPoint & pnt);
137  void doubleClicked(FileTransferItem * it, const QPoint & pnt);
138  void heartbeat();
139  void clearTerminated();
140  void clearAll();
141  void tipRequest(KviDynamicToolTip * tip, const QPoint & pnt);
142  void openLocalFile();
143  void openLocalFileWith();
145  void openLocalFileFolder();
146  void openFilePopupActivated(QAction * pAction);
147  void openLocalFileTerminal();
148  void deleteLocalFile();
149 };
150 
151 #endif //_FILETRANSFERWINDOW_H_
void rightButtonPressed(FileTransferItem *, QPoint pnt)
Definition: KviDynamicToolTip.h:49
Definition: KviFileTransfer.h:78
void deleteLocalFile()
Definition: FileTransferWindow.cpp:630
void tipRequest(KviDynamicToolTip *tip, const QPoint &pnt)
Definition: FileTransferWindow.cpp:342
void transferUnregistering(KviFileTransfer *t)
Definition: FileTransferWindow.cpp:386
KviFileTransfer * transfer()
Definition: FileTransferWindow.h:75
void fillTransferView()
Definition: FileTransferWindow.cpp:351
int dummyRead() const
Definition: FileTransferWindow.h:55
void openLocalFile()
Definition: FileTransferWindow.cpp:650
bool eventFilter(QObject *obj, QEvent *ev)
Definition: FileTransferWindow.cpp:318
QAbstractItemDelegate * m_pItemDelegate
Definition: FileTransferWindow.h:110
~FileTransferWindow()
Definition: FileTransferWindow.cpp:312
QSplitter * m_pVertSplitter
Definition: FileTransferWindow.h:108
virtual QString key(int column, bool bAcending) const
Definition: FileTransferWindow.cpp:103
void openLocalFileTerminal()
Definition: FileTransferWindow.cpp:590
FileTransferItem(FileTransferWidget *v, KviFileTransfer *t)
Definition: FileTransferWindow.cpp:74
virtual QPixmap * myIconPtr()
Definition: FileTransferWindow.cpp:839
void openLocalFileWith()
Definition: FileTransferWindow.cpp:691
virtual void resizeEvent(QResizeEvent *e)
Definition: FileTransferWindow.cpp:844
void openFilePopupActivated(QAction *pAction)
Definition: FileTransferWindow.cpp:554
Definition: FileTransferWindow.h:91
void mouseDoubleClickEvent(QMouseEvent *e)
Definition: FileTransferWindow.cpp:174
FileTransferWidget * m_pTableWidget
Definition: FileTransferWindow.h:109
Definition: KviTalTableWidget.h:67
int lineSpacing()
Definition: FileTransferWindow.h:132
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: FileTransferWindow.cpp:223
int m_iLineSpacing
Definition: FileTransferWindow.h:115
Definition: KviTalTableWidget.h:47
#define e
Definition: detector.cpp:69
KviFileTransfer * m_pTransfer
Definition: FileTransferWindow.h:71
FileTransferItem * findItem(KviFileTransfer *t)
Definition: FileTransferWindow.cpp:364
QMenu * m_pOpenFilePopup
Definition: FileTransferWindow.h:113
virtual void getBaseLogFileName(QString &buffer)
Definition: FileTransferWindow.cpp:834
FileTransferItemDelegate(QAbstractItemView *pWidget=0)
Definition: FileTransferWindow.h:84
Definition: FileTransferWindow.h:64
char s d
Definition: KviIrcNumericCodes.h:391
void doubleClicked(FileTransferItem *it, const QPoint &pnt)
Definition: FileTransferWindow.cpp:396
FileTransferWidget(QWidget *pParent)
Definition: FileTransferWindow.cpp:124
void openLocalFileFolder()
Definition: FileTransferWindow.cpp:734
virtual void fillCaptionBuffers()
Definition: FileTransferWindow.cpp:854
~FileTransferWidget()
Definition: FileTransferWindow.h:53
virtual void applyOptions()
Definition: FileTransferWindow.cpp:864
~FileTransferItem()
Definition: FileTransferWindow.cpp:87
Definition: FileTransferWindow.h:80
QHashIterator< int, QFile * > t(getDict)
virtual void displayUpdate()
Definition: FileTransferWindow.cpp:94
KviFileTransfer * selectedTransfer()
Definition: FileTransferWindow.cpp:543
Definition: KviModuleExtension.h:132
Toolkit Abstraction Layer: itemdelegate class.
Definition: KviTalIconAndRichTextItemDelegate.h:52
Base class for all windows in KVIrc.
Definition: KviWindow.h:74
Lower stack protocol for IRC connection.
Definition: KviModuleExtension.h:51
QMenu * m_pContextPopup
Definition: FileTransferWindow.h:111
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: FileTransferWindow.cpp:246
void copyLocalFileToClipboard()
Definition: FileTransferWindow.cpp:723
void clearTerminated()
Definition: FileTransferWindow.cpp:829
void rightButtonPressed(FileTransferItem *it, const QPoint &pnt)
Definition: FileTransferWindow.cpp:402
KviTalTableWidgetItem * col2Item
Definition: FileTransferWindow.h:73
void transferRegistered(KviFileTransfer *t)
Definition: FileTransferWindow.cpp:381
void clearAll()
Definition: FileTransferWindow.cpp:800
Contains the KviWindow class.
Class for item delegates.
QMenu * m_pLocalFilePopup
Definition: FileTransferWindow.h:112
void paintEvent(QPaintEvent *event)
Definition: FileTransferWindow.cpp:188
#define v
Definition: detector.cpp:86
Definition: FileTransferWindow.h:46
Definition: KviTalTableWidget.h:36
KviTalTableWidgetItem * col1Item
Definition: FileTransferWindow.h:72
void heartbeat()
Definition: FileTransferWindow.cpp:777
FileTransferWindow()
Definition: FileTransferWindow.cpp:252
QTimer * m_pTimer
Definition: FileTransferWindow.h:114
void doubleClicked(FileTransferItem *, QPoint pnt)
~FileTransferItemDelegate()
Definition: FileTransferWindow.h:86
int TransparencyCapable
Definition: FileTransferWindow.h:50
virtual QSize sizeHint() const
Definition: FileTransferWindow.cpp:849
void mousePressEvent(QMouseEvent *e)
Definition: FileTransferWindow.cpp:157
virtual void die()
Definition: FileTransferWindow.cpp:859