File: keyboardsql.h

package info (click to toggle)
tipp10 3.3.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,984 kB
  • sloc: cpp: 8,343; xml: 70; ansic: 60; makefile: 11
file content (119 lines) | stat: -rw-r--r-- 4,493 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*
Copyright (c) 2006-2009, Tom Thielicke IT Solutions

SPDX-License-Identifier: GPL-2.0-only
*/

/****************************************************************
**
** Definition of the KeyboardSql class
** File name: keyboardsql.h
**
****************************************************************/

#ifndef KEYBOARDSQL_H
#define KEYBOARDSQL_H

#include <QChar>
#include <QString>
#include <QStringList>

//! The KeyboardSql class provides a key to layout convertion.
/*!
        The KeyboardSql class is an database interface for a virtual keyboard.
   It can manage different layouts, standard is a windows keyboard layout. Over
   two functions, getKeyLayout() and getModifierLayout() it converts an unicode
   char or a given id into different layout values like coordinates, color and
   form data.

        @author Tom Thielicke, s712715
        @version 0.1.1
        @date 23.06.2006
*/
class KeyboardSql {

public:
    //! Constructor: sets the keyboard layout.
    /*!
            In this contructor the private QString variable opSystem is set.
            Standard value is "win", but other layouts are possible if
            corresponding tables exist. To change it, transmit the parameter
            op.Tables used for the keyboard layout are named
            character_list_<layout>, i.e. character_list_win.

            @param op The code of the keyboard layout table
            @see opSystem
    */
    KeyboardSql(QString keyboardLayout = "us_qwerty_win");

    //! Converts an unicode char into layout values of a key.
    /*!
            This function receives an unicode char, pointers to layout
            values which represent a key and a status text.
            The givenchar is selected in a sql query and the corresponding
            key layout values and a status text are transfered to the passed
            pointers.

            @param givenchar The char which is converted
            @param left The x ccordinate of the key
            @param top The y ccordinate of the key
            @param color The color of the key
            @param form The form of the key
            @param finger The finger code of the key
            @param modifier The id of the corresponding modifier key
            @param modifier2 The id of the corresponding second modifier key
            @param status The text for a status bar
            @see opSystem
    */
    bool getKeyLayout(QChar givenchar, int* left, int* top, int* color,
        int* form, int* modifier, int* modifier2, int* finger, QString* status);

    //! Converts an table id into layout values of a key.
    /*!
            This function receives an id, pointers to layout
            values which represent a key and a status text.
            The id is selected in a sql query and the corresponding
            key layout values and a status text are transfered to the passed
            pointers.

            @param givenmodifier The id which is converted
            @param left The x ccordinate of the key
            @param top The y ccordinate of the key
            @param color The color of the key
            @param form The form of the key
            @param finger The finger code of the key
            @param status The text for a status bar
            @see opSystem
    */
    bool getModifierLayout(int givenmodifier, int* left, int* top, int* color,
        int* form, int* finger, QString* status);

    //! Converts an unicode char into layout values of a key.
    /*!
            This function receives an unicode char, pointers to layout
            values which represent a key and a status text.
            The givenchar is selected in a sql query and the corresponding
            key layout values and a status text are transfered to the passed
            pointers.

            @param givenchar The char which is converted
            @param left The x ccordinate of the key
            @param top The y ccordinate of the key
            @param color The color of the key
            @param form The form of the key
            @param finger The finger code of the key
            @param status The text for a status bar
            @see opSystem
    */
    bool getNumLayout(QChar givenchar, int* left, int* top, int* color,
        int* form, int* finger, QString* status);

    void getFingerDescription();

private:
    //! Holds identification string of the keyboard layout table.
    QString layout;
    QStringList fingers;
};

#endif // KEYBOARDSQL_H