Debian Codegraph @

components/extension/youtube/videosite.h

raw symbols SCIP
1 /* fre:ac - free audio converter
2 * Copyright (C) 2001-2016 Robert Kausch <[email protected]>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation, either version 2 of
7 * the License, or (at your option) any later version.
8 *
9 * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
10 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
11 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */
12
13 #ifndef H_YOUTUBE_VIDEOSITE
14 #define H_YOUTUBE_VIDEOSITE
15
16 #include <smooth.h>
17 #include <boca.h>
18
19 using namespace smooth;
20 using namespace smooth::GUI;
21
22 using namespace BoCA;
23
24 #include <smooth-js/v8.h>
25
26 namespace BoCA
27 {
28 class Metadata
29 {
30 public:
31 String title;
32 String description;
33
34 String date;
35 String thumbnail;
36
37 String uploader;
38 };
39
40 class VideoSite
41 {
42 private:
43 static String ReplaceInnerHTML(const String &);
44
45 String name;
46 String version;
47
48 Array<String> decoders;
49
50 String script;
51
52 v8::Isolate *isolate;
53 v8::Persistent<v8::Context> context;
54
55 Bool CreateScriptContext();
56 Bool DestroyScriptContext();
57
58 Int ParseXML(const String &);
59 public:
60 VideoSite(const String &);
61 ~VideoSite();
62
63 Bool IsSane();
64
65 Bool CanHandleURL(const String &);
66
67 String GetVideoURL(const String &);
68 String GetDecoderID(const String &);
69
70 Metadata QueryMetadata(const String &);
71 accessors:
72 const String &GetName() const { return name; }
73 const String &GetVersion() const { return version; }
74
75 const Array<String> &GetDecoders() const { return decoders; }
76 };
77 };
78
79 #endif