libqutim  0.3.1.0
actiontoolbar.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** qutIM - instant messenger
4 **
5 ** Copyright © 2011 Ruslan Nigmatullin <euroelessar@yandex.ru>
6 ** Copyright © 2011 Aleksey Sidorov <gorthauer87@yandex.ru>
7 **
8 *****************************************************************************
9 **
10 ** $QUTIM_BEGIN_LICENSE$
11 ** This program is free software: you can redistribute it and/or modify
12 ** it under the terms of the GNU General Public License as published by
13 ** the Free Software Foundation, either version 3 of the License, or
14 ** (at your option) any later version.
15 **
16 ** This program is distributed in the hope that it will be useful,
17 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 ** See the GNU General Public License for more details.
20 **
21 ** You should have received a copy of the GNU General Public License
22 ** along with this program. If not, see http://www.gnu.org/licenses/.
23 ** $QUTIM_END_LICENSE$
24 **
25 ****************************************************************************/
26 
27 #ifndef ACTIONTOOLBAR_H
28 #define ACTIONTOOLBAR_H
29 
30 #include "actiongenerator.h"
31 #include <QToolBar>
32 #include <QMetaType>
33 
34 namespace qutim_sdk_0_3
35 {
36 class ActionToolBarPrivate;
37 
38 class LIBQUTIM_EXPORT ActionToolBar : public QToolBar
39 {
40  Q_OBJECT
41  Q_DECLARE_PRIVATE(ActionToolBar)
42 public:
43  explicit ActionToolBar(const QString &title, QWidget *parent = 0);
44  explicit ActionToolBar(QWidget *parent = 0);
45  virtual ~ActionToolBar();
46 
47  using QToolBar::addAction;
48  QAction *addAction(ActionGenerator *generator);
49  using QToolBar::insertAction;
50  QAction *insertAction(QAction *before, ActionGenerator *generator);
51  using QToolBar::removeAction;
52  void removeAction(const ActionGenerator *generator);
53 
54  // This is done for Stacked toolbars like one in tabbed
55  // chat window. This method calls setData(data) to every action,
56  // created by addAction(ActionGenerator *generator) method
57  void setData(const QVariant &var);
58  QVariant data() const;
59 
60  void setMoveHookEnabled(bool enabled = true);
61  // Toolbar id for appearance settings, by default id is "common"
62  // void setId(const QString& id);
63  using QToolBar::setIconSize;
64  void setIconSize(const QSize & iconSize);
65  using QToolBar::setToolButtonStyle;
66  void setToolButtonStyle(Qt::ToolButtonStyle toolButtonStyle);
67  void clear();
68 protected:
69  void changeEvent(QEvent *e);
70  void mouseMoveEvent(QMouseEvent* event);
71  void mousePressEvent(QMouseEvent* event);
72  void contextMenuEvent(QContextMenuEvent* event);
73  void showEvent(QShowEvent *event);
74  void hideEvent(QHideEvent *);
75 private:
76  QScopedPointer<ActionToolBarPrivate> d_ptr;
77  Q_PRIVATE_SLOT(d_func(), void _q_size_action_triggered(QAction*))
78  Q_PRIVATE_SLOT(d_func(), void _q_style_action_triggered(QAction*))
79 };
80 }
81 
82 #endif // ACTIONTOOLBAR_H
83 

Generated by Doxygen