[cosmetics] update date in GPL header
[vuplus_xbmc] / xbmc / filesystem / AndroidAppFile.h
1 #pragma once
2 /*
3  *      Copyright (C) 2012-2013 Team XBMC
4  *      http://www.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 "system.h"
23
24 #if defined(TARGET_ANDROID)
25 #include "IFile.h"
26 #include "URL.h"
27 #include "utils/StdString.h"
28 namespace XFILE
29 {
30 class CFileAndroidApp : public IFile
31 {
32 public:
33   /*! \brief Currently only used for retrieving App Icons. */
34   CFileAndroidApp(void);
35   virtual ~CFileAndroidApp(void);
36   virtual bool Open(const CURL& url);
37   virtual bool Exists(const CURL& url);
38   virtual int Stat(const CURL& url, struct __stat64* buffer);
39
40   /*! \brief Return 32bit rgba raw bitmap. */
41   virtual unsigned int Read(void* lpBuf, int64_t uiBufSize);
42   virtual void Close();
43   virtual int64_t GetLength();
44   virtual int64_t Seek(int64_t, int) {return -1;};
45   virtual int64_t GetPosition() {return 0;};
46   virtual int GetChunkSize();
47   virtual int IoControl(EIoControl request, void* param);
48
49   /*! \brief Only valid after GetLength() has been called, usually by Open(). */
50   unsigned int GetIconWidth();
51   /*! \brief Only valid after GetLength() has been called, usually by Open(). */
52   unsigned int GetIconHeight();
53
54 protected:
55   bool IsValidFile(const CURL& url);
56
57 private:
58   CURL              m_url;
59   CStdString        m_appname;
60   int               m_iconWidth;
61   int               m_iconHeight;
62 };
63 }
64
65 #endif
66