sbWindowsFormatter.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-2009 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_WINDOWS_FORMATTER_H__
28 #define __SB_WINDOWS_FORMATTER_H__
29 
30 //------------------------------------------------------------------------------
31 //------------------------------------------------------------------------------
32 //
33 // Songbird Windows formatter services defs.
34 //
35 //------------------------------------------------------------------------------
36 //------------------------------------------------------------------------------
37 
43 //------------------------------------------------------------------------------
44 //
45 // Songbird Windows formatter imported services.
46 //
47 //------------------------------------------------------------------------------
48 
49 // Local imports.
50 #include "sbIWindowsFormatter.h"
51 
52 // Windows imports.
53 #include <rpcsal.h>
54 
55 #include <vds.h>
56 
57 #include <sbautoCOMInitializer.h>
58 
59 //------------------------------------------------------------------------------
60 //
61 // Songbird Windows formatter classes.
62 //
63 //------------------------------------------------------------------------------
64 
70 class sbWindowsFormatter : public sbIWindowsFormatter
71 {
72  //----------------------------------------------------------------------------
73  //
74  // Public interface.
75  //
76  //----------------------------------------------------------------------------
77 
78 public:
79 
80  //
81  // IUnknown implementation.
82  //
83 
84  STDMETHOD_(ULONG, AddRef)();
85 
86  STDMETHOD_(ULONG, Release)();
87 
88  STDMETHOD(QueryInterface)(REFIID aIID,
89  void** aInterface);
90 
91 
92  //
93  // sbIWindowsFormatter
94  //
95 
96  STDMETHOD(Format)(BSTR aVolumeName,
97  unsigned long aType,
98  BSTR aLabel,
99  DWORD aUnitAllocationSize,
100  long aForce,
101  long aQuickFormat,
102  long aEnableCompression);
103 
104 
105  //
106  // Public services.
107  //
108 
115  static HRESULT New(sbWindowsFormatter** aWindowsFormatter);
116 
120  virtual ~sbWindowsFormatter();
121 
122 
123  //----------------------------------------------------------------------------
124  //
125  // Private interface.
126  //
127  //----------------------------------------------------------------------------
128 
129 private:
130 
131  //
132  // mRefCount Object reference count.
133  // mVdsService VDS service object.
134  //
135 
136  ULONG mRefCount;
137  IVdsService* mVdsService;
138  sbAutoCOMInitializer mAutoCOMInitializer;
139 
140  //
141  // Private services.
142  //
143 
148 
152  HRESULT Initialize();
153 
164  HRESULT GetVolume(BSTR aVolumeName,
165  IVdsVolumeMF** aVolume);
166 
179  HRESULT GetVolume(IVdsSwProvider* aSwProvider,
180  BSTR aVolumeName,
181  IVdsVolumeMF** aVolume);
182 
195  HRESULT GetVolume(IVdsPack* aPack,
196  BSTR aVolumeName,
197  IVdsVolumeMF** aVolume);
198 };
199 
200 
201 #endif // __SB_WINDOWS_FORMATTER_H__
202 
STDMETHOD() Format(BSTR aVolumeName, unsigned long aType, BSTR aLabel, DWORD aUnitAllocationSize, long aForce, long aQuickFormat, long aEnableCompression)
STDMETHOD() QueryInterface(REFIID aIID, void **aInterface)
STDMETHOD_(ULONG, AddRef)()
static HRESULT New(sbWindowsFormatter **aWindowsFormatter)