Files
MuditaOS/module-apps/application-call/windows/CallWindow.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

65 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;
/**
* 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 */