OSDN Git Service

Implement Drag&Drop support
[lamexp/LameXP.git] / src / Dialog_MainWindow.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2010 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.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License along
16 // with this program; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 //
19 // http://www.gnu.org/licenses/gpl-2.0.txt
20 ///////////////////////////////////////////////////////////////////////////////
21
22 #pragma once
23
24 #include "../tmp/UIC_MainWindow.h"
25
26 #include "Model_FileList.h"
27
28 //Class declarations
29 class QFileSystemModel;
30 class WorkingBanner;
31 class MessageHandlerThread;
32 class AudioFileModel;
33 class MetaInfoModel;
34 class SettingsModel;
35
36 class MainWindow: public QMainWindow, private Ui::MainWindow
37 {
38         Q_OBJECT
39
40 public:
41         MainWindow(QWidget *parent = 0);
42         ~MainWindow(void);
43
44 private slots:
45         void windowShown(void);
46         void aboutButtonClicked(void);
47         void encodeButtonClicked(void);
48         void addFilesButtonClicked(void);
49         void clearFilesButtonClicked(void);
50         void removeFileButtonClicked(void);
51         void fileDownButtonClicked(void);
52         void fileUpButtonClicked(void);
53         void showDetailsButtonClicked(void);
54         void tabPageChanged(int idx);
55         void tabActionActivated(QAction *action);
56         void styleActionActivated(QAction *action);
57         void outputFolderViewClicked(const QModelIndex &index);
58         void makeFolderButtonClicked(void);
59         void gotoHomeFolderButtonClicked(void);
60         void gotoDesktopButtonClicked(void);
61         void gotoMusicFolderButtonClicked(void);
62         void checkUpdatesActionActivated(void);
63         void visitHomepageActionActivated(void);
64         void openFolderActionActivated(void);
65         void notifyOtherInstance(void);
66         void addFileDelayed(const QString &filePath);
67         void handleDelayedFiles(void);
68         void editMetaButtonClicked(void);
69         void clearMetaButtonClicked(void);
70         void updateBitrate(int value);
71
72 protected:
73         void showEvent(QShowEvent *event);
74         void dragEnterEvent(QDragEnterEvent *event);
75         void dropEvent(QDropEvent *event);
76
77 private:
78         void addFiles(const QStringList &files);
79
80         FileListModel *m_fileListModel;
81         QFileSystemModel *m_fileSystemModel;
82         QActionGroup *m_tabActionGroup;
83         QActionGroup *m_styleActionGroup;
84         WorkingBanner *m_banner;
85         MessageHandlerThread *m_messageHandler;
86         QStringList *m_delayedFileList;
87         QTimer *m_delayedFileTimer;
88         AudioFileModel *m_metaData;
89         MetaInfoModel *m_metaInfoModel;
90         SettingsModel *m_settings;
91 };