comparison UIControl/Interfaces/IAddEquipmentUI.cs @ 51:dafbd432ca23

Re #60: Add UI to add/remove/edit weapons in GTK * Start to implement Add functionality using a new abstraction concept that keeps the UI dumb and keeps the logic in a cross-toolkit controller
author IBBoard <dev@ibboard.co.uk>
date Sat, 21 Aug 2010 20:00:03 +0000
parents
children f9f6e9db5350
comparison
equal deleted inserted replaced
50:d2f4fcc28254 51:dafbd432ca23
1 // This file (IAddEquipmentUI.cs) is a part of the IBBoard.WarFoundry.GUI.GTK project and is copyright 2010 IBBoard
2 //
3 // The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
4 using System;
5 using IBBoard.WarFoundry.API.Objects;
6 namespace IBBoard.WarFoundry.GUI.GTK.UIControl.Interfaces
7 {
8 /// <summary>
9 /// The interface that UI components should implement to represent "Add Equipment" dialogs or system equivalents (e.g. console areas or HTML fragments)
10 /// </summary>
11 public interface IAddEquipmentUI
12 {
13 /// <summary>
14 /// Should be fired when unit equipment item choice changes.
15 /// </summary>
16 event SingleArgMethodInvoker<UnitEquipmentItem> UnitEquipmentItemChoiceChanged;
17
18
19
20 /// <summary>
21 /// Sets the equipment items that should be displayed on the form
22 /// </summary>
23 /// <param name='items'>
24 /// The equipment items that should be displayed on the form
25 /// </param>
26 void SetUnitEquipmentItems(UnitEquipmentItem[] items);
27
28 /// <summary>
29 /// Sets the limits for the currently selected equipment item
30 /// </summary>
31 /// <param name='isRatioLimit'>
32 /// <code>True</code> if the current limit is a ratio limit, else <code>false</code> for absolute limits
33 /// </param>
34 /// <param name='minPercent'>
35 /// The minimum limit as a percentage
36 /// </param>
37 /// <param name='maxPercent'>
38 /// The maximum limit as a percentage
39 /// </param>
40 /// <param name='minNumber'>
41 /// The minimum number as an absolute figure
42 /// </param>
43 /// <param name='maxNumber'>
44 /// The maximum number as an absolute figure
45 /// </param>
46 void SetUnitEquipmentLimits(bool isRatioLimit, double minPercent, double maxPercent, int minNumber, int maxNumber);
47
48 /// <summary>
49 /// Sets whether the unit equipment limit UI components should be enabled and able to accept input.
50 /// </summary>
51 /// <param name='isEnabled'>
52 /// <code>True</code> if the UI components should accept input, else <code>false</code>
53 /// </param>
54 void SetUnitEquipmentLimitsEnabled(bool isEnabled);
55
56 /// <summary>
57 /// Shows the control and awaits a user action (close or okay)
58 /// </summary>
59 void ShowControl();
60 }
61 }
62