Back to index

lightning-sunbird  0.9+nobinonly
Functions
nsAbAutoCompleteSession.cpp File Reference
#include "msgCore.h"
#include "nsAbAutoCompleteSession.h"
#include "nsString.h"
#include "nsRDFCID.h"
#include "nsIRDFService.h"
#include "nsIAbDirectory.h"
#include "nsIAbCard.h"
#include "nsXPIDLString.h"
#include "nsReadableUtils.h"
#include "nsUnicharUtils.h"
#include "nsMsgBaseCID.h"
#include "nsMsgI18N.h"
#include "nsIMsgIdentity.h"
#include "prmem.h"
#include "nsNetCID.h"
#include "nsIIOService.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"

Go to the source code of this file.

Functions

static PRBool CommonPrefix (const PRUnichar *aString, const PRUnichar *aSubstr, PRInt32 aSubstrLen)
static nsresult NeedToSearchReplicatedLDAPDirectories (nsIPrefBranch *aPrefs, PRBool *aNeedToSearch)

Function Documentation

static PRBool CommonPrefix ( const PRUnichar aString,
const PRUnichar aSubstr,
PRInt32  aSubstrLen 
) [static]

Definition at line 274 of file nsAbAutoCompleteSession.cpp.

{
  if (!aSubstrLen || (nsCRT::strlen(aString) < NS_STATIC_CAST(PRUint32, aSubstrLen)))
    return PR_FALSE;

  return (Substring(aString,
                    aString+aSubstrLen).Equals(Substring(aSubstr, aSubstr+aSubstrLen),
                                               nsCaseInsensitiveStringComparator()));
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsresult NeedToSearchReplicatedLDAPDirectories ( nsIPrefBranch aPrefs,
PRBool aNeedToSearch 
) [static]

Definition at line 465 of file nsAbAutoCompleteSession.cpp.

{
  NS_ENSURE_ARG_POINTER(aPrefs);
  NS_ENSURE_ARG_POINTER(aNeedToSearch);

  // first check if the user is set up to do LDAP autocompletion
  nsresult rv = aPrefs->GetBoolPref("ldap_2.autoComplete.useDirectory", aNeedToSearch);
  NS_ENSURE_SUCCESS(rv, rv);

  // no need to search if not set up for LDAP autocompletion
  if (!*aNeedToSearch)
    return NS_OK;

  // now see if we are offline, if we are we need to search the
  // replicated directory
  nsCOMPtr <nsIIOService> ioService = do_GetService(NS_IOSERVICE_CONTRACTID, &rv);
  NS_ENSURE_SUCCESS(rv,rv);
  rv = ioService->GetOffline(aNeedToSearch);
  NS_ENSURE_SUCCESS(rv,rv);
  return NS_OK;
}

Here is the call graph for this function: