• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdevelop API Reference
  • KDE Home
  • Contact Us
 

kdevplatform/sublime

  • sources
  • kfour-appscomplete
  • kdevelop
  • kdevplatform
  • sublime
document.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright 2006-2007 Alexander Dymo <[email protected]> *
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 KDEVPLATFORM_SUBLIMEDOCUMENT_H
20 #define KDEVPLATFORM_SUBLIMEDOCUMENT_H
21 
22 #include <QObject>
23 #include <QList>
24 
25 
26 #include "sublimeexport.h"
27 
28 class QIcon;
29 
30 class QWidget;
31 
32 namespace Sublime {
33 
34 class Area;
35 class View;
36 class Controller;
37 class DocumentPrivate;
38 
45 class KDEVPLATFORMSUBLIME_EXPORT Document: public QObject {
46  Q_OBJECT
47 public:
49  Document(const QString &title, Controller *controller);
50  ~Document() override;
51 
54  View *createView();
56  const QList<View*> &views() const;
57 
59  Controller *controller() const;
60 
61  enum TitleType { Normal, Extended};
63  virtual QString title(TitleType type = Normal) const;
65  void setTitle(const QString& newTitle);
66  void setToolTip(const QString& newToolTip);
67  QString toolTip() const;
69  virtual QString documentType() const = 0;
70 
72  virtual QString documentSpecifier() const = 0;
73 
86  virtual bool askForCloseFeedback();
87 
96  virtual bool closeDocument(bool silent = false);
97 
98  void setStatusIcon(const QIcon& icon);
99 
103  QIcon statusIcon() const;
104 
110  QIcon icon() const;
111 
116  virtual QIcon defaultIcon() const;
117 
118 Q_SIGNALS:
120  void aboutToDelete(Sublime::Document *doc);
122  void titleChanged(Sublime::Document *doc);
124  void statusIconChanged(Sublime::Document *doc);
125 
126 protected:
129  virtual View *newView(Document *doc);
133  virtual QWidget *createViewWidget(QWidget *parent = nullptr) = 0;
135  virtual void closeViews();
136 
137 private:
138  const QScopedPointer<class DocumentPrivate> d_ptr;
139  Q_DECLARE_PRIVATE(Document)
140 
141  friend class DocumentPrivate;
142  friend class View;
143 };
144 
145 }
146 
147 #endif
148 
Sublime::View
View - the wrapper to the widget that knows about its document.
Definition: view.h:48
QWidget
QList
Sublime
Definition: aggregatemodel.cpp:25
Sublime::Document
Abstract base class for all Sublime documents.
Definition: document.h:44
QObject
QString
QIcon
QScopedPointer< class DocumentPrivate >
Sublime::Document::TitleType
TitleType
Definition: document.h:60
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Jan 23 2021 09:41:41 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kdevplatform/sublime

Skip menu "kdevplatform/sublime"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdevelop API Reference

Skip menu "kdevelop API Reference"
  • kdevplatform
  •   debugger
  •   documentation
  •   interfaces
  •   language
  •     assistant
  •     backgroundparser
  •     checks
  •     classmodel
  •     codecompletion
  •     codegen
  •     duchain
  •     editor
  •     highlighting
  •     interfaces
  •     util
  •   outputview
  •   project
  •   serialization
  •   shell
  •   sublime
  •   tests
  •   util
  •   vcs

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal