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
00062 virtual S32 getFirstSelectedIndex() const = 0;
00063
00064
00065 virtual BOOL setCurrentByID( const LLUUID& id ) = 0;
00066 virtual LLUUID getCurrentID() = 0;
00067
00068 BOOL selectByValue(LLSD value);
00069 BOOL deselectByValue(LLSD value);
00070 virtual BOOL setSelectedByValue(LLSD value, BOOL selected) = 0;
00071 virtual LLSD getSimpleSelectedValue() = 0;
00072
00073 virtual BOOL isSelected(LLSD value) = 0;
00074
00075 virtual BOOL operateOnSelection(EOperation op) = 0;
00076 virtual BOOL operateOnAll(EOperation op) = 0;
00077 };
00078
00079 class LLCtrlListInterface : public LLCtrlSelectionInterface
00080 {
00081 public:
00082 virtual ~LLCtrlListInterface();
00083
00084 virtual void addColumn(const LLSD& column, EAddPosition pos = ADD_BOTTOM) = 0;
00085 virtual void clearColumns() = 0;
00086 virtual void setColumnLabel(const LLString& column, const LLString& label) = 0;
00087
00088 virtual LLScrollListItem* addElement(const LLSD& value, EAddPosition pos = ADD_BOTTOM, void* userdata = NULL) = 0;
00089
00090 LLScrollListItem* addSimpleElement(const LLString& value);
00091 LLScrollListItem* addSimpleElement(const LLString& value, EAddPosition pos);
00092 virtual LLScrollListItem* addSimpleElement(const LLString& value, EAddPosition pos, const LLSD& id) = 0;
00093
00094 virtual void clearRows() = 0;
00095 virtual void sortByColumn(LLString name, BOOL ascending) = 0;
00096 };
00097
00098 class LLCtrlScrollInterface
00099 {
00100 public:
00101 virtual ~LLCtrlScrollInterface();
00102
00103 virtual S32 getScrollPos() = 0;
00104 virtual void setScrollPos( S32 pos ) = 0;
00105 virtual void scrollToShowSelected() = 0;
00106 };
00107
00108 #endif