27 #ifndef sbWatchFolderService_h_
28 #define sbWatchFolderService_h_
32 #include <sbIWatchFolderService.h>
33 #include <sbIFileSystemWatcher.h>
34 #include <sbIFileSystemListener.h>
35 #include <sbILibrary.h>
36 #include <sbIJobProgress.h>
37 #include <sbILibraryUtils.h>
38 #include <sbIMediaListListener.h>
41 #include <nsIComponentManager.h>
42 #include <nsIGenericFactory.h>
45 #include <nsIMutableArray.h>
46 #include <nsISupportsPrimitives.h>
47 #include <nsStringAPI.h>
49 #include <nsIIOService.h>
50 #include <nsIDOMWindow.h>
51 #include <nsUnicharUtils.h>
65 bool operator() (
const nsAString & s1,
const nsAString & s2)
const
68 return s1.Compare(s2, CaseInsensitiveCompare) < 0;
70 return s1.Compare(s2) < 0;
95 NS_DECL_SBIWATCHFOLDERSERVICE
96 NS_DECL_SBIFILESYSTEMLISTENER
97 NS_DECL_SBIMEDIALISTENUMERATIONLISTENER
98 NS_DECL_NSITIMERCALLBACK
99 NS_DECL_SBIJOBPROGRESSLISTENER
103 static NS_METHOD
RegisterSelf(nsIComponentManager* aCompMgr,
105 const char* aLoaderStr,
107 const nsModuleComponentInfo *aInfo);
110 typedef std::set<nsString, sbStringIgnoreCaseCompare>
sbStringSet;
119 typedef std::map<nsString, ignorePathData_t, sbStringIgnoreCaseCompare>
sbStringMap;
198 nsresult
GetFilePathURI(
const nsAString & aFilePath, nsIURI **aURIRetVal);
222 PRBool *aIsIgnoredPath);
250 nsCOMPtr<sbIFileSystemWatcher> mFileSystemWatcher;
251 nsCOMPtr<sbILibrary> mMainLibrary;
252 nsCOMPtr<sbILibraryUtils> mLibraryUtils;
253 nsCOMPtr<nsITimer> mEventPumpTimer;
254 nsCOMPtr<nsITimer> mChangeDelayTimer;
255 nsCOMPtr<nsITimer> mStartupDelayTimer;
256 nsCOMPtr<nsITimer> mFlushFSWatcherTimer;
257 nsCOMPtr<nsIMutableArray> mEnumeratedMediaItems;
258 nsRefPtr<sbWatchFolderPrefMgr> mPrefMgr;
265 nsCString mFileSystemWatcherGUID;
267 PRBool mHasWatcherStarted;
268 PRBool mShouldReinitWatcher;
269 PRBool mEventPumpTimerIsSet;
270 PRBool mShouldProcessEvents;
271 PRBool mChangeDelayTimerIsSet;
275 #endif // sbWatchFolderService_h_
nsresult GetURIArrayForStringPaths(sbStringSet &aPathsSet, nsIArray **aURIs)
std::map< nsString, ignorePathData_t, sbStringIgnoreCaseCompare > sbStringMap
std::set< nsString, sbStringIgnoreCaseCompare > sbStringSet
nsresult StopWatchingFolder()
nsresult ProcessEventPaths()
nsresult OnWatchFolderPathChanged(const nsAString &aNewPath)
nsresult SetStartupDelayTimer()
nsresult HandleSessionLoadError()
nsresult OnEnableWatchFolderChanged(PRBool aShouldEnable)
nsresult ProcessAddedPaths()
nsresult GetSongbirdWindow(nsIDOMWindow **aSongbirdWindow)
nsresult EnumerateItemsByPaths(sbStringSet &aPathSet)
sbStringSet::iterator sbStringSetIter
ignorePathData_t(PRInt32 aDepth, PRInt32 aCount)
virtual ~sbWatchFolderService()
nsresult HandleEventPathList(sbStringSet &aEventPathSet, EProcessType aProcessType)
bool operator()(const nsAString &s1, const nsAString &s2) const
std::set< nsString > sbStringSet
Implemented to receive notifications from sbIJobProgress interfaces.
nsresult SetEventPumpTimer()
restoreHistoryPrecursor aCount
NS_DECL_ISUPPORTS NS_DECL_SBIWATCHFOLDERSERVICE NS_DECL_SBIFILESYSTEMLISTENER NS_DECL_SBIMEDIALISTENUMERATIONLISTENER NS_DECL_NSITIMERCALLBACK NS_DECL_SBIJOBPROGRESSLISTENER nsresult Init()
nsresult DecrementIgnoredPathCount(const nsAString &aFilePath, PRBool *aIsIgnoredPath)
static NS_METHOD RegisterSelf(nsIComponentManager *aCompMgr, nsIFile *aPath, const char *aLoaderStr, const char *aType, const nsModuleComponentInfo *aInfo)
nsresult GetFilePathURI(const nsAString &aFilePath, nsIURI **aURIRetVal)
nsresult StartWatchingFolder()
nsresult HandleRootPathMissing()