|
| 1 | +/* |
| 2 | + * Copyright (C) 2020 Matthieu Gautier <mgautier@kymeria.fr> |
| 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 | + * 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. |
| 13 | + * |
| 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 Street, Fifth Floor, Boston, |
| 17 | + * MA 02110-1301, USA. |
| 18 | + */ |
| 19 | + |
| 20 | + |
| 21 | +#include <jni.h> |
| 22 | +#include "org_kiwix_libkiwix_Bookmark.h" |
| 23 | + |
| 24 | +#include "utils.h" |
| 25 | +#include "bookmark.h" |
| 26 | + |
| 27 | +#define NATIVE_TYPE kiwix::Bookmark |
| 28 | +#define TYPENAME libkiwix_Bookmark |
| 29 | +#include <macros.h> |
| 30 | + |
| 31 | +METHOD0(void, setNativeBookmark) |
| 32 | +{ |
| 33 | + SET_PTR(std::make_shared<NATIVE_TYPE>()); |
| 34 | +} |
| 35 | + |
| 36 | +DISPOSE |
| 37 | + |
| 38 | +GETTER(jstring, getBookId) |
| 39 | + |
| 40 | +GETTER(jstring, getBookTitle) |
| 41 | + |
| 42 | +GETTER(jstring, getUrl) |
| 43 | + |
| 44 | +GETTER(jstring, getTitle) |
| 45 | + |
| 46 | +GETTER(jstring, getLanguage) |
| 47 | + |
| 48 | +GETTER(jstring, getDate) |
| 49 | + |
| 50 | +METHOD(void, setBookId, jstring bookId) { |
| 51 | + THIS->setBookId(TO_C(bookId)); |
| 52 | +} |
| 53 | + |
| 54 | +METHOD(void, setBookTitle, jstring bookTitle) { |
| 55 | + THIS->setBookTitle(TO_C(bookTitle)); |
| 56 | +} |
| 57 | + |
| 58 | +METHOD(void, setUrl, jstring url) { |
| 59 | + THIS->setUrl(TO_C(url)); |
| 60 | +} |
| 61 | + |
| 62 | +METHOD(void, setTitle, jstring title) { |
| 63 | + THIS->setTitle(TO_C(title)); |
| 64 | +} |
| 65 | + |
| 66 | +METHOD(void, setLanguage, jstring lang) { |
| 67 | + THIS->setLanguage(TO_C(lang)); |
| 68 | +} |
| 69 | + |
| 70 | +METHOD(void, setDate, jstring date) { |
| 71 | + THIS->setDate(TO_C(date)); |
| 72 | +} |
0 commit comments