OpenZWave Library  1.2
ValueButton.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 //
3 // ValueButton.h
4 //
5 // Represents a write-only value that triggers activity in a device
6 //
7 // Copyright (c) 2010 Mal Lansell <openzwave@lansell.org>
8 //
9 // SOFTWARE NOTICE AND LICENSE
10 //
11 // This file is part of OpenZWave.
12 //
13 // OpenZWave is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU Lesser General Public License as published
15 // by the Free Software Foundation, either version 3 of the License,
16 // or (at your option) any later version.
17 //
18 // OpenZWave is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU Lesser General Public License for more details.
22 //
23 // You should have received a copy of the GNU Lesser General Public License
24 // along with OpenZWave. If not, see <http://www.gnu.org/licenses/>.
25 //
26 //-----------------------------------------------------------------------------
27 
28 #ifndef _ValueButton_H
29 #define _ValueButton_H
30 
31 #include <string>
32 #include "Defs.h"
33 #include "value_classes/Value.h"
34 
35 class TiXmlElement;
36 
37 namespace OpenZWave
38 {
39  class Msg;
40  class Node;
41  class CommandClass;
42 
45  class ValueButton: public Value
46  {
47  public:
48  ValueButton( uint32 const _homeId, uint8 const _nodeId, ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint8 const _index, string const& _label, uint8 const _pollIntensity );
49  ValueButton(): m_pressed( false ){}
50  virtual ~ValueButton(){}
51 
52  bool PressButton();
53  bool ReleaseButton();
54 
55  // From Value
56  virtual void ReadXML( uint32 const _homeId, uint8 const _nodeId, uint8 const _commandClassId, TiXmlElement const* _valueElement );
57  virtual void WriteXML( TiXmlElement* _valueElement );
58 
59  bool IsPressed()const{ return m_pressed; }
60 
61  private:
62  bool m_pressed;
63  };
64 
65 } // namespace OpenZWave
66 
67 #endif
68 
69 
70 
uint32
unsigned int uint32
Definition: Defs.h:69
OpenZWave::ValueButton::~ValueButton
virtual ~ValueButton()
Definition: ValueButton.h:50
OpenZWave::ValueButton::PressButton
bool PressButton()
Definition: ValueButton.cpp:90
OpenZWave::ValueButton::WriteXML
virtual void WriteXML(TiXmlElement *_valueElement)
Definition: ValueButton.cpp:78
OpenZWave::ValueID::ValueGenre
ValueGenre
Definition: ValueID.h:71
uint8
unsigned char uint8
Definition: Defs.h:63
OpenZWave::ValueButton::ReleaseButton
bool ReleaseButton()
Definition: ValueButton.cpp:103
OpenZWave::ValueButton
Button value ???.
Definition: ValueButton.h:45
OpenZWave::ValueButton::ReadXML
virtual void ReadXML(uint32 const _homeId, uint8 const _nodeId, uint8 const _commandClassId, TiXmlElement const *_valueElement)
Definition: ValueButton.cpp:63
OpenZWave::Value
Base class for values associated with a node.
Definition: Value.h:44
OpenZWave::ValueButton::IsPressed
bool IsPressed() const
Definition: ValueButton.h:59
Defs.h
OpenZWave::ValueButton::ValueButton
ValueButton()
Definition: ValueButton.h:49
Value.h
OpenZWave
Definition: Bitfield.h:34