[operations] [attributes] [fields] [template] [definition]
[implementation] [documentation]
To use the search tool you need to use a browser which supports JAVA (c)

[next] [prev] [superclass] [next peer] [prev peer] [subclass] [index] [hierarchy]

CardServer

mixes in with Object

CardServer



Operations

Get list of all operations

CanHandleCard
CardBatteryState
CardInserted
CardRemoved
CardWriteProtectSwitchChanged
IsCardDifferent


Attributes

Get list of all attributes

Slot


Fields

Field Type
CardServer: slot: CardSlot


Instance template

Class CardServer cannot be instantiated.


Class definition

Define Class CardServer;
    mixes in with Object;

    field slot: CardSlot, weak, getter;
    
    attribute Slot: CardSlot, readOnly;
        // CardSlot Object which controls the hardware of this card, or nil

    class operation CanHandleCard(slot: CardSlot): CardServer, noMethod, noFail;
        // called on each entry in the server list,
        // first returning non-nil gets to handle the card
    operation IsCardDifferent(): Boolean, noMethod;
        // Check to see if the card currently inserted in the slot
        // is different than the one the server said it could serve

    /* Automatic card events */
    operation CardInserted(slot: CardSlot); 
        // Called when a card has been inserted.
        // will be called if CanHandleCard returned true
        // override to handle card insertion
    operation CardRemoved();
        // Called after the card has been removed. The server
        // will be destroyed shortly.
        // will be called if CanHandleCard returned true (regardless of success
        //      of CardInserted call)
        // override to handle card removal

    /* Optional card events */
    operation CardWriteProtectSwitchChanged(state: Boolean);
        // Called when write protect switch has been changed.
        // (Note: this is only called when a WP switch change is allowed.)
        // override to handle switch change

    operation CardBatteryState(): Unsigned, noFail;
        // return the current battery state of the card (nobatt, full, low, dead)
end class;