connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/api/IConnection2.java
author dadubrow
Mon, 01 Mar 2010 11:27:50 -0600
changeset 1039 c7873299d91f
parent 899 b5675f3e69ad
permissions -rw-r--r--
Add support for status notification popups and remove ui dependency + use new notification to switch mode
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
688
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
     1
/**
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
     3
* All rights reserved.
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
     4
* This component and the accompanying materials are made available
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
     6
* which accompanies this distribution, and is available
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
     8
*
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
     9
* Initial Contributors:
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    11
*
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    12
* Contributors:
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    13
*
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    14
* Description: 
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    15
*
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    16
*/
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    17
700
9441b6037cb6 rename internal api package to internal.api
dadubrow
parents: 688
diff changeset
    18
package com.nokia.carbide.remoteconnections.internal.api;
688
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    19
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    20
import org.eclipse.jface.resource.ImageDescriptor;
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    21
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    22
import com.nokia.carbide.remoteconnections.interfaces.IConnection;
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    23
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    24
/**
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    25
 * An extended interface to a connection
899
b5675f3e69ad update since tags to 2.5
dadubrow
parents: 748
diff changeset
    26
 * @since 2.5
688
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    27
 */
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    28
public interface IConnection2 extends IConnection {
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    29
	
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    30
	/**
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    31
	 * Whether this connection is dynamic (managed by an automated process)
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    32
	 * Dynamic connections are not persisted or user editable.
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    33
	 * @return boolean
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    34
	 */
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    35
	boolean isDynamic();
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    36
	
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    37
	/**
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    38
	 * Sets this connection's dynamic attribute.
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    39
	 * @see IConnection2#isDynamic()
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    40
	 * @param dynamic boolean
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    41
	 */
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    42
	void setDynamic(boolean dynamic);
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    43
	
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    44
	/**
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    45
	 * The status of a connection
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    46
	 */
702
432756509142 rename connection status to avoid having to qualify when using with service status in same module
dadubrow
parents: 700
diff changeset
    47
	public interface IConnectionStatus {
432756509142 rename connection status to avoid having to qualify when using with service status in same module
dadubrow
parents: 700
diff changeset
    48
		enum EConnectionStatus {
748
7bd40a2d0a18 Add connection status reconciliation + fixes + tweaks
dadubrow
parents: 702
diff changeset
    49
			READY, NOT_READY, IN_USE, IN_USE_DISCONNECTED, NONE
688
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    50
		};
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    51
		
702
432756509142 rename connection status to avoid having to qualify when using with service status in same module
dadubrow
parents: 700
diff changeset
    52
		EConnectionStatus getEConnectionStatus();
688
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    53
		
748
7bd40a2d0a18 Add connection status reconciliation + fixes + tweaks
dadubrow
parents: 702
diff changeset
    54
		String getShortDescription();
7bd40a2d0a18 Add connection status reconciliation + fixes + tweaks
dadubrow
parents: 702
diff changeset
    55
		
7bd40a2d0a18 Add connection status reconciliation + fixes + tweaks
dadubrow
parents: 702
diff changeset
    56
		String getLongDescription();
688
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    57
	}
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    58
	
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    59
	/**
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    60
	 * Gets this connection's status
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    61
	 * @return IStatus
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    62
	 */
702
432756509142 rename connection status to avoid having to qualify when using with service status in same module
dadubrow
parents: 700
diff changeset
    63
	IConnectionStatus getStatus();
688
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    64
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    65
	/**
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    66
	 * Sets this connection's status
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    67
	 * @see IConnection2#getStatus()
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    68
	 * @param status IStatus
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    69
	 */
702
432756509142 rename connection status to avoid having to qualify when using with service status in same module
dadubrow
parents: 700
diff changeset
    70
	void setStatus(IConnectionStatus status);
688
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    71
	
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    72
	/**
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    73
	 * A listener for status changes
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    74
	 */
702
432756509142 rename connection status to avoid having to qualify when using with service status in same module
dadubrow
parents: 700
diff changeset
    75
	public interface IConnectionStatusChangedListener {
432756509142 rename connection status to avoid having to qualify when using with service status in same module
dadubrow
parents: 700
diff changeset
    76
		void statusChanged(IConnectionStatus status);
688
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    77
	}
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    78
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    79
	/**
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    80
	 * Adds a listener for status changes
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    81
	 * @param listener IStatusChangedListener
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    82
	 */
702
432756509142 rename connection status to avoid having to qualify when using with service status in same module
dadubrow
parents: 700
diff changeset
    83
	void addStatusChangedListener(IConnectionStatusChangedListener listener);
688
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    84
	
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    85
	/**
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    86
	 * Removes a listener for status changes
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    87
	 * @param listener IStatusChangedListener
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    88
	 */
702
432756509142 rename connection status to avoid having to qualify when using with service status in same module
dadubrow
parents: 700
diff changeset
    89
	void removeStatusChangedListener(IConnectionStatusChangedListener listener);
688
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    90
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    91
	/**
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    92
	 * An optional icon representing this connection.
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    93
	 * If none is set, the default icon is used.
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    94
	 * @return ImageDescriptor
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    95
	 */
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    96
	ImageDescriptor getImageDescriptor();
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    97
	
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    98
	/**
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
    99
	 * Set the image descriptor for this connection.
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
   100
	 * @see IConnection2#getImageDescriptor()
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
   101
	 * @param imageDescriptor
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
   102
	 */
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
   103
	void setImageDescriptor(ImageDescriptor imageDescriptor);
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
   104
	
ae5ff180a61d Changes to remote connections
dadubrow
parents:
diff changeset
   105
}