01: /*
02: *
03: *
04: * Copyright 1990-2007 Sun Microsystems, Inc. All Rights Reserved.
05: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License version
09: * 2 only, as published by the Free Software Foundation.
10: *
11: * This program is distributed in the hope that it will be useful, but
12: * WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * General Public License version 2 for more details (a copy is
15: * included at /legal/license.txt).
16: *
17: * You should have received a copy of the GNU General Public License
18: * version 2 along with this work; if not, write to the Free Software
19: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA
21: *
22: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
23: * Clara, CA 95054 or visit www.sun.com if you need additional
24: * information or have any questions.
25: */
26:
27: package com.sun.midp.lcdui;
28:
29: import javax.microedition.lcdui.Displayable;
30:
31: /**
32: * This class provides methods to abstract the central foreground control
33: * code from the the LCDUI library.
34: */
35: public interface ForegroundController {
36: /**
37: * Called to register a newly created Display. Must method must
38: * be called before the other methods can be called.
39: *
40: * @param displayId ID of the Display
41: * @param ownerClassName Class name of the that owns the display
42: *
43: * @return a place holder displayable to used when "getCurrent()==null",
44: * if null is returned an empty form is used
45: */
46: /*
47: * Implementation note: If an general customization interface is
48: * created for LCDUI to replace the build time constants based system, the
49: * displayable creation function of the method should be moved to it.
50: */
51: Displayable registerDisplay(int displayId, String ownerClassName);
52:
53: /**
54: * Called to request the foreground.
55: *
56: * @param displayId ID of the Display
57: * @param isAlert true if the current displayable is an Alert
58: */
59: void requestForeground(int displayId, boolean isAlert);
60:
61: /**
62: * Called to request the background.
63: *
64: * @param displayId ID of the Display
65: */
66: void requestBackground(int displayId);
67:
68: /**
69: * Called to start preempting. The given display will preempt all other
70: * displays for this isolate.
71: *
72: * @param displayId ID of the Display
73: */
74: void startPreempting(int displayId);
75:
76: /**
77: * Called to stop preempting.
78: *
79: * @param displayId ID of the Display
80: */
81: void stopPreempting(int displayId);
82: }
|