michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef __nsAutoCompleteSimpleResult__ michael@0: #define __nsAutoCompleteSimpleResult__ michael@0: michael@0: #include "nsIAutoCompleteResult.h" michael@0: #include "nsIAutoCompleteSimpleResult.h" michael@0: michael@0: #include "nsString.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "nsTArray.h" michael@0: #include "mozilla/Attributes.h" michael@0: michael@0: class nsAutoCompleteSimpleResult MOZ_FINAL : public nsIAutoCompleteSimpleResult michael@0: { michael@0: public: michael@0: nsAutoCompleteSimpleResult(); michael@0: inline void CheckInvariants() { michael@0: NS_ASSERTION(mValues.Length() == mComments.Length(), "Arrays out of sync"); michael@0: NS_ASSERTION(mValues.Length() == mImages.Length(), "Arrays out of sync"); michael@0: NS_ASSERTION(mValues.Length() == mStyles.Length(), "Arrays out of sync"); michael@0: NS_ASSERTION(mValues.Length() == mFinalCompleteValues.Length(), "Arrays out of sync"); michael@0: } michael@0: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSIAUTOCOMPLETERESULT michael@0: NS_DECL_NSIAUTOCOMPLETESIMPLERESULT michael@0: michael@0: private: michael@0: ~nsAutoCompleteSimpleResult() {} michael@0: michael@0: protected: michael@0: michael@0: // What we really want is an array of structs with value/comment/image/style contents. michael@0: // But then we'd either have to use COM or manage object lifetimes ourselves. michael@0: // Having four arrays of string simplifies this, but is stupid. michael@0: nsTArray mValues; michael@0: nsTArray mComments; michael@0: nsTArray mImages; michael@0: nsTArray mStyles; michael@0: nsTArray mFinalCompleteValues; michael@0: michael@0: nsString mSearchString; michael@0: nsString mErrorDescription; michael@0: int32_t mDefaultIndex; michael@0: uint32_t mSearchResult; michael@0: michael@0: bool mTypeAheadResult; michael@0: michael@0: nsCOMPtr mListener; michael@0: }; michael@0: michael@0: #endif // __nsAutoCompleteSimpleResult__