IDL-ify this interface

had to make nsFileSpec non-const for now


git-svn-id: svn://10.0.0.236/trunk@32888 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
alecf%netscape.com
1999-05-27 04:51:20 +00:00
parent a5732710d0
commit 241968b8ac
4 changed files with 88 additions and 74 deletions

View File

@@ -1,84 +1,35 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM nsIMailboxService.idl
*/
#ifndef nsIMailboxService_h___
#define nsIMailboxService_h___
#ifndef __gen_nsIMailboxService_h__
#define __gen_nsIMailboxService_h__
#include "nscore.h"
#include "nsISupports.h"
#include "MailNewsTypes.h"
#include "nsISupports.h" /* interface nsISupports */
#include "nsrootidl.h" /* interface nsrootidl */
#include "nsIUrlListener.h" /* interface nsIUrlListener */
class nsIURL; /* forward decl */
class nsIStreamListener; /* forward decl */
#include "nsFileSpec.h"
/* EEF82460-CB69-11d2-8065-006008128C4E */
#define NS_IMAILBOXSERVICE_IID \
{ 0xeef82460, 0xcb69, 0x11d2, \
{ 0x80, 0x65, 0x0, 0x60, 0x8, 0x12, 0x8c, 0x4e } }
/* starting interface: nsIMailboxService */
#define NS_MAILBOXSERVICE_CID \
{ /* EEF82462-CB69-11d2-8065-006008128C4E */ \
0xeef82462, 0xcb69, 0x11d2, \
{0x80, 0x65, 0x0, 0x60, 0x8, 0x12, 0x8c, 0x4e}}
/* {EEF82460-CB69-11d2-8065-006008128C4E} */
#define NS_IMAILBOXSERVICE_IID_STR "EEF82460-CB69-11d2-8065-006008128C4E"
#define NS_IMAILBOXSERVICE_IID \
{0xEEF82460, 0xCB69, 0x11d2, \
{ 0x80, 0x65, 0x00, 0x60, 0x08, 0x12, 0x8C, 0x4E }}
////////////////////////////////////////////////////////////////////////////////////////
// The Mailbox Service is an interface designed to make building and running mailbox urls
// easier. I'm not sure if this service will go away when the new networking model comes
// on line (as part of the N2 project). So I reserve the right to change my mind and take
// this service away =).
////////////////////////////////////////////////////////////////////////////////////////
class nsIURL;
class nsIStreamListener;
class nsIUrlListener;
class nsIMailboxService : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IMAILBOXSERVICE_IID)
class nsIMailboxService : public nsISupports
{
public:
static const nsIID& GetIID() { static nsIID iid = NS_IMAILBOXSERVICE_IID; return iid; }
/////////////////////////////////////////////////////////////////////////////////////////////
// All of these functions build mailbox urls and run them. If you want a handle
// on the running task, pass in a valid nsIURL ptr. You can later interrupt this action by
// asking the netlib service manager to interrupt the url you are given back. Remember to release
// aURL when you are done with it. Pass nsnull in for aURL if you don't care about
// the returned URL.
/////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////
// Pass in a file path for the mailbox you wish to parse. You also need to pass in a mailbox
// parser (the consumer). The url listener can be null if you have no interest in tracking
// the url.
//////////////////////////////////////////////////////////////////////////////////////////////
NS_IMETHOD ParseMailbox(const nsFileSpec& aMailboxPath, nsIStreamListener * aMailboxParser,
nsIUrlListener * aUrlListener, nsIURL ** aURL) = 0;
/////////////////////////////////////////////////////////////////////////////////////////////
// This is more of a convience function for testing purposes. We want to able to say: display
// message number 'n' in this mailbox without having to go out and get the key for message number
// 'n'. this function simply makes that possible.
/////////////////////////////////////////////////////////////////////////////////////////////
NS_IMETHOD DisplayMessageNumber(const char *url,
PRUint32 aMessageNumber,
nsISupports * aDisplayConsumer,
nsIUrlListener * aUrlListener,
nsIURL ** aURL) = 0;
/* nsIURL ParseMailbox (in nsFileSpec aMailboxPath, in nsIStreamListener aMailboxParser, in nsIUrlListener aUrlListener); */
NS_IMETHOD ParseMailbox(nsFileSpec & aMailboxPath, nsIStreamListener *aMailboxParser, nsIUrlListener *aUrlListener, nsIURL **_retval) = 0;
/* nsIURL DisplayMessageNumber (in string url, in unsigned long aMessageNumber, in nsISupports aDisplayConsumer, in nsIUrlListener aUrlListener); */
NS_IMETHOD DisplayMessageNumber(const char *url, PRUint32 aMessageNumber, nsISupports *aDisplayConsumer, nsIUrlListener *aUrlListener, nsIURL **_retval) = 0;
};
#endif /* nsIMailboxService_h___ */
#endif /* __gen_nsIMailboxService_h__ */

View File

@@ -0,0 +1,62 @@
/* -*- 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 "nsISupports.idl"
#include "nsIUrlListener.idl"
interface nsIURL;
interface nsIStreamListener;
[ref] native nsFileSpec(nsFileSpec);
%{C++
#include "nsFileSpec.h"
%}
[scriptable, uuid(EEF82460-CB69-11d2-8065-006008128C4E)]
interface nsIMailboxService : nsISupports {
/*
* All of these functions build mailbox urls and run them. If you want a
* handle on the running task, pass in a valid nsIURL ptr. You can later
* interrupt this action by asking the netlib service manager to interrupt
* the url you are given back. Remember to release aURL when you are done
* with it. Pass nsnull in for aURL if you don't care about the returned URL.
*/
/*
* Pass in a file path for the mailbox you wish to parse. You also need to
* pass in a mailbox parser (the consumer). The url listener can be null
* if you have no interest in tracking the url.
*/
nsIURL ParseMailbox(in nsFileSpec aMailboxPath,
in nsIStreamListener aMailboxParser,
in nsIUrlListener aUrlListener);
/*
* This is more of a convience function for testing purposes. We want
* to able to say: display message number 'n' in this mailbox without
* having to go out and get the key for message number 'n'. this
* function simply makes that possible.
*/
nsIURL DisplayMessageNumber(in string url,
in unsigned long aMessageNumber,
in nsISupports aDisplayConsumer,
in nsIUrlListener aUrlListener);
};

View File

@@ -32,6 +32,7 @@
#include "nsMsgDBCID.h"
#include "nsMsgKeyArray.h"
#include "nsLocalUtils.h"
#include "nsMsgLocalCID.h"
// we need this because of an egcs 1.0 (and possibly gcc) compiler bug
// that doesn't allow you to call ::nsISupports::GetIID() inside of a class
@@ -81,7 +82,7 @@ nsresult nsMailboxService::QueryInterface(const nsIID &aIID, void** aInstancePtr
return NS_NOINTERFACE;
}
nsresult nsMailboxService::ParseMailbox(const nsFileSpec& aMailboxPath, nsIStreamListener *aMailboxParser,
nsresult nsMailboxService::ParseMailbox(nsFileSpec& aMailboxPath, nsIStreamListener *aMailboxParser,
nsIUrlListener * aUrlListener, nsIURL ** aURL)
{
nsCOMPtr<nsIMailboxUrl> url;

View File

@@ -49,7 +49,7 @@ public:
// we suppport the nsIMailboxService Interface
////////////////////////////////////////////////////////////////////////////////////////
NS_IMETHOD ParseMailbox(const nsFileSpec& aMailboxPath, nsIStreamListener * aMailboxParser,
NS_IMETHOD ParseMailbox(nsFileSpec& aMailboxPath, nsIStreamListener * aMailboxParser,
nsIUrlListener * aUrlListener, nsIURL ** aURL);