00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __taskbar_h__
00025 #define __taskbar_h__
00026
00027 #include <kpanelextension.h>
00028 #include <taskmanager.h>
00029
00030 #include "taskcontainer.h"
00031 #include "panner.h"
00032 #include "kshadowengine.h"
00033
00034 #define WINDOWLISTBUTTON_SIZE 15
00035 #define BUTTON_MAX_WIDTH 200
00036 #define BUTTON_MIN_WIDTH 20
00037
00038 class Startup;
00039 class Task;
00040 class KGlobalAccel;
00041
00042 class TaskBar : public Panner
00043 {
00044 Q_OBJECT
00045
00046 public:
00047 TaskBar( TQWidget *parent = 0, const char *name = 0 );
00048 ~TaskBar();
00049
00050 TQSize sizeHint() const;
00051 TQSize sizeHint( KPanelExtension::Position, TQSize maxSize ) const;
00052
00053 void setOrientation( Orientation );
00054 void setArrowType( Qt::ArrowType at );
00055
00056 int containerCount() const;
00057 int taskCount() const;
00058 int showScreen() const;
00059
00060 bool showIcon() const { return m_showIcon; }
00061 bool sortByDesktop() const { return m_sortByDesktop; }
00062 bool showAllWindows() const { return m_showAllWindows; }
00063
00064 TQImage* blendGradient(const TQSize& size);
00065
00066 KTextShadowEngine *textShadowEngine();
00067
00068 public slots:
00069 void configure();
00070 void setBackground();
00071
00072 signals:
00073 void containerCountChanged();
00074
00075 protected slots:
00076 void add(Task::Ptr);
00077 void add(Startup::Ptr);
00078 void showTaskContainer(TaskContainer*);
00079 void remove(Task::Ptr task, TaskContainer *container = 0);
00080 void remove(Startup::Ptr startup, TaskContainer *container = 0);
00081
00082 void desktopChanged( int );
00083 void windowChanged(Task::Ptr);
00084 void windowChangedGeometry(Task::Ptr);
00085
00086 void publishIconGeometry();
00087
00088 void activateNextTask( bool forward );
00089 void slotActivateNextTask();
00090 void slotActivatePreviousTask();
00091 void slotSettingsChanged(int);
00092 void reLayout();
00093
00094 protected:
00095 void reLayoutEventually();
00096 void viewportMousePressEvent( TQMouseEvent* );
00097 void viewportMouseReleaseEvent( TQMouseEvent* );
00098 void viewportMouseDoubleClickEvent( TQMouseEvent* );
00099 void viewportMouseMoveEvent( TQMouseEvent* );
00100 void wheelEvent(TQWheelEvent*);
00101 void propagateMouseEvent( TQMouseEvent* );
00102 void resizeEvent( TQResizeEvent* );
00103 void moveEvent( TQMoveEvent* );
00104 bool idMatch( const TQString& id1, const TQString& id2 );
00105 TaskContainer::List filteredContainers();
00106
00107 private:
00108 void sortContainersByDesktop(TaskContainer::List& list);
00109 void setViewportBackground();
00110
00111 bool blocklayout;
00112 bool m_showAllWindows;
00113
00114 int m_currentScreen;
00115 bool m_showOnlyCurrentScreen;
00116 bool m_sortByDesktop;
00117 bool m_showIcon;
00118 bool m_showOnlyIconified;
00119 ArrowType arrowType;
00120 TaskContainer::List containers;
00121 TaskContainer::List m_hiddenContainers;
00122 TaskContainer::List m_deletableContainers;
00123 PixmapList frames;
00124 int maximumButtonsWithoutShrinking() const;
00125 bool shouldGroup() const;
00126 bool isGrouping;
00127 void reGroup();
00128 KGlobalAccel* keys;
00129 KTextShadowEngine* m_textShadowEngine;
00130 TQTimer m_relayoutTimer;
00131 bool m_ignoreUpdates;
00132 TQImage m_blendGradient;
00133 };
00134
00135 #endif