## IdeService IdeService — Provide project services for plugins |

## Functions

const gchar * | ide_service_get_name ()
void | ide_service_start ()
void | ide_service_stop ()

## Signals

void | context-loaded | Run Last

## Types and Values

#define | IDE_TYPE_SERVICE
struct | IdeServiceInterface
| IdeService

## Object Hierarchy

        GInterface
        ╰── IdeService

## Prerequisites

IdeService requires IdeObject.

## Description

The IdeService inteface is meant as a place to provide utility code to your plugin that should have it's lifetime bound to the lifetime of the loaded project.

When the project is created, the service will be started. When the project is closed, the service will be stopped and discarded.

## Functions

### ide_service_get_name ()

    const gchar *
    ide_service_get_name (IdeService *self);

Gets the name of the service. By default, the name of the object is used as the service name.

#### Parameters

self | an IdeService |

#### Returns

A name for the service.

[not nullable]

Since: 3.16

### ide_service_start ()

    void
    ide_service_start (IdeService *self);

This calls the IdeServiceInterface.start virtual function which plugins use to initialize their service.

This function is called by the owning IdeContext and should not be needed by plugins or other internal API in Builder.

#### Parameters

self | an IdeService |

Since: 3.16

### ide_service_stop ()

    void
    ide_service_stop (IdeService *self);

This calls the IdeServiceInterface.stop virtual function which plugins use to cleanup after their service.

This function is called by the owning IdeContext and should not be needed by plugins or other internal API in Builder.

#### Parameters

self | an IdeService |

Since: 3.16

## Types and Values

### IDE_TYPE_SERVICE

    #define IDE_TYPE_SERVICE (ide_service_get_type())

### struct IdeServiceInterface

    struct IdeServiceInterface {
      GTypeInterface parent_interface;

      void         (*context_loaded) (IdeService *self);
      const gchar *(*get_name)       (IdeService *self);
      void         (*start)          (IdeService *self);
      void         (*stop)           (IdeService *self);
    };

#### Members

GTypeInterface `parent_interface`; |  |
`context_loaded` () | Implement this virtual function to be notified when the IdeContext has completed loading. |
`get_name` () | Implement this virtual function to provide a useful name of the service. By default, the type name is used. |
`start` () | Implement this virtual function be notified when the service should start processing. This is usually before `context_loaded` has been called and services must deal with that. |
`stop` () | Implement this virtual function to be notified when the service should shut itself down by cleaning up any resources. |

Since: 3.16

### IdeService

    typedef struct _IdeService IdeService;

## Signal Details

### The `“context-loaded”` signal

    void
    user_function (IdeService *self,
                   gpointer    user_data)

The "context-loaded" signal is emitted when the owning IdeContext has completed loading the project. This may be useful if you want to defer startup procedures until the context is fully loaded.

#### Parameters

self | an IdeService |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 3.20