51 lines
1.2 KiB
C++
51 lines
1.2 KiB
C++
#ifndef UISTATEMODEL_H
|
|
#define UISTATEMODEL_H
|
|
|
|
#include <QObject>
|
|
#include <QUrl>
|
|
|
|
/**
|
|
* @brief Handles state of UI by providing the qml source.
|
|
*
|
|
* Provides the possibility to switch between different
|
|
* ui states such as music player or navigation.
|
|
*/
|
|
class UiStateModel : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(QUrl pSource READ getSource NOTIFY sourceChanged)
|
|
|
|
signals:
|
|
void sourceChanged();
|
|
|
|
public:
|
|
/**
|
|
* @brief Provides the possibility to configure UI according to profile.
|
|
*/
|
|
enum EProfile : uint{
|
|
/**
|
|
* @brief Profile designed for running LenaPi as window manager on Raspberry Pi Touch
|
|
*
|
|
* Start fullscreen and do NOT show close button or volume controls
|
|
*/
|
|
Profile_RasPiTouch = 0,
|
|
/**
|
|
* @brief Profiled designed for running LenaPi as a desktop app.
|
|
*
|
|
* Start fullscreen, show close button and volume controls.
|
|
*/
|
|
Profile_Desktop
|
|
};
|
|
explicit UiStateModel(QObject *parent = nullptr);
|
|
|
|
QUrl getSource() const;
|
|
|
|
void showMusicPlayer();
|
|
void showNavigation();
|
|
|
|
private:
|
|
QUrl mSource;
|
|
};
|
|
|
|
#endif // UISTATEMODEL_H
|