summaryrefslogtreecommitdiff
path: root/core/launcher
Unidiff
Diffstat (limited to 'core/launcher') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/inputmethods.cpp14
-rw-r--r--core/launcher/inputmethods.h2
-rw-r--r--core/launcher/taskbar.cpp41
-rw-r--r--core/launcher/taskbar.h30
4 files changed, 48 insertions, 39 deletions
diff --git a/core/launcher/inputmethods.cpp b/core/launcher/inputmethods.cpp
index f0d8294..d89a366 100644
--- a/core/launcher/inputmethods.cpp
+++ b/core/launcher/inputmethods.cpp
@@ -47,84 +47,84 @@
47/* ### SingleFloppy if someone is interested? */ 47/* ### SingleFloppy if someone is interested? */
48#if 0 48#if 0
49#ifdef QT_NO_COMPONENT 49#ifdef QT_NO_COMPONENT
50#include "../plugins/inputmethods/handwriting/handwritingimpl.h" 50#include "../plugins/inputmethods/handwriting/handwritingimpl.h"
51#include "../plugins/inputmethods/keyboard/keyboardimpl.h" 51#include "../plugins/inputmethods/keyboard/keyboardimpl.h"
52#include "../3rdparty/plugins/inputmethods/pickboard/pickboardimpl.h" 52#include "../3rdparty/plugins/inputmethods/pickboard/pickboardimpl.h"
53#endif 53#endif
54#endif 54#endif
55 55
56/* XPM */ 56/* XPM */
57static const char * tri_xpm[]={ 57static const char * tri_xpm[]={
58"9 9 2 1", 58"9 9 2 1",
59"a c #000000", 59"a c #000000",
60". c None", 60". c None",
61".........", 61".........",
62".........", 62".........",
63".........", 63".........",
64"....a....", 64"....a....",
65"...aaa...", 65"...aaa...",
66"..aaaaa..", 66"..aaaaa..",
67".aaaaaaa.", 67".aaaaaaa.",
68".........", 68".........",
69"........."}; 69"........."};
70 70
71static const int inputWidgetStyle = QWidget::WStyle_Customize |
72 QWidget::WStyle_Tool |
73 QWidget::WStyle_StaysOnTop |
74 QWidget::WGroupLeader;
75
76
77int InputMethod::operator <(const InputMethod& o) const 71int InputMethod::operator <(const InputMethod& o) const
78{ 72{
79 return name() < o.name(); 73 return name() < o.name();
80} 74}
81int InputMethod::operator >(const InputMethod& o) const 75int InputMethod::operator >(const InputMethod& o) const
82{ 76{
83 return name() > o.name(); 77 return name() > o.name();
84} 78}
85int InputMethod::operator <=(const InputMethod& o) const 79int InputMethod::operator <=(const InputMethod& o) const
86{ 80{
87 return name() <= o.name(); 81 return name() <= o.name();
88} 82}
89 83
90 84
91/* 85/*
92 Slightly hacky: We use WStyle_Tool as a flag to say "this widget 86 Slightly hacky: We use WStyle_Tool as a flag to say "this widget
93 belongs to the IM system, so clicking it should not cause a reset". 87 belongs to the IM system, so clicking it should not cause a reset".
94 */ 88 */
95class IMToolButton : public QToolButton 89class IMToolButton : public QToolButton
96{ 90{
97public: 91public:
98 IMToolButton::IMToolButton( QWidget *parent ) : QToolButton( parent ) 92 IMToolButton::IMToolButton( QWidget *parent ) : QToolButton( parent )
99 { setWFlags( WStyle_Tool ); } 93 { setWFlags( WStyle_Tool ); }
100}; 94};
101 95
102 96
103InputMethods::InputMethods( QWidget *parent ) : 97InputMethods::InputMethods( QWidget *parent ) :
104 QWidget( parent, "InputMethods", WStyle_Tool | WStyle_Customize ), 98 QWidget( parent, "InputMethods", WStyle_Tool | WStyle_Customize ),
105 mkeyboard(0), imethod(0) 99 mkeyboard(0), imethod(0)
106{ 100{
101 Config cfg( "Launcher" );
102 cfg.setGroup( "InputMethods" );
103 inputWidgetStyle = QWidget::WStyle_Customize | QWidget::WStyle_StaysOnTop | QWidget::WGroupLeader;
104 inputWidgetStyle |= cfg.readBoolEntry( "Float", false ) ? QWidget::WStyle_DialogBorder : QWidget::WStyle_Tool;
105 inputWidgetWidth = cfg.readNumEntry( "Width", 100 );
106
107 setBackgroundMode( PaletteBackground ); 107 setBackgroundMode( PaletteBackground );
108 QHBoxLayout *hbox = new QHBoxLayout( this ); 108 QHBoxLayout *hbox = new QHBoxLayout( this );
109 109
110 kbdButton = new IMToolButton( this); 110 kbdButton = new IMToolButton( this);
111 kbdButton->setFocusPolicy(NoFocus); 111 kbdButton->setFocusPolicy(NoFocus);
112 kbdButton->setToggleButton( TRUE ); 112 kbdButton->setToggleButton( TRUE );
113 if (parent->sizeHint().height() > 0) 113 if (parent->sizeHint().height() > 0)
114 kbdButton->setFixedHeight( parent->sizeHint().height() ); 114 kbdButton->setFixedHeight( parent->sizeHint().height() );
115 kbdButton->setFixedWidth( 32 ); 115 kbdButton->setFixedWidth( 32 );
116 kbdButton->setAutoRaise( TRUE ); 116 kbdButton->setAutoRaise( TRUE );
117 kbdButton->setUsesBigPixmap( TRUE ); 117 kbdButton->setUsesBigPixmap( TRUE );
118 hbox->addWidget( kbdButton ); 118 hbox->addWidget( kbdButton );
119 connect( kbdButton, SIGNAL(toggled(bool)), this, SLOT(showKbd(bool)) ); 119 connect( kbdButton, SIGNAL(toggled(bool)), this, SLOT(showKbd(bool)) );
120 120
121 kbdChoice = new IMToolButton( this ); 121 kbdChoice = new IMToolButton( this );
122 kbdChoice->setFocusPolicy(NoFocus); 122 kbdChoice->setFocusPolicy(NoFocus);
123 kbdChoice->setPixmap( QPixmap( (const char **)tri_xpm ) ); 123 kbdChoice->setPixmap( QPixmap( (const char **)tri_xpm ) );
124 if (parent->sizeHint().height() > 0) 124 if (parent->sizeHint().height() > 0)
125 kbdChoice->setFixedHeight( parent->sizeHint().height() ); 125 kbdChoice->setFixedHeight( parent->sizeHint().height() );
126 kbdChoice->setFixedWidth( 13 ); 126 kbdChoice->setFixedWidth( 13 );
127 kbdChoice->setAutoRaise( TRUE ); 127 kbdChoice->setAutoRaise( TRUE );
128 hbox->addWidget( kbdChoice ); 128 hbox->addWidget( kbdChoice );
129 connect( kbdChoice, SIGNAL(clicked()), this, SLOT(chooseKbd()) ); 129 connect( kbdChoice, SIGNAL(clicked()), this, SLOT(chooseKbd()) );
130 130
@@ -516,49 +516,49 @@ void InputMethods::chooseMethod(InputMethod* im)
516 if ( im ) 516 if ( im )
517 imButton->raiseWidget(im->widget); 517 imButton->raiseWidget(im->widget);
518 else 518 else
519 imButton->hide(); //### good UI? make sure it is shown again! 519 imButton->hide(); //### good UI? make sure it is shown again!
520 } 520 }
521} 521}
522 522
523void InputMethods::qcopReceive( const QCString &msg, const QByteArray &data ) 523void InputMethods::qcopReceive( const QCString &msg, const QByteArray &data )
524{ 524{
525 if ( imethod && imethod->newIM ) 525 if ( imethod && imethod->newIM )
526 imethod->extInterface->qcopReceive( msg, data ); 526 imethod->extInterface->qcopReceive( msg, data );
527} 527}
528 528
529 529
530void InputMethods::showKbd( bool on ) 530void InputMethods::showKbd( bool on )
531{ 531{
532 if ( !mkeyboard ) 532 if ( !mkeyboard )
533 return; 533 return;
534 534
535 if ( on ) { 535 if ( on ) {
536 mkeyboard->resetState(); 536 mkeyboard->resetState();
537 // HACK... Make the texteditor fit with all input methods 537 // HACK... Make the texteditor fit with all input methods
538 // Input methods should also never use more than about 40% of the screen 538 // Input methods should also never use more than about 40% of the screen
539 int height = QMIN( mkeyboard->widget->sizeHint().height(), 134 ); 539 int height = QMIN( mkeyboard->widget->sizeHint().height(), 134 );
540 mkeyboard->widget->resize( qApp->desktop()->width(), height ); 540 mkeyboard->widget->resize( qApp->desktop()->width() * (inputWidgetWidth*0.01), height );
541 mkeyboard->widget->move( 0, mapToGlobal( QPoint() ).y() - height ); 541 mkeyboard->widget->move( 0, mapToGlobal( QPoint() ).y() - height );
542 mkeyboard->widget->show(); 542 mkeyboard->widget->show();
543 } else { 543 } else {
544 mkeyboard->widget->hide(); 544 mkeyboard->widget->hide();
545 } 545 }
546 546
547 emit inputToggled( on ); 547 emit inputToggled( on );
548} 548}
549 549
550bool InputMethods::shown() const 550bool InputMethods::shown() const
551{ 551{
552 return mkeyboard && mkeyboard->widget->isVisible(); 552 return mkeyboard && mkeyboard->widget->isVisible();
553} 553}
554 554
555QString InputMethods::currentShown() const 555QString InputMethods::currentShown() const
556{ 556{
557 return mkeyboard && mkeyboard->widget->isVisible() 557 return mkeyboard && mkeyboard->widget->isVisible()
558 ? mkeyboard->name() : QString::null; 558 ? mkeyboard->name() : QString::null;
559} 559}
560 560
561void InputMethods::sendKey( ushort unicode, ushort scancode, ushort mod, bool press, bool repeat ) 561void InputMethods::sendKey( ushort unicode, ushort scancode, ushort mod, bool press, bool repeat )
562{ 562{
563#if defined(Q_WS_QWS) 563#if defined(Q_WS_QWS)
564 QWSServer::sendKeyEvent( unicode, scancode, mod, press, repeat ); 564 QWSServer::sendKeyEvent( unicode, scancode, mod, press, repeat );
diff --git a/core/launcher/inputmethods.h b/core/launcher/inputmethods.h
index 93b69de..246661a 100644
--- a/core/launcher/inputmethods.h
+++ b/core/launcher/inputmethods.h
@@ -82,29 +82,31 @@ private slots:
82 void chooseIm(); 82 void chooseIm();
83 void showKbd( bool ); 83 void showKbd( bool );
84 void resetStates(); 84 void resetStates();
85 void sendKey( ushort unicode, ushort scancode, ushort modifiers, bool, bool ); 85 void sendKey( ushort unicode, ushort scancode, ushort modifiers, bool, bool );
86 void qcopReceive( const QCString &msg, const QByteArray &data ); 86 void qcopReceive( const QCString &msg, const QByteArray &data );
87 87
88private: 88private:
89 void setPreferedHandlers(); 89 void setPreferedHandlers();
90 /*static */QStringList plugins()const; 90 /*static */QStringList plugins()const;
91 /*static */void installTranslator( const QString& ); 91 /*static */void installTranslator( const QString& );
92 void unloadMethod( QValueList<InputMethod>& ); 92 void unloadMethod( QValueList<InputMethod>& );
93 void chooseMethod(InputMethod* im); 93 void chooseMethod(InputMethod* im);
94 void chooseKeyboard(InputMethod* im); 94 void chooseKeyboard(InputMethod* im);
95 void updateKeyboards(InputMethod *im); 95 void updateKeyboards(InputMethod *im);
96 96
97private: 97private:
98 QToolButton *kbdButton; 98 QToolButton *kbdButton;
99 QToolButton *kbdChoice; 99 QToolButton *kbdChoice;
100 QWidgetStack *imButton; // later will be widget stack 100 QWidgetStack *imButton; // later will be widget stack
101 QToolButton *imChoice; 101 QToolButton *imChoice;
102 InputMethod *mkeyboard; 102 InputMethod *mkeyboard;
103 InputMethod *imethod; 103 InputMethod *imethod;
104 QValueList<InputMethod> inputMethodList; 104 QValueList<InputMethod> inputMethodList;
105 QValueList<InputMethod> inputModifierList; 105 QValueList<InputMethod> inputModifierList;
106 int inputWidgetStyle;
107 int inputWidgetWidth;
106}; 108};
107 109
108 110
109#endif // __INPUT_METHODS_H__ 111#endif // __INPUT_METHODS_H__
110 112
diff --git a/core/launcher/taskbar.cpp b/core/launcher/taskbar.cpp
index 37fdb30..2966168 100644
--- a/core/launcher/taskbar.cpp
+++ b/core/launcher/taskbar.cpp
@@ -7,48 +7,49 @@
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "startmenu.h" 21#include "startmenu.h"
22#include "inputmethods.h" 22#include "inputmethods.h"
23#include "runningappbar.h" 23#include "runningappbar.h"
24#include "systray.h" 24#include "systray.h"
25#include "wait.h" 25#include "wait.h"
26#include "appicons.h" 26#include "appicons.h"
27 27
28#include "taskbar.h" 28#include "taskbar.h"
29#include "server.h" 29#include "server.h"
30 30
31#include <qtopia/config.h>
31#include <qtopia/qpeapplication.h> 32#include <qtopia/qpeapplication.h>
32#ifdef QWS 33#ifdef QWS
33#include <qtopia/qcopenvelope_qws.h> 34#include <qtopia/qcopenvelope_qws.h>
34#endif 35#endif
35#include <qtopia/global.h> 36#include <qtopia/global.h>
36#include <qtopia/custom.h> 37#include <qtopia/custom.h>
37 38
38#include <qlabel.h> 39#include <qlabel.h>
39#include <qlayout.h> 40#include <qlayout.h>
40#include <qtimer.h> 41#include <qtimer.h>
41#ifdef QWS 42#ifdef QWS
42#include <qwindowsystem_qws.h> 43#include <qwindowsystem_qws.h>
43#endif 44#endif
44#include <qwidgetstack.h> 45#include <qwidgetstack.h>
45 46
46#if defined( Q_WS_QWS ) 47#if defined( Q_WS_QWS )
47#include <qwsdisplay_qws.h> 48#include <qwsdisplay_qws.h>
48#include <qgfx_qws.h> 49#include <qgfx_qws.h>
49#endif 50#endif
50 51
51 52
52static bool initNumLock() 53static bool initNumLock()
53{ 54{
54#ifdef QPE_INITIAL_NUMLOCK_STATE 55#ifdef QPE_INITIAL_NUMLOCK_STATE
@@ -151,48 +152,52 @@ public:
151 } 152 }
152 void paintEvent( QPaintEvent * ) 153 void paintEvent( QPaintEvent * )
153 { 154 {
154 int y = (height()-sizeHint().height())/2; 155 int y = (height()-sizeHint().height())/2;
155 QPainter p(this); 156 QPainter p(this);
156 if ( nl ) 157 if ( nl )
157 p.drawPixmap(1,y,nl_pm); 158 p.drawPixmap(1,y,nl_pm);
158 if ( cl ) 159 if ( cl )
159 p.drawPixmap(1,y+nl_pm.height()+1,cl_pm); 160 p.drawPixmap(1,y+nl_pm.height()+1,cl_pm);
160 } 161 }
161private: 162private:
162 QPixmap nl_pm, cl_pm; 163 QPixmap nl_pm, cl_pm;
163 bool nl, cl; 164 bool nl, cl;
164}; 165};
165 166
166//--------------------------------------------------------------------------- 167//---------------------------------------------------------------------------
167 168
168TaskBar::~TaskBar() 169TaskBar::~TaskBar()
169{ 170{
170} 171}
171 172
172 173
173TaskBar::TaskBar() : QHBox(0, 0, WStyle_Customize | WStyle_Tool | WStyle_StaysOnTop | WGroupLeader) 174TaskBar::TaskBar() : QHBox(0, 0, WStyle_Customize | WStyle_Tool | WStyle_StaysOnTop | WGroupLeader)
174{ 175{
176 Config cfg( "Launcher" );
177 cfg.setGroup( "InputMethods" );
178 resizeRunningApp = cfg.readBoolEntry( "Resize", true );
179
175 sm = new StartMenu( this ); 180 sm = new StartMenu( this );
176 connect( sm, SIGNAL(tabSelected(const QString&)), this, 181 connect( sm, SIGNAL(tabSelected(const QString&)), this,
177 SIGNAL(tabSelected(const QString&)) ); 182 SIGNAL(tabSelected(const QString&)) );
178 183
179 inputMethods = new InputMethods( this ); 184 inputMethods = new InputMethods( this );
180 connect( inputMethods, SIGNAL(inputToggled(bool)), 185 connect( inputMethods, SIGNAL(inputToggled(bool)),
181 this, SLOT(calcMaxWindowRect()) ); 186 this, SLOT(calcMaxWindowRect()) );
182 187
183 stack = new QWidgetStack( this ); 188 stack = new QWidgetStack( this );
184 stack->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); 189 stack->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) );
185 label = new QLabel(stack); 190 label = new QLabel(stack);
186 191
187 runningAppBar = new RunningAppBar(stack); 192 runningAppBar = new RunningAppBar(stack);
188 stack->raiseWidget(runningAppBar); 193 stack->raiseWidget(runningAppBar);
189 194
190 waitIcon = new Wait( this ); 195 waitIcon = new Wait( this );
191 (void) new AppIcons( this ); 196 (void) new AppIcons( this );
192 197
193 sysTray = new SysTray( this ); 198 sysTray = new SysTray( this );
194 199
195 /* ### FIXME plugin loader and safe mode */ 200 /* ### FIXME plugin loader and safe mode */
196#if 0 201#if 0
197 if (PluginLoader::inSafeMode()) 202 if (PluginLoader::inSafeMode())
198 (void)new SafeMode( this ); 203 (void)new SafeMode( this );
@@ -270,68 +275,66 @@ void TaskBar::stopWait()
270 * to smaller screen the SysTray is out of 275 * to smaller screen the SysTray is out of
271 * bounds and repaint() won't trigger an Event 276 * bounds and repaint() won't trigger an Event
272 */ 277 */
273void TaskBar::resizeEvent( QResizeEvent *e ) 278void TaskBar::resizeEvent( QResizeEvent *e )
274{ 279{
275 if ( sysTray ) 280 if ( sysTray )
276 sysTray->hide(); 281 sysTray->hide();
277 282
278 QHBox::resizeEvent( e ); 283 QHBox::resizeEvent( e );
279 284
280 if ( sysTray ) 285 if ( sysTray )
281 sysTray->show(); 286 sysTray->show();
282 287
283 qWarning("TaskBar::resize event"); 288 qWarning("TaskBar::resize event");
284} 289}
285 290
286void TaskBar::styleChange( QStyle &s ) 291void TaskBar::styleChange( QStyle &s )
287{ 292{
288 QHBox::styleChange( s ); 293 QHBox::styleChange( s );
289 calcMaxWindowRect(); 294 calcMaxWindowRect();
290} 295}
291 296
292void TaskBar::calcMaxWindowRect() 297void TaskBar::calcMaxWindowRect()
293{ 298{
294 /* 299 if ( resizeRunningApp )
295#ifdef Q_WS_QWS 300 {
296 QRect wr; 301 #if defined(Q_WS_QWS)
297 int displayWidth = qApp->desktop()->width(); 302 QRect wr;
298 QRect ir = inputMethods->inputRect(); 303 int displayWidth = qApp->desktop()->width();
299 if ( ir.isValid() ) { 304 QRect ir = inputMethods->inputRect();
300 wr.setCoords( 0, 0, displayWidth-1, ir.top()-1 ); 305 if ( ir.isValid() ) {
301 } else { 306 wr.setCoords( 0, 0, displayWidth-1, ir.top()-1 );
302 wr.setCoords( 0, 0, displayWidth-1, y()-1 ); 307 } else {
308 wr.setCoords( 0, 0, displayWidth-1, y()-1 );
309 }
310 #if QT_VERSION < 0x030000
311 QWSServer::setMaxWindowRect( qt_screen->mapToDevice(wr,QSize(qt_screen->width(),qt_screen->height())) );
312 #else
313 QWSServer::setMaxWindowRect( wr );
314 #endif
315 #endif
303 } 316 }
304
305#if QT_VERSION < 0x030000
306 QWSServer::setMaxWindowRect( qt_screen->mapToDevice(wr,
307 QSize(qt_screen->width(),qt_screen->height()))
308 );
309#else
310 QWSServer::setMaxWindowRect( wr );
311#endif
312#endif
313 */
314} 317}
315 318
316void TaskBar::receive( const QCString &msg, const QByteArray &data ) 319void TaskBar::receive( const QCString &msg, const QByteArray &data )
317{ 320{
318 QDataStream stream( data, IO_ReadOnly ); 321 QDataStream stream( data, IO_ReadOnly );
319 if ( msg == "message(QString)" ) { 322 if ( msg == "message(QString)" ) {
320 QString text; 323 QString text;
321 stream >> text; 324 stream >> text;
322 setStatusMessage( text ); 325 setStatusMessage( text );
323 } else if ( msg == "hideInputMethod()" ) { 326 } else if ( msg == "hideInputMethod()" ) {
324 inputMethods->hideInputMethod(); 327 inputMethods->hideInputMethod();
325 } else if ( msg == "showInputMethod()" ) { 328 } else if ( msg == "showInputMethod()" ) {
326 inputMethods->showInputMethod(); 329 inputMethods->showInputMethod();
327 } else if ( msg == "showInputMethod(QString)" ) { 330 } else if ( msg == "showInputMethod(QString)" ) {
328 QString name; 331 QString name;
329 stream >> name; 332 stream >> name;
330 inputMethods->showInputMethod(name); 333 inputMethods->showInputMethod(name);
331 } else if ( msg == "reloadInputMethods()" ) { 334 } else if ( msg == "reloadInputMethods()" ) {
332 inputMethods->loadInputMethods(); 335 inputMethods->loadInputMethods();
333 } else if ( msg == "reloadApplets()" ) { 336 } else if ( msg == "reloadApplets()" ) {
334 sysTray->clearApplets(); 337 sysTray->clearApplets();
335 sm->createMenu(); 338 sm->createMenu();
336 sysTray->addApplets(); 339 sysTray->addApplets();
337 }else if ( msg == "toggleMenu()" ) { 340 }else if ( msg == "toggleMenu()" ) {
diff --git a/core/launcher/taskbar.h b/core/launcher/taskbar.h
index 0cfc123..ed558b1 100644
--- a/core/launcher/taskbar.h
+++ b/core/launcher/taskbar.h
@@ -1,83 +1,87 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#ifndef __TASKBAR_H__ 21#ifndef TASKBAR_H
22#define __TASKBAR_H__ 22#define TASKBAR_H
23 23
24#include <qhbox.h> 24#include <qhbox.h>
25#include "serverinterface.h"
26#include "startmenu.h"
25 27
26class QLabel; 28class QLabel;
27class QTimer; 29class QTimer;
28class InputMethods; 30class InputMethods;
29class Wait; 31class Wait;
30class SysTray; 32class SysTray;
31class RunningAppBar; 33class RunningAppBar;
32class QWidgetStack; 34class QWidgetStack;
33class QTimer; 35class QTimer;
34class QLabel; 36class QLabel;
35class StartMenu;
36class LockKeyState; 37class LockKeyState;
38class AppLnkSet;
37 39
38class TaskBar : public QHBox { 40class TaskBar : public QHBox {
39 Q_OBJECT 41 Q_OBJECT
40public: 42public:
41 TaskBar(); 43 TaskBar();
42 ~TaskBar(); 44 ~TaskBar();
43 45
44 static QWidget *calibrate( bool ); 46 void launchStartMenu() { if (sm) sm->launch(); }
47 void refreshStartMenu() { if (sm) sm->refreshMenu(); }
48 void setApplicationState( const QString &name, ServerInterface::ApplicationState state );
45 49
46 bool recoverMemory(); 50signals:
51 void tabSelected(const QString&);
47 52
48 StartMenu *startMenu() const { return sm; }
49public slots: 53public slots:
50 void startWait(); 54 void startWait();
51 void stopWait(const QString&); 55 void stopWait(const QString&);
52 void stopWait(); 56 void stopWait();
57
53 void clearStatusBar(); 58 void clearStatusBar();
54 void toggleNumLockState(); 59 void toggleNumLockState();
55 void toggleCapsLockState(); 60 void toggleCapsLockState();
56 void toggleSymbolInput(); 61 void toggleSymbolInput();
62 void calcMaxWindowRect();
57 63
58protected: 64protected:
59 void resizeEvent( QResizeEvent * ); 65 void resizeEvent( QResizeEvent * );
60 void styleChange( QStyle & ); 66 void styleChange( QStyle & );
61 void setStatusMessage( const QString &text ); 67 void setStatusMessage( const QString &text );
62 68
63public slots:
64 void calcMaxWindowRect();
65private slots: 69private slots:
66 void receive( const QCString &msg, const QByteArray &data ); 70 void receive( const QCString &msg, const QByteArray &data );
67 71
68private: 72private:
69
70 QTimer *waitTimer; 73 QTimer *waitTimer;
71 Wait *waitIcon; 74 Wait *waitIcon;
72 InputMethods *inputMethods; 75 InputMethods *inputMethods;
73 SysTray *sysTray; 76 SysTray *sysTray;
74 RunningAppBar* runningAppBar; 77 RunningAppBar* runningAppBar;
75 QWidgetStack *stack; 78 QWidgetStack *stack;
76 QTimer *clearer; 79 QTimer *clearer;
77 QLabel *label; 80 QLabel *label;
78 LockKeyState* lockState; 81 LockKeyState* lockState;
79 StartMenu *sm; 82 StartMenu *sm;
83 bool resizeRunningApp;
80}; 84};
81 85
82 86
83#endif // __TASKBAR_H__ 87#endif // TASKBAR_H