30 #include <nsAutoPtr.h>
32 #include <nsIStringBundle.h>
34 #include <nsArrayEnumerator.h>
35 #include <sbIPropertyManager.h>
42 mUserViewable(PR_FALSE),
43 mUserEditable(PR_FALSE),
44 mRemoteReadable(PR_FALSE),
45 mRemoteWritable(PR_FALSE),
46 mUsedInIdentity(PR_FALSE),
47 mOperatorsLock(nsnull),
48 mUnitConverter(nsnull)
51 nsRefPtr<sbPropertyOperator> propOp;
53 mOperatorsLock = PR_NewLock();
54 NS_ASSERTION(mOperatorsLock,
55 "sbImmutablePropertyInfo::mOperatorsLock failed to create lock!");
69 nsRefPtr<sbPropertyOperator> propOp;
71 rv = sbImmutablePropertyInfo::GetOPERATOR_ISSET(op);
72 NS_ENSURE_SUCCESS(rv, rv);
74 NS_ENSURE_TRUE(propOp, NS_ERROR_OUT_OF_MEMORY);
76 NS_ENSURE_SUCCESS(rv, rv);
78 rv = sbImmutablePropertyInfo::GetOPERATOR_ISNOTSET(op);
79 NS_ENSURE_SUCCESS(rv, rv);
81 NS_ENSURE_TRUE(propOp, NS_ERROR_OUT_OF_MEMORY);
83 NS_ENSURE_SUCCESS(rv, rv);
89 sbImmutablePropertyInfo::GetOPERATOR_EQUALS(nsAString& aOPERATOR_EQUALS)
96 sbImmutablePropertyInfo::GetOPERATOR_NOTEQUALS(nsAString& aOPERATOR_NOTEQUALS)
103 sbImmutablePropertyInfo::GetOPERATOR_GREATER(nsAString& aOPERATOR_GREATER)
110 sbImmutablePropertyInfo::GetOPERATOR_GREATEREQUAL(nsAString& aOPERATOR_GREATEREQUAL)
117 sbImmutablePropertyInfo::GetOPERATOR_LESS(nsAString& aOPERATOR_LESS)
124 sbImmutablePropertyInfo::GetOPERATOR_LESSEQUAL(nsAString& aOPERATOR_LESSEQUAL)
131 sbImmutablePropertyInfo::GetOPERATOR_CONTAINS(nsAString& aOPERATOR_CONTAINS)
138 sbImmutablePropertyInfo::GetOPERATOR_NOTCONTAINS(nsAString& aOPERATOR_NOTCONTAINS)
145 sbImmutablePropertyInfo::GetOPERATOR_BEGINSWITH(nsAString& aOPERATOR_BEGINSWITH)
152 sbImmutablePropertyInfo::GetOPERATOR_NOTBEGINSWITH(nsAString& aOPERATOR_NOTBEGINSWITH)
159 sbImmutablePropertyInfo::GetOPERATOR_ENDSWITH(nsAString& aOPERATOR_ENDSWITH)
166 sbImmutablePropertyInfo::GetOPERATOR_NOTENDSWITH(nsAString& aOPERATOR_NOTENDSWITH)
173 sbImmutablePropertyInfo::GetOPERATOR_BETWEEN(nsAString& aOPERATOR_BETWEEN)
180 sbImmutablePropertyInfo::GetOPERATOR_ISSET(nsAString & aOPERATOR_ISSET)
187 sbImmutablePropertyInfo::GetOPERATOR_ISNOTSET(nsAString & aOPERATOR_ISNOTSET)
195 sbImmutablePropertyInfo::SetNullSort(PRUint32 aNullSort)
197 return NS_ERROR_NOT_IMPLEMENTED;
200 sbImmutablePropertyInfo::GetNullSort(PRUint32* aNullSort)
202 NS_ENSURE_ARG_POINTER(aNullSort);
210 return NS_ERROR_NOT_IMPLEMENTED;
213 sbImmutablePropertyInfo::GetSecondarySort(
sbIPropertyArray** aSecondarySort)
215 NS_ENSURE_ARG_POINTER(aSecondarySort);
221 sbImmutablePropertyInfo::GetId(nsAString& aID)
227 sbImmutablePropertyInfo::SetId(
const nsAString& aID)
229 return NS_ERROR_NOT_IMPLEMENTED;
233 sbImmutablePropertyInfo::GetType(nsAString& aType)
239 sbImmutablePropertyInfo::SetType(
const nsAString& aType)
241 return NS_ERROR_NOT_IMPLEMENTED;
245 sbImmutablePropertyInfo::GetDisplayName(nsAString& aDisplayName)
251 sbImmutablePropertyInfo::SetDisplayName(
const nsAString& aDisplayName)
253 return NS_ERROR_NOT_IMPLEMENTED;
258 sbImmutablePropertyInfo::GetLocalizationKey(nsAString & aLocalizationKey)
264 sbImmutablePropertyInfo::SetLocalizationKey(
const nsAString & aLocalizationKey)
266 return NS_ERROR_NOT_IMPLEMENTED;
270 sbImmutablePropertyInfo::GetUserViewable(PRBool *aUserViewable)
272 NS_ENSURE_ARG_POINTER(aUserViewable);
278 sbImmutablePropertyInfo::SetUserViewable(PRBool aUserViewable)
280 return NS_ERROR_NOT_IMPLEMENTED;
284 sbImmutablePropertyInfo::GetUserEditable(PRBool* aUserEditable)
286 NS_ENSURE_ARG_POINTER(aUserEditable);
292 sbImmutablePropertyInfo::SetUserEditable(PRBool aUserEditable)
294 return NS_ERROR_NOT_IMPLEMENTED;
298 sbImmutablePropertyInfo::GetRemoteReadable(PRBool* aRemoteReadable)
300 NS_ENSURE_ARG_POINTER(aRemoteReadable);
306 sbImmutablePropertyInfo::SetRemoteReadable(PRBool aRemoteReadable)
308 return NS_ERROR_NOT_IMPLEMENTED;
312 sbImmutablePropertyInfo::GetRemoteWritable(PRBool* aRemoteWritable)
314 NS_ENSURE_ARG_POINTER(aRemoteWritable);
320 sbImmutablePropertyInfo::SetRemoteWritable(PRBool aRemoteWritable)
322 return NS_ERROR_NOT_IMPLEMENTED;
328 NS_ENSURE_ARG_POINTER(aOperators);
331 return NS_NewArrayEnumerator(aOperators,
mOperators);
336 NS_ENSURE_ARG_POINTER(aOperators);
342 nsCOMPtr<nsISupports>
object;
344 while( NS_SUCCEEDED(aOperators->HasMoreElements(&hasMore)) &&
346 NS_SUCCEEDED(aOperators->GetNext(getter_AddRefs(
object)))) {
348 nsCOMPtr<sbIPropertyOperator> po = do_QueryInterface(
object, &rv);
349 NS_ENSURE_SUCCESS(rv, rv);
352 NS_ENSURE_TRUE(success, NS_ERROR_OUT_OF_MEMORY);
359 sbImmutablePropertyInfo::GetOperator(
const nsAString& aOperator,
362 NS_ENSURE_ARG_POINTER(_retval);
367 for (PRUint32
i = 0;
i < length;
i++) {
370 NS_ENSURE_SUCCESS(rv, rv);
371 if (op.Equals(aOperator)) {
382 sbImmutablePropertyInfo::Validate(
const nsAString&
aValue,
385 NS_ENSURE_ARG_POINTER(_retval);
391 sbImmutablePropertyInfo::Sanitize(
const nsAString&
aValue,
399 sbImmutablePropertyInfo::Format(
const nsAString&
aValue,
407 sbImmutablePropertyInfo::MakeSortable(
const nsAString&
aValue,
413 return MakeSearchable(aValue, _retval);
417 sbImmutablePropertyInfo::MakeSearchable(
const nsAString&
aValue,
441 sbImmutablePropertyInfo::GetUsedInIdentity(PRBool *aUsedInIdentity)
443 NS_ENSURE_ARG_POINTER(aUsedInIdentity);
450 sbImmutablePropertyInfo::SetUsedInIdentity(PRBool aUsedInIdentity)
452 return NS_ERROR_NOT_IMPLEMENTED;
nsCOMPtr< sbIPropertyUnitConverter > mUnitConverter
#define SB_OPERATOR_NOTEQUALS
#define SB_OPERATOR_CONTAINS
#define SB_OPERATOR_NOTCONTAINS
#define SB_OPERATOR_ISNOTSET
NS_IMETHOD SetUnitConverter(sbIPropertyUnitConverter *aUnitConverter)
#define SB_OPERATOR_BEGINSWITH
#define SB_OPERATOR_GREATER
#define SB_OPERATOR_EQUALS
virtual ~sbImmutablePropertyInfo()
#define SB_OPERATOR_LESSEQUAL
nsCOMArray< sbIPropertyOperator > mOperators
An interface to represent an operator that may act upon a property.
An interface used to describe a metadata property for use by the UI and other sbILibrary interfaces (...
nsString mLocalizationKey
nsCOMPtr< sbIPropertyArray > mSecondarySort
#define SB_OPERATOR_NOTENDSWITH
NS_IMPL_THREADSAFE_ISUPPORTS2(sbDeviceCapabilities, sbIDeviceCapabilities, nsIClassInfo) NS_IMPL_CI_INTERFACE_GETTER2(sbDeviceCapabilities
#define SB_OPERATOR_ISSET
#define SB_OPERATOR_NOTBEGINSWITH
StringArrayEnumerator prototype hasMore
Property unit converter interface This is an interface songbird property converter, used to convert a property value between its various units representations.
#define SB_OPERATOR_GREATEREQUAL
#define SB_OPERATOR_BETWEEN
#define SB_OPERATOR_ENDSWITH
An interface to carry around arrays of nsIProperty instances. Users of this interface should only QI ...
_getSelectedPageStyle s i