diff --git a/app/SysTray-X/windowctrl-win.cpp b/app/SysTray-X/windowctrl-win.cpp index 14af8d5..7943ebb 100644 --- a/app/SysTray-X/windowctrl-win.cpp +++ b/app/SysTray-X/windowctrl-win.cpp @@ -5,9 +5,59 @@ /* * Constructor */ -WindowCtrl::WindowCtrl(QObject *parent) : QObject(parent) +WindowCtrlWin::WindowCtrlWin( QObject *parent) : QObject( parent ) { } + +/* + * Find the window with title + */ +bool WindowCtrlWin::findWindow( const QString& title ) +{ + return false; +} + + +/* + * Display the window elements + */ +void WindowCtrlWin::displayWindowElements( const QString& title ) +{ +} + + +/* + * Get the Thunderbird window ID + */ +QList< WinId > WindowCtrlWin::getWinIds() +{ + return m_tb_windows; +} + + +/* + * Minimize a window + */ +void WindowCtrlWin::minimizeWindow( WinId window ) +{ +} + + +/* + * Normalize a window + */ +void WindowCtrlWin::normalizeWindow( WinId window ) +{ +} + + +/* + * Hide a window + */ +void WindowCtrlWin::hideWindow( WinId window, bool state ) +{ +} + #endif // Q_OS_WIN diff --git a/app/SysTray-X/windowctrl-win.h b/app/SysTray-X/windowctrl-win.h index b5a58b5..fa3e66c 100644 --- a/app/SysTray-X/windowctrl-win.h +++ b/app/SysTray-X/windowctrl-win.h @@ -6,6 +6,14 @@ #include +/* + * Define the windows Id + */ +typedef unsigned long WinId; + +/** + * @brief The WindowCtrlWin class + */ class WindowCtrlWin : public QObject { Q_OBJECT @@ -19,6 +27,51 @@ class WindowCtrlWin : public QObject */ explicit WindowCtrlWin( QObject *parent = nullptr ); + /** + * @brief findWindow. Find window with title. + * + * @param title The title to find. + * + * @return State of the find. + */ + bool findWindow( const QString& title ); + + /** + * @brief displayWindowElements. Display window elements. + * + * @param title The title to find. + */ + void displayWindowElements( const QString& title ); + + /** + * @brief getWinIds. Get the Thunderbird window IDs. + * + * @return The list of window IDs. + */ + QList< WinId > getWinIds(); + + /** + * @brief minimizeWindow. Minimize window. + * + * @param window The window. + */ + void minimizeWindow( WinId window ); + + /** + * @brief normalizeWindow. Normalize window. + * + * @param window The window. + */ + void normalizeWindow( WinId window ); + + /** + * @brief hideWindow. Hide window. + * + * @param window The window. + * @param state The state of the window. + */ + void hideWindow( WinId window, bool state ); + signals: /** @@ -37,6 +90,20 @@ class WindowCtrlWin : public QObject * @brief signalWindowMinimuze. Signal minimize window. */ void signalWindowMinimize(); + + /** + * @brief signalConsole. Send a console message. + * + * @param message The message. + */ + void signalConsole( QString message ); + + private: + + /** + * @brief m_tb_window. The Thunderbird windows. + */ + QList< WinId > m_tb_windows; }; #endif // WINDOWCTRLWIN_H diff --git a/app/SysTray-X/windowctrl.cpp b/app/SysTray-X/windowctrl.cpp index ff44eb3..ef0490a 100644 --- a/app/SysTray-X/windowctrl.cpp +++ b/app/SysTray-X/windowctrl.cpp @@ -9,13 +9,18 @@ */ #include "windowctrl.h" +/* + * System includes + */ +#include "preferences.h" + /* * Constructor */ WindowCtrl::WindowCtrl( Preferences* pref, QObject *parent ) : #ifdef Q_OS_UNIX WindowCtrlUnix( parent ) -#elif Q_OS_WIN +#elif defined Q_OS_WIN WindowCtrlWin( parent ) #else public QObject @@ -40,7 +45,7 @@ void WindowCtrl::slotWindowTest1() // Do something. - displayWindowAtoms( "- Mozilla Thunderbird" ); + displayWindowElements( "- Mozilla Thunderbird" ); // findWindow( 4313 ); @@ -149,9 +154,9 @@ void WindowCtrl::slotShowHide() { m_state = "normal"; - foreach( unsigned long win_id, getWIds() ) + foreach( unsigned long win_id, getWinIds() ) { - skipTaskbarWindow( win_id, false ); + hideWindow( win_id, false ); normalizeWindow( win_id ); } @@ -160,11 +165,11 @@ void WindowCtrl::slotShowHide() } else { m_state = "minimized"; - foreach( unsigned long win_id, getWIds() ) + foreach( unsigned long win_id, getWinIds() ) { if( m_minimize_hide ) { - skipTaskbarWindow( win_id, true ); + hideWindow( win_id, true ); } minimizeWindow( win_id ); } diff --git a/app/SysTray-X/windowctrl.h b/app/SysTray-X/windowctrl.h index 7c94d2d..e1f531f 100644 --- a/app/SysTray-X/windowctrl.h +++ b/app/SysTray-X/windowctrl.h @@ -16,14 +16,15 @@ * Predefines */ class QWindow; +class Preferences; /** * @brief The WindowCtrl class. */ #ifdef Q_OS_UNIX class WindowCtrl : public WindowCtrlUnix -#elif Q_OS_WIN -class WindowCtrl : public WindowCtrl +#elif defined Q_OS_WIN +class WindowCtrl : public WindowCtrlWin #else class WindowCtrl : public QObject #endif