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

« back to all changes in this revision

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