sipxmediaadapterlib  Version 3.3
MiDtmfNotf.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 _MiDtmfNotf_h_
14 #define _MiDtmfNotf_h_
15 
16 // SYSTEM INCLUDES
17 
18 // APPLICATION INCLUDES
19 #include "os/OsMsg.h"
20 #include "utl/UtlString.h"
21 #include "mi/MiNotification.h"
22 
23 // DEFINES
24 // MACROS
25 // EXTERNAL FUNCTIONS
26 // EXTERNAL VARIABLES
27 // CONSTANTS
28 // STRUCTS
29 // TYPEDEFS
30 // FORWARD DECLARATIONS
31 
37 class MiDtmfNotf : public MiNotification
38 {
39  /* //////////////////////////// PUBLIC //////////////////////////////////// */
40 public:
41 
42  static const int32_t DURATION_NOT_APPLICABLE;
43 
45  {
48  };
49 
50  enum KeyCode
51  {
52  DTMF_0 = 0,
62  DTMF_STAR = 10,
68  };
69 
70  /* ============================ CREATORS ================================== */
72 
73 
75  MiDtmfNotf(const UtlString& sourceId,
76  KeyCode key,
77  KeyPressState pressState,
78  int32_t duration = DURATION_NOT_APPLICABLE,
79  int connId = -1,
80  int streamId = -1);
81 
83  MiDtmfNotf(const MiDtmfNotf& rNotf);
84 
86  virtual OsMsg* createCopy(void) const;
87 
89  virtual ~MiDtmfNotf();
90 
92 
93  /* ============================ MANIPULATORS ============================== */
95 
96 
98  MiDtmfNotf& operator=(const MiDtmfNotf& rhs);
99 
101  void setKeyCode(KeyCode key);
102 
104  void setKeyPressState(KeyPressState pressState);
105 
107  void setDuration(int32_t duration);
108 
110 
111  /* ============================ ACCESSORS ================================= */
113 
114 
116  KeyCode getKeyCode() const;
117 
120 
122  int32_t getDuration() const;
123 
125 
126  /* ============================ INQUIRY =================================== */
128 
129 
130  UtlBoolean isPressed() const;
131 
133 
134  /* //////////////////////////// PROTECTED ///////////////////////////////// */
135 protected:
136 
137  /* //////////////////////////// PRIVATE /////////////////////////////////// */
138 private:
141  int32_t mDuration;
142 };
143 
144 /* ============================ INLINE METHODS ============================ */
145 
146 #endif // _MiDtmfNotf_h_
Definition: MiDtmfNotf.h:55
Definition: MiDtmfNotf.h:65
void setDuration(int32_t duration)
Set the duration of this DTMF notification.
Definition: MiDtmfNotf.cpp:101
int32_t getDuration() const
Get the duration of this DTMF notification.
Definition: MiDtmfNotf.cpp:121
MiDtmfNotf(const UtlString &sourceId, KeyCode key, KeyPressState pressState, int32_t duration=DURATION_NOT_APPLICABLE, int connId=-1, int streamId=-1)
Constructor.
Definition: MiDtmfNotf.cpp:32
Definition: MiDtmfNotf.h:58
int32_t mDuration
Duration of the DTMF event.
Definition: MiDtmfNotf.h:141
virtual OsMsg * createCopy(void) const
Create a copy of this msg object (which may be of a derived type)
Definition: MiDtmfNotf.cpp:59
void setKeyPressState(KeyPressState pressState)
Set the key press state for this DTMF notification – down or up.
Definition: MiDtmfNotf.cpp:95
Definition: MiDtmfNotf.h:62
Definition: MiDtmfNotf.h:64
void setKeyCode(KeyCode key)
Set the specific DTMF value that this notification represents.
Definition: MiDtmfNotf.cpp:89
Definition: MiDtmfNotf.h:59
UtlBoolean isPressed() const
Definition: MiDtmfNotf.cpp:129
Definition: MiDtmfNotf.h:67
Definition: MiDtmfNotf.h:66
Message notification class used to communicate media notification events.
Definition: MiNotification.h:42
Definition: MiDtmfNotf.h:47
KeyCode mKey
The DTMF key value.
Definition: MiDtmfNotf.h:139
KeyPressState getKeyPressState() const
Get the key press state for this DTMF notification – down or up.
Definition: MiDtmfNotf.cpp:115
Definition: MiDtmfNotf.h:46
Definition: MiDtmfNotf.h:52
Definition: MiDtmfNotf.h:61
MiDtmfNotf & operator=(const MiDtmfNotf &rhs)
Assignment operator.
Definition: MiDtmfNotf.cpp:74
Definition: MiDtmfNotf.h:54
Definition: MiDtmfNotf.h:63
virtual ~MiDtmfNotf()
Destructor.
Definition: MiDtmfNotf.cpp:65
Definition: MiDtmfNotf.h:37
KeyCode getKeyCode() const
Get the specific DTMF value that this notification represents.
Definition: MiDtmfNotf.cpp:109
Definition: MiDtmfNotf.h:57
KeyPressState
Definition: MiDtmfNotf.h:44
Definition: MiDtmfNotf.h:56
KeyCode
Definition: MiDtmfNotf.h:50
Definition: MiDtmfNotf.h:60
Definition: MiDtmfNotf.h:53
KeyPressState mPressState
Whether the key is up or down.
Definition: MiDtmfNotf.h:140
static const int32_t DURATION_NOT_APPLICABLE
Definition: MiDtmfNotf.h:42