Back to index

lightning-sunbird  0.9+nobinonly
nsISubscribableServer.idl
Go to the documentation of this file.
00001 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
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  *   Seth Spitzer <sspitzer@netscape.com>
00024  *
00025  * Alternatively, the contents of this file may be used under the terms of
00026  * either of the GNU General Public License Version 2 or later (the "GPL"),
00027  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00028  * in which case the provisions of the GPL or the LGPL are applicable instead
00029  * of those above. If you wish to allow use of your version of this file only
00030  * under the terms of either the GPL or the LGPL, and not to allow others to
00031  * use your version of this file under the terms of the MPL, indicate your
00032  * decision by deleting the provisions above and replace them with the notice
00033  * and other provisions required by the GPL or the LGPL. If you do not delete
00034  * the provisions above, a recipient may use your version of this file under
00035  * the terms of any one of the MPL, the GPL or the LGPL.
00036  *
00037  * ***** END LICENSE BLOCK ***** */
00038 
00039 #include "nsISupports.idl"
00040 #include "nsISupportsArray.idl"
00041 
00042 interface nsIMsgWindow;
00043 interface nsIMsgIncomingServer;
00044 interface nsIRDFResource;
00045 interface nsIRDFNode;
00046 
00047 [scriptable, uuid(61a08c3a-1dd2-11b2-b64f-c4b2de1cf129)]
00048 interface nsISubscribeDataSource : nsISupports {
00049     readonly attribute boolean hasObservers;
00050     void NotifyObservers(in nsIRDFResource subject, in nsIRDFResource property, in nsIRDFNode object, in boolean isAssert, in boolean isChange);
00051 };
00052 
00053 [scriptable, uuid(f337b84a-1dd1-11b2-97c7-fb8b2e3f2280)]
00054 interface nsISubscribeListener : nsISupports {
00055        void OnDonePopulating();
00056 };
00057 
00058 [scriptable, uuid(4afd3d64-f7e9-4eb6-98bf-8200a7dab60f)]
00059 interface nsISubscribableServer : nsISupports {
00060        attribute nsISubscribeListener subscribeListener;
00061        attribute char delimiter;
00062 
00063        void startPopulating(in nsIMsgWindow aMsgWindow, in boolean forceToServer);
00064        void startPopulatingWithUri(in nsIMsgWindow aMsgWindow, in boolean forceToServer, in string uri);
00065     void stopPopulating(in nsIMsgWindow aMsgWindow);
00066 
00067     // return true if state changed, false otherwise
00068     boolean setState(in AUTF8String path, in boolean state);
00069 
00070        void subscribeCleanup();
00071 
00072        void subscribe(in wstring name);
00073        void unsubscribe(in wstring name);
00074 
00075     void commitSubscribeChanges();
00076 
00077     // other stuff
00078        void setIncomingServer(in nsIMsgIncomingServer server);
00079     void addTo(in AUTF8String aName, in boolean addAsSubscribed,
00080                in boolean aSubscribable, in boolean aChangeIfExists);
00081     void setAsSubscribed(in AUTF8String path);
00082        void updateSubscribed();
00083        void setShowFullName(in boolean showFullName);
00084  
00085     // if path is null, use the root
00086     boolean hasChildren(in AUTF8String path);
00087     // if path is null, use the root
00088     boolean isSubscribed(in AUTF8String path);
00089     // if path is null, use the root
00090     boolean isSubscribable(in AUTF8String path);
00091     // if path is null, use the root
00092     AString getLeafName(in AUTF8String path);
00093     // if path is null, use the root
00094     void getChildren(in AUTF8String path, in nsISupportsArray array);
00095     // if path is null, use the root
00096     AUTF8String getFirstChildURI(in AUTF8String path);
00097 
00098     // for searching
00099     void setSearchValue(in AString searchValue);
00100     readonly attribute boolean supportsSubscribeSearch;
00101 };
00102