[cosmetics] update date in GPL header
[vuplus_xbmc] / tools / EventClients / lib / java / src / org / xbmc / eventclient / PacketACTION.java
1 /*
2  *  Copyright (C) 2008-2013 Team XBMC
3  *
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2 of the License, or
7  *  (at your option) any later version.
8  *
9  *  This program 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
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License along
15  *  with this program; if not, write to the Free Software Foundation, Inc.,
16  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18
19 package org.xbmc.eventclient;
20 /**
21  * XBMC Event Client Class
22  * 
23  * An ACTION packet tells XBMC to do the action specified, based on the type it knows were it needs to be sent.
24  * The idea is that this will be as in scripting/skining and keymapping, just triggered from afar.
25  * @author Stefan Agner
26  *
27  */
28 public class PacketACTION extends Packet {
29         
30         public final static byte ACTION_EXECBUILTIN = 0x01;
31         public final static byte ACTION_BUTTON      = 0x02;
32
33         
34         /**
35          * An ACTION packet tells XBMC to do the action specified, based on the type it knows were it needs to be sent.
36          * @param actionmessage Actionmessage (as in scripting/skinning)
37          */
38         public PacketACTION(String actionmessage)
39         {
40                 super(PT_ACTION);
41                 byte actiontype = ACTION_EXECBUILTIN;
42                 appendPayload(actionmessage, actiontype);
43         }
44
45         /**
46          * An ACTION packet tells XBMC to do the action specified, based on the type it knows were it needs to be sent.
47          * @param actionmessage Actionmessage (as in scripting/skinning)
48          * @param actiontype Actiontype (ACTION_EXECBUILTIN or ACTION_BUTTON)
49          */
50         public PacketACTION(String actionmessage, byte actiontype)
51         {
52                 super(PT_ACTION);
53                 appendPayload(actionmessage, actiontype);
54         }
55         
56         private void appendPayload(String actionmessage, byte actiontype)
57         {
58                 appendPayload(actiontype);
59                 appendPayload(actionmessage);
60         }
61 }