sbDeviceSupportsItemHelper.h
Go to the documentation of this file.
1 /*
2  *=BEGIN SONGBIRD GPL
3  *
4  * This file is part of the Songbird web player.
5  *
6  * Copyright(c) 2005-2010 POTI, Inc.
7  * http://www.songbirdnest.com
8  *
9  * This file may be licensed under the terms of of the
10  * GNU General Public License Version 2 (the ``GPL'').
11  *
12  * Software distributed under the License is distributed
13  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
14  * express or implied. See the GPL for the specific language
15  * governing rights and limitations.
16  *
17  * You should have received a copy of the GPL along with this
18  * program. If not, go to http://www.gnu.org/licenses/gpl.html
19  * or write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  *=END SONGBIRD GPL
23  */
24 
25 #ifndef SBDEVICESUPPORTSITEMHELPER_H_
26 #define SBDEVICESUPPORTSITEMHELPER_H_
27 
28 #include "sbIJobProgress.h"
29 
30 #include <nsAutoPtr.h>
31 #include <nsCOMPtr.h>
32 
34 class sbIMediaInspector;
35 class sbIMediaItem;
36 
37 class sbBaseDevice;
38 
47 {
48 public:
50  NS_DECL_SBIJOBPROGRESSLISTENER
51 
53 
54  nsresult Init(sbIMediaItem* aItem,
55  sbBaseDevice* aDevice,
57 
58  void RunSupportsMediaItem();
59 
60  nsresult InitJobProgress(sbIMediaInspector* aInspector,
61  PRUint32 aTranscodeType);
62 
63 private:
64  virtual ~sbDeviceSupportsItemHelper();
65 
66 protected:
67  nsCOMPtr<sbIMediaItem> mItem;
68  nsCOMPtr<sbIDeviceSupportsItemCallback> mCallback;
69 
70  // mDevice can't be a nsRefPtr because it's derived multiply from nsISupports
71  // and the two possibilities of AddRef confuses MSVC
73 
74  nsCOMPtr<sbIMediaInspector> mInspector;
75  PRUint32 mTranscodeType;
76 };
77 
78 #endif /* SBDEVICESUPPORTSITEMHELPER_H_ */
NS_DECL_ISUPPORTS NS_DECL_SBIJOBPROGRESSLISTENER sbDeviceSupportsItemHelper()
nsresult InitJobProgress(sbIMediaInspector *aInspector, PRUint32 aTranscodeType)
nsCOMPtr< sbIDeviceSupportsItemCallback > mCallback
nsCOMPtr< sbIMediaInspector > mInspector
nsresult Init(sbIMediaItem *aItem, sbBaseDevice *aDevice, sbIDeviceSupportsItemCallback *aCallback)
Implemented to receive notifications from sbIJobProgress interfaces.
Interface that defines a single item of media in the system.