Fix keymap.
[vuplus_xbmc] / xbmc / guilib / GUIIncludes.h
1 #pragma once
2
3 /*
4  *      Copyright (C) 2005-2013 Team XBMC
5  *      http://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 "utils/StdString.h"
24
25 #include <map>
26 #include <set>
27 #include "interfaces/info/InfoBool.h"
28
29 // forward definitions
30 class TiXmlElement;
31 namespace INFO
32 {
33   class CSkinVariableString;
34 }
35
36 class CGUIIncludes
37 {
38 public:
39   CGUIIncludes();
40   ~CGUIIncludes();
41
42   void ClearIncludes();
43   bool LoadIncludes(const CStdString &includeFile);
44   bool LoadIncludesFromXML(const TiXmlElement *root);
45
46   /*! \brief Resolve <include>name</include> tags recursively for the given XML element
47    Replaces any instances of <include file="foo">bar</include> with the value of the include
48    "bar" from the include file "foo".
49    \param node an XML Element - all child elements are traversed.
50    */
51   void ResolveIncludes(TiXmlElement *node, std::map<INFO::InfoPtr, bool>* xmlIncludeConditions = NULL);
52   const INFO::CSkinVariableString* CreateSkinVariable(const CStdString& name, int context);
53
54 private:
55   void ResolveIncludesForNode(TiXmlElement *node, std::map<INFO::InfoPtr, bool>* xmlIncludeConditions = NULL);
56   CStdString ResolveConstant(const CStdString &constant) const;
57   bool HasIncludeFile(const CStdString &includeFile) const;
58   std::map<CStdString, TiXmlElement> m_includes;
59   std::map<CStdString, TiXmlElement> m_defaults;
60   std::map<CStdString, TiXmlElement> m_skinvariables;
61   std::map<CStdString, CStdString> m_constants;
62   std::vector<CStdString> m_files;
63   typedef std::vector<CStdString>::const_iterator iFiles;
64
65   std::set<std::string> m_constantAttributes;
66   std::set<std::string> m_constantNodes;
67 };
68