Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
nsIconURI.cpp File Reference
#include "nsIconURI.h"
#include "nsNetUtil.h"
#include "nsIIOService.h"
#include "nsIURL.h"
#include "nsCRT.h"
#include "nsReadableUtils.h"
#include "nsPrintfCString.h"
#include "nsIAtom.h"
#include "nsStaticAtom.h"

Go to the source code of this file.

Defines

#define DEFAULT_IMAGE_SIZE   16
#define NS_MOZICON_SCHEME   "moz-icon:"
#define NS_MOZ_ICON_DELIMITER   '?'

Functions

static NS_DEFINE_CID (kIOServiceCID, NS_IOSERVICE_CID)
static void extractAttributeValue (const char *searchString, const char *attributeName, char **result)

Variables

static nsIAtomsStockSizeButton = nsnull
static nsIAtomsStockSizeToolbar = nsnull
static nsIAtomsStockSizeToolbarsmall = nsnull
static nsIAtomsStockSizeMenu = nsnull
static nsIAtomsStockSizeDialog = nsnull
static nsIAtomsStockStateNormal = nsnull
static nsIAtomsStockStateDisabled = nsnull

Define Documentation

Definition at line 51 of file nsIconURI.cpp.

Definition at line 102 of file nsIconURI.cpp.

#define NS_MOZICON_SCHEME   "moz-icon:"

Definition at line 101 of file nsIconURI.cpp.


Function Documentation

void extractAttributeValue ( const char *  searchString,
const char *  attributeName,
char **  result 
) [static]

Definition at line 173 of file nsIconURI.cpp.

{
  //NS_ENSURE_ARG_POINTER(extractAttributeValue);

       char * attributeValue = nsnull;
       if (searchString && attributeName)
       {
              // search the string for attributeName
              PRUint32 attributeNameSize = PL_strlen(attributeName);
              char * startOfAttribute = PL_strcasestr(searchString, attributeName);
              if (startOfAttribute &&
                 ( *(startOfAttribute-1) == '?' || *(startOfAttribute-1) == '&') )
              {
                     startOfAttribute += attributeNameSize; // skip over the attributeName
                     if (startOfAttribute) // is there something after the attribute name
                     {
                            char * endofAttribute = startOfAttribute ? PL_strchr(startOfAttribute, '&') : nsnull;
                            if (startOfAttribute && endofAttribute) // is there text after attribute value
                                   attributeValue = PL_strndup(startOfAttribute, endofAttribute - startOfAttribute);
                            else // there is nothing left so eat up rest of line.
                                   attributeValue = PL_strdup(startOfAttribute);
                     } // if we have a attribute value
              } // if we have a attribute name
       } // if we got non-null search string and attribute name values

  *result = attributeValue; // passing ownership of attributeValue into result...no need to 
}

Here is the call graph for this function:

static NS_DEFINE_CID ( kIOServiceCID  ,
NS_IOSERVICE_CID   
) [static]

Variable Documentation

Definition at line 57 of file nsIconURI.cpp.

Definition at line 61 of file nsIconURI.cpp.

Definition at line 60 of file nsIconURI.cpp.

Definition at line 58 of file nsIconURI.cpp.

Definition at line 59 of file nsIconURI.cpp.

Definition at line 63 of file nsIconURI.cpp.

Definition at line 62 of file nsIconURI.cpp.