~ubuntu-branches/ubuntu/precise/gwenview/precise-proposed

« back to all changes in this revision

Viewing changes to app/viewmainpage.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2011-12-15 14:17:54 UTC
  • mto: This revision was merged to the branch mainline in revision 12.
  • Revision ID: package-import@ubuntu.com-20111215141754-z043hyx69dulbggf
Tags: upstream-4.7.90
Import upstream version 4.7.90

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 VIEWMAINPAGE_H
 
21
#define VIEWMAINPAGE_H
 
22
 
 
23
// Local
 
24
#include <lib/document/document.h>
 
25
 
 
26
// KDE
 
27
#include <kurl.h>
 
28
 
 
29
// Qt
 
30
#include <QToolButton>
 
31
#include <QWidget>
 
32
 
 
33
class QPalette;
 
34
 
 
35
class KActionCollection;
 
36
 
 
37
namespace Gwenview
 
38
{
 
39
 
 
40
class DocumentView;
 
41
class RasterImageView;
 
42
class SlideShow;
 
43
class ThumbnailBarView;
 
44
 
 
45
struct ViewMainPagePrivate;
 
46
 
 
47
/**
 
48
 * Holds the active document view and associated widgetry.
 
49
 */
 
50
class ViewMainPage : public QWidget
 
51
{
 
52
    Q_OBJECT
 
53
public:
 
54
    static const int MaxViewCount;
 
55
 
 
56
    ViewMainPage(QWidget* parent, SlideShow*, KActionCollection*);
 
57
    ~ViewMainPage();
 
58
 
 
59
    ThumbnailBarView* thumbnailBar() const;
 
60
 
 
61
    void loadConfig();
 
62
 
 
63
    void saveConfig();
 
64
 
 
65
    /**
 
66
     * Reset the view
 
67
     */
 
68
    void reset();
 
69
 
 
70
    void setFullScreenMode(bool fullScreen);
 
71
 
 
72
    bool isFullScreenMode() const;
 
73
 
 
74
    void setNormalPalette(const QPalette&);
 
75
 
 
76
    int statusBarHeight() const;
 
77
 
 
78
    virtual QSize sizeHint() const;
 
79
 
 
80
    /**
 
81
     * Returns the url of the current document, or an invalid url if unknown
 
82
     */
 
83
    KUrl url() const;
 
84
 
 
85
    void openUrl(const KUrl& url);
 
86
 
 
87
    /**
 
88
     * Opens up to MaxViewCount urls, and set currentUrl as the current one
 
89
     */
 
90
    void openUrls(const KUrl::List& urls, const KUrl& currentUrl);
 
91
 
 
92
    void reload();
 
93
 
 
94
    Document::Ptr currentDocument() const;
 
95
 
 
96
    bool isEmpty() const;
 
97
 
 
98
    /**
 
99
     * Returns the image view, if the current adapter has one.
 
100
     */
 
101
    RasterImageView* imageView() const;
 
102
 
 
103
    /**
 
104
     * Returns the document view
 
105
     */
 
106
    DocumentView* documentView() const;
 
107
 
 
108
    /**
 
109
     * Sets a widget to show at the bottom of the panel
 
110
     */
 
111
    void setToolWidget(QWidget* widget);
 
112
 
 
113
    QToolButton* toggleSideBarButton() const;
 
114
 
 
115
Q_SIGNALS:
 
116
 
 
117
    /**
 
118
     * Emitted when the part has finished loading
 
119
     */
 
120
    void completed();
 
121
 
 
122
    void previousImageRequested();
 
123
 
 
124
    void nextImageRequested();
 
125
 
 
126
    void toggleFullScreenRequested();
 
127
 
 
128
    void captionUpdateRequested(const QString&);
 
129
 
 
130
private Q_SLOTS:
 
131
    void setThumbnailBarVisibility(bool visible);
 
132
 
 
133
    void showContextMenu();
 
134
 
 
135
    void slotViewFocused(DocumentView*);
 
136
 
 
137
    void trashView(DocumentView*);
 
138
    void deselectView(DocumentView*);
 
139
 
 
140
private:
 
141
    friend struct ViewMainPagePrivate;
 
142
    ViewMainPagePrivate* const d;
 
143
};
 
144
 
 
145
} // namespace
 
146
 
 
147
#endif /* VIEWMAINPAGE_H */