thedesk/libthedesk/statemanager.cpp

92 lines
2.7 KiB
C++
Raw Normal View History

2020-04-04 08:02:17 -04:00
/****************************************
*
* INSERT-PROJECT-NAME-HERE - INSERT-GENERIC-NAME-HERE
* Copyright (C) 2020 Victor Tran
*
* This program 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.
*
* This program 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 <http://www.gnu.org/licenses/>.
*
* *************************************/
#include "statemanager.h"
#include "barmanager.h"
2020-04-11 08:06:34 -04:00
#include "powermanager.h"
#include "statuscentermanager.h"
#include "localemanager.h"
2020-04-12 11:34:13 -04:00
#include "hudmanager.h"
#include "gatewaymanager.h"
2020-04-16 10:52:51 -04:00
#include "onboardingmanager.h"
#include "quietmodemanager.h"
2020-04-04 08:02:17 -04:00
2020-04-11 08:06:34 -04:00
struct StateManagerPrivate {
StateManager* instance = nullptr;
BarManager* barManager;
2020-04-12 11:34:13 -04:00
GatewayManager* gatewayManager;
2020-04-11 08:06:34 -04:00
StatusCenterManager* statusCenterManager;
PowerManager* powerManager;
LocaleManager* localeManager;
2020-04-12 11:34:13 -04:00
HudManager* hudManager;
2020-04-16 10:52:51 -04:00
OnboardingManager* onboardingManager;
QuietModeManager* quietModeManager;
2020-04-11 08:06:34 -04:00
};
StateManagerPrivate* StateManager::d = new StateManagerPrivate();
2020-04-04 08:02:17 -04:00
StateManager::StateManager() : QObject(nullptr) {
d->barManager = new BarManager(this);
2020-04-12 11:34:13 -04:00
d->gatewayManager = new GatewayManager(this);
2020-04-11 08:06:34 -04:00
d->statusCenterManager = new StatusCenterManager(this);
d->powerManager = new PowerManager(this);
d->localeManager = new LocaleManager(this);
2020-04-12 11:34:13 -04:00
d->hudManager = new HudManager(this);
2020-04-16 10:52:51 -04:00
d->onboardingManager = new OnboardingManager(this);
d->quietModeManager = new QuietModeManager(this);
2020-04-04 08:02:17 -04:00
}
StateManager* StateManager::instance() {
2020-04-11 08:06:34 -04:00
if (d->instance == nullptr) d->instance = new StateManager();
2020-04-04 08:02:17 -04:00
return d->instance;
}
BarManager* StateManager::barManager() {
return d->barManager;
}
2020-04-11 08:06:34 -04:00
2020-04-12 11:34:13 -04:00
GatewayManager* StateManager::gatewayManager() {
return d->gatewayManager;
}
2020-04-11 08:06:34 -04:00
PowerManager* StateManager::powerManager() {
return d->powerManager;
}
StatusCenterManager* StateManager::statusCenterManager() {
return d->statusCenterManager;
}
LocaleManager* StateManager::localeManager() {
return d->localeManager;
}
2020-04-12 11:34:13 -04:00
HudManager* StateManager::hudManager() {
return d->hudManager;
}
2020-04-16 10:52:51 -04:00
OnboardingManager* StateManager::onboardingManager() {
return d->onboardingManager;
}
QuietModeManager* StateManager::quietModeManager() {
return d->quietModeManager;
}