[cosmetics] update date in GPL header
[vuplus_xbmc] / xbmc / dialogs / GUIDialogBoxBase.h
1 #pragma once
2
3 /*
4  *      Copyright (C) 2005-2013 Team XBMC
5  *      http://www.xbmc.org
6  *
7  *  This Program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation; either version 2, or (at your option)
10  *  any later version.
11  *
12  *  This Program is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  *  GNU General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with XBMC; see the file COPYING.  If not, see
19  *  <http://www.gnu.org/licenses/>.
20  *
21  */
22
23 #include "guilib/GUIDialog.h"
24 #include "utils/Variant.h"
25
26 #define DIALOG_MAX_LINES 3
27 #define DIALOG_MAX_CHOICES 2
28
29 class CGUIDialogBoxBase :
30       public CGUIDialog
31 {
32 public:
33   CGUIDialogBoxBase(int id, const CStdString &xmlFile);
34   virtual ~CGUIDialogBoxBase(void);
35   virtual bool OnMessage(CGUIMessage& message);
36   bool IsConfirmed() const;
37   void SetLine(int iLine, const CVariant &line);
38   void SetHeading(const CVariant &heading);
39   void SetChoice(int iButton, const CVariant &choice);
40 protected:
41   CStdString GetDefaultLabel(int controlId) const;
42   virtual int GetDefaultLabelID(int controlId) const;
43   /*! \brief Get a localized string from a variant
44    If the varaint is already a string we return directly, else if it's an integer we return the corresponding
45    localized string.
46    \param var the variant to localize.
47    */
48   CStdString GetLocalized(const CVariant &var) const;
49
50   virtual void OnInitWindow();
51   virtual void OnDeinitWindow(int nextWindowID);
52
53   bool m_bConfirmed;
54
55   // actual strings
56   std::string m_strHeading;
57   std::string m_strLines[DIALOG_MAX_LINES];
58   std::string m_strChoices[DIALOG_MAX_CHOICES];
59 };