aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/service/protocol/ProtocolIcon.java
blob: 3c0e192ab5fbe05b87bd6c98081e58fa3e5a9389 (plain)
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
99
100
101
/*
 * Jitsi, the OpenSource Java VoIP and Instant Messaging client.
 *
 * Copyright @ 2015 Atlassian Pty Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.java.sip.communicator.service.protocol;

import java.util.*;

/**
 * The <tt>ProtocolIcon</tt> interface is meant to be implemented by protocol
 * implementations in order to export their icon. The <tt>Protocolicon</tt>
 * could support different sizes: 16x16, 32x32, etc.
 * The ICON_SIZE_XXX constats are meant to be used to specify the size of the
 * icon, in order to enable other bundles to obtain the exact image they need.
 *
 * @author Yana Stamcheva
 */
public interface ProtocolIcon
{
    /**
     * Defines a 16x16 icon size.
     */
    public static final String ICON_SIZE_16x16 = "IconSize16x16";

    /**
     * Defines a 32x32 icon size.
     */
    public static final String ICON_SIZE_32x32 = "IconSize32x32";

    /**
     * Defines a 48x48 icon size.
     */
    public static final String ICON_SIZE_48x48 = "IconSize48x48";

    /**logo
     * Defines a 64x64 icon size.
     */
    public static final String ICON_SIZE_64x64 = "IconSize64x64";

    /**
     * Returns an iterator over a set, containing different predefined icon sizes.
     * Each icon size in the set is one of the ICON_SIZE_XXX constants. The
     * method is meant to be implemented by a protocol implementation in order
     * to allow other bundles to obtain information about the number of sizes
     * in which this icon is exported.
     *
     * @return Iterator an iterator over a set containing different predefined
     * icon sizes. Each icon size in the set is one of the ICON_SIZE_XXX
     * constants.
     */
    public Iterator<String> getSupportedSizes();

    /**
     * Checks if the given icon size is supported by the current protocol
     * implementation. If the given <tt>iconSize</tt> is contained in the list of
     * supported sizes - returns TRUE, otherwise - FALSE.
     *
     * @param iconSize the size of the protocol icon; one of the ICON_SIZE_XXX
     * constants
     * @return TRUE - if the given icon size is supported by the current
     * implementation, FALSE - otherwise.
     */
    public boolean isSizeSupported(String iconSize);

    /**
     * Returns the protocol icon image in the desired size.
     * @param iconSize the size of the protocol icon; one of the ICON_SIZE_XXX
     * constants
     * @return the protocol icon image in the desired size
     */
    public byte[] getIcon(String iconSize);

    /**
     * Returns a path to the icon with the given size.
     * @param iconSize the size of the icon we're looking for
     * @return the path to the icon with the given size
     */
    public String getIconPath(String iconSize);

    /**
     * Returns the icon that should be used when the protocol provider is in
     * a connecting state.
     *
     * @return the icon that should be used when the protocol provider is in
     * a connecting state
     */
    public byte[] getConnectingIcon();
}