3 * Copyright (C) 2005-2012 Team XBMC
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)
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.
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/>.
22 #include "BackgroundInfoLoader.h"
23 #include "utils/StdString.h"
25 class CThumbLoader : public CBackgroundInfoLoader
28 CThumbLoader(int nThreads=-1);
29 virtual ~CThumbLoader();
31 virtual void Initialize() { };
33 /*! \brief helper function to fill the art for a library item
34 \param item a CFileItem
35 \return true if we fill art, false otherwise
37 virtual bool FillLibraryArt(CFileItem &item) { return false; }
39 /*! \brief Checks whether the given item has an image listed in the texture database
40 \param item CFileItem to check
41 \param type the type of image to retrieve
42 \return the image associated with this item
44 static CStdString GetCachedImage(const CFileItem &item, const CStdString &type);
46 /*! \brief Associate an image with the given item in the texture database
47 \param item CFileItem to associate the image with
48 \param type the type of image
49 \param image the URL of the image
51 static void SetCachedImage(const CFileItem &item, const CStdString &type, const CStdString &image);
54 class CProgramThumbLoader : public CThumbLoader
57 CProgramThumbLoader();
58 virtual ~CProgramThumbLoader();
59 virtual bool LoadItem(CFileItem* pItem);
61 /*! \brief Fill the thumb of a programs item
62 First uses a cached thumb from a previous run, then checks for a local thumb
63 and caches it for the next run
64 \param item the CFileItem object to fill
65 \return true if we fill the thumb, false otherwise
68 static bool FillThumb(CFileItem &item);
70 /*! \brief Get a local thumb for a programs item
71 Shortcuts are checked, then we check for a file or folder thumb
72 \param item the CFileItem object to check
73 \return the local thumb (if it exists)
76 static CStdString GetLocalThumb(const CFileItem &item);