LibreOffice Module android (master) 1
LOEvent.java
Go to the documentation of this file.
1/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9package org.libreoffice;
10
11import android.graphics.PointF;
12import android.graphics.RectF;
13import android.view.KeyEvent;
14
17
21public class LOEvent implements Comparable<LOEvent> {
22 public static final int SIZE_CHANGED = 1;
23 public static final int CHANGE_PART = 2;
24 public static final int LOAD = 3;
25 public static final int CLOSE = 4;
26 public static final int TILE_REEVALUATION_REQUEST = 5;
27 public static final int THUMBNAIL = 6;
28 public static final int TILE_INVALIDATION = 7;
29 public static final int TOUCH = 8;
30 public static final int KEY_EVENT = 9;
31 public static final int CHANGE_HANDLE_POSITION = 10;
32 public static final int SWIPE_RIGHT = 11;
33 public static final int SWIPE_LEFT = 12;
34 public static final int NAVIGATION_CLICK = 13;
35 public static final int UNO_COMMAND = 14;
36 public static final int LOAD_NEW = 16;
37 public static final int SAVE_AS = 17;
38 public static final int UPDATE_PART_PAGE_RECT = 18;
39 public static final int UPDATE_ZOOM_CONSTRAINTS = 19;
40 public static final int UPDATE_CALC_HEADERS = 20;
41 public static final int REFRESH = 21;
42 public static final int PAGE_SIZE_CHANGED = 22;
43 public static final int UNO_COMMAND_NOTIFY = 23;
44 public static final int SAVE_COPY_AS = 24;
45
46
47 public final int mType;
48 public int mPriority = 0;
50
52 public int mPartIndex;
58 public PointF mDocumentCoordinate;
59 public KeyEvent mKeyEvent;
60 public RectF mInvalidationRect;
62 public String mValue;
63 public int mPageWidth;
64 public int mPageHeight;
65 public boolean mNotify;
66
67 public LOEvent(int type) {
68 mType = type;
69 }
70
71 public LOEvent(int type, ComposedTileLayer composedTileLayer) {
72 mType = type;
73 mTypeString = "Tile Reevaluation";
74 mComposedTileLayer = composedTileLayer;
75 }
76
77 public LOEvent(int type, String someString) {
78 mType = type;
79 mTypeString = "String";
80 mString = someString;
81 mValue = null;
82 }
83
84 public LOEvent(int type, String someString, boolean notify) {
85 mType = type;
86 mTypeString = "String";
87 mString = someString;
88 mValue = null;
89 mNotify = notify;
90 }
91
92 public LOEvent(int type, String someString, String value, boolean notify) {
93 mType = type;
94 mTypeString = "String";
95 mString = someString;
96 mValue = value;
97 mNotify = notify;
98 }
99
100 public LOEvent(int type, String key, String value) {
101 mType = type;
102 mTypeString = "key / value";
103 mString = key;
104 mValue = value;
105 }
106
107 public LOEvent(String filePath, int type) {
108 mType = type;
109 mTypeString = "Load";
110 this.filePath = filePath;
111 }
112
113 public LOEvent(String filePath, String fileType, int type) {
114 mType = type;
115 mTypeString = "Load New/Save As";
116 this.filePath = filePath;
117 this.fileType = fileType;
118 }
119
120 public LOEvent(int type, int partIndex) {
121 mType = type;
122 mPartIndex = partIndex;
123 mTypeString = "Change part";
124 }
125
127 mType = type;
128 mTask = task;
129 mTypeString = "Thumbnail";
130 }
131
132 public LOEvent(int type, String touchType, PointF documentTouchCoordinate) {
133 mType = type;
134 mTypeString = "Touch";
135 mTouchType = touchType;
136 mDocumentCoordinate = documentTouchCoordinate;
137 }
138
139 public LOEvent(int type, KeyEvent keyEvent) {
140 mType = type;
141 mTypeString = "Key Event";
142 mKeyEvent = keyEvent;
143 }
144
145 public LOEvent(int type, RectF rect) {
146 mType = type;
147 mTypeString = "Tile Invalidation";
148 mInvalidationRect = rect;
149 }
150
151 public LOEvent(int type, SelectionHandle.HandleType handleType, PointF documentCoordinate) {
152 mType = type;
153 mHandleType = handleType;
154 mDocumentCoordinate = documentCoordinate;
155 }
156
157 public LOEvent(int type, int pageWidth, int pageHeight){
158 mType = type;
159 mPageWidth = pageWidth;
160 mPageHeight = pageHeight;
161 }
162
164 if (mTypeString == null) {
165 return "Event type: " + mType;
166 }
167 return mTypeString;
168 }
169
170 @Override
171 public int compareTo(LOEvent another) {
172 return mPriority - another.mPriority;
173 }
174
175}
176
177/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Events and data that is queued and processed by LOKitThread.
Definition: LOEvent.java:21
static final int LOAD_NEW
Definition: LOEvent.java:36
static final int CHANGE_PART
Definition: LOEvent.java:23
ThumbnailCreator.ThumbnailCreationTask mTask
Definition: LOEvent.java:51
static final int TOUCH
Definition: LOEvent.java:29
static final int TILE_INVALIDATION
Definition: LOEvent.java:28
static final int SAVE_COPY_AS
Definition: LOEvent.java:44
static final int PAGE_SIZE_CHANGED
Definition: LOEvent.java:42
LOEvent(int type, String someString)
Definition: LOEvent.java:77
static final int UNO_COMMAND_NOTIFY
Definition: LOEvent.java:43
LOEvent(int type, SelectionHandle.HandleType handleType, PointF documentCoordinate)
Definition: LOEvent.java:151
static final int NAVIGATION_CLICK
Definition: LOEvent.java:34
static final int SWIPE_RIGHT
Definition: LOEvent.java:32
LOEvent(int type, int partIndex)
Definition: LOEvent.java:120
LOEvent(int type, RectF rect)
Definition: LOEvent.java:145
LOEvent(int type, int pageWidth, int pageHeight)
Definition: LOEvent.java:157
static final int SIZE_CHANGED
Definition: LOEvent.java:22
LOEvent(int type, String key, String value)
Definition: LOEvent.java:100
static final int UPDATE_ZOOM_CONSTRAINTS
Definition: LOEvent.java:39
LOEvent(int type, String someString, String value, boolean notify)
Definition: LOEvent.java:92
static final int LOAD
Definition: LOEvent.java:24
static final int SWIPE_LEFT
Definition: LOEvent.java:33
LOEvent(int type, String touchType, PointF documentTouchCoordinate)
Definition: LOEvent.java:132
ComposedTileLayer mComposedTileLayer
Definition: LOEvent.java:56
static final int UNO_COMMAND
Definition: LOEvent.java:35
static final int CLOSE
Definition: LOEvent.java:25
static final int KEY_EVENT
Definition: LOEvent.java:30
LOEvent(String filePath, int type)
Definition: LOEvent.java:107
static final int UPDATE_PART_PAGE_RECT
Definition: LOEvent.java:38
int compareTo(LOEvent another)
Definition: LOEvent.java:171
static final int UPDATE_CALC_HEADERS
Definition: LOEvent.java:40
LOEvent(int type, ComposedTileLayer composedTileLayer)
Definition: LOEvent.java:71
LOEvent(int type, String someString, boolean notify)
Definition: LOEvent.java:84
static final int CHANGE_HANDLE_POSITION
Definition: LOEvent.java:31
LOEvent(String filePath, String fileType, int type)
Definition: LOEvent.java:113
SelectionHandle.HandleType mHandleType
Definition: LOEvent.java:61
static final int THUMBNAIL
Definition: LOEvent.java:27
LOEvent(int type, KeyEvent keyEvent)
Definition: LOEvent.java:139
static final int TILE_REEVALUATION_REQUEST
Definition: LOEvent.java:26
static final int REFRESH
Definition: LOEvent.java:41
static final int SAVE_AS
Definition: LOEvent.java:37
LOEvent(int type, ThumbnailCreator.ThumbnailCreationTask task)
Definition: LOEvent.java:126
Create thumbnails for the parts of the document.
Selection handle is a common class for "start", "middle" and "end" types of selection handles.
Any value
ResultType type