2 // Copyright (C) 2003 Constantin Kaplinsky. All Rights Reserved.
4 // This 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.
9 // This software 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.
14 // You should have received a copy of the GNU General Public License
15 // along with this software; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
21 // CapabilityInfo.java - A class to hold information about a
22 // particular capability as used in the RFB protocol 3.130.
25 class CapabilityInfo {
29 public CapabilityInfo(int code,
30 String vendorSignature,
34 this.vendorSignature = vendorSignature;
35 this.nameSignature = nameSignature;
36 this.description = description;
40 public CapabilityInfo(int code,
41 byte[] vendorSignature,
42 byte[] nameSignature) {
44 this.vendorSignature = new String(vendorSignature);
45 this.nameSignature = new String(nameSignature);
46 this.description = null;
50 public int getCode() {
54 public String getDescription() {
58 public boolean isEnabled() {
62 public void enable() {
66 public boolean equals(CapabilityInfo other) {
67 return (other != null && this.code == other.code &&
68 this.vendorSignature.equals(other.vendorSignature) &&
69 this.nameSignature.equals(other.nameSignature));
72 public boolean enableIfEquals(CapabilityInfo other) {
73 if (this.equals(other))
82 protected String vendorSignature;
83 protected String nameSignature;
85 protected String description;
86 protected boolean enabled;