1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 
6 #include "msgCore.h"  // precompiled header...
7 
8 #include "nsPop3URL.h"
9 #include "nsPop3Protocol.h"
10 #include "nsString.h"
11 #include "prmem.h"
12 #include "plstr.h"
13 #include "prprf.h"
14 
nsPop3URL()15 nsPop3URL::nsPop3URL() : nsMsgMailNewsUrl() {}
16 
~nsPop3URL()17 nsPop3URL::~nsPop3URL() {}
18 
NS_IMPL_ISUPPORTS_INHERITED(nsPop3URL,nsMsgMailNewsUrl,nsIPop3URL)19 NS_IMPL_ISUPPORTS_INHERITED(nsPop3URL, nsMsgMailNewsUrl, nsIPop3URL)
20 
21 ////////////////////////////////////////////////////////////////////////////////////
22 // Begin nsIPop3URL specific support
23 ////////////////////////////////////////////////////////////////////////////////////
24 
25 nsresult nsPop3URL::SetPop3Sink(nsIPop3Sink* aPop3Sink) {
26   if (aPop3Sink) m_pop3Sink = aPop3Sink;
27   return NS_OK;
28 }
29 
GetPop3Sink(nsIPop3Sink ** aPop3Sink)30 nsresult nsPop3URL::GetPop3Sink(nsIPop3Sink** aPop3Sink) {
31   if (aPop3Sink) {
32     *aPop3Sink = m_pop3Sink;
33     NS_IF_ADDREF(*aPop3Sink);
34   }
35   return NS_OK;
36 }
37 
38 NS_IMETHODIMP
GetMessageUri(nsACString & aMessageUri)39 nsPop3URL::GetMessageUri(nsACString& aMessageUri) {
40   if (m_messageUri.IsEmpty()) return NS_ERROR_NULL_POINTER;
41   aMessageUri = m_messageUri;
42   return NS_OK;
43 }
44 
45 NS_IMETHODIMP
SetMessageUri(const nsACString & aMessageUri)46 nsPop3URL::SetMessageUri(const nsACString& aMessageUri) {
47   m_messageUri = aMessageUri;
48   return NS_OK;
49 }
50