Files
cefsharp/CefSharp/IMenuModel.cs
T
amaitland fc4307629b Improve IMenuModel xml documentation
Add NotFound to CefMenuCommand
Strongly type some more of the params for IMenuModel
2015-08-31 12:12:56 +10:00

57 lines
2.0 KiB
C#

// Copyright © 2010-2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
namespace CefSharp
{
public interface IMenuModel
{
/// <summary>
/// Returns the number of items in this menu.
/// </summary>
int Count { get; }
/// <summary>
/// Remove all menu items. Can be used to disable the context menu. Returns true on success.
/// </summary>
/// <returns></returns>
bool Clear();
/// <summary>
/// Returns the label at the specified index or empty if not found due to
/// invalid range or the index being a separator.
/// </summary>
/// <param name="index">specified index</param>
/// <returns>Label or empty if not found due to invalid range or the index being a separator.</returns>
string GetLabelAt(int index);
/// <summary>
/// Returns the command id at the specified index or -1 if not found due to invalid range or the index being a separator.
/// </summary>
/// <param name="index">the index</param>
/// <returns>Command or -1 if not found due to invalid range or the index being a separator.</returns>
CefMenuCommand GetCommandIdAt(int index);
/// <summary>
/// Removes the item with the specified commandId.
/// </summary>
/// <param name="commandId">the command Id</param>
/// <returns> Returns true on success</returns>
bool Remove(CefMenuCommand commandId);
/// <summary>
/// Add an item to the menu.
/// </summary>
/// <param name="commandId"></param>
/// <param name="label"></param>
/// <returns>Returns true on success.</returns>
bool AddItem(CefMenuCommand commandId, string label);
/// <summary>
/// Add a separator to the menu.
/// </summary>
/// <returns>Returns true on success.</returns>
bool AddSeparator();
}
}