org.gnome.glib

## Class Application

- Object
- - org.freedesktop.bindings.Pointer
  - - org.freedesktop.bindings.Proxy
    - - org.gnome.glib.Object
      - - org.gnome.glib.Application

- Direct Known Subclasses:
    Application

      public class Application
      extends Object

  The foundation of an application. This class is the basis for higher-level functionality appropriate to a GUI framework; it is accessed through the [ `org.gnome.gtk`] `Application` class; see there for a full discussion.
  Since:
    4.1.2
  Author:
    Guillaume Mazoyer

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `Application.Activate` This signal is emitted on the primary instance when an activation occurs (at startup or by calling the Application `activate()` method.
    `static interface` | `Application.CommandLine` Connect to this signal to receive command line arguments from a remote instance.
    `static interface` | `Application.Startup` This signal is emitted on the primary instance immediately after registration.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `activate()` Emits the `Application.Activate` signal.
    `String` | `getApplicationId()` Gets the unique identifier of the Application.
    `ApplicationFlags` | `getFlags()` Returns the `flags` of the Application.
    `int` | `getInactivityTimeout()` Returns the current inactivity timeout for the Application.
    `void` | `hold()` Increases the use count of the Application.
    `boolean` | `isRemote()` Checks if the Application is remote.
    `void` | `quit()` Immediately quits the Application.
    `int` | `run(String[] args)` Runs the Application.
    `void` | `setApplicationId(String id)` Sets the unique identifier of the Application.
    `void` | `setFlags(ApplicationFlags flags)` Sets the flags of the Application.
    `void` | `setInactivityTimeout(int timeout)` Sets the current inactivity timeout (in milliseconds) for the Application.
    `void` | `unhold()` Decrease the use count of the Application.

    - ### Methods inherited from class org.freedesktop.bindings.Pointer

      `toString`

    - ### Methods inherited from class Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### activate

          public void activate()

      Emits the `Application.Activate` signal.
      Since:
        4.1.2

    - #### getApplicationId

          public String getApplicationId()

      Gets the unique identifier of the Application.
      Since:
        4.1.2

    - #### getFlags

          public ApplicationFlags getFlags()

      Returns the `flags` of the Application.
      Since:
        4.1.2

    - #### getInactivityTimeout

          public int getInactivityTimeout()

      Returns the current inactivity timeout for the Application. This is the amount of time (in milliseconds) after the last call to `unhold()` before the Application stops running.
      Since:
        4.1.2

    - #### hold

          public void hold()

      Increases the use count of the Application.

      Use this function to indicate that the Application has a reason to continue to run. This method is called by GTK+ when a top-level `Window` is on the screen.

      To cancel the hold, call `unhold()`.

      Since:
        4.1.2

    - #### isRemote

          public boolean isRemote()

      Checks if the Application is remote. If it is then it means that another instance of the Application exists and is running, the primary; instance.

      Not sure what the point of this is; this method is not available until after `run()` has been called, and the signals raised on this class all happen in the primary instance.

      Since:
        4.1.2

    - #### quit

          public void quit()

      Immediately quits the Application.
      Since:
        4.1.2

    - #### run

          public int run(String[] args)

      Runs the Application.

      This is intended to be called from `main()`. Its return value is should be used as the exit value of the program.

      You can pass `null` if you don't have any command line arguments.

      Since:
        4.1.2

    - #### setApplicationId

          public void setApplicationId(String id)

      Sets the unique identifier of the Application. The application ID must be valid. See `isValidId()`.
      Since:
        4.1.2

    - #### setFlags

          public void setFlags(ApplicationFlags flags)

      Sets the flags of the Application.
      Since:
        4.1.2

    - #### setInactivityTimeout

          public void setInactivityTimeout(int timeout)

      Sets the current inactivity timeout (in milliseconds) for the Application.
      Since:
        4.1.2

    - #### unhold

          public void unhold()

      Decrease the use count of the Application.

      When the use count reaches zero, the Application will stop running.

      You should never call this function except to cancel the effect of a previous call to `hold()`.

      Since:
        4.1.2