all repos — mgba @ d33f1d13926f4aa2afebad31775222cdd278411c

mGBA Game Boy Advance Emulator

src/platform/qt/library/LibraryGrid.h (view raw)

 1/* Copyright (c) 2014-2017 waddlesplash
 2 *
 3 * This Source Code Form is subject to the terms of the Mozilla Public
 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 6#pragma once
 7
 8#include <QListWidget>
 9
10#include "LibraryController.h"
11
12namespace QGBA {
13
14class LibraryGrid final : public AbstractGameList {
15public:
16	explicit LibraryGrid(LibraryController* parent = nullptr);
17	~LibraryGrid();
18
19	// AbstractGameList stuff
20	virtual LibraryEntryRef selectedEntry() override;
21	virtual void selectEntry(LibraryEntryRef game) override;
22
23	virtual void setViewStyle(LibraryStyle newStyle) override;
24
25	virtual void addEntry(LibraryEntryRef item) override;
26	virtual void removeEntry(LibraryEntryRef entry) override;
27
28	virtual QWidget* widget() override { return m_widget; }
29
30signals:
31	void startGame();
32
33private:
34	QListWidget* m_widget;
35
36	// Game banner image size
37	const quint32 GRID_BANNER_WIDTH = 320;
38	const quint32 GRID_BANNER_HEIGHT = 240;
39
40	const quint32 ICON_BANNER_WIDTH = 64;
41	const quint32 ICON_BANNER_HEIGHT = 64;
42
43	QMap<LibraryEntryRef, QListWidgetItem*> m_items;
44	LibraryStyle m_currentStyle;
45};
46
47}