sipXcallLib home page


PtPhoneButton.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 _PtPhoneButton_h_
13 #define _PtPhoneButton_h_
14 
15 // SYSTEM INCLUDES
16 // APPLICATION INCLUDES
17 #include "ptapi/PtComponent.h"
18 #include "os/OsBSem.h"
19 #include "os/OsProtectEventMgr.h"
20 // DEFINES
21 #define MAX_NAME_LENGTH 128
22 
23 // MACROS
24 // EXTERNAL FUNCTIONS
25 // EXTERNAL VARIABLES
26 // CONSTANTS
27 // STRUCTS
28 // TYPEDEFS
29 // FORWARD DECLARATIONS
30 class PtPhoneLamp;
31 class PtComponent;
32 class TaoClientTask;
33 
34 //:The PtPhoneButton class models keypad and feature buttons. Applications
35 // may "press" this button via the buttonPress() on the PtPhoneButton object. Each
36 // button has an identifying piece of information associated with it (e.g.
37 // the text label on the telephone keypad button). Applications may obtain and set
38 // this information via the getInfo() and setInfo() methods, repsectively. Additionally,
39 // there may be a lamp-component associated with a button, obtained via the
40 // getAssociatedPhoneLamp() method.
41 
42 class PtPhoneButton : public PtComponent
43 {
44 /* //////////////////////////// PUBLIC //////////////////////////////////// */
45 public:
46 
47 /* ============================ CREATORS ================================== */
48  PtPhoneButton();
49  //:Default constructor
50 
51  PtPhoneButton(TaoClientTask *pClient, const char* name = 0);
52 
53  PtPhoneButton(const PtPhoneButton& rPtPhoneButton);
54  //:Copy constructor (not implemented for this class)
55 
57  //:Assignment operator (not implemented for this class)
58 
59  virtual
61  //:Destructor
62 
63 /* ============================ MANIPULATORS ============================== */
64 
65  virtual PtStatus buttonPress(void);
66  //:Press this button.
69 
70  virtual PtStatus setInfo(char* buttonInfo);
71  //:Set the information associated with this button.
75 
76  PtStatus setInfo2(char* buttonInfo);
77  //:Set the information associated with this button locally.
78 
79 /* ============================ ACCESSORS ================================= */
80 
82  //:Returns a pointer to the PtPhoneLamp object associated with this button.
86 
87  PtStatus getInfo(char* pInfo, int maxLen);
88  //:Returns the information associated with this button.
90 
91 /* ============================ INQUIRY =================================== */
92 
93 /* //////////////////////////// PROTECTED ///////////////////////////////// */
94 protected:
96 
99 
100  OsTime mTimeOut;
101 
102 /* //////////////////////////// PRIVATE /////////////////////////////////// */
103 private:
104  OsProtectEventMgr *mpEventMgr;
105 
106 
107 
108 };
109 
110 /* ============================ INLINE METHODS ============================ */
111 
112 #endif // _PtPhoneButton_h_
PtStatus
Definition: PtDefs.h:49
virtual PtStatus setInfo(char *buttonInfo)
retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available ...
Definition: PtPhoneButton.cpp:193
OsProtectEventMgr * mpEventMgr
Definition: PtPhoneButton.h:104
virtual PtStatus buttonPress(void)
Definition: PtPhoneButton.cpp:153
PtStatus setInfo2(char *buttonInfo)
param: (in) buttonInfo - The string to associate with this button retcode: PT_SUCCESS - Success retco...
Definition: PtPhoneButton.cpp:207
Definition: PtComponent.h:30
Definition: PtPhoneButton.h:42
virtual ~PtPhoneButton()
Definition: PtPhoneButton.cpp:103
PtStatus getInfo(char *pInfo, int maxLen)
param: (out) rpLamp - The pointer to the associated lamp object retcode: PT_SUCCESS - Success retcode...
Definition: PtPhoneButton.cpp:240
PtPhoneLamp * mpLamp
Definition: PtPhoneButton.h:98
PtPhoneButton & operator=(const PtPhoneButton &rhs)
Definition: PtPhoneButton.cpp:116
TaoClientTask * mpClient
Definition: PtPhoneButton.h:97
char mpInfo[MAX_NAME_LENGTH+1]
param: (out) pInfo - A pointer to the string associated with this button
Definition: PtPhoneButton.h:95
virtual PtStatus getAssociatedPhoneLamp(PtPhoneLamp &rLamp)
Definition: PtPhoneButton.cpp:225
Definition: PtPhoneLamp.h:34
OsTime mTimeOut
Definition: PtPhoneButton.h:100
PtPhoneButton()
Definition: PtPhoneButton.cpp:35
#define MAX_NAME_LENGTH
Definition: PtPhoneButton.h:21
Definition: TaoClientTask.h:50