File: Interfaces.vala

package info (click to toggle)
plank 0.11.89-6
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 5,660 kB
  • sloc: sh: 4,959; makefile: 1,076; cpp: 404; xml: 33; ansic: 31; python: 22; sed: 16
file content (86 lines) | stat: -rw-r--r-- 2,691 bytes parent folder | download | duplicates (3)
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
//
//  Copyright (C) 2015 Rico Tzschichholz
//
//  This file is part of Plank.
//
//  Plank is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  Plank 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 General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
//

namespace Plank
{
	const string DBUS_PING_NAME = "Ping";
	
	const string DBUS_DOCK_INTERFACE_NAME = "net.launchpad.plank";
	const string DBUS_CLIENT_INTERFACE_NAME = "net.launchpad.plank.Client";

	/**
	 * Provide an interface to manage items of the dock
	 */
	[DBus (name = "net.launchpad.plank.Items")]
	interface DBusItemsIface : GLib.Object
	{
		/**
		 * Emmited when items are changed
		 */
		public signal void changed ();
		
		/**
		 * Add a new item for the given uri to the dock
		 *
		 * @param uri an URI
		 * @return whether it was successfully added
		 */
		public abstract bool add (string uri) throws GLib.DBusError, GLib.IOError;
		
		/**
		 * Remove an existing item for the given uri from the dock
		 *
		 * @param uri an URI
		 * @return whether it was successfully removed
		 */
		public abstract bool remove (string uri) throws GLib.DBusError, GLib.IOError;
		
		/**
		 * Returns the number of currently visible items on the dock
		 *
		 * @return the item-count
		 */
		public abstract int get_count () throws GLib.DBusError, GLib.IOError;
		
		/**
		 * Returns an array of uris of the persistent applications on the dock
		 *
		 * @return the array of uris
		 */
		public abstract string[] get_persistent_applications () throws GLib.DBusError, GLib.IOError;
		
		/**
		 * Returns an array of uris of the transient applications on the dock
		 *
		 * @return the array of uris
		 */
		public abstract string[] get_transient_applications () throws GLib.DBusError, GLib.IOError;

		/**
		 * Gets the x,y coords with the dock's position to display a hover window for an item.
		 *
		 * @param uri an URI
		 * @param x the resulting x position
		 * @param y the resulting y position
		 * @param dock_position the position of the dock
		 * @return whether it was successfully retrieved
		 */
		public abstract bool get_hover_position (string uri, out int x, out int y, out Gtk.PositionType dock_position) throws GLib.DBusError, GLib.IOError;
	}
}