1 /****************************************************************************
3 ** Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org>
4 ** Parts of this file have been take from okular:
5 ** Copyright (C) 2004-2005 Enrico Ros <eros.kde@email.it>
7 ** This file is part of KDE.
9 ** This program is free software; you can redistribute it and/or modify
10 ** it under the terms of the GNU General Public License as published by
11 ** the Free Software Foundation; either version 2 of the License, or
12 ** (at your option) any later version.
14 ** This program is distributed in the hope that it will be useful,
15 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ** GNU General Public License for more details.
19 ** You should have received a copy of the GNU General Public License
20 ** along with this program; see the file COPYING. If not, write to
21 ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 ** Boston, MA 02110-1301, USA.
24 ****************************************************************************/
26 #ifndef FLOATINGTOOLBAR
27 #define FLOATINGTOOLBAR
32 * @short A widget containing buttons, that slides in from a side.
34 * This is a shaped widget that slides in from a side of the 'anchor widget'
35 * it's attached to. It can be dragged and docked on {left,top,right,bottom}
36 * sides and contains buttons.
38 class FloatingToolBar
: public QWidget
42 FloatingToolBar(QWidget
*parent
, QWidget
*anchorWidget
);
46 enum Side
{ Left
= 0, Top
= 1, Right
= 2, Bottom
= 3 };
48 void addAction(QAction
*action
);
49 void setSide(Side side
);
51 void showAndAnimate();
52 void hideAndDestroy();
55 void orientationChanged(int side
);
58 void setSticky(bool sticky
);
61 bool eventFilter(QObject
*o
, QEvent
*e
);
62 void paintEvent(QPaintEvent
*);
63 void mousePressEvent(QMouseEvent
*e
);
64 void mouseMoveEvent(QMouseEvent
*e
);
65 void mouseReleaseEvent(QMouseEvent
*e
);
66 void wheelEvent(QWheelEvent
*e
);
69 class FloatingToolBarPrivate
*d
;