зеркало из https://github.com/mozilla/pjs.git
changes to get simple addressbook autocompletion working. not part of the build yet.
This commit is contained in:
Родитель
8182f1cf23
Коммит
309d210a33
|
@ -21,6 +21,6 @@
|
|||
|
||||
[scriptable, uuid(CA2A6B08-3625-11d3-988E-001083010E9B)]
|
||||
interface nsIAutoCompleteListener : nsISupports {
|
||||
void OnAutoCompleteResult(in wstring aOriginalString, in wstring aMatch);
|
||||
void OnAutoCompleteResult(in wstring aDocId, in wstring aOriginalString, in wstring aMatch);
|
||||
};
|
||||
|
||||
|
|
|
@ -23,6 +23,6 @@ interface nsIAutoCompleteListener;
|
|||
|
||||
[scriptable, uuid(CA2A6B07-3625-11d3-988E-001083010E9B)]
|
||||
interface nsIAutoCompleteSession : nsISupports {
|
||||
void AutoComplete(in wstring aSearchString, in nsIAutoCompleteListener aResultListener);
|
||||
void AutoComplete(in wstring doc_id, in wstring aSearchString, in nsIAutoCompleteListener aResultListener);
|
||||
};
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ nsresult NS_NewAbAutoCompleteSession(const nsIID &aIID, void ** aInstancePtrResu
|
|||
{
|
||||
nsAbAutoCompleteSession * abSession = new nsAbAutoCompleteSession();
|
||||
if (abSession)
|
||||
return abSession->QueryInterface(nsCOMTypeInfo<nsIAbAutoCompleteSession>::GetIID(), aInstancePtrResult);
|
||||
return abSession->QueryInterface(nsCOMTypeInfo<nsIAutoCompleteSession>::GetIID(), aInstancePtrResult);
|
||||
else
|
||||
return NS_ERROR_OUT_OF_MEMORY; /* we couldn't allocate the object */
|
||||
}
|
||||
|
@ -36,17 +36,17 @@ nsresult NS_NewAbAutoCompleteSession(const nsIID &aIID, void ** aInstancePtrResu
|
|||
return NS_ERROR_NULL_POINTER; /* aInstancePtrResult was NULL....*/
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsAbAutoCompleteSession, nsCOMTypeInfo<nsIAbAutoCompleteSession>::GetIID())
|
||||
NS_IMPL_ISUPPORTS(nsAbAutoCompleteSession, nsCOMTypeInfo<nsIAutoCompleteSession>::GetIID())
|
||||
|
||||
nsAbAutoCompleteSession::nsAbAutoCompleteSession()
|
||||
{
|
||||
NS_INIT_REFCNT;
|
||||
NS_INIT_REFCNT();
|
||||
}
|
||||
|
||||
nsAbAutoCompleteSession::~nsAbAutoCompleteSession()
|
||||
{}
|
||||
|
||||
NS_IMETHODIMP nsAbAutoCompleteSession::AutoComplete(const PRUnichar *aSearchString, nsIAutoCompleteListener *aResultListener)
|
||||
NS_IMETHODIMP nsAbAutoCompleteSession::AutoComplete(const PRUnichar *aDocId, const PRUnichar *aSearchString, nsIAutoCompleteListener *aResultListener)
|
||||
{
|
||||
// mscott - right now I'm not even going to bother to make this synchronous...
|
||||
// I'll beef it up with some test data later but we want to see if this idea works for right now...
|
||||
|
@ -54,7 +54,7 @@ NS_IMETHODIMP nsAbAutoCompleteSession::AutoComplete(const PRUnichar *aSearchStri
|
|||
nsresult rv = NS_OK;
|
||||
nsString2 searchResult("Scott MacGregor <mscott@netscape.com>");
|
||||
if (aResultListener)
|
||||
rv = aResultListener->OnAutoCompleteResult(aSearchString, searchResult.GetUnicode());
|
||||
rv = aResultListener->OnAutoCompleteResult(aDocId, aSearchString, searchResult.GetUnicode());
|
||||
else
|
||||
rv = NS_ERROR_NULL_POINTER;
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ public:
|
|||
nsAbAutoCompleteSession();
|
||||
virtual ~nsAbAutoCompleteSession();
|
||||
|
||||
NS_IMETHOD AutoComplete(const PRUnichar *aSearchString, nsIAutoCompleteListener *aResultListener);
|
||||
NS_IMETHOD AutoComplete(const PRUnichar *aDocId, const PRUnichar *aSearchString, nsIAutoCompleteListener *aResultListener);
|
||||
|
||||
protected:
|
||||
nsCOMPtr<nsIAutoCompleteListener> m_resultListener;
|
||||
|
|
Загрузка…
Ссылка в новой задаче