1
// ISearchController.cs
3
// GNOME Do is the legal property of its developers. Please refer to the
4
// COPYRIGHT file distributed with this source distribution.
6
// This program is free software: you can redistribute it and/or modify
7
// it under the terms of the GNU General Public License as published by
8
// the Free Software Foundation, either version 3 of the License, or
9
// (at your option) any later version.
11
// This program is distributed in the hope that it will be useful,
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
// GNU General Public License for more details.
16
// You should have received a copy of the GNU General Public License
17
// along with this program. If not, see <http://www.gnu.org/licenses/>.
21
using System.Collections.Generic;
31
public interface ISearchController
34
/// Returns a context useful for passing to a UI for display.
36
IUIContext UIContext {get;}
39
/// IObject Results from the current Query
41
IObject[] Results {get; set;}
44
/// The full selection, including secondary selections
46
IObject[] FullSelection {get;}
49
/// The primary selection from the user curosr
51
IObject Selection {get;}
54
/// The location of the cursor in the results list
56
int Cursor {get; set;}
59
/// Places marked by the user as additional cursors
61
int[] SecondaryCursors {get;}
64
/// Get or Set text mode on a search context
66
bool TextMode {get; set;}
69
/// Determines if the default filter is applied to the context or not
71
bool DefaultFilter {get;}
74
/// The search types used to filter results
76
Type[] SearchTypes {get;}
79
/// Returns the current Query
84
/// Add a single character to the Search Context
86
/// <param name="character">
87
/// A <see cref="System.Char"/>
89
void AddChar (char character);
92
/// Delete the last character from the query
97
/// Add a secondary cursor. Returns true if successful.
99
/// <param name="cursorLocation">
100
/// A <see cref="System.Int32"/>
103
/// A <see cref="System.Boolean"/>
105
bool ToggleSecondaryCursor (int cursorLocation);
108
/// Return true if item child search was possible
111
/// A <see cref="System.Boolean"/>
113
bool ItemChildSearch ();
116
/// Return true if item parent search was possible
119
/// A <see cref="System.Boolean"/>
121
bool ItemParentSearch ();
124
/// Resets the controllers context but leaves UpstreamContext links in place
129
/// The controllers Query has changed
131
event NullEventHandler QueryChanged;
134
/// Triggered when the result has changed. This may not fire after every search.
136
event NullEventHandler SelectionChanged;
139
/// The controller has started a search due to upstream results changing
141
event SearchStartedEventHandler SearchStarted;
144
/// The controllers search has finished.
146
event SearchFinishedEventHandler SearchFinished;