- add sources.
[platform/framework/web/crosswalk.git] / src / base / android / jni_generator / sample_for_tests.h
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <jni.h>
6 #include <map>
7 #include <string>
8
9 #include "base/basictypes.h"
10
11 namespace base {
12 namespace android {
13
14 // This file is used to:
15 // - document the best practices and guidelines on JNI usage.
16 // - ensure sample_for_tests_jni.h compiles and the functions declared in it
17 // as expected.
18 //
19 // All methods are called directly from Java. See more documentation in
20 // SampleForTests.java.
21 class CPPClass {
22  public:
23   CPPClass();
24   ~CPPClass();
25
26   class InnerClass {
27    public:
28     jdouble MethodOtherP0(JNIEnv* env, jobject obj);
29   };
30
31   void Destroy(JNIEnv* env, jobject obj);
32
33   jint Method(JNIEnv* env, jobject obj);
34
35   void AddStructB(JNIEnv* env, jobject obj, jobject structb);
36
37   void IterateAndDoSomethingWithStructB(JNIEnv* env, jobject obj);
38
39  private:
40   std::map<long, std::string> map_;
41
42   DISALLOW_COPY_AND_ASSIGN(CPPClass);
43 };
44
45 }  // namespace android
46 }  // namespace base