sbILibraryLoader.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-2008 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 
33 #include "nsISupports.idl"
34 
35 interface sbILibrary;
36 interface sbILibraryManager;
37 
43 [scriptable, uuid(816e9cbe-e635-4abc-944f-aa4fa5ec918a)]
45 {
52  void onRegisterStartupLibraries(in sbILibraryManager aLibraryManager);
53 
63  void onLibraryStartupModified(in sbILibrary aLibrary,
64  in boolean aLoadAtStartup);
65 };
66 
67 %{C++
68 
69 #include <nsICategoryManager.h>
70 #include <nsIComponentManager.h>
71 #include <nsIFile.h>
72 
73 #include <nsCOMPtr.h>
74 #include <nsServiceManagerUtils.h>
75 #include <nsStringGlue.h>
76 #include <nsXPCOMCID.h>
77 
78 #define SB_LIBRARY_LOADER_CATEGORY "songbird-library-loader"
79 
103 #define SB_LIBRARY_LOADER_REGISTRATION(_name, _desc) \
104  \
105  NS_METHOD \
106  _name##RegisterSelf(nsIComponentManager* aCompMgr, \
107  nsIFile* aPath, \
108  const char* registryLocation, \
109  const char* componentType, \
110  const nsModuleComponentInfo* info) \
111  { \
112  nsresult rv; \
113  nsCOMPtr<nsICategoryManager> catMan = \
114  do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv); \
115  NS_ENSURE_SUCCESS(rv, rv); \
116  \
117  rv = catMan->AddCategoryEntry(SB_LIBRARY_LOADER_CATEGORY, \
118  _desc, \
119  info->mContractID, \
120  PR_TRUE, PR_TRUE, \
121  nsnull); \
122  NS_ENSURE_SUCCESS(rv, rv); \
123  \
124  return NS_OK; \
125  } \
126  \
127  NS_METHOD \
128  _name##UnregisterSelf(nsIComponentManager* aCompMgr, \
129  nsIFile* aPath, \
130  const char* registryLocation, \
131  const nsModuleComponentInfo* info) \
132  { \
133  nsresult rv; \
134  nsCOMPtr<nsICategoryManager> catMan = \
135  do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv); \
136  NS_ENSURE_SUCCESS(rv, rv); \
137  \
138  rv = catMan->DeleteCategoryEntry(SB_LIBRARY_LOADER_CATEGORY, \
139  _desc, \
140  PR_FALSE); \
141  NS_ENSURE_SUCCESS(rv, rv); \
142  \
143  return NS_OK; \
144  }
145 %}
var uuid
function C(H)
Manages the lifecycle of libraries in the system.
void onRegisterStartupLibraries(in sbILibraryManager aLibraryManager)
Called when the loader sohould register all startup libraries with the Library Manager.
Media library abstraction.
Definition: sbILibrary.idl:82
[USER CODE SHOULD NOT REFERENCE THIS CLASS]
void onLibraryStartupModified(in sbILibrary aLibrary, in boolean aLoadAtStartup)
Called when a user action has altered the startup status of one of the libraries controlled by this l...