2
* Copyright (C) 2010 Michal Hruby <michal.mhr@gmail.com>
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation; either
7
* version 2.1 of the License, or (at your option) any later version.
9
* This library is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Lesser General Public License for more details.
14
* You should have received a copy of the GNU Lesser General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
* Authored by Michal Hruby <michal.mhr@gmail.com>
18
* Alberto Aldegheri <albyrock87+dev@gmail.com>
34
public interface Match: Object
38
INCREMENT_MINOR = 2000,
39
INCREMENT_SMALL = 5000,
40
INCREMENT_MEDIUM = 10000,
41
INCREMENT_LARGE = 20000,
45
BELOW_AVERAGE = 60000,
47
ABOVE_AVERAGE = 75000,
56
public abstract string title { get; construct set; }
57
public abstract string description { get; set; }
58
public abstract string icon_name { get; construct set; }
59
public abstract bool has_thumbnail { get; construct set; }
60
public abstract string thumbnail_path { get; construct set; }
61
public abstract MatchType match_type { get; construct set; }
63
public virtual void execute (Match? match)
65
Utils.Logger.error (this, "execute () is not implemented");
68
public virtual void execute_with_target (Match? source, Match? target = null)
70
if (target == null) execute (source);
71
else Utils.Logger.error (this, "execute () is not implemented");
74
public virtual bool needs_target () {
78
public virtual QueryFlags target_flags ()
80
return QueryFlags.ALL;
83
public signal void executed ();
86
public interface ApplicationMatch: Match
88
public abstract AppInfo? app_info { get; set; }
89
public abstract bool needs_terminal { get; set; }
90
public abstract string? filename { get; construct set; }
93
public interface UriMatch: Match
95
public abstract string uri { get; set; }
96
public abstract QueryFlags file_type { get; set; }
97
public abstract string mime_type { get; set; }
100
public interface ContactMatch: Match
102
public abstract void send_message (string message, bool present);
103
public abstract void open_chat ();
106
public interface ExtendedInfo: Match
108
public abstract string? extended_info { get; set; }
111
public enum TextOrigin
117
public interface TextMatch: Match
119
public abstract TextOrigin text_origin { get; set; }
120
public abstract string get_text ();
123
public interface SearchMatch: Match, SearchProvider
125
public abstract Match search_source { get; set; }
128
public class DefaultMatch: Object, Match
130
public string title { get; construct set; }
131
public string description { get; set; }
132
public string icon_name { get; construct set; }
133
public bool has_thumbnail { get; construct set; }
134
public string thumbnail_path { get; construct set; }
135
public MatchType match_type { get; construct set; }
137
public DefaultMatch (string query_string)
139
Object (title: query_string, description: "", has_thumbnail: false,
140
icon_name: "unknown", match_type: MatchType.UNKNOWN);