sbIFileSystemListener.idl
Go to the documentation of this file.
1 /*
2 //
3 // BEGIN SONGBIRD GPL
4 //
5 // This file is part of the Songbird web player.
6 //
7 // Copyright(c) 2005-2009 POTI, Inc.
8 // http://songbirdnest.com
9 //
10 // This file may be licensed under the terms of of the
11 // GNU General Public License Version 2 (the "GPL").
12 //
13 // Software distributed under the License is distributed
14 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
15 // express or implied. See the GPL for the specific language
16 // governing rights and limitations.
17 //
18 // You should have received a copy of the GPL along with this
19 // program. If not, go to http://www.gnu.org/licenses/gpl.html
20 // or write to the Free Software Foundation, Inc.,
21 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 //
23 // END SONGBIRD GPL
24 //
25 */
26 
27 #include "nsISupports.idl"
28 
29 //
30 // \brief Listener interface for objects that want to listen to file system
31 // events. Pass in an instance of this interface when creating a
32 // |sbIFileSystemWatcher| instance.
33 //
34 [scriptable, uuid(44cec493-c59e-45ca-bc9f-b053e17a519f)]
36 {
37  //
38  // \brief Watcher Error Types
39  //
40  // ROOT_PATH_MISSING - The root watch path is missing
41  // NOTE: This event is posted when the root watch path is missing. Posting
42  // can happen before startup or after. Once the watcher notices
43  // that the root watch path is missing, it will automatically stop
44  // watching and notify via |onWatcherStopped()|.
45  //
46  // INVALID_DIRECTORY - A directory was encountered that could not be watched.
47  // NOTE: This event is posted when the native file-system event hooks
48  // cannot add a hook for a specified directory. Check the
49  // |aDescription| field to find what the invalid directory is.
50  //
51  // SESSION_LOAD_ERROR - The watcher could not load a saved session.
52  // NOTE: If a listener receives this callback, the watcher should be
53  // re-initialized via |init()| in order to receive callbacks
54  // about changes to the watched path.
55  //
56  const unsigned long ROOT_PATH_MISSING = 0;
57  const unsigned long INVALID_DIRECTORY = 1;
58  const unsigned long SESSION_LOAD_ERROR = 2;
59 
60  //
61  // \brief Callback when the |sbIFileSystemWatcher| has initialized and has
62  // started listening to events.
63  //
64  void onWatcherStarted();
65 
66  //
67  // \brief Callback when the |sbIFileSystemWatcher| has stopped listening
68  // to file system events.
69  //
70  void onWatcherStopped();
71 
72  //
73  // \brief Callback when the watcher has encountered an error.
74  // \param aErrorType The error type the watcher encountered.
75  // SEE: The constants defined above.
76  // \param aDescription Additional information about the received error.
77  //
78  void onWatcherError(in unsigned long aErrorType,
79  in AString aDescription);
80 
81  //
82  // \brief Callback when something has change in the filesystem.
83  // \param aFilePath The event path of the file change.
84  //
85  void onFileSystemChanged(in AString aFilePath);
86 
87  //
88  // \brief Callback when something was removed in the filesystem.
89  // \param aFilePath The event path of the file removal.
90  //
91  void onFileSystemRemoved(in AString aFilePath);
92 
93  //
94  // \brief Callback when something was added in the filesystem.
95  // \param aFilePath The event path of the file addition.
96  //
97  void onFileSystemAdded(in AString aFilePath);
98 };
99 
void onWatcherError(in unsigned long aErrorType, in AString aDescription)
void onFileSystemChanged(in AString aFilePath)
var uuid
const unsigned long INVALID_DIRECTORY
void onFileSystemRemoved(in AString aFilePath)
const unsigned long ROOT_PATH_MISSING
void onFileSystemAdded(in AString aFilePath)
const unsigned long SESSION_LOAD_ERROR