1 package org.ximtec.igesture.io;
2
3 import java.awt.Point;
4 import java.io.File;
5 import java.util.Map;
6 import java.util.Set;
7
8 /**
9 * This interface defines the methods the controller of the device manager should support.
10 * @author Bjorn Puype, bpuype@gmail.com
11 *
12 */
13 public interface IDeviceManager {
14
15 /**
16 * Add a user.
17 * @param user
18 */
19 void addUser(IUser user);
20 /**
21 * Remove a user
22 */
23 void removeUser(IUser user);
24
25 /**
26 * Add a device and associate it with a user.
27 * @param device The device to add.
28 * @param user The user to associate with the device.
29 */
30 void addDevice(AbstractGestureDevice<?,?> device, IUser user);
31 /**
32 * Remove a device.
33 * @param device The device to remove.
34 */
35 void removeDevice(AbstractGestureDevice<?,?> device);
36
37 /**
38 * Associate a user with a device.
39 * @param device The device.
40 * @param user The user to associate with the device.
41 */
42 void associateUser(AbstractGestureDevice<?,?> device, IUser user);
43 /**
44 * Get the user that is associated with <i>device</i>
45 */
46 IUser getAssociatedUser(GestureDevice<?,?> device);
47
48 /**
49 * Get the default user of the system (aka system user).
50 * @return default user.
51 */
52 IUser getDefaultUser();
53
54 /**
55 * Get all devices registered with the controller.
56 * @return A set of devices.
57 */
58 Set<AbstractGestureDevice<?,?>> getDevices();
59 /**
60 * Get all users registered with the controller.
61 * @return A set of users.
62 */
63 Set<IUser> getUsers();
64
65 /**
66 * Show the view at a certain point.
67 * @param p The desired point
68 */
69 void showView(Point p);
70
71 /**
72 * Get the mapping between connection types and discovery services.
73 * @return
74 */
75 Map<String, DeviceDiscoveryService> getDiscoveryMapping();
76
77 /**
78 * Save the current user and device configuration to file.
79 * @param file The file to save to.
80 */
81 void saveConfiguration(File file);
82
83 /**
84 * Load a user and device configuration from file.
85 * @param file The file to load from.
86 */
87 void loadConfiguration(File file);
88
89
90 public void addDeviceManagerListener(DeviceManagerListener listener);
91
92 public void removeDeviceManagerListener(DeviceManagerListener listener);
93
94 public void removeAllDeviceManagerListener();
95
96 public void notifyDeviceManagerListener(int operation, AbstractGestureDevice<?,?> device);
97 }