OSDN Git Service

Bump version.
[lamexp/LameXP.git] / src / Dialog_DropBox.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2020 LoRd_MuldeR <MuldeR2@GMX.de>
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU GENERAL PUBLIC LICENSE as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version; always including the non-optional
9 // LAMEXP GNU GENERAL PUBLIC LICENSE ADDENDUM. See "License.txt" file!
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License along
17 // with this program; if not, write to the Free Software Foundation, Inc.,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 //
20 // http://www.gnu.org/licenses/gpl-2.0.txt
21 ///////////////////////////////////////////////////////////////////////////////
22
23 #pragma once
24
25 #include <QDialog>
26
27 //UIC forward declartion
28 namespace Ui {
29         class DropBox;
30 }
31
32 //Class declarations
33 class QAbstractItemModel;
34 class QDragEnterEvent;
35 class QLabel;
36 class QMouseEvent;
37 class QPoint;
38 class SettingsModel;
39
40 //DropBox class
41 class DropBox: public QDialog
42 {
43         Q_OBJECT
44
45 public:
46         DropBox(QWidget *parent = 0, QAbstractItemModel *model = 0, SettingsModel *settings = 0);
47         ~DropBox(void);
48         
49 private:
50         Ui::DropBox *ui; //for Qt UIC
51
52         bool m_canClose;
53         QPoint *m_mouseReferencePoint;
54         QPoint *m_windowReferencePoint;
55         QLabel *m_counterLabel;
56         QAbstractItemModel *const m_model;
57         SettingsModel *const m_settings;
58         bool m_moving;
59         bool m_firstShow;
60         QRect m_screenGeometry;
61
62         static void boundWidget(QWidget *widget);
63
64 protected:
65         void keyPressEvent(QKeyEvent *event);
66         void keyReleaseEvent(QKeyEvent *event);
67         void closeEvent(QCloseEvent *event);
68         void showEvent(QShowEvent *event);
69         void mousePressEvent(QMouseEvent *event);
70         void mouseMoveEvent(QMouseEvent *event);
71         void mouseReleaseEvent(QMouseEvent *event);
72         void changeEvent(QEvent *e);
73         bool event(QEvent *event);
74
75 public slots:
76         void modelChanged(void);
77         void showToolTip(void);
78 };