remove unuseful cmake stuff
[kdenetwork.git] / krdc / floatingtoolbar.h
blob99dfa7e9fc0080c7bb19c9e18c084950c2864561
1 /****************************************************************************
2 **
3 ** Copyright (C) 2007-2008 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>
6 **
7 ** This file is part of KDE.
8 **
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_H
27 #define FLOATINGTOOLBAR_H
29 #include <QToolBar>
31 /**
32 * @short A toolbar widget 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 actions.
38 class FloatingToolBar : public QToolBar
40 Q_OBJECT
41 public:
42 FloatingToolBar(QWidget *parent, QWidget *anchorWidget);
43 ~FloatingToolBar();
45 Q_ENUMS(Side)
46 enum Side { Left = 0, Top = 1, Right = 2, Bottom = 3 };
48 void addAction(QAction *action);
49 void setSide(Side side);
51 Q_SIGNALS:
52 void orientationChanged(int side);
54 public Q_SLOTS:
55 void setSticky(bool sticky);
56 void showAndAnimate();
57 void hideAndDestroy();
59 protected:
60 bool eventFilter(QObject *o, QEvent *e);
61 void paintEvent(QPaintEvent *);
62 void mousePressEvent(QMouseEvent *e);
63 void mouseMoveEvent(QMouseEvent *e);
64 void enterEvent(QEvent *e);
65 void leaveEvent(QEvent *e);
66 void mouseReleaseEvent(QMouseEvent *e);
67 void wheelEvent(QWheelEvent *e);
69 private:
70 class FloatingToolBarPrivate *d;
72 private Q_SLOTS:
73 void animate();
74 void hide();
77 #endif