[ExecString] combine SplitParameters with identical function of CUtil
[xbmc.git] / xbmc / guilib / GUIDialog.h
blob7300c1fa1b6289cd300103abeff7e63fd79016c7
1 /*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 /*!
12 \file GUIDialog.h
13 \brief
16 #include "GUIWindow.h"
17 #include "WindowIDs.h"
19 #ifdef TARGET_WINDOWS_STORE
20 #pragma pack(push, 8)
21 #endif
22 enum class DialogModalityType
24 MODELESS,
25 MODAL
27 #ifdef TARGET_WINDOWS_STORE
28 #pragma pack(pop)
29 #endif
31 /*!
32 \ingroup winmsg
33 \brief
35 class CGUIDialog :
36 public CGUIWindow
38 public:
39 CGUIDialog(int id, const std::string &xmlFile, DialogModalityType modalityType = DialogModalityType::MODAL);
40 ~CGUIDialog(void) override;
42 bool OnAction(const CAction &action) override;
43 bool OnMessage(CGUIMessage& message) override;
44 void DoProcess(unsigned int currentTime, CDirtyRegionList &dirtyregions) override;
45 void Render() override;
47 void Open(const std::string &param = "");
48 void Open(bool bProcessRenderLoop, const std::string& param = "");
50 bool OnBack(int actionID) override;
52 bool IsDialogRunning() const override { return m_active; }
53 bool IsDialog() const override { return true; }
54 bool IsModalDialog() const override { return m_modalityType == DialogModalityType::MODAL; }
55 virtual DialogModalityType GetModalityType() const { return m_modalityType; }
57 void SetAutoClose(unsigned int timeoutMs);
58 void ResetAutoClose(void);
59 void CancelAutoClose(void);
60 bool IsAutoClosed(void) const { return m_bAutoClosed; }
61 void SetSound(bool OnOff) { m_enableSound = OnOff; }
62 bool IsSoundEnabled() const override { return m_enableSound; }
64 protected:
65 bool Load(TiXmlElement *pRootElement) override;
66 void SetDefaults() override;
67 void OnWindowLoaded() override;
68 using CGUIWindow::UpdateVisibility;
69 virtual void UpdateVisibility();
71 virtual void Open_Internal(bool bProcessRenderLoop, const std::string &param = "");
72 void OnDeinitWindow(int nextWindowID) override;
74 void ProcessRenderLoop(bool renderOnly = false);
76 bool m_wasRunning; ///< \brief true if we were running during the last DoProcess()
77 bool m_autoClosing;
78 bool m_enableSound;
79 unsigned int m_showStartTime;
80 unsigned int m_showDuration;
81 bool m_bAutoClosed;
82 DialogModalityType m_modalityType;