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.
16 #include "GUIWindow.h"
17 #include "WindowIDs.h"
19 #ifdef TARGET_WINDOWS_STORE
22 enum class DialogModalityType
27 #ifdef TARGET_WINDOWS_STORE
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
¶m
= "");
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
; }
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
¶m
= "");
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()
79 unsigned int m_showStartTime
;
80 unsigned int m_showDuration
;
82 DialogModalityType m_modalityType
;