GnuCash 7574033+
Loading...
Searching...
No Matches
An Owner Tree Plugin

Files

file  gnc-plugin-page-owner-tree.h
 Functions providing a page which lists owners of one type.

Data Structures

struct  GncPluginPageOwnerTreePrivate
struct  action_owners_struct
 Map actions to owners. More...
struct  GncPluginPageOwnerTree
struct  GncPluginPageOwnerTreeClass

Macros

#define PLUGIN_PAGE_ACCT_TREE_CM_CLASS   "plugin-page-owner-tree"
#define DELETE_DIALOG_FILTER   "filter"
#define DELETE_DIALOG_OWNER   "owner"
#define GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(o)
#define OWNER_TYPE_LABEL   "OwnerType"
#define GNC_TYPE_PLUGIN_PAGE_OWNER_TREE   (gnc_plugin_page_owner_tree_get_type ())
#define GNC_PLUGIN_PAGE_OWNER_TREE(obj)
#define GNC_PLUGIN_PAGE_OWNER_TREE_CLASS(klass)
#define GNC_IS_PLUGIN_PAGE_OWNER_TREE(obj)
#define GNC_IS_PLUGIN_PAGE_OWNER_TREE_CLASS(klass)
#define GNC_PLUGIN_PAGE_OWNER_TREE_GET_CLASS(obj)
#define GNC_PLUGIN_PAGE_OWNER_TREE_NAME   "GncPluginPageOwnerTree"

Enumerations

enum  { OWNER_SELECTED , LAST_SIGNAL }

Functions

GncPluginPage * gnc_plugin_page_owner_tree_new (GncOwnerType owner_type)
 Create a new "owner tree" plugin page.
GncOwner * gnc_plugin_page_owner_tree_get_current_owner (GncPluginPageOwnerTree *page)
 Given a pointer to an owner tree plugin page, return the selected owner (if any).
GType gnc_plugin_page_owner_tree_get_type (void)
 Retrieve the type number for an "owner tree" plugin page.

Detailed Description

Macro Definition Documentation

◆ DELETE_DIALOG_FILTER

#define DELETE_DIALOG_FILTER   "filter"

Definition at line 72 of file gnc-plugin-page-owner-tree.cpp.

◆ DELETE_DIALOG_OWNER

#define DELETE_DIALOG_OWNER   "owner"

Definition at line 73 of file gnc-plugin-page-owner-tree.cpp.

◆ GNC_IS_PLUGIN_PAGE_OWNER_TREE

#define GNC_IS_PLUGIN_PAGE_OWNER_TREE ( obj)
Value:
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_PAGE_OWNER_TREE))

Definition at line 48 of file gnc-plugin-page-owner-tree.h.

◆ GNC_IS_PLUGIN_PAGE_OWNER_TREE_CLASS

#define GNC_IS_PLUGIN_PAGE_OWNER_TREE_CLASS ( klass)
Value:
(G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_PAGE_OWNER_TREE))

Definition at line 49 of file gnc-plugin-page-owner-tree.h.

◆ GNC_PLUGIN_PAGE_OWNER_TREE

#define GNC_PLUGIN_PAGE_OWNER_TREE ( obj)
Value:
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_PAGE_OWNER_TREE, GncPluginPageOwnerTree))

Definition at line 46 of file gnc-plugin-page-owner-tree.h.

◆ GNC_PLUGIN_PAGE_OWNER_TREE_CLASS

#define GNC_PLUGIN_PAGE_OWNER_TREE_CLASS ( klass)
Value:
(G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_PAGE_OWNER_TREE, GncPluginPageOwnerTreeClass))

Definition at line 47 of file gnc-plugin-page-owner-tree.h.

◆ GNC_PLUGIN_PAGE_OWNER_TREE_GET_CLASS

#define GNC_PLUGIN_PAGE_OWNER_TREE_GET_CLASS ( obj)
Value:
(G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_PAGE_OWNER_TREE, GncPluginPageOwnerTreeClass))

Definition at line 50 of file gnc-plugin-page-owner-tree.h.

◆ GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE

#define GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE ( o)
Value:

Definition at line 92 of file gnc-plugin-page-owner-tree.cpp.

92#define GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(o) \
93 ((GncPluginPageOwnerTreePrivate*)gnc_plugin_page_owner_tree_get_instance_private((GncPluginPageOwnerTree*)o))

◆ GNC_PLUGIN_PAGE_OWNER_TREE_NAME

#define GNC_PLUGIN_PAGE_OWNER_TREE_NAME   "GncPluginPageOwnerTree"

Definition at line 52 of file gnc-plugin-page-owner-tree.h.

◆ GNC_TYPE_PLUGIN_PAGE_OWNER_TREE

#define GNC_TYPE_PLUGIN_PAGE_OWNER_TREE   (gnc_plugin_page_owner_tree_get_type ())

Definition at line 45 of file gnc-plugin-page-owner-tree.h.

◆ OWNER_TYPE_LABEL

#define OWNER_TYPE_LABEL   "OwnerType"

Definition at line 656 of file gnc-plugin-page-owner-tree.cpp.

◆ PLUGIN_PAGE_ACCT_TREE_CM_CLASS

#define PLUGIN_PAGE_ACCT_TREE_CM_CLASS   "plugin-page-owner-tree"

Definition at line 70 of file gnc-plugin-page-owner-tree.cpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Definition at line 75 of file gnc-plugin-page-owner-tree.cpp.

76{
77 OWNER_SELECTED,
78 LAST_SIGNAL
79};

Function Documentation

◆ gnc_plugin_page_owner_tree_get_current_owner()

GncOwner * gnc_plugin_page_owner_tree_get_current_owner ( GncPluginPageOwnerTree * page)

Given a pointer to an owner tree plugin page, return the selected owner (if any).

Parameters
pageThe "owner tree" page.
Returns
The currently selected owner. NULL if no owner is selected.

Definition at line 450 of file gnc-plugin-page-owner-tree.cpp.

451{
453 GncOwner *owner;
454
455 priv = GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(page);
456 ENTER("page %p (tree view %p)", page, priv->tree_view);
457 owner = gnc_tree_view_owner_get_selected_owner (GNC_TREE_VIEW_OWNER(priv->tree_view));
458 if (owner == NULL)
459 {
460 LEAVE("no owner");
461 return NULL;
462 }
463
464 LEAVE("owner %p", owner);
465 return owner;
466}
GncOwner * gnc_tree_view_owner_get_selected_owner(GncTreeViewOwner *view)
This function returns the owner associated with the selected item in the owner tree view.
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition qoflog.h:282
#define ENTER(format, args...)
Print a function entry debugging message.
Definition qoflog.h:272

◆ gnc_plugin_page_owner_tree_get_type()

GType gnc_plugin_page_owner_tree_get_type ( void )

Retrieve the type number for an "owner tree" plugin page.

Returns
The type number.

◆ gnc_plugin_page_owner_tree_new()

GncPluginPage * gnc_plugin_page_owner_tree_new ( GncOwnerType owner_type)

Create a new "owner tree" plugin page.

Parameters
owner_typeThe owner type to create a page for. Can be any of the owner types defined in GnuCash, like vendor, customer,...
Returns
The newly created plugin page.

Definition at line 249 of file gnc-plugin-page-owner-tree.cpp.

250{
251 GncPluginPageOwnerTree *plugin_page;
253 const GList *item;
254
255 g_return_val_if_fail( (owner_type != GNC_OWNER_UNDEFINED)
256 && (owner_type != GNC_OWNER_NONE), NULL);
257 ENTER(" ");
258
259 /* Is there an existing page? */
260 item = gnc_gobject_tracking_get_list(GNC_PLUGIN_PAGE_OWNER_TREE_NAME);
261 for ( ; item; item = g_list_next(item))
262 {
263 plugin_page = (GncPluginPageOwnerTree *)item->data;
264 priv = GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(plugin_page);
265 if (priv->owner_type == owner_type)
266 {
267 LEAVE("existing %s tree page %p", gncOwnerTypeToQofIdType(owner_type), plugin_page);
268 return GNC_PLUGIN_PAGE(plugin_page);
269 }
270 }
271
272 plugin_page = GNC_PLUGIN_PAGE_OWNER_TREE(g_object_new(GNC_TYPE_PLUGIN_PAGE_OWNER_TREE, nullptr));
273
274 priv = GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(plugin_page);
275 priv->owner_type = owner_type;
276
277 LEAVE("new %s tree page %p", gncOwnerTypeToQofIdType(owner_type), plugin_page);
278 return GNC_PLUGIN_PAGE(plugin_page);
279}
const GList * gnc_gobject_tracking_get_list(const gchar *name)
Get a list of all known objects of a specified type.
QofIdTypeConst gncOwnerTypeToQofIdType(GncOwnerType t)
Returns the QofIdType of the given GncOwnerType, or NULL if no suitable one exists.
Definition gncOwner.c:235