sipXcallLib home page


PsMsg.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2006 SIPez LLC.
3 // Licensed to SIPfoundry under a Contributor Agreement.
4 //
5 // Copyright (C) 2004-2006 SIPfoundry Inc.
6 // Licensed by SIPfoundry under the LGPL license.
7 //
8 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
9 // Licensed to SIPfoundry under a Contributor Agreement.
10 //
11 // $$
13 
14 #ifndef _PsMsg_h_
15 #define _PsMsg_h_
16 
17 // SYSTEM INCLUDES
18 
19 // APPLICATION INCLUDES
20 #include "os/OsMsg.h"
21 // DEFINES
22 #define PSMSG_MAX_STRINGPARAM_LENGTH 1024
23 // MACROS
24 // EXTERNAL FUNCTIONS
25 // EXTERNAL VARIABLES
26 // CONSTANTS
27 // STRUCTS
28 // TYPEDEFS
29 // FORWARD DECLARATIONS
30 class UtlString;
31 
32 //:Message object used to communicate phone set information
33 class PsMsg : public OsMsg
34 {
35 /* //////////////////////////// PUBLIC //////////////////////////////////// */
36 public:
37 
38  // Phone set message types
39  enum PsMsgType
40  {
41 /* ----------------------------- LOWLEVEL --------------------------------- */
45  KEY_DOWN, //for true keyboard support on NT
53 /* ----------------------------- PHONEBUTTON ------------------------------ */
58 /* ----------------------------- PHONEHOOKSWITCH -------------------------- */
62 /* ----------------------------- PHONELAMP -------------------------------- */
67 /* ----------------------------- PHONEDISPLAY ----------------------------- */
72 /* ----------------------------- PHONEMIC --------------------------------- */
75 /* ----------------------------- PHONERINGER ------------------------------ */
85 /* ----------------------------- PHONESPEAKER ----------------------------- */
90 /* ----------------------------- PHONECOMPONENT --------------------------- */
93 /* ----------------------------- PHONECOMPONENT --------------------------- */
96 /* ----------------------------- PHONEGROUP ------------------------------- */
103 /* ----------------------------- TERMINAL --------------------------------- */
107  };
108 
109 /* ============================ CREATORS ================================== */
110 
111  PsMsg(int msg, void* source, const int param1, const int param2);
112  //:Constructor
113 
114  PsMsg(const PsMsg& rPsMsg);
115  //:Copy constructor
116 
117  virtual OsMsg* createCopy(void) const;
118  //:Create a copy of this msg object (which may be of a derived type)
119 
120  virtual
121  ~PsMsg();
122  //:Destructor
123 
124 /* ============================ MANIPULATORS ============================== */
125 
126  PsMsg& operator=(const PsMsg& rhs);
127  //:Assignment operator
128 
129  void setMsgSource(void* source);
130  //:Set the message source
131 
132  void setParam1(int param1);
133  //:Set parameter1 of the phone set message
134 
135  void setParam2(int param2);
136  //:Set parameter2 of the phone set message
137 
138  void setStringParam1(const char* str);
139  //:Set string parameter1 of the phone set message
140 
141  void setStringParam2(const char* str);
142  //:Set string parameter2 of the phone set message
143 
144 
145  void setInUse(UtlBoolean isInUse);
146  //:Set the InUse flag for the message.
147  // For messages sent from an ISR, TRUE indicates that the receiver is
148  // not done with the message yet. The InUse flag is ignored for
149  // messages that were not sent from an ISR.
150 
151 /* ============================ ACCESSORS ================================= */
152 
153  virtual int getMsg(void) const;
154  //:Return the type of the phone set message
155 
156  virtual void* getMsgSource(void) const;
157  //:Return the message source
158 
159  virtual int getParam1(void) const;
160  //:Return parameter1 of the message
161 
162  virtual int getParam2(void) const;
163  //:Return parameter2 of the message
164 
165  void getStringParam1(UtlString& stringData);
166  //:Return string parameter1 of the message
167 
168  void getStringParam2(UtlString& stringData);
169  //:Return string parameter2 of the message
170 
171 /* ============================ INQUIRY =================================== */
172 
173  UtlBoolean isInUse(void);
174  //:Returns the value of the InUse flag for the message.
175  // For messages sent from an ISR, TRUE indicates that the receiver is
176  // not done with the message yet. The InUse flag is ignored for
177  // messages that were not sent from an ISR.
178 
179 /* //////////////////////////// PROTECTED ///////////////////////////////// */
180 protected:
181 
182 /* //////////////////////////// PRIVATE /////////////////////////////////// */
183 private:
184  UtlBoolean mInUse; // For messages sent from an ISR, indicates that
185  void* mMsgSource; // Message source
186  int mParam1; // Message parameter 1
187  int mParam2; // Message parameter 2
188  char mStringParam1[PSMSG_MAX_STRINGPARAM_LENGTH + 1]; // String parameter 1
189  char mStringParam2[PSMSG_MAX_STRINGPARAM_LENGTH + 1]; // String parameter 2
190  // the receiver is not done with the message yet
191 
192 };
193 
194 /* ============================ INLINE METHODS ============================ */
195 
196 #endif // _PsMsg_h_
Definition: PsMsg.h:88
void setStringParam2(const char *str)
Definition: PsMsg.cpp:148
Definition: PsMsg.h:91
virtual int getParam1(void) const
Definition: PsMsg.cpp:184
Definition: PsMsg.h:71
Definition: PsMsg.h:56
void setInUse(UtlBoolean isInUse)
Definition: PsMsg.cpp:164
virtual void * getMsgSource(void) const
Definition: PsMsg.cpp:178
Definition: PsMsg.h:57
void setParam2(int param2)
Definition: PsMsg.cpp:130
void setStringParam1(const char *str)
Definition: PsMsg.cpp:136
Definition: PsMsg.h:94
Definition: PsMsg.h:80
Definition: PsMsg.h:102
Definition: PsMsg.h:100
Definition: PsMsg.h:86
Definition: PsMsg.h:64
Definition: PsMsg.h:59
Definition: PsMsg.h:69
char mStringParam2[PSMSG_MAX_STRINGPARAM_LENGTH+1]
Definition: PsMsg.h:189
Definition: PsMsg.h:84
Definition: PsMsg.h:89
Definition: PsMsg.h:54
int mParam1
Definition: PsMsg.h:186
Definition: PsMsg.h:87
Definition: PsMsg.h:81
Definition: PsMsg.h:77
Definition: PsMsg.h:68
Definition: PsMsg.h:73
Definition: PsMsg.h:42
char mStringParam1[PSMSG_MAX_STRINGPARAM_LENGTH+1]
Definition: PsMsg.h:188
Definition: PsMsg.h:52
Definition: PsMsg.h:79
UtlBoolean mInUse
Definition: PsMsg.h:184
Definition: PsMsg.h:33
PsMsg(int msg, void *source, const int param1, const int param2)
Definition: PsMsg.cpp:31
Definition: PsMsg.h:98
Definition: PsMsg.h:55
void getStringParam2(UtlString &stringData)
Definition: PsMsg.cpp:205
PsMsg & operator=(const PsMsg &rhs)
Definition: PsMsg.cpp:87
Definition: PsMsg.h:63
Definition: PsMsg.h:46
void setParam1(int param1)
Definition: PsMsg.cpp:124
Definition: PsMsg.h:74
Definition: PsMsg.h:95
Definition: PsMsg.h:65
Definition: PsMsg.h:101
int mParam2
Definition: PsMsg.h:187
void setMsgSource(void *source)
Definition: PsMsg.cpp:118
#define PSMSG_MAX_STRINGPARAM_LENGTH
Definition: PsMsg.h:22
Definition: PsMsg.h:70
Definition: PsMsg.h:49
Definition: PsMsg.h:50
Definition: PsMsg.h:48
Definition: PsMsg.h:83
virtual int getMsg(void) const
Definition: PsMsg.cpp:172
virtual int getParam2(void) const
Definition: PsMsg.cpp:190
Definition: PsMsg.h:43
Definition: PsMsg.h:99
void getStringParam1(UtlString &stringData)
Definition: PsMsg.cpp:196
virtual OsMsg * createCopy(void) const
Definition: PsMsg.cpp:70
Definition: PsMsg.h:51
PsMsgType
Definition: PsMsg.h:39
virtual ~PsMsg()
Definition: PsMsg.cpp:76
Definition: PsMsg.h:60
Definition: PsMsg.h:92
Definition: PsMsg.h:47
Definition: PsMsg.h:78
Definition: PsMsg.h:45
Definition: PsMsg.h:97
Definition: PsMsg.h:105
Definition: PsMsg.h:66
Definition: PsMsg.h:61
Definition: PsMsg.h:76
void * mMsgSource
Definition: PsMsg.h:185
UtlBoolean isInUse(void)
Definition: PsMsg.cpp:217
Definition: PsMsg.h:44
Definition: PsMsg.h:104