2
Copyright 2004 Jonathan Riddell <jr@jriddell.org>
4
This program is free software; you can redistribute it and/or
5
modify it under the terms of the GNU General Public License
6
as published by the Free Software Foundation; either version 2
7
of the License, or (at your option) any later version.
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
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with this program; if not, write to the Free Software
16
Foundation, Inc., 51 Franklin Steet, Fifth Floor, Boston, MA 02111-1307, USA.
19
#ifndef __gvimagepart_h__
20
#define __gvimagepart_h__
22
#include <kparts/part.h>
23
#include <kparts/browserextension.h>
25
// Forward declarations
39
* The browser extension is an attribute of GVImagePart and provides
40
* some services to Konqueror. All Konqueror KParts have one.
42
class GVImagePartBrowserExtension: public KParts::BrowserExtension {
46
GVImagePartBrowserExtension(GVImagePart* viewPart, const char* name=0L);
47
~GVImagePartBrowserExtension();
54
GVImagePart* mGVImagePart;
58
* A Read Only KPart to view images using Gwenview
60
class GVImagePart : public KParts::ReadOnlyPart {
63
GVImagePart(QWidget*, const char*, QObject*, const char*, const QStringList &);
64
virtual ~GVImagePart();
67
* Return information about the part
69
static KAboutData* createAboutData();
77
* Print the image being viewed
82
virtual bool openURL(const KURL& url);
85
virtual bool openFile() { return false; }
87
* Sets Konqueror's caption, statusbar and emits completed().
88
* Called by loaded() signal in Document
90
void loaded(const KURL& url);
93
* Rotates the current image 90 degrees clockwise
98
void partActivateEvent(KParts::PartActivateEvent* event);
102
void dirListerClear();
104
void dirListerNewItems( const KFileItemList& );
106
void dirListerDeleteItem(KFileItem*);
108
void slotSelectNext();
109
void slotSelectPrevious();
115
void updateNextPrevious();
116
KURL nextURL() const;
117
KURL previousURL() const;
120
* The component's widget
122
ImageView* mImageView;
130
* This inherits from KParts::BrowserExtention and supplies
131
* some extra functionality to Konqueror.
133
GVImagePartBrowserExtension* mBrowserExtension;
135
// for the next/previous actions
136
KDirLister* mDirLister;
139
KAction* mPreviousImage;
140
// alphabetically sorted filenames of images in the picture's directory
141
QStringList mImagesInDirectory;
143
ImageLoader* mPrefetch;
144
enum LastDirection { DirectionUnknown, DirectionNext, DirectionPrevious };
145
LastDirection mLastDirection; // used for prefetching