Files
MuditaOS/module-apps/application-call/windows/CallWindow.hpp
Alek Rudnik 89eeba99eb Egd 3188 new sms enhancments (#355)
* [EGD-3188] new sms window - fix layout and functionalities

* [EGD-3188] sending sms from calllog and phonebook

* [EGD-3188] aborting the incoming call via sending sms template
Unufy sms ui common actions to use libphone number only
added default option to contactrecrord::getformattedname method

* [EGD-3188] fix for siwtching back from sms template window when the call is aborted

* [EGD-3188] PR fixes
2020-05-12 20:19:07 +02:00

66 lines
1.9 KiB
C++

#pragma once
#include "application-call/ApplicationCall.hpp"
#include "AppWindow.hpp"
#include "Rect.hpp"
#include "Image.hpp"
#include "application-call/widgets/Icons.hpp"
namespace gui
{
class CallWindow : public AppWindow
{
public:
enum class State
{
IDLE,
INCOMING_CALL,
OUTGOING_CALL,
CALL_IN_PROGRESS,
CALL_ENDED
};
protected:
// used to display both nnumber and name of contact
gui::Label *numberLabel = nullptr;
// used to inform user about call state of call and display duration of call
gui::Label *durationLabel = nullptr;
gui::SendSmsIcon *sendSmsIcon = nullptr;
gui::MicrophoneIcon *microphoneIcon = nullptr;
gui::SpeakerIcon *speakerIcon = nullptr;
gui::Image *imageCircleTop = nullptr;
gui::Image *imageCircleBottom = nullptr;
State state = State::IDLE;
utils::PhoneNumber::View phoneNumber;
/**
* Manipulates widgets to handle currently set state of the window.
*/
void setVisibleState();
bool handleLeftButton();
bool handleRightButton();
public:
CallWindow(app::Application *app, std::string windowName = app::window::name_call);
virtual ~CallWindow();
/**
* Used by application to update window's state
*/
void setState(State state);
const State &getState();
void updateDuration(const utils::time::Duration &duration);
void setCallNumber(std::string);
bool onInput(const InputEvent &inputEvent) override;
void onBeforeShow(ShowMode mode, SwitchData *data) override;
bool handleSwitchData(SwitchData *data) override;
void rebuild() override;
void buildInterface() override;
void destroyInterface() override;
};
} /* namespace gui */