Rename and reimplement to use "Media iface"
[www-quvi.git] / Quvi.h
blob20a495b05613643f9b21b94766d55aca5465cd34
1 /* WWW::Quvi
2 * Copyright (C) 2010,2011 Toni Gundogdu <legatvs@gmail.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301 USA
20 #ifndef Quvi_h
21 #define Quvi_h
23 #include <quvi/quvi.h>
25 class Options;
26 class Query;
27 class Media;
28 class Url;
30 class Options
32 public:
33 Options();
34 Options(const Options&);
35 Options& operator=(const Options&);
36 virtual ~Options();
37 private:
38 void _swap(const Options&);
39 public:
40 std::string user_agent;
41 std::string http_proxy;
42 bool verbose_libcurl;
43 std::string format;
44 bool verify;
45 bool resolve;
46 long category;
49 class Url
51 public:
52 Url();
53 Url(quvi_video_t);
54 Url(const Url&);
55 Url& operator=(const Url&);
56 virtual ~Url();
57 private:
58 void _swap(const Url&);
59 public:
60 std::string content_type;
61 std::string file_suffix;
62 double length_bytes;
63 std::string url;
66 class Media
68 public:
69 Media();
70 Media(quvi_video_t);
71 Media(const Media&);
72 Media& operator=(const Media&);
73 virtual ~Media();
74 private:
75 void _swap(const Media&);
76 public:
77 std::string title;
78 std::string host;
79 std::string page_url;
80 std::string id;
81 Url url;
82 bool ok;
83 std::string start_time;
86 class Query
88 public:
89 Query();
90 Query(const Query&);
91 Query& operator=(const Query&);
92 virtual ~Query();
93 public:
94 Media parse(const std::string&, const Options&);
95 int next_website(std::string&, std::string&);
96 int supported(const std::string&);
97 private:
98 void _init();
99 void _close();
100 private:
101 quvi_t _quvi;
102 void *_curl;
103 public:
104 std::string last_error;
105 long quvi_code;
106 long resp_code;
109 #endif
111 // vim: set ts=2 sw=2 tw=72 expandtab: