Files
MuditaOS/module-apps/application-call/windows/EmergencyCallWindow.cpp
Mateusz Grzegorzek 58dd02cff1 [BH-861] Cleanup Application split - part I
1. Prepare Pure and Bell specific `Application`
   classes and add them to `app` target:

- `products/BellHybrid/apps/Application.cpp`
- `products/PurePhone/apps/Application.cpp`

2. Update `CMakeLists.txt` files.
3. Move `ApplicationBell` implementation to Bell-specific
   `Application` class and remove `ApplicationBell` files.
4. Change Bell apps parent classes from `ApplicationBell`
  to Bell-specific `Application` class.
5. Rename `Application` to `ApplicationCommon` in the rest of the files.
2021-09-13 11:58:10 +02:00

58 lines
2.1 KiB
C++

// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "CallAppStyle.hpp"
#include "EmergencyCallWindow.hpp"
#include <service-appmgr/Controller.hpp>
namespace gui
{
EmergencyCallWindow::EmergencyCallWindow(app::ApplicationCommon *app, app::EnterNumberWindowInterface *interface)
: NumberWindow(app, interface, app::window::name_emergencyCall)
{
buildInterface();
}
void EmergencyCallWindow::buildInterface()
{
using namespace callAppStyle;
NumberWindow::buildInterface();
bottomBar->setText(BottomBar::Side::CENTER, utils::translate("app_phonebook_ice_contacts_title"));
bottomBar->setText(BottomBar::Side::RIGHT, utils::translate(style::strings::common::back));
numberDescriptionLabel->setText(utils::translate("app_call_emergency_text"));
}
status_bar::Configuration EmergencyCallWindow::configureStatusBar(status_bar::Configuration appConfiguration)
{
appConfiguration.enable(status_bar::Indicator::PhoneMode);
return appConfiguration;
}
bool EmergencyCallWindow::onInput(const InputEvent &inputEvent)
{
if (inputEvent.isShortRelease()) {
// Call function
if (inputEvent.is(KeyCode::KEY_LF)) {
interface->handleEmergencyCallEvent(enteredNumber);
return true;
}
else if (inputEvent.is(gui::KeyCode::KEY_ENTER)) {
auto data = std::make_unique<gui::SwitchData>();
data->ignoreCurrentWindowOnStack = true;
app::manager::Controller::sendAction(application,
app::manager::actions::ShowEmergencyContacts,
std::move(data),
app::manager::OnSwitchBehaviour::RunInBackground);
return true;
}
}
return NumberWindow::onInput(inputEvent);
}
} /* namespace gui */