kodi
JNIXBMCJsonHandler.h
1 /*
2  * Copyright (C) 2018 Christian Browet
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "interfaces/json-rpc/IClient.h"
12 #include "interfaces/json-rpc/ITransportLayer.h"
13 
14 #include <androidjni/JNIBase.h>
15 
16 namespace jni
17 {
18 
19  class CJNIXBMCJsonHandler : public CJNIBase
20  {
21  public:
22  CJNIXBMCJsonHandler(const jni::jhobject &object) : CJNIBase(object) {}
23 
24  static void RegisterNatives(JNIEnv* env);
25 
26 
27  protected:
28  ~CJNIXBMCJsonHandler() override = default;
29 
30  static jstring _requestJSON(JNIEnv* env, jobject thiz, jstring request);
31 
33  {
34  public:
35  CJNITransportLayer() = default;
36  ~CJNITransportLayer() override = default;
37 
38  // implementations of JSONRPC::ITransportLayer
39  bool PrepareDownload(const char *path, CVariant &details, std::string &protocol) override;
40  bool Download(const char *path, CVariant &result) override;
41  int GetCapabilities() override;
42  };
43 
45  {
46  public:
47  int GetPermissionFlags() override;
48  int GetAnnouncementFlags() override;
49  bool SetAnnouncementFlags(int flags) override;
50  };
51 
52  };
53 
54 }
Definition: JNIXBMCJsonHandler.h:32
Definition: JNIXBMCJsonHandler.h:19
Definition: Variant.h:31
Definition: JNIMainActivity.h:15
Definition: JNIXBMCJsonHandler.h:44
Definition: ITransportLayer.h:27
Definition: IClient.h:13