view include/gui/pages/now_playing.h @ 242:82470f83f0c2

autotools: make windows build work also, I've added back the method I made for getting the vars as variables rather than separate files, so less clutter in tmp folders :)
author Paper <paper@paper.us.eu.org>
date Mon, 22 Jan 2024 19:06:23 -0800
parents 4d461ef7d424
children 862d0d8619f6
line wrap: on
line source

#ifndef __gui__pages__now_playing_h
#define __gui__pages__now_playing_h

#include "gui/widgets/anime_info.h"
#include "gui/widgets/poster.h"
#include "gui/widgets/text.h"

#include <QFrame>
#include <unordered_map>
#include <memory>

class QStackedWidget;

namespace Anime {
class Anime;
}

namespace anitomy {
class Elements;
}

namespace NowPlayingPages {

class Default : public QWidget {
		Q_OBJECT

	public:
		Default(QWidget* parent = nullptr);
};

class Playing : public QWidget {
		Q_OBJECT

	public:
		Playing(QWidget* parent = nullptr);
		void SetPlayingAnime(const Anime::Anime& anime, const anitomy::Elements& info);
		int GetPlayingAnime();

	private:
		int _id = 0;
		int _episode = 0;
		std::unique_ptr<QWidget> _main = nullptr;
		std::unique_ptr<TextWidgets::Title> _title = nullptr;
		std::unique_ptr<AnimeInfoWidget> _info = nullptr;
		std::unique_ptr<QWidget> _sidebar = nullptr;
		std::unique_ptr<Poster> _poster = nullptr;
};

}

class NowPlayingPage final : public QFrame {
		Q_OBJECT

	public:
		NowPlayingPage(QWidget* parent = nullptr);
		void SetDefault();
		void SetPlaying(const Anime::Anime& anime, const anitomy::Elements& episodes);
		int GetPlayingId();

	private:
		QStackedWidget* stack;
};

#endif // __gui__pages__now_playing_h