29 #include <nsAutoPtr.h>
30 #include <nsITreeView.h>
40 MOZ_COUNT_CTOR(sbBooleanPropertyInfo);
41 mType = NS_LITERAL_STRING(
"boolean");
42 mSuppressSelect = PR_TRUE;
56 NS_ENSURE_SUCCESS(rv, rv);
59 NS_ENSURE_SUCCESS(rv, rv);
68 nsRefPtr<sbPropertyOperator> propOp;
71 rv = sbPropertyInfo::GetOPERATOR_EQUALS(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 = sbPropertyInfo::GetOPERATOR_NOTEQUALS(op);
79 NS_ENSURE_SUCCESS(rv, rv);
81 NS_ENSURE_TRUE(propOp, NS_ERROR_OUT_OF_MEMORY);
83 NS_ENSURE_SUCCESS(rv, rv);
85 rv = GetOPERATOR_ISTRUE(op);
86 NS_ENSURE_SUCCESS(rv, rv);
88 NS_ENSURE_TRUE(propOp, NS_ERROR_OUT_OF_MEMORY);
90 NS_ENSURE_SUCCESS(rv, rv);
92 rv = GetOPERATOR_ISFALSE(op);
93 NS_ENSURE_SUCCESS(rv, rv);
95 NS_ENSURE_TRUE(propOp, NS_ERROR_OUT_OF_MEMORY);
97 NS_ENSURE_SUCCESS(rv, rv);
105 NS_ENSURE_ARG_POINTER(_retval);
107 if (aValue.IsVoid() ||
109 aValue.EqualsLiteral(
"0") ||
110 aValue.EqualsLiteral(
"1")) {
123 return NS_ERROR_NOT_IMPLEMENTED;
137 PRBool valid = PR_FALSE;
142 NS_ENSURE_SUCCESS(rv, rv);
146 rv = NS_ERROR_INVALID_ARG;
153 sbBooleanPropertyInfo::GetOPERATOR_ISTRUE(nsAString & aOPERATOR_ISTRUE)
160 sbBooleanPropertyInfo::GetOPERATOR_ISFALSE(nsAString & aOPERATOR_ISFALSE)
169 sbBooleanPropertyInfo::GetImageSrc(
const nsAString&
aValue,
177 sbBooleanPropertyInfo::GetProgressMode(
const nsAString& aValue,
180 NS_ENSURE_ARG_POINTER(_retval);
181 *_retval = nsITreeView::PROGRESS_NONE;
186 sbBooleanPropertyInfo::GetCellValue(
const nsAString& aValue,
190 PRBool valid = PR_FALSE;
195 NS_ENSURE_SUCCESS(rv, rv);
199 rv = NS_ERROR_INVALID_ARG;
203 if (aValue.IsVoid() || aValue.IsEmpty()) {
204 _retval.AssignLiteral(
"0");
211 sbBooleanPropertyInfo::GetRowProperties(
const nsAString& aValue,
219 sbBooleanPropertyInfo::GetCellProperties(
const nsAString& aValue,
222 _retval.AssignLiteral(
"checkbox");
224 if (aValue.EqualsLiteral(
"1")) {
225 _retval.AppendLiteral(
" checked");
227 _retval.AppendLiteral(
" unchecked");
234 sbBooleanPropertyInfo::GetColumnType(nsAString& _retval)
236 _retval.AssignLiteral(
"text");
243 sbBooleanPropertyInfo::GetSuppressSelect(PRBool* aSuppressSelect)
245 NS_ENSURE_ARG_POINTER(aSuppressSelect);
246 *aSuppressSelect = mSuppressSelect;
251 sbBooleanPropertyInfo::SetSuppressSelect(PRBool aSuppressSelect)
253 mSuppressSelect = aSuppressSelect;
258 sbBooleanPropertyInfo::IsDisabled(
const nsAString& aCurrentValue,
261 NS_ENSURE_ARG_POINTER(_retval);
267 sbBooleanPropertyInfo::HitTest(
const nsAString& aCurrentValue,
268 const nsAString& aPart,
275 NS_ENSURE_ARG_POINTER(_retval);
281 sbBooleanPropertyInfo::GetValueForClick(
const nsAString& aCurrentValue,
288 if (aCurrentValue.EqualsLiteral(
"1")) {
289 _retval.AssignLiteral(
"0");
291 _retval.AssignLiteral(
"1");
304 PRBool *_retval NS_OUTPARAM)
306 NS_ENSURE_ARG_POINTER(_retval);
The property information specific to clickable properties.
NS_IMETHOD Format(const nsAString &aValue, nsAString &_retval)
NS_IMETHOD Validate(const nsAString &aValue, PRBool *_retval)
virtual ~sbBooleanPropertyInfo()
NS_IMPL_ISUPPORTS_INHERITED3(sbBooleanPropertyInfo, sbPropertyInfo, sbIBooleanPropertyInfo, sbIClickablePropertyInfo, sbITreeViewPropertyInfo) sbBooleanPropertyInfo
#define SB_OPERATOR_ISTRUE
nsCOMArray< sbIPropertyOperator > mOperators
NS_IMETHOD Sanitize(const nsAString &aValue, nsAString &_retval)
The property information specific to boolean properties.
#define SB_OPERATOR_ISFALSE
NS_IMETHOD MakeSearchable(const nsAString &aValue, nsAString &_retval)
nsresult InitializeOperators()