Version 3.6.0.4, tag libreoffice-3.6.0.4
[LibreOffice.git] / reportbuilder / java / com / sun / star / report / ReportJob.java
blob9bda7926f7d4e7fee44fe8e4707dcfe378903ae8
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 package com.sun.star.report;
29 import java.io.IOException;
31 /**
32 * This allows some simple job control. A job can be interrupted (or if it has
33 * not yet been started, canceled), and the job status can be queried (scheduled,
34 * running, finished).
36 * <table border="1">
37 * <tr>
38 * <th>JobStatus</th><th>running</th><th>finished</th>
39 * </tr>
40 * <tr>
41 * <td>Scheduled</td><td>false</td><td>false</td>
42 * </tr>
43 * <tr>
44 * <td>Running</td><td>true</td><td>false</td>
45 * </tr>
46 * <tr>
47 * <td>Finished</td><td>false</td><td>true</td>
48 * </tr>
49 * </table>
51 * @author Thomas Morgner
53 public interface ReportJob
56 /**
57 * Although we might want to run the job as soon as it has been
58 * created, sometimes it is wiser to let the user add some listeners
59 * first. If we execute at once, the user either has to deal with
60 * threading code or wont receive any progress information in single
61 * threaded environments.
62 * @throws java.io.IOException
63 * @throws ReportExecutionException
65 void execute()
66 throws ReportExecutionException, IOException;
68 /**
69 * Interrupt the job.
71 void interrupt();
73 /**
74 * Queries the jobs execution status.
76 * @return true, if the job is currently running, false otherwise.
78 boolean isRunning();
80 /**
81 * Queries the jobs result status.
83 * @return true, if the job is finished (or has been interrupted), false
84 * if the job waits for activation.
86 boolean isFinished();
88 void addProgressIndicator(JobProgressIndicator indicator);
90 void removeProgressIndicator(JobProgressIndicator indicator);