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

« back to all changes in this revision

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