summaryrefslogtreecommitdiff
path: root/indra/llui/lltoolbar.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/lltoolbar.h')
-rw-r--r--indra/llui/lltoolbar.h27
1 files changed, 25 insertions, 2 deletions
diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h
index 5d64630fa6..10e5f49c0f 100644
--- a/indra/llui/lltoolbar.h
+++ b/indra/llui/lltoolbar.h
@@ -33,7 +33,11 @@
#include "lllayoutstack.h"
#include "lluictrl.h"
#include "llcommandmanager.h"
+#include "llassettype.h"
+typedef boost::function<void (S32 x, S32 y, const LLUUID& uuid)> startdrag_callback_t;
+typedef boost::function<BOOL (S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type)> handledrag_callback_t;
+typedef boost::function<BOOL (EDragAndDropType type, void* data, const LLUUID& uuid)> handledrop_callback_t;
class LLToolBarButton : public LLButton
{
@@ -58,6 +62,9 @@ public:
BOOL handleMouseDown(S32 x, S32 y, MASK mask);
BOOL handleHover(S32 x, S32 y, MASK mask);
void setCommandId(const LLCommandId& id) { mId = id; }
+
+ void setStartDragCallback(startdrag_callback_t cb) { mStartDragItemCallback = cb; }
+ void setHandleDragCallback(handledrag_callback_t cb) { mHandleDragItemCallback = cb; }
private:
LLCommandId mId;
S32 mMouseDownX;
@@ -65,6 +72,10 @@ private:
S32 mMinWidth;
S32 mMaxWidth;
S32 mDesiredHeight;
+ bool mIsDragged;
+ startdrag_callback_t mStartDragItemCallback;
+ handledrag_callback_t mHandleDragItemCallback;
+ LLUUID mUUID;
};
@@ -108,7 +119,6 @@ class LLToolBar
: public LLUICtrl
{
public:
-
struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
{
Mandatory<LLToolBarEnums::ButtonType> button_display_mode;
@@ -137,10 +147,18 @@ public:
void draw();
void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
-
+ virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
+ EDragAndDropType cargo_type,
+ void* cargo_data,
+ EAcceptance* accept,
+ std::string& tooltip_msg);
+
bool addCommand(const LLCommandId& commandId);
bool hasCommand(const LLCommandId& commandId) const;
bool enableCommand(const LLCommandId& commandId, bool enabled);
+ void setStartDragCallback(startdrag_callback_t cb) { mStartDragItemCallback = cb; }
+ void setHandleDragCallback(handledrag_callback_t cb) { mHandleDragItemCallback = cb; }
+ void setHandleDropCallback(handledrop_callback_t cb) { mHandleDropCallback = cb; }
LLToolBarButton* createButton(const LLCommandId& id);
@@ -150,6 +168,10 @@ protected:
~LLToolBar();
void initFromParams(const Params&);
+ startdrag_callback_t mStartDragItemCallback;
+ handledrag_callback_t mHandleDragItemCallback;
+ handledrop_callback_t mHandleDropCallback;
+ bool mDragAndDropTarget;
public:
// Methods used in loading and saving toolbar settings
@@ -166,6 +188,7 @@ private:
BOOL isSettingChecked(const LLSD& userdata);
void onSettingEnable(const LLSD& userdata);
+ LLUUID mUUID;
const bool mReadOnly;
std::list<LLToolBarButton*> mButtons;