sipXcallLib home page


PsTaoButton.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 #ifndef _PsTaoButton_h_
12 #define _PsTaoButton_h_
13 
14 // SYSTEM INCLUDES
15 
16 // APPLICATION INCLUDES
17 #include "ps/PsTaoComponent.h"
18 
19 // DEFINES
20 // MACROS
21 // EXTERNAL FUNCTIONS
22 // EXTERNAL VARIABLES
23 // CONSTANTS
24 // STRUCTS
25 // TYPEDEFS
26 // FORWARD DECLARATIONS
27 class PsTaoLamp;
28 
29 //:The PsTaoButton class models the keypad and feature buttons.
31 {
32  friend class PsPhoneTask;
33  // The PsPhoneTask is responsible for creating and destroying
34  // all objects derived from the PsTaoComponent class. No other entity
35  // should invoke the constructors or destructors for these classes.
36 
37 /* //////////////////////////// PUBLIC //////////////////////////////////// */
38 public:
39 
41  {
42  UP,
44  };
45 
46 /* ============================ CREATORS ================================== */
47 
48 /* ============================ MANIPULATORS ============================== */
49 
50  void buttonDown(void);
51  //:Press (and hold) the button down.
52 
53  void buttonUp(void);
54  //:Release the button.
55 
56  void buttonPress(void);
57  //:Press the button, effectively buttonDown() followed by buttonUp().
58 
59  UtlBoolean setInfo(const UtlString& rInfo);
60  //:Sets the information associated with this button.
61 
62 /* ============================ ACCESSORS ================================= */
63 
65  //:Returns a pointer to the lamp associated with this button or NULL if
66  //:there is no associated lamp.
67 
68  void getInfo(UtlString& rInfo);
69  //:Returns the information associated with this button.
70 
71 /* ============================ INQUIRY =================================== */
72 
73  UtlBoolean isButtonDown(void);
74  //:Returns TRUE if the button is down, otherwise FALSE.
75 
76  UtlBoolean isButtonRepeating(void);
77  //:Returns TRUE if the button is repeating (and down), otherwise FALSE.
78 
79 /* //////////////////////////// PROTECTED ///////////////////////////////// */
80 protected:
81  PsTaoButton(const UtlString& rComponentName, int componentType);
82 
83 /* //////////////////////////// PRIVATE /////////////////////////////////// */
84 private:
85 
86  int mButtonState; // button state (up or down)
87  UtlString mButtonInfo; // button info
88  UtlBoolean mIsRepeating; // TRUE if button is repeating
89  UtlBoolean mbNotSetBefore; // TRUE if button info is not yet set
90  PsTaoLamp* mpAssocLamp; // pointer to the associated lamp
91 
92  PsTaoButton(const UtlString& rName, const UtlString& rInfo);
93  //:Constructor
94 
95  virtual
96  ~PsTaoButton();
97  //:Destructor
98 
99  void setAssociatedPhoneLamp(PsTaoLamp& rLamp);
100 
101  PsTaoButton();
102  //:Default constructor (not implemented for this class)
103 
104  PsTaoButton(const PsTaoButton& rPsTaoButton);
105  //:Copy constructor (not implemented for this class)
106 
107  PsTaoButton& operator=(const PsTaoButton& rhs);
108  //:Assignment operator (not implemented for this class)
109 
110 };
111 
112 /* ============================ INLINE METHODS ============================ */
113 
114 #endif // _PsTaoButton_h_
void buttonUp(void)
Definition: PsTaoButton.cpp:71
PsTaoButton & operator=(const PsTaoButton &rhs)
Definition: PsTaoButton.cpp:58
Definition: PsTaoComponent.h:32
ButtonState
Definition: PsTaoButton.h:40
Definition: PsTaoButton.h:30
void buttonPress(void)
Definition: PsTaoButton.cpp:76
UtlBoolean isButtonRepeating(void)
Definition: PsTaoButton.cpp:110
PsTaoButton()
Definition: PsTaoButton.cpp:28
virtual ~PsTaoButton()
Definition: PsTaoButton.cpp:49
UtlBoolean isButtonDown(void)
Definition: PsTaoButton.cpp:105
Definition: PsTaoLamp.h:30
UtlBoolean setInfo(const UtlString &rInfo)
Definition: PsTaoButton.cpp:80
void getInfo(UtlString &rInfo)
Definition: PsTaoButton.cpp:98
void buttonDown(void)
Definition: PsTaoButton.cpp:66
UtlString mButtonInfo
Definition: PsTaoButton.h:87
PsTaoLamp * getAssociatedPhoneLamp(void)
Definition: PsTaoButton.cpp:93
UtlBoolean mIsRepeating
Definition: PsTaoButton.h:88
void setAssociatedPhoneLamp(PsTaoLamp &rLamp)
PsTaoLamp * mpAssocLamp
Definition: PsTaoButton.h:90
int mButtonState
Definition: PsTaoButton.h:86
UtlBoolean mbNotSetBefore
Definition: PsTaoButton.h:89
Definition: PsPhoneTask.h:50
Definition: PsTaoButton.h:43
Definition: PsTaoButton.h:42