Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions
nsMessengerUnixIntegration.cpp File Reference
#include "nsMessengerUnixIntegration.h"
#include "nsIMsgAccountManager.h"
#include "nsIMsgMailSession.h"
#include "nsIMsgIncomingServer.h"
#include "nsIMsgIdentity.h"
#include "nsIMsgAccount.h"
#include "nsIRDFResource.h"
#include "nsIMsgFolder.h"
#include "nsCOMPtr.h"
#include "nsMsgBaseCID.h"
#include "nsMsgFolderFlags.h"
#include "nsDirectoryServiceDefs.h"
#include "nsAppDirectoryServiceDefs.h"
#include "nsIDirectoryService.h"
#include "nsIWindowWatcher.h"
#include "nsIWindowMediator.h"
#include "nsIDOMWindowInternal.h"
#include "nsPIDOMWindow.h"
#include "nsIDocShell.h"
#include "nsIBaseWindow.h"
#include "nsIWidget.h"
#include "nsIMessengerWindowService.h"
#include "prprf.h"
#include "nsIWeakReference.h"
#include "nsIStringBundle.h"
#include "nsIAlertsService.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#include "nsISupportsPrimitives.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsNativeCharsetUtils.h"

Go to the source code of this file.

Defines

#define ALERT_CHROME_URL   "chrome://messenger/content/newmailalert.xul"
#define NEW_MAIL_ALERT_ICON   "chrome://messenger/skin/icons/new-mail-alert.png"
#define SHOW_ALERT_PREF   "mail.biff.show_alert"

Functions

static void openMailWindow (const PRUnichar *aMailWindowName, const char *aFolderUri)

Define Documentation

#define ALERT_CHROME_URL   "chrome://messenger/content/newmailalert.xul"

Definition at line 79 of file nsMessengerUnixIntegration.cpp.

#define NEW_MAIL_ALERT_ICON   "chrome://messenger/skin/icons/new-mail-alert.png"

Definition at line 80 of file nsMessengerUnixIntegration.cpp.

#define SHOW_ALERT_PREF   "mail.biff.show_alert"

Definition at line 81 of file nsMessengerUnixIntegration.cpp.


Function Documentation

static void openMailWindow ( const PRUnichar aMailWindowName,
const char *  aFolderUri 
) [static]

Definition at line 83 of file nsMessengerUnixIntegration.cpp.

{
  nsCOMPtr<nsIWindowMediator> mediator ( do_GetService(NS_WINDOWMEDIATOR_CONTRACTID) );
  if (!mediator)
    return;

  nsCOMPtr<nsIDOMWindowInternal> domWindow;
  mediator->GetMostRecentWindow(aMailWindowName, getter_AddRefs(domWindow));
  if (domWindow)
  {
    if (aFolderUri)
    {
      nsCOMPtr<nsPIDOMWindow> piDOMWindow(do_QueryInterface(domWindow));
      if (piDOMWindow)
      {
        nsCOMPtr<nsISupports> xpConnectObj;
        piDOMWindow->GetObjectProperty(NS_LITERAL_STRING("MsgWindowCommands").get(), getter_AddRefs(xpConnectObj));
        nsCOMPtr<nsIMsgWindowCommands> msgWindowCommands = do_QueryInterface(xpConnectObj);
        if (msgWindowCommands)
          msgWindowCommands->SelectFolder(aFolderUri);
      }
    }

    domWindow->Focus();
  }
  else
  {
    // the user doesn't have a mail window open already so open one for them...
    nsCOMPtr<nsIMessengerWindowService> messengerWindowService =
      do_GetService(NS_MESSENGERWINDOWSERVICE_CONTRACTID);
    // if we want to preselect the first account with new mail,
    // here is where we would try to generate a uri to pass in
    // (and add code to the messenger window service to make that work)
    if (messengerWindowService)
      messengerWindowService->OpenMessengerWindowWithUri(
                                "mail:3pane", aFolderUri, nsMsgKey_None);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function: