~ubuntu-branches/ubuntu/precise/gnome-do/precise-proposed

« back to all changes in this revision

Viewing changes to Do/src/Do.Core/SearchControllers/ISearchController.cs

  • Committer: Bazaar Package Importer
  • Author(s): Christopher James Halse Rogers
  • Date: 2008-09-14 10:09:40 UTC
  • mto: (0.1.8 sid)
  • mto: This revision was merged to the branch mainline in revision 7.
  • Revision ID: james.westby@ubuntu.com-20080914100940-kyghudg7py14bu2z
Tags: upstream-0.6.0.0
ImportĀ upstreamĀ versionĀ 0.6.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// ISearchController.cs
 
2
// 
 
3
// GNOME Do is the legal property of its developers. Please refer to the
 
4
// COPYRIGHT file distributed with this source distribution.
 
5
//
 
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.
 
10
//
 
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.
 
15
//
 
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/>.
 
18
//
 
19
 
 
20
using System;
 
21
using System.Collections.Generic;
 
22
 
 
23
using Do.Addins;
 
24
using Do.Universe;
 
25
using Do.UI;
 
26
 
 
27
namespace Do.Core
 
28
{
 
29
        
 
30
        
 
31
        public interface ISearchController
 
32
        {
 
33
                /// <value>
 
34
                /// Returns a context useful for passing to a UI for display.
 
35
                /// </value>
 
36
                IUIContext UIContext {get;}
 
37
                
 
38
                /// <value>
 
39
                /// IObject Results from the current Query
 
40
                /// </value>
 
41
                IObject[] Results {get; set;}
 
42
                
 
43
                /// <value>
 
44
                /// The full selection, including secondary selections
 
45
                /// </value>
 
46
                IObject[] FullSelection {get;}
 
47
                
 
48
                /// <value>
 
49
                /// The primary selection from the user curosr
 
50
                /// </value>
 
51
                IObject Selection {get;}
 
52
                
 
53
                /// <value>
 
54
                /// The location of the cursor in the results list
 
55
                /// </value>
 
56
                int Cursor {get; set;}
 
57
                
 
58
                /// <value>
 
59
                /// Places marked by the user as additional cursors
 
60
                /// </value>
 
61
                int[] SecondaryCursors {get;}
 
62
                
 
63
                /// <value>
 
64
                /// Get or Set text mode on a search context
 
65
                /// </value>
 
66
                bool TextMode {get; set;}
 
67
                
 
68
                /// <value>
 
69
                /// Determines if the default filter is applied to the context or not
 
70
                /// </value>
 
71
                bool DefaultFilter {get;}
 
72
                
 
73
                /// <value>
 
74
                /// The search types used to filter results
 
75
                /// </value>
 
76
                Type[] SearchTypes {get;}
 
77
                
 
78
                /// <value>
 
79
                /// Returns the current Query
 
80
                /// </value>
 
81
                string Query {get;}
 
82
                
 
83
                /// <summary>
 
84
                /// Add a single character to the Search Context
 
85
                /// </summary>
 
86
                /// <param name="character">
 
87
                /// A <see cref="System.Char"/>
 
88
                /// </param>
 
89
                void AddChar (char character);
 
90
                
 
91
                /// <summary>
 
92
                /// Delete the last character from the query
 
93
                /// </summary>
 
94
                void DeleteChar ();
 
95
                
 
96
                /// <summary>
 
97
                /// Add a secondary cursor.  Returns true if successful.
 
98
                /// </summary>
 
99
                /// <param name="cursorLocation">
 
100
                /// A <see cref="System.Int32"/>
 
101
                /// </param>
 
102
                /// <returns>
 
103
                /// A <see cref="System.Boolean"/>
 
104
                /// </returns>
 
105
                bool ToggleSecondaryCursor (int cursorLocation);
 
106
                
 
107
                /// <summary>
 
108
                /// Return true if item child search was possible
 
109
                /// </summary>
 
110
                /// <returns>
 
111
                /// A <see cref="System.Boolean"/>
 
112
                /// </returns>
 
113
                bool ItemChildSearch ();
 
114
 
 
115
                /// <summary>
 
116
                /// Return true if item parent search was possible
 
117
                /// </summary>
 
118
                /// <returns>
 
119
                /// A <see cref="System.Boolean"/>
 
120
                /// </returns>
 
121
                bool ItemParentSearch ();
 
122
                
 
123
                /// <summary>
 
124
                /// Resets the controllers context but leaves UpstreamContext links in place
 
125
                /// </summary>
 
126
                void Reset ();
 
127
                
 
128
                /// <summary>
 
129
                /// The controllers Query has changed
 
130
                /// </summary>
 
131
                event NullEventHandler QueryChanged;
 
132
                
 
133
                /// <summary>
 
134
                /// Triggered when the result has changed.  This may not fire after every search.
 
135
                /// </summary>
 
136
                event NullEventHandler SelectionChanged;
 
137
                
 
138
                /// <summary>
 
139
                /// The controller has started a search due to upstream results changing
 
140
                /// </summary>
 
141
                event SearchStartedEventHandler SearchStarted;
 
142
                
 
143
                /// <summary>
 
144
                /// The controllers search has finished.
 
145
                /// </summary>
 
146
                event SearchFinishedEventHandler SearchFinished;
 
147
        }
 
148
}