aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
diff options
context:
space:
mode:
authorDr Scofield2009-02-06 16:55:34 +0000
committerDr Scofield2009-02-06 16:55:34 +0000
commit9b66108081a8c8cf79faaa6c541554091c40850e (patch)
tree095a232ae5a9de3a9244bcd34da08294f61eeea5 /OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
parent* removed superfluous constants class (diff)
downloadopensim-SC_OLD-9b66108081a8c8cf79faaa6c541554091c40850e.zip
opensim-SC_OLD-9b66108081a8c8cf79faaa6c541554091c40850e.tar.gz
opensim-SC_OLD-9b66108081a8c8cf79faaa6c541554091c40850e.tar.bz2
opensim-SC_OLD-9b66108081a8c8cf79faaa6c541554091c40850e.tar.xz
This changeset is the step 1 of 2 in refactoring
OpenSim.Region.Environment into a "framework" part and a modules only part. This first changeset refactors OpenSim.Region.Environment.Scenes, OpenSim.Region.Environment.Interfaces, and OpenSim.Region.Interfaces into OpenSim.Region.Framework.{Interfaces,Scenes} leaving only region modules in OpenSim.Region.Environment. The next step will be to move region modules up from OpenSim.Region.Environment.Modules to OpenSim.Region.CoreModules and then sort out which modules are really core modules and which should move out to forge. I've been very careful to NOT BREAK anything. i hope i've succeeded. as this is the work of a whole week i hope i managed to keep track with the applied patches of the last week --- could any of you that did check in stuff have a look at whether it survived? thx!
Diffstat (limited to 'OpenSim/Region/Framework/Interfaces/IEntityInventory.cs')
-rw-r--r--OpenSim/Region/Framework/Interfaces/IEntityInventory.cs207
1 files changed, 207 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
new file mode 100644
index 0000000..20fe090
--- /dev/null
+++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
@@ -0,0 +1,207 @@
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;
29using System.Collections.Generic;
30using System.Reflection;
31using OpenMetaverse;
32using log4net;
33using OpenSim.Framework;
34using OpenSim.Framework.Communications.Cache;
35using OpenSim.Region.Framework.Interfaces;
36using OpenSim.Region.Framework.Scenes.Scripting;
37
38namespace OpenSim.Region.Framework.Interfaces
39{
40 /// <summary>
41 /// Interface to an entity's (SceneObjectPart's) inventory
42 /// </summary>
43 ///
44 /// This is not a finished 1.0 candidate interface
45 public interface IEntityInventory
46 {
47 /// <summary>
48 /// Force the task inventory of this prim to persist at the next update sweep
49 /// </summary>
50 void ForceInventoryPersistence();
51
52 /// <summary>
53 /// Reset UUIDs for all the items in the prim's inventory.
54 /// </summary>
55 ///
56 /// This involves either generating
57 /// new ones or setting existing UUIDs to the correct parent UUIDs.
58 ///
59 /// If this method is called and there are inventory items, then we regard the inventory as having changed.
60 ///
61 /// <param name="linkNum">Link number for the part</param>
62 void ResetInventoryIDs();
63
64 /// <summary>
65 /// Change every item in this inventory to a new owner.
66 /// </summary>
67 /// <param name="ownerId"></param>
68 void ChangeInventoryOwner(UUID ownerId);
69
70 /// <summary>
71 /// Change every item in this inventory to a new group.
72 /// </summary>
73 /// <param name="groupID"></param>
74 void ChangeInventoryGroup(UUID groupID);
75
76 /// <summary>
77 /// Start all the scripts contained in this entity's inventory
78 /// </summary>
79 void CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource);
80
81 /// <summary>
82 /// Stop all the scripts in this entity.
83 /// </summary>
84 void RemoveScriptInstances();
85
86 /// <summary>
87 /// Start a script which is in this entity's inventory.
88 /// </summary>
89 /// <param name="item"></param>
90 /// <param name="postOnRez"></param>
91 /// <param name="engine"></param>
92 /// <param name="stateSource"></param>
93 void CreateScriptInstance(
94 TaskInventoryItem item, int startParam, bool postOnRez, string engine, int stateSource);
95
96 /// <summary>
97 /// Start a script which is in this entity's inventory.
98 /// </summary>
99 /// <param name="itemId"></param>
100 /// <param name="startParam"></param>
101 /// <param name="postOnRez"></param>
102 /// <param name="engine"></param>
103 /// <param name="stateSource"></param>
104 void CreateScriptInstance(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource);
105
106 /// <summary>
107 /// Stop a script which is in this prim's inventory.
108 /// </summary>
109 /// <param name="itemId"></param>
110 void RemoveScriptInstance(UUID itemId);
111
112 /// <summary>
113 /// Add an item to this entity's inventory. If an item with the same name already exists, then an alternative
114 /// name is chosen.
115 /// </summary>
116 /// <param name="item"></param>
117 void AddInventoryItem(TaskInventoryItem item, bool allowedDrop);
118
119 /// <summary>
120 /// Add an item to this entity's inventory. If an item with the same name already exists, it is replaced.
121 /// </summary>
122 /// <param name="item"></param>
123 void AddInventoryItemExclusive(TaskInventoryItem item, bool allowedDrop);
124
125 /// <summary>
126 /// Restore a whole collection of items to the entity's inventory at once.
127 /// We assume that the items already have all their fields correctly filled out.
128 /// The items are not flagged for persistence to the database, since they are being restored
129 /// from persistence rather than being newly added.
130 /// </summary>
131 /// <param name="items"></param>
132 void RestoreInventoryItems(ICollection<TaskInventoryItem> items);
133
134 /// <summary>
135 /// Returns an existing inventory item. Returns the original, so any changes will be live.
136 /// </summary>
137 /// <param name="itemID"></param>
138 /// <returns>null if the item does not exist</returns>
139 TaskInventoryItem GetInventoryItem(UUID itemId);
140
141 /// <summary>
142 /// Update an existing inventory item.
143 /// </summary>
144 /// <param name="item">The updated item. An item with the same id must already exist
145 /// in this prim's inventory.</param>
146 /// <returns>false if the item did not exist, true if the update occurred successfully</returns>
147 bool UpdateInventoryItem(TaskInventoryItem item);
148
149 /// <summary>
150 /// Remove an item from this entity's inventory
151 /// </summary>
152 /// <param name="itemID"></param>
153 /// <returns>Numeric asset type of the item removed. Returns -1 if the item did not exist
154 /// in this prim's inventory.</returns>
155 int RemoveInventoryItem(UUID itemID);
156
157 /// <summary>
158 /// Return the name with which a client can request a xfer of this prim's inventory metadata
159 /// </summary>
160 string GetInventoryFileName();
161
162 bool GetInventoryFileName(IClientAPI client, uint localID);
163
164 /// <summary>
165 /// Serialize all the metadata for the items in this prim's inventory ready for sending to the client
166 /// </summary>
167 /// <param name="xferManager"></param>
168 void RequestInventoryFile(IClientAPI client, IXfer xferManager);
169
170 /// <summary>
171 /// Backup the inventory to the given data store
172 /// </summary>
173 /// <param name="datastore"></param>
174 void ProcessInventoryBackup(IRegionDataStore datastore);
175
176 uint MaskEffectivePermissions();
177
178 void ApplyNextOwnerPermissions();
179
180 void ApplyGodPermissions(uint perms);
181
182 /// <summary>
183 /// Returns true if this inventory contains any scripts
184 /// </summary></returns>
185 bool ContainsScripts();
186
187 /// <summary>
188 /// Get the uuids of all items in this inventory
189 /// </summary>
190 /// <returns></returns>
191 List<UUID> GetInventoryList();
192
193 /// <summary>
194 /// Get the names of the assemblies associated with scripts in this inventory.
195 /// </summary>
196 /// <returns></returns>
197 string[] GetScriptAssemblies();
198
199 /// <summary>
200 /// Get the xml representing the saved states of scripts in this inventory.
201 /// </summary>
202 /// <returns>
203 /// A <see cref="Dictionary`2"/>
204 /// </returns>
205 Dictionary<UUID, string> GetScriptStates();
206 }
207}