sipxmedialib  Version 3.3
MprnDTMFMsg.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2007 SIPez LLC.
3 // Licensed to SIPfoundry under a Contributor Agreement.
4 //
5 // Copyright (C) 2007 SIPfoundry Inc.
6 // Licensed by SIPfoundry under the LGPL license.
7 //
8 // $$
10 
11 // Author: Keith Kyzivat <kkyzivat AT SIPez DOT com>
12 
13 #ifndef _MprnDTMFMsg_h_
14 #define _MprnDTMFMsg_h_
15 
16 // SYSTEM INCLUDES
17 
18 // APPLICATION INCLUDES
19 #include "os/OsMsg.h"
20 #include "utl/UtlString.h"
21 #include "mp/MpTypes.h"
22 #include "MpResNotificationMsg.h"
23 
24 // DEFINES
25 // MACROS
26 // EXTERNAL FUNCTIONS
27 // EXTERNAL VARIABLES
28 // CONSTANTS
29 // STRUCTS
30 // TYPEDEFS
31 // FORWARD DECLARATIONS
32 
40 {
41  /* //////////////////////////// PUBLIC //////////////////////////// */
42 public:
43 
44  static const int32_t DURATION_NOT_APPLICABLE;
45 
47  {
50  };
51 
52  enum KeyCode
53  {
54  DTMF_0 = 0,
64  DTMF_STAR = 10,
70  };
71 
72  /* ============================ CREATORS ================================== */
74 
75 
77  MprnDTMFMsg(const UtlString& namedResOriginator,
78  KeyCode key,
79  KeyPressState pressState,
80  int32_t duration = DURATION_NOT_APPLICABLE,
82  int streamId = -1);
83 
85  MprnDTMFMsg(const MprnDTMFMsg& rMsg);
86 
88  virtual OsMsg* createCopy(void) const;
89 
91  virtual ~MprnDTMFMsg();
92 
94 
95  /* ============================ MANIPULATORS ============================== */
97 
98 
100  MprnDTMFMsg& operator=(const MprnDTMFMsg& rhs);
101 
103  void setKeyCode(KeyCode key);
104 
106  void setKeyPressState(KeyPressState pressState);
107 
109  void setDuration(int32_t duration);
110 
112 
113  /* ============================ ACCESSORS ================================= */
115 
116 
118  KeyCode getKeyCode() const;
119 
122 
124  int32_t getDuration() const;
125 
127 
128  /* ============================ INQUIRY =================================== */
130 
131 
133  UtlBoolean isPressed() const;
134 
136 
137  /* //////////////////////////// PROTECTED ///////////////////////////////// */
138 protected:
139 
140  /* //////////////////////////// PRIVATE /////////////////////////////////// */
141 private:
144  int32_t mDuration;
145 };
146 
147 /* ============================ INLINE METHODS ============================ */
148 
149 #endif // _MprnDTMFMsg_h_
Definition: MprnDTMFMsg.h:56
Definition: MprnDTMFMsg.h:58
Definition: MprnDTMFMsg.h:67
virtual OsMsg * createCopy(void) const
Create a copy of this msg object (which may be of a derived type)
Definition: MprnDTMFMsg.cpp:61
KeyPressState getKeyPressState() const
Get the key press state for this DTMF message – down or up.
Definition: MprnDTMFMsg.cpp:117
void setKeyCode(KeyCode key)
Set the specific DTMF value that this event represents.
Definition: MprnDTMFMsg.cpp:91
KeyPressState mPressState
Whether the key is up or down.
Definition: MprnDTMFMsg.h:143
Definition: MprnDTMFMsg.h:62
void setDuration(int32_t duration)
Set the duration of this DTMF event.
Definition: MprnDTMFMsg.cpp:103
MprnDTMFMsg(const UtlString &namedResOriginator, KeyCode key, KeyPressState pressState, int32_t duration=DURATION_NOT_APPLICABLE, MpConnectionID connId=MP_INVALID_CONNECTION_ID, int streamId=-1)
Constructor.
Definition: MprnDTMFMsg.cpp:34
KeyPressState
Definition: MprnDTMFMsg.h:46
Definition: MprnDTMFMsg.h:69
KeyCode getKeyCode() const
Get the specific DTMF value that this event represents.
Definition: MprnDTMFMsg.cpp:111
static const int32_t DURATION_NOT_APPLICABLE
Definition: MprnDTMFMsg.h:44
int32_t getDuration() const
Get the duration of this DTMF event.
Definition: MprnDTMFMsg.cpp:123
int32_t mDuration
Duration of the DTMF event.
Definition: MprnDTMFMsg.h:144
Definition: MprnDTMFMsg.h:57
void setKeyPressState(KeyPressState pressState)
Set the key press state for this DTMF message – down or up.
Definition: MprnDTMFMsg.cpp:97
Definition: MprnDTMFMsg.h:61
KeyCode
Definition: MprnDTMFMsg.h:52
Definition: MprnDTMFMsg.h:66
UtlBoolean isPressed() const
Return TRUE if this notification indicates key is down/pressed.
Definition: MprnDTMFMsg.cpp:131
Definition: MpResNotificationMsg.h:31
Definition: MprnDTMFMsg.h:64
Definition: MprnDTMFMsg.h:55
Definition: MprnDTMFMsg.h:39
KeyCode mKey
The DTMF key value.
Definition: MprnDTMFMsg.h:142
Definition: MprnDTMFMsg.h:65
Definition: MprnDTMFMsg.h:68
MprnDTMFMsg & operator=(const MprnDTMFMsg &rhs)
Assignment operator.
Definition: MprnDTMFMsg.cpp:76
Definition: MprnDTMFMsg.h:60
int MpConnectionID
Flowgraph connection ID.
Definition: MpTypes.h:56
Definition: MprnDTMFMsg.h:63
virtual ~MprnDTMFMsg()
Destructor.
Definition: MprnDTMFMsg.cpp:67
Definition: MprnDTMFMsg.h:48
#define MP_INVALID_CONNECTION_ID
Definition: MpTypes.h:57
Definition: MprnDTMFMsg.h:54
Definition: MprnDTMFMsg.h:49
Definition: MprnDTMFMsg.h:59