Bug 700296 (Interfaces) - Remove dynamic containers implementation from Places.

r=dietrich sr=gavin
This commit is contained in:
Marco Bonardo 2011-11-29 02:22:49 +01:00
Родитель 4bf83ce793
Коммит 2074fdb7a7
4 изменённых файлов: 6 добавлений и 234 удалений

Просмотреть файл

@ -62,7 +62,6 @@ XPIDLSRCS += \
mozIPlacesAutoComplete.idl \ mozIPlacesAutoComplete.idl \
nsIAnnotationService.idl \ nsIAnnotationService.idl \
nsIBrowserHistory.idl \ nsIBrowserHistory.idl \
nsIDynamicContainer.idl \
nsIFaviconService.idl \ nsIFaviconService.idl \
nsILivemarkService.idl \ nsILivemarkService.idl \
nsINavBookmarksService.idl \ nsINavBookmarksService.idl \

Просмотреть файл

@ -1,114 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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.
*
* The Original Code is Places.
*
* The Initial Developer of the Original Code is Google Inc.
* Portions created by the Initial Developer are Copyright (C) 2005
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Annie Sullivan <annie.sullivan@gmail.com> (original author)
* Asaf Romano <mano@mozilla.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
interface nsIURI;
interface nsINavHistoryContainerResultNode;
interface nsINavHistoryQueryOptions;
/**
* The dynamic container interface provides a base class for services that want
* to provide containers for temporary contents.
*
* The service can fill result nodes directly into the container when it is
* being opened. It can use the property bag on every result node to store data
* associated with each item, such as full path on disk. It would create
* additional containers for each container, registered to its service.
*
* See also createDynamicContainer in nsINavBookmarksService.
*/
[scriptable, uuid(7e85d97b-4109-4ea7-afd8-bc2cd3840d70)]
interface nsIDynamicContainer : nsISupports
{
/**
* Called when the given container node is about to be populated so that the
* service can populate the container if necessary.
*
* @param aContainer
* The container node for the container being opened. Note that all
* result nodes implement a property bag if you need to store state.
* @param aOptions
* The options used to generate this query. Containers should follow
* these when possible, for example, whether to expand queries, etc.
* Implementations should use this when possible if adding query and
* folder nodes to the container. DO NOT MODIFY THIS VALUE.
*/
void onContainerNodeOpening(in nsINavHistoryContainerResultNode aContainer,
in nsINavHistoryQueryOptions aOptions);
/**
* Called when the given container has just been collapsed so that the
* service can do any necessary cleanup. This is NOT guaranteed to get
* called. In particular, if the query just goes away, you will not get this
* call. This only happens when the container itself goes from the open state
* to the closed state. A service with large numbers of dynamically populated
* items might use this to do some cleanup so those items don't hang around
*
* @param aContainer
* The container node of the container being closed. The service need
* not worry about removing any created nodes, they will be
* automatically removed when this call completes.
*/
void onContainerNodeClosed(in nsINavHistoryContainerResultNode aContainer);
/**
* Called when the given container is about to be deleted from the bookmarks
* table, so that the service can do any necessary cleanup.
* Called BEFORE the container is deleted, so that the service
* can still reference it.
* @param aItemId
* The item-id of the container item.
*/
void onContainerRemoving(in long long aItemId);
/**
* Called when the given container has just been moved, in case
* the service needs to do any bookkeeping.
* Called AFTER the container has been moved.
* @param aItemId
* The item-id of the container item.
* @param aNewParent
* The item of the new parent folder for the container.
* @param aNewIndex
* The index the container will be inserted at, or -1 for append.
*/
void onContainerMoved(in long long aItemId,
in long long aNewParent, in long aNewIndex);
};

Просмотреть файл

@ -281,7 +281,7 @@ interface nsINavBookmarkObserver : nsISupports
* folders. A URI in history can be contained in one or more such folders. * folders. A URI in history can be contained in one or more such folders.
*/ */
[scriptable, uuid(573f99bd-988c-4253-836f-4ce009d33ac6)] [scriptable, uuid(5398fdee-72d8-4100-9863-6bb7f88274e0)]
interface nsINavBookmarksService : nsISupports interface nsINavBookmarksService : nsISupports
{ {
/** /**
@ -319,6 +319,8 @@ interface nsINavBookmarksService : nsISupports
const unsigned short TYPE_BOOKMARK = 1; const unsigned short TYPE_BOOKMARK = 1;
const unsigned short TYPE_FOLDER = 2; const unsigned short TYPE_FOLDER = 2;
const unsigned short TYPE_SEPARATOR = 3; const unsigned short TYPE_SEPARATOR = 3;
// Dynamic containers are deprecated and unsupported.
// This const exists just to avoid reusing the value.
const unsigned short TYPE_DYNAMIC_CONTAINER = 4; const unsigned short TYPE_DYNAMIC_CONTAINER = 4;
/** /**
@ -360,24 +362,6 @@ interface nsINavBookmarksService : nsISupports
long long createFolder(in long long aParentFolder, in AUTF8String name, long long createFolder(in long long aParentFolder, in AUTF8String name,
in long index); in long index);
/**
* Creates a dynamic container under the given parent folder.
*
* @param aParentFolder
* The id of the parent folder
* @param aName
* The name of the new folder
* @param aContractId
* The contract id of the service which is to manipulate this
* container.
* @param aIndex
* The index to insert at, or DEFAULT_INDEX to append
*
* @return The ID of the newly-inserted folder.
*/
long long createDynamicContainer(in long long aParentFolder, in AUTF8String aName,
in AString aContractId, in long aIndex);
/** /**
* Gets an undo-able transaction for removing a folder from the bookmarks * Gets an undo-able transaction for removing a folder from the bookmarks
* tree. * tree.

Просмотреть файл

@ -90,6 +90,8 @@ interface nsINavHistoryResultNode : nsISupports
const unsigned long RESULT_TYPE_URI = 0; // nsINavHistoryResultNode const unsigned long RESULT_TYPE_URI = 0; // nsINavHistoryResultNode
const unsigned long RESULT_TYPE_VISIT = 1; // nsINavHistoryVisitResultNode const unsigned long RESULT_TYPE_VISIT = 1; // nsINavHistoryVisitResultNode
const unsigned long RESULT_TYPE_FULL_VISIT = 2; // nsINavHistoryFullVisitResultNode const unsigned long RESULT_TYPE_FULL_VISIT = 2; // nsINavHistoryFullVisitResultNode
// Dynamic containers are deprecated and unsupported.
// This const exists just to avoid reusing the value.
const unsigned long RESULT_TYPE_DYNAMIC_CONTAINER = 4; // nsINavHistoryContainerResultNode const unsigned long RESULT_TYPE_DYNAMIC_CONTAINER = 4; // nsINavHistoryContainerResultNode
const unsigned long RESULT_TYPE_QUERY = 5; // nsINavHistoryQueryResultNode const unsigned long RESULT_TYPE_QUERY = 5; // nsINavHistoryQueryResultNode
const unsigned long RESULT_TYPE_FOLDER = 6; // nsINavHistoryQueryResultNode const unsigned long RESULT_TYPE_FOLDER = 6; // nsINavHistoryQueryResultNode
@ -233,7 +235,7 @@ interface nsINavHistoryFullVisitResultNode : nsINavHistoryVisitResultNode
* Bookmark folders and places queries will be QueryResultNodes which extends * Bookmark folders and places queries will be QueryResultNodes which extends
* these items. * these items.
*/ */
[scriptable, uuid(55829318-0f6c-4503-8739-84231f3a6793)] [scriptable, uuid(62534d3c-1b3f-401e-b3ba-b911f57f8a29)]
interface nsINavHistoryContainerResultNode : nsINavHistoryResultNode interface nsINavHistoryContainerResultNode : nsINavHistoryResultNode
{ {
@ -323,105 +325,6 @@ interface nsINavHistoryContainerResultNode : nsINavHistoryResultNode
* been called to override it, and true for non-folder nodes. * been called to override it, and true for non-folder nodes.
*/ */
readonly attribute boolean childrenReadOnly; readonly attribute boolean childrenReadOnly;
// --------------------------------------------------------------------------
// Dynamic container
/**
* This is a string representing the dynamic container API service that is
* responsible for this container. This throws if if the node is not a dynamic
* container.
*/
readonly attribute AUTF8String dynamicContainerType;
/**
* Appends a full visit node to this container and returns it. For the dynamic
* container API. TO BE CALLED FROM nsIDynamicContainer::OnContainerOpening()
* ONLY, and only for non-bookmark-folder containers.
*
* @see nsINavHistoryURIResultNode for parameters.
*/
nsINavHistoryResultNode appendURINode(
in AUTF8String aURI, in AUTF8String aTitle, in PRUint32 aAccessCount,
in PRTime aTime, in AUTF8String aIconURI);
/**
* Appends a full visit node to this container and returns it. For the dynamic
* container API. TO BE CALLED FROM nsIDynamicContainer::OnContainerOpening()
* ONLY, and only for non-bookmark-folder containers.
*
* @see nsINavHistoryVisitResultNode for parameters.
*
* UNTESTED: Container API functions are commented out until we can test
*/
/*nsINavHistoryVisitResultNode appendVisitNode(
in AUTF8String aURI, in AUTF8String aTitle, in PRUint32 aAccessCount,
in PRTime aTime, in AUTF8String aIconURI, in PRInt64 aSession);*/
/**
* Appends a full visit node to this container and returns it. For the dynamic
* container API. TO BE CALLED FROM nsIDynamicContainer::OnContainerOpening()
* ONLY, and only for non-bookmark-folder containers.
*
* @see nsINavHistoryFullVisitResultNode for parameters.
*
* UNTESTED: Container API functions are commented out until we can test
*/
/*nsINavHistoryFullVisitResultNode appendFullVisitNode(
in AUTF8String aURI, in AUTF8String aTitle, in PRUint32 aAccessCount,
in PRTime aTime, in AUTF8String aIconURI, in PRInt64 aSession,
in PRInt64 aVisitId, in PRInt64 aReferringVisitId,
in PRInt32 aTransitionType);*/
/**
* Appends a container node to this container and returns it. For the dynamic
* container API. TO BE CALLED FROM nsIDynamicContainer::OnContainerOpening()
* ONLY, and only for non-bookmark-folder containers.
*
* aContainerType should be RESULT_TYPE_DYNAMIC_CONTAINER.
* When type is dynamic container you must
* specify a dynamic container type, otherwise, the dynamic container type must
* be null. Use appendQueryNode and appendFolderNode for the other container
* types.
*
* UNTESTED: Container API functions are commented out until we can test
*/
/*nsINavHistoryContainerResultNode appendContainerNode(
in AUTF8String aTitle, in AUTF8String aIconURI, in PRUint32 aContainerType,
in AUTF8String aDynamicContainerType);*/
/**
* Appends a query node to this container and returns it. For the dynamic
* container API. TO BE CALLED FROM nsIDynamicContainer::OnContainerOpening()
* ONLY, and only for non-bookmark-folder containers.
*
* Normally you should supply an empty string for IconURI and it will take
* the default query icon for the current theme.
*
* UNTESTED: Container API functions are commented out until we can test
*/
/*nsINavHistoryQueryResultNode appendQueryNode(
in AUTF8String aQueryURI, in AUTF8String aTitle, in AUTF8String aIconURI);*/
/**
* Appends a bookmark folder node to this container and returns it. For the
* dynamic container API. TO BE CALLED FROM nsIDynamicContainer::OnContainerOpening()
* ONLY, and only for non-bookmark-folder containers.
*
* All container attributes will come from the boomkarks service for this
* folder.
*/
nsINavHistoryContainerResultNode appendFolderNode(in PRInt64 aFolderId);
/**
* Clears all children of this container. For the dynamic container API.
* TO BE CALLED FROM nsIDynamicContainer::OnContainerOpening and
* nsIDynamicContainer::OnContainerClosed ONLY, and valid only for
* non-bookmark-folder containers.
*
* UNTESTED: Container API functions are commented out until we can test
*/
/*void clearContents();*/
}; };