~ubuntu-branches/ubuntu/edgy/gwenview/edgy

« back to all changes in this revision

Viewing changes to src/gvdirpart/gvdirpart.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2005-12-06 17:59:19 UTC
  • mfrom: (1.1.3 upstream) (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20051206175919-8yv9nfmw0pws6p52
Tags: 1.3.1-0ubuntu1
* Sync with Debian
* Edit kde.mk for .pot generation

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
Copyright 2004 Jonathan Riddell <jr@jriddell.org>
 
3
 
 
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.
 
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
 
12
GNU General Public License for more details.
 
13
 
 
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.
 
17
 
 
18
*/
 
19
#ifndef __gvdirpart_h__
 
20
#define __gvdirpart_h__
 
21
 
 
22
#include <kparts/part.h>
 
23
#include <kparts/browserextension.h>
 
24
 
 
25
// Forward declarations
 
26
class QSplitter;
 
27
class KAboutData;
 
28
class KAction;
 
29
class KToggleAction;
 
30
 
 
31
namespace Gwenview {
 
32
 
 
33
class ImageView;
 
34
class FileViewStack;
 
35
class Document;
 
36
class SlideShow;
 
37
 
 
38
class GVDirPart;
 
39
 
 
40
/**
 
41
 * The browser extension is an attribute of GVImagePart and provides
 
42
 * some services to Konqueror.  All Konqueror KParts have one.
 
43
 */
 
44
class GVDirPartBrowserExtension: public KParts::BrowserExtension {
 
45
        Q_OBJECT
 
46
 
 
47
public:
 
48
        GVDirPartBrowserExtension(GVDirPart* viewPart, const char* name=0L);
 
49
        ~GVDirPartBrowserExtension();
 
50
 
 
51
public slots:
 
52
        void contextMenu();
 
53
 
 
54
        void updateActions();
 
55
        void refresh();
 
56
 
 
57
        void copy();
 
58
        void cut();
 
59
        void trash();
 
60
        void del();
 
61
        void editMimeType();
 
62
 
 
63
        void print();
 
64
private:
 
65
        GVDirPart* mGVDirPart;
 
66
};
 
67
 
 
68
/**
 
69
 * A Read Only KPart to browse directories and their images using Gwenview
 
70
 */
 
71
class GVDirPart : public KParts::ReadOnlyPart {
 
72
        Q_OBJECT
 
73
public:
 
74
        GVDirPart(QWidget*, const char*, QObject*, const char*, const QStringList &);
 
75
        virtual ~GVDirPart();
 
76
 
 
77
        /**
 
78
         * Return information about the part
 
79
         */
 
80
        static KAboutData* createAboutData();
 
81
 
 
82
        /**
 
83
         * Returns the name of the current file in the pixmap
 
84
         */
 
85
        KURL pixmapURL();
 
86
 
 
87
        /**
 
88
         * Print the image being viewed if there is one
 
89
         */
 
90
        void print();
 
91
protected:
 
92
        void partActivateEvent(KParts::PartActivateEvent* event);
 
93
 
 
94
        /**
 
95
         * Unused because openURL() is implemented but required to be
 
96
         * implemented.
 
97
         */
 
98
        virtual bool openFile();
 
99
        
 
100
        /**
 
101
         * Tell the widgets the URL to browse.  Sets the window
 
102
         * caption and saves URL to m_url (important for history and
 
103
         * others).
 
104
         */
 
105
        virtual bool openURL(const KURL& url);
 
106
 
 
107
protected slots:
 
108
        /**
 
109
         * Turns the slide show on or off
 
110
         */
 
111
        void toggleSlideShow();
 
112
 
 
113
        /**
 
114
         * Sets Konqueror's caption, statusbar and emits completed().
 
115
         * Called by loaded() signal in GVDocument
 
116
         */
 
117
        void loaded(const KURL& url);
 
118
 
 
119
        /**
 
120
         * Rotates the current image 90 degrees clockwise
 
121
         */
 
122
        void rotateRight();
 
123
 
 
124
        void directoryChanged(const KURL& dirURL);
 
125
 
 
126
        void urlChanged( const KURL& );
 
127
 
 
128
protected:
 
129
        /**
 
130
         * The component's widget, contains the files view on the left
 
131
         * and scroll view on the right.
 
132
         */
 
133
        QSplitter* mSplitter;
 
134
 
 
135
        /**
 
136
         * Scroll widget
 
137
         */
 
138
        ImageView* mImageView;
 
139
 
 
140
        /**
 
141
         * Holds the image
 
142
         */
 
143
        Document* mDocument;
 
144
 
 
145
        /**
 
146
         * Shows the directory's files and folders
 
147
         */
 
148
 
 
149
        FileViewStack* mFilesView;
 
150
 
 
151
        /**
 
152
         * This inherits from KParts::BrowserExtention and supplies
 
153
         * some extra functionality to Konqueror.
 
154
         */
 
155
        GVDirPartBrowserExtension* mBrowserExtension;
 
156
 
 
157
        /**
 
158
         * Action turns on slide show
 
159
         */
 
160
        KToggleAction* mToggleSlideShow;
 
161
        SlideShow* mSlideShow;
 
162
};
 
163
 
 
164
} // namespace
 
165
#endif