//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using System.Collections.Generic;
using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel;
namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes
{
///
/// A supports creation of children
/// for a class of objects in the tree. The
///
public abstract class ChildFactory
{
///
/// The set of applicable parents for which the factory can create children.
///
///
/// the string names for each that
/// this factory can create children for
///
public abstract IEnumerable ApplicableParents();
///
/// Expands an element in the
///
/// Parent Node
/// force to refresh
/// name of the sql object to filter
///
public abstract IEnumerable Expand(TreeNode parent, bool refresh, string name, bool includeSystemObjects);
///
/// The list of filters that should be applied on the smo object list
///
public abstract IEnumerable Filters { get; }
///
/// The list of properties to be loaded with the object
///
public abstract IEnumerable SmoProperties { get; }
///
/// Returns the node sub type if the object can have sub types otehr wise returns empty string
///
public abstract string GetNodeSubType(object context);
///
/// Returns the status of the object assigned to node. If the object doesn't spport status returns empty string
///
public abstract string GetNodeStatus(object context);
///
/// Returns the custom name of the object assigned to the node. If the object doesn't have custom name, returns empty string
///
public abstract string GetNodeCustomName(object smoObject, SmoQueryContext smoContext);
public abstract bool CanCreateChild(TreeNode parent, object context);
public abstract TreeNode CreateChild(TreeNode parent, object context);
// TODO Consider whether Remove operations need to be supported
//public abstract bool CanRemoveChild(TreeNode parent, object context);
//public abstract int GetChildIndexToRemove(TreeNode parent, object context);
}
}