File: GNOME_MrProject_ResourceManager.idl

package info (click to toggle)
mrproject 0.5.1-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 5,136 kB
  • ctags: 4,114
  • sloc: ansic: 40,041; sh: 7,059; makefile: 1,107; yacc: 318; python: 111
file content (114 lines) | stat: -rw-r--r-- 3,204 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
 * Copyright (C) 2000-2001 CodeFactory AB
 * Copyright (C) 2000-2001 Richard Hult <rhult@codefactory.se>
 * Copyright (C) 2001      Mikael Hallendal <micke@codefactory.se>
 *
 * This program 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 program 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 program; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 *
 * Author: Mikael Hallendal
 */

#ifndef GNOME_MRPROJECT_RESOURCE_MANAGER_IDL
#define GNOME_MRPROJECT_RESOURCE_MANAGER_IDL

module GNOME {
	
	module MrProject {

		/* Resource types */
		const short RESOURCE_TYPE_NONE     = 0;
		const short RESOURCE_TYPE_PEOPLE   = 1;
		const short RESOURCE_TYPE_MATERIAL = 2;

		typedef short ResourceType;

		struct Resource {
			Id               	resourceId;
			string			name;
			Id                      groupId;

			ResourceType		type;

			long                    units;

			string                  email;
			
			float                   stdRate;
			float                   ovtRate;

			/* Costs... */
			/* Calendar... */
		};

		struct ResourceGroup {
			Id       groupId;
			string   name;
			string   adminName;
			string   adminPhone;
			string   adminEmail;
		};

		typedef sequence<Resource>	ResourceSeq;
		typedef sequence<ResourceGroup> ResourceGroupSeq;
		
		interface ResourceManager : Bonobo::Unknown {
			exception		NoSuchResource {};
			exception		InvalidPosition {};
			exception               NoSuchGroup {};

			attribute ProjectState	state;

			/* Resource Management */
			Resource createResource   ();

			Id       insertResource   (in Resource r);
			
			Resource getResource      (in Id resourceId)			raises (NoSuchResource);
			ResourceSeq getAllResources ();
			void updateResource	  (in Resource r)                       raises (NoSuchResource);
			void removeResources	  (in IdSeq resIds)                     raises (NoSuchResource);

			/* ResourceGroup Management */
			ResourceGroup createGroup ();

			Id               insertGroup (in ResourceGroup rg);
			
			ResourceGroup    getGroup    (in Id groupId)                   raises (NoSuchGroup);
			ResourceGroupSeq getAllGroups();
			
			void updateGroup          (in ResourceGroup rg)                 raises (NoSuchGroup);

			void removeGroup          (in Id groupId)              raises (NoSuchGroup);
			Id                        getDefaultGroup ();
			void setDefaultGroup      (in Id groupId);
		};

		/*
		 * Structures that are passed with events.
		 */

		struct EventResourceGroupRemoved {
			Id              id;
		};

		struct EventResourceGroupDefaultSet {
			Id              id;
		};
	};
};

#endif