Files
MuditaOS/module-apps/windows/AppWindow.hpp
Alek-Mudita dc3d655abe Egd 2566 signal strength indicator (#214)
* [EGD-2566] refactored cellular notification recogniton

* [EGD-2566] add new conversion to dBm

* [EGD-2566] added dBm to bar calculations
some minor fixes connected to signal strength
put static data in event store

* [EGD-2566] removed magic number

* [EGD-2566] PR fixes

* [EGD-2566] PR fixes

* [EGD-2566] missing rebase fix

* [EGD-2566] moved Signal Strength to separate file.

* [EGD-2566] missing return

* [EGD-2566] update signalstrength without message sending

* [EGD-2566]  reverted USE_DAEFAULT_BAUDRATE to 1

* [EGD-2566][fix] missing change for closing  end call window

* [EGD-2566] fix for proper checking for CSQ. Verbose setting of singla strength in Store

* [EGD-2566] fixed inlude in ScopeDTime.

* [EGD-2566]  added mutex in GSM store

* [EGD-2566] missing change

* [EGD-2566] reverted USE_DAEFAULT_BAUDRATE

* [EGD-2566] PR fixy
2020-03-13 16:42:42 +01:00

87 lines
2.3 KiB
C++

/*
* @file AppWindow.hpp
* @author Robert Borzecki (robert.borzecki@mudita.com)
* @date 24 cze 2019
* @brief
* @copyright Copyright (C) 2019 mudita.com
* @details
*/
#ifndef MODULE_APPS_WINDOWS_APPWINDOW_HPP_
#define MODULE_APPS_WINDOWS_APPWINDOW_HPP_
#include "gui/widgets/TopBar.hpp"
#include "gui/widgets/BottomBar.hpp"
#include "gui/widgets/Window.hpp"
#include "Service/Service.hpp"
#include "Service/Message.hpp"
namespace app {
class Application;
};
namespace gui {
namespace name
{
namespace window
{
const inline std::string main_window = "MainWindow";
const inline std::string no_window = "";
} // namespace window
} // namespace name
/*
* @brief This is wrapper for gui window used within applications.
*/
class AppWindow: public Window {
protected:
/// actual built window title
gui::Label* title = nullptr;
/**
* Information bar for the buttons on the bottom of the page.
*/
gui::BottomBar* bottomBar = nullptr;
/**
* Information bar for signal, battery and lock icon on the top of the screen.
*/
gui::TopBar* topBar = nullptr;
/**
* Pointer to the application object that owns the window.
*/
app::Application* application = nullptr;
public:
AppWindow( app::Application* app, std::string name, uint32_t id=GUIWindowID++ );
AppWindow( AppWindow* win );
virtual ~AppWindow();
app::Application* getApplication() { return application; };
void setApplication( app::Application* app ) { application = app; };
virtual bool onDatabaseMessage( sys::Message* msg );
bool batteryCharging(bool charging);
bool setSIM();
//updates battery level in the window
bool updateBatteryLevel( uint32_t percentage );
//updates battery level in the window
bool updateSignalStrength();
virtual bool updateTime( const UTF8& timeStr );
virtual bool updateTime( const uint32_t& timestamp, bool mode24H );
void setTitle(const UTF8 &text);
void rebuild() override;
void buildInterface() override;
void destroyInterface() override;
bool onInput( const InputEvent& inputEvent ) override;
std::list<DrawCommand*> buildDrawList() override;
void textModeShowCB(const UTF8 &text);
bool textSelectSpecialCB();
bool returnToPreviousView();
};
} /* namespace gui */
#endif /* MODULE_APPS_WINDOWS_APPWINDOW_HPP_ */