aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfolderview.h
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llfolderview.h')
-rw-r--r--linden/indra/newview/llfolderview.h75
1 files changed, 46 insertions, 29 deletions
diff --git a/linden/indra/newview/llfolderview.h b/linden/indra/newview/llfolderview.h
index 5e6902d..9fad72e 100644
--- a/linden/indra/newview/llfolderview.h
+++ b/linden/indra/newview/llfolderview.h
@@ -168,6 +168,10 @@ public:
168class LLInventoryFilter 168class LLInventoryFilter
169{ 169{
170public: 170public:
171 //fix to get rid of gSavedSettings use - rkeast
172 void setSearchType(U32 type);
173 U32 getSearchType();
174
171 typedef enum e_folder_show 175 typedef enum e_folder_show
172 { 176 {
173 SHOW_ALL_FOLDERS, 177 SHOW_ALL_FOLDERS,
@@ -248,6 +252,9 @@ public:
248 void fromLLSD(LLSD& data); 252 void fromLLSD(LLSD& data);
249 253
250protected: 254protected:
255 //fix to get rid of gSavedSettings use - rkeast
256 U32 mSearchType;
257
251 struct filter_ops 258 struct filter_ops
252 { 259 {
253 U32 mFilterTypes; 260 U32 mFilterTypes;
@@ -322,9 +329,12 @@ class LLFolderView;
322 329
323class LLFolderViewItem : public LLUICtrl 330class LLFolderViewItem : public LLUICtrl
324{ 331{
325protected:
326 friend class LLFolderViewEventListener; 332 friend class LLFolderViewEventListener;
327 333
334private:
335 BOOL mIsSelected;
336
337protected:
328 static const LLFontGL* sFont; 338 static const LLFontGL* sFont;
329 static const LLFontGL* sSmallFont; 339 static const LLFontGL* sSmallFont;
330 static LLColor4 sFgColor; 340 static LLColor4 sFgColor;
@@ -354,7 +364,6 @@ protected:
354 U32 mCreationDate; 364 U32 mCreationDate;
355 LLFolderViewFolder* mParentFolder; 365 LLFolderViewFolder* mParentFolder;
356 LLFolderViewEventListener* mListener; 366 LLFolderViewEventListener* mListener;
357 BOOL mIsSelected;
358 BOOL mIsCurSelection; 367 BOOL mIsCurSelection;
359 BOOL mSelectPending; 368 BOOL mSelectPending;
360 LLFontGL::StyleFlags mLabelStyle; 369 LLFontGL::StyleFlags mLabelStyle;
@@ -363,7 +372,6 @@ protected:
363 std::string mStatusText; 372 std::string mStatusText;
364 BOOL mHasVisibleChildren; 373 BOOL mHasVisibleChildren;
365 S32 mIndentation; 374 S32 mIndentation;
366 S32 mNumDescendantsSelected;
367 BOOL mFiltered; 375 BOOL mFiltered;
368 S32 mLastFilterGeneration; 376 S32 mLastFilterGeneration;
369 std::string::size_type mStringMatchOffset; 377 std::string::size_type mStringMatchOffset;
@@ -424,22 +432,23 @@ public:
424 432
425 virtual void dirtyFilter(); 433 virtual void dirtyFilter();
426 434
427 // If the selection is 'this' then note that otherwise 435 // If 'selection' is 'this' then note that otherwise ignore.
428 // ignore. Returns TRUE if this object was affected. If open is 436 // Returns TRUE if this item ends up being selected.
429 // TRUE, then folders are opened up along the way to the 437 virtual BOOL setSelection(LLFolderViewItem* selection, BOOL openitem, BOOL take_keyboard_focus);
430 // selection.
431 virtual BOOL setSelection(LLFolderViewItem* selection, BOOL openitem,
432 BOOL take_keyboard_focus);
433 438
434 // This method is used to toggle the selection of an item. If 439 // This method is used to set the selection state of an item.
435 // selection is 'this', then note selection, and return TRUE. 440 // If 'selection' is 'this' then note selection.
441 // Returns TRUE if the selection state of this item was changed.
436 virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected); 442 virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected);
437 443
438 // this method is used to group select items 444 // this method is used to group select items
439 virtual S32 extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& items){ return FALSE; } 445 virtual void extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& items) { }
440 446
441 // this method is used to group select items 447 // this method is used to deselect this element
442 virtual void recursiveDeselect(BOOL deselect_self); 448 void deselectItem();
449
450 // this method is used to select this element
451 void selectItem();
443 452
444 // gets multiple-element selection 453 // gets multiple-element selection
445 virtual BOOL getSelectionList(std::set<LLUUID> &selection){return TRUE;} 454 virtual BOOL getSelectionList(std::set<LLUUID> &selection){return TRUE;}
@@ -453,9 +462,7 @@ public:
453 // destroys this item recursively 462 // destroys this item recursively
454 virtual void destroyView(); 463 virtual void destroyView();
455 464
456 S32 getNumSelectedDescendants() { return mNumDescendantsSelected; } 465 BOOL isSelected() const { return mIsSelected; }
457
458 BOOL isSelected() { return mIsSelected; }
459 466
460 void setIsCurSelection(BOOL select) { mIsCurSelection = select; } 467 void setIsCurSelection(BOOL select) { mIsCurSelection = select; }
461 468
@@ -475,7 +482,7 @@ public:
475 // viewed. This method will ask the viewed object itself. 482 // viewed. This method will ask the viewed object itself.
476 const std::string& getName( void ) const; 483 const std::string& getName( void ) const;
477 484
478 const std::string& getSearchableLabel( U32 search_type ) const; 485 const std::string& getSearchableLabel() const;
479 486
480 // This method returns the label displayed on the view. This 487 // This method returns the label displayed on the view. This
481 // method was primarily added to allow sorting on the folder 488 // method was primarily added to allow sorting on the folder
@@ -563,6 +570,13 @@ public:
563 UNKNOWN, TRASH, NOT_TRASH 570 UNKNOWN, TRASH, NOT_TRASH
564 } ETrash; 571 } ETrash;
565 572
573private:
574 S32 mNumDescendantsSelected;
575
576public: // Accessed needed by LLFolderViewItem
577 void recursiveIncrementNumDescendantsSelected(S32 increment);
578 S32 numSelected(void) const { return mNumDescendantsSelected + (isSelected() ? 1 : 0); }
579
566protected: 580protected:
567 typedef std::list<LLFolderViewItem*> items_t; 581 typedef std::list<LLFolderViewItem*> items_t;
568 typedef std::list<LLFolderViewFolder*> folders_t; 582 typedef std::list<LLFolderViewFolder*> folders_t;
@@ -624,20 +638,22 @@ public:
624 virtual void dirtyFilter(); 638 virtual void dirtyFilter();
625 639
626 // Passes selection information on to children and record 640 // Passes selection information on to children and record
627 // selection information if necessary. Returns TRUE if this object 641 // selection information if necessary.
628 // (or a child) was affected. 642 // Returns TRUE if this object (or a child) ends up being selected.
629 virtual BOOL setSelection(LLFolderViewItem* selection, BOOL openitem, 643 // If 'openitem' is TRUE then folders are opened up along the way to the selection.
630 BOOL take_keyboard_focus); 644 virtual BOOL setSelection(LLFolderViewItem* selection, BOOL openitem, BOOL take_keyboard_focus);
631 645
632 // This method is used to change the selection of an item. If 646 // This method is used to change the selection of an item.
633 // selection is 'this', then note selection as true. Returns TRUE 647 // Recursively traverse all children; if 'selection' is 'this' then change
634 // if this or a child is now selected. 648 // the select status if necessary.
649 // Returns TRUE if the selection state of this folder, or of a child, was changed.
635 virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected); 650 virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected);
636 651
637 // this method is used to group select items 652 // this method is used to group select items
638 virtual S32 extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& items); 653 virtual void extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& items);
639 654
640 virtual void recursiveDeselect(BOOL deselect_self); 655 // Deselect this folder and all folder/items it contains recursively.
656 void recursiveDeselect(BOOL deselect_self);
641 657
642 // Returns true is this object and all of its children can be removed. 658 // Returns true is this object and all of its children can be removed.
643 virtual BOOL isRemovable(); 659 virtual BOOL isRemovable();
@@ -724,6 +740,7 @@ public:
724 740
725 time_t getCreationDate() const; 741 time_t getCreationDate() const;
726 bool isTrash() const; 742 bool isTrash() const;
743 S32 getNumSelectedDescendants(void) const { return mNumDescendantsSelected; }
727}; 744};
728 745
729 746
@@ -797,7 +814,7 @@ public:
797 // children, and keeps track of selected objects. 814 // children, and keeps track of selected objects.
798 virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected); 815 virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected);
799 816
800 virtual S32 extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& items); 817 virtual void extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& items);
801 818
802 virtual BOOL getSelectionList(std::set<LLUUID> &selection); 819 virtual BOOL getSelectionList(std::set<LLUUID> &selection);
803 820