Back to index

lightning-sunbird  0.9+nobinonly
nsICookieService.idl
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either the GNU General Public License Version 2 or later (the "GPL"), or
00026  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 #include "nsISupports.idl"
00039 
00040 interface nsIURI;
00041 interface nsIPrompt;
00042 interface nsIChannel;
00043 
00077 [scriptable, uuid(011C3190-1434-11d6-A618-0010A401EB10)]
00078 interface nsICookieService : nsISupports
00079 {
00080   /*
00081    * Get the complete cookie string associated with the URI.
00082    *
00083    * @param aURI
00084    *        the URI of the document for which cookies are being queried.
00085    * @param aChannel
00086    *        the channel used to load the document.  this parameter may be null,
00087    *        but it is strongly recommended that a non-null value be provided to
00088    *        ensure that the cookie privacy preferences are honored.
00089    *
00090    * @return the resulting cookie string
00091    */
00092   string getCookieString(in nsIURI aURI, in nsIChannel aChannel);
00093 
00094   /*
00095    * Get the complete cookie string associated with the URI.
00096    *
00097    * XXX this function is redundant and will most likely be removed in a future
00098    * revision of this interface.  GetCookieString will query the documentURI
00099    * property off of nsIHttpChannelInternal if supported, so GetCookieString
00100    * can be used in place of this method.
00101    *
00102    * @param aURI
00103    *        the URI of the document for which cookies are being queried.
00104    * @param aFirstURI
00105    *        the URI that the user originally typed in or clicked on to initiate
00106    *        the load of the document referenced by aURI.
00107    * @param aChannel
00108    *        the channel used to load the document.  this parameter may be null,
00109    *        but it is strongly recommended that a non-null value be provided to
00110    *        ensure that the cookie privacy preferences are honored.
00111    *
00112    * @return the resulting cookie string
00113    */
00114   string getCookieStringFromHttp(in nsIURI aURI, in nsIURI aFirstURI, in nsIChannel aChannel);
00115 
00116   /*
00117    * Set the cookie string associated with the URI.
00118    *
00119    * @param aURI
00120    *        the URI of the document for which cookies are being set.
00121    * @param aPrompt
00122    *        the prompt to use for all user-level cookie notifications.
00123    * @param aCookie
00124    *        the cookie string to set.
00125    * @param aChannel
00126    *        the channel used to load the document.  this parameter may be null,
00127    *        but it is strongly recommended that a non-null value be provided to
00128    *        ensure that the cookie privacy preferences are honored.
00129    *
00130    * XXX should be able to allow null aPrompt, since nsIPrompt can be queryied
00131    * from aChannel.
00132    */
00133   void setCookieString(in nsIURI aURI, in nsIPrompt aPrompt, in string aCookie, in nsIChannel aChannel);
00134 
00135   /*
00136    * Set the cookie string and expires associated with the URI.
00137    *
00138    * XXX this function is redundant and will most likely be removed in a future
00139    * revision of this interface.  SetCookieString will query the documentURI
00140    * property off of nsIHttpChannelInternal if supported, and SetCookieString
00141    * could also query the Date header from the channel if aChannel supports
00142    * nsIHttpChannel.
00143    *
00144    * @param aURI
00145    *        the URI of the document for which cookies are being set.
00146    * @param aFirstURI
00147    *        the URI that the user originally typed in or clicked on to initiate
00148    *        the load of the document referenced by aURI.
00149    * @param aPrompt
00150    *        the prompt to use for all user-level cookie notifications.
00151    * @param aCookie
00152    *        the cookie string to set.
00153    * @param aServerTime
00154    *        the expiry information of the cookie (the Date header from the HTTP
00155    *        response).
00156    * @param aChannel
00157    *        the channel used to load the document.  this parameter may be null,
00158    *        but it is strongly recommended that a non-null value be provided to
00159    *        ensure that the cookie privacy preferences are honored.
00160    */
00161   void setCookieStringFromHttp(in nsIURI aURI, in nsIURI aFirstURI, in nsIPrompt aPrompt, in string aCookie, in string aServerTime, in nsIChannel aChannel);
00162 
00168   readonly attribute boolean cookieIconIsVisible;
00169 };