sbMetadataAlbumArtFetcher.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 //
5 // BEGIN SONGBIRD GPL
6 //
7 // This file is part of the Songbird web player.
8 //
9 // Copyright(c) 2005-2008 POTI, Inc.
10 // http://songbirdnest.com
11 //
12 // This file may be licensed under the terms of of the
13 // GNU General Public License Version 2 (the "GPL").
14 //
15 // Software distributed under the License is distributed
16 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
17 // express or implied. See the GPL for the specific language
18 // governing rights and limitations.
19 //
20 // You should have received a copy of the GPL along with this
21 // program. If not, go to http://www.gnu.org/licenses/gpl.html
22 // or write to the Free Software Foundation, Inc.,
23 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 //
25 // END SONGBIRD GPL
26 //
27 */
28 
29 #ifndef __SB_METADATAALBUMARTFETCHER_H__
30 #define __SB_METADATAALBUMARTFETCHER_H__
31 
32 //------------------------------------------------------------------------------
33 //------------------------------------------------------------------------------
34 //
35 // Songbird metadata album art fetcher.
36 //
37 //------------------------------------------------------------------------------
38 //------------------------------------------------------------------------------
39 
45 //------------------------------------------------------------------------------
46 //
47 // Songbird metadata album art fetcher imported services.
48 //
49 //------------------------------------------------------------------------------
50 
51 // Songbird imports.
52 #include <sbIAlbumArtFetcher.h>
53 #include <sbIAlbumArtService.h>
54 #include <sbIMetadataManager.h>
55 
56 // Mozilla imports.
57 #include <nsCOMPtr.h>
58 #include <nsIPrefBranch.h>
59 
60 
61 //------------------------------------------------------------------------------
62 //
63 // Songbird metadata album art fetcher defs.
64 //
65 //------------------------------------------------------------------------------
66 
67 //
68 // Songbird metadata album art fetcher component defs.
69 //
70 
71 #define SB_METADATAALBUMARTFETCHER_CLASSNAME "sbMetadataAlbumArtFetcher"
72 #define SB_METADATAALBUMARTFETCHER_CID \
73  /* {61f7f510-abef-4b04-9ebf-078976f1bef1} */ \
74  { \
75  0x61f7f510, \
76  0xabef, \
77  0x4b04, \
78  { 0x9e, 0xbf, 0x07, 0x89, 0x76, 0xf1, 0xbe, 0xf1 } \
79  }
80 
81 
82 //------------------------------------------------------------------------------
83 //
84 // Songbird metadata album art fetcher classes.
85 //
86 //------------------------------------------------------------------------------
87 
93 {
94  //----------------------------------------------------------------------------
95  //
96  // Public interface.
97  //
98  //----------------------------------------------------------------------------
99 
100 public:
101 
102  //
103  // Inherited interfaces.
104  //
105 
107  NS_DECL_SBIALBUMARTFETCHER
108 
109 
110  //
111  // Public services.
112  //
113 
115 
116  virtual ~sbMetadataAlbumArtFetcher();
117 
118  nsresult Initialize();
119 
120 
121  //----------------------------------------------------------------------------
122  //
123  // Private interface.
124  //
125  //----------------------------------------------------------------------------
126 
127 private:
128 
129  //
130  // mPrefService Preference service to get prefs.
131  // mAlbumArtService Album art service.
132  // mAlbumArtSourceList List of album art sources.
133  //
134 
135  nsCOMPtr<nsIPrefBranch> mPrefService;
136  nsCOMPtr<sbIAlbumArtService> mAlbumArtService;
137  nsCOMPtr<nsIArray> mAlbumArtSourceList;
138 
139 
140  //
141  // Internal services.
142  //
143 
144  nsresult GetMetadataHandler(nsIURI* aContentSrcURI,
145  nsIArray* aSourceList,
146  sbIMetadataManager* aManager,
147  sbIMetadataHandler** aMetadataHandler);
148 
149  nsresult GetImageForItem(sbIMediaItem* aMediaItem,
150  nsIArray* aSourceList,
151  sbIMetadataManager* aManager,
152  sbIAlbumArtListener* aListener);
153 };
154 
155 
156 #endif // __SB_METADATAALBUMARTFETCHER_H__
157 
NS_DECL_ISUPPORTS NS_DECL_SBIALBUMARTFETCHER sbMetadataAlbumArtFetcher()
The manager from which to request a metadata handler.
A component which is interested in the result of an album art fetch request.
An object capable of manipulating the metadata tags for a media file.
Interface that defines a single item of media in the system.
Interface for an album art fetcher. Instantiate as a component instance.