summaryrefslogtreecommitdiffstats
path: root/kxkb/pixmap.h
blob: bb747f8c89f1270a7590162f2ef015b11be079ac (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
#ifndef __PIXMAP_H__
#define __PIXMAP_H__


#include <tqpixmap.h>
#include <tqdict.h>
#include <tqstring.h>

#include "kxkbconfig.h"

#define ERROR_CODE "error"
#define ERROR_LABEL "!"

#define FLAG_MAX_DIM 24

enum PixmapStyle {
    PIXMAP_STYLE_NORMAL = 0,
    PIXMAP_STYLE_INDICATOR = 1,
    PIXMAP_STYLE_CONTEXTMENU = 2
};

class LayoutIconManager {
    public:
        LayoutIconManager(KxkbConfig *kxkbConfig);
        const TQPixmap& find(const TQString& code, int pixmapStyle, const TQString& displayName = TQString::null);

    private:
        TQPixmap* createErrorPixmap();
        void dimPixmap(TQPixmap& pixmap);
        TQString getCountryFromLayoutName(const TQString& layoutName);

    private:
        KxkbConfig *m_kxkbConfig;
        static const TQString flagTemplate;
        bool m_showFlag, m_showLabel, m_bgTransparent, m_labelShadow, m_fitToBox, m_dimFlag, m_bevel;
        TQColor m_bgColor, m_fgColor, m_shColor;
        TQFont m_labelFont;

        TQDict<TQPixmap> m_pixmapCache;
};

#endif