///
/// Copyright © 2003-2008 JetBrains s.r.o.
/// You may distribute under the terms of the GNU General Public License, as published by the Free Software Foundation, version 2 (see License.txt in the repository root folder).
///
using System;
namespace JetBrains.Omea.OpenAPI
{
///
/// Service for performing operations on Bookmarks in Omea.
///
public interface IBookmarkProfile: IDisposable
{
///
/// Name of the profile.
///
/// May consist of several parts splitted with '/' or '\'.
string Name { get; }
///
/// Starts importing of bookmarks.
///
void StartImport();
///
/// Returns array of chars forbidden for usage in bookmark names.
///
char[] InvalidNameChars { get; }
///
/// Checks whether specified resource can be created or updated (exported).
///
/// Weblink or folder resource to be exported.
/// Error message.
/// True if resource can be created.
/// If res is null then the function says whether the profile can export at all.
bool CanCreate( IResource res, out string error );
///
/// Checks whether specified resource can be renamed.
///
/// Weblink or folder resource to be renamed.
/// Error message.
/// True if resource can be renamed.
bool CanRename( IResource res, out string error );
///
/// Checks whether specified resource can be moved to the parent folder.
///
/// Weblink or folder resource.
/// Parent folder resource.
/// Error message.
/// True if resource can be moved.
bool CanMove( IResource res, IResource parent, out string error );
///
/// Checks whether specified resource can be deleted.
///
/// Weblink or folder resource.
/// Error message.
/// True if resource can be deleted.
bool CanDelete( IResource res, out string error );
///
/// Exports newly created or changed resource.
///
/// Weblink or folder resource.
void Create( IResource res );
///
/// Exports resource which is been renamed.
///
/// Weblink or folder resource.
/// New name of the resoruce.
/// When the method is called, the resource is still not reanmed.
void Rename( IResource res, string newName );
///
/// Exports moved resource.
///
/// Weblink or folder resource.
/// Parent folder resource.
/// Old parent folder resource.
void Move( IResource res, IResource parent, IResource oldParent );
///
/// Exports deletion of a resource.
///
/// Weblink or folder resource to be deleted.
void Delete( IResource res );
}
///
/// Service for performing operations on Bookmarks in Omea.
///
public interface IBookmarkService
{
///
/// Registers bookmark profile.
///
/// Profile to register.
void RegisterProfile( IBookmarkProfile profile );
///
/// Deregisters bookmark profile.
///
/// Profile to deregister.
void DeRegisterProfile( IBookmarkProfile profile );
///
/// Returns all registered profiles.
///
IBookmarkProfile[] Profiles { get; }
///
/// Gets owner profile.
///
/// Weblink or folder resource.
/// Returns owner profile for a weblink or folder resource,
/// or null is resource is not owned.
IBookmarkProfile GetOwnerProfile( IResource res );
///
/// Root resource for all weblinks, owned by profiles or not.
///
IResource BookmarksRoot { get; }
///
/// Gets root resource for a profile with specified name.
///
/// Bookmark profile name.
IResource GetProfileRoot( string profileName );
///
/// Gets root resource for specified profile.
///
/// Bookmark profile.
IResource GetProfileRoot( IBookmarkProfile profile );
///
/// Gets list of all bookmarks.
///
IResourceList GetBookmarks();
///
/// Gets list of bookmarks of specified profile.
///
/// Bookmark profile
IResourceList GetBookmarks( IBookmarkProfile profile );
IResource FindOrCreateBookmark( IResource parent, string name, string url );
IResource FindOrCreateFolder( IResource parent, string name );
///
/// Sets the name of weblink or folder.
///
/// Weblink or folder resource.
/// New name of resource.
void SetName( IResource res, string name );
///
/// Sets the URL of weblink resource.
///
/// Weblink resource.
/// URL of weblink.
void SetUrl( IResource res, string url );
///
/// Sets the parent folder of weblink or folder resource.
///
/// Weblink or folder resource.
/// Parent folder resource.
void SetParent( IResource res, IResource parent );
void DeleteBookmark( IResource res );
void DeleteBookmarks( IResourceList resources );
void DeleteFolder( IResource res );
void DeleteFolders( IResourceList resources );
}
}