lib
KoToolBox.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _KO_TOOLBOX_H_
00020 #define _KO_TOOLBOX_H_
00021
00022 #include <qtoolbutton.h>
00023 #include <qptrvector.h>
00024 #include <qtoolbar.h>
00025 #include <koffice_export.h>
00026 #include <ktoolbar.h>
00027
00028 class QWidget;
00029 class KAction;
00030 class KMainWindow;
00031 class KDualColorButton;
00032 class QGridLayout;
00033 class ToolArea;
00034
00035
00045 class KOFFICEUI_EXPORT KoToolBox : public KToolBar {
00046
00047 Q_OBJECT
00048
00049 public:
00050
00051 KoToolBox( KMainWindow *mainWin, const char* name, KInstance* instance, int numberOfTooltypes);
00052 virtual ~KoToolBox();
00053
00054
00055
00056
00057
00058 void registerTool(KAction * tool, int toolType, Q_UINT32 priority);
00059
00060
00061 void setupTools();
00062
00063 public slots:
00064
00065 virtual void setOrientation ( Orientation o );
00066 void slotButtonPressed( int id );
00067 void slotPressButton( int id );
00068
00069
00070 void enableTools(bool enable);
00071
00072 void slotSetTool(const QString & toolname);
00073
00074 private:
00075
00076 QToolButton * createButton(QWidget * parent, const char* iconName, QString tooltip);
00077
00078
00079 private:
00080 Q_UINT32 m_numberOfButtons;
00081
00082 QButtonGroup * m_buttonGroup;
00083
00084 QPtrList<ToolArea> m_toolBoxes;
00085
00086 typedef QMap< int, KAction*> ToolList;
00087
00088 QPtrList<ToolList> m_tools;
00089 QPtrList<KAction> m_idToActionMap;
00090 KInstance* m_instance;
00091 };
00092
00093
00094 class ToolArea : public QWidget {
00095
00096 public:
00097 ToolArea(QWidget *parent);
00098 ~ToolArea();
00099
00100 void setOrientation ( Qt::Orientation o );
00101 void add(QWidget *button);
00102
00103 QWidget* getNextParent();
00104
00105 private:
00106 QPtrList<QWidget> m_children;
00107 QBoxLayout *m_layout;
00108
00109 QWidget *m_leftRow;
00110 QBoxLayout *m_leftLayout;
00111
00112 QWidget *m_rightRow;
00113 QBoxLayout *m_rightLayout;
00114
00115 bool m_left;
00116 };
00117
00118
00119 #endif // _KO_TOOLBOX_H_
|