]> git.basschouten.com Git - openhab-addons.git/blob
58891b3967f98f62df760b7be97ef67d13e6be22
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.yamahareceiver.internal.protocol;
14
15 import static java.util.stream.Collectors.toSet;
16 import static org.openhab.binding.yamahareceiver.internal.YamahaReceiverBindingConstants.Inputs.*;
17
18 import java.io.IOException;
19 import java.util.Set;
20 import java.util.stream.Stream;
21
22 /**
23  * The navigation control protocol interface
24  *
25  * @author David Graeff - Initial contribution
26  * @author Tomasz Maruszak - refactoring
27  */
28 public interface InputWithNavigationControl extends IStateUpdatable {
29     /**
30      * List all inputs that are compatible with this kind of control
31      */
32     Set<String> SUPPORTED_INPUTS = Stream
33             .of(INPUT_NET_RADIO, INPUT_NET_RADIO_LEGACY, INPUT_USB, INPUT_IPOD_USB, INPUT_DOCK, INPUT_PC, INPUT_NAPSTER,
34                     INPUT_PANDORA, INPUT_SIRIUS, INPUT_RHAPSODY, INPUT_IPOD, INPUT_HD_RADIO)
35             .collect(toSet());
36
37     /**
38      * Navigate back
39      *
40      * @throws ReceivedMessageParseException
41      * @throws IOException
42      */
43     void goBack() throws ReceivedMessageParseException, IOException;
44
45     /**
46      * Navigate up
47      *
48      * @throws ReceivedMessageParseException
49      * @throws IOException
50      */
51     void goUp() throws IOException, ReceivedMessageParseException;
52
53     /**
54      * Navigate down
55      *
56      * @throws ReceivedMessageParseException
57      * @throws IOException
58      */
59     void goDown() throws IOException, ReceivedMessageParseException;
60
61     /**
62      * Navigate left. Not for all zones or functions available.
63      *
64      * @throws ReceivedMessageParseException
65      * @throws IOException
66      */
67     void goLeft() throws IOException, ReceivedMessageParseException;
68
69     /**
70      * Navigate right. Not for all zones or functions available.
71      *
72      * @throws ReceivedMessageParseException
73      * @throws IOException
74      */
75     void goRight() throws IOException, ReceivedMessageParseException;
76
77     /**
78      * Select current item. Not for all zones or functions available.
79      *
80      * @throws ReceivedMessageParseException
81      * @throws IOException
82      */
83     void selectCurrentItem() throws IOException, ReceivedMessageParseException;
84
85     /**
86      * Navigate to root menu
87      *
88      * @throws ReceivedMessageParseException
89      * @throws IOException
90      */
91     boolean goToRoot() throws IOException, ReceivedMessageParseException;
92
93     /**
94      * Navigate to the given page. The Yamaha protocol separates list of items into pages.
95      *
96      * @param page The page, starting with 1.
97      * @throws IOException
98      * @throws ReceivedMessageParseException
99      */
100     void goToPage(int page) throws IOException, ReceivedMessageParseException;
101
102     /**
103      * Provide a full path to the menu and menu item
104      *
105      * @param fullPath
106      * @throws IOException
107      * @throws ReceivedMessageParseException
108      */
109     void selectItemFullPath(String fullPath) throws IOException, ReceivedMessageParseException;
110 }