summaryrefslogtreecommitdiffstats
path: root/kxkb/kxkbtraywindow.h
diff options
context:
space:
mode:
Diffstat (limited to 'kxkb/kxkbtraywindow.h')
-rw-r--r--kxkb/kxkbtraywindow.h81
1 files changed, 20 insertions, 61 deletions
diff --git a/kxkb/kxkbtraywindow.h b/kxkb/kxkbtraywindow.h
index 46d66c44b..484bae632 100644
--- a/kxkb/kxkbtraywindow.h
+++ b/kxkb/kxkbtraywindow.h
@@ -1,7 +1,7 @@
//
// C++ Interface: kxkbtraywindow
//
-// Description:
+// Description:
//
//
// Author: Andriy Rysin <rysin@kde.org>, (C) 2006
@@ -19,75 +19,34 @@
#include "kxkbconfig.h"
-
-class TQLabel;
-class TDEPopupMenu;
class XkbRules;
-/* This class is responsible for displaying flag/label for the layout,
- catching keyboard/mouse events and displaying menu when selected
-*/
-
-class KxkbLabelController: public TQObject
+class KxkbSystemTray : public KSystemTray
{
-// TQ_OBJECT
-
-public:
- enum { START_MENU_ID = 100, CONFIG_MENU_ID = 130, HELP_MENU_ID = 131 };
-
- KxkbLabelController(TQLabel *label, TDEPopupMenu* contextMenu);
+ TQ_OBJECT
- void initLayoutList(const TQValueList<LayoutUnit>& layouts, const XkbRules& rule);
- void setCurrentLayout(const LayoutUnit& layout);
-// void setCurrentLayout(const TQString& layout, const TQString &variant);
- void setError(const TQString& layoutInfo="");
- void setShowFlag(bool showFlag) { m_showFlag = showFlag; }
- void show() { label->show(); }
+ public:
+ KxkbSystemTray();
+ void initLayoutList(const TQValueList<LayoutUnit>& layouts, const XkbRules& rule);
+ void setCurrentLayout(const LayoutUnit& layout);
+ void setError(const TQString& layoutInfo = TQString::null);
- WId winId() { return label->winId(); }
-
-// signals:
-//
-// void menuActivated(int);
-// void toggled();
+ enum { START_MENU_ID = 100, CONFIG_MENU_ID = 130, HELP_MENU_ID = 131 };
-// protected:
-//
-// void mouseReleaseEvent(TQMouseEvent *);
-
-private:
- TQLabel* label;
- TDEPopupMenu* contextMenu;
-
- const int m_menuStartIndex;
- bool m_showFlag;
- int m_prevLayoutCount;
- TQMap<TQString, TQString> m_descriptionMap;
-
- void setToolTip(const TQString& tip);
- void setPixmap(const TQPixmap& pixmap);
-};
+ protected:
+ void mouseReleaseEvent(TQMouseEvent *ev);
+ private slots:
+ void setToolTip(const TQString& tip);
+ void setPixmap(const TQPixmap& pix);
-class KxkbSystemTray : public KSystemTray
-{
- TQ_OBJECT
-
- public:
- KxkbSystemTray():
- KSystemTray(NULL)
- {}
-
- void mouseReleaseEvent(TQMouseEvent *ev)
- {
- if (ev->button() == TQt::LeftButton)
- emit toggled();
- KSystemTray::mouseReleaseEvent(ev);
- }
+ signals:
+ void menuActivated(int);
+ void toggled();
- signals:
- void menuActivated(int);
- void toggled();
+ private:
+ int m_prevLayoutCount;
+ TQMap<TQString, TQString> m_descriptionMap;
};