sbTranscodeProfileLoader.h
Go to the documentation of this file.
1 /* vim: set sw=2 : */
2 /*
3 //
4 // BEGIN SONGBIRD GPL
5 //
6 // This file is part of the Songbird web player.
7 //
8 // Copyright(c) 2005-2009 POTI, Inc.
9 // http://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 
28 #ifndef __SB_TRANSCODEPROFILELOADER_H__
29 #define __SB_TRANSCODEPROFILELOADER_H__
30 
31 #include <sbITranscodeProfile.h>
32 
33 #include <nsIRunnable.h>
34 
35 #include <nsAutoPtr.h>
36 #include <nsCOMPtr.h>
37 
38 // forward declarations
39 class nsIDOMElement;
40 class nsIDOMNode;
41 class nsIDOMParser;
42 class nsIFile;
43 class sbTranscodeProfile;
44 
46  public nsIRunnable
47 {
48 public:
50  NS_DECL_SBITRANSCODEPROFILELOADER
51  NS_DECL_NSIRUNNABLE
52 
54 
55 private:
56  ~sbTranscodeProfileLoader();
57 
58 protected:
63  };
64 
70  nsresult LoadProfileInternal();
71 
78  nsresult GetType(nsIDOMNode* aTypeNode, PRUint32* _retval);
84  nsresult ProcessProperty(nsIDOMElement* aPropertyElement,
85  sbITranscodeProfileProperty** _retval);
91  nsresult ProcessAttribute(nsIDOMElement* aAttributeElement,
99  nsresult ProcessContainer(sbTranscodeProfile* aProfile,
100  ContainerType_t aContainerType,
101  nsIDOMElement* aContainer);
102 
107  nsCOMPtr<nsIFile> mFile;
108 
113  nsRefPtr<sbTranscodeProfile> mProfile;
114 
118  nsresult mResult;
119 };
120 
121 #define SONGBIRD_TRANSCODEPROFILELOADER_CLASSNAME \
122  "Songbird transcoding profile loader service"
123 #define SONGBIRD_TRANSCODEPROFILELOADER_CID \
124  /* {C64F3BC9-263F-4c2a-8E4C-C6BFBD9AE1F0} */ \
125  { 0xc64f3bc9, 0x263f, 0x4c2a, \
126  { 0x8e, 0x4c, 0xc6, 0xbf, 0xbd, 0x9a, 0xe1, 0xf0 } }
127 #define SONGBIRD_TRANSCODEPROFILELOADER_CONTRACTID \
128  "@songbirdnest.com/Songbird/Transcode/ProfileLoader;1"
129 
130 #endif /* __SB_TRANSCODEPROFILELOADER_H__ */
nsRefPtr< sbTranscodeProfile > mProfile
nsresult GetType(nsIDOMNode *aTypeNode, PRUint32 *_retval)
nsresult ProcessProperty(nsIDOMElement *aPropertyElement, sbITranscodeProfileProperty **_retval)
An object that can create an sbITranscodeProfile from an XML description file.
NS_DECL_ISUPPORTS NS_DECL_SBITRANSCODEPROFILELOADER NS_DECL_NSIRUNNABLE sbTranscodeProfileLoader()
nsresult ProcessAttribute(nsIDOMElement *aAttributeElement, sbITranscodeProfileAttribute **_retval)
nsresult ProcessContainer(sbTranscodeProfile *aProfile, ContainerType_t aContainerType, nsIDOMElement *aContainer)