CardServer |
|
|
CanHandleCard CardBatteryState CardInserted CardRemoved CardWriteProtectSwitchChanged IsCardDifferent |
|
Slot |
| Field | Type | |
|---|---|---|
| CardServer: | slot: | CardSlot |
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;