1 /*
2 * Tethys: GUI Utilities
3 * Copyright 2012-2026. Tony Washer
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 * use this file except in compliance with the License. You may obtain a copy
7 * of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 */
17 package io.github.tonywasher.joceanus.tethys.api.thread;
18
19 import io.github.tonywasher.joceanus.oceanus.base.OceanusException;
20 import io.github.tonywasher.joceanus.oceanus.profile.OceanusProfile;
21
22 /**
23 * Report status.
24 */
25 public interface TethysUIThreadStatusReport {
26 /**
27 * Initialise Task.
28 *
29 * @param pTask the task
30 * @throws OceanusException on cancellation
31 */
32 void initTask(String pTask) throws OceanusException;
33
34 /**
35 * Set number of stages.
36 *
37 * @param pNumStages the number of stages
38 * @throws OceanusException on cancellation
39 */
40 void setNumStages(int pNumStages) throws OceanusException;
41
42 /**
43 * Set new stage.
44 *
45 * @param pStage the new stage
46 * @throws OceanusException on cancellation
47 */
48 void setNewStage(String pStage) throws OceanusException;
49
50 /**
51 * Set number of steps.
52 *
53 * @param pNumSteps the number of steps
54 * @throws OceanusException on cancellation
55 */
56 void setNumSteps(int pNumSteps) throws OceanusException;
57
58 /**
59 * Set steps done.
60 *
61 * @param pSteps the number of steps done
62 * @throws OceanusException on cancellation
63 */
64 void setStepsDone(int pSteps) throws OceanusException;
65
66 /**
67 * Set next step.
68 *
69 * @throws OceanusException on cancellation
70 */
71 void setNextStep() throws OceanusException;
72
73 /**
74 * Set next step.
75 *
76 * @param pStep the step to set
77 * @throws OceanusException on cancellation
78 */
79 void setNextStep(String pStep) throws OceanusException;
80
81 /**
82 * Set Completion.
83 *
84 * @throws OceanusException on cancellation
85 */
86 void setCompletion() throws OceanusException;
87
88 /**
89 * Is the task cancelled?
90 *
91 * @throws OceanusException on cancellation
92 */
93 void checkForCancellation() throws OceanusException;
94
95 /**
96 * Throw cancellation exception.
97 *
98 * @throws OceanusException on error
99 */
100 void throwCancelException() throws OceanusException;
101
102 /**
103 * Obtain the active task.
104 *
105 * @return the active task
106 */
107 OceanusProfile getActiveTask();
108 }