Songbird / Development / Songbird Add-Ons API Documentation

components/library/base/public/sbILibraryLoader.idl

Go to the documentation of this file.
00001 /*
00002 //
00003 // BEGIN SONGBIRD GPL
00004 //
00005 // This file is part of the Songbird web player.
00006 //
00007 // Copyright(c) 2005-2008 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 
00033 #include "nsISupports.idl"
00034 
00035 interface sbILibrary;
00036 interface sbILibraryManager;
00037 
00043 [scriptable, uuid(816e9cbe-e635-4abc-944f-aa4fa5ec918a)]
00044 interface sbILibraryLoader : nsISupports
00045 {
00052   void onRegisterStartupLibraries(in sbILibraryManager aLibraryManager);
00053 
00063   void onLibraryStartupModified(in sbILibrary aLibrary,
00064                                 in boolean aLoadAtStartup);
00065 };
00066 
00067 %{C++
00068 
00069 #include <nsICategoryManager.h>
00070 #include <nsIComponentManager.h>
00071 #include <nsIFile.h>
00072 
00073 #include <nsCOMPtr.h>
00074 #include <nsServiceManagerUtils.h>
00075 #include <nsStringGlue.h>
00076 #include <nsXPCOMCID.h>
00077 
00078 #define SB_LIBRARY_LOADER_CATEGORY "songbird-library-loader"
00079 
00103 #define SB_LIBRARY_LOADER_REGISTRATION(_name, _desc)                           \
00104                                                                                \
00105   NS_METHOD                                                                    \
00106   _name##RegisterSelf(nsIComponentManager* aCompMgr,                           \
00107                       nsIFile* aPath,                                          \
00108                       const char* registryLocation,                            \
00109                       const char* componentType,                               \
00110                       const nsModuleComponentInfo* info)                       \
00111   {                                                                            \
00112     nsresult rv;                                                               \
00113     nsCOMPtr<nsICategoryManager> catMan =                                      \
00114       do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);                       \
00115     NS_ENSURE_SUCCESS(rv, rv);                                                 \
00116                                                                                \
00117     rv = catMan->AddCategoryEntry(SB_LIBRARY_LOADER_CATEGORY,                  \
00118                                   _desc,                                       \
00119                                   info->mContractID,                           \
00120                                   PR_TRUE, PR_TRUE,                            \
00121                                   nsnull);                                     \
00122     NS_ENSURE_SUCCESS(rv, rv);                                                 \
00123                                                                                \
00124     return NS_OK;                                                              \
00125   }                                                                            \
00126                                                                                \
00127   NS_METHOD                                                                    \
00128   _name##UnregisterSelf(nsIComponentManager* aCompMgr,                         \
00129                         nsIFile* aPath,                                        \
00130                         const char* registryLocation,                          \
00131                         const nsModuleComponentInfo* info)                     \
00132   {                                                                            \
00133     nsresult rv;                                                               \
00134     nsCOMPtr<nsICategoryManager> catMan =                                      \
00135       do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);                       \
00136     NS_ENSURE_SUCCESS(rv, rv);                                                 \
00137                                                                                \
00138     rv = catMan->DeleteCategoryEntry(SB_LIBRARY_LOADER_CATEGORY,               \
00139                                      _desc,                                    \
00140                                      PR_FALSE);                                \
00141     NS_ENSURE_SUCCESS(rv, rv);                                                 \
00142                                                                                \
00143     return NS_OK;                                                              \
00144   }
00145 %}

Generated on Tue Mar 10 14:28:55 2009 for Songbird by  doxygen 1.5.2