Remove LiveTV menu.
[vuplus_xbmc] / xbmc / ThumbLoader.h
1 #pragma once
2 /*
3  *      Copyright (C) 2005-2013 Team XBMC
4  *      http://xbmc.org
5  *
6  *  This Program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2, or (at your option)
9  *  any later version.
10  *
11  *  This Program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with XBMC; see the file COPYING.  If not, see
18  *  <http://www.gnu.org/licenses/>.
19  *
20  */
21
22 #include "BackgroundInfoLoader.h"
23 #include "utils/StdString.h"
24
25 class CTextureDatabase;
26
27 class CThumbLoader : public CBackgroundInfoLoader
28 {
29 public:
30   CThumbLoader();
31   virtual ~CThumbLoader();
32
33   virtual void OnLoaderStart();
34   virtual void OnLoaderFinish();
35
36   /*! \brief helper function to fill the art for a library item
37    \param item a CFileItem
38    \return true if we fill art, false otherwise
39    */
40   virtual bool FillLibraryArt(CFileItem &item) { return false; }
41
42   /*! \brief Checks whether the given item has an image listed in the texture database
43    \param item CFileItem to check
44    \param type the type of image to retrieve
45    \return the image associated with this item
46    */
47   virtual CStdString GetCachedImage(const CFileItem &item, const CStdString &type);
48
49   /*! \brief Associate an image with the given item in the texture database
50    \param item CFileItem to associate the image with
51    \param type the type of image
52    \param image the URL of the image
53    */
54   virtual void SetCachedImage(const CFileItem &item, const CStdString &type, const CStdString &image);
55
56 protected:
57   CTextureDatabase *m_textureDatabase;
58 };
59
60 class CProgramThumbLoader : public CThumbLoader
61 {
62 public:
63   CProgramThumbLoader();
64   virtual ~CProgramThumbLoader();
65   virtual bool LoadItem(CFileItem* pItem);
66   virtual bool LoadItemCached(CFileItem* pItem);
67   virtual bool LoadItemLookup(CFileItem* pItem);
68
69   /*! \brief Fill the thumb of a programs item
70    First uses a cached thumb from a previous run, then checks for a local thumb
71    and caches it for the next run
72    \param item the CFileItem object to fill
73    \return true if we fill the thumb, false otherwise
74    \sa GetLocalThumb
75    */
76   virtual bool FillThumb(CFileItem &item);
77
78   /*! \brief Get a local thumb for a programs item
79    Shortcuts are checked, then we check for a file or folder thumb
80    \param item the CFileItem object to check
81    \return the local thumb (if it exists)
82    \sa FillThumb
83    */
84   static CStdString GetLocalThumb(const CFileItem &item);
85 };