libkipi from trunk (KDE 4.3) : add support of kipi host settings "file timestamp...
[kdegraphics.git] / gwenview / lib / slidecontainer.h
blobd1aea1905eed3d49f6b5791210da26a3abde6f65
1 /*
2 Gwenview: an image viewer
3 Copyright 2007 Aurélien Gâteau <aurelien.gateau@free.fr>
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef SLIDECONTAINER_H
21 #define SLIDECONTAINER_H
23 // Qt
24 #include <QFrame>
25 #include <QTimeLine>
27 #include <lib/gwenviewlib_export.h>
29 namespace Gwenview {
32 /**
33 * This widget is design to contain one child widget, the "content" widget.
34 * It will start hidden by default. Calling slideIn() will slide in the content
35 * widget from the top border. Calling slideOut() will slide it out.
37 class GWENVIEWLIB_EXPORT SlideContainer : public QFrame {
38 Q_OBJECT
39 public:
40 SlideContainer(QWidget* parent = 0);
42 /**
43 * Returns the content widget
45 QWidget* content() const;
47 /**
48 * Defines the content widget
50 void setContent(QWidget* content);
53 public Q_SLOTS:
54 /**
55 * Slides the content widget in.
56 * Calling it multiple times won't cause the animation to be replayed.
58 void slideIn();
60 /**
61 * Slides the content widget out.
62 * Calling it multiple times won't cause the animation to be replayed.
64 void slideOut();
66 protected:
67 QSize sizeHint() const;
68 QSize minimumSizeHint() const;
69 void resizeEvent(QResizeEvent*);
71 private Q_SLOTS:
72 void slotTimeLineChanged(qreal value);
73 void slotTimeLineFinished();
75 private:
76 QWidget* mContent;
77 QTimeLine* mTimeLine;
81 } /* namespace */
84 #endif /* SLIDECONTAINER_H */