001: /*
002: * Copyright 1990-2007 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
004: *
005: * This program is free software; you can redistribute it and/or
006: * modify it under the terms of the GNU General Public License version
007: * 2 only, as published by the Free Software Foundation.
008: *
009: * This program is distributed in the hope that it will be useful, but
010: * WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012: * General Public License version 2 for more details (a copy is
013: * included at /legal/license.txt).
014: *
015: * You should have received a copy of the GNU General Public License
016: * version 2 along with this work; if not, write to the Free Software
017: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
018: * 02110-1301 USA
019: *
020: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
021: * Clara, CA 95054 or visit www.sun.com if you need additional
022: * information or have any questions.
023: */
024:
025: package com.sun.midp.midlet;
026:
027: import javax.microedition.midlet.MIDlet;
028:
029: /**
030: * The interface decouples the MIDlet state handler for the VM.
031: */
032: public interface MIDletStateListener {
033: /**
034: * Called before a MIDlet is created.
035: *
036: * @param suite reference to the loaded suite
037: * @param className class name of the MIDlet to be created
038: */
039: void midletPreStart(MIDletSuite suite, String className);
040:
041: /**
042: * Called after a MIDlet is successfully created.
043: *
044: * @param suite reference to the loaded suite
045: * @param className Class name of the MIDlet
046: * @param externalAppId ID of given by an external application manager
047: */
048: void midletCreated(MIDletSuite suite, String className,
049: int externalAppId);
050:
051: /**
052: * Called before a MIDlet is activated.
053: *
054: * @param suite reference to the loaded suite
055: * @param className class name of the MIDlet
056: */
057: void preActivated(MIDletSuite suite, String className);
058:
059: /**
060: * Called after a MIDlet is successfully activated. This is after
061: * the startApp method is called.
062: *
063: * @param suite reference to the loaded suite
064: * @param midlet reference to the MIDlet
065: */
066: void midletActivated(MIDletSuite suite, MIDlet midlet);
067:
068: /**
069: * Called after a MIDlet is successfully paused.
070: *
071: * @param suite reference to the loaded suite
072: * @param className class name of the MIDlet
073: */
074: void midletPaused(MIDletSuite suite, String className);
075:
076: /**
077: * Called after a MIDlet pauses itself. In this case pauseApp has
078: * not been called.
079: *
080: * @param suite reference to the loaded suite
081: * @param className class name of the MIDlet
082: */
083: void midletPausedItself(MIDletSuite suite, String className);
084:
085: /**
086: * Called when a MIDlet calls MIDlet resume request.
087: *
088: * @param suite reference to the loaded suite
089: * @param className class name of the MIDlet
090: */
091: void resumeRequest(MIDletSuite suite, String className);
092:
093: /**
094: * Called after a MIDlet is successfully destroyed.
095: *
096: * @param suite reference to the loaded suite
097: * @param className class name of the MIDlet
098: */
099: void midletDestroyed(MIDletSuite suite, String className);
100: }
|