summaryrefslogtreecommitdiffstats
path: root/src/multibuffer.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit114a878c64ce6f8223cfd22d76a20eb16d177e5e (patch)
treeacaf47eb0fa12142d3896416a69e74cbf5a72242 /src/multibuffer.h
downloadtdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.tar.gz
tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/multibuffer.h')
-rw-r--r--src/multibuffer.h89
1 files changed, 89 insertions, 0 deletions
diff --git a/src/multibuffer.h b/src/multibuffer.h
new file mode 100644
index 00000000..3d04f256
--- /dev/null
+++ b/src/multibuffer.h
@@ -0,0 +1,89 @@
+/*
+ * KDevelop Multiple Buffer Support
+ *
+ * Copyright (c) 2005 Adam Treat <treat@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+#ifndef MULTIBUFFER_H
+#define MULTIBUFFER_H
+
+#include <qpair.h>
+#include <qsplitter.h>
+#include <qguardedptr.h>
+
+namespace KParts
+{
+class Part;
+class Factory;
+class ReadOnlyPart;
+}
+
+class KURL;
+
+typedef QMap< KURL, KParts::Part* > BufferMap;
+typedef QMap< KParts::Part*, QPair<int, int> > ActivationMap;
+
+class MultiBuffer : public QSplitter
+{
+ Q_OBJECT
+public:
+ MultiBuffer( QWidget * parent = 0 );
+ virtual ~MultiBuffer();
+
+ KParts::Part *activeBuffer() const;
+ bool hasURL( const KURL &url ) const;
+ bool hasPart( KParts::Part *part );
+ int numberOfBuffers() const;
+ bool isActivated() const;
+ void setDelayedActivation( bool delayed );
+
+ KParts::Part* createPart( const QString &mimeType,
+ const QString &partType,
+ const QString &className,
+ const QString &preferredName = QString::null );
+
+ KParts::Part* openURL( const KURL &url );
+ bool closeURL( const KURL &url );
+
+ void registerURL( const KURL &url, KParts::Part *part );
+ void registerDelayedActivation( KParts::Part *part, int line, int col );
+
+ void updateUrlForPart( KParts::Part *part, KURL url );
+
+public slots:
+ virtual void show();
+ virtual void setOrientation( Qt::Orientation );
+ void activePartChanged( const KURL &url );
+
+protected:
+ virtual void focusInEvent( QFocusEvent *ev );
+
+private:
+ KParts::Part* createPart( const KURL &url );
+
+private:
+ BufferMap m_buffers;
+ QGuardedPtr<KParts::Factory> m_editorFactory;
+ ActivationMap m_delayedActivation;
+ bool m_delayActivate;
+ bool m_activated;
+ QGuardedPtr<KParts::Part> m_activeBuffer;
+};
+
+#endif
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on