OLD | NEW |
| (Empty) |
1 /* | |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | |
3 * Copyright (C) 2006-2016 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 CRITICAL, | |
38 INVALID | |
39 } | |
40 | |
41 public String getMessageString() | |
42 { | |
43 return getMessageString(this.ptr); | |
44 } | |
45 | |
46 public String getTitle() | |
47 { | |
48 return getTitle(this.ptr); | |
49 } | |
50 | |
51 public Type getType() | |
52 { | |
53 return getType(this.ptr); | |
54 } | |
55 | |
56 public void markAsShown() | |
57 { | |
58 markAsShown(this.ptr); | |
59 } | |
60 | |
61 @Override | |
62 public String toString() | |
63 { | |
64 return this.getTitle() + " - " + this.getMessageString(); | |
65 } | |
66 | |
67 private final static native void registerNatives(); | |
68 | |
69 private final static native String getMessageString(long ptr); | |
70 | |
71 private final static native String getTitle(long ptr); | |
72 | |
73 private final static native Type getType(long ptr); | |
74 | |
75 private final static native void markAsShown(long ptr); | |
76 } | |
OLD | NEW |