sipXcallLib home page


PtPhoneLamp.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 _PtPhoneLamp_h_
13 #define _PtPhoneLamp_h_
14 
15 // SYSTEM INCLUDES
16 // APPLICATION INCLUDES
17 #include "ptapi/PtDefs.h"
18 #include "ptapi/PtComponent.h"
19 #include "os/OsTime.h"
20 #include "os/OsProtectEventMgr.h"
21 // DEFINES
22 // MACROS
23 // EXTERNAL FUNCTIONS
24 // EXTERNAL VARIABLES
25 // CONSTANTS
26 // STRUCTS
27 // TYPEDEFS
28 // FORWARD DECLARATIONS
29 class PtPhoneButton;
30 class TaoClientTask;
31 
32 //:The PtPhoneLamp class models phone lamps and other simple indicators.
33 
34 class PtPhoneLamp : public PtComponent
35 {
36 friend class PtPhoneButton;
37 
38 /* //////////////////////////// PUBLIC //////////////////////////////////// */
39 public:
40 
42  {
43  MODE_OFF = 0x00,
44  MODE_STEADY = 0x01,
45  MODE_FLASH = 0x02,
46  MODE_FLUTTER = 0x04,
48  MODE_WINK = 0x10
49  };
56 
57 /* ============================ CREATORS ================================== */
58  PtPhoneLamp(const PtPhoneLamp& rPtPhoneLamp);
59  //:Copy constructor
60 
61  PtPhoneLamp(TaoClientTask *pClient);
62 
63  PtPhoneLamp& operator=(const PtPhoneLamp& rhs);
64  //:Assignment operator
65 
66  PtPhoneLamp();
67  //:Default constructor
68 
69  virtual
70  ~PtPhoneLamp();
71  //:Destructor
72 
73 /* ============================ MANIPULATORS ============================== */
74 
75  virtual PtStatus setMode(int mode);
76  //:Sets the indicator to one of its supported modes.
80 
81 /* ============================ ACCESSORS ================================= */
82 
84  //:Returns a pointer to the PtPhoneButton object associated with this indicator.
88 
89  virtual PtStatus getMode(int& rMode);
90  //:Sets <i>rMode</i> to the current mode for this indicator,
93 
94  virtual PtStatus getSupportedModes(int& rModeMask);
95  //:Sets <i>rModeMask</i> to all of the modes that are supported for this indicator.
96 
97 /* ============================ INQUIRY =================================== */
98 
99 /* //////////////////////////// PROTECTED ///////////////////////////////// */
100 protected:
101 
103 
104  OsTime mTimeOut;
105 
106  int mMode;
108  int mType;
109 
111  void setAssociatedButton(PtPhoneButton* pButton);
112 
113 /* //////////////////////////// PRIVATE /////////////////////////////////// */
114 private:
115  OsProtectEventMgr *mpEventMgr;
116 
117 
118 };
119 
120 /* ============================ INLINE METHODS ============================ */
121 
122 #endif // _PtPhoneLamp_h_
PtStatus
Definition: PtDefs.h:49
Definition: PtPhoneLamp.h:48
PtPhoneButton * mpAssociatedButton
Definition: PtPhoneLamp.h:110
OsTime mTimeOut
Definition: PtPhoneLamp.h:104
virtual ~PtPhoneLamp()
Definition: PtPhoneLamp.cpp:81
PtPhoneLamp()
Definition: PtPhoneLamp.cpp:35
virtual PtStatus getSupportedModes(int &rModeMask)
retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available ...
Definition: PtPhoneLamp.cpp:192
Definition: PtComponent.h:30
Definition: PtPhoneButton.h:42
int mMode
Definition: PtPhoneLamp.h:106
Definition: PtPhoneLamp.h:47
virtual PtStatus setMode(int mode)
Definition: PtPhoneLamp.cpp:117
Definition: PtPhoneLamp.h:43
int mType
Definition: PtPhoneLamp.h:108
int mSupportedModes
Definition: PtPhoneLamp.h:107
Definition: PtPhoneLamp.h:44
virtual PtStatus getAssociatedPhoneButton(PtPhoneButton &rButton)
retcode: PT_SUCCESS - Success retcode: PT_INVALID_ARGUMENT - The requested mode is not supported by t...
Definition: PtPhoneLamp.cpp:175
Definition: PtPhoneLamp.h:45
TaoClientTask * mpClient
Definition: PtPhoneLamp.h:102
Definition: PtPhoneLamp.h:34
void setAssociatedButton(PtPhoneButton *pButton)
Definition: PtPhoneLamp.cpp:201
PtPhoneLamp & operator=(const PtPhoneLamp &rhs)
Definition: PtPhoneLamp.cpp:93
virtual PtStatus getMode(int &rMode)
param: (out) rpButton - The pointer to the associated button object retcode: PT_SUCCESS - Success ret...
Definition: PtPhoneLamp.cpp:186
Definition: TaoClientTask.h:50
OsProtectEventMgr * mpEventMgr
Definition: PtPhoneLamp.h:115
Definition: PtPhoneLamp.h:46
IndicatorMode
Definition: PtPhoneLamp.h:41