File indexing completed on 2024-12-22 05:17:13

0001 /*
0002  * This file is part of the KDE wacomtablet project. For copyright
0003  * information and license terms see the AUTHORS and COPYING files
0004  * in the top-level directory of this distribution.
0005  *
0006  * This program is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU General Public License as
0008  * published by the Free Software Foundation; either version 2 of
0009  * the License, or (at your option) any later version.
0010  *
0011  * This program is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014  * GNU General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU General Public License
0017  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
0018  */
0019 
0020 #ifndef COMMONTESTUTILS_H
0021 #define COMMONTESTUTILS_H
0022 
0023 #include "common/deviceinformation.h"
0024 #include "common/deviceprofile.h"
0025 #include "common/devicetype.h"
0026 #include "common/tabletinformation.h"
0027 
0028 #include <QString>
0029 
0030 namespace Wacom
0031 {
0032 
0033 class CommonTestUtils
0034 {
0035 public:
0036     /*
0037      * Expected Values
0038      */
0039 
0040     static const long DEVICEINFORMATION_DEVICE_ID;
0041     static const QString DEVICEINFORMATION_DEVICE_NODE;
0042     static const long DEVICEINFORMATION_PRODUCT_ID;
0043     static const long DEVICEINFORMATION_TABLET_SERIAL;
0044     static const long DEVICEINFORMATION_VENDOR_ID;
0045 
0046     static const QString TABLETINFORMATION_COMPANY_ID;
0047     static const QString TABLETINFORMATION_COMPANY_NAME;
0048     static const QString TABLETINFORMATION_TABLET_MODEL;
0049     static const QString TABLETINFORMATION_TABLET_NAME;
0050     static const QString TABLETINFORMATION_TABLET_SERIAL;
0051     static const QString TABLETINFORMATION_TABLET_ID;
0052     static const bool TABLETINFORMATION_HAS_BUTTONS;
0053     static const bool TABLETINFORMATION_HAS_WHEEL;
0054     static const bool TABLETINFORMATION_HAS_TOUCHRING;
0055     static const bool TABLETINFORMATION_HAS_TOUCHSTRIPLEFT;
0056     static const bool TABLETINFORMATION_HAS_TOUCHSTRIPRIGHT;
0057     static const bool TABLETINFORMATION_IS_AVAILABLE;
0058     static const QString TABLETINFORMATION_NUM_PAD_BUTTONS;
0059 
0060     static const QString TABLETINFORMATION_DEV1_NAME;
0061     static const QString TABLETINFORMATION_DEV1_TYPE;
0062 
0063     static const QString TABLETINFORMATION_DEV2_NAME;
0064     static const QString TABLETINFORMATION_DEV2_TYPE;
0065 
0066     static const QString TABLETINFORMATION_DEV3_NAME;
0067     static const QString TABLETINFORMATION_DEV3_TYPE;
0068 
0069     /*
0070      * Helper Methods
0071      */
0072 
0073     static void assertValues(const DeviceInformation &info, const DeviceType &expectedType, const QString &expectedName);
0074 
0075     static void assertValues(DeviceProfile &profile, const char *name = nullptr);
0076 
0077     static void assertValues(const TabletInformation &info);
0078 
0079     static void setValues(DeviceInformation &info);
0080 
0081     static void setValues(DeviceProfile &profile);
0082 
0083     static void setValues(TabletInformation &info);
0084 
0085 }; // CLASS
0086 } // NAMESPACE
0087 #endif // HEADER PROTECTION