29 #include <nsAutoPtr.h>
31 #include <nsServiceManagerUtils.h>
33 #include <sbIPropertyArray.h>
34 #include <sbIPropertyManager.h>
35 #include <nsIStringBundle.h>
45 mUserViewable(PR_FALSE),
46 mUserEditable(PR_TRUE),
47 mRemoteReadable(PR_FALSE),
48 mRemoteWritable(PR_FALSE)
56 rv =
CreateBundle(
"chrome://songbird/locale/songbird.properties",
58 NS_ENSURE_SUCCESS(rv, rv);
68 NS_ENSURE_SUCCESS(rv, rv);
79 const nsAString&
aName,
82 NS_ENSURE_ARG_POINTER(aBundle);
85 nsresult rv = aBundle->GetStringFromName(aName.BeginReading(),
86 getter_Copies(value));
87 if (NS_SUCCEEDED(rv)) {
92 char*
message = PR_smprintf(
"sbPropertyManager: '%s' not found in bundle",
93 NS_LossyConvertUTF16toASCII(aName).
get());
95 PR_smprintf_free(message);
105 nsIStringBundle** _retval)
107 NS_ENSURE_ARG_POINTER(aURLSpec);
108 NS_ENSURE_ARG_POINTER(_retval);
111 nsCOMPtr<nsIStringBundleService> stringBundleService =
112 do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
113 NS_ENSURE_SUCCESS(rv, rv);
115 nsCOMPtr<nsIStringBundle> stringBundle;
116 rv = stringBundleService->CreateBundle(aURLSpec, _retval);
117 NS_ENSURE_SUCCESS(rv, rv);
125 return NS_ERROR_NOT_IMPLEMENTED;
129 sbAbstractPropertyBuilder::GetPropertyID(nsAString& aPropertyID)
135 sbAbstractPropertyBuilder::SetPropertyID(
const nsAString& aPropertyID)
142 sbAbstractPropertyBuilder::GetDisplayName(nsAString& aDisplayName)
148 sbAbstractPropertyBuilder::SetDisplayName(
const nsAString& aDisplayName)
155 sbAbstractPropertyBuilder::GetDisplayNameKey(nsAString& aDisplayNameKey)
161 sbAbstractPropertyBuilder::SetDisplayNameKey(
const nsAString& aDisplayNameKey)
168 sbAbstractPropertyBuilder::GetUserViewable(PRBool* aUserViewable)
170 NS_ENSURE_ARG_POINTER(aUserViewable);
175 sbAbstractPropertyBuilder::SetUserViewable(PRBool aUserViewable)
182 sbAbstractPropertyBuilder::GetUserEditable(PRBool* aUserEditable)
184 NS_ENSURE_ARG_POINTER(aUserEditable);
189 sbAbstractPropertyBuilder::SetUserEditable(PRBool aUserEditable)
196 sbAbstractPropertyBuilder::GetRemoteReadable(PRBool* aRemoteReadable)
198 NS_ENSURE_ARG_POINTER(aRemoteReadable);
203 sbAbstractPropertyBuilder::SetRemoteReadable(PRBool aRemoteReadable)
210 sbAbstractPropertyBuilder::GetRemoteWritable(PRBool* aRemoteWritable)
212 NS_ENSURE_ARG_POINTER(aRemoteWritable);
217 sbAbstractPropertyBuilder::SetRemoteWritable(PRBool aRemoteWritable)
PRPackedBool mUserEditable
nsresult GetFinalDisplayName(nsAString &aDisplayName)
nsCOMPtr< nsIStringBundle > mBundle
PRPackedBool mRemoteReadable
NS_IMPL_ISUPPORTS1(sbAbstractPropertyBuilder, sbIPropertyBuilder) sbAbstractPropertyBuilder
An interface used to describe a metadata property for use by the UI and other sbILibrary interfaces (...
PRPackedBool mUserViewable
PRPackedBool mRemoteWritable
static nsresult CreateBundle(const char *aURLSpec, nsIStringBundle **_retval)
static nsresult GetStringFromName(nsIStringBundle *aBundle, const nsAString &aName, nsAString &_retval)