27 #ifndef __SB_IPD_MARSHALL_H__
28 #define __SB_IPD_MARSHALL_H__
51 #include <sbIDeviceManager.h>
52 #include <sbIDeviceRegistrar.h>
56 #include <nsAutoLock.h>
57 #include <nsAutoPtr.h>
58 #include <nsClassHashtable.h>
59 #include <nsIClassInfo.h>
60 #include <nsInterfaceHashtable.h>
73 #define SB_IPDMARSHALL_CONTRACTID "@songbirdnest.com/Songbird/IPDMarshall;1"
74 #define SB_IPDMARSHALL_CLASSNAME "iPod Device Marshall"
75 #define SB_IPDMARSHALL_DESCRIPTION "iPod Device Marshall"
76 #define SB_IPDMARSHALL_CID \
81 { 0xae, 0x2b, 0x0f, 0xed, 0xb9, 0x47, 0xdf, 0x37 } \
112 NS_DECL_SBIDEVICEMARSHALL
146 nsCOMPtr<sbIDeviceManager2> mDeviceManager;
147 nsCOMPtr<sbIDeviceRegistrar> mDeviceRegistrar;
148 nsInterfaceHashtable<nsCStringHashKey, nsISupports>
150 nsClassHashtable<nsCStringHashKey, nsCString>
151 mDeviceMediaPartitionTable;
159 nsresult EventInitialize();
161 void EventFinalize();
163 static void HandleLibHalDevicePropertyModified(LibHalContext* aLibHalCtx,
164 const char* aDeviceUDI,
166 dbus_bool_t aIsRemoved,
167 dbus_bool_t aIsAdded);
169 void HandleLibHalDevicePropertyModified(nsACString& aDeviceUDI,
171 dbus_bool_t aIsRemoved,
172 dbus_bool_t aIsAdded);
174 static void HandleLibHalDeviceRemoved(LibHalContext* aLibHalCtx,
175 const char* aDeviceUDI);
177 void HandleLibHalDeviceRemoved(nsACString& aDeviceUDI);
179 void HandleAddedEvent(
const nsACString& aDeviceUDI,
180 const nsACString& aMediaPartitionUDI);
182 void HandleRemovedEvent(
const nsACString& aDeviceUDI,
183 const nsACString& aMediaPartitionUDI);
190 nsresult Initialize();
194 nsresult ScanForConnectedDevices();
196 nsresult ProbeDev(nsACString &aDeviceUDI);
198 PRBool IsIPod(nsACString& aDeviceUDI);
200 PRBool IsMediaPartition(nsACString& aDeviceUDI);
NS_DECL_ISUPPORTS NS_DECL_SBIDEVICEMARSHALL NS_DECL_NSICLASSINFO sbIPDMarshall()