LLInventoryFilter migrated into llinventoryfilter.cpp/h
This commit is contained in:
@@ -55,6 +55,7 @@
|
||||
#include "llviewertexture.h"
|
||||
#include "lldepthstack.h"
|
||||
#include "lltooldraganddrop.h"
|
||||
#include "llinventoryfilter.h"
|
||||
|
||||
class LLMenuGL;
|
||||
|
||||
@@ -74,7 +75,6 @@ class LLFolderViewFunctor;
|
||||
class LLScrollableContainerView;
|
||||
class LLFolderViewEventListener;
|
||||
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Class LLFolderViewListenerFunctor
|
||||
//
|
||||
@@ -102,117 +102,7 @@ class LLFolderViewItem;
|
||||
class LLFolderViewFolder;
|
||||
|
||||
|
||||
class LLInventoryFilter
|
||||
{
|
||||
public:
|
||||
typedef enum e_folder_show
|
||||
{
|
||||
SHOW_ALL_FOLDERS,
|
||||
SHOW_NON_EMPTY_FOLDERS,
|
||||
SHOW_NO_FOLDERS
|
||||
} EFolderShow;
|
||||
|
||||
typedef enum e_filter_behavior
|
||||
{
|
||||
FILTER_NONE, // nothing to do, already filtered
|
||||
FILTER_RESTART, // restart filtering from scratch
|
||||
FILTER_LESS_RESTRICTIVE, // existing filtered items will certainly pass this filter
|
||||
FILTER_MORE_RESTRICTIVE // if you didn't pass the previous filter, you definitely won't pass this one
|
||||
} EFilterBehavior;
|
||||
|
||||
static const U32 SO_DATE = 1;
|
||||
static const U32 SO_FOLDERS_BY_NAME = 2;
|
||||
static const U32 SO_SYSTEM_FOLDERS_TO_TOP = 4;
|
||||
|
||||
LLInventoryFilter(const std::string& name);
|
||||
virtual ~LLInventoryFilter();
|
||||
|
||||
void setFilterTypes(U32 types);
|
||||
U32 getFilterTypes() const { return mFilterOps.mFilterTypes; }
|
||||
|
||||
void setFilterSubString(const std::string& string);
|
||||
const std::string getFilterSubString(BOOL trim = FALSE);
|
||||
|
||||
void setFilterWorn(bool worn) { mFilterWorn = worn; }
|
||||
bool getFilterWorn() const { return mFilterWorn; }
|
||||
|
||||
void setFilterPermissions(PermissionMask perms);
|
||||
PermissionMask getFilterPermissions() const { return mFilterOps.mPermissions; }
|
||||
|
||||
void setDateRange(time_t min_date, time_t max_date);
|
||||
void setDateRangeLastLogoff(BOOL sl);
|
||||
time_t getMinDate() const { return mFilterOps.mMinDate; }
|
||||
time_t getMaxDate() const { return mFilterOps.mMaxDate; }
|
||||
|
||||
void setHoursAgo(U32 hours);
|
||||
U32 getHoursAgo() const { return mFilterOps.mHoursAgo; }
|
||||
|
||||
void setShowFolderState( EFolderShow state);
|
||||
EFolderShow getShowFolderState() { return mFilterOps.mShowFolderState; }
|
||||
|
||||
void setSortOrder(U32 order);
|
||||
U32 getSortOrder() { return mOrder; }
|
||||
|
||||
BOOL check(LLFolderViewItem* item);
|
||||
std::string::size_type getStringMatchOffset() const;
|
||||
BOOL isActive();
|
||||
BOOL isNotDefault();
|
||||
BOOL isModified();
|
||||
BOOL isModifiedAndClear();
|
||||
BOOL isSinceLogoff();
|
||||
void clearModified() { mModified = FALSE; mFilterBehavior = FILTER_NONE; }
|
||||
const std::string getName() const { return mName; }
|
||||
std::string getFilterText();
|
||||
|
||||
void setFilterCount(S32 count) { mFilterCount = count; }
|
||||
S32 getFilterCount() { return mFilterCount; }
|
||||
void decrementFilterCount() { mFilterCount--; }
|
||||
|
||||
void markDefault();
|
||||
void resetDefault();
|
||||
|
||||
BOOL isFilterWith(LLInventoryType::EType t);
|
||||
|
||||
S32 getCurrentGeneration() const { return mFilterGeneration; }
|
||||
S32 getMinRequiredGeneration() const { return mMinRequiredGeneration; }
|
||||
S32 getMustPassGeneration() const { return mMustPassGeneration; }
|
||||
|
||||
//RN: this is public to allow system to externally force a global refilter
|
||||
void setModified(EFilterBehavior behavior = FILTER_RESTART);
|
||||
|
||||
void toLLSD(LLSD& data);
|
||||
void fromLLSD(LLSD& data);
|
||||
|
||||
protected:
|
||||
struct filter_ops
|
||||
{
|
||||
U32 mFilterTypes;
|
||||
time_t mMinDate;
|
||||
time_t mMaxDate;
|
||||
U32 mHoursAgo;
|
||||
EFolderShow mShowFolderState;
|
||||
PermissionMask mPermissions;
|
||||
};
|
||||
filter_ops mFilterOps;
|
||||
filter_ops mDefaultFilterOps;
|
||||
std::string::size_type mSubStringMatchOffset;
|
||||
std::string mFilterSubString;
|
||||
bool mFilterWorn;
|
||||
U32 mOrder;
|
||||
const std::string mName;
|
||||
S32 mFilterGeneration;
|
||||
S32 mMustPassGeneration;
|
||||
S32 mMinRequiredGeneration;
|
||||
S32 mFilterCount;
|
||||
S32 mNextFilterGeneration;
|
||||
EFilterBehavior mFilterBehavior;
|
||||
|
||||
private:
|
||||
U32 mLastLogoff;
|
||||
BOOL mModified;
|
||||
BOOL mNeedTextRebuild;
|
||||
std::string mFilterText;
|
||||
};
|
||||
|
||||
// These are grouping of inventory types.
|
||||
// Order matters when sorting system folders to the top.
|
||||
|
||||
Reference in New Issue
Block a user