31 #include <nsIClassInfoImpl.h>
32 #include <nsIProgrammingLanguage.h>
33 #include <sbIMediaItem.h>
34 #include <sbIMediaList.h>
36 #include <nsIMutableArray.h>
65 sbPropertyChange::sbPropertyChange()
71 sbPropertyChange::~sbPropertyChange()
77 const nsAString &aOldValue,
78 const nsAString &aNewValue)
113 NS_IMETHODIMP sbPropertyChange::GetOperation(PRUint32 *aOperation)
115 NS_ENSURE_ARG_POINTER(aOperation);
122 NS_IMETHODIMP sbPropertyChange::GetId(nsAString & aId)
130 NS_IMETHODIMP sbPropertyChange::GetOldValue(nsAString & aOldValue)
138 NS_IMETHODIMP sbPropertyChange::GetNewValue(nsAString & aNewValue)
152 NS_INTERFACE_MAP_BEGIN(sbLibraryChange)
153 NS_IMPL_QUERY_CLASSINFO(sbLibraryChange)
156 if ( aIID.Equals(NS_GET_IID(sbLibraryChange)) )
170 sbLibraryChange::sbLibraryChange()
176 sbLibraryChange::~sbLibraryChange()
185 nsIArray *aProperties,
186 nsIArray *aListItems)
221 NS_ENSURE_ARG_POINTER(aSourceItem);
231 NS_ENSURE_ARG_POINTER(aProperties);
239 NS_IMETHODIMP sbLibraryChange::GetOperation(PRUint32 *aOperation)
241 NS_ENSURE_ARG_POINTER(aOperation);
249 NS_IMETHODIMP sbLibraryChange::GetTimestamp(PRUint64 *aTimestamp)
251 NS_ENSURE_ARG_POINTER(aTimestamp);
259 NS_IMETHODIMP sbLibraryChange::GetSourceItem(
sbIMediaItem * *aItem)
261 NS_ENSURE_ARG_POINTER(aItem);
264 return *aItem ?
NS_OK : NS_ERROR_NOT_AVAILABLE;
268 NS_IMETHODIMP sbLibraryChange::GetDestinationItem(
sbIMediaItem * *aItem)
270 NS_ENSURE_ARG_POINTER(aItem);
274 return *aItem ?
NS_OK : NS_ERROR_NOT_AVAILABLE;
278 NS_IMETHODIMP sbLibraryChange::GetItemIsList(PRBool *aItemIsList)
280 NS_ENSURE_ARG_POINTER(aItemIsList);
284 nsCOMPtr<sbIMediaList> mediaList;
292 if(rv == NS_ERROR_NO_INTERFACE) {
293 *aItemIsList = PR_FALSE;
296 else if(mediaList != 0) {
297 *aItemIsList = PR_TRUE;
301 return NS_ERROR_UNEXPECTED;
305 NS_IMETHODIMP sbLibraryChange::GetListItems(nsIArray **aListItems)
307 NS_ENSURE_ARG_POINTER(aListItems);
310 nsresult rv = GetItemIsList(&isList);
311 NS_ENSURE_SUCCESS(rv, rv);
314 return NS_ERROR_FAILURE;
322 NS_IMETHODIMP sbLibraryChange::GetProperties(nsIArray * *aProperties)
324 NS_ENSURE_ARG_POINTER(aProperties);
328 return *aProperties ?
NS_OK : NS_ERROR_NOT_AVAILABLE;
339 NS_INTERFACE_MAP_BEGIN(sbLibraryChangeset)
340 NS_IMPL_QUERY_CLASSINFO(sbLibraryChangeset)
343 if ( aIID.Equals(NS_GET_IID(sbLibraryChangeset)) )
356 sbLibraryChangeset::sbLibraryChangeset()
360 sbLibraryChangeset::~sbLibraryChangeset()
368 NS_ENSURE_ARG_POINTER(aSourceLists);
369 NS_ENSURE_ARG_POINTER(aDestinationList);
370 NS_ENSURE_ARG_POINTER(aChanges);
382 NS_ENSURE_ARG_POINTER(aSourceLists);
391 NS_ENSURE_ARG_POINTER(aDestinationList);
398 NS_IMETHODIMP sbLibraryChangeset::SetChanges(nsIArray *aChanges)
400 NS_ENSURE_ARG_POINTER(aChanges);
408 NS_IMETHODIMP sbLibraryChangeset::GetSourceLists(nsIArray * *aSourceLists)
410 NS_ENSURE_ARG_POINTER(aSourceLists);
414 return *aSourceLists ?
NS_OK : NS_ERROR_NOT_AVAILABLE;
418 NS_IMETHODIMP sbLibraryChangeset::GetDestinationList(
sbIMediaList * *aDestinationList)
420 NS_ENSURE_ARG_POINTER(aDestinationList);
424 return *aDestinationList ?
NS_OK : NS_ERROR_NOT_AVAILABLE;
428 NS_IMETHODIMP sbLibraryChangeset::GetChanges(nsIArray * *aChanges)
430 NS_ENSURE_ARG_POINTER(aChanges);
434 return *aChanges ?
NS_OK : NS_ERROR_NOT_AVAILABLE;
nsresult SetOldValue(const nsAString &aOldValue)
nsresult SetOperation(PRUint32 aOperation)
nsCOMPtr< nsIArray > mProperties
else NS_INTERFACE_MAP_END NS_IMPL_CI_INTERFACE_GETTER2(sbPropertyChange, sbIPropertyChange, sbIChangeOperation) sbPropertyChange
sbLibraryChangeset Definition.
nsCOMPtr< nsIArray > mChanges
nsresult SetID(const nsAString &aID)
NS_IMPL_THREADSAFE_RELEASE(sbRequestItem)
NS_IMPL_THREADSAFE_ADDREF(sbRequestItem)
NS_DEFINE_STATIC_IID_ACCESSOR(sbPropertyChange,{0x2cb3d75f, 0xfd37, 0x4ae0,{0xa7, 0xf1, 0xe8, 0x5c, 0x7b, 0xb9, 0xd1, 0x7b}}) class sbLibraryChange nsresult InitWithValues(PRUint32 aOperation, PRUint64 aTimestamp, sbIMediaItem *aSourceItem, sbIMediaItem *aDestinationItem, nsIArray *aProperties, nsIArray *aListItems)
nsresult SetItems(sbIMediaItem *aSourceItem, sbIMediaItem *aDestinationItem)
nsCOMPtr< sbIMediaItem > mSourceItem
nsresult SetListItems(nsIArray *aProperties)
nsresult SetNewValue(const nsAString &aNewValue)
nsresult SetSourceLists(nsIArray *aSourceLists)
nsCOMPtr< sbIMediaList > mDestinationList
nsCOMPtr< nsIArray > mSourceLists
nsresult InitWithValues(PRUint32 aOperation, const nsAString &aID, const nsAString &aOldValue, const nsAString &aNewValue)
nsresult SetOperation(PRUint32 aOperation)
else NS_INTERFACE_MAP_END NS_IMPL_CI_INTERFACE_GETTER1(sbLibraryChangeset, sbILibraryChangeset) sbLibraryChangeset
nsCOMPtr< nsIMutableArray > mListItems
nsresult SetTimestamp(PRUint64 aTimestamp)
nsresult SetProperties(nsIArray *aProperties)
nsresult SetDestinationList(sbIMediaList *aDestinationList)
nsCOMPtr< sbIMediaItem > mDestinationItem
if(aIID.Equals(NS_GET_IID(sbPropertyChange))) foundInterface