~ubuntu-branches/debian/sid/kexi/sid

« back to all changes in this revision

Viewing changes to src/kexiutils/KexiAnimatedLayout.h

  • Committer: Package Import Robot
  • Author(s): Pino Toscano
  • Date: 2017-06-24 20:10:10 UTC
  • Revision ID: package-import@ubuntu.com-20170624201010-5lrzd5r2vwthwifp
Tags: upstream-3.0.1.1
Import upstream version 3.0.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of the KDE project
 
2
   Copyright (C) 2011 Jarosław Staniek <staniek@kde.org>
 
3
 
 
4
   This program is free software; you can redistribute it and/or
 
5
   modify it under the terms of the GNU Library General Public
 
6
   License as published by the Free Software Foundation; either
 
7
   version 2 of the License, or (at your option) any later version.
 
8
 
 
9
   This program is distributed in the hope that it will be useful,
 
10
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
   Library General Public License for more details.
 
13
 
 
14
   You should have received a copy of the GNU Library General Public License
 
15
   along with this program; see the file COPYING.  If not, write to
 
16
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
17
 * Boston, MA 02110-1301, USA.
 
18
 */
 
19
 
 
20
#ifndef KEXIANIMATEDLAYOUT_H
 
21
#define KEXIANIMATEDLAYOUT_H
 
22
 
 
23
#include <QStackedLayout>
 
24
 
 
25
#include "kexiutils_export.h"
 
26
 
 
27
//! A tool for animated switching between widgets in a given stacked layout.
 
28
/*! Animation is performed if the graphic effects level is set at least
 
29
 at "simple" level, i.e. when
 
30
 (KexiUtils::graphicEffectsLevel() & KexiUtils::SimpleAnimationEffects) is true. */
 
31
class KEXIUTILS_EXPORT KexiAnimatedLayout : public QStackedLayout
 
32
{
 
33
    Q_OBJECT
 
34
public:
 
35
    explicit KexiAnimatedLayout(QWidget* parent = 0);
 
36
 
 
37
    ~KexiAnimatedLayout();
 
38
 
 
39
public Q_SLOTS:
 
40
    //! Sets the current widget to be the specified widget.
 
41
    /*! Animation is performed while switching the widgets
 
42
        (assuming animations are enabled (see the explanation
 
43
        for @ref KexiAnimatedStackedLayout).
 
44
        The new current widget must already be contained in this stacked layout.
 
45
        Because of the animation, changing current widget is asynchronous, i.e.
 
46
        after this methods returns, current widget is not changed.
 
47
        Connect to signal QStackedLayout::currentChanged(int index) to be notified
 
48
        about actual change of the current widget when animation finishes.
 
49
        @note this method is not virtual, so when calling it, make sure
 
50
              the pointer is KexiAnimatedStackedLayout, not parent class QStackedLayout.
 
51
        @see setCurrentIndex() currentWidget() */
 
52
    void setCurrentWidget(QWidget* widget);
 
53
 
 
54
    //! Sets the current widget to be the specified index.
 
55
    /*! Animation is performed as for setCurrentWidget(). */
 
56
    void setCurrentIndex(int index);
 
57
 
 
58
private:
 
59
    class Private;
 
60
    Private* const d;
 
61
};
 
62
 
 
63
#endif