llinventoryclipboard.h

Go to the documentation of this file.
00001 
00032 #ifndef LL_LLINVENTORYCLIPBOARD_H
00033 #define LL_LLINVENTORYCLIPBOARD_H
00034 
00035 #include "lldarray.h"
00036 #include "lluuid.h"
00037 
00038 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00039 // Class LLInventoryClipboard
00040 //
00041 // This class is used to cut/copy/paste inventory items around the
00042 // world. This class is accessed through a singleton (only one
00043 // inventory clipboard for now) which can be referenced using the
00044 // instance() method.
00045 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00046 
00047 class LLInventoryClipboard
00048 {
00049 public:
00050         // calling this before main() is undefined
00051         static LLInventoryClipboard& instance() { return sInstance; }
00052 
00053         // this method adds to the current list.
00054         void add(const LLUUID& object);
00055 
00056         // this stores a single inventory object
00057         void store(const LLUUID& object);
00058 
00059         // this method stores an array of objects
00060         void store(const LLDynamicArray<LLUUID>& inventory_objects);
00061 
00062         // this method gets the objects in the clipboard by copying them
00063         // into the array provided.
00064         void retrieve(LLDynamicArray<LLUUID>& inventory_objects) const;
00065 
00066         // this method empties out the clipboard
00067         void reset();
00068 
00069         // returns true if the clipboard has something pasteable in it.
00070         BOOL hasContents() const;
00071 
00072 protected:
00073         static LLInventoryClipboard sInstance;
00074 
00075         LLDynamicArray<LLUUID> mObjects;
00076 
00077 public:
00078         // please don't actually call these
00079         LLInventoryClipboard();
00080         ~LLInventoryClipboard();
00081 private:
00082         // please don't implement these
00083         LLInventoryClipboard(const LLInventoryClipboard&);
00084         LLInventoryClipboard& operator=(const LLInventoryClipboard&);
00085 };
00086 
00087 
00088 #endif // LL_LLINVENTORYCLIPBOARD_H

Generated on Thu Jul 1 06:08:45 2010 for Second Life Viewer by  doxygen 1.4.7