#region Disclaimer / License
// Copyright (C) 2010, Jackie Ng
// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie@gmail.com
//
// 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;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.ComponentModel;
namespace Maestro.Base
{
///
/// Abstract view interface.
///
public interface IViewContent : ISubView
{
///
/// The title of the view
///
string Title { get; set; }
///
/// The view's description, this is the ToolTip content
///
string Description { get; set; }
///
/// Raised when the description has changed
///
event EventHandler DescriptionChanged;
///
/// Fires when the title has been changed
///
event EventHandler TitleChanged;
///
/// Detrmines if this view can be closed by the user, note that this does not affect the method
/// in any way. All view content can still be programmatically closed if they inherit from and
/// does not override the default implementation of
///
bool AllowUserClose { get; }
///
/// Makes this content active
///
void Activate();
///
/// Hides this view content. Can only be called when
///
void Hide();
///
/// Closes the view. This raises the event
///
///
void Close();
///
/// Fired when the view is activating
///
event EventHandler ViewContentActivating;
///
/// Fired when the view has been closed internally
///
event CancelEventHandler ViewContentClosing;
///
/// Fired when the view has been closed internally
///
event EventHandler ViewContentClosed;
///
/// Fired when the view is going to hide
///
event EventHandler ViewContentHiding;
///
/// Fired when the view, which was hidden is now being shown
///
event EventHandler ViewContentShowing;
///
/// Displays an exception message
///
/// The exception object
void ShowError(Exception ex);
///
/// Displays an error message
///
/// The message
void ShowError(string message);
///
/// Displays an alert message
///
/// The title of this message
/// The message
void ShowMessage(string title, string message);
///
/// Make a request for confirmation
///
/// The title of the confirmation message
/// The message
/// true if confirmed, false otherwise
bool Confirm(string title, string message);
///
/// Make a request for confirmation
///
/// The title of the confirmation message
/// The message template
/// The template values
/// true if confirmed, false otherwise
bool ConfirmFormatted(string title, string format, params string[] args);
///
/// Indicates whether this view is attached to a workbench
///
bool IsAttached { get; }
///
/// Indicates the default region this view content will be put in
///
ViewRegion DefaultRegion { get; }
}
///
/// Defines the possible regions of the user interface a can reside in
///
public enum ViewRegion
{
///
/// The view content will be docked to the left
///
Left,
///
/// The view content will be docked to the right
///
Right,
///
/// The view content will be docked to the bottom
///
Bottom,
///
/// The view content will be docked to the center, (in a tabbed document interface)
///
Document,
///
/// The view content will reside in a floating dialog
///
Floating,
///
/// The view content will reside in a modal dialog
///
Dialog
}
}