blob: 0e2ebfd621bdd451bc9677912af0de9dd3c06c12 (
plain)
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
|
/***************************************************************************
* ktouchkeyboard.h *
* ---------------- *
* Copyright (C) 2004 by Andreas Nicolai *
* [email protected] *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#ifndef KTOUCHKEYBOARD_H
#define KTOUCHKEYBOARD_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <tqvaluevector.h>
#include "ktouchkeyconnector.h"
#include "ktouchkey.h"
class KURL;
/// This class stores the keyboard tqlayout and the connectivity between characters
/// and the actual keys.
class KTouchKeyboard {
public:
/// Default constructor, sets up the standard number keyboard.
KTouchKeyboard() { createDefault(); }
/// Clears the keyboard (resets all data)
void clear();
/// Loads a keyboard tqlayout (old format) from file (returns true if successful).
bool load(TQWidget * window, const KURL& url);
/// Loads a lecture (in XML format) from file (returns true if successful).
bool loadXML(TQWidget * window, const KURL& url);
/// Saves the lecture data to file (returns true if successful).
bool saveXML(TQWidget * window, const KURL& url) const;
/// Creates the default number keyboard.
void createDefault();
/// Updates the indices in the KTouchKeyConnector objects for faster access.
void updateConnections();
TQValueVector<KTouchKey> m_keys; ///< Vector with key definitions.
TQValueVector<KTouchKeyConnector> m_connectors; ///< Vector with connectivity data.
TQString m_title; ///< Title of the keyboard (to appear in the menu).
TQString m_comment; ///< Comments about the creator of the keyboard tqlayout.
TQString m_language; ///< Language ID of keyboard
TQString m_fontSuggestions; ///< Suggestions of fonts to be used on the keys.
// These variables are recalculated after the keyboard was loaded.
int m_width; ///< The width of the keyboard (maximum of the sums of all keywidths in each line).
int m_height; ///< The height of the keyboard (sum of all key row heights).
private:
/// Loads keyboard data from file
bool read(TQTextStream& in);
/// Loads keyboard data from file into an XML document
bool read(const TQDomDocument& doc);
/// Saves keyboard data in the XML document
void write(TQDomDocument& doc) const;
};
#endif // KTOUCHKEYBOARD_H
|