sbMediaItemDownloadService.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set sw=2 :miv */
3 /*
4  *=BEGIN SONGBIRD GPL
5  *
6  * This file is part of the Songbird web player.
7  *
8  * Copyright(c) 2005-2010 POTI, Inc.
9  * http://www.songbirdnest.com
10  *
11  * This file may be licensed under the terms of of the
12  * GNU General Public License Version 2 (the ``GPL'').
13  *
14  * Software distributed under the License is distributed
15  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
16  * express or implied. See the GPL for the specific language
17  * governing rights and limitations.
18  *
19  * You should have received a copy of the GPL along with this
20  * program. If not, go to http://www.gnu.org/licenses/gpl.html
21  * or write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23  *
24  *=END SONGBIRD GPL
25  */
26 
27 #ifndef SB_MEDIA_ITEM_DOWNLOAD_SERVICE_H_
28 #define SB_MEDIA_ITEM_DOWNLOAD_SERVICE_H_
29 
30 //------------------------------------------------------------------------------
31 //------------------------------------------------------------------------------
32 //
33 // Songbird media item download service defs.
34 //
35 //------------------------------------------------------------------------------
36 //------------------------------------------------------------------------------
37 
43 //------------------------------------------------------------------------------
44 //
45 // Songbird media item download service imported services.
46 //
47 //------------------------------------------------------------------------------
48 
49 // Songbird imports.
50 #include <sbIMediaItemDownloadService.h>
51 #include <sbIServiceManager.h>
52 
53 // Mozilla imports.
54 #include <nsCOMPtr.h>
55 #include <nsIGenericFactory.h>
56 #include <nsIObserver.h>
57 #include <nsTArray.h>
58 
59 
60 //------------------------------------------------------------------------------
61 //
62 // Songbird media item download service definitions.
63 //
64 //------------------------------------------------------------------------------
65 
66 //
67 // Songbird media item download service XPCOM component definitions.
68 //
69 
70 #define SB_MEDIA_ITEM_DOWNLOAD_SERVICE_CLASSNAME "sbMediaItemDownloadService"
71 #define SB_MEDIA_ITEM_DOWNLOAD_SERVICE_DESCRIPTION \
72  "Songbird Media Item Download Service"
73 #define SB_MEDIA_ITEM_DOWNLOAD_SERVICE_CID \
74 { \
75  0x35443420, \
76  0x1dd2, \
77  0x11b2, \
78  { 0x8d, 0x65, 0xfe, 0xf3, 0x91, 0x81, 0x82, 0xcf } \
79 }
80 
81 
82 //------------------------------------------------------------------------------
83 //
84 // Songbird media item download service classes.
85 //
86 //------------------------------------------------------------------------------
87 
95  public nsIObserver
96 {
97  //----------------------------------------------------------------------------
98  //
99  // Public interface.
100  //
101  //----------------------------------------------------------------------------
102 
103 public:
104 
105  //
106  // XPCOM interfaces.
107  //
108 
110  NS_DECL_SBIMEDIAITEMDOWNLOADSERVICE
111  NS_DECL_NSIOBSERVER
112 
113 
114  //
115  // Public services.
116  //
117 
122 
126  virtual ~sbMediaItemDownloadService();
127 
131  static NS_METHOD RegisterSelf(nsIComponentManager* aCompMgr,
132  nsIFile* aPath,
133  const char* aLoaderStr,
134  const char* aType,
135  const nsModuleComponentInfo* aInfo);
136 
140  static NS_METHOD UnregisterSelf(nsIComponentManager* aCompMgr,
141  nsIFile* aPath,
142  const char* aLoaderStr,
143  const nsModuleComponentInfo* aInfo);
144 
145 
146  //----------------------------------------------------------------------------
147  //
148  // Private interface.
149  //
150  //----------------------------------------------------------------------------
151 
152 private:
153 
154  //
155  // mInitialized True if initialized.
156  // mServiceManager Songbird service manager object.
157  // mDownloaderList List of media item downloaders.
158  //
159 
160  PRBool mInitialized;
161  nsCOMPtr<sbIServiceManager> mServiceManager;
162  nsTArray< nsCOMPtr<sbIMediaItemDownloader> >
163  mDownloaderList;
164 
165 
169  nsresult Initialize();
170 
174  void Finalize();
175 };
176 
177 #endif // SB_MEDIA_ITEM_DOWNLOAD_SERVICE_H_
178 
_updateCookies aPath
static NS_METHOD RegisterSelf(nsIComponentManager *aCompMgr, nsIFile *aPath, const char *aLoaderStr, const char *aType, const nsModuleComponentInfo *aInfo)
NS_DECL_ISUPPORTS NS_DECL_SBIMEDIAITEMDOWNLOADSERVICE NS_DECL_NSIOBSERVER sbMediaItemDownloadService()
static NS_METHOD UnregisterSelf(nsIComponentManager *aCompMgr, nsIFile *aPath, const char *aLoaderStr, const nsModuleComponentInfo *aInfo)