summaryrefslogtreecommitdiffstats
path: root/mailnews/local/src/nsPop3Service.h
blob: 61dd9cf5cf8d47b7c46f13d83a136982dfa93f40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsPop3Service_h___
#define nsPop3Service_h___

#include "nscore.h"

#include "nsIPop3Service.h"
#include "nsIPop3URL.h"
#include "nsIUrlListener.h"
#include "nsIStreamListener.h"
#include "nsIProtocolHandler.h"
#include "nsIMsgProtocolInfo.h"
#include "nsTObserverArray.h"

class nsIMsgMailNewsUrl;

class nsPop3Service : public nsIPop3Service,
                      public nsIProtocolHandler,
                      public nsIMsgProtocolInfo
{
public:

  nsPop3Service();
  
  NS_DECL_ISUPPORTS
  NS_DECL_NSIPOP3SERVICE
  NS_DECL_NSIPROTOCOLHANDLER
  NS_DECL_NSIMSGPROTOCOLINFO

protected:
  virtual ~nsPop3Service();
  nsresult GetMail(bool downloadNewMail,
                   nsIMsgWindow* aMsgWindow, 
                   nsIUrlListener * aUrlListener,
                   nsIMsgFolder *inbox, 
                   nsIPop3IncomingServer *popServer,
                   nsIURI ** aURL);
  // convience function to make constructing of the pop3 url easier...
  nsresult BuildPop3Url(const char * urlSpec, nsIMsgFolder *inbox,
                    nsIPop3IncomingServer *, nsIUrlListener * aUrlListener,
                    nsIURI ** aUrl, nsIMsgWindow *aMsgWindow);

  nsresult RunPopUrl(nsIMsgIncomingServer * aServer, nsIURI * aUrlToRun);
  void AlertServerBusy(nsIMsgMailNewsUrl *url);
  nsTObserverArray<nsCOMPtr<nsIPop3ServiceListener> > mListeners;
};

#endif /* nsPop3Service_h___ */