Use hideDropTarget-action from MainWindow.
[kdenetwork.git] / kget / ui / droptarget.h
blobc7d1da36d031491239cdce46808380bfb08a5d24
1 /* This file is part of the KDE project
3 Copyright (C) 2002 Patrick Charbonnier <pch@freeshell.org>
4 Based On Caitoo v.0.7.3 (c) 1998 - 2000, Matej Koss
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
12 #ifndef _DROPTARGET_H
13 #define _DROPTARGET_H
15 #include <QWidget>
16 #include <QDragEnterEvent>
17 #include <QMouseEvent>
18 #include <QDropEvent>
19 #include <QCloseEvent>
21 class QAction;
22 class QTimer;
23 class KMenu;
25 class MainWindow;
27 class DropTarget : public QWidget
29 Q_OBJECT
31 public:
32 DropTarget(MainWindow * parent);
33 ~DropTarget();
35 void playAnimationShow();
36 void playAnimationHide();
37 void playAnimationSync();
38 void setVisible( bool shown, bool internal = true );
40 protected:
41 // drag and drop
42 void dragEnterEvent(QDragEnterEvent *);
43 void dropEvent(QDropEvent *);
45 // handle quit events as hide events
46 void closeEvent( QCloseEvent * );
48 void mousePressEvent(QMouseEvent * e);
49 void mouseReleaseEvent(QMouseEvent * e);
50 void mouseDoubleClickEvent(QMouseEvent * e);
51 void mouseMoveEvent(QMouseEvent * e);
53 // paint the drop target
54 void paintEvent(QPaintEvent*);
56 private slots:
57 void toggleSticky();
58 void toggleMinimizeRestore();
59 void slotStartStopToggled( bool );
60 void slotAnimateShow();
61 void slotAnimateHide();
62 void slotAnimateSync();
63 void slotClose();
65 private:
66 KMenu * popupMenu;
67 MainWindow * parentWidget;
68 QTimer * animTimer;
69 QPixmap cachedPixmap;
71 QAction * pop_sticky;
72 QAction * pop_show;
74 QPoint position;
76 int dx;
77 int dy;
78 bool isdragging;
79 bool showInformation;
81 float ani_y, ani_vy;
84 #endif // _DROPTARGET_H