theshell/mainwindow.h

241 lines
5.3 KiB
C
Raw Normal View History

2017-08-05 15:20:02 +10:00
/****************************************
*
* theShell - Desktop Environment
* Copyright (C) 2017 Victor Tran
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* *************************************/
2016-02-17 17:24:00 +11:00
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
2016-03-17 19:46:40 +11:00
#include <QTimer>
#include <QList>
#include <QProcess>
#include <QSignalMapper>
#include <QDesktopWidget>
#include <QDateTime>
#include <QtDBus/QDBusConnection>
#include <QMessageBox>
2016-03-29 17:42:24 +11:00
#include <QSettings>
2016-04-03 10:41:46 +10:00
#include <QSoundEffect>
#include <QPainter>
#include <QMenu>
2016-11-25 15:24:09 +11:00
#include <QAction>
#include <math.h>
2016-03-17 19:46:40 +11:00
#include "window.h"
#include "menu.h"
#include "notificationdbus.h"
#include "upowerdbus.h"
#include "infopanedropdown.h"
2016-05-29 17:03:52 +10:00
#include "touchkeyboard.h"
2016-06-11 17:07:36 +10:00
#include "systrayicons.h"
#include "fadebutton.h"
2016-05-29 17:03:52 +10:00
#include "FlowLayout/flowlayout.h"
2016-12-17 23:58:08 +11:00
#include "tutorialwindow.h"
2017-01-12 01:00:27 +11:00
#include "audiomanager.h"
2017-08-04 21:18:42 +10:00
#include "taskbarmanager.h"
2016-05-29 17:03:52 +10:00
#include <systemd/sd-login.h>
#include <systemd/sd-daemon.h>
2017-05-02 17:12:21 +10:00
#include "locationservices.h"
2016-05-29 17:03:52 +10:00
class Menu;
class InfoPaneDropdown;
2016-02-17 17:24:00 +11:00
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
2016-03-29 17:42:24 +11:00
Q_PROPERTY(QRect geometry READ geometry WRITE setGeometry)
2016-02-17 17:24:00 +11:00
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
2016-03-29 17:42:24 +11:00
void setGeometry(int x, int y, int w, int h);
void setGeometry(QRect geometry);
InfoPaneDropdown* getInfoPane();
void show();
2016-02-17 17:24:00 +11:00
2016-07-06 12:37:05 +10:00
bool isMprisAvailable();
bool isMprisPlaying();
void nextSong();
void playPause();
void play();
void pause();
void previousSong();
QString mprisApp();
QString songName();
QString songArtist();
QString songAlbum();
public slots:
void openMenu(bool openTotheWave = false, bool startListening = false);
void doUpdate();
2017-02-10 17:40:34 +11:00
void updateStruts();
2016-03-17 19:46:40 +11:00
private slots:
void on_time_clicked();
2016-03-29 17:42:24 +11:00
void on_date_clicked();
void on_pushButton_2_clicked();
2017-01-12 01:00:27 +11:00
void internetLabelChanged(QString display, int signalStrength);
2016-03-29 17:42:24 +11:00
void on_networkLabel_clicked();
void on_notifications_clicked();
void on_batteryLabel_clicked();
void on_volumeFrame_MouseEnter();
void on_volumeFrame_MouseExit();
void on_volumeSlider_sliderMoved(int position);
void on_volumeSlider_valueChanged(int value);
void on_brightnessFrame_MouseEnter();
void on_brightnessFrame_MouseExit();
void on_brightnessSlider_sliderMoved(int position);
void on_brightnessSlider_valueChanged(int value);
2016-04-03 10:41:46 +10:00
void on_volumeSlider_sliderReleased();
void numNotificationsChanged(int notifications);
2016-05-29 17:03:52 +10:00
void pullDownGesture();
void on_pushButton_4_clicked();
void setTimer(QString timer);
void setTimerVisible(bool visible);
void setTimerEnabled(bool enable);
void on_timerIcon_clicked();
void on_timer_clicked();
2016-06-12 11:28:41 +10:00
void DBusNewService(QString name);
void on_mprisPause_clicked();
void on_mprisBack_clicked();
2016-07-06 12:37:05 +10:00
void on_mprisForward_clicked();
2016-06-12 11:28:41 +10:00
void on_mprisSongName_clicked();
void ActivateWindow();
void reloadScreens();
2016-06-30 16:07:29 +10:00
void on_desktopNext_clicked();
void on_desktopBack_clicked();
void on_openMenu_clicked();
void on_mprisSelection_triggered(QAction *arg1);
void updateMpris();
2017-01-12 01:00:27 +11:00
void on_time_dragging(int , int );
void on_time_mouseReleased();
void on_date_dragging(int , int );
void on_date_mouseReleased();
void on_batteryLabel_dragging(int , int );
void on_batteryLabel_mouseReleased();
void on_networkLabel_dragging(int , int );
void on_networkLabel_mouseReleased();
void on_notifications_dragging(int , int );
void on_notifications_mouseReleased();
2017-04-24 15:49:10 +10:00
void on_actionNone_triggered();
void on_actionNotifications_triggered();
void on_actionMute_triggered();
2017-08-04 21:18:42 +10:00
void updateWindow(WmWindow window);
void deleteWindow(WmWindow window);
2016-07-01 14:01:19 +10:00
signals:
void reloadBackgrounds();
2016-06-30 16:07:29 +10:00
2016-02-17 17:24:00 +11:00
private:
Ui::MainWindow *ui;
2017-08-04 21:18:42 +10:00
//QList<WmWindow> windowList;
Menu* gatewayMenu;
2017-08-04 21:18:42 +10:00
TaskbarManager* taskbarManager;
QMap<Window, FadeButton*> buttonWindowMap;
2016-03-17 19:46:40 +11:00
2016-07-01 14:01:19 +10:00
QSettings settings;
2016-03-17 19:46:40 +11:00
int hideTop = 0;
bool hiding = false;
2016-03-29 17:42:24 +11:00
bool lockHide = false;
2016-06-28 16:48:19 +10:00
int attentionDemandingWindows = 0;
int oldDesktop = 0;
Window oldActiveWindow = 0;
2016-06-28 16:48:19 +10:00
bool borderBlinkOn = true;
bool warningAnimCreated = false;
int warningWidth = 0;
bool forceWindowMove = false;
2016-03-29 17:42:24 +11:00
2016-06-12 11:28:41 +10:00
QString mprisCurrentAppName = "";
QStringList mprisDetectedApps;
2016-07-06 12:37:05 +10:00
QString mprisTitle;
QString mprisArtist;
QString mprisAlbum;
bool mprisPlaying;
bool pauseMprisMenuUpdate = false;
2016-06-12 11:28:41 +10:00
2016-03-29 17:42:24 +11:00
void closeEvent(QCloseEvent*);
void paintEvent(QPaintEvent *event);
2016-03-17 19:46:40 +11:00
2016-03-29 17:42:24 +11:00
InfoPaneDropdown *infoPane;
2017-02-10 17:40:34 +11:00
QGraphicsOpacityEffect* statusBarOpacityEffect;
bool statusBarVisible = false;
2016-02-17 17:24:00 +11:00
};
#endif // MAINWINDOW_H