Common object and functions
[Content Plugins]


Files

file  gnc-plugin-page.h
 Functions for adding plugins to a Gnucash window.

Data Structures

struct  GncPluginPagePrivate
struct  GncPluginPage
struct  GncPluginPageClass

Defines

#define GNC_TYPE_PLUGIN_PAGE   (gnc_plugin_page_get_type ())
#define GNC_PLUGIN_PAGE(o)   (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_PLUGIN_PAGE, GncPluginPage))
#define GNC_PLUGIN_PAGE_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_PAGE, GncPluginPageClass))
#define GNC_IS_PLUGIN_PAGE(o)   (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_PLUGIN_PAGE))
#define GNC_IS_PLUGIN_PAGE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_PAGE))
#define GNC_PLUGIN_PAGE_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_PLUGIN_PAGE, GncPluginPageClass))

Typedefs

typedef GncPluginPagePrivate GncPluginPagePrivate
typedef GncPluginPage GncPluginPage

Enumerations

enum  {
  INSERTED, REMOVED, SELECTED, UNSELECTED,
  LAST_SIGNAL
}

Functions

GType gnc_plugin_page_get_type (void)
GtkWidget * gnc_plugin_page_create_widget (GncPluginPage *plugin_page)
void gnc_plugin_page_destroy_widget (GncPluginPage *plugin_page)
void gnc_plugin_page_merge_actions (GncPluginPage *plugin_page, GtkUIManager *ui_merge)
void gnc_plugin_page_unmerge_actions (GncPluginPage *plugin_page, GtkUIManager *ui_merge)
const gchar * gnc_plugin_page_get_name (GncPluginPage *plugin_page)
void gnc_plugin_page_inserted (GncPluginPage *plugin_page)
void gnc_plugin_page_removed (GncPluginPage *plugin_page)
void gnc_plugin_page_selected (GncPluginPage *plugin_page)
void gnc_plugin_page_unselected (GncPluginPage *plugin_page)
void gnc_plugin_page_add_book (GncPluginPage *page, QofBook *book)
gboolean gnc_plugin_page_has_book (GncPluginPage *page, GUID *entity)
gboolean gnc_plugin_page_has_books (GncPluginPage *page)
GtkWidget * gnc_plugin_page_get_window (GncPluginPage *page)
const gchar * gnc_plugin_page_get_tab_name (GncPluginPage *page)
void gnc_plugin_page_set_tab_name (GncPluginPage *page, const gchar *name)
const gchar * gnc_plugin_page_get_title (GncPluginPage *page)
void gnc_plugin_page_set_title (GncPluginPage *page, const gchar *name)
const gchar * gnc_plugin_page_get_uri (GncPluginPage *page)
void gnc_plugin_page_set_uri (GncPluginPage *page, const gchar *name)
const gchar * gnc_plugin_page_get_statusbar_text (GncPluginPage *page)
void gnc_plugin_page_set_statusbar_text (GncPluginPage *page, const gchar *message)
gboolean gnc_plugin_page_get_use_new_window (GncPluginPage *page)
void gnc_plugin_page_set_use_new_window (GncPluginPage *page, gboolean use_new)
void gnc_plugin_page_set_tab_name (GncPluginPage *page, const char *name)
void gnc_plugin_page_set_title (GncPluginPage *page, const char *name)
void gnc_plugin_page_set_uri (GncPluginPage *page, const char *name)
void gnc_plugin_page_set_statusbar_text (GncPluginPage *page, const char *name)


Function Documentation

void gnc_plugin_page_add_book GncPluginPage page,
QofBook book
 

Add a book reference to the specified page.

Parameters:
page The page to be modified.
book The book referenced by this page.

Definition at line 317 of file gnc-plugin-page.c.

00318 {
00319   GncPluginPagePrivate *priv;
00320   GUID *guid;
00321 
00322   g_return_if_fail (GNC_IS_PLUGIN_PAGE (page));
00323   g_return_if_fail (book != NULL);
00324 
00325   priv = page->priv;
00326 
00327   guid = guid_malloc();
00328   *guid = *qof_book_get_guid(book);
00329   priv->books = g_list_append(priv->books, guid);
00330 }

const gchar * gnc_plugin_page_get_statusbar_text GncPluginPage page  ) 
 

Retrieve the statusbar text associated with this page.

Parameters:
page The page whose statusbar should text be retrieved.
Returns:
A pointer to the statusbar text for this page. This string is owned by the page and should not be freed by the caller.

Definition at line 421 of file gnc-plugin-page.c.

00422 {
00423   g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (page), NULL);
00424 
00425   return page->priv->statusbar_text;
00426 }

const gchar * gnc_plugin_page_get_tab_name GncPluginPage page  ) 
 

Retrieve the name used in the notebook tab for this page.

Parameters:
page The page whose tab name should be retrieved.
Returns:
The page's tab name. This string is owned by the page and should not be freed by the caller.

Definition at line 367 of file gnc-plugin-page.c.

00368 {
00369   g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (page), NULL);
00370 
00371   return page->priv->tab_name;
00372 }

const gchar * gnc_plugin_page_get_title GncPluginPage page  ) 
 

Retrieve the page part of the window title.

Parameters:
page The page whose title component should be retrieved.
Returns:
The page title. This string is owned by the page and should not be freed by the caller.

Definition at line 385 of file gnc-plugin-page.c.

00386 {
00387   g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (page), NULL);
00388 
00389   return page->priv->title;
00390 }

const gchar * gnc_plugin_page_get_uri GncPluginPage page  ) 
 

Retrieve the Uniform Resource Identifier for this page.

Parameters:
page The page whose URI should be retrieved.
Returns:
The URI for this page. This string is owned by the page and should not be freed by the caller.

Definition at line 403 of file gnc-plugin-page.c.

00404 {
00405   g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (page), NULL);
00406 
00407   return page->priv->uri;
00408 }

gboolean gnc_plugin_page_get_use_new_window GncPluginPage page  ) 
 

Retrieve the "use new window" setting associated with this page.

Parameters:
page The page whose setting should be retrieved.
Returns:
Whether this page should be created in a new window.

Definition at line 439 of file gnc-plugin-page.c.

00440 {
00441   g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (page), FALSE);
00442 
00443   return page->priv->use_new_window;
00444 }

GtkWidget * gnc_plugin_page_get_window GncPluginPage page  ) 
 

Retrieve a pointer to the GncMainWindow (GtkWindow) containing this page.

Parameters:
page The page whose window should be retrieved.
Returns:
A pointer to the window.

Definition at line 359 of file gnc-plugin-page.c.

00360 {
00361   g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (page), NULL);
00362 
00363   return page->window;
00364 }

gboolean gnc_plugin_page_has_book GncPluginPage page,
GUID book
 

Query a page to see if it has a reference to a given book. This function takes a guid instead of a QofBook because that's what the engine event mechanism provides.

Parameters:
page The page to query.
book The guid of the book in question.
Returns:
TRUE if the page refers to the specified book. FALSE otherwise.

Definition at line 333 of file gnc-plugin-page.c.

00334 {
00335   GncPluginPagePrivate *priv;
00336   GList *item;
00337 
00338   g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (page), FALSE);
00339   g_return_val_if_fail (entity != NULL, FALSE);
00340 
00341   priv = page->priv;
00342   for (item = priv->books; item; item = g_list_next(item)) {
00343     if (guid_equal((GUID*)item->data, entity)) {
00344       return TRUE;
00345     }
00346   }
00347   return FALSE;
00348 }

gboolean gnc_plugin_page_has_books GncPluginPage page  ) 
 

Query a page to see if it has a reference to any book.

Parameters:
page The page to query.
Returns:
TRUE if the page references any books. FALSE otherwise.

Definition at line 351 of file gnc-plugin-page.c.

00352 {
00353   g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (page), FALSE);
00354 
00355   return (page->priv->books != NULL);
00356 }

void gnc_plugin_page_set_statusbar_text GncPluginPage page,
const char *  name
 

Set the statusbar text associated with this page.

Parameters:
page The page whose statusbar text should be set.
name The new statusbar text for the page.

void gnc_plugin_page_set_tab_name GncPluginPage page,
const char *  name
 

Set the name used in the notebook tab for this page.

Parameters:
page The page whose tab label should be set.
name The new string for the tab label.

void gnc_plugin_page_set_title GncPluginPage page,
const char *  name
 

Set the page part of the window title.

Parameters:
page The page whose title component should be set.
name The new title for the page.

void gnc_plugin_page_set_uri GncPluginPage page,
const char *  name
 

Set the Uniform Resource Identifier for this page.

Parameters:
page The page whose URI should be set.
name The new URI for the page.

void gnc_plugin_page_set_use_new_window GncPluginPage page,
gboolean  use_new
 

Set the "use new window" setting associated with this page. If this setting is TRUE, the page will be installed into a new window. Otherwise the page will be installed into an existing window.

Parameters:
page The page whose setting should be updated.
use_new The new value for this setting.

Definition at line 447 of file gnc-plugin-page.c.

00448 {
00449   g_return_if_fail (GNC_IS_PLUGIN_PAGE (page));
00450 
00451   page->priv->use_new_window = use_new;
00452 }


Generated on Sun Sep 4 18:09:20 2005 for GnuCash by  doxygen 1.4.3-20050530