~shnatsel/slingshot/update-cmake-modules

« back to all changes in this revision

Viewing changes to lib/synapse-core/plugin.vala

  • Committer: RabbitBot
  • Author(s): Tom Beckmann
  • Date: 2014-06-28 05:00:49 UTC
  • mfrom: (421.1.19 slingshot)
  • Revision ID: rabbitbot-20140628050049-pi540b7grh00lzcv
Copy the sources of Synapse over and implements a new searchview using libsynapse

Copying is currently necessary as synapse's library is internal. I hope we can change this soon, although I don't consider it very urgent, as synapse is almost unmaintained at the moment, so we most likely won't miss out on important updates.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2010 Michal Hruby <michal.mhr@gmail.com>
 
3
 *
 
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.
 
8
 *
 
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.
 
13
 *
 
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/>.
 
16
 *
 
17
 * Authored by Michal Hruby <michal.mhr@gmail.com>
 
18
 *
 
19
 */
 
20
 
 
21
namespace Synapse
 
22
{
 
23
  public interface Activatable : Object
 
24
  {
 
25
    // this property will eventually go away
 
26
    public abstract bool enabled { get; set; default = true; }
 
27
 
 
28
    public abstract void activate ();
 
29
    public abstract void deactivate ();
 
30
  }
 
31
 
 
32
  public interface Configurable : Object
 
33
  {
 
34
    public abstract Gtk.Widget create_config_widget ();
 
35
  }
 
36
 
 
37
  public interface ItemProvider : Activatable
 
38
  {
 
39
    public abstract async ResultSet? search (Query query) throws SearchError;
 
40
    public virtual bool handles_query (Query query)
 
41
    {
 
42
      return true;
 
43
    }
 
44
    public virtual bool handles_empty_query ()
 
45
    {
 
46
      return false;
 
47
    }
 
48
  }
 
49
 
 
50
  public interface ActionProvider : Activatable
 
51
  {
 
52
    public abstract ResultSet? find_for_match (ref Query query, Match match);
 
53
    public virtual bool handles_unknown ()
 
54
    {
 
55
      return false;
 
56
    }
 
57
  }
 
58
}
 
59