40 lines
819 B
C++
40 lines
819 B
C++
#ifndef NAVIGATIONCONTROLLER_H
|
|
#define NAVIGATIONCONTROLLER_H
|
|
|
|
#include <QObject>
|
|
#include <QQmlContext>
|
|
|
|
class NavigationItemModel;
|
|
class NavigationListModel;
|
|
class UiStateModel;
|
|
class MusicController;
|
|
|
|
class NavigationController : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
NavigationController(QObject *parent = Q_NULLPTR);
|
|
|
|
void init(const QString & rootPath);
|
|
|
|
void setContext(QQmlContext* context);
|
|
|
|
private:
|
|
void setContextProperties();
|
|
void add(const QString & path, NavigationItemModel* parentItem);
|
|
|
|
NavigationItemModel* mRootItem;
|
|
NavigationListModel* mNavList;
|
|
|
|
UiStateModel* mUiState;
|
|
MusicController* mMusicController;
|
|
|
|
QString mRootPath = ".";
|
|
|
|
QQmlContext* mContext = Q_NULLPTR;
|
|
|
|
private slots:
|
|
void onNavigationRequest();
|
|
};
|
|
|
|
#endif // NAVIGATIONCONTROLLER_H
|