diff options
Diffstat (limited to 'linden/indra/newview/llfolderview.h')
-rw-r--r-- | linden/indra/newview/llfolderview.h | 87 |
1 files changed, 43 insertions, 44 deletions
diff --git a/linden/indra/newview/llfolderview.h b/linden/indra/newview/llfolderview.h index 3858388..6369120 100644 --- a/linden/indra/newview/llfolderview.h +++ b/linden/indra/newview/llfolderview.h | |||
@@ -70,26 +70,25 @@ class LLFolderViewItem; | |||
70 | class LLFolderView; | 70 | class LLFolderView; |
71 | class LLInventoryModel; | 71 | class LLInventoryModel; |
72 | class LLScrollableContainerView; | 72 | class LLScrollableContainerView; |
73 | typedef BOOL (*LLFolderSearchFunction)(LLFolderViewItem* first_item, const char *find_text, BOOL backward); | ||
74 | 73 | ||
75 | class LLFolderViewEventListener | 74 | class LLFolderViewEventListener |
76 | { | 75 | { |
77 | public: | 76 | public: |
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. |
@@ -329,9 +328,9 @@ protected: | |||
329 | static LLColor4 sSuffixColor; | 328 | static LLColor4 sSuffixColor; |
330 | static LLColor4 sSearchStatusColor; | 329 | static LLColor4 sSearchStatusColor; |
331 | 330 | ||
332 | LLString mLabel; | 331 | std::string mLabel; |
333 | LLString mSearchableLabel; | 332 | std::string mSearchableLabel; |
334 | LLString mType; | 333 | std::string mType; |
335 | S32 mLabelWidth; | 334 | S32 mLabelWidth; |
336 | U32 mCreationDate; | 335 | U32 mCreationDate; |
337 | LLFolderViewFolder* mParentFolder; | 336 | LLFolderViewFolder* mParentFolder; |
@@ -340,9 +339,9 @@ protected: | |||
340 | BOOL mIsCurSelection; | 339 | BOOL mIsCurSelection; |
341 | BOOL mSelectPending; | 340 | BOOL mSelectPending; |
342 | LLFontGL::StyleFlags mLabelStyle; | 341 | LLFontGL::StyleFlags mLabelStyle; |
343 | LLString mLabelSuffix; | 342 | std::string mLabelSuffix; |
344 | LLUIImagePtr mIcon; | 343 | LLUIImagePtr mIcon; |
345 | LLString mStatusText; | 344 | std::string mStatusText; |
346 | BOOL mHasVisibleChildren; | 345 | BOOL mHasVisibleChildren; |
347 | S32 mIndentation; | 346 | S32 mIndentation; |
348 | S32 mNumDescendantsSelected; | 347 | S32 mNumDescendantsSelected; |
@@ -383,7 +382,7 @@ public: | |||
383 | void filterFromRoot( void ); | 382 | void filterFromRoot( void ); |
384 | 383 | ||
385 | // creation_date is in UTC seconds | 384 | // creation_date is in UTC seconds |
386 | LLFolderViewItem( const LLString& name, LLUIImagePtr icon, S32 creation_date, LLFolderView* root, LLFolderViewEventListener* listener ); | 385 | LLFolderViewItem( const std::string& name, LLUIImagePtr icon, S32 creation_date, LLFolderView* root, LLFolderViewEventListener* listener ); |
387 | virtual ~LLFolderViewItem( void ); | 386 | virtual ~LLFolderViewItem( void ); |
388 | 387 | ||
389 | // addToFolder() returns TRUE if it succeeds. FALSE otherwise | 388 | // addToFolder() returns TRUE if it succeeds. FALSE otherwise |
@@ -454,17 +453,17 @@ public: | |||
454 | 453 | ||
455 | // This method returns the actual name of the thing being | 454 | // This method returns the actual name of the thing being |
456 | // viewed. This method will ask the viewed object itself. | 455 | // viewed. This method will ask the viewed object itself. |
457 | const LLString& getName( void ) const; | 456 | const std::string& getName( void ) const; |
458 | 457 | ||
459 | const LLString& getSearchableLabel( void ) const; | 458 | const std::string& getSearchableLabel( void ) const; |
460 | 459 | ||
461 | // This method returns the label displayed on the view. This | 460 | // This method returns the label displayed on the view. This |
462 | // method was primarily added to allow sorting on the folder | 461 | // method was primarily added to allow sorting on the folder |
463 | // contents possible before the entire view has been constructed. | 462 | // contents possible before the entire view has been constructed. |
464 | const char* getLabel() const { return mLabel.c_str(); } | 463 | const std::string& getLabel() const { return mLabel; } |
465 | 464 | ||
466 | // Used for sorting, like getLabel() above. | 465 | // Used for sorting, like getLabel() above. |
467 | virtual U32 getCreationDate() const { return mCreationDate; } | 466 | virtual time_t getCreationDate() const { return mCreationDate; } |
468 | 467 | ||
469 | LLFolderViewFolder* getParentFolder( void ) { return mParentFolder; } | 468 | LLFolderViewFolder* getParentFolder( void ) { return mParentFolder; } |
470 | const LLFolderViewFolder* getParentFolder( void ) const { return mParentFolder; } | 469 | const LLFolderViewFolder* getParentFolder( void ) const { return mParentFolder; } |
@@ -476,7 +475,7 @@ public: | |||
476 | LLFolderViewEventListener* getListener( void ) { return mListener; } | 475 | LLFolderViewEventListener* getListener( void ) { return mListener; } |
477 | 476 | ||
478 | // just rename the object. | 477 | // just rename the object. |
479 | void rename(const LLString& new_name); | 478 | void rename(const std::string& new_name); |
480 | 479 | ||
481 | // open | 480 | // open |
482 | virtual void openItem( void ); | 481 | virtual void openItem( void ); |
@@ -519,7 +518,7 @@ public: | |||
519 | EDragAndDropType cargo_type, | 518 | EDragAndDropType cargo_type, |
520 | void* cargo_data, | 519 | void* cargo_data, |
521 | EAcceptance* accept, | 520 | EAcceptance* accept, |
522 | LLString& tooltip_msg); | 521 | std::string& tooltip_msg); |
523 | }; | 522 | }; |
524 | 523 | ||
525 | 524 | ||
@@ -555,7 +554,7 @@ protected: | |||
555 | F32 mCurHeight; | 554 | F32 mCurHeight; |
556 | F32 mTargetHeight; | 555 | F32 mTargetHeight; |
557 | F32 mAutoOpenCountdown; | 556 | F32 mAutoOpenCountdown; |
558 | U32 mSubtreeCreationDate; | 557 | time_t mSubtreeCreationDate; |
559 | mutable ETrash mAmTrash; | 558 | mutable ETrash mAmTrash; |
560 | S32 mLastArrangeGeneration; | 559 | S32 mLastArrangeGeneration; |
561 | S32 mLastCalculatedWidth; | 560 | S32 mLastCalculatedWidth; |
@@ -570,7 +569,7 @@ public: | |||
570 | RECURSE_UP_DOWN | 569 | RECURSE_UP_DOWN |
571 | } ERecurseType; | 570 | } ERecurseType; |
572 | 571 | ||
573 | LLFolderViewFolder( const LLString& name, LLUIImagePtr icon, | 572 | LLFolderViewFolder( const std::string& name, LLUIImagePtr icon, |
574 | LLFolderView* root, | 573 | LLFolderView* root, |
575 | LLFolderViewEventListener* listener ); | 574 | LLFolderViewEventListener* listener ); |
576 | virtual ~LLFolderViewFolder( void ); | 575 | virtual ~LLFolderViewFolder( void ); |
@@ -681,7 +680,7 @@ public: | |||
681 | EDragAndDropType cargo_type, | 680 | EDragAndDropType cargo_type, |
682 | void* cargo_data, | 681 | void* cargo_data, |
683 | EAcceptance* accept, | 682 | EAcceptance* accept, |
684 | LLString& tooltip_msg); | 683 | std::string& tooltip_msg); |
685 | 684 | ||
686 | void applyFunctorRecursively(LLFolderViewFunctor& functor); | 685 | void applyFunctorRecursively(LLFolderViewFunctor& functor); |
687 | virtual void applyListenerFunctorRecursively(LLFolderViewListenerFunctor& functor); | 686 | virtual void applyListenerFunctorRecursively(LLFolderViewListenerFunctor& functor); |
@@ -699,10 +698,10 @@ public: | |||
699 | EDragAndDropType cargo_type, | 698 | EDragAndDropType cargo_type, |
700 | void* cargo_data, | 699 | void* cargo_data, |
701 | EAcceptance* accept, | 700 | EAcceptance* accept, |
702 | LLString& tooltip_msg); | 701 | std::string& tooltip_msg); |
703 | virtual void draw(); | 702 | virtual void draw(); |
704 | 703 | ||
705 | U32 getCreationDate() const; | 704 | time_t getCreationDate() const; |
706 | bool isTrash() const; | 705 | bool isTrash() const; |
707 | }; | 706 | }; |
708 | 707 | ||
@@ -724,7 +723,7 @@ public: | |||
724 | 723 | ||
725 | static F32 sAutoOpenTime; | 724 | static F32 sAutoOpenTime; |
726 | 725 | ||
727 | LLFolderView( const LLString& name, LLUIImagePtr root_folder_icon, const LLRect& rect, | 726 | LLFolderView( const std::string& name, LLUIImagePtr root_folder_icon, const LLRect& rect, |
728 | const LLUUID& source_id, LLView *parent_view ); | 727 | const LLUUID& source_id, LLView *parent_view ); |
729 | virtual ~LLFolderView( void ); | 728 | virtual ~LLFolderView( void ); |
730 | 729 | ||
@@ -739,7 +738,7 @@ public: | |||
739 | void setAllowMultiSelect(BOOL allow) { mAllowMultiSelect = allow; } | 738 | void setAllowMultiSelect(BOOL allow) { mAllowMultiSelect = allow; } |
740 | 739 | ||
741 | LLInventoryFilter* getFilter() { return &mFilter; } | 740 | LLInventoryFilter* getFilter() { return &mFilter; } |
742 | const LLString getFilterSubString(BOOL trim = FALSE); | 741 | const std::string getFilterSubString(BOOL trim = FALSE); |
743 | U32 getFilterTypes() const { return mFilter.getFilterTypes(); } | 742 | U32 getFilterTypes() const { return mFilter.getFilterTypes(); } |
744 | PermissionMask getFilterPermissions() const { return mFilter.getFilterPermissions(); } | 743 | PermissionMask getFilterPermissions() const { return mFilter.getFilterPermissions(); } |
745 | LLInventoryFilter::EFolderShow getShowFolderState() { return mFilter.getShowFolderState(); } | 744 | LLInventoryFilter::EFolderShow getShowFolderState() { return mFilter.getShowFolderState(); } |
@@ -749,7 +748,7 @@ public: | |||
749 | 748 | ||
750 | // Close all folders in the view | 749 | // Close all folders in the view |
751 | void closeAllFolders(); | 750 | void closeAllFolders(); |
752 | void openFolder(const LLString& foldername); | 751 | void openFolder(const std::string& foldername); |
753 | 752 | ||
754 | virtual void toggleOpen() {}; | 753 | virtual void toggleOpen() {}; |
755 | virtual void setOpenArrangeRecursively(BOOL openitem, ERecurseType recurse); | 754 | virtual void setOpenArrangeRecursively(BOOL openitem, ERecurseType recurse); |
@@ -839,7 +838,7 @@ public: | |||
839 | EDragAndDropType cargo_type, | 838 | EDragAndDropType cargo_type, |
840 | void* cargo_data, | 839 | void* cargo_data, |
841 | EAcceptance* accept, | 840 | EAcceptance* accept, |
842 | LLString& tooltip_msg); | 841 | std::string& tooltip_msg); |
843 | /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); | 842 | /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); |
844 | /*virtual*/ void onFocusLost(); | 843 | /*virtual*/ void onFocusLost(); |
845 | virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); | 844 | virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); |
@@ -851,7 +850,7 @@ public: | |||
851 | void setScrollContainer( LLScrollableContainerView* parent ) { mScrollContainer = parent; } | 850 | void setScrollContainer( LLScrollableContainerView* parent ) { mScrollContainer = parent; } |
852 | LLRect getVisibleRect(); | 851 | LLRect getVisibleRect(); |
853 | 852 | ||
854 | BOOL search(LLFolderViewItem* first_item, const LLString &search_string, BOOL backward); | 853 | BOOL search(LLFolderViewItem* first_item, const std::string &search_string, BOOL backward); |
855 | void setShowSelectionContext(BOOL show) { mShowSelectionContext = show; } | 854 | void setShowSelectionContext(BOOL show) { mShowSelectionContext = show; } |
856 | BOOL getShowSelectionContext(); | 855 | BOOL getShowSelectionContext(); |
857 | void setShowSingleSelection(BOOL show); | 856 | void setShowSingleSelection(BOOL show); |
@@ -881,7 +880,7 @@ protected: | |||
881 | static void onRenamerLost( LLUICtrl* renamer, void* user_data); | 880 | static void onRenamerLost( LLUICtrl* renamer, void* user_data); |
882 | 881 | ||
883 | void finishRenamingItem( void ); | 882 | void finishRenamingItem( void ); |
884 | void revertRenamingItem( void ); | 883 | void closeRenamer( void ); |
885 | 884 | ||
886 | protected: | 885 | protected: |
887 | LLHandle<LLView> mPopupMenuHandle; | 886 | LLHandle<LLView> mPopupMenuHandle; |
@@ -910,7 +909,7 @@ protected: | |||
910 | LLFolderViewFolder* mAutoOpenCandidate; | 909 | LLFolderViewFolder* mAutoOpenCandidate; |
911 | LLFrameTimer mAutoOpenTimer; | 910 | LLFrameTimer mAutoOpenTimer; |
912 | LLFrameTimer mSearchTimer; | 911 | LLFrameTimer mSearchTimer; |
913 | LLString mSearchString; | 912 | std::string mSearchString; |
914 | LLInventoryFilter mFilter; | 913 | LLInventoryFilter mFilter; |
915 | BOOL mShowSelectionContext; | 914 | BOOL mShowSelectionContext; |
916 | BOOL mShowSingleSelection; | 915 | BOOL mShowSingleSelection; |