Fix no newlines warnings. Patch by Peter Oberndorfer
[kdevelopdvcssupport.git] / shell / partdocument.h
blob21fc9c8b913a9131f7d0ae28dedecf1ee69585c3
1 /***************************************************************************
2 * Copyright 2007 Alexander Dymo <adymo@kdevelop.org> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU Library General Public License as *
6 * published by the Free Software Foundation; either version 2 of the *
7 * 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 Library General Public *
15 * License along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ***************************************************************************/
19 #ifndef KDEV_PARTDOCUMENT_H
20 #define KDEV_PARTDOCUMENT_H
22 #include <interfaces/idocument.h>
23 #include <sublime/urldocument.h>
25 #include "shellexport.h"
27 namespace KParts {
28 class Part;
31 namespace KDevelop {
33 /**
34 The generic document which represents KParts.
36 This document is used by shell when more specific document classes
37 are incapable of loading the url.
39 This document loads one KPart (read-only or read-write) per view
40 and sets part widget to be a view widget.
42 class KDEVPLATFORMSHELL_EXPORT PartDocument: public Sublime::UrlDocument, public KDevelop::IDocument {
43 Q_OBJECT
44 public:
45 PartDocument(const KUrl &url, ICore* core );
46 virtual ~PartDocument();
48 virtual KUrl url() const;
49 void setUrl(const KUrl& newUrl);
51 virtual QWidget *createViewWidget(QWidget *parent = 0);
52 virtual KParts::Part *partForView(QWidget *view) const;
54 virtual KMimeType::Ptr mimeType() const;
55 virtual KTextEditor::Document* textDocument() const;
56 virtual bool save(DocumentSaveMode mode = Default);
57 virtual void reload();
58 virtual bool close(DocumentSaveMode mode = Default);
59 virtual bool isActive() const;
60 virtual DocumentState state() const;
62 virtual void activate(Sublime::View *activeView, KParts::MainWindow *mainWindow);
64 virtual KTextEditor::Cursor cursorPosition() const;
65 virtual void setCursorPosition(const KTextEditor::Cursor &cursor);
66 virtual void setTextSelection(const KTextEditor::Range &range);
68 private:
69 class PartDocumentPrivate * const d;
74 #endif