27 #ifndef __SBLOCALDATABASELIBRARYFACTORY_H__
28 #define __SBLOCALDATABASELIBRARYFACTORY_H__
30 #include <sbIDatabaseQuery.h>
31 #include <sbILibraryFactory.h>
34 #include <nsHashKeys.h>
35 #include <nsInterfaceHashtable.h>
36 #include <nsIGenericFactory.h>
37 #include <nsStringGlue.h>
39 #define SB_LOCALDATABASE_LIBRARYFACTORY_TYPE \
40 SB_LOCALDATABASE_LIBRARYFACTORY_DESCRIPTION
44 class nsIPropertyBag2;
45 class nsIWeakReference;
52 NS_DECL_SBILIBRARYFACTORY
54 static NS_METHOD
RegisterSelf(nsIComponentManager* aCompMgr,
56 const char* aLoaderStr,
58 const nsModuleComponentInfo *aInfo);
60 already_AddRefed<nsILocalFile>
GetFileForGUID(
const nsAString& aGUID);
66 nsIPropertyBag2* aCreationParameters = nsnull,
67 nsString aResourceGUID = EmptyString());
72 nsresult InitalizeLibrary(nsIFile* aDatabaseFile,
const nsAString &aResourceGUID);
74 nsresult UpdateLibrary(nsIFile* aDatabaseFile);
77 nsIFile* aDatabaseFile);
80 nsInterfaceHashtable<nsHashableHashKey, nsIWeakReference> mCreatedLibraries;
void GetGUIDFromFile(nsILocalFile *aFile, nsAString &aGUID)
Factory for new library instances.
already_AddRefed< nsILocalFile > GetFileForGUID(const nsAString &aGUID)
Media library abstraction.
NS_DECL_ISUPPORTS static NS_DECL_SBILIBRARYFACTORY NS_METHOD RegisterSelf(nsIComponentManager *aCompMgr, nsIFile *aPath, const char *aLoaderStr, const char *aType, const nsModuleComponentInfo *aInfo)
An object responsible for executing SQL queries on the database.
nsresult CreateLibraryFromDatabase(nsIFile *aDatabase, sbILibrary **_retval, nsIPropertyBag2 *aCreationParameters=nsnull, nsString aResourceGUID=EmptyString())