27 #include <tqtoolbar.h>
28 #include <tqmainwindow.h>
29 #include <tqcombobox.h>
31 #include <tqptrlist.h>
32 #include <tqguardedptr.h>
34 #include <tqiconset.h>
36 #include <tdeglobal.h>
49 class TDEToolBoxManager;
56 class TDEToolBarPrivate;
58 class TDEUI_EXPORT TDEToolBarSeparator :
public TQFrame
63 TDEToolBarSeparator( Orientation,
bool l, TQToolBar *parent,
const char* name=0 );
65 TQSize sizeHint()
const;
66 Orientation orientation()
const {
return orient; }
67 TQSizePolicy sizePolicy()
const;
68 bool showLine()
const {
return line; }
70 void setOrientation( Orientation );
72 void styleChange( TQStyle& );
73 void drawContents( TQPainter* );
109 TQ_PROPERTY( IconText iconText READ iconText WRITE setIconText )
110 TQ_PROPERTY(
BarPosition barPos READ barPos WRITE setBarPos )
111 TQ_PROPERTY(
bool fullSize READ fullSize WRITE setFullSize )
112 TQ_PROPERTY(
int iconSize READ iconSize WRITE setIconSize )
113 TQ_PROPERTY( TQString text READ text WRITE setText )
116 enum IconText{IconOnly = 0, IconTextRight, TextOnly, IconTextBottom};
125 enum BarPosition{ Unmanaged, Floating, Top, Bottom, Right, Left, Flat};
144 TDEToolBar( TQWidget *parent,
const char *name = 0,
bool honorStyle =
false,
bool readConfig =
true );
161 TDEToolBar( TQMainWindow *parentWindow, TQMainWindow::ToolBarDock dock ,
bool newLine =
false,
162 const char *name = 0,
bool honorStyle =
false,
bool readConfig =
true );
179 TDEToolBar( TQMainWindow *parentWindow, TQWidget *dock,
bool newLine =
false,
180 const char *name = 0,
bool honorStyle =
false,
bool readConfig =
true );
208 int insertButton(
const TQString& icon,
int id,
bool enabled =
true,
209 const TQString& text = TQString::null,
int index=-1,
230 int insertButton(
const TQString& icon,
int id,
const char *signal,
231 const TQObject *receiver,
const char *slot,
232 bool enabled =
true,
const TQString& text = TQString::null,
259 int insertButton(
const TQPixmap& pixmap,
int id,
bool enabled =
true,
260 const TQString& text = TQString::null,
int index=-1 );
279 int insertButton(
const TQPixmap& pixmap,
int id,
const char *signal,
280 const TQObject *receiver,
const char *slot,
281 bool enabled =
true,
const TQString& text = TQString::null,
296 int insertButton(
const TQString& icon,
int id, TQPopupMenu *popup,
297 bool enabled,
const TQString&_text,
int index=-1);
311 int insertButton(
const TQPixmap& pixmap,
int id, TQPopupMenu *popup,
312 bool enabled,
const TQString&_text,
int index=-1);
326 int insertLined (
const TQString& text,
int id,
328 const TQObject *receiver,
const char *slot,
330 const TQString& toolTipText = TQString::null,
331 int size = 70,
int index =-1);
347 int insertCombo (
const TQStringList &list,
int id,
bool writable,
348 const char *signal,
const TQObject *receiver,
349 const char *slot,
bool enabled=
true,
350 const TQString& tooltiptext=TQString::null,
351 int size=70,
int index=-1,
352 TQComboBox::Policy policy = TQComboBox::AtBottom);
363 int insertCombo (
const TQString& text,
int id,
bool writable,
364 const char *signal, TQObject *receiver,
365 const char *slot,
bool enabled=
true,
366 const TQString& tooltiptext=TQString::null,
367 int size=70,
int index=-1,
368 TQComboBox::Policy policy = TQComboBox::AtBottom);
374 int insertSeparator(
int index = -1,
int id = -1 );
380 int insertLineSeparator(
int index = -1,
int id = -1 );
392 int insertWidget(
int id,
int width, TQWidget *_widget,
int index=-1);
410 int insertAnimatedWidget(
int id, TQObject *receiver,
const char *slot,
411 const TQString& icons,
int index = -1);
429 void addConnection (
int id,
const char *signal,
430 const TQObject *receiver,
const char *slot);
434 void setItemEnabled(
int id,
bool enabled );
441 void setButtonIcon(
int id,
const TQString& _icon );
448 void setButtonPixmap(
int id,
const TQPixmap& _pixmap );
455 void setButtonIconSet(
int id,
const TQIconSet& iconset );
483 void setDelayedPopup (
int id , TQPopupMenu *_popup,
bool toggle =
false);
498 void setAutoRepeat (
int id,
bool flag=
true);
504 void setToggle (
int id,
bool flag =
true);
515 void toggleButton (
int id);
526 void setButton (
int id,
bool flag);
533 bool isButtonOn (
int id)
const;
540 void setLinedText (
int id,
const TQString& text);
546 TQString getLinedText (
int id)
const;
551 void insertComboItem (
int id,
const TQString& text,
int index);
556 void insertComboList (
int id,
const TQStringList &list,
int index);
561 void removeComboItem (
int id,
int index);
566 void setCurrentComboItem (
int id,
int index);
573 void changeComboItem (
int id,
const TQString& text,
int index=-1);
580 void clearCombo (
int id);
589 TQString getComboItem (
int id,
int index=-1)
const;
638 void alignItemRight (
int id,
bool right =
true);
651 TQWidget *getWidget (
int id);
666 void setItemAutoSized (
int id,
bool yes =
true);
680 void removeItem (
int id);
687 void removeItemDelayed (
int id);
692 void hideItem (
int id);
697 void showItem (
int id);
704 int itemIndex (
int id);
724 void setFullSize(
bool flag =
true);
730 bool fullSize()
const;
736 void enableMoving(
bool flag =
true) TDE_DEPRECATED;
742 void setBarPos (BarPosition bpos);
748 BarPosition barPos() const;
758 bool enable(BarStatus stat) TDE_DEPRECATED;
764 void setMaxHeight (
int h) TDE_DEPRECATED;
772 int maxHeight() TDE_DEPRECATED;
779 void setMaxWidth (
int dw) TDE_DEPRECATED;
787 int maxWidth() TDE_DEPRECATED;
795 void setTitle (const TQString& _title);
801 void enableFloating (
bool flag) TDE_DEPRECATED;
814 void setIconText(IconText it);
823 void setIconText(IconText it,
bool update);
829 IconText iconText() const;
841 void setIconSize(
int size);
852 void setIconSize(
int size,
bool update);
858 int iconSize() const;
864 int iconSizeDefault() const;
871 void setEnableContextMenu(
bool enable = true);
877 bool contextMenuEnabled() const;
887 void setItemNoStyle(
int id,
bool no_style = true);
889 void setFlat (
bool flag);
908 void saveSettings(
TDEConfig *config, const TQString &configGroup);
914 void applySettings(
TDEConfig *config, const TQString &configGroup,
bool force);
916 void applySettings(
TDEConfig *config, const TQString &configGroup);
937 void setText( const TQString & txt );
943 TQString text() const;
945 void setStretchableWidget( TQWidget *w );
946 TQSizePolicy sizePolicy() const;
947 bool highlight() const;
948 TQSize sizeHint() const;
949 TQSize minimumSizeHint() const;
950 TQSize minimumSize() const;
955 void updateRects(
bool = false ) {}
960 void loadState(
const TQDomElement &e );
964 void saveState( TQDomElement &e );
969 void positionYourself(
bool force =
false);
1069 static bool highlightSetting();
1075 static bool transparentSetting();
1081 static IconText iconTextSetting();
1084 virtual void setIconText(
const TQString &txt )
1085 { TQToolBar::setIconText( txt ); }
1088 void mousePressEvent( TQMouseEvent * );
1089 void childEvent( TQChildEvent *e );
1090 void showEvent( TQShowEvent *e );
1091 void resizeEvent( TQResizeEvent *e );
1092 bool event( TQEvent *e );
1093 void applyAppearanceSettings(
TDEConfig *config,
const TQString &_configGroup,
bool forceGlobal =
false);
1094 TQString settingsGroup()
const;
1097 void rebuildLayout();
1098 void slotReadConfig ();
1099 void slotAppearanceChanged();
1100 void slotIconChanged(
int);
1102 void toolBarPosChanged( TQToolBar *tb );
1103 void slotContextAboutToShow();
1104 void slotContextAboutToHide();
1105 void widgetDestroyed();
1108 void init(
bool readConfig =
true,
bool honorStyle =
false );
1110 void insertWidgetInternal( TQWidget *w,
int &index,
int id );
1111 void removeWidgetInternal( TQWidget *w );
1112 void getAttributes( TQString &position, TQString &icontext,
int &index );
1113 int dockWindowIndex();
1115 void doModeChange();
1117 TQMap<TQWidget*, int > widget2id;
1118 typedef TQMap<int, TQWidget* > Id2WidgetMap;
1119 Id2WidgetMap id2widget;
1121 TQPtrList<TQWidget> widgets;
1122 TQTimer *layoutTimer;
1123 TQGuardedPtr<TQWidget> stretchableWidget, rightAligned;
1125 virtual void virtual_hook(
int id,
void* data );
1127 TDEToolBarPrivate *d;
An enhanced TQLineEdit widget for inputting text.
A KXMLGUIClient can be used with KXMLGUIFactory to create a GUI from actions and an XML document,...
static TDEInstance * instance()