Back to index

lightning-sunbird  0.9+nobinonly
Classes | Typedefs | Functions
nsXULSortService.cpp File Reference
#include "nsCOMPtr.h"
#include "nsCRT.h"
#include "nsIAtom.h"
#include "nsIContent.h"
#include "nsIDOMElement.h"
#include "nsIDOMNode.h"
#include "nsIDocument.h"
#include "nsINameSpaceManager.h"
#include "nsIRDFCompositeDataSource.h"
#include "nsIRDFNode.h"
#include "nsIRDFObserver.h"
#include "nsIRDFService.h"
#include "nsIServiceManager.h"
#include "nsISupportsArray.h"
#include "nsIURL.h"
#include "nsRDFCID.h"
#include "nsXULContentUtils.h"
#include "nsString.h"
#include "nsXPIDLString.h"
#include "nsUnicharUtils.h"
#include "rdf.h"
#include "nsRDFSort.h"
#include "nsVoidArray.h"
#include "nsQuickSort.h"
#include "nsIXULSortService.h"
#include "prlog.h"
#include "nsICollation.h"
#include "nsCollationCID.h"
#include "nsLayoutCID.h"
#include "nsIDOMXULElement.h"
#include "nsILocale.h"
#include "nsILocaleService.h"
#include "nsIRDFContainerUtils.h"
#include "nsXULAtoms.h"
#include "nsINodeInfo.h"

Go to the source code of this file.

Classes

struct  _sortStruct
struct  contentSortInfo
class  XULSortServiceImpl

Typedefs

typedef struct _sortStruct sortStruct
typedef struct _sortStructsortPtr

Functions

static NS_DEFINE_CID (kRDFServiceCID, NS_RDFSERVICE_CID)
static NS_DEFINE_CID (kCollationFactoryCID, NS_COLLATIONFACTORY_CID)
static NS_DEFINE_CID (kRDFInMemoryDataSourceCID, NS_RDFINMEMORYDATASOURCE_CID)
static NS_DEFINE_CID (kRDFContainerUtilsCID, NS_RDFCONTAINERUTILS_CID)
 DEFINE_RDF_VOCAB (NC_NAMESPACE_URI, NC, BookmarkSeparator)
int PR_CALLBACK inplaceSortCallback (const void *data1, const void *data2, void *privateData)
int PR_CALLBACK testSortCallback (const void *data1, const void *data2, void *privateData)
static contentSortInfoCreateContentSortInfo (nsIContent *content, nsIRDFResource *resource)
nsresult NS_NewXULSortService (nsIXULSortService **mgr)

Class Documentation

struct _sortStruct

Definition at line 104 of file nsXULSortService.cpp.

Collaboration diagram for _sortStruct:
Class Members
PRBool cacheFirstHint
nsCOMPtr< nsIRDFNode > cacheFirstNode
PRBool cacheIsFirstNodeCollationKey
nsCOMPtr
< nsIRDFCompositeDataSource >
db
PRBool descendingSort
PRBool firstFlag
PRBool inbetweenSeparatorSort
nsCOMPtr< nsIRDFDataSource > mInner
PRBool naturalOrderSort
nsCOMPtr< nsIContent > parentContainer
nsCOMPtr< nsIRDFResource > sortProperty
nsCOMPtr< nsIRDFResource > sortProperty2
nsCOMPtr< nsIRDFResource > sortPropertyColl
nsCOMPtr< nsIRDFResource > sortPropertyColl2
nsCOMPtr< nsIRDFResource > sortPropertySort
nsCOMPtr< nsIRDFResource > sortPropertySort2
struct contentSortInfo

Definition at line 123 of file nsXULSortService.cpp.

Collaboration diagram for contentSortInfo:
Class Members
PRBool checkedCollation1
PRBool checkedCollation2
PRBool checkedNode1
PRBool checkedNode2
PRBool checkedSort1
PRBool checkedSort2
nsCOMPtr< nsIRDFNode > collationNode1
nsCOMPtr< nsIRDFNode > collationNode2
nsIContent * content
nsCOMPtr< nsIRDFNode > node1
nsCOMPtr< nsIRDFNode > node2
nsCOMPtr< nsIRDFResource > resource
nsCOMPtr< nsIRDFNode > sortNode1
nsCOMPtr< nsIRDFNode > sortNode2

Typedef Documentation

typedef struct _sortStruct * sortPtr
typedef struct _sortStruct sortStruct

Function Documentation

static contentSortInfo* CreateContentSortInfo ( nsIContent content,
nsIRDFResource resource 
) [static]

Definition at line 1092 of file nsXULSortService.cpp.

{
  contentSortInfo * info = new contentSortInfo;
  if (!info)
    return nsnull;

  info->content = content;
  NS_IF_ADDREF(info->content);

  info->resource = resource;

  info->checkedCollation1 = PR_FALSE;
  info->checkedCollation2 = PR_FALSE;
  info->checkedSort1 = PR_FALSE;
  info->checkedSort2 = PR_FALSE;
  info->checkedNode1 = PR_FALSE;
  info->checkedNode2 = PR_FALSE;

  return info;
}

Here is the caller graph for this function:

DEFINE_RDF_VOCAB ( NC_NAMESPACE_URI  ,
NC  ,
BookmarkSeparator   
)
int PR_CALLBACK inplaceSortCallback ( const void data1,
const void data2,
void privateData 
)

Note: inplaceSortCallback is a small C callback stub for NS_QuickSort

Definition at line 1062 of file nsXULSortService.cpp.

{
  _sortStruct *sortInfo = (_sortStruct *)privateData;
  nsIContent *node1 = *(nsIContent **)data1;
  nsIContent *node2 = *(nsIContent **)data2;
  PRInt32 sortOrder = 0;

  if (nsnull != sortInfo)
    XULSortServiceImpl::InplaceSort(node1, node2, sortInfo, sortOrder);

  return sortOrder;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static NS_DEFINE_CID ( kRDFServiceCID  ,
NS_RDFSERVICE_CID   
) [static]
static NS_DEFINE_CID ( kCollationFactoryCID  ,
NS_COLLATIONFACTORY_CID   
) [static]
static NS_DEFINE_CID ( kRDFInMemoryDataSourceCID  ,
NS_RDFINMEMORYDATASOURCE_CID   
) [static]
static NS_DEFINE_CID ( kRDFContainerUtilsCID  ,
NS_RDFCONTAINERUTILS_CID   
) [static]

Definition at line 1679 of file nsXULSortService.cpp.

{
  XULSortServiceImpl *sortService = new XULSortServiceImpl();
  if (!sortService)
    return NS_ERROR_OUT_OF_MEMORY;

  *mgr = sortService;
  NS_ADDREF(*mgr);

  return NS_OK;
}

Here is the call graph for this function:

int PR_CALLBACK testSortCallback ( const void data1,
const void data2,
void privateData 
)

Note: testSortCallback is a small C callback stub for NS_QuickSort

Definition at line 1077 of file nsXULSortService.cpp.

{
  _sortStruct *sortInfo = (_sortStruct *)privateData;
  contentSortInfo *info1 = *(contentSortInfo **)data1;
  contentSortInfo *info2 = *(contentSortInfo **)data2;
  PRInt32 sortOrder = 0;

  if (nsnull != sortInfo)
    XULSortServiceImpl::InplaceSort(info1, info2, sortInfo, sortOrder);

  return sortOrder;
}

Here is the call graph for this function:

Here is the caller graph for this function: