Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Unified Diff: ppapi/cpp/dev/foobar_dev.h

Issue 60173003: Draft: apps APIs in Pepper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/cpp/dev/array_dev.h ('k') | ppapi/cpp/dev/foobar_dev.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/dev/foobar_dev.h
diff --git a/ppapi/cpp/dev/foobar_dev.h b/ppapi/cpp/dev/foobar_dev.h
new file mode 100644
index 0000000000000000000000000000000000000000..cc0a839634e2ecac04d08c3c617f8957f769f97e
--- /dev/null
+++ b/ppapi/cpp/dev/foobar_dev.h
@@ -0,0 +1,149 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PPAPI_CPP_DEV_FOOBAR_DEV_H_
+#define PPAPI_CPP_DEV_FOOBAR_DEV_H_
+
+#include <string>
+#include <vector>
+
+#include "ppapi/c/dev/ppb_foobar_dev.h"
+#include "ppapi/cpp/dev/optional_dev.h"
+#include "ppapi/cpp/dev/struct_wrapper_base_dev.h"
+#include "ppapi/cpp/instance_handle.h"
+#include "ppapi/cpp/output_traits.h"
+#include "ppapi/cpp/var.h"
+
+namespace pp {
+
+template <class T>
+class CompletionCallbackWithOutput;
+
+namespace foobar {
+
+class Bar : public internal::StructWrapperBase<PP_Bar, PP_Bar_Array> {
+ public:
+ Bar();
+ Bar(const Bar& other);
+ explicit Bar(const PP_Bar& other);
+ Bar(PP_Bar* storage, NotOwned);
+ virtual ~Bar();
+
+ Bar& operator=(const Bar& other);
+ Bar& operator=(const PP_Bar& other);
+
+ private:
+ virtual void NotifyStartRawUpdate();
+ virtual void NotifyEndRawUpdate();
+};
+
+class Foo : public internal::StructWrapperBase<PP_Foo, PP_Foo_Array> {
+ public:
+ Foo();
+
+ Foo(const Foo& other);
+ // For taking input parameters from event listeners.
+ explicit Foo(const PP_Foo& other);
+
+ // For struct / array members.
+ // Don't take ownership of |storage|, therefore |storage| must live longer
+ // than this object.
+ Foo(PP_Foo* storage, NotOwned);
+
+ virtual ~Foo();
+
+ Foo& operator=(const Foo& other);
+ Foo& operator=(const PP_Foo& other);
+
+ double a() const;
+ void set_a(double value);
+
+ bool is_b_set() const;
+ void unset_b();
+ double b() const;
+ void set_b(double value);
+
+ Array<double>& c();
+ const Array<double>& c() const;
+
+ bool is_d_set() const;
+ void unset_d();
+ Array<double>& d();
+ const Array<double>& d() const;
+/*
+ const std::string& e() const;
+ void set_e(const std::string& value);
+
+ bool is_f_set() const;
+ void unset_f();
+ const std::string& f() const;
+ void set_f(const std::string& value);
+
+ Array<std::string>& g();
+ const Array<std::string>& g() const;
+
+ bool is_h_set() const;
+ void unset_h();
+ Array<std::string>& h();
+ const Array<std::string>& h() const;
+
+ Bar& i();
+ const Bar& i() const;
+
+ bool is_j_set() const;
+ void unset_j();
+ Bar& j();
+ const Bar& j() const;
+
+ Array<Bar>& k();
+ const Array<Bar>& k() const;
+
+ bool is_l_set() const;
+ void unset_l();
+ Array<Bar>& l();
+ const Array<Bar>& l() const;
+*/
+
+ private:
+ virtual void NotifyStartRawUpdate();
+ virtual void NotifyEndRawUpdate();
+
+ Optional<double> b_wrapper_;
+ Array<double> c_wrapper_;
+ Optional<Array<double> > d_wrapper_;
+ /*StringWrapper e_wrapper_;
+ Optional<StringWrapper> f_wrapper_;
+ Array<StringWrapper> g_wrapper_;
+ Optional<Array<StringWrapper> > h_wrapper_;
+ Bar i_wrapper_;
+ Optional<Bar> j_wrapper_;
+ Array<Bar> k_wrapper_;
+ OptionalArray<Bar> l_wrapper_;*/
+};
+
+class Foobar {
+ public:
+ explicit Foobar(const InstanceHandle& instance);
+ ~Foobar();
+
+ typedef CompletionCallbackWithOutput<Foo> BazCallback;
+ int32_t Baz(const std::string& str,
+ const Optional<std::string>& optional_str,
+ const Optional<double>& dbl,
+ const BazCallback& callback);
+
+ typedef CompletionCallbackWithOutput<Array<double> > QuxCallback;
+ int32_t Qux(const QuxCallback& callback);
+
+ typedef CompletionCallbackWithOutput<Array<Foo> > BlahCallback;
+ int32_t Blah(const BlahCallback& callback);
+
+ private:
+ InstanceHandle instance_;
+};
+
+} // namespace foobar
+} // namespace pp
+
+#endif // PPAPI_CPP_DEV_FOOBAR_DEV_H_
« no previous file with comments | « ppapi/cpp/dev/array_dev.h ('k') | ppapi/cpp/dev/foobar_dev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698