]> rtime.felk.cvut.cz Git - hornmich/skoda-qr-demo.git/blob - QRScanner/glass/src/main/java/cz/cvut/fel/dce/qrscanner/mupdf/MuPDFAlertInternal.java
Implement PDF preview showing, change icon, implement views and manus layout
[hornmich/skoda-qr-demo.git] / QRScanner / glass / src / main / java / cz / cvut / fel / dce / qrscanner / mupdf / MuPDFAlertInternal.java
1 package cz.cvut.fel.dce.qrscanner.mupdf;
2
3 // Version of MuPDFAlert without enums to simplify JNI
4 public class MuPDFAlertInternal {
5         public final String message;
6         public final int iconType;
7         public final int buttonGroupType;
8         public final String title;
9         public int buttonPressed;
10
11         MuPDFAlertInternal(String aMessage, int aIconType, int aButtonGroupType, String aTitle, int aButtonPressed) {
12                 message = aMessage;
13                 iconType = aIconType;
14                 buttonGroupType = aButtonGroupType;
15                 title = aTitle;
16                 buttonPressed = aButtonPressed;
17         }
18
19         MuPDFAlertInternal(MuPDFAlert alert) {
20                 message = alert.message;
21                 iconType = alert.iconType.ordinal();
22                 buttonGroupType = alert.buttonGroupType.ordinal();
23                 title = alert.message;
24                 buttonPressed = alert.buttonPressed.ordinal();
25         }
26
27         MuPDFAlert toAlert() {
28                 return new MuPDFAlert(message, MuPDFAlert.IconType.values()[iconType], MuPDFAlert.ButtonGroupType.values()[buttonGroupType], title, MuPDFAlert.ButtonPressed.values()[buttonPressed]);
29         }
30 }