# gcp::ThemeManager Class Reference

themes engine class. More...

`#include <gcp/theme.h>`

List of all members.

## Public Member Functions

| ThemeManager ()
| ~ThemeManager ()
Theme * | GetTheme (char const *name)
Theme * | GetTheme (std::string &name)
std::list< std::string > const & | GetThemesNames ()
void | OnConfigChanged (GConfClient *client, guint cnxn_id, GConfEntry *entry)
Theme * | CreateNewTheme (Theme *theme=NULL)
void | AddFileTheme (Theme *theme, char const *label)
void | RemoveFileTheme (Theme *theme)
void | ChangeThemeName (Theme *theme, char const *name)
Theme * | GetDefaultTheme ()
void | SetDefaultTheme (char const *name)
void | Shutdown ()

## Detailed Description

themes engine class.

Represent the themes set. Only one global object of this class exists in GChemPaint.

Definition at line 280 of file theme.h.

## Constructor & Destructor Documentation

gcp::ThemeManager::ThemeManager | ( |  | ) |

Constructs a theme manager.

gcp::ThemeManager::~ThemeManager | ( |  | ) |

The destructor.

## Member Function Documentation

Theme* gcp::ThemeManager::GetTheme | ( | char const * | name | ) |

Parameters:

  | name | the name of the requested theme.

Returns:
  the theme corresponding to name if any, or NULL.

Theme* gcp::ThemeManager::GetTheme | ( | std::string & | name | ) |

Parameters:

  | name | the name of the requested theme.

Returns:
  the theme corresponding to name if any, or NULL.

std::list<std::string> const& gcp::ThemeManager::GetThemesNames | ( |  | ) |

Returns:
  the list of all theme names currently in use.

void gcp::ThemeManager::OnConfigChanged | ( | GConfClient * | client,
|  | guint | cnxn_id,
|  | GConfEntry * | entry |
| ) |  |  |

Parameters:

  | client | the GConfClient which a key value changed.
  | cnxn_id | the notification id.
  | entry | the entry which changed.

Called by the framework when the value associated with entry changed in the settings.

Theme* gcp::ThemeManager::CreateNewTheme | ( | Theme * | theme = `NULL` | ) |

Parameters:

  | theme | a theme to duplicate.

Creates a new theme based on theme or on the default theme if theme is NULL.

void gcp::ThemeManager::AddFileTheme | ( | Theme * | theme,
|  | char const * | label |
| ) |  |  |

Parameters:

  | theme | a theme imported from a document file.
  | label | the document label.

Called when opening a file if the theme saved with the file has the same name than an already registered theme, but different settings. The theme will not be saved to the local database, and will be registered using label and the theme name.

void gcp::ThemeManager::RemoveFileTheme | ( | Theme * | theme | ) |

Parameters:

  | theme | the themeto remove from the list.

Called for theme registered using AddFileName() typically when the associated document file is closed.

void gcp::ThemeManager::ChangeThemeName | ( | Theme * | theme,
|  | char const * | name |
| ) |  |  |

Parameters:

  | theme | a theme.
  | name | the new name for the theme.

Changes the name of the theme.

Theme* gcp::ThemeManager::GetDefaultTheme | ( |  | ) | `[inline]`

Returns:
  the default theme.

Definition at line 361 of file theme.h.

void gcp::ThemeManager::SetDefaultTheme | ( | char const * | name | ) |

Parameters:

  | name | the name of the default theme.

Sets the default theme. This theme is used when creating new documents with no explicit theme.

void gcp::ThemeManager::Shutdown | ( |  | ) |

Closes configuration change notification. Should be called once before the destructionof the theme manager.

The documentation for this class was generated from the following file:

- theme.h