aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Data/InventoryData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Data/InventoryData.cs')
-rw-r--r--OpenSim/Framework/Data/InventoryData.cs185
1 files changed, 185 insertions, 0 deletions
diff --git a/OpenSim/Framework/Data/InventoryData.cs b/OpenSim/Framework/Data/InventoryData.cs
new file mode 100644
index 0000000..c2a1d06
--- /dev/null
+++ b/OpenSim/Framework/Data/InventoryData.cs
@@ -0,0 +1,185 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.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 libsecondlife;
30
31namespace OpenSim.Framework.Data
32{
33 /// <summary>
34 /// Inventory Item - contains all the properties associated with an individual inventory piece.
35 /// </summary>
36 public class InventoryItemBase
37 {
38 /// <summary>
39 /// A UUID containing the ID for the inventory item itself
40 /// </summary>
41 public LLUUID inventoryID;
42 /// <summary>
43 /// The UUID of the associated asset on the asset server
44 /// </summary>
45 public LLUUID assetID;
46 /// <summary>
47 /// This is an enumerated value determining the type of asset (eg Notecard, Sound, Object, etc)
48 /// </summary>
49 public int type;
50 /// <summary>
51 /// The folder this item is contained in (NULL_KEY = Inventory Root)
52 /// </summary>
53 public LLUUID parentFolderID;
54 /// <summary>
55 /// The owner of this inventory item
56 /// </summary>
57 public LLUUID avatarID;
58 /// <summary>
59 /// The name of the inventory item (must be less than 64 characters)
60 /// </summary>
61 public string inventoryName;
62 /// <summary>
63 /// The description of the inventory item (must be less than 64 characters)
64 /// </summary>
65 public string inventoryDescription;
66 /// <summary>
67 /// A mask containing the permissions for the next owner (cannot be enforced)
68 /// </summary>
69 public uint inventoryNextPermissions;
70 /// <summary>
71 /// A mask containing permissions for the current owner (cannot be enforced)
72 /// </summary>
73 public uint inventoryCurrentPermissions;
74 }
75
76 /// <summary>
77 /// A Class for folders which contain users inventory
78 /// </summary>
79 public class InventoryFolderBase
80 {
81 /// <summary>
82 /// The name of the folder (64 characters or less)
83 /// </summary>
84 public string name;
85 /// <summary>
86 /// The agent who's inventory this is contained by
87 /// </summary>
88 public LLUUID agentID;
89 /// <summary>
90 /// The folder this folder is contained in (NULL_KEY for root)
91 /// </summary>
92 public LLUUID parentID;
93 /// <summary>
94 /// The UUID for this folder
95 /// </summary>
96 public LLUUID folderID;
97 }
98
99 /// <summary>
100 /// An interface for accessing inventory data from a storage server
101 /// </summary>
102 public interface IInventoryData
103 {
104 /// <summary>
105 /// Initialises the interface
106 /// </summary>
107 void Initialise();
108
109 /// <summary>
110 /// Closes the interface
111 /// </summary>
112 void Close();
113
114 /// <summary>
115 /// The plugin being loaded
116 /// </summary>
117 /// <returns>A string containing the plugin name</returns>
118 string getName();
119
120 /// <summary>
121 /// The plugins version
122 /// </summary>
123 /// <returns>A string containing the plugin version</returns>
124 string getVersion();
125
126 /// <summary>
127 /// Returns a list of inventory items contained within the specified folder
128 /// </summary>
129 /// <param name="folderID">The UUID of the target folder</param>
130 /// <returns>A List of InventoryItemBase items</returns>
131 List<InventoryItemBase> getInventoryInFolder(LLUUID folderID);
132
133 /// <summary>
134 /// Returns a list of folders in the users inventory root.
135 /// </summary>
136 /// <param name="user">The UUID of the user who is having inventory being returned</param>
137 /// <returns>A list of folders</returns>
138 List<InventoryFolderBase> getUserRootFolders(LLUUID user);
139
140 /// <summary>
141 /// Returns a list of inventory folders contained in the folder 'parentID'
142 /// </summary>
143 /// <param name="parentID">The folder to get subfolders for</param>
144 /// <returns>A list of inventory folders</returns>
145 List<InventoryFolderBase> getInventoryFolders(LLUUID parentID);
146
147 /// <summary>
148 /// Returns an inventory item by its UUID
149 /// </summary>
150 /// <param name="item">The UUID of the item to be returned</param>
151 /// <returns>A class containing item information</returns>
152 InventoryItemBase getInventoryItem(LLUUID item);
153
154 /// <summary>
155 /// Returns a specified inventory folder by its UUID
156 /// </summary>
157 /// <param name="folder">The UUID of the folder to be returned</param>
158 /// <returns>A class containing folder information</returns>
159 InventoryFolderBase getInventoryFolder(LLUUID folder);
160
161 /// <summary>
162 /// Creates a new inventory item based on item
163 /// </summary>
164 /// <param name="item">The item to be created</param>
165 void addInventoryItem(InventoryItemBase item);
166
167 /// <summary>
168 /// Updates an inventory item with item (updates based on ID)
169 /// </summary>
170 /// <param name="item">The updated item</param>
171 void updateInventoryItem(InventoryItemBase item);
172
173 /// <summary>
174 /// Adds a new folder specified by folder
175 /// </summary>
176 /// <param name="folder">The inventory folder</param>
177 void addInventoryFolder(InventoryFolderBase folder);
178
179 /// <summary>
180 /// Updates a folder based on its ID with folder
181 /// </summary>
182 /// <param name="folder">The inventory folder</param>
183 void updateInventoryFolder(InventoryFolderBase folder);
184 }
185}