mrp-types.h 3.74 KB
Newer Older
Richard Hult's avatar
Richard Hult committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
 * Copyright (C) 2001-2003 CodeFactory AB
 * Copyright (C) 2001-2003 Richard Hult <richard@imendio.com>
 * Copyright (C) 2001-2002 Mikael Hallendal <micke@imendio.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this library; if not, write to the
Josué Abarca's avatar
Josué Abarca committed
19 20
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 * Boston, MA 02110-1301, USA.
Richard Hult's avatar
Richard Hult committed
21
 */
22

Richard Hult's avatar
Richard Hult committed
23 24 25 26 27 28 29 30 31 32 33
#ifndef __MRP_TYPES_H__
#define __MRP_TYPES_H__

#include <libplanner/mrp-time.h>

#define MRP_TYPE_RELATION_TYPE (mrp_relation_type_get_type ())
#define MRP_TYPE_TASK_TYPE     (mrp_task_type_get_type ())
#define MRP_TYPE_TASK_SCHED    (mrp_task_sched_get_type ())
#define MRP_TYPE_PROPERTY_TYPE (mrp_property_type_get_type ())
#define MRP_TYPE_STRING_LIST   (mrp_string_list_get_type ())

34 35 36 37 38 39 40 41 42 43
/**
 * MrpRelationType:
 * @MRP_RELATION_NONE: invalid relation type (unset)
 * @MRP_RELATION_FS: finish to start
 * @MRP_RELATION_FF: finish to finish (unimplemented)
 * @MRP_RELATION_SS: start to start (unimplemented)
 * @MRP_RELATION_SF: start to finish (unimplemented)
 *
 * The type of relation.
 */
Richard Hult's avatar
Richard Hult committed
44
typedef enum {
Ahmed Baïzid's avatar
Ahmed Baïzid committed
45 46 47 48 49
	MRP_RELATION_NONE = 0,
	MRP_RELATION_FS,
	MRP_RELATION_FF,
	MRP_RELATION_SS,
	MRP_RELATION_SF
Richard Hult's avatar
Richard Hult committed
50 51
} MrpRelationType;

52 53
/**
 * MrpConstraintType:
Ahmed Baïzid's avatar
Ahmed Baïzid committed
54
 * @MRP_CONSTRAINT_ASAP: as soon as possible (default)
55 56 57 58 59
 * @MRP_CONSTRAINT_ALAP: as late as possible (unimplemented)
 * @MRP_CONSTRAINT_SNET: start no eariler than
 * @MRP_CONSTRAINT_FNLT: finish no later than (unimplemented)
 * @MRP_CONSTRAINT_MSO: must start on
 *
Ahmed Baïzid's avatar
Ahmed Baïzid committed
60
 * The type of constraint for the task. The default is #MRP_CONSTRAINT_ASAP.
61
 */
Richard Hult's avatar
Richard Hult committed
62
typedef enum {
Ahmed Baïzid's avatar
Ahmed Baïzid committed
63 64 65 66 67
	MRP_CONSTRAINT_ASAP = 0,
	MRP_CONSTRAINT_ALAP,
	MRP_CONSTRAINT_SNET,
	MRP_CONSTRAINT_FNLT,
	MRP_CONSTRAINT_MSO,
Richard Hult's avatar
Richard Hult committed
68 69 70 71 72 73 74
} MrpConstraintType;

struct _MrpConstraint {
	MrpConstraintType type;
	mrptime           time;
};

Ahmed Baïzid's avatar
Ahmed Baïzid committed
75 76 77 78 79 80 81
/**
 * MrpTaskType:
 * @MRP_TASK_TYPE_NORMAL: normal
 * @MRP_TASK_TYPE_MILESTONE: milestone
 *
 * Task types.
 */
Richard Hult's avatar
Richard Hult committed
82 83 84 85 86
typedef enum {
	MRP_TASK_TYPE_NORMAL,
	MRP_TASK_TYPE_MILESTONE
} MrpTaskType;

Ahmed Baïzid's avatar
Ahmed Baïzid committed
87 88 89 90 91 92 93
/**
 * MrpTaskSched:
 * @MRP_TASK_SCHED_FIXED_WORK: fixed work
 * @MRP_TASK_SCHED_FIXED_DURATION: fixed duration
 *
 * Task scheduling types.
 */
Richard Hult's avatar
Richard Hult committed
94 95 96 97 98 99
typedef enum {
	MRP_TASK_SCHED_FIXED_WORK,
	MRP_TASK_SCHED_FIXED_DURATION
} MrpTaskSched;


100 101 102 103 104
/**
 * MrpTask:
 *
 * Object representing a task in the project.
 */
Richard Hult's avatar
Richard Hult committed
105
typedef struct _MrpTask       MrpTask;
106 107 108 109 110
/**
 * MrpResource:
 *
 * Object representing a task in the project.
 */
Richard Hult's avatar
Richard Hult committed
111
typedef struct _MrpResource   MrpResource;
112 113 114 115 116
/**
 * MrpGroup:
 *
 * Object representing a resource group.
 */
Richard Hult's avatar
Richard Hult committed
117
typedef struct _MrpGroup      MrpGroup;
118 119 120 121 122
/**
 * MrpAssignment:
 *
 * Represents an assignment, i.e. the assignment of a task to a resource.
 */
Richard Hult's avatar
Richard Hult committed
123
typedef struct _MrpAssignment MrpAssignment;
124 125 126 127 128 129 130
/**
 * MrpConstraint:
 * @type:
 * @time:
 *
 * A struct representing a scheduling constraint on a task.
 */
Richard Hult's avatar
Richard Hult committed
131 132
typedef struct _MrpConstraint MrpConstraint;

133
GType   mrp_relation_type_get_type (void) G_GNUC_CONST;
Richard Hult's avatar
Richard Hult committed
134

135
GType   mrp_task_type_get_type     (void) G_GNUC_CONST;
Richard Hult's avatar
Richard Hult committed
136

137
GType   mrp_task_sched_get_type    (void) G_GNUC_CONST;
Richard Hult's avatar
Richard Hult committed
138

139
GType   mrp_property_type_get_type (void) G_GNUC_CONST;
Richard Hult's avatar
Richard Hult committed
140 141 142 143 144 145

GList * mrp_string_list_copy       (const GList *list);

void    mrp_string_list_free       (GList       *list);

#endif /* __MRP_TYPES_H__ */