summaryrefslogtreecommitdiffstats
path: root/kxkb/rules.h
blob: d3e72b7a6974dd6313460ab0be202eff973b7882 (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
#ifndef __RULES_H__
#define __RULES_H__

#include <qstring.h>
#include <qdict.h>
#include <qmap.h>


class XkbRules
{
public:

  XkbRules(bool layoutsOnly=false);

  const QDict<char> &models() const { return m_models; };
  const QDict<char> &layouts() const { return m_layouts; };
  const QDict<char> &options() const { return m_options; };
  
  QStringList getAvailableVariants(const QString& layout);
  unsigned int getDefaultGroup(const QString& layout, const QString& includeGroup);

  bool isSingleGroup(const QString& layout);

protected:

  void loadRules(QString filename, bool layoutsOnly=false);
  void loadGroups(QString filename);
  void loadOldLayouts(QString filename);

private:

  QDict<char> m_models;
  QDict<char> m_layouts;
  QDict<char> m_options;
  QMap<QString, unsigned int> m_initialGroups;
  QDict<QStringList> m_varLists;
  QStringList m_oldLayouts;
  QStringList m_nonLatinLayouts;
  
  QString X11_DIR;	// pseudo-constant
  
//  void fixLayouts();
};


#endif