Files
MuditaOS/module-apps/application-calllog/ApplicationCallLog.hpp
Piotr Tański 81adfe41ab [EGD-6347] Refactored phone modes handling in applications
PhoneModeObserver doesn't work properly in applications.
Applications have to handle the phone mode changes via AppMgr.
Phone mode and tethering handlers separated.
2021-04-12 14:54:55 +02:00

49 lines
1.6 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.hpp>
#include <CalllogRecord.hpp>
#include <OptionWindow.hpp>
namespace app
{
inline constexpr auto CallLogAppStr = "ApplicationCallLog";
class ApplicationCallLog : public Application
{
public:
ApplicationCallLog(std::string name = CallLogAppStr,
std::string parent = {},
sys::phone_modes::PhoneMode mode = sys::phone_modes::PhoneMode::Connected,
StartInBackground startInBackground = {false});
~ApplicationCallLog() override;
sys::MessagePointer DataReceivedHandler(sys::DataMessage *msgl, sys::ResponseMessage *resp) override;
sys::ReturnCodes InitHandler() override;
sys::ReturnCodes DeinitHandler() override;
sys::ReturnCodes SwitchPowerModeHandler(const sys::ServicePowerMode mode) override final
{
return sys::ReturnCodes::Success;
}
void createUserInterface() final;
void destroyUserInterface() final;
bool removeCalllogEntry(const CalllogRecord &record);
bool setAllEntriesRead();
};
template <> struct ManifestTraits<ApplicationCallLog>
{
static auto GetManifest() -> manager::ApplicationManifest
{
return {{manager::actions::Launch, manager::actions::ShowCallLog, manager::actions::PhoneModeChanged}};
}
};
} /* namespace app */