| Libplanner Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Properties | Signals | ||||
#include <libplanner/planner.h>
MrpResourcePriv;
MrpResource;
enum MrpResourceType;
MrpResource * mrp_resource_new (void);
const gchar * mrp_resource_get_name (MrpResource *resource);
void mrp_resource_set_name (MrpResource *resource,
const gchar *name);
void mrp_resource_assign (MrpResource *resource,
MrpTask *task,
gint units);
GList * mrp_resource_get_assignments (MrpResource *resource);
GList * mrp_resource_get_assigned_tasks (MrpResource *resource);
gint mrp_resource_compare (gconstpointer a,
gconstpointer b);
MrpCalendar * mrp_resource_get_calendar (MrpResource *resource);
void mrp_resource_set_calendar (MrpResource *resource,
MrpCalendar *calendar);
"calendar" gpointer : Read / Write "cost" gfloat : Read / Write "email" gchar* : Read / Write "group" MrpGroup* : Read / Write "name" gchar* : Read / Write "note" gchar* : Read / Write "short-name" gchar* : Read / Write "type" gint : Read / Write "units" gint : Read / Write
typedef struct _MrpResourcePriv MrpResourcePriv;
A private struct for internal use only. The definition of this structure is not publically available.
typedef enum {
MRP_RESOURCE_TYPE_NONE,
MRP_RESOURCE_TYPE_WORK,
MRP_RESOURCE_TYPE_MATERIAL
} MrpResourceType;
The type of the resource, work or material.
MrpResource * mrp_resource_new (void);
Creates a new empty resource.
Returns : |
the newly created resource. |
const gchar * mrp_resource_get_name (MrpResource *resource);
Retrives the name of resource.
|
an MrpResource |
Returns : |
the name |
void mrp_resource_set_name (MrpResource *resource,const gchar *name);
Sets the name of resource.
|
an MrpResource |
|
new name of resource
|
void mrp_resource_assign (MrpResource *resource,MrpTask *task,gint units);
Assigns resource to task by the given amount of units. A value of 100
units corresponds to fulltime assignment.
|
an MrpResource |
|
an MrpTask |
|
the amount of units of assignment |
GList * mrp_resource_get_assignments (MrpResource *resource);
Retrieves the assignments that this resource has. If caller needs to manipulate the returned list, a copy of it needs to be made.
|
an MrpResource. |
Returns : |
The assignments of resource. It should not be freed. |
GList * mrp_resource_get_assigned_tasks (MrpResource *resource);
Retrieves a list of all the tasks that this resource is assigned to. It is
basically a convenience wrapper around mrp_resource_get_assignments().
|
an MrpResource |
Returns : |
A list of the tasks that this resource is assigned to. Needs to be freed when not used anymore. |
gint mrp_resource_compare (gconstpointer a,gconstpointer b);
Comparison routine for resources. It is suitable for sorting, and only compares the resource name.
|
an MrpResource |
|
an MrpResource |
Returns : |
-1 if a is less than b, 1 id a is greater than b, and 1 if
equal. |
MrpCalendar * mrp_resource_get_calendar (MrpResource *resource);
Retrieves the calendar that is used for resource. If no calendar is set,
NULL is returned, which means the project default calendar.
|
an MrpResource |
Returns : |
a MrpCalendar, or NULL if no specific calendar is set. |
void mrp_resource_set_calendar (MrpResource *resource,MrpCalendar *calendar);
Sets the calendar to use for resource. NULL means to use the project
default calendar.
|
an MrpResource |
|
the MrpCalendar to set, or NULL
|
"cost" property"cost" gfloat : Read / Write
The standard cost of the resource.
Allowed values: >= 0
Default value: 0
"email" property"email" gchar* : Read / Write
The email address of the resource.
Default value: NULL
"short-name" property"short-name" gchar* : Read / Write
The shorter name, initials or nickname of the resource.
Default value: NULL
"type" property"type" gint : Read / Write
The type of resource this is.
Allowed values: [0,2]
Default value: 1
"units" property"units" gint : Read / Write
The amount of units this resource has.
Allowed values: >= G_MAXULONG
Default value: 0
"assignment-added" signalvoid user_function (MrpResource *mrpresource,
MrpAssignment *arg1,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"assignment-removed" signalvoid user_function (MrpResource *mrpresource,
MrpAssignment *arg1,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |