Bug 323492 r=bryner,beng Places history result node refactor, dynamic updates, performance improvements.

Original committer: brettw%gmail.com
Original revision: 1.4
Original date: 2006/01/24 01:24:15
This commit is contained in:
benjamin%smedbergs.us 2006-07-18 18:00:32 +00:00
Родитель 387e78b5ac
Коммит 1f3cb555c0
1 изменённых файлов: 29 добавлений и 4 удалений

Просмотреть файл

@ -50,15 +50,29 @@
// This class encapsulates the parameters for basic history queries for // This class encapsulates the parameters for basic history queries for
// building UI, trees, lists, etc. // building UI, trees, lists, etc.
#define NS_NAVHISTORYQUERY_IID \
{ 0xb10185e0, 0x86eb, 0x4612, { 0x95, 0x7c, 0x09, 0x34, 0xf2, 0xb1, 0xce, 0xd7 } }
class nsNavHistoryQuery : public nsINavHistoryQuery class nsNavHistoryQuery : public nsINavHistoryQuery
{ {
public: public:
nsNavHistoryQuery(); nsNavHistoryQuery();
// note: we use a copy constructor in Clone(), the default is good enough // note: we use a copy constructor in Clone(), the default is good enough
NS_DECLARE_STATIC_IID_ACCESSOR(NS_NAVHISTORYQUERY_IID)
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS
NS_DECL_NSINAVHISTORYQUERY NS_DECL_NSINAVHISTORYQUERY
PRTime BeginTime() { return mBeginTime; }
PRUint32 BeginTimeReference() { return mBeginTimeReference; }
PRTime EndTime() { return mEndTime; }
PRUint32 EndTimeReference() { return mEndTimeReference; }
const nsString& SearchTerms() { return mSearchTerms; }
PRBool OnlyBookmarked() { return mOnlyBookmarked; }
PRBool DomainIsHost() { return mDomainIsHost; }
const nsCString& Domain() { return mDomain; }
PRBool UriIsPrefix() { return mUriIsPrefix; }
nsIURI* Uri() { return mUri; } // NOT AddRef-ed!
const nsTArray<PRInt64>& Folders() const { return mFolders; } const nsTArray<PRInt64>& Folders() const { return mFolders; }
private: private:
@ -77,7 +91,6 @@ protected:
PRBool mUriIsPrefix; PRBool mUriIsPrefix;
nsCOMPtr<nsIURI> mUri; nsCOMPtr<nsIURI> mUri;
nsTArray<PRInt64> mFolders; nsTArray<PRInt64> mFolders;
PRUint32 mItemTypes;
}; };
@ -91,7 +104,9 @@ class nsNavHistoryQueryOptions : public nsINavHistoryQueryOptions
public: public:
nsNavHistoryQueryOptions() : mSort(0), mResultType(0), nsNavHistoryQueryOptions() : mSort(0), mResultType(0),
mGroupCount(0), mGroupings(nsnull), mGroupCount(0), mGroupings(nsnull),
mExpandPlaces(PR_FALSE), mExcludeItems(PR_FALSE),
mExcludeQueries(PR_FALSE),
mExpandQueries(PR_FALSE),
mForceOriginalTitle(PR_FALSE), mForceOriginalTitle(PR_FALSE),
mIncludeHidden(PR_FALSE), mIncludeHidden(PR_FALSE),
mMaxResults(0) mMaxResults(0)
@ -111,7 +126,9 @@ public:
const PRUint32* GroupingMode(PRUint32 *count) const { const PRUint32* GroupingMode(PRUint32 *count) const {
*count = mGroupCount; return mGroupings; *count = mGroupCount; return mGroupings;
} }
PRBool ExpandPlaces() const { return mExpandPlaces; } PRBool ExcludeItems() const { return mExcludeItems; }
PRBool ExcludeQueries() const { return mExcludeQueries; }
PRBool ExpandQueries() const { return mExpandQueries; }
PRBool ForceOriginalTitle() const { return mForceOriginalTitle; } PRBool ForceOriginalTitle() const { return mForceOriginalTitle; }
PRBool IncludeHidden() const { return mIncludeHidden; } PRBool IncludeHidden() const { return mIncludeHidden; }
PRUint32 MaxResults() const { return mMaxResults; } PRUint32 MaxResults() const { return mMaxResults; }
@ -123,11 +140,19 @@ private:
~nsNavHistoryQueryOptions() { delete[] mGroupings; } ~nsNavHistoryQueryOptions() { delete[] mGroupings; }
// IF YOU ADD MORE ITEMS:
// * Add a new getter for C++ above if it makes sense
// * Add to the serialization code
// * Add to the deserialization code
// * Add to the nsNavHistoryQueryOptions::Clone() function
// * Add to the nsNavHistory.cpp:IsSimpleBookmarksQuery function if applicable
PRUint32 mSort; PRUint32 mSort;
PRUint32 mResultType; PRUint32 mResultType;
PRUint32 mGroupCount; PRUint32 mGroupCount;
PRUint32 *mGroupings; PRUint32 *mGroupings;
PRBool mExpandPlaces; PRBool mExcludeItems;
PRBool mExcludeQueries;
PRBool mExpandQueries;
PRBool mForceOriginalTitle; PRBool mForceOriginalTitle;
PRBool mIncludeHidden; PRBool mIncludeHidden;
PRUint32 mMaxResults; PRUint32 mMaxResults;