30 #include <nsAutoPtr.h>
32 #include <sbIPropertyArray.h>
33 #include <sbIPropertyManager.h>
34 #include <nsIStringBundle.h>
48 NS_ENSURE_SUCCESS(rv, rv);
51 NS_ENSURE_SUCCESS(rv, rv);
53 rv = SetDisplayNameKey(NS_LITERAL_STRING(
"property.download_button"));
54 NS_ENSURE_SUCCESS(rv, rv);
56 rv = SetLabelKey(NS_LITERAL_STRING(
"property.download_button"));
57 NS_ENSURE_SUCCESS(rv, rv);
59 rv = SetRetryLabelKey(NS_LITERAL_STRING(
"property.download_button_retry"));
60 NS_ENSURE_SUCCESS(rv, rv);
68 NS_ENSURE_ARG_POINTER(_retval);
73 NS_ENSURE_SUCCESS(rv, rv);
76 if (!mLabelKey.IsEmpty()) {
78 NS_ENSURE_SUCCESS(rv, rv);
85 if (!mRetryLabelKey.IsEmpty()) {
87 NS_ENSURE_SUCCESS(rv, rv);
90 retryLabel = mRetryLabel;
93 nsRefPtr<sbDownloadButtonPropertyInfo> pi =
103 NS_ENSURE_TRUE(pi, NS_ERROR_OUT_OF_MEMORY);
106 NS_ENSURE_SUCCESS(rv, rv);
108 NS_ADDREF(*_retval = pi);
113 sbDownloadButtonPropertyBuilder::GetLabel(nsAString& aLabel)
119 sbDownloadButtonPropertyBuilder::SetLabel(
const nsAString& aLabel)
126 sbDownloadButtonPropertyBuilder::GetRetryLabel(nsAString& aRetryLabel)
128 aRetryLabel = mRetryLabel;
132 sbDownloadButtonPropertyBuilder::SetRetryLabel(
const nsAString& aRetryLabel)
134 mRetryLabel = aRetryLabel;
139 sbDownloadButtonPropertyBuilder::GetLabelKey(nsAString& aLabelKey)
141 aLabelKey = mLabelKey;
145 sbDownloadButtonPropertyBuilder::SetLabelKey(
const nsAString& aLabelKey)
147 mLabelKey = aLabelKey;
152 sbDownloadButtonPropertyBuilder::GetRetryLabelKey(nsAString& aRetryLabelKey)
154 aRetryLabelKey = mRetryLabelKey;
158 sbDownloadButtonPropertyBuilder::SetRetryLabelKey(
const nsAString& aRetryLabelKey)
160 mRetryLabelKey = aRetryLabelKey;
attribute AString displayName
PRPackedBool mUserEditable
nsresult GetFinalDisplayName(nsAString &aDisplayName)
nsCOMPtr< nsIStringBundle > mBundle
PRPackedBool mRemoteReadable
An interface used to describe a metadata property for use by the UI and other sbILibrary interfaces (...
PRPackedBool mUserViewable
#define SB_PROPERTY_DOWNLOADBUTTON
PRPackedBool mRemoteWritable
static nsresult GetStringFromName(nsIStringBundle *aBundle, const nsAString &aName, nsAString &_retval)