2021-06-21 03:43:40 +01:00
|
|
|
/*
|
2021-06-24 02:37:57 +01:00
|
|
|
* titles_tab.hpp
|
2021-06-21 03:43:40 +01:00
|
|
|
*
|
2024-04-12 10:47:36 +01:00
|
|
|
* Copyright (c) 2020-2024, DarkMatterCore <pabloacurielz@gmail.com>.
|
2021-06-21 03:43:40 +01:00
|
|
|
*
|
|
|
|
* This file is part of nxdumptool (https://github.com/DarkMatterCore/nxdumptool).
|
|
|
|
*
|
|
|
|
* nxdumptool is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* nxdumptool is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2021-06-24 02:37:57 +01:00
|
|
|
#ifndef __TITLES_TAB_HPP__
|
|
|
|
#define __TITLES_TAB_HPP__
|
2021-06-21 03:43:40 +01:00
|
|
|
|
2021-08-11 08:17:57 +01:00
|
|
|
#include "root_view.hpp"
|
2021-06-21 03:43:40 +01:00
|
|
|
#include "layered_error_frame.hpp"
|
|
|
|
|
|
|
|
namespace nxdt::views
|
|
|
|
{
|
2021-06-24 16:53:36 +01:00
|
|
|
/* Expanded TabFrame class used as a PopupFrame for titles. */
|
|
|
|
class TitlesTabPopup: public brls::TabFrame
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const TitleApplicationMetadata *app_metadata = nullptr;
|
|
|
|
bool is_system = false;
|
2022-07-05 02:04:28 +01:00
|
|
|
|
2024-04-18 09:46:29 +01:00
|
|
|
TitleUserApplicationData user_app_data{};
|
|
|
|
TitleInfo *system_title_info = nullptr;
|
2022-07-05 02:04:28 +01:00
|
|
|
|
2021-06-24 16:53:36 +01:00
|
|
|
public:
|
|
|
|
TitlesTabPopup(const TitleApplicationMetadata *app_metadata, bool is_system);
|
2024-04-19 11:08:44 +01:00
|
|
|
~TitlesTabPopup();
|
2021-06-24 16:53:36 +01:00
|
|
|
};
|
2022-07-05 02:04:28 +01:00
|
|
|
|
2021-06-24 16:53:36 +01:00
|
|
|
/* Expanded ListItem class to hold application metadata. */
|
2021-06-24 02:37:57 +01:00
|
|
|
class TitlesTabItem: public brls::ListItem
|
2021-06-24 02:04:28 +01:00
|
|
|
{
|
|
|
|
private:
|
2021-06-24 16:53:36 +01:00
|
|
|
const TitleApplicationMetadata *app_metadata = nullptr;
|
2021-06-24 02:37:57 +01:00
|
|
|
bool is_system = false;
|
2024-04-18 09:46:29 +01:00
|
|
|
bool click_anim = true;
|
2022-07-05 02:04:28 +01:00
|
|
|
|
2021-06-24 02:04:28 +01:00
|
|
|
public:
|
2022-07-28 03:13:48 +01:00
|
|
|
TitlesTabItem(const TitleApplicationMetadata *app_metadata, bool is_system, bool click_anim = true);
|
|
|
|
|
|
|
|
void playClickAnimation(void) override;
|
2022-07-05 02:04:28 +01:00
|
|
|
|
2021-06-24 16:53:36 +01:00
|
|
|
ALWAYS_INLINE const TitleApplicationMetadata *GetApplicationMetadata(void)
|
|
|
|
{
|
|
|
|
return this->app_metadata;
|
|
|
|
}
|
2022-07-05 02:04:28 +01:00
|
|
|
|
2021-06-24 16:53:36 +01:00
|
|
|
ALWAYS_INLINE bool IsSystemTitle(void)
|
|
|
|
{
|
|
|
|
return this->is_system;
|
|
|
|
}
|
2021-06-24 02:04:28 +01:00
|
|
|
};
|
2022-07-05 02:04:28 +01:00
|
|
|
|
2021-06-24 02:37:57 +01:00
|
|
|
class TitlesTab: public LayeredErrorFrame
|
2021-06-21 03:43:40 +01:00
|
|
|
{
|
|
|
|
private:
|
2021-08-11 08:17:57 +01:00
|
|
|
RootView *root_view = nullptr;
|
2022-07-05 02:04:28 +01:00
|
|
|
|
2024-04-18 09:46:29 +01:00
|
|
|
nxdt::tasks::UserTitleEvent::Subscription title_task_sub;
|
2021-06-24 02:37:57 +01:00
|
|
|
bool is_system = false;
|
2022-07-05 02:04:28 +01:00
|
|
|
|
2024-04-18 09:46:29 +01:00
|
|
|
void PopulateList(const nxdt::tasks::TitleApplicationMetadataVector& app_metadata);
|
2022-07-05 02:04:28 +01:00
|
|
|
|
2021-06-21 03:43:40 +01:00
|
|
|
public:
|
2021-08-11 08:17:57 +01:00
|
|
|
TitlesTab(RootView *root_view, bool is_system);
|
2024-04-19 11:08:44 +01:00
|
|
|
~TitlesTab();
|
2021-06-21 03:43:40 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2021-06-24 02:37:57 +01:00
|
|
|
#endif /* __TITLES_TAB_HPP__ */
|