Commit ef1a3f8d authored by Ronan's avatar Ronan

feat(MessagesCountNotifier): notify messages count on Windows with sys tray icon

parent f1d1577a
......@@ -225,19 +225,12 @@ set(HEADERS
set(MAIN_FILE src/app/main.cpp)
if (UNIX AND NOT APPLE)
list(APPEND SOURCES src/components/core/messages-count-notifier/MessagesCountNotifierLinux.cpp)
list(APPEND HEADERS src/components/core/messages-count-notifier/MessagesCountNotifierLinux.hpp)
endif ()
if (WIN32)
list(APPEND SOURCES src/components/core/messages-count-notifier/MessagesCountNotifierWindows.cpp)
list(APPEND HEADERS src/components/core/messages-count-notifier/MessagesCountNotifierWindows.hpp)
endif ()
if (APPLE)
list(APPEND SOURCES src/components/core/messages-count-notifier/MessagesCountNotifierMacOs.m)
list(APPEND HEADERS src/components/core/messages-count-notifier/MessagesCountNotifierMacOs.hpp)
else ()
list(APPEND SOURCES src/components/core/messages-count-notifier/MessagesCountNotifierSystemTrayIcon.cpp)
list(APPEND HEADERS src/components/core/messages-count-notifier/MessagesCountNotifierSystemTrayIcon.hpp)
endif ()
if (ENABLE_DBUS)
......
......@@ -35,13 +35,11 @@
#include "components/sip-addresses/SipAddressesModel.hpp"
#include "utils/Utils.hpp"
#if defined(Q_OS_LINUX)
#include "messages-count-notifier/MessagesCountNotifierLinux.hpp"
#elif defined(Q_OS_MACOS)
#if defined(Q_OS_MACOS)
#include "messages-count-notifier/MessagesCountNotifierMacOs.hpp"
#elif defined(Q_OS_WIN)
#include "messages-count-notifier/MessagesCountNotifierWindows.hpp"
#endif // if defined(Q_OS_LINUX)
#else
#include "messages-count-notifier/MessagesCountNotifierSystemTrayIcon.hpp"
#endif // if defined(Q_OS_MACOS)
#include "CoreHandlers.hpp"
#include "CoreManager.hpp"
......
......@@ -20,6 +20,9 @@
* Author: Ronan Abhamon
*/
#ifndef ABSTRACT_MESSAGES_COUNT_NOTIFIER_H_
#define ABSTRACT_MESSAGES_COUNT_NOTIFIER_H_
#include <memory>
#include <QObject>
......@@ -51,3 +54,5 @@ private:
int mUnreadMessagesCount = 0;
};
#endif // ABSTRACT_MESSAGES_COUNT_NOTIFIER_H_
......@@ -20,6 +20,9 @@
* Author: Ghislain MARY
*/
#ifndef MESSAGES_COUNT_NOTIFIER_MAC_OS_H_
#define MESSAGES_COUNT_NOTIFIER_MAC_OS_H_
#include "AbstractMessagesCountNotifier.hpp"
extern "C" void notifyUnreadMessagesCountMacOS (int n);
......@@ -34,3 +37,5 @@ public:
notifyUnreadMessagesCountMacOS(n);
}
};
#endif // MESSAGES_COUNT_NOTIFIER_MAC_OS_H_
/*
* MessagesCountNotifierLinux.hpp
* MessagesCountNotifierSystemTrayIcon.hpp
* Copyright (C) 2017-2018 Belledonne Communications, Grenoble, France
*
* This program is free software; you can redistribute it and/or
......@@ -31,7 +31,7 @@
#include "utils/LinphoneUtils.hpp"
#include "utils/Utils.hpp"
#include "MessagesCountNotifierLinux.hpp"
#include "MessagesCountNotifierSystemTrayIcon.hpp"
// =============================================================================
......
/*
* MessagesCountNotifierLinux.hpp
* MessagesCountNotifierSystemTrayIcon.hpp
* Copyright (C) 2017-2018 Belledonne Communications, Grenoble, France
*
* This program is free software; you can redistribute it and/or
......@@ -20,6 +20,9 @@
* Author: Ronan Abhamon
*/
#ifndef MESSAGES_COUNT_NOTIFIER_SYSTEM_TRAY_ICON_H_
#define MESSAGES_COUNT_NOTIFIER_SYSTEM_TRAY_ICON_H_
#include "AbstractMessagesCountNotifier.hpp"
// =============================================================================
......@@ -42,3 +45,5 @@ private:
QTimer *mBlinkTimer = nullptr;
bool mDisplayCounter = false;
};
#endif // MESSAGES_COUNT_NOTIFIER_SYSTEM_TRAY_ICON_H_
/*
* MessagesCountNotifierWindows.cpp
* Copyright (C) 2017-2018 Belledonne Communications, Grenoble, France
*
* 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 2
* 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, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Created on: August 7, 2017
* Author: Ronan Abhamon
*/
#include "MessagesCountNotifierWindows.hpp"
// =============================================================================
MessagesCountNotifier::MessagesCountNotifier (QObject *parent) : AbstractMessagesCountNotifier(parent) {
// TODO.
}
void MessagesCountNotifier::notifyUnreadMessagesCount (int n) {
// TODO.
Q_UNUSED(n);
}
/*
* MessagesCountNotifierWindows.hpp
* Copyright (C) 2017-2018 Belledonne Communications, Grenoble, France
*
* 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 2
* 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, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Created on: August 7, 2017
* Author: Ronan Abhamon
*/
#include "AbstractMessagesCountNotifier.hpp"
// =============================================================================
class MessagesCountNotifier : public AbstractMessagesCountNotifier {
public:
MessagesCountNotifier (QObject *parent = Q_NULLPTR);
protected:
void notifyUnreadMessagesCount (int n) override;
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment