зеркало из https://github.com/mozilla/gecko-dev.git
(not part of the build yet) a=cyeh.
implementation of the nsIImapIncomingServer interface. This class is responsible for maintaining an up to date list of all the prefs for a given imap server.
This commit is contained in:
Родитель
e7d5334609
Коммит
0e219bc9ac
|
@ -0,0 +1,92 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "msgCore.h"
|
||||
|
||||
#include "nsIImapIncomingServer.h"
|
||||
#include "nsImapIncomingServer.h"
|
||||
#include "nsMsgIncomingServer.h"
|
||||
|
||||
#include "nsIPref.h"
|
||||
|
||||
#include "prmem.h"
|
||||
#include "plstr.h"
|
||||
|
||||
|
||||
/* get some implementation from nsMsgIncomingServer */
|
||||
class nsImapIncomingServer : public nsMsgIncomingServer,
|
||||
public nsIImapIncomingServer
|
||||
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
nsImapIncomingServer();
|
||||
virtual ~nsImapIncomingServer();
|
||||
|
||||
// we support the nsIImapIncomingServer interface
|
||||
NS_IMPL_CLASS_GETSET_STR(RootFolderPath, m_rootFolderPath);
|
||||
|
||||
NS_IMETHOD LoadPreferences(nsIPref *prefs, const char *serverKey);
|
||||
|
||||
private:
|
||||
char *m_rootFolderPath;
|
||||
};
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED(nsImapIncomingServer,
|
||||
nsMsgIncomingServer,
|
||||
nsIImapIncomingServer);
|
||||
|
||||
|
||||
|
||||
nsImapIncomingServer::nsImapIncomingServer() : m_rootFolderPath(nsnull)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
}
|
||||
|
||||
nsImapIncomingServer::~nsImapIncomingServer()
|
||||
{
|
||||
PR_FREEIF(m_rootFolderPath);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsImapIncomingServer::LoadPreferences(nsIPref *prefs,
|
||||
const char *serverKey)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printf("Loading imap prefs for %s..\n",serverKey);
|
||||
#endif
|
||||
|
||||
nsMsgIncomingServer::LoadPreferences(prefs, serverKey);
|
||||
|
||||
// now load imap server specific preferences
|
||||
m_rootFolderPath = getCharPref(prefs, serverKey, "directory");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult NS_NewImapIncomingServer(const nsIID& iid,
|
||||
void **result)
|
||||
{
|
||||
nsImapIncomingServer *server;
|
||||
if (!result) return NS_ERROR_NULL_POINTER;
|
||||
server = new nsImapIncomingServer();
|
||||
|
||||
return server->QueryInterface(iid, result);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef __nsImapIncomingServer_h
|
||||
#define __nsImapIncomingServer_h
|
||||
|
||||
#include "nsIImapIncomingServer.h"
|
||||
#include "nscore.h"
|
||||
|
||||
#define NS_IMAPINCOMINGSERVER_CID \
|
||||
{ /* 8D3675E0-ED46-11d2-8077-006008128C4E */ \
|
||||
0x8d3675e0, 0xed46, 0x11d2, \
|
||||
{0x80, 0x77, 0x0, 0x60, 0x8, 0x12, 0x8c, 0x4e}}
|
||||
|
||||
NS_BEGIN_EXTERN_C
|
||||
|
||||
nsresult NS_NewImapIncomingServer(const nsIID& iid, void **result);
|
||||
|
||||
NS_END_EXTERN_C
|
||||
|
||||
#endif
|
Загрузка…
Ссылка в новой задаче