mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-10-24 23:48:31 -04:00
This PR adds proper notification on call notifications coming from single number. To that end following changes have been introduced: * extension of Notification DB record with contact_id filed * use of `ContactRecordInterface` in `NotificationsRecordInterface` * extension of `Increment` query to require `PhoneNumber::View` * multiple minor changes on path from creating/handling `NotificationsRecord` to displaying respective notification.
61 lines
1.8 KiB
C++
61 lines
1.8 KiB
C++
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#pragma once
|
|
|
|
#include <application-desktop/models/ActiveNotificationsModel.hpp>
|
|
|
|
#include <AppWindow.hpp>
|
|
#include <gui/widgets/Label.hpp>
|
|
#include <Translator.hpp>
|
|
#include <ListView.hpp>
|
|
|
|
namespace app
|
|
{
|
|
class ApplicationDesktop;
|
|
}
|
|
|
|
namespace gui
|
|
{
|
|
class NotificationsModel;
|
|
|
|
class DesktopMainWindow : public AppWindow
|
|
{
|
|
protected:
|
|
gui::Label *time = nullptr;
|
|
gui::Label *dayText = nullptr;
|
|
|
|
gui::ListView *notificationsList = nullptr;
|
|
std::shared_ptr<gui::ActiveNotificationsModel> notificationsModel = nullptr;
|
|
|
|
// method hides or show widgets and sets bars according to provided state
|
|
void setVisibleState();
|
|
auto setActiveState() -> bool;
|
|
bool processLongReleaseEvent(const InputEvent &inputEvent);
|
|
bool processShortReleaseEvent(const InputEvent &inputEvent);
|
|
app::ApplicationDesktop *getAppDesktop() const;
|
|
|
|
public:
|
|
explicit DesktopMainWindow(app::Application *app);
|
|
|
|
// virtual methods gui::Window
|
|
bool onInput(const InputEvent &inputEvent) override;
|
|
void onBeforeShow(ShowMode mode, SwitchData *data) override;
|
|
// virtual methods gui::AppWindow
|
|
void rebuild() override;
|
|
void buildInterface() override;
|
|
void destroyInterface() override;
|
|
top_bar::Configuration configureTopBar(top_bar::Configuration appConfiguration) override;
|
|
|
|
bool updateTime() override;
|
|
|
|
private:
|
|
void invalidate() noexcept;
|
|
std::string osUpdateVer;
|
|
std::string osCurrentVer;
|
|
|
|
gui::KeyInputMappedTranslation translator;
|
|
};
|
|
|
|
} /* namespace gui */
|