![]() |
![]() |
![]() |
Libplanner Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
#include <libplanner/planner.h> MrpProjectPriv; MrpProject; gboolean (*MrpTaskTraverseFunc) (MrpTask *Param1
,gpointer Param2
); MrpProject * mrp_project_new (MrpApplication *app
); gboolean mrp_project_is_empty (MrpProject *project
); gboolean mrp_project_needs_saving (MrpProject *project
); mrptime mrp_project_get_project_start (MrpProject *project
); void mrp_project_set_project_start (MrpProject *project
,mrptime start
); gboolean mrp_project_load (MrpProject *project
,const gchar *uri
,GError **error
); gboolean mrp_project_save (MrpProject *project
,gboolean force
,GError **error
); gboolean mrp_project_save_to_xml (MrpProject *project
,gchar **str
,GError **error
); gboolean mrp_project_load_from_xml (MrpProject *project
,const gchar *str
,GError **error
); gboolean mrp_project_save_as (MrpProject *project
,const gchar *uri
,gboolean force
,GError **error
); void mrp_project_close (MrpProject *project
); const gchar * mrp_project_get_uri (MrpProject *project
); MrpResource * mrp_project_get_resource_by_name (MrpProject *project
,const gchar *name
); GList * mrp_project_get_resources (MrpProject *project
); void mrp_project_add_resource (MrpProject *project
,MrpResource *resource
); void mrp_project_remove_resource (MrpProject *project
,MrpResource *resource
); MrpGroup * mrp_project_get_group_by_name (MrpProject *project
,const gchar *name
); GList * mrp_project_get_groups (MrpProject *project
); void mrp_project_add_group (MrpProject *project
,MrpGroup *group
); void mrp_project_remove_group (MrpProject *project
,MrpGroup *group
); MrpTask * mrp_project_get_task_by_name (MrpProject *project
,const gchar *name
); GList * mrp_project_get_all_tasks (MrpProject *project
); void mrp_project_insert_task (MrpProject *project
,MrpTask *parent
,gint position
,MrpTask *task
); void mrp_project_remove_task (MrpProject *project
,MrpTask *task
); gboolean mrp_project_move_task (MrpProject *project
,MrpTask *task
,MrpTask *sibling
,MrpTask *parent
,gboolean before
,GError **error
); MrpTask * mrp_project_get_root_task (MrpProject *project
); void mrp_project_task_traverse (MrpProject *project
,MrpTask *root
,MrpTaskTraverseFunc func
,gpointer user_data
); void mrp_project_reschedule (MrpProject *project
); gint mrp_project_calculate_task_work (MrpProject *project
,MrpTask *task
,mrptime start
,mrptime finish
); GList * mrp_project_get_properties_from_type (MrpProject *project
,GType object_type
); void mrp_project_add_property (MrpProject *project
,GType object_type
,MrpProperty *property
,gboolean user_defined
); void mrp_project_remove_property (MrpProject *project
,GType object_type
,const gchar *name
); MrpProperty * mrp_project_get_property (MrpProject *project
,const gchar *name
,GType object_type
); gboolean mrp_project_has_property (MrpProject *project
,GType owner_type
,const gchar *name
); MrpCalendar * mrp_project_get_root_calendar (MrpProject *project
); MrpCalendar * mrp_project_get_calendar (MrpProject *project
);
"calendar" MrpCalendar* : Read / Write "default-group" MrpGroup* : Read / Write "manager" gchar* : Read / Write "name" gchar* : Read / Write "organization" gchar* : Read / Write "phase" gchar* : Read / Write "phases" gpointer : Read / Write "project-start" glong : Read / Write
"calendar-tree-changed" : Run Last "day-added" : Run Last "day-changed" : Run Last "day-removed" : Run Last "default-group-changed" : Run Last "group-added" : Run Last "group-removed" : Run Last "loaded" : Run Last "needs-saving-changed" : Run Last "property-added" : Run Last "property-changed" : Run Last "property-removed" : Run Last "resource-added" : Run Last "resource-removed" : Run Last "task-inserted" : Run Last "task-moved" : Run Last "task-removed" : Run Last
typedef struct _MrpProjectPriv MrpProjectPriv;
A private struct for internal use only. The definition of this structure is not publically available.
gboolean (*MrpTaskTraverseFunc) (MrpTask *Param1
,gpointer Param2
);
A function to use with mrp_project_task_traverse()
. task
is the
currently traversed task, and data
is the user data passed to the
mrp_project_task_traverse()
. The traversal can be stopped by returning
TRUE
.
|
|
|
|
Returns : |
TRUE if the traversal is to be stopped.
|
MrpProject * mrp_project_new (MrpApplication *app
);
Creates a new MrpProject.
|
MrpApplication that creates the new project. |
Returns : |
the MrpProject |
gboolean mrp_project_is_empty (MrpProject *project
);
Checks whether a project is empty.
|
an MrpProject |
Returns : |
TRUE if project is empty, otherwise FALSE
|
gboolean mrp_project_needs_saving (MrpProject *project
);
Checks if project
needs saving
|
an MrpProject |
Returns : |
TRUE if project has been altered since last save,
otherwise FALSE
|
mrptime mrp_project_get_project_start (MrpProject *project
);
Fetches the project start from project
.
|
an MrpProject |
Returns : |
the project start |
void mrp_project_set_project_start (MrpProject *project
,mrptime start
);
Set the project start.
|
an MrpProject |
|
project start time |
gboolean mrp_project_load (MrpProject *project
,const gchar *uri
,GError **error
);
Loads a project stored at uri
into project
.
|
an MrpProject |
|
the URI where project should be read from |
|
location to store error, or NULL
|
Returns : |
Returns TRUE on success, otherwise FALSE .
|
gboolean mrp_project_save (MrpProject *project
,gboolean force
,GError **error
);
Saves a project.
|
an MrpProject |
|
overwrite changes done by someone else if necessary |
|
location to store error, or NULL
|
Returns : |
TRUE on success, otherwise FALSE
|
gboolean mrp_project_save_to_xml (MrpProject *project
,gchar **str
,GError **error
);
Saves a project as XML to a string buffer.
|
an MrpProject |
|
location to store XML string |
|
location to store error, or NULL
|
Returns : |
TRUE on success, otherwise FALSE
|
gboolean mrp_project_load_from_xml (MrpProject *project
,const gchar *str
,GError **error
);
Loads a project from XML data into project
.
|
an MrpProject |
|
XML string with project data to read from |
|
location to store error, or NULL
|
Returns : |
Returns TRUE on success, otherwise FALSE .
|
gboolean mrp_project_save_as (MrpProject *project
,const gchar *uri
,gboolean force
,GError **error
);
Saves a project to a specific URI.
|
an MrpProject |
|
URI to save to |
|
overwrite an existing file if necessary |
|
location to store error, or NULL
|
Returns : |
TRUE on success, otherwise FALSE
|
void mrp_project_close (MrpProject *project
);
Closes a project.
|
an MrpProject |
const gchar * mrp_project_get_uri (MrpProject *project
);
Fetches the URI from project
.
|
an MrpProject |
Returns : |
the URI of project
|
MrpResource * mrp_project_get_resource_by_name (MrpProject *project
,const gchar *name
);
Retrieves the first resource in the list that match the name.
|
an MrpProject |
|
name to search for |
Returns : |
an MrpResource or NULL if not found
|
GList * mrp_project_get_resources (MrpProject *project
);
Fetches the list of resources in project
. This list should not be freed and
if caller needs to manipulate it, a copy needs to be made first.
|
an MrpProject |
Returns : |
the resource list of project
|
void mrp_project_add_resource (MrpProject *project
,MrpResource *resource
);
Adds resource
to the list of resources in project
.
|
an MrpProject |
|
MrpResource to add |
void mrp_project_remove_resource (MrpProject *project
,MrpResource *resource
);
Removes resource
from project
.
|
an MrpProject |
|
MrpResource to remove |
MrpGroup * mrp_project_get_group_by_name (MrpProject *project
,const gchar *name
);
Retrieves the first group with name that matches name
|
an MrpProject |
|
a name to look for |
Returns : |
an MrpGroup or NULL if not found
|
GList * mrp_project_get_groups (MrpProject *project
);
Fetches the list of groups in project
. The list should not be freed and if
caller needs to manipulate it, a copy needs to be made first.
|
an MrpProject |
Returns : |
the group list of project
|
void mrp_project_add_group (MrpProject *project
,MrpGroup *group
);
Adds group
to the list of groups in project
.
|
an MrpProject |
|
MrpGroup to remove |
void mrp_project_remove_group (MrpProject *project
,MrpGroup *group
);
Removes group
from project
.
|
an MrpProject |
|
MrpGroup to remove |
MrpTask * mrp_project_get_task_by_name (MrpProject *project
,const gchar *name
);
Retrieves the first task with name matching name
. Uses task_traverse to traverse all tasks.
|
an MrpProject |
|
the name to look for |
Returns : |
an MrpTask or NULL if not found.
|
GList * mrp_project_get_all_tasks (MrpProject *project
);
Returns a new list of the tasks in project
. The caller needs to free the
list with g_list_free()
, but not the values in it.
|
an MrpProject |
Returns : |
a newly allocated list of the tasks |
void mrp_project_insert_task (MrpProject *project
,MrpTask *parent
,gint position
,MrpTask *task
);
Insert task
in the task tree with parent
at position
among other
children.
|
an MrpProject |
|
MrpTask that will be parent to inserted task |
|
position among children to insert task |
|
MrpTask to insert |
void mrp_project_remove_task (MrpProject *project
,MrpTask *task
);
Removes task
from the task tree in project
.
|
an MrpProject |
|
MrpTask to remove |
gboolean mrp_project_move_task (MrpProject *project
,MrpTask *task
,MrpTask *sibling
,MrpTask *parent
,gboolean before
,GError **error
);
Move the task in the task tree. If sibling
is NULL
task will be placed
first among the children of parent
if before
is TRUE
, otherwise it will
be placed last. If sibling
is set, task
will be placed before or after
sibling
depending on the value of before
.
MrpTask * mrp_project_get_root_task (MrpProject *project
);
Fetches the root task from project
.
|
an MrpProject |
Returns : |
the root task |
void mrp_project_task_traverse (MrpProject *project
,MrpTask *root
,MrpTaskTraverseFunc func
,gpointer user_data
);
Calls func
on each task under root
in the task tree. user_data
is passed
to func
. If func
returns TRUE
, the traversal is stopped.
|
an MrpProject |
|
MrpTask indicates where traversing will begin. |
|
the function to call for each task |
|
user data passed to the function |
void mrp_project_reschedule (MrpProject *project
);
Reschedules the project, calculating task start/end/duration etc.
|
an MrpProject |
gint mrp_project_calculate_task_work (MrpProject *project
,MrpTask *task
,mrptime start
,mrptime finish
);
Calculates the work needed to achieve the given start and finish time, with the allocated resources' calendards in consideration.
|
an MrpProject |
|
an MrpTask |
|
a start time, or if -1 , the task start time is to be used
|
|
a finish time |
Returns : |
The calculated work. |
GList * mrp_project_get_properties_from_type (MrpProject *project
,GType object_type
);
Fetches a list of the properties belonging to project
and applies to
object_type
. The list should not be freed and needs to be copied before
modified.
|
an MrpProject |
|
a GType |
Returns : |
The list of properties. |
void mrp_project_add_property (MrpProject *project
,GType object_type
,MrpProperty *property
,gboolean user_defined
);
Add a custom property to project
. The object_type
specifies what kind of
objects the property applies to. user_defined
specifies whether the
property is created by the user or by some plugin.
|
an MrpProject |
|
the owner type |
|
an MrpProperty |
|
whether the property is defined through a user interface |
void mrp_project_remove_property (MrpProject *project
,GType object_type
,const gchar *name
);
Removes the property corresponding to object_type
and name
from project
.
|
an MrpProject |
|
a GType specifing object type to remove property from |
|
the name of the property |
MrpProperty * mrp_project_get_property (MrpProject *project
,const gchar *name
,GType object_type
);
Fetches an MrpProperty that corresponds to name
and object_type
. This is
mainly for language bindings and should not be used for other cases.
|
an MrpProject |
|
the name of the property |
|
object type the property belongs to |
Returns : |
An MrpProperty, if found, otherwise NULL .
|
gboolean mrp_project_has_property (MrpProject *project
,GType owner_type
,const gchar *name
);
Checks if project
has a property named name
applying to object of type
object_type
.
|
an MrpProperty |
|
a GType specifing object type look for property on |
|
the name of the property |
Returns : |
TRUE if property name exists on objects of type object_type
|
MrpCalendar * mrp_project_get_root_calendar (MrpProject *project
);
Fetches the root calendar of project
.
|
an MrpProject |
Returns : |
the root calendar of project
|
MrpCalendar * mrp_project_get_calendar (MrpProject *project
);
Fetches the calendar used by project
.
|
an MrpProject |
Returns : |
the calendar used by project
|
"default-group"
property"default-group" MrpGroup* : Read / Write
Default group for new resources.
"manager"
property"manager" gchar* : Read / Write
The manager of the project.
Default value: ""
"organization"
property"organization" gchar* : Read / Write
The organization behind the project.
Default value: ""
"project-start"
property"project-start" glong : Read / Write
The start date of the project.
Allowed values: [0,2147483647]
Default value: 0
"calendar-tree-changed"
signalvoid user_function (MrpProject *mrpproject, MrpCalendar *arg1, gpointer user_data) : Run Last
|
the object which received the signal. |
|
|
|
user data set when the signal handler was connected. |
"day-added"
signalvoid user_function (MrpProject *mrpproject, gpointer arg1, gpointer user_data) : Run Last
|
the object which received the signal. |
|
|
|
user data set when the signal handler was connected. |
"day-changed"
signalvoid user_function (MrpProject *mrpproject, gpointer arg1, gpointer user_data) : Run Last
|
the object which received the signal. |
|
|
|
user data set when the signal handler was connected. |
"day-removed"
signalvoid user_function (MrpProject *mrpproject, gpointer arg1, gpointer user_data) : Run Last
|
the object which received the signal. |
|
|
|
user data set when the signal handler was connected. |
"default-group-changed"
signalvoid user_function (MrpProject *mrpproject, MrpGroup *arg1, gpointer user_data) : Run Last
|
the object which received the signal. |
|
|
|
user data set when the signal handler was connected. |
"group-added"
signalvoid user_function (MrpProject *mrpproject, MrpGroup *arg1, gpointer user_data) : Run Last
|
the object which received the signal. |
|
|
|
user data set when the signal handler was connected. |
"group-removed"
signalvoid user_function (MrpProject *mrpproject, MrpGroup *arg1, gpointer user_data) : Run Last
|
the object which received the signal. |
|
|
|
user data set when the signal handler was connected. |
"loaded"
signalvoid user_function (MrpProject *mrpproject, gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"needs-saving-changed"
signalvoid user_function (MrpProject *mrpproject, gboolean arg1, gpointer user_data) : Run Last
|
the object which received the signal. |
|
|
|
user data set when the signal handler was connected. |
"property-added"
signalvoid user_function (MrpProject *mrpproject, glong arg1, gpointer arg2, gpointer user_data) : Run Last
|
the object which received the signal. |
|
|
|
|
|
user data set when the signal handler was connected. |
"property-changed"
signalvoid user_function (MrpProject *mrpproject, gpointer arg1, gpointer user_data) : Run Last
|
the object which received the signal. |
|
|
|
user data set when the signal handler was connected. |
"property-removed"
signalvoid user_function (MrpProject *mrpproject, gpointer arg1, gpointer user_data) : Run Last
|
the object which received the signal. |
|
|
|
user data set when the signal handler was connected. |
"resource-added"
signalvoid user_function (MrpProject *mrpproject, MrpResource *arg1, gpointer user_data) : Run Last
|
the object which received the signal. |
|
|
|
user data set when the signal handler was connected. |
"resource-removed"
signalvoid user_function (MrpProject *mrpproject, MrpResource *arg1, gpointer user_data) : Run Last
|
the object which received the signal. |
|
|
|
user data set when the signal handler was connected. |
"task-inserted"
signalvoid user_function (MrpProject *mrpproject, MrpTask *arg1, gpointer user_data) : Run Last
|
the object which received the signal. |
|
|
|
user data set when the signal handler was connected. |
"task-moved"
signalvoid user_function (MrpProject *mrpproject, MrpTask *arg1, gpointer user_data) : Run Last
|
the object which received the signal. |
|
|
|
user data set when the signal handler was connected. |
"task-removed"
signalvoid user_function (MrpProject *mrpproject, MrpTask *arg1, gpointer user_data) : Run Last
|
the object which received the signal. |
|
|
|
user data set when the signal handler was connected. |