27 #define SB_STRING_BUNDLE_CHROME_URL "chrome://songbird/locale/songbird.properties"
32 #include <sbIPropertyArray.h>
33 #include <sbIPropertyManager.h>
34 #include <nsIStringBundle.h>
35 #include <nsITreeView.h>
36 #include <nsServiceManagerUtils.h>
54 const nsAString& aDisplayName,
55 const nsAString& aLocalizationKey,
56 const nsAString& aLabel,
57 const nsAString& aRetryLabel,
58 const PRBool aRemoteReadable,
59 const PRBool aRemoteWritable,
60 const PRBool aUserViewable,
61 const PRBool aUserEditable)
64 mDisplayName = aDisplayName;
65 mLocalizationKey = aLocalizationKey;
67 mRetryLabel = aRetryLabel;
68 mUserViewable = aUserViewable;
69 mUserEditable = aUserEditable;
70 mRemoteReadable = aRemoteReadable;
71 mRemoteWritable = aRemoteWritable;
72 mType.AssignLiteral(
"downloadbutton");
73 mSuppressSelect = PR_TRUE;
82 NS_ENSURE_SUCCESS(rv, rv);
90 sbDownloadButtonPropertyInfo::GetImageSrc(
const nsAString&
aValue,
98 sbDownloadButtonPropertyInfo::GetProgressMode(
const nsAString& aValue,
101 NS_ENSURE_ARG_POINTER(_retval);
105 switch(
value.GetMode()) {
110 *_retval = nsITreeView::PROGRESS_NONE;
113 *_retval = nsITreeView::PROGRESS_UNDETERMINED;
117 *_retval = nsITreeView::PROGRESS_NORMAL;
125 sbDownloadButtonPropertyInfo::GetCellValue(
const nsAString& aValue,
130 switch(
value.GetMode()) {
133 if (
value.GetTotal() > 0) {
135 ((PRFloat64)
value.GetCurrent() / (PRFloat64)
value.GetTotal()) * 100;
136 _retval.AppendInt((PRUint32) progress);
147 sbDownloadButtonPropertyInfo::GetRowProperties(
const nsAString& aValue,
155 sbDownloadButtonPropertyInfo::GetCellProperties(
const nsAString& aValue,
160 switch(
value.GetMode()) {
162 _retval.AssignLiteral(
"button");
165 _retval.AssignLiteral(
"progressNotStarted");
168 _retval.AssignLiteral(
"progressCompleted");
171 _retval.AssignLiteral(
"progressPaused");
174 _retval.AssignLiteral(
"button progressFailed");
180 _retval.AppendLiteral(
" downloadbutton");
186 sbDownloadButtonPropertyInfo::GetColumnType(nsAString& _retval)
188 _retval.AssignLiteral(
"progressmeter");
195 sbDownloadButtonPropertyInfo::GetSuppressSelect(PRBool* aSuppressSelect)
197 NS_ENSURE_ARG_POINTER(aSuppressSelect);
198 *aSuppressSelect = mSuppressSelect;
203 sbDownloadButtonPropertyInfo::SetSuppressSelect(PRBool aSuppressSelect)
205 mSuppressSelect = aSuppressSelect;
210 sbDownloadButtonPropertyInfo::IsDisabled(
const nsAString& aCurrentValue,
213 NS_ENSURE_ARG_POINTER(_retval);
219 sbDownloadButtonPropertyInfo::HitTest(
const nsAString& aCurrentValue,
220 const nsAString& aPart,
227 NS_ENSURE_ARG_POINTER(_retval);
228 *_retval = aPart.EqualsLiteral(
"text");
236 sbDownloadButtonPropertyInfo::OnClick(
sbIMediaItem *aItem,
239 PRBool *_retval NS_OUTPARAM)
241 NS_ENSURE_ARG_POINTER(_retval);
247 sbDownloadButtonPropertyInfo::GetValueForClick(
const nsAString& aCurrentValue,
254 return NS_ERROR_NOT_IMPLEMENTED;
270 _retval = mRetryLabel;
The property information specific to clickable properties.