Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Attributes | Events
nsRssIncomingServer Class Reference

#include <nsRssIncomingServer.h>

Inheritance diagram for nsRssIncomingServer:
Inheritance graph
[legend]
Collaboration diagram for nsRssIncomingServer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIRSSINCOMINGSERVER
NS_DECL_NSILOCALMAILINCOMINGSERVER
NS_DECL_NSIFOLDERLISTENER
NS_IMETHOD 
GetLocalStoreType (char **)
NS_IMETHOD GetOfflineSupportLevel (PRInt32 *aSupportLevel)
NS_IMETHOD GetSupportsDiskSpace (PRBool *aSupportsDiskSpace)
NS_IMETHOD GetAccountManagerChrome (nsAString &aResult)
NS_IMETHOD PerformBiff (nsIMsgWindow *aMsgWindow)
NS_IMETHOD GetServerRequiresPasswordForBiff (PRBool *aServerRequiresPasswordForBiff)
NS_IMETHOD GetCanSearchMessages (PRBool *canSearchMessages)
 nsRssIncomingServer ()
virtual ~nsRssIncomingServer ()
void createDefaultMailboxes (in nsIFileSpec path)
void setFlagsOnDefaultMailboxes ()
nsIURI getNewMail (in nsIMsgWindow aMsgWindow, in nsIUrlListener aUrlListener, in nsIMsgFolder aInbox)
void OnItemAdded (in nsIRDFResource parentItem, in nsISupports item)
void OnItemRemoved (in nsIRDFResource parentItem, in nsISupports item)
void OnItemPropertyChanged (in nsIRDFResource item, in nsIAtom property, in string oldValue, in string newValue)
void OnItemIntPropertyChanged (in nsIRDFResource item, in nsIAtom property, in long oldValue, in long newValue)
void OnItemBoolPropertyChanged (in nsIRDFResource item, in nsIAtom property, in boolean oldValue, in boolean newValue)
void OnItemUnicharPropertyChanged (in nsIRDFResource item, in nsIAtom property, in wstring oldValue, in wstring newValue)
void OnItemPropertyFlagChanged (in nsIMsgDBHdr item, in nsIAtom property, in unsigned long oldFlag, in unsigned long newFlag)
void OnItemEvent (in nsIMsgFolder item, in nsIAtom event)

Public Attributes

readonly attribute nsILocalFile subscriptionsDataSourcePath
readonly attribute nsILocalFile feedItemsDataSourcePath
const folderListenerNotifyFlagValue added = 0x1
const folderListenerNotifyFlagValue removed = 0x2
const folderListenerNotifyFlagValue propertyChanged = 0x4
const folderListenerNotifyFlagValue intPropertyChanged = 0x8
const folderListenerNotifyFlagValue boolPropertyChanged = 0x10
const folderListenerNotifyFlagValue unicharPropertyChanged = 0x20
const folderListenerNotifyFlagValue propertyFlagChanged = 0x40

Protected Member Functions

nsresult FillInDataSourcePath (const nsAString &aDataSourceName, nsILocalFile **aLocation)

Static Protected Attributes

static nsrefcnt gInstanceCount = 0

Events

const
folderListenerNotifyFlagValue=0 
x80
const folderListenerNotifyFlagValue all = 0xFFFFFFFF

Detailed Description

Definition at line 45 of file nsRssIncomingServer.h.


Constructor & Destructor Documentation

Definition at line 72 of file nsRssIncomingServer.cpp.

{
  gInstanceCount--;
  
  // I used to have code here which unregistered the global rss folder listener with the
  // mail session. But the rss incoming server is held until shutdown when we shut down the 
  // account datasource. And at shutdown the mail session explicitly releases all of its folder listeners
  // anyway so this was effectively a no-op...
}

Member Function Documentation

nsresult nsRssIncomingServer::FillInDataSourcePath ( const nsAString &  aDataSourceName,
nsILocalFile **  aLocation 
) [protected]

Definition at line 82 of file nsRssIncomingServer.cpp.

{
  nsresult rv;
  // start by gettting the local path for this server
  nsCOMPtr<nsIFileSpec> localPathForServer;
  rv = GetLocalPath(getter_AddRefs(localPathForServer));
  NS_ENSURE_SUCCESS(rv, rv);

  // convert to a nsIFile
  nsCOMPtr<nsILocalFile> localFile;
  nsFileSpec pathSpec;
  localPathForServer->GetFileSpec(&pathSpec);
  rv = NS_FileSpecToIFile(&pathSpec, getter_AddRefs(localFile));
  NS_ENSURE_SUCCESS(rv, rv);

  // now append the name of the subscriptions data source
  rv = localFile->Append(aDataSourceName);
  NS_IF_ADDREF(*aLocation = localFile);
  return rv;
}

Here is the call graph for this function:

Definition at line 234 of file nsRssIncomingServer.cpp.

{
    aResult.AssignLiteral("am-newsblog.xul");
    return NS_OK;
}

Definition at line 261 of file nsRssIncomingServer.cpp.

{
  NS_ENSURE_ARG_POINTER(canSearchMessages);
  *canSearchMessages = PR_TRUE;
  return NS_OK;
}

Definition at line 227 of file nsRssIncomingServer.cpp.

{
    NS_ENSURE_ARG_POINTER(type);
    *type = strdup("mailbox");
    return NS_OK;
}
nsIURI nsILocalMailIncomingServer::getNewMail ( in nsIMsgWindow  aMsgWindow,
in nsIUrlListener  aUrlListener,
in nsIMsgFolder  aInbox 
) [inherited]

Definition at line 240 of file nsRssIncomingServer.cpp.

{
  NS_ENSURE_ARG_POINTER(aSupportLevel);
  *aSupportLevel = OFFLINE_SUPPORT_LEVEL_NONE;
  return NS_OK;
}

Definition at line 254 of file nsRssIncomingServer.cpp.

{
  NS_ENSURE_ARG_POINTER(aServerRequiresPasswordForBiff);
  *aServerRequiresPasswordForBiff = PR_FALSE;  // for rss folders, we don't require a password
  return NS_OK;
}

Definition at line 247 of file nsRssIncomingServer.cpp.

{
  NS_ENSURE_ARG_POINTER(aSupportsDiskSpace);
  *aSupportsDiskSpace = PR_FALSE;
  return NS_OK;
}
void nsIFolderListener::OnItemAdded ( in nsIRDFResource  parentItem,
in nsISupports  item 
) [inherited]

Here is the caller graph for this function:

void nsIFolderListener::OnItemBoolPropertyChanged ( in nsIRDFResource  item,
in nsIAtom  property,
in boolean  oldValue,
in boolean  newValue 
) [inherited]

Here is the caller graph for this function:

void nsIFolderListener::OnItemEvent ( in nsIMsgFolder  item,
in nsIAtom  event 
) [inherited]

Here is the caller graph for this function:

void nsIFolderListener::OnItemIntPropertyChanged ( in nsIRDFResource  item,
in nsIAtom  property,
in long  oldValue,
in long  newValue 
) [inherited]

Here is the caller graph for this function:

void nsIFolderListener::OnItemPropertyChanged ( in nsIRDFResource  item,
in nsIAtom  property,
in string  oldValue,
in string  newValue 
) [inherited]
void nsIFolderListener::OnItemPropertyFlagChanged ( in nsIMsgDBHdr  item,
in nsIAtom  property,
in unsigned long  oldFlag,
in unsigned long  newFlag 
) [inherited]

Here is the caller graph for this function:

void nsIFolderListener::OnItemRemoved ( in nsIRDFResource  parentItem,
in nsISupports  item 
) [inherited]
void nsIFolderListener::OnItemUnicharPropertyChanged ( in nsIRDFResource  item,
in nsIAtom  property,
in wstring  oldValue,
in wstring  newValue 
) [inherited]

Definition at line 150 of file nsRssIncomingServer.cpp.

{
  // do we need to do anything here besides download articles
  // for each feed? I don't think we have a way to check a feed for new articles without actually
  // getting the articles. Do we need to SetPerformingBiff to true for this server? 
  nsresult rv;
  nsCOMPtr<nsIMsgFolder> rootRSSFolder;
  GetRootMsgFolder(getter_AddRefs(rootRSSFolder));

  // enumerate over the RSS folders and ping each one
  nsCOMPtr<nsISupportsArray> allDescendents;
  NS_NewISupportsArray(getter_AddRefs(allDescendents));
  rv = rootRSSFolder->ListDescendents(allDescendents);
  NS_ENSURE_SUCCESS(rv, rv);
  
  PRUint32 cnt =0;  
  allDescendents->Count(&cnt);

  nsCOMPtr<nsISupports> supports;
  nsCOMPtr<nsIUrlListener> urlListener;
  nsCOMPtr<nsIMsgFolder> rssFolder;

  for (PRUint32 index = 0; index < cnt; index++)
  {
    supports = getter_AddRefs(allDescendents->ElementAt(index));
    rssFolder = do_QueryInterface(supports, &rv);
    if (rssFolder)
    {
      urlListener = do_QueryInterface(rssFolder);
      // WARNING: Never call GetNewMail with the root folder or you will trigger an infinite loop...
      GetNewMail(aMsgWindow, urlListener, rssFolder, nsnull);
    }
  }

  return NS_OK;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 49 of file nsIFolderListener.idl.

Definition at line 69 of file nsIFolderListener.idl.

Definition at line 47 of file nsIRssIncomingServer.idl.

Definition at line 69 of file nsRssIncomingServer.h.

Definition at line 63 of file nsIFolderListener.idl.

Definition at line 57 of file nsIFolderListener.idl.

Definition at line 81 of file nsIFolderListener.idl.

Definition at line 53 of file nsIFolderListener.idl.

Definition at line 44 of file nsIRssIncomingServer.idl.

Definition at line 75 of file nsIFolderListener.idl.


Event Documentation

Definition at line 90 of file nsIFolderListener.idl.

Definition at line 87 of file nsIFolderListener.idl.


The documentation for this class was generated from the following files: