| 
									
										
										
										
											2012-10-02 09:12:39 +02:00
										 |  |  | /****************************************************************************
 | 
					
						
							| 
									
										
										
										
											2010-12-03 13:49:35 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2014-01-07 13:27:11 +01:00
										 |  |  | ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). | 
					
						
							| 
									
										
										
										
											2012-10-02 09:12:39 +02:00
										 |  |  | ** Contact: http://www.qt-project.org/legal
 | 
					
						
							| 
									
										
										
										
											2010-12-03 13:49:35 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2012-10-02 09:12:39 +02:00
										 |  |  | ** This file is part of Qt Creator. | 
					
						
							| 
									
										
										
										
											2010-12-03 13:49:35 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2012-10-02 09:12:39 +02:00
										 |  |  | ** Commercial License Usage | 
					
						
							|  |  |  | ** Licensees holding valid commercial Qt licenses may use this file in | 
					
						
							|  |  |  | ** accordance with the commercial license agreement provided with the | 
					
						
							|  |  |  | ** Software or, alternatively, in accordance with the terms contained in | 
					
						
							|  |  |  | ** a written agreement between you and Digia.  For licensing terms and | 
					
						
							|  |  |  | ** conditions see http://qt.digia.com/licensing.  For further information
 | 
					
						
							|  |  |  | ** use the contact form at http://qt.digia.com/contact-us.
 | 
					
						
							| 
									
										
										
										
											2010-12-03 13:49:35 +01:00
										 |  |  | ** | 
					
						
							|  |  |  | ** GNU Lesser General Public License Usage | 
					
						
							| 
									
										
										
										
											2012-10-02 09:12:39 +02:00
										 |  |  | ** Alternatively, this file may be used under the terms of the GNU Lesser | 
					
						
							|  |  |  | ** General Public License version 2.1 as published by the Free Software | 
					
						
							|  |  |  | ** Foundation and appearing in the file LICENSE.LGPL included in the | 
					
						
							|  |  |  | ** packaging of this file.  Please review the following information to | 
					
						
							|  |  |  | ** ensure the GNU Lesser General Public License version 2.1 requirements | 
					
						
							|  |  |  | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
 | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** In addition, as a special exception, Digia gives you certain additional | 
					
						
							|  |  |  | ** rights.  These rights are described in the Digia Qt LGPL Exception | 
					
						
							| 
									
										
										
										
											2010-12-03 13:49:35 +01:00
										 |  |  | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | 
					
						
							|  |  |  | ** | 
					
						
							| 
									
										
										
										
											2012-10-02 09:12:39 +02:00
										 |  |  | ****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2010-12-03 13:49:35 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | #ifndef ABSTRACTEDITORSUPPORT_H
 | 
					
						
							|  |  |  | #define ABSTRACTEDITORSUPPORT_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "cpptools_global.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-02-15 10:42:41 +01:00
										 |  |  | #include <QString>
 | 
					
						
							| 
									
										
										
										
											2013-03-21 19:24:34 +01:00
										 |  |  | #include <QObject>
 | 
					
						
							| 
									
										
										
										
											2011-08-18 15:04:13 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-12-03 13:49:35 +01:00
										 |  |  | namespace CppTools { | 
					
						
							| 
									
										
										
										
											2013-04-02 11:28:11 +02:00
										 |  |  | class CppModelManagerInterface; | 
					
						
							| 
									
										
										
										
											2010-12-03 13:49:35 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-21 19:24:34 +01:00
										 |  |  | class CPPTOOLS_EXPORT AbstractEditorSupport : public QObject | 
					
						
							| 
									
										
										
										
											2010-12-03 13:49:35 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2013-03-21 19:24:34 +01:00
										 |  |  |     Q_OBJECT | 
					
						
							| 
									
										
										
										
											2010-12-03 13:49:35 +01:00
										 |  |  | public: | 
					
						
							| 
									
										
										
										
											2013-04-02 11:28:11 +02:00
										 |  |  |     explicit AbstractEditorSupport(CppModelManagerInterface *modelmanager); | 
					
						
							| 
									
										
										
										
											2010-12-03 13:49:35 +01:00
										 |  |  |     virtual ~AbstractEditorSupport(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-08-19 15:47:51 +02:00
										 |  |  |     /// \returns the contents, encoded as UTF-8
 | 
					
						
							| 
									
										
										
										
											2010-12-03 13:49:35 +01:00
										 |  |  |     virtual QByteArray contents() const = 0; | 
					
						
							|  |  |  |     virtual QString fileName() const = 0; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     void updateDocument(); | 
					
						
							| 
									
										
										
										
											2013-11-25 15:22:58 +01:00
										 |  |  |     unsigned revision() const { return m_revision; } | 
					
						
							| 
									
										
										
										
											2010-12-03 13:49:35 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // TODO: find a better place for common utility functions
 | 
					
						
							| 
									
										
										
										
											2013-04-02 11:28:11 +02:00
										 |  |  |     static QString functionAt(const CppModelManagerInterface *mm, | 
					
						
							| 
									
										
										
										
											2010-12-03 13:49:35 +01:00
										 |  |  |                               const QString &fileName, | 
					
						
							|  |  |  |                               int line, int column); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     static QString licenseTemplate(const QString &file = QString(), const QString &className = QString()); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							| 
									
										
										
										
											2013-04-02 11:28:11 +02:00
										 |  |  |     CppModelManagerInterface *m_modelmanager; | 
					
						
							| 
									
										
										
										
											2013-11-25 15:22:58 +01:00
										 |  |  |     unsigned m_revision; | 
					
						
							| 
									
										
										
										
											2010-12-03 13:49:35 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-02 11:28:11 +02:00
										 |  |  | } // namespace CppTools
 | 
					
						
							| 
									
										
										
										
											2010-12-03 13:49:35 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | #endif // ABSTRACTEDITORSUPPORT_H
 |