2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2005-11-08 02:25:22 +00:00
|
|
|
|
2005-11-09 19:19:33 +00:00
|
|
|
#ifndef __nsAutoCompleteSimpleResult__
|
|
|
|
#define __nsAutoCompleteSimpleResult__
|
2005-11-08 02:25:22 +00:00
|
|
|
|
2005-11-09 19:19:33 +00:00
|
|
|
#include "nsIAutoCompleteResult.h"
|
|
|
|
#include "nsIAutoCompleteSimpleResult.h"
|
2005-11-08 02:25:22 +00:00
|
|
|
|
2005-11-09 19:19:33 +00:00
|
|
|
#include "nsString.h"
|
|
|
|
#include "prtypes.h"
|
2007-05-27 17:45:20 +00:00
|
|
|
#include "nsCOMPtr.h"
|
2009-01-18 20:14:14 +00:00
|
|
|
#include "nsTArray.h"
|
2005-11-09 19:19:33 +00:00
|
|
|
|
|
|
|
class nsAutoCompleteSimpleResult : public nsIAutoCompleteSimpleResult
|
2005-11-08 02:25:22 +00:00
|
|
|
{
|
2005-11-09 19:19:33 +00:00
|
|
|
public:
|
|
|
|
nsAutoCompleteSimpleResult();
|
2009-01-18 20:14:14 +00:00
|
|
|
inline void CheckInvariants() {
|
|
|
|
NS_ASSERTION(mValues.Length() == mComments.Length(), "Arrays out of sync");
|
|
|
|
NS_ASSERTION(mValues.Length() == mImages.Length(), "Arrays out of sync");
|
|
|
|
NS_ASSERTION(mValues.Length() == mStyles.Length(), "Arrays out of sync");
|
|
|
|
}
|
2005-11-09 19:19:33 +00:00
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIAUTOCOMPLETERESULT
|
|
|
|
NS_DECL_NSIAUTOCOMPLETESIMPLERESULT
|
|
|
|
|
2005-11-09 21:27:51 +00:00
|
|
|
private:
|
|
|
|
~nsAutoCompleteSimpleResult() {}
|
|
|
|
|
2005-11-09 19:19:33 +00:00
|
|
|
protected:
|
|
|
|
|
2007-07-20 21:55:18 +00:00
|
|
|
// What we really want is an array of structs with value/comment/image/style contents.
|
2005-11-09 19:19:33 +00:00
|
|
|
// But then we'd either have to use COM or manage object lifetimes ourselves.
|
2007-07-20 21:55:18 +00:00
|
|
|
// Having four arrays of string simplifies this, but is stupid.
|
2009-01-18 20:14:14 +00:00
|
|
|
nsTArray<nsString> mValues;
|
|
|
|
nsTArray<nsString> mComments;
|
|
|
|
nsTArray<nsString> mImages;
|
|
|
|
nsTArray<nsString> mStyles;
|
2005-11-09 19:19:33 +00:00
|
|
|
|
|
|
|
nsString mSearchString;
|
|
|
|
nsString mErrorDescription;
|
|
|
|
PRInt32 mDefaultIndex;
|
|
|
|
PRUint32 mSearchResult;
|
2007-05-27 17:45:20 +00:00
|
|
|
|
2012-01-19 11:31:19 +00:00
|
|
|
bool mTypeAheadResult;
|
|
|
|
|
2007-05-27 17:45:20 +00:00
|
|
|
nsCOMPtr<nsIAutoCompleteSimpleResultListener> mListener;
|
2005-11-08 02:25:22 +00:00
|
|
|
};
|
2005-11-09 19:19:33 +00:00
|
|
|
|
|
|
|
#endif // __nsAutoCompleteSimpleResult__
|