#ifndef __WINDOW_HPP__ #define __WINDOW_HPP__ #include class Client; class XMLQueueParser; class XMLOnelinerParser; class QAction; class QGroupBox; class QFrame; class QVBoxLayout; class QHBoxLayout; class QTableWidget; class QSlider; class QLabel; class QTimer; class QResizeEvent; class QPushButton; class QIcon; class QLineEdit; class AnimatedText; class QSystemTrayIcon; class Window : public QMainWindow { Q_OBJECT private: Client* client; XMLQueueParser* xmlQueueParser; XMLOnelinerParser* xmlOnelinerParser; // Menu // File QAction* connectMenu; QAction* favoriteMenu; QAction* favoriteLastMenu; QAction* onelinerMenu; QAction* closeMenu; // Vote QAction* vote1; QAction* vote2; QAction* vote3; QAction* vote4; QAction* vote5; // View QAction* coloursMenu; QAction* musicSwitchMenu; QAction* onelinerSwitchMenu; QAction* notificationSwitchMenu; QHBoxLayout* globalHBox; QFrame* musicFrame; QVBoxLayout* musicVBox; QVBoxLayout* onelinerVBox; // Now playing part QGroupBox* nowGroupBox; QVBoxLayout* nowSongBox; QSlider* songPositionSlider; QLabel* songLabel; QLabel* songTimeLabel; QTimer* updateSliderTimer; QTimer* updateFavoriteButton; //QTableWidget* nowQueueTable; // Rest of the window (two tables) QTableWidget* requestQueueTable; QTableWidget* historyQueueTable; // Oneliner QGroupBox* onelinerBox; AnimatedText* onelinerViewer; QLineEdit* onelinerChat; QTimer* updateQueueTimer; QTimer* updateOnelinerTimer; QPushButton* favoriteButton; QHBoxLayout* voteBox; QPushButton* voteButton1; QPushButton* voteButton2; QPushButton* voteButton3; QPushButton* voteButton4; QPushButton* voteButton5; // Icons for the voting button QIcon* logo; QIcon* favIcon; QIcon* redStar; QIcon* emptyStar; // Vote icons QIcon* vote1Icon; QIcon* vote2Icon; QIcon* vote3Icon; QIcon* vote4Icon; QIcon* vote5Icon; // System tray icon QSystemTrayIcon* trayIcon; // Special timer for resizing tables QTimer* resizeTimer; unsigned int songLengthMin; unsigned int songLengthSec; unsigned int songPositionMin; unsigned int songPositionSec; bool notification; /** * Create a new entry in the QMenu* * * @param QMenu* the parent menu of the entry * @param const QString& the name of the entry * @param const QString& the key sequence to set to the menu * @param const QString& the tip displayed when the cursor is on the entry * @param const QObject* the pointer of the receiver of the connection * @param const char* the function called when the signal is emitted * @param const bool false if the menu is disabled * @param const bool false if the menu is not checkable * @return QAction* return the entry newly created * @brief - Create the entry * - Assign a shortcut * - Assign a status description * - Set if the menu is enabled or not * - Connect the funtion */ QAction* addAction( QMenu* parentMenu, const QString& entryName, const QString& keySequence, const QString& statusTipMessage, const QObject* object, const char* slot, const bool enabled = true, const bool checkable = false); void setFavoriteButton(void); void setVoteButton(void); void setOnelinerChat(void); void updateQueue(void); void updateOneliner(void); public slots: void aboutBox(void); void connection(void); void checkIfConnected(void); void favoriteMusic(void); void favoriteLastMusic(void); void reloadQueue(void); void reloadOneliner(void); void sendMessage(void); void voteScore1(void); void voteScore2(void); void voteScore3(void); void voteScore4(void); void voteScore5(void); void updateXmlFile(bool error); void updateSlider(void); void resizeTables(void); // View related void switchColours(void); void switchMusic(void); void switchOneliner(void); void switchNotification(void); // History related void loadHistoryMenu(void); void saveHistoryMenu(void); public: Window(const QString& windowName, const unsigned int width, const unsigned int height, QWidget* parent=0); ~Window(void); }; #endif