File: haskellsupport_part.cpp

package info (click to toggle)
kdevelop 4%3A3.3.5-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 48,900 kB
  • ctags: 30,911
  • sloc: cpp: 289,305; sh: 18,675; makefile: 3,890; perl: 3,261; ruby: 2,081; ansic: 1,779; python: 1,636; xml: 577; yacc: 421; java: 359; lex: 252; php: 20; ada: 5; fortran: 4; pascal: 4; haskell: 2; sql: 1
file content (152 lines) | stat: -rw-r--r-- 4,567 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/***************************************************************************
                          haskellsupport_part.cpp  -  description
                             -------------------
    begin                : Mon Aug 11 2003
    copyright            : (C) 2003 by Peter Robinson
    email                : listener@thaldyron.com
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#include <qwhatsthis.h>
#include <qdir.h>
#include <qtimer.h>
#include <kiconloader.h>
#include <klocale.h>
#include <kdevgenericfactory.h>
#include <kdebug.h>
#include <kapplication.h>
#include <kstatusbar.h>
#include <kdevplugininfo.h>

//#include <antlr/ASTFactory.hpp>

#include "kdevpartcontroller.h"
#include "kdevproject.h"
#include "kdevcore.h"
#include "kdevmainwindow.h"

#include "haskellsupport_part.h"

typedef KDevGenericFactory<HaskellSupportPart> HaskellSupportFactory;
static const KDevPluginInfo data("kdevhaskellsupport");
K_EXPORT_COMPONENT_FACTORY( libkdevhaskellsupport, HaskellSupportFactory( data ) )

HaskellSupportPart::HaskellSupportPart(QObject *parent, const char *name, const QStringList& )
  : KDevLanguageSupport(&data, parent, name ? name : "HaskellSupportPart" )
{
	setInstance(HaskellSupportFactory::instance());
	setXMLFile("kdevpart_haskellsupport.rc");

 	connect( core(), SIGNAL( projectOpened() ),
  			 this, SLOT( projectOpened() ) );
  	connect( core(), SIGNAL( projectClosed() ),
  			 this, SLOT( projectClosed() ) );
  	connect( partController(), SIGNAL( savedFile( const KURL& ) ),
 			 this, SLOT( savedFile( const KURL& ) ) );
  	connect( core(), SIGNAL( contextMenu( QPopupenu*, const Context* ) ),
  			 this, SLOT( contextMenu( QPopupenu *, const Context* ) ) );
	connect( core(), SIGNAL( configWidget( KDialogBase* ) ),
  			 this, SLOT( configWidget( KDialogBase* ) ) );
	connect( core(), SIGNAL( projectConfigWidget( KDialogBase* ) ),
  			 this, SLOT( projectConfigWidget( KDialogBase* ) ) );
  	kdDebug( 9000 ) << "Haskell support found";

// @todo embed problem reporter instead:
//  mainWindow()->embedOutputView( m_widget, "name that should appear", "enter a tooltip" );
}


HaskellSupportPart::~HaskellSupportPart()
{
  // remove & delete problemReporter view
}


HaskellSupportPart::Features HaskellSupportPart::features()
{
  	return Features( Functions );
}

void HaskellSupportPart::projectOpened()
{
	connect( project(), SIGNAL( addedFilesToProject( const QStringList& ) ),
					 this, SLOT( addedFilesToProject( const QStringList& ) ) );
	connect( project(), SIGNAL( removedFilesFromProject( const QStringList& ) ),
					 this, SLOT( removedFilesFromProject( const QStringList& ) ) );
	QDir::setCurrent( project()->projectDirectory() );
	m_projectFileList = project()->allFiles();
	m_projectClosed = false;
	QTimer::singleShot( 0, this, SLOT( slotInitialParse() ) );
}

void HaskellSupportPart::projectClosed()
{
	m_projectClosed = true;
}

void HaskellSupportPart::configWidget( KDialogBase *dlg )
{
	Q_UNUSED( dlg );
	return;
}

void HaskellSupportPart::projectConfigWidget( KDialogBase *dlg )
{
	Q_UNUSED( dlg );
	return;
}

void HaskellSupportPart::contextMenu( QPopupMenu *popup, const Context *// context
                                      )
{
	Q_UNUSED( popup );
	return;
}

void HaskellSupportPart::savedFile( const KURL &fileName )
{
	Q_UNUSED( fileName.path() );
	return;
}

void HaskellSupportPart::addedFilesToProject( const QStringList &fileList )
{
	Q_UNUSED( fileList );
	return;
}

void HaskellSupportPart::removedFilesFromProject( const QStringList &fileList )
{
	Q_UNUSED( fileList );
	return;
}

void HaskellSupportPart::slotProjectCompiled()
{
	return;
}

void HaskellSupportPart::slotInitialParse()
{
	return;
}

KMimeType::List HaskellSupportPart::mimeTypes()
{
 	KMimeType::List list;
 	KMimeType::Ptr mime = KMimeType::mimeType( "text/x-haskell" );
	if( mime ) {
    	list << mime;
	}
	return list;
}

#include "haskellsupport_part.moc"