25 #ifndef __SBLOCALDATABASEMEDIALISTBASE_H__
26 #define __SBLOCALDATABASEMEDIALISTBASE_H__
30 #include <nsIClassInfo.h>
31 #include <nsIStringEnumerator.h>
32 #include <sbILocalDatabaseGUIDArray.h>
33 #include <sbIMediaList.h>
35 #include <nsClassHashtable.h>
37 #include <nsStringGlue.h>
39 #include <nsTHashtable.h>
44 #define SB_CONTINUE_IF_FALSE(_expr) \
47 NS_WARNING("SB_CONTINUE_IF_FALSE triggered"); \
52 #define SB_CONTINUE_IF_FAILED(_rv) \
53 SB_CONTINUE_IF_FALSE(NS_SUCCEEDED(_rv))
57 #define SB_MEDIALIST_LOCK_FULLARRAY_AND_ENSURE_MUTABLE() \
59 nsAutoMonitor mon(mFullArrayMonitor); \
60 if (mLockedEnumerationActive) { \
61 NS_ERROR("Operation not permitted during a locked enumeration"); \
62 return NS_ERROR_FAILURE; \
66 #define SB_ASYNC_NOTIFICATION_ITEMS 50
69 class nsIMutableArray;
71 class nsStringHashKey;
86 typedef nsClassHashtable<nsStringHashKey, sbStringArray> sbStringArrayHash;
89 NS_DECL_ISUPPORTS_INHERITED
98 virtual ~sbLocalDatabaseMediaListBase();
101 const nsAString& aGuid,
102 PRBool aOwnsLibrary = PR_TRUE);
107 NS_ASSERTION(mFullArray,
"mArray is null!");
112 PRBool aOwnsWeak = PR_FALSE,
113 PRUint32 aFlags = 0) {
114 return AddListener(aListener, aOwnsWeak, aFlags, nsnull);
152 const nsAString & aProperty);
156 static PLDHashOperator PR_CALLBACK
157 AddFilterToGUIDArrayCallback(nsStringHashKey::KeyType aKey,
163 nsresult EnumerateItemsByPropertyInternal(
const nsAString& aID,
169 nsresult EnumerateItemsByPropertiesInternal(sbStringArrayHash* aPropertiesHash,
195 nsCOMPtr<sbILocalDatabaseGUIDArray> mFullArray;
222 static void*
operator new(
size_t ) CPP_THROW_NEW;
223 static void operator delete(
void* );
232 NS_DECL_NSISTRINGENUMERATOR
239 nsCOMPtr<sbILocalDatabaseGUIDArray> mArray;
NS_DECL_ISUPPORTS NS_DECL_NSISTRINGENUMERATOR sbGUIDArrayValueEnumerator(sbILocalDatabaseGUIDArray *aArray)
nsTArray< nsString > sbStringArray
[USER CODE SHOULD NOT REFERENCE THIS CLASS]
Simple class to make sure we notify listeners that a batch operation has completed every time they ar...
An interface to carry around arrays of nsIProperty instances Note that implementations of the interfa...
[USER CODE SHOULD NOT REFERENCE THIS CLASS]
An object responsible for executing SQL queries on the database.
~sbGUIDArrayValueEnumerator()
An interface to carry around arrays of nsIProperty instances. Users of this interface should only QI ...
sbAutoBatchHelper(sbLocalDatabaseMediaListBase &aList)