sipXcallLib home page


PsLampInfo.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 _PsLampInfo_h_
15 #define _PsLampInfo_h_
16 
17 // SYSTEM INCLUDES
18 // APPLICATION INCLUDES
19 // DEFINES
20 // MACROS
21 // EXTERNAL FUNCTIONS
22 // EXTERNAL VARIABLES
23 // CONSTANTS
24 // STRUCTS
25 // TYPEDEFS
26 // FORWARD DECLARATIONS
27 class PsLampTask;
28 
29 //:Phone set button information
31 {
32 
33 friend class PsLampTask;
34 
35 /* //////////////////////////// PUBLIC //////////////////////////////////// */
36 public:
37 
38  enum LampMode
39  {
40  OFF = 0x00,
41  STEADY = 0x01,
42  FLASH = 0x02, // slow on and off
43  FLUTTER = 0x04, // fast on and off
44  BROKEN_FLUTTER = 0x08, // superposition of flash and flutter
45  WINK = 0x10
46  };
47 
48 /* ============================ CREATORS ================================== */
49 
50  PsLampInfo(int lampId=0,
51  const char* pName="",
52  LampMode mode=OFF);
53  //:Constructor
54  // Default values are provided for all of the arguments so that it is
55  // possible to allocate an array of PsLampInfo objects.
56 
57  PsLampInfo(const PsLampInfo& rPsLampInfo);
58  //:Copy constructor
59 
60  virtual
61  ~PsLampInfo();
62  //:Destructor
63 
64 /* ============================ MANIPULATORS ============================== */
65 
66  PsLampInfo& operator=(const PsLampInfo& rhs);
67  //:Assignment operator
68 
69 /* ============================ ACCESSORS ================================= */
70 
71  int getId(void) const;
72  //:Returns the lamp ID
73 
74  const char* getName(void) const;
75  //:Returns the lamp name
76 
77 /* ============================ INQUIRY =================================== */
78 
79 /* //////////////////////////// PROTECTED ///////////////////////////////// */
80 protected:
81 
82 /* //////////////////////////// PRIVATE /////////////////////////////////// */
83 private:
84 
85  int mLampId; // lamp identifier
86  LampMode mLampMode; // current lamp mode
87  char* mpLampName; // name for this lamp
88 
89  // Access to the mode information for lamp objects needs to be
90  // synchronized. The following methods: setInfo(), setMode() and getMode()
91  // are intended to be called indirectly via methods associated with the
92  // PsLampTask (which ensures that access to the data is synchronized
93  // appropriately.
94 
95  void setInfo(int lampId, LampMode mode, char* pLampName);
96  //:Set all of the properties for the PsLampInfo object
97 
98  void setMode(LampMode mode);
99  //:Set the lamp mode
100 
101  PsLampInfo::LampMode getMode(void) const;
102  //:Returns the lamp mode
103 
104 };
105 
106 /* ============================ INLINE METHODS ============================ */
107 
108 #endif // _PsLampInfo_h_
LampMode mLampMode
Definition: PsLampInfo.h:86
PsLampInfo & operator=(const PsLampInfo &rhs)
Definition: PsLampInfo.cpp:76
Definition: PsLampInfo.h:30
Definition: PsLampInfo.h:40
Definition: PsLampInfo.h:43
Definition: PsLampInfo.h:45
PsLampInfo::LampMode getMode(void) const
Definition: PsLampInfo.cpp:140
int mLampId
Definition: PsLampInfo.h:85
void setMode(LampMode mode)
Definition: PsLampInfo.cpp:134
char * mpLampName
Definition: PsLampInfo.h:87
Definition: PsLampTask.h:33
Definition: PsLampInfo.h:41
LampMode
Definition: PsLampInfo.h:38
PsLampInfo(int lampId=0, const char *pName="", LampMode mode=OFF)
Definition: PsLampInfo.cpp:31
void setInfo(int lampId, LampMode mode, char *pLampName)
Definition: PsLampInfo.cpp:121
int getId(void) const
Definition: PsLampInfo.cpp:103
Definition: PsLampInfo.h:44
const char * getName(void) const
Definition: PsLampInfo.cpp:109
virtual ~PsLampInfo()
Definition: PsLampInfo.cpp:62
Definition: PsLampInfo.h:42