Package smartcard :: Package wx :: Module SimpleSCardAppEventObserver
[hide private]
[frames] | no frames]

Source Code for Module smartcard.wx.SimpleSCardAppEventObserver

 1  """Smartcard event observer. 
 2   
 3  __author__ = "gemalto http://www.gemalto.com" 
 4   
 5  Copyright 2001-2012 gemalto 
 6  Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com 
 7   
 8  This file is part of pyscard. 
 9   
10  pyscard is free software; you can redistribute it and/or modify 
11  it under the terms of the GNU Lesser General Public License as published by 
12  the Free Software Foundation; either version 2.1 of the License, or 
13  (at your option) any later version. 
14   
15  pyscard is distributed in the hope that it will be useful, 
16  but WITHOUT ANY WARRANTY; without even the implied warranty of 
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
18  GNU Lesser General Public License for more details. 
19   
20  You should have received a copy of the GNU Lesser General Public License 
21  along with pyscard; if not, write to the Free Software 
22  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
23  """ 
24   
25   
26 -class SimpleSCardAppEventObserver(object):
27 """This interface defines the event handlers 28 called by the SimpleSCardApp.""" 29
30 - def __init__(self):
31 self.selectedcard = None 32 self.selectedreader = None
33 34 # callbacks from SimpleCardAppFrame controls
35 - def OnActivateCard(self, card):
36 """Called when a card is activated in the reader 37 tree control or toolbar.""" 38 self.selectedcard = card
39
40 - def OnActivateReader(self, reader):
41 """Called when a reader is activated in the reader 42 tree control or toolbar.""" 43 self.selectedreader = reader
44
45 - def OnDeactivateCard(self, card):
46 """Called when a card is deactivated in the reader 47 tree control or toolbar.""" 48 pass
49
50 - def OnDeselectCard(self, card):
51 """Called when a card is selected in the reader 52 tree control or toolbar.""" 53 self.selectedcard = None
54
55 - def OnSelectCard(self, card):
56 """Called when a card is selected in the reader 57 tree control or toolbar.""" 58 self.selectedcard = card
59
60 - def OnSelectReader(self, reader):
61 """Called when a reader is selected in the reader 62 tree control or toolbar.""" 63 self.selectedreader = reader
64