summaryrefslogtreecommitdiff
path: root/indra/newview/llpersonmodelcommon.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpersonmodelcommon.h')
-rw-r--r--indra/newview/llpersonmodelcommon.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h
index 866d863581..f3454df53f 100644
--- a/indra/newview/llpersonmodelcommon.h
+++ b/indra/newview/llpersonmodelcommon.h
@@ -127,6 +127,79 @@ private:
};
+//Below code is just copied and adjusted from llconversationmodel.h, will need to investigate further
+
+class LLPersonViewFilter : public LLFolderViewFilter
+{
+public:
+
+ enum ESortOrderType
+ {
+ SO_NAME = 0, // Sort by name
+ SO_DATE = 0x1, // Sort by date (most recent)
+ SO_SESSION_TYPE = 0x2, // Sort by type (valid only for sessions)
+ SO_DISTANCE = 0x3, // Sort by distance (valid only for participants in nearby chat)
+ };
+ // Default sort order is by type for sessions and by date for participants
+ static const U32 SO_DEFAULT = (SO_SESSION_TYPE << 16) | (SO_DATE);
+
+ LLPersonViewFilter() { mEmpty = ""; }
+ ~LLPersonViewFilter() {}
+
+ bool check(const LLFolderViewModelItem* item) { return true; }
+ bool checkFolder(const LLFolderViewModelItem* folder) const { return true; }
+ void setEmptyLookupMessage(const std::string& message) { }
+ std::string getEmptyLookupMessage() const { return mEmpty; }
+ bool showAllResults() const { return true; }
+ std::string::size_type getStringMatchOffset(LLFolderViewModelItem* item) const { return std::string::npos; }
+ std::string::size_type getFilterStringSize() const { return 0; }
+
+ bool isActive() const { return false; }
+ bool isModified() const { return false; }
+ void clearModified() { }
+ const std::string& getName() const { return mEmpty; }
+ const std::string& getFilterText() { return mEmpty; }
+ void setModified(EFilterModified behavior = FILTER_RESTART) { }
+
+ void setFilterCount(S32 count) { }
+ S32 getFilterCount() const { return 0; }
+ void decrementFilterCount() { }
+
+ bool isDefault() const { return true; }
+ bool isNotDefault() const { return false; }
+ void markDefault() { }
+ void resetDefault() { }
+
+ S32 getCurrentGeneration() const { return 0; }
+ S32 getFirstSuccessGeneration() const { return 0; }
+ S32 getFirstRequiredGeneration() const { return 0; }
+private:
+ std::string mEmpty;
+};
+
+class LLPersonViewSort
+{
+public:
+ LLPersonViewSort(U32 order = LLPersonViewFilter::SO_DEFAULT) : mSortOrder(order) { }
+
+ bool operator()(const LLPersonModelCommon* const& a, const LLPersonModelCommon* const& b) const {return false;}
+ operator U32() const { return mSortOrder; }
+private:
+ // Note: we're treating this value as a sort order bitmask as done in other places in the code (e.g. inventory)
+ U32 mSortOrder;
+};
+
+
+class LLPersonFolderViewModel
+ : public LLFolderViewModel<LLPersonViewSort, LLPersonModelCommon, LLPersonModelCommon, LLPersonViewFilter>
+{
+public:
+ typedef LLFolderViewModel<LLPersonViewSort, LLPersonModelCommon, LLPersonModelCommon, LLPersonViewFilter> base_t;
+
+ void sort(LLFolderViewFolder* folder) { base_t::sort(folder);}
+ bool startDrag(std::vector<LLFolderViewModelItem*>& items) { return false; } // We do not allow drag of conversation items
+};
+
#endif // LL_LLPERSONMODELCOMMON_H