summaryrefslogtreecommitdiffabout
path: root/microkde/kdeui/ktoolbar.h
authorzautrix <zautrix>2004-12-05 12:12:10 (UTC)
committer zautrix <zautrix>2004-12-05 12:12:10 (UTC)
commit5ab47964d8b52897bb0662ef4a5fcf9604acaf6c (patch) (side-by-side diff)
tree0f80433206ddd6b4ef901cb346d0f06caf76b20f /microkde/kdeui/ktoolbar.h
parent196365e533c6fd1a8f47aa9579763ef5afcebcda (diff)
downloadkdepimpi-5ab47964d8b52897bb0662ef4a5fcf9604acaf6c.zip
kdepimpi-5ab47964d8b52897bb0662ef4a5fcf9604acaf6c.tar.gz
kdepimpi-5ab47964d8b52897bb0662ef4a5fcf9604acaf6c.tar.bz2
fixed kapi toolbar repaint problem
Diffstat (limited to 'microkde/kdeui/ktoolbar.h') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdeui/ktoolbar.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/microkde/kdeui/ktoolbar.h b/microkde/kdeui/ktoolbar.h
index 2c061b5..61b5ea3 100644
--- a/microkde/kdeui/ktoolbar.h
+++ b/microkde/kdeui/ktoolbar.h
@@ -664,444 +664,445 @@ public:
* This works only if the toolbar is set to full width.
* Only @p one item can be autosized, and it has to be
* the last left-aligned item. Items that come after this must be right
* aligned. Items that can be right aligned are Lineds, Frames, Widgets and
* Combos. An autosized item will resize itself whenever the toolbar geometry
* changes to the last right-aligned item (or to end of toolbar if there
* are no right-aligned items.)
* @see setFullWidth()
* @see alignItemRight()
*/
void setItemAutoSized (int id, bool yes = true);
/**
* Remove all items.
*
* The toolbar is redrawn after it.
*/
void clear ();
/**
* Remove item @p id.
*
* Item is deleted. Toolbar is redrawn after it.
*/
void removeItem (int id);
/**
* Remove item @p id.
*
* Item is deleted when toolbar is redrawn.
*/
void removeItemDelayed (int id);
/**
* Hide item.
*/
void hideItem (int id);
/**
* Show item.
*/
void showItem (int id);
/**
* Returns the index of the given item.
*
* KDE4: make this const!
*/
int itemIndex (int id);
/**
* Set toolbar to full parent size (default).
*
* In full size mode the bar
* extends over the parent's full width or height. If the mode is disabled
* the toolbar tries to take as much space as it needs without wrapping, but
* it does not exceed the parent box. You can force a certain width or
* height with @ref setMaxWidth() or @ref setMaxHeight().
*
* If you want to use right-aligned items or auto-sized items you must use
* full size mode.
*/
void setFullSize(bool flag = true);
/**
* @return @p true if the full-size mode is enabled. Otherwise
* it returns @false.
*/
bool fullSize() const;
/**
* @deprecated use setMovingEnabled(bool) instead.
* Enable or disable moving of toolbar.
*/
void enableMoving(bool flag = true);
/**
* Set position of toolbar.
* @see BarPosition()
*/
void setBarPos (BarPosition bpos);
/**
* Returns position of toolbar.
*/
BarPosition barPos();
/**
* @deprecated
* Show, hide, or toggle toolbar.
*
* This method is provided for compatibility only,
* please use show() and/or hide() instead.
* @see BarStatus
*/
bool enable(BarStatus stat);
/**
* @deprecated
* Use setMaximumHeight() instead.
*/
void setMaxHeight (int h); // Set max height for vertical toolbars
/**
* @deprecated
* Use maximumHeight() instead.
* Returns the value that was set with @ref setMaxHeight().
*/
int maxHeight();
/**
* @deprecated
* Use setMaximumWidth() instead.
* Set maximal width of horizontal (top or bottom) toolbar.
*/
void setMaxWidth (int dw);
/**
* @deprecated
* Use maximumWidth() instead.
* Returns the value that was set with @ref setMaxWidth().
*/
int maxWidth();
/**
* Set title for toolbar when it floats.
*
* Titles are however not (yet)
* visible. You can't change toolbar's title while it's floating.
*/
void setTitle (const QString& _title);
/**
* @deprecated
* Use enableMoving() instead.
*/
void enableFloating (bool arrrrrrgh);
/**
* Set the kind of painting for buttons.
*
* Choose from:
* @li IconOnly (only icons),
* @li IconTextRight (icon and text, text is left from icons),
* @li TextOnly (only text),
* @li IconTextBottom (icons and text, text is under icons).
* @see IconText
*
*/
void setIconText(IconText it);
// Note: don't merge with the next one, it breaks Qt properties
/**
* Similar to @ref setIconText(IconText it) but allows you to
* disable or enable updating. If @p update is false, then the
* buttons will not be updated. This is useful only if you know
* that you will be forcing an update later.
*/
void setIconText(IconText it, bool update);
/**
* @return The current text style for buttons.
*/
IconText iconText() const;
/**
* Set the icon size to load. Usually you should not call
* this, the icon size is taken care of by KIconLoader
* and globally configured.
* By default, the toolbar will load icons of size 32 for main
* toolbars and 22 for other toolbars
* @see KIconLoader.
*
* @param size The size to use
*/
void setIconSize(int size);
// Note: don't merge with the next one, it breaks Qt properties
/**
* Same as @ref setIconText(int size) but allows you
* to disable the toolbar update.
*
* @param size The size to use
* @param update If true, then the toolbar will be updated after
* this
*/
void setIconSize(int size, bool update);
/**
* @return The current icon size for buttons.
*/
int iconSize() const;
/**
* This allows you to enable or disable the context menu.
*
* @param enable If false, then the context menu will be disabled
*/
void setEnableContextMenu(bool enable = true);
/**
* Returns whether or not the context menu is disabled
*
* @return The context menu state
*/
bool contextMenuEnabled() const;
/**
* This will inform a toolbar button to ignore certain style
* changes. Specifically, it will ignore IconText (always IconOnly)
* and will not allow image effects to apply.
*
* @param id The button to exclude from styles
* @param no_style If true, then it is excluded (default: true).
*/
void setItemNoStyle(int id, bool no_style = true);
void setFlat (bool flag);
/**
* @return the number of items in the toolbar
*/
int count() const;
/**
* Instruct the toolbar to save it's current state to either the app
* config file or to the XML-GUI resource file (whichever has
* precedence).
*/
void saveState();
/**
* Save the toolbar settings to group @p configGroup in @p config.
*/
void saveSettings(KConfig *config, const QString &configGroup);
/**
* Read the toolbar settings from group @p configGroup in @p config
* and apply them.
*/
void applySettings(KConfig *config, const QString &configGroup);
/**
* Tell the toolbar what XML-GUI resource file it should use to save
* it's state. The state of the toolbar (position, size, etc) is
* saved in KConfig files if the application does not use XML-GUI..
* but if the app does, then it's saved the XML file. This function
* allows this to happen.
*
* @param xmlfile The XML-GUI resource file to write to
* @param xml The DOM document for the XML-GUI building
*/
// void setXML(const QString& xmlfile, const QDomDocument& xml);
/* @internal */
void setXMLGUIClient( KXMLGUIClient *client );
/**
* Assign a (translated) text to this toolbar. This is used
* for the tooltip on the handle, and when listing the toolbars.
*/
void setText( const QString & txt );
/**
* @return the toolbar's text.
*/
QString text() const;
void setStretchableWidget( QWidget *w );
QSizePolicy sizePolicy() const;
bool highlight() const;
QSize sizeHint() const;
QSize minimumSizeHint() const;
QSize minimumSize() const;
void hide();
void show();
void updateRects( bool = FALSE ) {}
//US void loadState( const QDomElement &e );
//US void saveState( QDomElement &e );
/**
* @internal
*/
void positionYourself( bool force = false);
signals:
/**
* Emitted when button @p id is clicked.
*/
void clicked(int id);
/**
* Emitted when button @p id is double-clicked.
*
* Note: you will always
* recive two @ref clicked() , @ref pressed() and @ref released() signals.
* There is no way to avoid it - at least no easy way.
* If you need to resolve this all you can do is set up timers
* which wait for @ref QApplication::doubleClickInterval() to expire.
* If in that time you don't get this signal, you may belive that
* button was only clicked and not double-clicked.
* And please note that butons with popup menus do not emit this signal,
* but those with delayed popup do.
*/
void doubleClicked (int id);
/**
* Emitted when button @p id is pressed.
*/
void pressed(int);
/**
* Emits when button @p id is released.
*/
void released(int);
/**
* Emitted when a toggle button changes state.
*
* Emitted also if you change state
* with @ref setButton() or @ref toggleButton()
* If you make a button normal again, with
* setToggle(false), this signal won't
* be emitted.
*/
void toggled(int);
/**
* This signal is emitted when item id gets highlighted/unhighlighted
* (i.e when mouse enters/exits).
*
* Note that this signal is emitted from
* all buttons (normal, disabled and toggle) even when there is no visible
* change in buttons (i.e., buttons do not raise when mouse enters).
* The parameter @p isHighlighted is @p true when mouse enters and @p false when
* mouse exits.
*/
void highlighted(int id, bool isHighlighted);
/**
* This signal is emitted when item id gets highlighted/unhighlighted
* (i.e when mouse enters/exits).
*
* Note that this signal is emitted from
* all buttons (normal, disabled and toggle) even when there is no visible
* change in buttons (i.e., buttons do not raise when mouse enters).
*/
void highlighted(int id );
/**
* Emitted when toolbar changes position, or when
* an item is removed from toolbar.
*
* If you subclass @ref KMainWindow and reimplement
* @ref KMainWindow::resizeEvent() be sure to connect to
* this signal. Note: You can connect this signal to a slot that
* doesn't take parameter.
*/
void moved( BarPosition );
/**
* @internal
* This signal is emitted when toolbar detects changing of
* following parameters:
* highlighting, button-size, button-mode. This signal is
* internal, aimed to buttons.
*/
void modechange ();
/**
* This signal is emitted when the toolbar is getting deleted,
* and before ~KToolbar finishes (so it's still time to remove
* widgets from the toolbar).
* Used by KWidgetAction.
* @since 3.2
*/
void toolbarDestroyed();
public:
/**
* @return global setting for "Highlight buttons under mouse"
*/
+ void repaintMe();
static bool highlightSetting();
/**
* @return global setting for "Toolbars transparent when moving"
*/
static bool transparentSetting();
/**
* @return global setting for "Icon Text"
*/
static IconText iconTextSetting();
public slots:
virtual void setIconText( const QString &txt )
{ QToolBar::setIconText( txt ); }
+ void slotRepaint();
protected:
void mousePressEvent( QMouseEvent * );
void childEvent( QChildEvent *e );
void showEvent( QShowEvent *e );
void resizeEvent( QResizeEvent *e );
bool event( QEvent *e );
void applyAppearanceSettings(KConfig *config, const QString &_configGroup, bool forceGlobal = false);
QString settingsGroup();
private slots:
void rebuildLayout();
void slotReadConfig ();
void slotAppearanceChanged();
void slotIconChanged(int);
- void slotRepaint();
void toolBarPosChanged( QToolBar *tb );
void slotContextAboutToShow();
void widgetDestroyed();
private:
void init( bool readConfig = true, bool honorStyle = false );
void doConnections( KToolBarButton *button );
void insertWidgetInternal( QWidget *w, int &index, int id );
void removeWidgetInternal( QWidget *w );
void getAttributes( QString &position, QString &icontext, int &index );
//US KPopupMenu *contextMenu();
QPopupMenu *contextMenu();
QMap<QWidget*, int > widget2id;
typedef QMap<int, QWidget* > Id2WidgetMap;
Id2WidgetMap id2widget;
//US KPopupMenu *context;
QPopupMenu *context;
QPtrList<QWidget> widgets;
QTimer *layoutTimer;
QGuardedPtr<QWidget> stretchableWidget, rightAligned;
protected:
virtual void virtual_hook( int id, void* data );
private:
KToolBarPrivate *d;
bool inshutdownprocess;
};
#endif