~ubuntu-branches/ubuntu/trusty/gwenview/trusty

« back to all changes in this revision

Viewing changes to app/sidebar.h

  • Committer: Bazaar Package Importer
  • Author(s): Rohan Garg
  • Date: 2011-07-20 13:46:34 UTC
  • Revision ID: james.westby@ubuntu.com-20110720134634-92930fdjeed4gdc9
Tags: upstream-4.6.90+repack
Import upstream version 4.6.90+repack

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
Gwenview: an image viewer
 
3
Copyright 2007 Aurélien Gâteau <agateau@kde.org>
 
4
 
 
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.
 
9
 
 
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.
 
14
 
 
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.
 
18
 
 
19
*/
 
20
#ifndef SIDEBAR_H
 
21
#define SIDEBAR_H
 
22
 
 
23
// Qt
 
24
#include <QFrame>
 
25
#include <QTabWidget>
 
26
 
 
27
 
 
28
namespace Gwenview {
 
29
 
 
30
class SideBar;
 
31
 
 
32
class SideBarGroupPrivate;
 
33
class SideBarGroup : public QFrame {
 
34
        Q_OBJECT
 
35
public:
 
36
        SideBarGroup(const QString& title);
 
37
        ~SideBarGroup();
 
38
 
 
39
        void addWidget(QWidget*);
 
40
        void addAction(QAction*);
 
41
        void clear();
 
42
 
 
43
protected:
 
44
        virtual void paintEvent(QPaintEvent*);
 
45
 
 
46
private:
 
47
        SideBarGroupPrivate* const d;
 
48
};
 
49
 
 
50
 
 
51
class SideBarPagePrivate;
 
52
class SideBarPage : public QWidget {
 
53
        Q_OBJECT
 
54
public:
 
55
        SideBarPage(const QString& title);
 
56
        ~SideBarPage();
 
57
        void addWidget(QWidget*);
 
58
        void addStretch();
 
59
 
 
60
        const QString& title() const;
 
61
 
 
62
private:
 
63
        SideBarPagePrivate* const d;
 
64
};
 
65
 
 
66
 
 
67
class SideBarPrivate;
 
68
class SideBar : public QTabWidget {
 
69
        Q_OBJECT
 
70
public:
 
71
        SideBar(QWidget* parent);
 
72
        ~SideBar();
 
73
 
 
74
        void addPage(SideBarPage*);
 
75
 
 
76
        QString currentPage() const;
 
77
        void setCurrentPage(const QString& name);
 
78
 
 
79
        virtual QSize sizeHint() const;
 
80
 
 
81
private:
 
82
        SideBarPrivate* const d;
 
83
};
 
84
 
 
85
} // namespace
 
86
 
 
87
#endif /* SIDEBAR_H */