sipXcallLib home page


PtPhoneRinger.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 _PtPhoneRinger_h_
13 #define _PtPhoneRinger_h_
14 
15 // SYSTEM INCLUDES
16 // APPLICATION INCLUDES
17 #include "ptapi/PtComponent.h"
18 #include "os/OsTime.h"
19 #include "os/OsProtectEventMgr.h"
20 // DEFINES
21 // MACROS
22 // EXTERNAL FUNCTIONS
23 // EXTERNAL VARIABLES
24 // CONSTANTS
25 // STRUCTS
26 // TYPEDEFS
27 // FORWARD DECLARATIONS
28 class TaoClientTask;
29 
30 //:The PtPhoneRinger class models a phone ringer.
31 
32 class PtPhoneRinger : public PtComponent
33 {
34 /* //////////////////////////// PUBLIC //////////////////////////////////// */
35 public:
36 
38  {
39  OFF = 0,
40  MIDDLE = 5,
41  FULL = 10
42  };
46 
47 /* ============================ CREATORS ================================== */
48  PtPhoneRinger();
49  //:Default constructor
50 
51  PtPhoneRinger(TaoClientTask *pClient);
52 
53  PtPhoneRinger(const PtPhoneRinger& rPtPhoneRinger);
54  //:Copy constructor (not implemented for this class)
55 
57  //:Assignment operator (not implemented for this class)
58 
59  virtual
61  //:Destructor
62 
63 
64 /* ============================ MANIPULATORS ============================== */
65 
66  virtual PtStatus setRingerInfo(int patternIndex, char* info);
67  //:Specifies the information string to associate with the indicated
68  //:ringer pattern.
69  // The <i>info</i> text string is used to provide additional
70  // ringer-related information to the phone system (for example, the
71  // sound file to associate with this ringer pattern).
77 
78  virtual PtStatus setRingerPattern(int patternIndex);
79  //:Sets the ringer pattern given a valid index number.
80  // The pattern index should be a number between 0 and the value returned
81  // by getMaxRingPatternIndex().
85 
86  virtual PtStatus setRingerVolume(int volume);
87  //:Sets the ringer volume to a value between OFF and FULL (inclusive).
92 
93 /* ============================ ACCESSORS ================================= */
94 
95  virtual PtStatus getMaxRingPatternIndex(int& rMaxIndex);
96  //:Sets <i>rMaxIndex</i> to the maximum valid ringer pattern index.
99 
100  virtual PtStatus getNumberOfRings(int& rNumRingCycles);
101  //:Sets <i>rNumRingCycles</i> to the number of complete ring cycles that the ringer has been ringing.
104 
105  virtual PtStatus getRingerInfo(int patternIndex, char*& rpInfo);
106  //:Sets <i>rpInfo</i> to point to the information text string that is
107  //:associated with the specified ringer pattern.
113 
114  virtual PtStatus getRingerPattern(int& rPatternIndex);
115  //:Sets <i>rPatternIndex</i> to the index of the current ringer pattern.
118 
119  virtual PtStatus getRingerVolume(int& rVolume);
120  //:Sets <i>rVolume</i> to the current ringer volume level.
123 
124 // virtual PtStatus getName(char*& rpName);
125  //:Returns the name associated with this component.
129 
130 // virtual PtStatus getType(int& rType);
131  //:Returns the type associated with this component.
135 
136 /* ============================ INQUIRY =================================== */
137 
138  virtual PtStatus isRingerOn(PtBoolean& rIsOn);
139  //:Sets <i>rIsOn</i> to FALSE if the ringer is OFF and FALSE otherwise.
143 
144 /* //////////////////////////// PROTECTED ///////////////////////////////// */
145 protected:
146 
148 
149  OsTime mTimeOut;
150 /* //////////////////////////// PRIVATE /////////////////////////////////// */
151 private:
152  OsProtectEventMgr *mpEventMgr;
153 
154 
155 };
156 
157 /* ============================ INLINE METHODS ============================ */
158 
159 #endif // _PtPhoneRinger_h_
RingerLevel
Definition: PtPhoneRinger.h:37
PtStatus
Definition: PtDefs.h:49
virtual PtStatus setRingerPattern(int patternIndex)
param: patternIndex - Identifies the pattern whose info string will be modified. param: info - The te...
Definition: PtPhoneRinger.cpp:143
Definition: PtPhoneRinger.h:41
int PtBoolean
Definition: PtDefs.h:71
PtPhoneRinger & operator=(const PtPhoneRinger &rhs)
Definition: PtPhoneRinger.cpp:83
Definition: PtPhoneRinger.h:32
Definition: PtPhoneRinger.h:39
virtual PtStatus getRingerInfo(int patternIndex, char *&rpInfo)
retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available ...
Definition: PtPhoneRinger.cpp:304
virtual PtStatus getNumberOfRings(int &rNumRingCycles)
retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available ...
Definition: PtPhoneRinger.cpp:266
virtual PtStatus isRingerOn(PtBoolean &rIsOn)
retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available ...
Definition: PtPhoneRinger.cpp:429
virtual PtStatus getRingerVolume(int &rVolume)
retcode: PT_SUCCESS - Success retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available ...
Definition: PtPhoneRinger.cpp:387
Definition: PtComponent.h:30
PtPhoneRinger()
enumcode: OFF - The ringer is turned off enumcode: MIDDLE - The ringer volume is set to the middle of...
Definition: PtPhoneRinger.cpp:39
virtual PtStatus setRingerInfo(int patternIndex, char *info)
Definition: PtPhoneRinger.cpp:99
virtual PtStatus getRingerPattern(int &rPatternIndex)
param: patternIndex - identifies the pattern whose info string will be modified. param: rpInfo - set ...
Definition: PtPhoneRinger.cpp:349
virtual ~PtPhoneRinger()
Definition: PtPhoneRinger.cpp:75
OsProtectEventMgr * mpEventMgr
Definition: PtPhoneRinger.h:152
Definition: PtPhoneRinger.h:40
TaoClientTask * mpClient
param: (out) rIsOn - TRUE ==> ringer is ON, FALSE ==> ringer is OFF retcode: PT_SUCCESS - Success ret...
Definition: PtPhoneRinger.h:147
OsTime mTimeOut
Definition: PtPhoneRinger.h:149
virtual PtStatus setRingerVolume(int volume)
retcode: PT_SUCCESS - Success retcode: PT_INVALID_ARGUMENT - Invalid pattern index retcode: PT_PROVID...
Definition: PtPhoneRinger.cpp:182
Definition: TaoClientTask.h:50
virtual PtStatus getMaxRingPatternIndex(int &rMaxIndex)
param: volume - The ringer volume level retcode: PT_SUCCESS - Success retcode: PT_INVALID_ARGUMENT - ...
Definition: PtPhoneRinger.cpp:228