aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/IInventoryData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/IInventoryData.cs')
-rw-r--r--OpenSim/Data/IInventoryData.cs157
1 files changed, 157 insertions, 0 deletions
diff --git a/OpenSim/Data/IInventoryData.cs b/OpenSim/Data/IInventoryData.cs
new file mode 100644
index 0000000..03b1cbe
--- /dev/null
+++ b/OpenSim/Data/IInventoryData.cs
@@ -0,0 +1,157 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSim Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System.Collections.Generic;
29using OpenMetaverse;
30using OpenSim.Framework;
31
32namespace OpenSim.Data
33{
34 /// <summary>
35 /// An interface for accessing inventory data from a storage server
36 /// </summary>
37 public interface IInventoryDataPlugin : IPlugin
38 {
39 /// <summary>
40 /// Initialises the interface
41 /// </summary>
42 void Initialise(string connect);
43
44 /// <summary>
45 /// Returns all descendent folders of this folder. Does not return the parent folder itself.
46 /// </summary>
47 /// <param name="parentID">The folder to get subfolders for</param>
48 /// <returns>A list of inventory folders</returns>
49 List<InventoryFolderBase> getFolderHierarchy(UUID parentID);
50
51 /// <summary>
52 /// Returns a list of inventory items contained within the specified folder
53 /// </summary>
54 /// <param name="folderID">The UUID of the target folder</param>
55 /// <returns>A List of InventoryItemBase items</returns>
56 List<InventoryItemBase> getInventoryInFolder(UUID folderID);
57
58 /// <summary>
59 /// Returns a list of the root folders within a users inventory
60 /// </summary>
61 /// <param name="user">The user whos inventory is to be searched</param>
62 /// <returns>A list of folder objects</returns>
63 List<InventoryFolderBase> getUserRootFolders(UUID user);
64
65 /// <summary>
66 /// Returns the users inventory root folder.
67 /// </summary>
68 /// <param name="user">The UUID of the user who is having inventory being returned</param>
69 /// <returns>Root inventory folder, null if no root inventory folder was found</returns>
70 InventoryFolderBase getUserRootFolder(UUID user);
71
72 /// <summary>
73 /// Returns a list of inventory folders contained in the folder 'parentID'
74 /// </summary>
75 /// <param name="parentID">The folder to get subfolders for</param>
76 /// <returns>A list of inventory folders</returns>
77 List<InventoryFolderBase> getInventoryFolders(UUID parentID);
78
79 /// <summary>
80 /// Returns an inventory item by its UUID
81 /// </summary>
82 /// <param name="item">The UUID of the item to be returned</param>
83 /// <returns>A class containing item information</returns>
84 InventoryItemBase getInventoryItem(UUID item);
85
86 /// <summary>
87 /// Returns a specified inventory folder by its UUID
88 /// </summary>
89 /// <param name="folder">The UUID of the folder to be returned</param>
90 /// <returns>A class containing folder information</returns>
91 InventoryFolderBase getInventoryFolder(UUID folder);
92
93 /// <summary>
94 /// Creates a new inventory item based on item
95 /// </summary>
96 /// <param name="item">The item to be created</param>
97 void addInventoryItem(InventoryItemBase item);
98
99 /// <summary>
100 /// Updates an inventory item with item (updates based on ID)
101 /// </summary>
102 /// <param name="item">The updated item</param>
103 void updateInventoryItem(InventoryItemBase item);
104
105 /// <summary>
106 ///
107 /// </summary>
108 /// <param name="item"></param>
109 void deleteInventoryItem(UUID item);
110
111 /// <summary>
112 /// Adds a new folder specified by folder
113 /// </summary>
114 /// <param name="folder">The inventory folder</param>
115 void addInventoryFolder(InventoryFolderBase folder);
116
117 /// <summary>
118 /// Updates a folder based on its ID with folder
119 /// </summary>
120 /// <param name="folder">The inventory folder</param>
121 void updateInventoryFolder(InventoryFolderBase folder);
122
123 /// <summary>
124 /// Updates a folder based on its ID with folder
125 /// </summary>
126 /// <param name="folder">The inventory folder</param>
127 void moveInventoryFolder(InventoryFolderBase folder);
128
129 /// <summary>
130 /// Deletes a folder. Thie will delete both the folder itself and its contents (items and descendent folders)
131 /// </summary>
132 /// <param name="folder">The id of the folder</param>
133 void deleteInventoryFolder(UUID folder);
134
135 /// <summary>
136 /// Returns all activated gesture-items in the inventory of the specified avatar.
137 /// </summary>
138 /// <param name="avatarID">
139 /// The <see cref="UUID"/> of the avatar
140 /// </param>
141 /// <returns>
142 /// The list of gestures (<see cref="InventoryItemBase"/>s)
143 /// </returns>
144 List<InventoryItemBase> fetchActiveGestures(UUID avatarID);
145 }
146
147 public class InventoryDataInitialiser : PluginInitialiserBase
148 {
149 private string connect;
150 public InventoryDataInitialiser (string s) { connect = s; }
151 public override void Initialise (IPlugin plugin)
152 {
153 IInventoryDataPlugin p = plugin as IInventoryDataPlugin;
154 p.Initialise (connect);
155 }
156 }
157}