llctrlselectioninterface.h

Go to the documentation of this file.
00001 
00032 #ifndef LLCTRLSELECTIONINTERFACE_H
00033 #define LLCTRLSELECTIONINTERFACE_H
00034 
00035 #include "stdtypes.h"
00036 #include "stdenums.h"
00037 #include "llstring.h"
00038 
00039 class LLSD;
00040 class LLUUID;
00041 class LLScrollListItem;
00042 
00043 class LLCtrlSelectionInterface
00044 {
00045 public:
00046         virtual ~LLCtrlSelectionInterface();
00047         
00048         enum EOperation
00049         {
00050                 OP_DELETE = 1,
00051                 OP_SELECT,
00052                 OP_DESELECT,
00053         };
00054 
00055         virtual BOOL    getCanSelect() const = 0;
00056 
00057         virtual S32             getItemCount() const = 0;
00058 
00059         virtual BOOL    selectFirstItem() = 0;
00060         virtual BOOL    selectNthItem( S32 index ) = 0;
00061         virtual BOOL    selectItemRange( S32 first, S32 last ) = 0;
00062 
00063         virtual S32             getFirstSelectedIndex() const = 0;
00064 
00065         // TomY TODO: Simply cast the UUIDs to LLSDs, using the selectByValue function
00066         virtual BOOL    setCurrentByID( const LLUUID& id ) = 0;
00067         virtual LLUUID  getCurrentID() const = 0;
00068 
00069                         BOOL    selectByValue(const LLSD value);
00070                         BOOL    deselectByValue(const LLSD value);
00071         virtual BOOL    setSelectedByValue(const LLSD& value, BOOL selected) = 0;
00072         virtual LLSD    getSelectedValue() = 0;
00073 
00074         virtual BOOL    isSelected(const LLSD& value) const = 0;
00075 
00076         virtual BOOL    operateOnSelection(EOperation op) = 0;
00077         virtual BOOL    operateOnAll(EOperation op) = 0;
00078 };
00079 
00080 class LLCtrlListInterface : public LLCtrlSelectionInterface
00081 {
00082 public:
00083         virtual ~LLCtrlListInterface();
00084         
00085         virtual void addColumn(const LLSD& column, EAddPosition pos = ADD_BOTTOM) = 0;
00086         virtual void clearColumns() = 0;
00087         virtual void setColumnLabel(const LLString& column, const LLString& label) = 0;
00088         // TomY TODO: Document this
00089         virtual LLScrollListItem* addElement(const LLSD& value, EAddPosition pos = ADD_BOTTOM, void* userdata = NULL) = 0;
00090 
00091         LLScrollListItem* addSimpleElement(const LLString& value); // defaults to bottom
00092         LLScrollListItem* addSimpleElement(const LLString& value, EAddPosition pos); // defaults to no LLSD() id
00093         virtual LLScrollListItem* addSimpleElement(const LLString& value, EAddPosition pos, const LLSD& id) = 0;
00094 
00095         virtual void clearRows() = 0;
00096         virtual void sortByColumn(LLString name, BOOL ascending) = 0;
00097 };
00098 
00099 class LLCtrlScrollInterface
00100 {
00101 public:
00102         virtual ~LLCtrlScrollInterface();
00103         
00104         virtual S32 getScrollPos() const = 0;
00105         virtual void setScrollPos( S32 pos ) = 0;
00106         virtual void scrollToShowSelected() = 0;
00107 };
00108 
00109 #endif

Generated on Fri May 16 08:32:51 2008 for SecondLife by  doxygen 1.5.5