summaryrefslogtreecommitdiff
path: root/indra/newview/llfolderviewitem.h
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2010-09-24 11:23:07 -0700
committerMerov Linden <merov@lindenlab.com>2010-09-24 11:23:07 -0700
commitb85cf7b12562a3359e52147d26eb1051ce388559 (patch)
tree3f656bb586e7cd2a25763d8053365e106365a063 /indra/newview/llfolderviewitem.h
parent24473fc0d619beaafab029170a7aacde5855be1a (diff)
parentb34856d66dfa1a725cb85d813982709566b6db7a (diff)
Pull update from viewer-development
Diffstat (limited to 'indra/newview/llfolderviewitem.h')
-rw-r--r--indra/newview/llfolderviewitem.h59
1 files changed, 37 insertions, 22 deletions
diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h
index 11b644e3aa..ab9317afd9 100644
--- a/indra/newview/llfolderviewitem.h
+++ b/indra/newview/llfolderviewitem.h
@@ -108,7 +108,7 @@ public:
// layout constants
static const S32 LEFT_PAD = 5;
- // LEFT_INDENTATION is set via folder_indentation above
+ // LEFT_INDENTATION is set via folder_indentation above
static const S32 ICON_PAD = 2;
static const S32 ICON_WIDTH = 16;
static const S32 TEXT_PAD = 1;
@@ -121,6 +121,9 @@ public:
// Mostly for debugging printout purposes.
const std::string& getSearchableLabel() { return mSearchableLabel; }
+private:
+ BOOL mIsSelected;
+
protected:
friend class LLUICtrlFactory;
friend class LLFolderViewEventListener;
@@ -134,7 +137,6 @@ protected:
time_t mCreationDate;
LLFolderViewFolder* mParentFolder;
LLFolderViewEventListener* mListener;
- BOOL mIsSelected;
BOOL mIsCurSelection;
BOOL mSelectPending;
LLFontGL::StyleFlags mLabelStyle;
@@ -212,19 +214,23 @@ public:
virtual void dirtyFilter();
- // If the selection is 'this' then note that otherwise
- // ignore. Returns TRUE if this object was affected. If open is
- // TRUE, then folders are opened up along the way to the
- // selection.
- virtual BOOL setSelection(LLFolderViewItem* selection, BOOL openitem,
- BOOL take_keyboard_focus);
+ // If 'selection' is 'this' then note that otherwise ignore.
+ // Returns TRUE if this item ends up being selected.
+ virtual BOOL setSelection(LLFolderViewItem* selection, BOOL openitem, BOOL take_keyboard_focus);
- // This method is used to toggle the selection of an item. If
- // selection is 'this', then note selection, and return TRUE.
+ // This method is used to set the selection state of an item.
+ // If 'selection' is 'this' then note selection.
+ // Returns TRUE if the selection state of this item was changed.
virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected);
// this method is used to group select items
- virtual S32 extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& items){ return FALSE; }
+ virtual void extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& items) { }
+
+ // this method is used to deselect this element
+ void deselectItem();
+
+ // this method is used to select this element
+ void selectItem();
// gets multiple-element selection
virtual std::set<LLUUID> getSelectionList() const;
@@ -238,7 +244,7 @@ public:
// destroys this item recursively
virtual void destroyView();
- BOOL isSelected() { return mIsSelected; }
+ BOOL isSelected() const { return mIsSelected; }
void setUnselected() { mIsSelected = FALSE; }
@@ -247,7 +253,7 @@ public:
BOOL getIsCurSelection() { return mIsCurSelection; }
BOOL hasVisibleChildren() { return mHasVisibleChildren; }
-
+
void setShowLoadStatus(bool status) { mShowLoadStatus = status; }
// Call through to the viewed object and return true if it can be
@@ -359,6 +365,13 @@ public:
UNKNOWN, TRASH, NOT_TRASH
} ETrash;
+private:
+ S32 mNumDescendantsSelected;
+
+public: // Accessed needed by LLFolderViewItem
+ void recursiveIncrementNumDescendantsSelected(S32 increment);
+ S32 numSelected(void) const { return mNumDescendantsSelected + (isSelected() ? 1 : 0); }
+
protected:
typedef std::list<LLFolderViewItem*> items_t;
typedef std::list<LLFolderViewFolder*> folders_t;
@@ -420,18 +433,19 @@ public:
virtual void dirtyFilter();
// Passes selection information on to children and record
- // selection information if necessary. Returns TRUE if this object
- // (or a child) was affected.
- virtual BOOL setSelection(LLFolderViewItem* selection, BOOL openitem,
- BOOL take_keyboard_focus);
-
- // This method is used to change the selection of an item. If
- // selection is 'this', then note selection as true. Returns TRUE
- // if this or a child is now selected.
+ // selection information if necessary.
+ // Returns TRUE if this object (or a child) ends up being selected.
+ // If 'openitem' is TRUE then folders are opened up along the way to the selection.
+ virtual BOOL setSelection(LLFolderViewItem* selection, BOOL openitem, BOOL take_keyboard_focus);
+
+ // This method is used to change the selection of an item.
+ // Recursively traverse all children; if 'selection' is 'this' then change
+ // the select status if necessary.
+ // Returns TRUE if the selection state of this folder, or of a child, was changed.
virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected);
// this method is used to group select items
- virtual S32 extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& items);
+ virtual void extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& items);
// Returns true is this object and all of its children can be removed.
virtual BOOL isRemovable();
@@ -521,6 +535,7 @@ public:
time_t getCreationDate() const;
bool isTrash() const;
+ S32 getNumSelectedDescendants(void) const { return mNumDescendantsSelected; }
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~