## AnjutaProfileManager AnjutaProfileManager — Managers a stack of plugins profiles |

## Stability Level

Unstable, unless otherwise indicated

## Synopsis

    #include <libanjuta/anjuta-profile-manager.h>

                        AnjutaProfileManagerClass;
                        AnjutaProfileManagerPriv;
                        AnjutaProfileManager;
    AnjutaProfileManager * anjuta_profile_manager_new       (AnjutaPluginManager *plugin_manager);
    gboolean            anjuta_profile_manager_push         (AnjutaProfileManager *profile_manager,
                                                             AnjutaProfile *profile,
                                                             GError **error);
    gboolean            anjuta_profile_manager_pop          (AnjutaProfileManager *profile_manager,
                                                             const gchar *profile_name,
                                                             GError **error);
    void                anjuta_profile_manager_freeze       (AnjutaProfileManager *profile_manager);
    gboolean            anjuta_profile_manager_thaw         (AnjutaProfileManager *profile_manager,
                                                             GError **error);
    AnjutaProfile*      anjuta_profile_manager_get_current  (AnjutaProfileManager *profile_manager);

## Object Hierarchy

      GObject
       +----AnjutaProfileManager

## Properties

      "plugin-manager"           AnjutaPluginManager*  : Read / Write / Construct

## Signals

      "profile-descoped"                               : Run First
      "profile-popped"                                 : Run First
      "profile-pushed"                                 : Run First
      "profile-scoped"                                 : Run First

## Description

Anjuta uses up to two profiles. A "no project" profile is used when no project is loaded a project profile when one is loaded. If a second project is loaded, it is loaded in another instance of Anjuta. When a project is closed, Anjuta goes back to the "no project" profile.

The profile manager can be in a frozen state where you can push or pop a profile from the stack without triggering a change of the profile.

## Details

### AnjutaProfileManagerClass

    typedef struct {
    	GObjectClass parent_class;
    	void(* profile_pushed) (AnjutaProfileManager *self,
    							AnjutaProfile* profile);
    	void(* profile_popped) (AnjutaProfileManager *self,
    							AnjutaProfile* profile);
    	void(* profile_descoped) (AnjutaProfileManager *self,
    							  AnjutaProfile* profile);
    	void(* profile_scoped) (AnjutaProfileManager *self,
    							AnjutaProfile* profile);
    } AnjutaProfileManagerClass;

### AnjutaProfileManagerPriv

    typedef struct _AnjutaProfileManagerPriv AnjutaProfileManagerPriv;

### AnjutaProfileManager

    typedef struct _AnjutaProfileManager AnjutaProfileManager;

Stores stack of AnjutaProfile.

### anjuta_profile_manager_new ()

    AnjutaProfileManager * anjuta_profile_manager_new       (AnjutaPluginManager *plugin_manager);

Create a new profile manager.

`plugin_manager` : | the AnjutaPluginManager used by all profiles.
Returns : | the new AnjutaProfileManager object.

### anjuta_profile_manager_push ()

    gboolean            anjuta_profile_manager_push         (AnjutaProfileManager *profile_manager,
                                                             AnjutaProfile *profile,
                                                             GError **error);

Add a new profile at the top of the profile manager stack. If the profile manager is not frozen, this new profile will be loaded immediatly and become the current profile.

`profile_manager` : | the AnjutaProfileManager object.
`profile` : | the new AnjutaProfile.
`error` : | error propagation and reporting.
Returns : | TRUE on success, FALSE otherwise.

### anjuta_profile_manager_pop ()

    gboolean            anjuta_profile_manager_pop          (AnjutaProfileManager *profile_manager,
                                                             const gchar *profile_name,
                                                             GError **error);

Remove a profile from the profile manager stack. If the manager is not frozen, only the current profile can be removed. It will be unloaded and the previous profile will be loaded. If the manager is frozen, the current profile or the last pushed profile can be removed.

`profile_manager` : | the AnjutaProfileManager object.
`profile_name` : | the name of the profile to remove.
`error` : | error propagation and reporting.
Returns : | TRUE on success, FALSE otherwise.

### anjuta_profile_manager_freeze ()

    void                anjuta_profile_manager_freeze       (AnjutaProfileManager *profile_manager);

Freeze the plugin manager. In this state, plugins can be added and removed from the stack without triggering any change in the current profile. It is possible to freeze the manager several times but it will be back in its normal state only after as much call of `anjuta_profile_manager_thaw()`.

`profile_manager` : | the AnjutaProfileManager object.

### anjuta_profile_manager_thaw ()

    gboolean            anjuta_profile_manager_thaw         (AnjutaProfileManager *profile_manager,
                                                             GError **error);

Put back the plugin manager in its normal mode after calling `anjuta_profile_manager_freeze()`. It will load a new profile if one has been added while the manager was frozen.

`profile_manager` : | the AnjutaProfileManager object.
`error` : | error propagation and reporting.
Returns : | TRUE on success, FALSE otherwise.

### anjuta_profile_manager_get_current ()

    AnjutaProfile*      anjuta_profile_manager_get_current  (AnjutaProfileManager *profile_manager);

Return the current profile.

`profile_manager` : | A AnjutaProfileManager object.
Returns : | a AnjutaProfile object or NULL if the profile stack is empty.

## Property Details

### The `"plugin-manager"` property

      "plugin-manager"           AnjutaPluginManager*  : Read / Write / Construct

The plugin manager to use for profile plugins.

## Signal Details

### The `"profile-descoped"` signal

    void                user_function                      (AnjutaProfileManager *profile_manager,
                                                            AnjutaProfile        *profile,
                                                            gpointer              user_data)            : Run First

Emitted when a profile will be unloaded.

`profile_manager` : | a AnjutaProfileManager object.
`profile` : | the old unloaded AnjutaProfile.
`user_data` : | user data set when the signal handler was connected.

### The `"profile-popped"` signal

    void                user_function                      (AnjutaProfileManager *profile_manager,
                                                            AnjutaProfile        *profile,
                                                            gpointer              user_data)            : Run First

Emitted when a profile is removed from the stack. If the profile manager is not frozen, the current profile will be unloaded and the previous one will be loaded.

`profile_manager` : | a AnjutaProfileManager object.
`profile` : | the current removed AnjutaProfile.
`user_data` : | user data set when the signal handler was connected.

### The `"profile-pushed"` signal

    void                user_function                      (AnjutaProfileManager *profile_manager,
                                                            AnjutaProfile        *profile,
                                                            gpointer              user_data)            : Run First

Emitted when a profile is added in the stack. If the profile manager is not frozen, the current profile will be unloaded and the new one will be loaded.

`profile_manager` : | a AnjutaProfileManager object.
`profile` : | the new AnjutaProfile added.
`user_data` : | user data set when the signal handler was connected.

### The `"profile-scoped"` signal

    void                user_function                      (AnjutaProfileManager *profile_manager,
                                                            AnjutaProfile        *profile,
                                                            gpointer              user_data)            : Run First

Emitted when a new profile is loaded.

`profile_manager` : | a AnjutaProfileManager object.
`profile` : | the current loaded AnjutaProfile.
`user_data` : | user data set when the signal handler was connected.

## See Also

AnjutaPluginManager, AnjutaProfile