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-2011 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:
27 """This interface defines the event handlers called by the SimpleSCardApp.""" 28
29 - def __init__(self):
30 self.selectedcard = None 31 self.selectedreader = None
32 33 # callbacks from SimpleCardAppFrame controls
34 - def OnActivateCard(self, card):
35 """Called when a card is activated in the reader tree control or toolbar.""" 36 self.selectedcard = card
37
38 - def OnActivateReader(self, reader):
39 """Called when a reader is activated in the reader tree control or toolbar.""" 40 self.selectedreader = reader
41
42 - def OnDeactivateCard(self, card):
43 """Called when a card is deactivated in the reader tree control or toolbar.""" 44 pass
45
46 - def OnDeselectCard(self, card):
47 """Called when a card is selected in the reader tree control or toolbar.""" 48 self.selectedcard = None
49
50 - def OnSelectCard(self, card):
51 """Called when a card is selected in the reader tree control or toolbar.""" 52 self.selectedcard = card
53
54 - def OnSelectReader(self, reader):
55 """Called when a reader is selected in the reader tree control or toolbar.""" 56 self.selectedreader = reader
57