sbWatchFolderService Class Reference

#include <sbWatchFolderService.h>

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

Classes

struct  ignorePathData_t
 

Public Member Functions

 sbWatchFolderService ()
 
virtual ~sbWatchFolderService ()
 
NS_DECL_ISUPPORTS
NS_DECL_SBIWATCHFOLDERSERVICE
NS_DECL_SBIFILESYSTEMLISTENER
NS_DECL_SBIMEDIALISTENUMERATIONLISTENER
NS_DECL_NSITIMERCALLBACK
NS_DECL_SBIJOBPROGRESSLISTENER
nsresult 
Init ()
 
- Public Member Functions inherited from sbIWatchFolderService
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...
 
- 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...
 

Static Public Member Functions

static NS_METHOD RegisterSelf (nsIComponentManager *aCompMgr, nsIFile *aPath, const char *aLoaderStr, const char *aType, const nsModuleComponentInfo *aInfo)
 

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,
sbStringIgnoreCaseCompare
sbStringSet
 
typedef sbStringSet::iterator sbStringSetIter
 
typedef std::map< nsString,
ignorePathData_t,
sbStringIgnoreCaseCompare
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 HandleRootPathMissing ()
 
nsresult DecrementIgnoredPathCount (const nsAString &aFilePath, PRBool *aIsIgnoredPath)
 
nsresult OnAppStartup ()
 
nsresult OnAppShutdown ()
 
nsresult OnWatchFolderPathChanged (const nsAString &aNewPath)
 
nsresult OnEnableWatchFolderChanged (PRBool aShouldEnable)
 

Friends

class sbWatchFolderPrefMgr
 

Additional Inherited Members

- Public Attributes inherited from sbIWatchFolderService
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 82 of file sbWatchFolderService.h.

Member Typedef Documentation

Definition at line 119 of file sbWatchFolderService.h.

typedef std::set<nsString, sbStringIgnoreCaseCompare> sbWatchFolderService::sbStringSet
protected

Definition at line 110 of file sbWatchFolderService.h.

typedef sbStringSet::iterator sbWatchFolderService::sbStringSetIter
protected

Definition at line 111 of file sbWatchFolderService.h.

Member Enumeration Documentation

Enumerator
eNone 
eRemoval 
eChanged 
eMoveOrRename 

Definition at line 121 of file sbWatchFolderService.h.

Enumerator
eNotSupported 
eDisabled 
eStarted 
eWatching 

Definition at line 128 of file sbWatchFolderService.h.

Constructor & Destructor Documentation

sbWatchFolderService::sbWatchFolderService ( )
sbWatchFolderService::~sbWatchFolderService ( )
virtual

Definition at line 86 of file sbWatchFolderService.cpp.

Member Function Documentation

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

Definition at line 709 of file sbWatchFolderService.cpp.

nsresult sbWatchFolderService::EnumerateItemsByPaths ( sbStringSet aPathSet)
protected

Definition at line 502 of file sbWatchFolderService.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 484 of file sbWatchFolderService.cpp.

Here is the caller graph for this function:

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

Definition at line 544 of file sbWatchFolderService.cpp.

Here is the caller graph for this function:

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

Definition at line 440 of file sbWatchFolderService.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 372 of file sbWatchFolderService.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbWatchFolderService::HandleRootPathMissing ( )
protected

Definition at line 670 of file sbWatchFolderService.cpp.

Here is the call graph for this function:

nsresult sbWatchFolderService::HandleSessionLoadError ( )
protected

Definition at line 557 of file sbWatchFolderService.cpp.

Here is the call graph for this function:

nsresult sbWatchFolderService::Init ( )

Definition at line 91 of file sbWatchFolderService.cpp.

nsresult sbWatchFolderService::InitInternal ( )
protected

Definition at line 141 of file sbWatchFolderService.cpp.

Here is the call graph for this function:

nsresult sbWatchFolderService::OnAppShutdown ( )
protected

Definition at line 740 of file sbWatchFolderService.cpp.

Here is the call graph for this function:

nsresult sbWatchFolderService::OnAppStartup ( )
protected

Definition at line 731 of file sbWatchFolderService.cpp.

Here is the call graph for this function:

nsresult sbWatchFolderService::OnEnableWatchFolderChanged ( PRBool  aShouldEnable)
protected

Definition at line 851 of file sbWatchFolderService.cpp.

Here is the call graph for this function:

nsresult sbWatchFolderService::OnWatchFolderPathChanged ( const nsAString &  aNewPath)
protected

Definition at line 764 of file sbWatchFolderService.cpp.

Here is the call graph for this function:

nsresult sbWatchFolderService::ProcessAddedPaths ( )
protected

Definition at line 392 of file sbWatchFolderService.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbWatchFolderService::ProcessEventPaths ( )
protected

Definition at line 340 of file sbWatchFolderService.cpp.

Here is the call graph for this function:

NS_METHOD sbWatchFolderService::RegisterSelf ( nsIComponentManager *  aCompMgr,
nsIFile *  aPath,
const char *  aLoaderStr,
const char *  aType,
const nsModuleComponentInfo *  aInfo 
)
static

Definition at line 1372 of file sbWatchFolderService.cpp.

nsresult sbWatchFolderService::SetEventPumpTimer ( )
protected

Definition at line 312 of file sbWatchFolderService.cpp.

nsresult sbWatchFolderService::SetStartupDelayTimer ( )
protected

Definition at line 295 of file sbWatchFolderService.cpp.

Here is the caller graph for this function:

nsresult sbWatchFolderService::StartWatchingFolder ( )
protected

Definition at line 217 of file sbWatchFolderService.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbWatchFolderService::StopWatchingFolder ( )
protected

Definition at line 255 of file sbWatchFolderService.cpp.

Here is the caller graph for this function:

Friends And Related Function Documentation

friend class sbWatchFolderPrefMgr
friend

Definition at line 88 of file sbWatchFolderService.h.


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