update copyright date
[gnash.git] / plugin / npapi / external.h
blobbb02f83bd28996e3875caa76a51f1807f0d248c6
1 //
2 // Copyright (C) 2010, 2011 Free Software Foundation, Inc
3 //
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program 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
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef GNASH_PLUGIN_EXTERNAL_H
20 #define GNASH_PLUGIN_EXTERNAL_H
22 #ifdef HAVE_CONFIG_H
23 #include "gnashconfig.h"
24 #endif
26 #include <string>
27 #include <sstream>
28 #include <vector>
29 #include <map>
31 #include "npapi.h"
32 #include "npruntime.h"
34 #include "GnashNPVariant.h"
36 namespace gnash {
38 namespace plugin {
40 struct ExternalInterface
42 typedef struct {
43 std::string name;
44 std::string type;
45 std::vector<GnashNPVariant> args;
46 } invoke_t;
48 // Create an Invoke message for the standalone Gnash
49 static std::string makeInvoke (const std::string &method, std::vector<std::string> args);
51 static std::string makeNull ();
52 static std::string makeTrue ();
53 static std::string makeFalse ();
54 static std::string makeString (const std::string &str);
55 static std::string makeProperty (const std::string &str, const std::string &data);
56 static std::string makeProperty (const std::string &str, double num);
57 static std::string makeProperty (const std::string &str, int num);
58 static std::string makeNumber (double num);
59 static std::string makeNumber (int num);
60 static std::string makeNumber (unsigned int num);
61 static std::string makeArray (std::vector<std::string> &args);
62 static std::string makeObject (std::map<std::string, std::string> &args);
64 static GnashNPVariant parseXML(const std::string &xml);
65 static invoke_t *parseInvoke(const std::string &xml);
67 static std::map<std::string, GnashNPVariant> parseProperties(const std::string &xml);
68 static std::vector<GnashNPVariant> parseArguments(const std::string &xml);
69 static std::string convertNPVariant (const NPVariant *npv);
75 #endif // GNASH_PLUGIN_EXTERNAL_H
77 // local Variables:
78 // mode: C++
79 // indent-tabs-mode: nil
80 // End: