~kees/libunity/remote-search-none

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
 * Copyright (C) 2010 Canonical, Ltd.
 *
 * This library is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License
 * version 3.0 as published by the Free Software Foundation.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3.0 for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see
 * <http://www.gnu.org/licenses/>.
 *
 * Authored by Neil Jagdish Patel <neil.patel@canonical.com>
 *
 */

using GLib;
using Dee;

namespace Unity.Protocol {

/* The raw type that get's passed over DBus to Unity */
public struct LensInfo
{
  public string dbus_path;
  public bool search_in_global;
  public bool visible;
  public string search_hint;
  public string private_connection_name;
  public string results_model_name;
  public string global_results_model_name;
  public string categories_model_name;
  public string filters_model_name;
  public HashTable<string, Variant> hints;
}

public enum HandledType
{
  NOT_HANDLED,
  SHOW_DASH,
  HIDE_DASH,
  GOTO_DASH_URI,
  SHOW_PREVIEW
}

public enum ActionType
{
  ACTIVATE_RESULT,
  PREVIEW_RESULT,
  PREVIEW_ACTION,
  PREVIEW_BUILTIN_ACTION
}

public enum ViewType
{
  HIDDEN,
  HOME_VIEW,
  LENS_VIEW
}

/**
 * LensService:
 *
 * The Lens interface exported on DBus
 */
[DBus (name = "com.canonical.Unity.Lens")]
public interface LensService : GLib.Object
{
  public async abstract void info_request () throws IOError;

  // FIXME: should have the hints param and activate_with_hints should go away
  public async abstract ActivationReplyRaw activate (
      string uri, uint action_type) throws IOError;

  public async abstract ActivationReplyRaw activate_with_hints (
      string uri, uint action_type, HashTable<string, Variant> hints) throws IOError;

  public async abstract HashTable<string, Variant> update_preview_property (string uri, HashTable<string, Variant> values) throws IOError;

  public async abstract HashTable<string, Variant> search (
      string search_string, HashTable<string, Variant> hints) throws IOError;

  public async abstract HashTable<string, Variant> global_search (
      string search_string, HashTable<string, Variant> hints) throws IOError;
  
  public async abstract void update_filter (string filter_name,
                                            HashTable<string, Variant> properties) throws IOError;
  
  public async abstract void set_view_type (uint view_type) throws IOError;
  
  public signal void changed (LensInfo lens_info);
}

} /* namespace unity */