Files
MuditaOS/module-apps/application-call/ApplicationCall.hpp
Alek-Mudita 1446a4bff8 Egd 2539 duration class (#258)
* [GED-2539] Timestamp : changed buffer to heap one

[EGD-2539] implemented 1st version of Duration class

[EGD-2539] added autoformating of the output

[EGD-2539] clean up

[EGD-2539] used duration in call and calllog
added Duration operators

[EGD-2539] add better duartions to calllog.db

[EGD-2539] format file

* [EGD-2539] fixes after rebase

* [EGD-2539] displayed format follows design guidline

* [EGD-2539] added UT for duration class and necessary FW fixes

* [EGD-2539] fixed tim_conversion UT

* [EGD-2539] PR fixes

* [EGD-2539] added move constructor to UTF8 class

* [EGD-2539] added checking for nullptr in fillContactData

* [EGD-2539] PR fixes
2020-03-25 17:14:00 +01:00

58 lines
2.1 KiB
C++

#pragma once
#include "Application.hpp"
#include "Service/Message.hpp"
#include "SystemManager/SystemManager.hpp"
#include <service-cellular/api/CellularServiceAPI.hpp>
#include <time/time_conversion.hpp>
namespace app
{
inline const std::string name_call = "ApplicationCall";
namespace window
{
inline const std::string name_call = "CallWindow";
inline const std::string name_enterNumber = "EnterNumberWindow";
inline const std::string name_emergencyCall = "EmergencyCallWindow";
inline const std::string name_duplicatedContact = "DuplicatedContactWindow";
} // namespace window
class ApplicationCall : public Application
{
private:
void CallAbortHandler();
void CallActiveHandler();
void IncomingCallHandler(const CellularNotificationMessage *const msg);
void RingingHandler(const CellularNotificationMessage *const msg);
protected:
std::string phoneNumber;
AppTimer timerCall;
utils::time::Timestamp callStartTime = 0;
utils::time::Duration callDuration;
utils::time::Timestamp callDelayedStopTime = 0;
void timerCallCallback();
public:
ApplicationCall(std::string name = name_call, std::string parent = "", bool startBackgound = false);
~ApplicationCall() override = default;
sys::Message_t 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() override;
void destroyUserInterface() override;
void setDisplayedNumber(std::string num);
const std::string &getDisplayedNumber();
// starts timer that upon triggering, if no user action was performed, will hide application to background and
// move to previous application
void runCallTimer();
void stopCallTimer();
};
} /* namespace app */