diff options
author | Jacek Antonelli | 2008-08-15 23:44:56 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:56 -0500 |
commit | c07901e29ed545bbb02e3bddf148fe1104b94e9f (patch) | |
tree | f1ada64ce834acd7d92a425efb96c4b86bcf16b1 /linden/indra/newview/llfolderview.h | |
parent | Second Life viewer sources 1.15.0.2 (diff) | |
download | meta-impy-c07901e29ed545bbb02e3bddf148fe1104b94e9f.zip meta-impy-c07901e29ed545bbb02e3bddf148fe1104b94e9f.tar.gz meta-impy-c07901e29ed545bbb02e3bddf148fe1104b94e9f.tar.bz2 meta-impy-c07901e29ed545bbb02e3bddf148fe1104b94e9f.tar.xz |
Second Life viewer sources 1.15.1.3
Diffstat (limited to 'linden/indra/newview/llfolderview.h')
-rw-r--r-- | linden/indra/newview/llfolderview.h | 49 |
1 files changed, 44 insertions, 5 deletions
diff --git a/linden/indra/newview/llfolderview.h b/linden/indra/newview/llfolderview.h index 8acbc8f..ec70b90 100644 --- a/linden/indra/newview/llfolderview.h +++ b/linden/indra/newview/llfolderview.h | |||
@@ -181,6 +181,7 @@ public: | |||
181 | 181 | ||
182 | static const U32 SO_DATE = 1; | 182 | static const U32 SO_DATE = 1; |
183 | static const U32 SO_FOLDERS_BY_NAME = 2; | 183 | static const U32 SO_FOLDERS_BY_NAME = 2; |
184 | static const U32 SO_SYSTEM_FOLDERS_TO_TOP = 4; | ||
184 | 185 | ||
185 | LLInventoryFilter(const LLString& name); | 186 | LLInventoryFilter(const LLString& name); |
186 | virtual ~LLInventoryFilter(); | 187 | virtual ~LLInventoryFilter(); |
@@ -265,6 +266,34 @@ private: | |||
265 | LLString mFilterText; | 266 | LLString mFilterText; |
266 | }; | 267 | }; |
267 | 268 | ||
269 | // These are grouping of inventory types. | ||
270 | // Order matters when sorting system folders to the top. | ||
271 | enum EInventorySortGroup | ||
272 | { | ||
273 | SG_SYSTEM_FOLDER, | ||
274 | SG_TRASH_FOLDER, | ||
275 | SG_NORMAL_FOLDER, | ||
276 | SG_ITEM | ||
277 | }; | ||
278 | |||
279 | class LLInventorySort | ||
280 | { | ||
281 | public: | ||
282 | LLInventorySort() | ||
283 | : mSortOrder(0) { } | ||
284 | |||
285 | // Returns true if order has changed | ||
286 | bool updateSort(U32 order); | ||
287 | U32 getSort() { return mSortOrder; } | ||
288 | |||
289 | bool operator()(LLFolderViewItem* a, LLFolderViewItem* b); | ||
290 | private: | ||
291 | U32 mSortOrder; | ||
292 | bool mByDate; | ||
293 | bool mSystemToTop; | ||
294 | bool mFoldersByName; | ||
295 | }; | ||
296 | |||
268 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 297 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
269 | // Class LLFolderViewItem | 298 | // Class LLFolderViewItem |
270 | // | 299 | // |
@@ -351,6 +380,8 @@ public: | |||
351 | enum { ARRANGE = TRUE, DO_NOT_ARRANGE = FALSE }; | 380 | enum { ARRANGE = TRUE, DO_NOT_ARRANGE = FALSE }; |
352 | virtual BOOL addToFolder(LLFolderViewFolder* folder, LLFolderView* root); | 381 | virtual BOOL addToFolder(LLFolderViewFolder* folder, LLFolderView* root); |
353 | 382 | ||
383 | virtual EInventorySortGroup getSortGroup(); | ||
384 | |||
354 | // Finds width and height of this object and it's children. Also | 385 | // Finds width and height of this object and it's children. Also |
355 | // makes sure that this view and it's children are the right size. | 386 | // makes sure that this view and it's children are the right size. |
356 | virtual S32 arrange( S32* width, S32* height, S32 filter_generation ); | 387 | virtual S32 arrange( S32* width, S32* height, S32 filter_generation ); |
@@ -449,8 +480,10 @@ public: | |||
449 | 480 | ||
450 | virtual void setStatusText(const LLString& text) { mStatusText = text; } | 481 | virtual void setStatusText(const LLString& text) { mStatusText = text; } |
451 | 482 | ||
452 | BOOL getFiltered(); | 483 | virtual BOOL potentiallyVisible(); // do we know for a fact that this item has been filtered out? |
453 | BOOL getFiltered(S32 filter_generation); | 484 | |
485 | virtual BOOL getFiltered(); | ||
486 | virtual BOOL getFiltered(S32 filter_generation); | ||
454 | virtual void setFiltered(BOOL filtered, S32 filter_generation); | 487 | virtual void setFiltered(BOOL filtered, S32 filter_generation); |
455 | 488 | ||
456 | // change the icon | 489 | // change the icon |
@@ -504,7 +537,7 @@ protected: | |||
504 | typedef std::vector<LLFolderViewFolder*> folders_t; | 537 | typedef std::vector<LLFolderViewFolder*> folders_t; |
505 | items_t mItems; | 538 | items_t mItems; |
506 | folders_t mFolders; | 539 | folders_t mFolders; |
507 | sort_order_f mSortFunction; | 540 | LLInventorySort mSortFunction; |
508 | 541 | ||
509 | BOOL mIsOpen; | 542 | BOOL mIsOpen; |
510 | BOOL mExpanderHighlighted; | 543 | BOOL mExpanderHighlighted; |
@@ -534,6 +567,8 @@ public: | |||
534 | virtual EWidgetType getWidgetType() const; | 567 | virtual EWidgetType getWidgetType() const; |
535 | virtual LLString getWidgetTag() const; | 568 | virtual LLString getWidgetTag() const; |
536 | 569 | ||
570 | virtual BOOL potentiallyVisible(); | ||
571 | |||
537 | LLFolderViewItem* getNextFromChild( LLFolderViewItem*, BOOL include_children = TRUE ); | 572 | LLFolderViewItem* getNextFromChild( LLFolderViewItem*, BOOL include_children = TRUE ); |
538 | LLFolderViewItem* getPreviousFromChild( LLFolderViewItem*, BOOL include_children = TRUE ); | 573 | LLFolderViewItem* getPreviousFromChild( LLFolderViewItem*, BOOL include_children = TRUE ); |
539 | 574 | ||
@@ -546,6 +581,9 @@ public: | |||
546 | 581 | ||
547 | BOOL needsArrange(); | 582 | BOOL needsArrange(); |
548 | 583 | ||
584 | // Returns the sort group (system, trash, folder) for this folder. | ||
585 | virtual EInventorySortGroup getSortGroup(); | ||
586 | |||
549 | virtual void setCompletedFilterGeneration(S32 generation, BOOL recurse_up); | 587 | virtual void setCompletedFilterGeneration(S32 generation, BOOL recurse_up); |
550 | virtual S32 getCompletedFilterGeneration() { return mCompletedFilterGeneration; } | 588 | virtual S32 getCompletedFilterGeneration() { return mCompletedFilterGeneration; } |
551 | 589 | ||
@@ -603,7 +641,7 @@ public: | |||
603 | // This function is called by a child that needs to be resorted. | 641 | // This function is called by a child that needs to be resorted. |
604 | void resort(LLFolderViewItem* item); | 642 | void resort(LLFolderViewItem* item); |
605 | 643 | ||
606 | void setItemSortFunction(sort_order_f ordering); | 644 | void setItemSortOrder(U32 ordering); |
607 | void sortBy(U32); | 645 | void sortBy(U32); |
608 | //BOOL (*func)(LLFolderViewItem* a, LLFolderViewItem* b)); | 646 | //BOOL (*func)(LLFolderViewItem* a, LLFolderViewItem* b)); |
609 | 647 | ||
@@ -617,7 +655,8 @@ public: | |||
617 | virtual void setOpen(BOOL open = TRUE); /* Flawfinder: ignore */ | 655 | virtual void setOpen(BOOL open = TRUE); /* Flawfinder: ignore */ |
618 | 656 | ||
619 | // Called when a child is refreshed. | 657 | // Called when a child is refreshed. |
620 | virtual void requestArrange(); | 658 | // don't rearrange child folder contents unless explicitly requested |
659 | virtual void requestArrange(BOOL include_descendants = FALSE); | ||
621 | 660 | ||
622 | // internal method which doesn't update the entire view. This | 661 | // internal method which doesn't update the entire view. This |
623 | // method was written because the list iterators destroy the state | 662 | // method was written because the list iterators destroy the state |