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.Display;
30: import javax.microedition.lcdui.Displayable;
31: import javax.microedition.lcdui.Image;
32:
33: import com.sun.midp.events.EventQueue;
34:
35: /**
36: * This class works around the fact that public classes can not
37: * be added to a javax package by an implementation.
38: */
39: public interface DisplayEventHandler {
40:
41: /**
42: * Preempt the current displayable with
43: * the given displayable until donePreempting is called.
44: *
45: * @param d displayable to show the user
46: * @param waitForDisplay if true this method will wait if the
47: * screen is being preempted by another thread.
48: *
49: * @return an preempt token object to pass to donePreempting done if prempt
50: * will happen, else null
51: *
52: * @exception SecurityException if the caller does not have permission
53: * the internal MIDP permission.
54: * @exception InterruptedException if another thread interrupts the
55: * calling thread while this method is waiting to preempt the
56: * display.
57: */
58: public Object preemptDisplay(Displayable d, boolean waitForDisplay)
59: throws InterruptedException;
60:
61: /**
62: * Display the displayable that was being displayed before
63: * preemptDisplay was called.
64: *
65: * @param preemptToken the token returned from preemptDisplay
66: */
67: public void donePreempting(Object preemptToken);
68:
69: /**
70: * Called by Display to notify DisplayEventHandler that
71: * Display has been sent to the background to finish
72: * preempt process if any.
73: *
74: * @param displayId id of Display
75: */
76: public void onDisplayBackgroundProcessed(int displayId);
77:
78: /**
79: * Initialize Display Event Handler
80: *
81: * @param theDisplayEventProducer producer for display events
82: * @param theForegroundController controls which display has the foreground
83: * @param theRepaintEventProducer producer for repaint events events
84: * @param theDisplayContainer container for display objects
85: */
86: public void initDisplayEventHandler(
87: DisplayEventProducer theDisplayEventProducer,
88: ForegroundController theForegroundController,
89: RepaintEventProducer theRepaintEventProducer,
90: DisplayContainer theDisplayContainer);
91:
92: /**
93: * Initialize per suite data of the display event handler.
94: *
95: * @param drawTrustedIcon true, to draw the trusted icon in the upper
96: * status bar for every display of this suite
97: */
98: void initSuiteData(boolean drawTrustedIcon);
99: }
|