| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, | |
| 3 * Copyright (C) 2006-present eyeo GmbH | |
| 4 * | |
| 5 * Adblock Plus is free software: you can redistribute it and/or modify | |
| 6 * it under the terms of the GNU General Public License version 3 as | |
| 7 * published by the Free Software Foundation. | |
| 8 * | |
| 9 * Adblock Plus 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 Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | |
| 16 */ | |
| 17 | |
| 18 package org.adblockplus.libadblockplus; | |
| 19 | |
| 20 public class Notification extends JsValue | |
| 21 { | |
| 22 static | |
| 23 { | |
| 24 System.loadLibrary("adblockplus-jni"); | |
| 25 registerNatives(); | |
| 26 } | |
| 27 | |
| 28 private Notification(final long ptr) | |
| 29 { | |
| 30 super(ptr); | |
| 31 } | |
| 32 | |
| 33 public static enum Type | |
| 34 { | |
| 35 INFORMATION, | |
| 36 QUESTION, | |
| 37 RELENTLESS, | |
| 38 CRITICAL, | |
| 39 INVALID | |
| 40 } | |
| 41 | |
| 42 public String getMessageString() | |
| 43 { | |
| 44 return getMessageString(this.ptr); | |
| 45 } | |
| 46 | |
| 47 public String getTitle() | |
| 48 { | |
| 49 return getTitle(this.ptr); | |
| 50 } | |
| 51 | |
| 52 public Type getType() | |
| 53 { | |
| 54 return getType(this.ptr); | |
| 55 } | |
| 56 | |
| 57 public void markAsShown() | |
| 58 { | |
| 59 markAsShown(this.ptr); | |
| 60 } | |
| 61 | |
| 62 @Override | |
| 63 public String toString() | |
| 64 { | |
| 65 return this.getTitle() + " - " + this.getMessageString(); | |
| 66 } | |
| 67 | |
| 68 private final static native void registerNatives(); | |
| 69 | |
| 70 private final static native String getMessageString(long ptr); | |
| 71 | |
| 72 private final static native String getTitle(long ptr); | |
| 73 | |
| 74 private final static native Type getType(long ptr); | |
| 75 | |
| 76 private final static native void markAsShown(long ptr); | |
| 77 } | |
| OLD | NEW |