sipXcallLib home page


PtConnectionListener.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2004-2006 SIPfoundry Inc.
3 // Licensed by SIPfoundry under the LGPL license.
4 //
5 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
6 // Licensed to SIPfoundry under a Contributor Agreement.
7 //
8 // $$
10 
11 
12 #ifndef _PtConnectionListener_h_
13 #define _PtConnectionListener_h_
14 
15 // SYSTEM INCLUDES
16 // APPLICATION INCLUDES
17 #include <ptapi/PtCallListener.h>
18 
19 // DEFINES
20 // MACROS
21 // EXTERNAL FUNCTIONS
22 // EXTERNAL VARIABLES
23 // CONSTANTS
24 // STRUCTS
25 // TYPEDEFS
26 // FORWARD DECLARATIONS
27 class PtConnectionEvent;
28 
29 //:The PtConnectionListener is used to register with PtAddress, PtTerminal,
30 //:and PtCall objects to receive events from associated PtCall and
31 //:PtConnection objects.
32 
34 {
35 /* //////////////////////////// PUBLIC //////////////////////////////////// */
36 public:
38 
39 /* ============================ CREATORS ================================== */
40 
41  PtConnectionListener(PtEventMask* pMask = NULL);
42  //:Default constructor
44 
45  virtual
47  //:Destructor
48 
49 /* ============================ MANIPULATORS ============================== */
50 
51  virtual void connectionCreated(const PtConnectionEvent& rEvent);
52  //:Method invoked on listener for event id =
53  //:CONNECTION_CREATED
54  //:indicating that a new PtConnection object has been created.
55  // The event parameter is valid only within
56  // this method. The implementation must copy the event if
57  // it is needed beyond the scope of an invocation. The implementation
58  // of this method should not block as it may prevent other listeners
59  // from processing events in a timely fashion.
61 
62  virtual void connectionAlerting(const PtConnectionEvent& rEvent);
63  //:Method invoked on listener for event id =
64  //:CONNECTION_ALERTING
65  //:indicating that the state of the PtConnection object has changed to
66  //:PtConnection::ALERTING.
67  // The event parameter is valid only within
68  // this method. The implementation must copy the event if
69  // it is needed beyond the scope of an invocation. The implementation
70  // of this method should not block as it may prevent other listeners
71  // from processing events in a timely fashion.
73 
74  virtual void connectionDisconnected(const PtConnectionEvent& rEvent);
75  //:Method invoked on listener for event id =
76  //:CONNECTION_DISCONNECTED
77  //:indicating that the state of the PtConnection object has changed to
78  //:PtConnection::DISCONNECTED.
79  // The event parameter is valid only within
80  // this method. The implementation must copy the event if
81  // it is needed beyond the scope of an invocation. The implementation
82  // of this method should not block as it may prevent other listeners
83  // from processing events in a timely fashion.
85 
86  virtual void connectionFailed(const PtConnectionEvent& rEvent);
87  //:Method invoked on listener for event id =
88  //:CONNECTION_FAILED
89  //:indicating that the state of the PtConnection object has changed to
90  //:PtConnection::FAILED.
91  // The event parameter is valid only within
92  // this method. The implementation must copy the event if
93  // it is needed beyond the scope of an invocation. The implementation
94  // of this method should not block as it may prevent other listeners
95  // from processing events in a timely fashion.
97 
98  virtual void connectionUnknown(const PtConnectionEvent& rEvent);
99  //:Method invoked on listener for event id =
100  //:CONNECTION_UNKNOWN
101  //:indicating that the state of the PtConnection object has changed to
102  //:PtConnection::UNKNOWN.
103  // The event parameter is valid only within
104  // this method. The implementation must copy the event if
105  // it is needed beyond the scope of an invocation. The implementation
106  // of this method should not block as it may prevent other listeners
107  // from processing events in a timely fashion.
109 
110  virtual void connectionDialing(const PtConnectionEvent& rEvent);
111  //:Method invoked on listener for event id =
112  //:CONNECTION_DIALING
113  //:indicating that the state of the PtConnection object has changed to
114  //:PtConnection::DIALING.
115  // The event parameter is valid only within
116  // this method. The implementation must copy the event if
117  // it is needed beyond the scope of an invocation. The implementation
118  // of this method should not block as it may prevent other listeners
119  // from processing events in a timely fashion.
121 
122  virtual void connectionEstablished(const PtConnectionEvent& rEvent);
123  //:Method invoked on listener for event id =
124  //:CONNECTION_ESTABLISHED
125  //:indicating that the state of the PtConnection object has changed to
126  //:PtConnection::ESTABLISHED.
127  // The event parameter is valid only within
128  // this method. The implementation must copy the event if
129  // it is needed beyond the scope of an invocation. The implementation
130  // of this method should not block as it may prevent other listeners
131  // from processing events in a timely fashion.
133 
134  virtual void connectionInitiated(const PtConnectionEvent& rEvent);
135  //:Method invoked on listener for event id =
136  //:CONNECTION_INITIATED
137  //:indicating that the state of the PtConnection object has changed to
138  //:PtConnection::INITIATED.
139  // The event parameter is valid only within
140  // this method. The implementation must copy the event if
141  // it is needed beyond the scope of an invocation. The implementation
142  // of this method should not block as it may prevent other listeners
143  // from processing events in a timely fashion.
145 
146  virtual void connectionNetworkAlerting(const PtConnectionEvent& rEvent);
147  //:Method invoked on listener for event id =
148  //:CONNECTION_NETWORK_ALERTING
149  //:indicating that the state of the PtConnection object has changed to
150  //:PtConnection::NETWORK_ALERTING.
151  // The event parameter is valid only within
152  // this method. The implementation must copy the event if
153  // it is needed beyond the scope of an invocation. The implementation
154  // of this method should not block as it may prevent other listeners
155  // from processing events in a timely fashion.
157 
158  virtual void connectionNetworkReached(const PtConnectionEvent& rEvent);
159  //:Method invoked on listener for event id =
160  //:CONNECTION_NETWORK_REACHED
161  //:indicating that the state of the PtConnection object has changed to
162  //:PtConnection::NETWORK_REACHED.
163  // The event parameter is valid only within
164  // this method. The implementation must copy the event if
165  // it is needed beyond the scope of an invocation. The implementation
166  // of this method should not block as it may prevent other listeners
167  // from processing events in a timely fashion.
169 
170  virtual void connectionOffered(const PtConnectionEvent& rEvent);
171  //:Method invoked on listener for event id =
172  //:CONNECTION_OFFERED
173  //:indicating that the state of the PtConnection object has changed to
174  //:PtConnection::OFFERED.
175  // The event parameter is valid only within
176  // this method. The implementation must copy the event if
177  // it is needed beyond the scope of an invocation. The implementation
178  // of this method should not block as it may prevent other listeners
179  // from processing events in a timely fashion.
181 
182  virtual void connectionQueued(const PtConnectionEvent& rEvent);
183  //:Method invoked on listener for event id =
184  //:CONNECTION_QUEUED
185  //:indicating that the state of the PtConnection object has changed to
186  //:PtConnection::QUEUED.
187  // The event parameter is valid only within
188  // this method. The implementation must copy the event if
189  // it is needed beyond the scope of an invocation. The implementation
190  // of this method should not block as it may prevent other listeners
191  // from processing events in a timely fashion.
193 
194 /* ============================ ACCESSORS ================================= */
195 
196  static const char* className();
197  //:Returns the name of this class
199 
200 /* ============================ INQUIRY =================================== */
201 
202  virtual PtBoolean isClass(const char* pClassName);
203  //:Determines if this object if of the specified type.
207 
208  virtual PtBoolean isInstanceOf(const char* pClassName);
209  //:Determines if this object is either an instance of or is derived from
210  //:the specified type.
214 
215 /* //////////////////////////// PROTECTED ///////////////////////////////// */
216 protected:
217 
218 /* //////////////////////////// PRIVATE /////////////////////////////////// */
219 private:
220 
221  PtConnectionListener(const PtConnectionListener& rPtConnectionListener);
222  //:Copy constructor
223 
224  PtConnectionListener& operator=(const PtConnectionListener& rhs);
225  //:Assignment operator
226 };
227 
228 /* ============================ INLINE METHODS ============================ */
229 
230 #endif // _PtConnectionListener_h_
virtual PtBoolean isInstanceOf(const char *pClassName)
param: (in) pClassName - the string to compare with the name of this class. retcode: TRUE - if the gi...
virtual void connectionQueued(const PtConnectionEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtConnectionListener.cpp:101
virtual void connectionOffered(const PtConnectionEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtConnectionListener.cpp:97
int PtBoolean
Definition: PtDefs.h:71
virtual void connectionDisconnected(const PtConnectionEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtConnectionListener.cpp:65
virtual void connectionAlerting(const PtConnectionEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtConnectionListener.cpp:61
virtual void connectionUnknown(const PtConnectionEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtConnectionListener.cpp:73
Definition: PtConnectionEvent.h:32
#define PT_CLASS_INFO_MEMBERS
Definition: PtDefs.h:73
virtual PtBoolean isClass(const char *pClassName)
returns: Returns the string representation of the name of this class
Definition: PtCallListener.h:33
virtual void connectionFailed(const PtConnectionEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtConnectionListener.cpp:69
virtual void connectionNetworkAlerting(const PtConnectionEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtConnectionListener.cpp:89
PT_CLASS_INFO_MEMBERS PtConnectionListener(PtEventMask *pMask=NULL)
Definition: PtConnectionListener.cpp:30
virtual void connectionNetworkReached(const PtConnectionEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtConnectionListener.cpp:93
static const char * className()
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
PtConnectionListener & operator=(const PtConnectionListener &rhs)
Definition: PtConnectionListener.cpp:49
virtual void connectionDialing(const PtConnectionEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtConnectionListener.cpp:77
virtual ~PtConnectionListener()
param: (in) pMask - Event mask defining events the listener is interested in. This must be a subset o...
Definition: PtConnectionListener.cpp:41
virtual void connectionCreated(const PtConnectionEvent &rEvent)
Definition: PtConnectionListener.cpp:57
Definition: PtConnectionListener.h:33
Definition: PtEventMask.h:39
virtual void connectionInitiated(const PtConnectionEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtConnectionListener.cpp:85
virtual void connectionEstablished(const PtConnectionEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtConnectionListener.cpp:81