summaryrefslogtreecommitdiffstats
path: root/xbmc/application/ApplicationSkinHandling.h
blob: fc5c3d0df5b2e28958932f8faaff1de07c03761b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
 *  Copyright (C) 2005-2018 Team Kodi
 *  This file is part of Kodi - https://kodi.tv
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 *  See LICENSES/README.md for more information.
 */

#pragma once

#include "application/IApplicationComponent.h"

#include <string>

class CApplication;
class CSetting;
class IMsgTargetCallback;
class IWindowManagerCallback;

/*!
 * \brief Class handling application support for skin management.
 */
class CApplicationSkinHandling : public IApplicationComponent
{
  friend class CApplication;

public:
  CApplicationSkinHandling(IMsgTargetCallback* msgCb,
                           IWindowManagerCallback* wCb,
                           bool& bInitializing);

  void UnloadSkin();

  bool OnSettingChanged(const CSetting& setting);
  void ReloadSkin(bool confirm = false);

protected:
  bool LoadSkin(const std::string& skinID);
  bool LoadCustomWindows();

  /*!
 * \brief Called by the application main/render thread for processing
 *        operations belonging to the skin.
 */
  void ProcessSkin() const;

  bool m_saveSkinOnUnloading = true;
  bool m_confirmSkinChange = true;
  bool m_ignoreSkinSettingChanges = false;
  IMsgTargetCallback* m_msgCb;
  IWindowManagerCallback* m_wCb;
  bool& m_bInitializing;
};