]> git.vomp.tv Git - vompclient.git/blob - src/wpictureview.h
Switch to cmake
[vompclient.git] / src / wpictureview.h
1 /*
2     Copyright 2005 Brian Walton (WTextBox)
3     Copyright 2014 Marten Richter (WPictureView)
4
5     This file is part of VOMP.
6
7     VOMP 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 of the License, or
10     (at your option) any later version.
11
12     VOMP 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 VOMP; if not, write to the Free Software
19     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20 */
21
22 #ifndef WPICTUREVIEW_H
23 #define WPICTUREVIEW_H
24
25 #include <stdio.h>
26 #include <string>
27 #include <list>
28
29 #include "defines.h"
30 #include "boxx.h"
31 #include "image.h"
32 #include "imageloader.h"
33
34 class Colour;
35
36 class WPictureView : public Boxx
37 {
38   public:
39         WPictureView();
40     virtual ~WPictureView();
41     void addPicture(Image& pict, float width, float height,bool banner=false, std::string caption ="", std::string caption2 ="");
42     void draw();
43     void setForegroundColour(const DrawStyle& fcolour);
44
45
46     // if added as a pane
47     int handleCommand(int command);
48         bool mouseAndroidScroll(int x, int y, int sx, int sy);
49
50   protected:
51     class Picture {
52     public:
53         Picture(Image& tmedia, float width, float height, bool tbanner, std::string tcaption, std::string tcaption2)
54         {
55                 media=tmedia; caption=tcaption;caption2=tcaption2;w=width; h=height; banner=tbanner;
56         }
57
58         Image media;
59         std::string caption;
60         std::string caption2;
61         float w;
62         float h;
63         bool banner;
64     };
65     std::list<Picture> pictures;
66
67     DrawStyle foreColour;
68     unsigned int cur_scroll_line;
69     unsigned int rem_scroll_line;
70     unsigned int const_height; // if set only one per line
71 };
72
73 class WActorGallery : public WPictureView
74 {
75 public:
76         WActorGallery(Actors& actors);
77
78 };
79
80 class WArtworkGallery : public WPictureView
81 {
82 public:
83         WArtworkGallery(MovieInfo& movie);
84         WArtworkGallery(SeriesInfo& series);
85 protected:
86         void addTVMedias(TVMedias& medias, bool banner=false);
87         void addTVMedia(TVMediaStruct& media, bool banner=false);
88
89 };
90
91 #endif