1999-06-11 02:08:59 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/*
|
1999-11-06 06:43:54 +03:00
|
|
|
* The contents of this file are subject to the Netscape Public
|
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/NPL/
|
1999-06-11 02:08:59 +04:00
|
|
|
*
|
1999-11-06 06:43:54 +03:00
|
|
|
* Software distributed under the License is distributed on an "AS
|
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
1999-06-11 02:08:59 +04:00
|
|
|
*
|
1999-11-06 06:43:54 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
1999-06-11 02:08:59 +04:00
|
|
|
* Communications Corporation. Portions created by Netscape are
|
1999-11-06 06:43:54 +03:00
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
1999-06-11 02:08:59 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef nsICookieService_h__
|
|
|
|
#define nsICookieService_h__
|
|
|
|
|
|
|
|
#include "nsISupports.h"
|
1999-06-23 07:29:44 +04:00
|
|
|
#include "nsIURL.h"
|
1999-06-12 04:01:52 +04:00
|
|
|
#include "nsString.h"
|
1999-06-11 02:08:59 +04:00
|
|
|
|
2000-01-23 02:13:58 +03:00
|
|
|
// {AB397774-12D3-11d3-8AD1-00105A1B8860}
|
|
|
|
#define NS_COOKIESERVICE_CID \
|
|
|
|
{ 0xab397774, 0x12d3, 0x11d3, { 0x8a, 0xd1, 0x0, 0x10, 0x5a, 0x1b, 0x88, 0x60 } }
|
|
|
|
|
2000-01-23 01:46:13 +03:00
|
|
|
/* ProgID prefixes for Cookie DLL registration. */
|
|
|
|
#define NS_COOKIESERVICE_PROGID "component://netscape/cookie"
|
|
|
|
|
1999-06-11 02:08:59 +04:00
|
|
|
// {AB397772-12D3-11d3-8AD1-00105A1B8860}
|
|
|
|
#define NS_ICOOKIESERVICE_IID \
|
1999-08-10 02:43:18 +04:00
|
|
|
{ 0xab397772, 0x12d3, 0x11d3, { 0x8a, 0xd1, 0x0, 0x10, 0x5a, 0x1b, 0x88, 0x60 } }
|
1999-06-11 02:08:59 +04:00
|
|
|
|
|
|
|
class nsICookieService : public nsISupports {
|
|
|
|
public:
|
1999-06-12 04:01:52 +04:00
|
|
|
|
1999-07-31 17:22:20 +04:00
|
|
|
static const nsIID& GetIID() { static nsIID iid = NS_ICOOKIESERVICE_IID; return iid; }
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Get the complete cookie string associated with the URL
|
|
|
|
*
|
|
|
|
* @param aURL The URL for which to get the cookie string
|
|
|
|
* @param aCookie The string object which will hold the result
|
|
|
|
* @return Returns NS_OK if successful, or NS_FALSE if an error occurred.
|
|
|
|
*/
|
|
|
|
NS_IMETHOD GetCookieString(nsIURI *aURL, nsString& aCookie)=0;
|
|
|
|
|
1999-12-18 08:48:26 +03:00
|
|
|
/*
|
|
|
|
* Get the complete cookie string associated with the URL
|
|
|
|
*
|
|
|
|
* @param aURL The URL for which to get the cookie string
|
|
|
|
* @param aFirstURL The URL which the user typed in or clicked on
|
|
|
|
* @param aCookie The string object which will hold the result
|
|
|
|
* @return Returns NS_OK if successful, or NS_FALSE if an error occurred.
|
|
|
|
*/
|
|
|
|
NS_IMETHOD GetCookieStringFromHTTP(nsIURI *aURL, nsIURI *aFirstURL, nsString& aCookie)=0;
|
|
|
|
|
1999-07-31 17:22:20 +04:00
|
|
|
/*
|
|
|
|
* Set the cookie string associated with the URL
|
|
|
|
*
|
|
|
|
* @param aURL The URL for which to set the cookie string
|
|
|
|
* @param aCookie The string to set
|
|
|
|
* @return Returns NS_OK if successful, or NS_FALSE if an error occurred.
|
|
|
|
*/
|
|
|
|
NS_IMETHOD SetCookieString(nsIURI *aURL, const nsString& aCookie)=0;
|
|
|
|
|
1999-11-30 01:02:20 +03:00
|
|
|
/*
|
|
|
|
* Set the cookie string and expires associated with the URL
|
|
|
|
*
|
|
|
|
* @param aURL The URL for which to set the cookie string
|
1999-12-18 08:48:26 +03:00
|
|
|
* @param aFirstURL The URL which the user typed in or clicked on
|
1999-11-30 01:02:20 +03:00
|
|
|
* @param aCookie The char * string to set
|
|
|
|
* @param aExpires The expiry information of the cookie
|
|
|
|
* @return Returns NS_OK if successful, or NS_FALSE if an error occurred.
|
|
|
|
*/
|
1999-12-18 08:48:26 +03:00
|
|
|
NS_IMETHOD SetCookieStringFromHttp(nsIURI *aURL, nsIURI *aFirstURL, const char *aCookie, const char *aExpires)=0;
|
1999-11-30 01:02:20 +03:00
|
|
|
|
1999-08-09 22:36:55 +04:00
|
|
|
/*
|
|
|
|
* Blows away all permissions currently in the cookie permissions list,
|
|
|
|
* and then blows away all cookies currently in the cookie list.
|
|
|
|
*/
|
|
|
|
NS_IMETHOD Cookie_RemoveAllCookies(void)=0;
|
|
|
|
|
1999-07-31 17:22:20 +04:00
|
|
|
/*
|
|
|
|
* Interface routines for cookie viewer
|
|
|
|
*/
|
|
|
|
NS_IMETHOD Cookie_CookieViewerReturn(nsAutoString results)=0;
|
|
|
|
NS_IMETHOD Cookie_GetCookieListForViewer(nsString& aCookieList)=0;
|
2000-03-11 23:02:45 +03:00
|
|
|
NS_IMETHOD Cookie_GetPermissionListForViewer(nsString& aPermissionList, PRInt32 type)=0;
|
|
|
|
NS_IMETHOD Image_Block(nsAutoString imageURL)=0;
|
2000-03-27 00:26:15 +04:00
|
|
|
NS_IMETHOD Permission_Add(nsString imageURL, PRBool permission, PRInt32 type)=0;
|
2000-03-19 19:58:35 +03:00
|
|
|
NS_IMETHOD Image_CheckForPermission
|
|
|
|
(char * hostname, char * firstHostname, PRBool &permission)=0;
|
1999-12-23 01:41:18 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Specifies whether cookies will be accepted or not.
|
|
|
|
* XXX This method can be refined to return more specific information
|
|
|
|
* (i.e. whether we accept foreign cookies or not, etc.) if necessary.
|
|
|
|
*/
|
|
|
|
NS_IMETHOD CookieEnabled(PRBool* aEnabled)=0;
|
1999-06-11 02:08:59 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsICookieService_h__ */
|