27 #ifndef sbWatchFolder_h_
28 #define sbWatchFolder_h_
30 #include <sbIWatchFolder.h>
31 #include <sbIFileSystemWatcher.h>
32 #include <sbIFileSystemListener.h>
33 #include <sbILibrary.h>
34 #include <sbIJobProgress.h>
35 #include <sbILibraryUtils.h>
36 #include <sbIMediaListListener.h>
39 #include <nsIComponentManager.h>
40 #include <nsIGenericFactory.h>
43 #include <nsIMutableArray.h>
44 #include <nsISupportsPrimitives.h>
45 #include <nsStringAPI.h>
47 #include <nsIIOService.h>
48 #include <nsIDOMWindow.h>
49 #include <nsUnicharUtils.h>
55 #define SB_WATCHFOLDER_CLASSNAME \
57 #define SB_WATCHFOLDER_CID \
58 {0x11ef8123, 0x666b, 0x4acc, {0xab, 0x17, 0x58, 0x7a, 0x5c, 0x44, 0xc5, 0xb9}}
60 #define SB_WATCHFOLDER_DESCRIPTION \
61 "Songbird Watch Folder"
82 NS_DECL_SBIWATCHFOLDER
83 NS_DECL_SBIFILESYSTEMLISTENER
84 NS_DECL_SBIMEDIALISTENUMERATIONLISTENER
85 NS_DECL_NSITIMERCALLBACK
86 NS_DECL_SBIJOBPROGRESSLISTENER
93 bool operator() (
const nsAString & s1,
const nsAString & s2)
const
96 return s1.Compare(s2, CaseInsensitiveCompare) < 0;
98 return s1.Compare(s2) < 0;
112 typedef std::map<nsString, ignorePathData_t, IgnoringCase>
sbStringMap;
191 nsresult
GetFilePathURI(
const nsAString & aFilePath, nsIURI **aURIRetVal);
217 PRBool *aIsIgnoredPath);
220 nsCOMPtr<sbIFileSystemWatcher> mFileSystemWatcher;
221 nsCOMPtr<sbIMediaList> mMediaList;
222 nsCOMPtr<sbILibraryUtils> mLibraryUtils;
223 nsCOMPtr<nsITimer> mEventPumpTimer;
224 nsCOMPtr<nsITimer> mChangeDelayTimer;
225 nsCOMPtr<nsITimer> mStartupDelayTimer;
226 nsCOMPtr<nsITimer> mFlushFSWatcherTimer;
227 nsCOMPtr<nsIMutableArray> mEnumeratedMediaItems;
234 nsCString mFileSystemWatcherGUID;
236 PRBool mHasWatcherStarted;
237 PRBool mShouldReinitWatcher;
238 PRBool mEventPumpTimerIsSet;
239 PRBool mShouldProcessEvents;
240 PRBool mChangeDelayTimerIsSet;
244 PRBool mShouldSynchronize;
245 nsCOMPtr<sbIDirectoryImportService> mCustomImporter;
246 nsCOMPtr<sbIMediacoreTypeSniffer> mTypeSniffer;
247 nsCOMPtr<sbIFileMetadataService> mMetadataScanner;
253 #define SB_WATCHFOLDER_CLASSNAME \
255 #define SB_WATCHFOLDER_CID \
256 {0x11ef8123, 0x666b, 0x4acc, {0xab, 0x17, 0x58, 0x7a, 0x5c, 0x44, 0xc5, 0xb9}}
258 #define SB_WATCHFOLDER_DESCRIPTION \
259 "Songbird Watch Folder"
261 #endif // sbWatchFolder_h_
sbStringSet::iterator sbStringSetIter
nsresult StartWatchingFolder()
bool operator()(const nsAString &s1, const nsAString &s2) const
nsresult HandleSessionLoadError()
nsresult GetSongbirdWindow(nsIDOMWindow **aSongbirdWindow)
NS_DECL_ISUPPORTS NS_DECL_SBIWATCHFOLDER NS_DECL_SBIFILESYSTEMLISTENER NS_DECL_SBIMEDIALISTENUMERATIONLISTENER NS_DECL_NSITIMERCALLBACK NS_DECL_SBIJOBPROGRESSLISTENER nsresult Init()
nsresult StopWatchingFolder()
nsresult ProcessEventPaths()
nsresult GetFilePathURI(const nsAString &aFilePath, nsIURI **aURIRetVal)
std::map< nsString, ignorePathData_t, IgnoringCase > sbStringMap
nsresult GetURIArrayForStringPaths(sbStringSet &aPathsSet, nsIArray **aURIs)
nsresult ProcessAddedPaths()
nsresult EnumerateItemsByPaths(sbStringSet &aPathSet)
nsresult DecrementIgnoredPathCount(const nsAString &aFilePath, PRBool *aIsIgnoredPath)
std::set< nsString > sbStringSet
nsresult SetEventPumpTimer()
nsresult HandleEventPathList(sbStringSet &aEventPathSet, EProcessType aProcessType)
Implemented to receive notifications from sbIJobProgress interfaces.
nsresult HandleRootPathMissing()
ignorePathData_t(PRInt32 aDepth, PRInt32 aCount)
restoreHistoryPrecursor aCount
nsresult SetStartupDelayTimer()
std::set< nsString, IgnoringCase > sbStringSet