sbWatchFolder Class Reference

#include <sbWatchFolder.h>

Inheritance diagram for sbWatchFolder:
[legend]
Collaboration diagram for sbWatchFolder:
[legend]

Classes

struct  ignorePathData_t
 
struct  IgnoringCase
 

Public Member Functions

 sbWatchFolder ()
 
virtual ~sbWatchFolder ()
 
NS_DECL_ISUPPORTS
NS_DECL_SBIWATCHFOLDER
NS_DECL_SBIFILESYSTEMLISTENER
NS_DECL_SBIMEDIALISTENUMERATIONLISTENER
NS_DECL_NSITIMERCALLBACK
NS_DECL_SBIJOBPROGRESSLISTENER
nsresult 
Init ()
 
- Public Member Functions inherited from sbIWatchFolder
void addIgnorePath (in AString aFilePath)
 Add a absolute file path to be ignored by the watch folder service. This path will be ignored until it is removed via a call to |removeIgnorePath()|. Each call to |addIgnorePath()| should be balanced by a call to |removeIgnorePath()|. When used in conjunction with |addIgnoreCount()|, the count will be decremented as normal when the path is ignored. The path will continue to be ignored when the count reaches zero. More...
 
void removeIgnorePath (in AString aFilePath)
 Remove an absolute file path from the ignored paths list of the watch folder service. All future events at the specified path will be processed by the watch folders service. When used in conjunction with |addIgnoreCount()|, any remaining events specified by the count will still be ignored. More...
 
void addIgnoreCount (in AString aFilePath, in long aCount)
 Add an absolute file path to be ignore by the watch folder service. This path will be ignored for the given number of events, which includes file addition, deletion, or change. When used in conjunction with |addIgnorePath()| and |removeIgnorPath()|, the counter will be decremented as events are ignored. The path may continue to be ignored after the count reaches zero if any calls to |addIgnorePath()| are not balanced by calls to |removeIgnorePath()|. More...
 
void start (in ACString aSessionGuid)
 Starts watching. More...
 
ACString stop ()
 Stops watching. More...
 
void setFolder (in AString aPath, in boolean aSynchronizeMediaList)
 
- Public Member Functions inherited from sbIFileSystemListener
void onWatcherStarted ()
 
void onWatcherStopped ()
 
void onWatcherError (in unsigned long aErrorType, in AString aDescription)
 
void onFileSystemChanged (in AString aFilePath)
 
void onFileSystemRemoved (in AString aFilePath)
 
void onFileSystemAdded (in AString aFilePath)
 
- Public Member Functions inherited from sbIMediaListEnumerationListener
unsigned short onEnumerationBegin (in sbIMediaList aMediaList)
 Called when enumeration is about to begin. More...
 
unsigned short onEnumeratedItem (in sbIMediaList aMediaList, in sbIMediaItem aMediaItem)
 Called once for each item in the enumeration. More...
 
void onEnumerationEnd (in sbIMediaList aMediaList, in nsresult aStatusCode)
 Called when enumeration has completed. More...
 
- Public Member Functions inherited from sbIJobProgressListener
void onJobProgress (in sbIJobProgress aJobProgress)
 Notification that an object implementing sbIJobProgress has changed. More...
 

Protected Types

enum  EProcessType { eNone = 0, eRemoval = 1, eChanged = 2, eMoveOrRename = 3 }
 
enum  EWatchFolderState { eNotSupported = 0, eDisabled = 1, eStarted = 2, eWatching = 3 }
 
typedef std::set< nsString,
IgnoringCase
sbStringSet
 
typedef sbStringSet::iterator sbStringSetIter
 
typedef std::map< nsString,
ignorePathData_t, IgnoringCase
sbStringMap
 

Protected Member Functions

nsresult InitInternal ()
 
nsresult StartWatchingFolder ()
 
nsresult StopWatchingFolder ()
 
nsresult SetStartupDelayTimer ()
 
nsresult SetEventPumpTimer ()
 
nsresult ProcessEventPaths ()
 
nsresult HandleEventPathList (sbStringSet &aEventPathSet, EProcessType aProcessType)
 
nsresult ProcessAddedPaths ()
 
nsresult EnumerateItemsByPaths (sbStringSet &aPathSet)
 
nsresult GetURIArrayForStringPaths (sbStringSet &aPathsSet, nsIArray **aURIs)
 
nsresult GetFilePathURI (const nsAString &aFilePath, nsIURI **aURIRetVal)
 
nsresult GetSongbirdWindow (nsIDOMWindow **aSongbirdWindow)
 
nsresult HandleSessionLoadError ()
 
nsresult Rescan ()
 
nsresult HandleRootPathMissing ()
 
nsresult DecrementIgnoredPathCount (const nsAString &aFilePath, PRBool *aIsIgnoredPath)
 

Additional Inherited Members

- Public Attributes inherited from sbIWatchFolder
attribute sbIMediaList mediaList
 
readonly attribute AString path
 
attribute sbIDirectoryImportService importer
 
attribute sbIMediacoreTypeSniffer typeSniffer
 
attribute sbIFileMetadataService metadataScanner
 
attribute boolean canInteract
 
readonly attribute boolean isSupported
 
readonly attribute boolean isRunning
 
- Public Attributes inherited from sbIFileSystemListener
const unsigned long ROOT_PATH_MISSING = 0
 
const unsigned long INVALID_DIRECTORY = 1
 
const unsigned long SESSION_LOAD_ERROR = 2
 
- Public Attributes inherited from sbIMediaListEnumerationListener
const unsigned short CONTINUE = 0
 
const unsigned short CANCEL = 1
 

Detailed Description

Definition at line 71 of file sbWatchFolder.h.

Member Typedef Documentation

typedef std::map<nsString, ignorePathData_t, IgnoringCase> sbWatchFolder::sbStringMap
protected

Definition at line 112 of file sbWatchFolder.h.

typedef std::set<nsString, IgnoringCase> sbWatchFolder::sbStringSet
protected

Definition at line 103 of file sbWatchFolder.h.

typedef sbStringSet::iterator sbWatchFolder::sbStringSetIter
protected

Definition at line 104 of file sbWatchFolder.h.

Member Enumeration Documentation

Enumerator
eNone 
eRemoval 
eChanged 
eMoveOrRename 

Definition at line 114 of file sbWatchFolder.h.

Enumerator
eNotSupported 
eDisabled 
eStarted 
eWatching 

Definition at line 121 of file sbWatchFolder.h.

Constructor & Destructor Documentation

sbWatchFolder::sbWatchFolder ( )
sbWatchFolder::~sbWatchFolder ( )
virtual

Definition at line 84 of file sbWatchFolder.cpp.

Member Function Documentation

nsresult sbWatchFolder::DecrementIgnoredPathCount ( const nsAString &  aFilePath,
PRBool *  aIsIgnoredPath 
)
protected

Definition at line 687 of file sbWatchFolder.cpp.

nsresult sbWatchFolder::EnumerateItemsByPaths ( sbStringSet aPathSet)
protected

Definition at line 462 of file sbWatchFolder.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbWatchFolder::GetFilePathURI ( const nsAString &  aFilePath,
nsIURI **  aURIRetVal 
)
protected

Definition at line 444 of file sbWatchFolder.cpp.

Here is the caller graph for this function:

nsresult sbWatchFolder::GetSongbirdWindow ( nsIDOMWindow **  aSongbirdWindow)
protected

Definition at line 504 of file sbWatchFolder.cpp.

Here is the caller graph for this function:

nsresult sbWatchFolder::GetURIArrayForStringPaths ( sbStringSet aPathsSet,
nsIArray **  aURIs 
)
protected

Definition at line 400 of file sbWatchFolder.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbWatchFolder::HandleEventPathList ( sbStringSet aEventPathSet,
EProcessType  aProcessType 
)
protected

Definition at line 326 of file sbWatchFolder.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbWatchFolder::HandleRootPathMissing ( )
protected

Definition at line 650 of file sbWatchFolder.cpp.

Here is the call graph for this function:

nsresult sbWatchFolder::HandleSessionLoadError ( )
protected

Definition at line 517 of file sbWatchFolder.cpp.

Here is the call graph for this function:

nsresult sbWatchFolder::Init ( )

Definition at line 89 of file sbWatchFolder.cpp.

nsresult sbWatchFolder::InitInternal ( )
protected

Definition at line 136 of file sbWatchFolder.cpp.

Here is the call graph for this function:

nsresult sbWatchFolder::ProcessAddedPaths ( )
protected

Definition at line 346 of file sbWatchFolder.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbWatchFolder::ProcessEventPaths ( )
protected

Definition at line 294 of file sbWatchFolder.cpp.

Here is the call graph for this function:

nsresult sbWatchFolder::Rescan ( )
protected

Definition at line 587 of file sbWatchFolder.cpp.

Here is the caller graph for this function:

nsresult sbWatchFolder::SetEventPumpTimer ( )
protected

Definition at line 266 of file sbWatchFolder.cpp.

nsresult sbWatchFolder::SetStartupDelayTimer ( )
protected

Definition at line 249 of file sbWatchFolder.cpp.

nsresult sbWatchFolder::StartWatchingFolder ( )
protected

Definition at line 169 of file sbWatchFolder.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbWatchFolder::StopWatchingFolder ( )
protected

Definition at line 217 of file sbWatchFolder.cpp.


The documentation for this class was generated from the following files: