30 #include <sbIPropertyArray.h>
31 #include <sbIPropertyManager.h>
32 #include <nsIStringBundle.h>
33 #include <nsITreeView.h>
34 #include <nsServiceManagerUtils.h>
51 const nsAString& aDisplayName,
52 const nsAString& aLocalizationKey,
53 const nsAString& aLabel,
54 const nsAString& aCompletedLabel,
55 const nsAString& aFailedLabel,
56 const PRBool aRemoteReadable,
57 const PRBool aRemoteWritable,
58 const PRBool aUserViewable,
59 const PRBool aUserEditable)
63 mDisplayName = aDisplayName;
64 mLocalizationKey = aLocalizationKey;
66 mCompletedLabel = aCompletedLabel;
67 mFailedLabel = aFailedLabel;
68 mUserViewable = aUserViewable;
69 mUserEditable = aUserEditable;
70 mRemoteReadable = aRemoteReadable;
71 mRemoteWritable = aRemoteWritable;
72 mType.AssignLiteral(
"status");
81 NS_ENSURE_SUCCESS(rv, rv);
89 sbStatusPropertyInfo::GetImageSrc(
const nsAString&
aValue,
97 sbStatusPropertyInfo::GetProgressMode(
const nsAString& aValue,
100 NS_ENSURE_ARG_POINTER(retval);
104 switch(
value.GetMode()) {
109 *retval = nsITreeView::PROGRESS_NONE;
112 *retval = nsITreeView::PROGRESS_NORMAL;
115 NS_WARNING(
"Unexpected sbStatusPropertyValue mode");
116 *retval = nsITreeView::PROGRESS_UNDETERMINED;
124 sbStatusPropertyInfo::GetCellValue(
const nsAString& aValue,
131 retval.AppendInt(
value.GetCurrent());
138 sbStatusPropertyInfo::GetRowProperties(
const nsAString& aValue,
146 sbStatusPropertyInfo::GetCellProperties(
const nsAString& aValue,
151 switch(
value.GetMode()) {
153 retval.AssignLiteral(
"progressCompleted ");
156 retval.AssignLiteral(
"progressFailed ");
162 retval.AppendLiteral(
"status");
168 sbStatusPropertyInfo::GetColumnType(nsAString& retval)
170 retval.AssignLiteral(
"progressmeter");
187 retval = mCompletedLabel;
190 retval = mFailedLabel;
NS_IMETHOD Format(const nsAString &aValue, nsAString &_retval)
NS_IMPL_ISUPPORTS_INHERITED1(sbStatusPropertyInfo, sbImmutablePropertyInfo, sbITreeViewPropertyInfo) sbStatusPropertyInfo