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.h95
1 files changed, 49 insertions, 46 deletions
diff --git a/linden/indra/newview/llfolderview.h b/linden/indra/newview/llfolderview.h
index 3858388..7978386 100644
--- a/linden/indra/newview/llfolderview.h
+++ b/linden/indra/newview/llfolderview.h
@@ -70,26 +70,25 @@ class LLFolderViewItem;
70class LLFolderView; 70class LLFolderView;
71class LLInventoryModel; 71class LLInventoryModel;
72class LLScrollableContainerView; 72class LLScrollableContainerView;
73typedef BOOL (*LLFolderSearchFunction)(LLFolderViewItem* first_item, const char *find_text, BOOL backward);
74 73
75class LLFolderViewEventListener 74class LLFolderViewEventListener
76{ 75{
77public: 76public:
78 virtual ~LLFolderViewEventListener( void ) {} 77 virtual ~LLFolderViewEventListener( void ) {}
79 virtual const LLString& getName() const = 0; 78 virtual const std::string& getName() const = 0;
80 virtual const LLString& getDisplayName() const = 0; 79 virtual const std::string& getDisplayName() const = 0;
81 virtual const LLUUID& getUUID() const = 0; 80 virtual const LLUUID& getUUID() const = 0;
82 virtual U32 getCreationDate() const = 0; // UTC seconds 81 virtual time_t getCreationDate() const = 0; // UTC seconds
83 virtual PermissionMask getPermissionMask() const = 0; 82 virtual PermissionMask getPermissionMask() const = 0;
84 virtual LLUIImagePtr getIcon() const = 0; 83 virtual LLUIImagePtr getIcon() const = 0;
85 virtual LLFontGL::StyleFlags getLabelStyle() const = 0; 84 virtual LLFontGL::StyleFlags getLabelStyle() const = 0;
86 virtual LLString getLabelSuffix() const = 0; 85 virtual std::string getLabelSuffix() const = 0;
87 virtual void openItem( void ) = 0; 86 virtual void openItem( void ) = 0;
88 virtual void previewItem( void ) = 0; 87 virtual void previewItem( void ) = 0;
89 virtual void selectItem(void) = 0; 88 virtual void selectItem(void) = 0;
90 virtual void showProperties(void) = 0; 89 virtual void showProperties(void) = 0;
91 virtual BOOL isItemRenameable() const = 0; 90 virtual BOOL isItemRenameable() const = 0;
92 virtual BOOL renameItem(const LLString& new_name) = 0; 91 virtual BOOL renameItem(const std::string& new_name) = 0;
93 virtual BOOL isItemMovable( void ) = 0; // Can be moved to another folder 92 virtual BOOL isItemMovable( void ) = 0; // Can be moved to another folder
94 virtual BOOL isItemRemovable( void ) = 0; // Can be destroyed 93 virtual BOOL isItemRemovable( void ) = 0; // Can be destroyed
95 virtual BOOL removeItem() = 0; 94 virtual BOOL removeItem() = 0;
@@ -104,7 +103,7 @@ public:
104 virtual BOOL isUpToDate() const = 0; 103 virtual BOOL isUpToDate() const = 0;
105 virtual BOOL hasChildren() const = 0; 104 virtual BOOL hasChildren() const = 0;
106 virtual LLInventoryType::EType getInventoryType() const = 0; 105 virtual LLInventoryType::EType getInventoryType() const = 0;
107 virtual void performAction(LLFolderView* folder, LLInventoryModel* model, LLString action) {} 106 virtual void performAction(LLFolderView* folder, LLInventoryModel* model, std::string action) {}
108 107
109 // This method should be called when a drag begins. returns TRUE 108 // This method should be called when a drag begins. returns TRUE
110 // if the drag can begin, otherwise FALSE. 109 // if the drag can begin, otherwise FALSE.
@@ -186,22 +185,22 @@ public:
186 static const U32 SO_FOLDERS_BY_NAME = 2; 185 static const U32 SO_FOLDERS_BY_NAME = 2;
187 static const U32 SO_SYSTEM_FOLDERS_TO_TOP = 4; 186 static const U32 SO_SYSTEM_FOLDERS_TO_TOP = 4;
188 187
189 LLInventoryFilter(const LLString& name); 188 LLInventoryFilter(const std::string& name);
190 virtual ~LLInventoryFilter(); 189 virtual ~LLInventoryFilter();
191 190
192 void setFilterTypes(U32 types); 191 void setFilterTypes(U32 types);
193 U32 getFilterTypes() const { return mFilterOps.mFilterTypes; } 192 U32 getFilterTypes() const { return mFilterOps.mFilterTypes; }
194 193
195 void setFilterSubString(const LLString& string); 194 void setFilterSubString(const std::string& string);
196 const LLString getFilterSubString(BOOL trim = FALSE); 195 const std::string getFilterSubString(BOOL trim = FALSE);
197 196
198 void setFilterPermissions(PermissionMask perms); 197 void setFilterPermissions(PermissionMask perms);
199 PermissionMask getFilterPermissions() const { return mFilterOps.mPermissions; } 198 PermissionMask getFilterPermissions() const { return mFilterOps.mPermissions; }
200 199
201 void setDateRange(U32 min_date, U32 max_date); 200 void setDateRange(time_t min_date, time_t max_date);
202 void setDateRangeLastLogoff(BOOL sl); 201 void setDateRangeLastLogoff(BOOL sl);
203 U32 getMinDate() const { return mFilterOps.mMinDate; } 202 time_t getMinDate() const { return mFilterOps.mMinDate; }
204 U32 getMaxDate() const { return mFilterOps.mMaxDate; } 203 time_t getMaxDate() const { return mFilterOps.mMaxDate; }
205 204
206 void setHoursAgo(U32 hours); 205 void setHoursAgo(U32 hours);
207 U32 getHoursAgo() const { return mFilterOps.mHoursAgo; } 206 U32 getHoursAgo() const { return mFilterOps.mHoursAgo; }
@@ -220,8 +219,8 @@ public:
220 BOOL isModifiedAndClear(); 219 BOOL isModifiedAndClear();
221 BOOL isSinceLogoff(); 220 BOOL isSinceLogoff();
222 void clearModified() { mModified = FALSE; mFilterBehavior = FILTER_NONE; } 221 void clearModified() { mModified = FALSE; mFilterBehavior = FILTER_NONE; }
223 const LLString getName() const { return mName; } 222 const std::string getName() const { return mName; }
224 LLString getFilterText(); 223 std::string getFilterText();
225 224
226 void setFilterCount(S32 count) { mFilterCount = count; } 225 void setFilterCount(S32 count) { mFilterCount = count; }
227 S32 getFilterCount() { return mFilterCount; } 226 S32 getFilterCount() { return mFilterCount; }
@@ -246,8 +245,8 @@ protected:
246 struct filter_ops 245 struct filter_ops
247 { 246 {
248 U32 mFilterTypes; 247 U32 mFilterTypes;
249 U32 mMinDate; 248 time_t mMinDate;
250 U32 mMaxDate; 249 time_t mMaxDate;
251 U32 mHoursAgo; 250 U32 mHoursAgo;
252 EFolderShow mShowFolderState; 251 EFolderShow mShowFolderState;
253 PermissionMask mPermissions; 252 PermissionMask mPermissions;
@@ -255,9 +254,9 @@ protected:
255 filter_ops mFilterOps; 254 filter_ops mFilterOps;
256 filter_ops mDefaultFilterOps; 255 filter_ops mDefaultFilterOps;
257 std::string::size_type mSubStringMatchOffset; 256 std::string::size_type mSubStringMatchOffset;
258 LLString mFilterSubString; 257 std::string mFilterSubString;
259 U32 mOrder; 258 U32 mOrder;
260 const LLString mName; 259 const std::string mName;
261 S32 mFilterGeneration; 260 S32 mFilterGeneration;
262 S32 mMustPassGeneration; 261 S32 mMustPassGeneration;
263 S32 mMinRequiredGeneration; 262 S32 mMinRequiredGeneration;
@@ -269,7 +268,7 @@ private:
269 U32 mLastLogoff; 268 U32 mLastLogoff;
270 BOOL mModified; 269 BOOL mModified;
271 BOOL mNeedTextRebuild; 270 BOOL mNeedTextRebuild;
272 LLString mFilterText; 271 std::string mFilterText;
273}; 272};
274 273
275// These are grouping of inventory types. 274// These are grouping of inventory types.
@@ -328,10 +327,12 @@ protected:
328 static LLColor4 sFilterTextColor; 327 static LLColor4 sFilterTextColor;
329 static LLColor4 sSuffixColor; 328 static LLColor4 sSuffixColor;
330 static LLColor4 sSearchStatusColor; 329 static LLColor4 sSearchStatusColor;
330 static LLUIImagePtr sArrowImage;
331 static LLUIImagePtr sBoxImage;
331 332
332 LLString mLabel; 333 std::string mLabel;
333 LLString mSearchableLabel; 334 std::string mSearchableLabel;
334 LLString mType; 335 std::string mType;
335 S32 mLabelWidth; 336 S32 mLabelWidth;
336 U32 mCreationDate; 337 U32 mCreationDate;
337 LLFolderViewFolder* mParentFolder; 338 LLFolderViewFolder* mParentFolder;
@@ -340,9 +341,9 @@ protected:
340 BOOL mIsCurSelection; 341 BOOL mIsCurSelection;
341 BOOL mSelectPending; 342 BOOL mSelectPending;
342 LLFontGL::StyleFlags mLabelStyle; 343 LLFontGL::StyleFlags mLabelStyle;
343 LLString mLabelSuffix; 344 std::string mLabelSuffix;
344 LLUIImagePtr mIcon; 345 LLUIImagePtr mIcon;
345 LLString mStatusText; 346 std::string mStatusText;
346 BOOL mHasVisibleChildren; 347 BOOL mHasVisibleChildren;
347 S32 mIndentation; 348 S32 mIndentation;
348 S32 mNumDescendantsSelected; 349 S32 mNumDescendantsSelected;
@@ -352,8 +353,6 @@ protected:
352 F32 mControlLabelRotation; 353 F32 mControlLabelRotation;
353 LLFolderView* mRoot; 354 LLFolderView* mRoot;
354 BOOL mDragAndDropTarget; 355 BOOL mDragAndDropTarget;
355 LLUIImagePtr mArrowImage;
356 LLUIImagePtr mBoxImage;
357 BOOL mIsLoading; 356 BOOL mIsLoading;
358 LLTimer mTimeSinceRequestStart; 357 LLTimer mTimeSinceRequestStart;
359 358
@@ -376,6 +375,9 @@ protected:
376 virtual BOOL addFolder(LLFolderViewFolder*) { return FALSE; } 375 virtual BOOL addFolder(LLFolderViewFolder*) { return FALSE; }
377 376
378public: 377public:
378 static void initClass();
379 static void cleanupClass();
380
379 // This function is called when the folder view is dirty. It's 381 // This function is called when the folder view is dirty. It's
380 // implemented here but called by derived classes when folding the 382 // implemented here but called by derived classes when folding the
381 // views. 383 // views.
@@ -383,7 +385,7 @@ public:
383 void filterFromRoot( void ); 385 void filterFromRoot( void );
384 386
385 // creation_date is in UTC seconds 387 // creation_date is in UTC seconds
386 LLFolderViewItem( const LLString& name, LLUIImagePtr icon, S32 creation_date, LLFolderView* root, LLFolderViewEventListener* listener ); 388 LLFolderViewItem( const std::string& name, LLUIImagePtr icon, S32 creation_date, LLFolderView* root, LLFolderViewEventListener* listener );
387 virtual ~LLFolderViewItem( void ); 389 virtual ~LLFolderViewItem( void );
388 390
389 // addToFolder() returns TRUE if it succeeds. FALSE otherwise 391 // addToFolder() returns TRUE if it succeeds. FALSE otherwise
@@ -454,17 +456,17 @@ public:
454 456
455 // This method returns the actual name of the thing being 457 // This method returns the actual name of the thing being
456 // viewed. This method will ask the viewed object itself. 458 // viewed. This method will ask the viewed object itself.
457 const LLString& getName( void ) const; 459 const std::string& getName( void ) const;
458 460
459 const LLString& getSearchableLabel( void ) const; 461 const std::string& getSearchableLabel( void ) const;
460 462
461 // This method returns the label displayed on the view. This 463 // This method returns the label displayed on the view. This
462 // method was primarily added to allow sorting on the folder 464 // method was primarily added to allow sorting on the folder
463 // contents possible before the entire view has been constructed. 465 // contents possible before the entire view has been constructed.
464 const char* getLabel() const { return mLabel.c_str(); } 466 const std::string& getLabel() const { return mLabel; }
465 467
466 // Used for sorting, like getLabel() above. 468 // Used for sorting, like getLabel() above.
467 virtual U32 getCreationDate() const { return mCreationDate; } 469 virtual time_t getCreationDate() const { return mCreationDate; }
468 470
469 LLFolderViewFolder* getParentFolder( void ) { return mParentFolder; } 471 LLFolderViewFolder* getParentFolder( void ) { return mParentFolder; }
470 const LLFolderViewFolder* getParentFolder( void ) const { return mParentFolder; } 472 const LLFolderViewFolder* getParentFolder( void ) const { return mParentFolder; }
@@ -476,7 +478,7 @@ public:
476 LLFolderViewEventListener* getListener( void ) { return mListener; } 478 LLFolderViewEventListener* getListener( void ) { return mListener; }
477 479
478 // just rename the object. 480 // just rename the object.
479 void rename(const LLString& new_name); 481 void rename(const std::string& new_name);
480 482
481 // open 483 // open
482 virtual void openItem( void ); 484 virtual void openItem( void );
@@ -501,6 +503,7 @@ public:
501 void setIcon(LLUIImagePtr icon); 503 void setIcon(LLUIImagePtr icon);
502 504
503 // refresh information from the object being viewed. 505 // refresh information from the object being viewed.
506 void refreshFromListener();
504 virtual void refresh(); 507 virtual void refresh();
505 508
506 virtual void applyListenerFunctorRecursively(LLFolderViewListenerFunctor& functor); 509 virtual void applyListenerFunctorRecursively(LLFolderViewListenerFunctor& functor);
@@ -519,7 +522,7 @@ public:
519 EDragAndDropType cargo_type, 522 EDragAndDropType cargo_type,
520 void* cargo_data, 523 void* cargo_data,
521 EAcceptance* accept, 524 EAcceptance* accept,
522 LLString& tooltip_msg); 525 std::string& tooltip_msg);
523}; 526};
524 527
525 528
@@ -555,7 +558,7 @@ protected:
555 F32 mCurHeight; 558 F32 mCurHeight;
556 F32 mTargetHeight; 559 F32 mTargetHeight;
557 F32 mAutoOpenCountdown; 560 F32 mAutoOpenCountdown;
558 U32 mSubtreeCreationDate; 561 time_t mSubtreeCreationDate;
559 mutable ETrash mAmTrash; 562 mutable ETrash mAmTrash;
560 S32 mLastArrangeGeneration; 563 S32 mLastArrangeGeneration;
561 S32 mLastCalculatedWidth; 564 S32 mLastCalculatedWidth;
@@ -570,7 +573,7 @@ public:
570 RECURSE_UP_DOWN 573 RECURSE_UP_DOWN
571 } ERecurseType; 574 } ERecurseType;
572 575
573 LLFolderViewFolder( const LLString& name, LLUIImagePtr icon, 576 LLFolderViewFolder( const std::string& name, LLUIImagePtr icon,
574 LLFolderView* root, 577 LLFolderView* root,
575 LLFolderViewEventListener* listener ); 578 LLFolderViewEventListener* listener );
576 virtual ~LLFolderViewFolder( void ); 579 virtual ~LLFolderViewFolder( void );
@@ -681,7 +684,7 @@ public:
681 EDragAndDropType cargo_type, 684 EDragAndDropType cargo_type,
682 void* cargo_data, 685 void* cargo_data,
683 EAcceptance* accept, 686 EAcceptance* accept,
684 LLString& tooltip_msg); 687 std::string& tooltip_msg);
685 688
686 void applyFunctorRecursively(LLFolderViewFunctor& functor); 689 void applyFunctorRecursively(LLFolderViewFunctor& functor);
687 virtual void applyListenerFunctorRecursively(LLFolderViewListenerFunctor& functor); 690 virtual void applyListenerFunctorRecursively(LLFolderViewListenerFunctor& functor);
@@ -699,10 +702,10 @@ public:
699 EDragAndDropType cargo_type, 702 EDragAndDropType cargo_type,
700 void* cargo_data, 703 void* cargo_data,
701 EAcceptance* accept, 704 EAcceptance* accept,
702 LLString& tooltip_msg); 705 std::string& tooltip_msg);
703 virtual void draw(); 706 virtual void draw();
704 707
705 U32 getCreationDate() const; 708 time_t getCreationDate() const;
706 bool isTrash() const; 709 bool isTrash() const;
707}; 710};
708 711
@@ -724,7 +727,7 @@ public:
724 727
725 static F32 sAutoOpenTime; 728 static F32 sAutoOpenTime;
726 729
727 LLFolderView( const LLString& name, LLUIImagePtr root_folder_icon, const LLRect& rect, 730 LLFolderView( const std::string& name, LLUIImagePtr root_folder_icon, const LLRect& rect,
728 const LLUUID& source_id, LLView *parent_view ); 731 const LLUUID& source_id, LLView *parent_view );
729 virtual ~LLFolderView( void ); 732 virtual ~LLFolderView( void );
730 733
@@ -739,7 +742,7 @@ public:
739 void setAllowMultiSelect(BOOL allow) { mAllowMultiSelect = allow; } 742 void setAllowMultiSelect(BOOL allow) { mAllowMultiSelect = allow; }
740 743
741 LLInventoryFilter* getFilter() { return &mFilter; } 744 LLInventoryFilter* getFilter() { return &mFilter; }
742 const LLString getFilterSubString(BOOL trim = FALSE); 745 const std::string getFilterSubString(BOOL trim = FALSE);
743 U32 getFilterTypes() const { return mFilter.getFilterTypes(); } 746 U32 getFilterTypes() const { return mFilter.getFilterTypes(); }
744 PermissionMask getFilterPermissions() const { return mFilter.getFilterPermissions(); } 747 PermissionMask getFilterPermissions() const { return mFilter.getFilterPermissions(); }
745 LLInventoryFilter::EFolderShow getShowFolderState() { return mFilter.getShowFolderState(); } 748 LLInventoryFilter::EFolderShow getShowFolderState() { return mFilter.getShowFolderState(); }
@@ -749,7 +752,7 @@ public:
749 752
750 // Close all folders in the view 753 // Close all folders in the view
751 void closeAllFolders(); 754 void closeAllFolders();
752 void openFolder(const LLString& foldername); 755 void openFolder(const std::string& foldername);
753 756
754 virtual void toggleOpen() {}; 757 virtual void toggleOpen() {};
755 virtual void setOpenArrangeRecursively(BOOL openitem, ERecurseType recurse); 758 virtual void setOpenArrangeRecursively(BOOL openitem, ERecurseType recurse);
@@ -839,7 +842,7 @@ public:
839 EDragAndDropType cargo_type, 842 EDragAndDropType cargo_type,
840 void* cargo_data, 843 void* cargo_data,
841 EAcceptance* accept, 844 EAcceptance* accept,
842 LLString& tooltip_msg); 845 std::string& tooltip_msg);
843 /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); 846 /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
844 /*virtual*/ void onFocusLost(); 847 /*virtual*/ void onFocusLost();
845 virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); 848 virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
@@ -851,7 +854,7 @@ public:
851 void setScrollContainer( LLScrollableContainerView* parent ) { mScrollContainer = parent; } 854 void setScrollContainer( LLScrollableContainerView* parent ) { mScrollContainer = parent; }
852 LLRect getVisibleRect(); 855 LLRect getVisibleRect();
853 856
854 BOOL search(LLFolderViewItem* first_item, const LLString &search_string, BOOL backward); 857 BOOL search(LLFolderViewItem* first_item, const std::string &search_string, BOOL backward);
855 void setShowSelectionContext(BOOL show) { mShowSelectionContext = show; } 858 void setShowSelectionContext(BOOL show) { mShowSelectionContext = show; }
856 BOOL getShowSelectionContext(); 859 BOOL getShowSelectionContext();
857 void setShowSingleSelection(BOOL show); 860 void setShowSingleSelection(BOOL show);
@@ -881,7 +884,7 @@ protected:
881 static void onRenamerLost( LLUICtrl* renamer, void* user_data); 884 static void onRenamerLost( LLUICtrl* renamer, void* user_data);
882 885
883 void finishRenamingItem( void ); 886 void finishRenamingItem( void );
884 void revertRenamingItem( void ); 887 void closeRenamer( void );
885 888
886protected: 889protected:
887 LLHandle<LLView> mPopupMenuHandle; 890 LLHandle<LLView> mPopupMenuHandle;
@@ -910,7 +913,7 @@ protected:
910 LLFolderViewFolder* mAutoOpenCandidate; 913 LLFolderViewFolder* mAutoOpenCandidate;
911 LLFrameTimer mAutoOpenTimer; 914 LLFrameTimer mAutoOpenTimer;
912 LLFrameTimer mSearchTimer; 915 LLFrameTimer mSearchTimer;
913 LLString mSearchString; 916 std::string mSearchString;
914 LLInventoryFilter mFilter; 917 LLInventoryFilter mFilter;
915 BOOL mShowSelectionContext; 918 BOOL mShowSelectionContext;
916 BOOL mShowSingleSelection; 919 BOOL mShowSingleSelection;