4
* Copyright (C) 2004 Brad Hards <bradh@frogmouth.net>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22
#ifndef __LOGITECHMOUSE_H__
23
#define __LOGITECHMOUSE_H__
25
#include <QPushButton>
29
#include <config-workspace.h>
31
#include "ui_logitechmouse_base.h"
35
#define VENDOR_LOGITECH 0x046D
36
#define HAS_RES 0x01 /* mouse supports variable resolution */
37
#define HAS_SS 0x02 /* mouse supports smart scroll control */
38
#define HAS_CSR 0x04 /* mouse supports cordless status reporting and control */
39
#define HAS_SSR 0x08 /* mouse supports smart scroll reporting */
40
#define USE_CH2 0x10 /* mouse needs to use the second channel */
42
class LogitechMouseBase : public QWidget, public Ui::LogitechMouseBase
45
LogitechMouseBase( QWidget *parent ) : QWidget( parent ) {
52
class LogitechMouse : public LogitechMouseBase
57
LogitechMouse( struct usb_device *usbDev, int mouseCapabilityFlags, QWidget* parent = 0, const char* name=0);
60
void save(KConfig *config);
66
void stopTimerForNow();
69
void initCordlessStatusReporting();
70
void updateCordlessStatus();
72
void setLogitechTo400();
73
void setLogitechTo800();
75
QString cordlessName() const ;
77
void updateResolution();
78
quint8 batteryLevel() const;
79
quint8 channel() const;
80
bool isDualChannelCapable() const;
84
struct usb_dev_handle *m_usbDeviceHandle;
85
bool m_connectStatus; // true if the CONNECT button on the mouse is pressed
86
bool m_mousePowerup; // true if we are doing "just out of the box" auto-locking
87
bool m_receiverUnlock; // true if mouse has been disconnected by a long press
88
// of the receiver's CONNECT button
89
bool m_waitLock; // true if receiver searching for new mouse because the
90
// CONNECT button on the receiver was pressed
91
quint8 m_batteryLevel;
93
quint8 m_cordlessNameIndex; // this gets convered into a QString in cordlessName()
94
quint16 m_cordlessSecurity;
95
quint16 m_useSecondChannel;
97
quint8 m_numberOfButtons;
99
bool m_twoChannelCapable; // true if the mouse supports dual channels
100
bool m_verticalRoller; // true if the mouse has a vertical roller (wheel)
101
bool m_horizontalRoller; // true if the mouse has a horizontal roller (wheel)
102
bool m_has800cpi; // true if the mouse does 800cpi resolution
103
int m_mouseCapabilityFlags;