[guilib] fix labelcontrols with auto width always being marked as dirty if they speci...
[vuplus_xbmc] / xbmc / guilib / GUIDialog.h
1 /*!
2 \file GUIDialog.h
3 \brief
4 */
5
6 #pragma once
7
8 /*
9  *      Copyright (C) 2005-2013 Team XBMC
10  *      http://xbmc.org
11  *
12  *  This Program is free software; you can redistribute it and/or modify
13  *  it under the terms of the GNU General Public License as published by
14  *  the Free Software Foundation; either version 2, or (at your option)
15  *  any later version.
16  *
17  *  This Program is distributed in the hope that it will be useful,
18  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  *  GNU General Public License for more details.
21  *
22  *  You should have received a copy of the GNU General Public License
23  *  along with XBMC; see the file COPYING.  If not, see
24  *  <http://www.gnu.org/licenses/>.
25  *
26  */
27
28 #include "GUIWindow.h"
29 #include "WindowIDs.h"
30
31 /*!
32  \ingroup winmsg
33  \brief
34  */
35 class CGUIDialog :
36       public CGUIWindow
37 {
38 public:
39   CGUIDialog(int id, const CStdString &xmlFile);
40   virtual ~CGUIDialog(void);
41
42   virtual bool OnAction(const CAction &action);
43   virtual bool OnMessage(CGUIMessage& message);
44   virtual void DoProcess(unsigned int currentTime, CDirtyRegionList &dirtyregions);
45   virtual void Render();
46
47   void DoModal(int iWindowID = WINDOW_INVALID, const CStdString &param = ""); // modal
48   void Show(); // modeless
49   
50   virtual bool OnBack(int actionID);
51
52   virtual bool IsDialogRunning() const { return m_active; };
53   virtual bool IsDialog() const { return true;};
54   virtual bool IsModalDialog() const { return m_bModal; };
55
56   void SetAutoClose(unsigned int timeoutMs);
57   void ResetAutoClose(void);
58   bool IsAutoClosed(void) const { return m_bAutoClosed; };
59   void SetSound(bool OnOff) { m_enableSound = OnOff; };
60   virtual bool IsSoundEnabled() const { return m_enableSound; };
61
62 protected:
63   virtual void SetDefaults();
64   virtual void OnWindowLoaded();
65   virtual void UpdateVisibility();
66
67   virtual void DoModal_Internal(int iWindowID = WINDOW_INVALID, const CStdString &param = ""); // modal
68   virtual void Show_Internal(); // modeless
69   virtual void OnDeinitWindow(int nextWindowID);
70
71   bool m_wasRunning; ///< \brief true if we were running during the last DoProcess()
72   bool m_bModal;
73   bool m_autoClosing;
74   bool m_enableSound;
75   unsigned int m_showStartTime;
76   unsigned int m_showDuration;
77   bool m_bAutoClosed;
78 };