00001 /* 00002 // 00003 // BEGIN SONGBIRD GPL 00004 // 00005 // This file is part of the Songbird web player. 00006 // 00007 // Copyright(c) 2005-2009 POTI, Inc. 00008 // http://songbirdnest.com 00009 // 00010 // This file may be licensed under the terms of of the 00011 // GNU General Public License Version 2 (the "GPL"). 00012 // 00013 // Software distributed under the License is distributed 00014 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 00015 // express or implied. See the GPL for the specific language 00016 // governing rights and limitations. 00017 // 00018 // You should have received a copy of the GPL along with this 00019 // program. If not, go to http://www.gnu.org/licenses/gpl.html 00020 // or write to the Free Software Foundation, Inc., 00021 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00022 // 00023 // END SONGBIRD GPL 00024 // 00025 */ 00026 00027 #include "nsISupports.idl" 00028 00029 // 00030 // \brief Listener interface for objects that want to listen to file system 00031 // events. Pass in an instance of this interface when creating a 00032 // |sbIFileSystemWatcher| instance. 00033 // 00034 [scriptable, uuid(44cec493-c59e-45ca-bc9f-b053e17a519f)] 00035 interface sbIFileSystemListener : nsISupports 00036 { 00037 // 00038 // \brief Watcher Error Types 00039 // 00040 // ROOT_PATH_MISSING - The root watch path is missing 00041 // NOTE: This event is posted when the root watch path is missing. Posting 00042 // can happen before startup or after. Once the watcher notices 00043 // that the root watch path is missing, it will automatically stop 00044 // watching and notify via |onWatcherStopped()|. 00045 // 00046 // INVALID_DIRECTORY - A directory was encountered that could not be watched. 00047 // NOTE: This event is posted when the native file-system event hooks 00048 // cannot add a hook for a specified directory. Check the 00049 // |aDescription| field to find what the invalid directory is. 00050 // 00051 // SESSION_LOAD_ERROR - The watcher could not load a saved session. 00052 // NOTE: If a listener receives this callback, the watcher should be 00053 // re-initialized via |init()| in order to receive callbacks 00054 // about changes to the watched path. 00055 // 00056 const unsigned long ROOT_PATH_MISSING = 0; 00057 const unsigned long INVALID_DIRECTORY = 1; 00058 const unsigned long SESSION_LOAD_ERROR = 2; 00059 00060 // 00061 // \brief Callback when the |sbIFileSystemWatcher| has initialized and has 00062 // started listening to events. 00063 // 00064 void onWatcherStarted(); 00065 00066 // 00067 // \brief Callback when the |sbIFileSystemWatcher| has stopped listening 00068 // to file system events. 00069 // 00070 void onWatcherStopped(); 00071 00072 // 00073 // \brief Callback when the watcher has encountered an error. 00074 // \param aErrorType The error type the watcher encountered. 00075 // SEE: The constants defined above. 00076 // \param aDescription Additional information about the received error. 00077 // 00078 void onWatcherError(in unsigned long aErrorType, 00079 in AString aDescription); 00080 00081 // 00082 // \brief Callback when something has change in the filesystem. 00083 // \param aFilePath The event path of the file change. 00084 // 00085 void onFileSystemChanged(in AString aFilePath); 00086 00087 // 00088 // \brief Callback when something was removed in the filesystem. 00089 // \param aFilePath The event path of the file removal. 00090 // 00091 void onFileSystemRemoved(in AString aFilePath); 00092 00093 // 00094 // \brief Callback when something was added in the filesystem. 00095 // \param aFilePath The event path of the file addition. 00096 // 00097 void onFileSystemAdded(in AString aFilePath); 00098 }; 00099