#region Disclaimer / License
// Copyright (C) 2009, Kenneth Skovhede
// http://www.hexad.dk, opensource@hexad.dk
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
#endregion
using System;
namespace OSGeo.MapGuide.Maestro
{
///
/// This interface describes all the required methods and properties a resource editor must have
/// The .Net interface model does not allow an interface to describe the required constructors.
/// The required constructors are:
///
/// Constructor(EditorInterface editor);
/// Constructor(EditorInterface editor, string resourceID);
///
/// The first constructor is used for creating a new resource, the second for editing an existing.
///
public interface IResourceEditorControl
{
///
/// Gets or sets the resource in its current state
///
object Resource { get; set; }
///
/// Refreshes the display to reflect the current object
///
void UpdateDisplay();
///
/// Gets or sets the ID of the current resource
///
string ResourceId { get; set; }
///
/// Initiates a preview, returns true if the call succeded
///
bool Preview();
///
/// Validates the current resource, returns true if the call succeded
///
bool ValidateResource(bool recursive);
///
/// Initiates profiling, returns true if the call succeded
///
bool Profile();
///
/// Returns a value indicating if the editor supports previews
///
bool SupportsPreview { get; }
///
/// Returns a value indicating if the editor supports validation
///
bool SupportsValidate { get; }
///
/// Returns a value indicating if the editor supports profiling
///
bool SupportsProfiling { get; }
///
/// Called before a save, to let the provider do the save, or some preliminary work.
/// Return false to let the generic code handle the save.
///
bool Save(string savename);
}
}