summaryrefslogtreecommitdiffstats
path: root/languages/cpp/app_templates/dcopservice/dcopservice.cpp
blob: 2f569f3c8527577210bc203208f8ef73250c5b4d (plain)
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
%{CPP_TEMPLATE}

#include "%{APPNAMELC}.h"
#include <kdebug.h>
#include <kapplication.h>

%{APPNAME}::%{APPNAME}() : DCOPObject("serviceInterface")
{
	kdDebug() << "Starting new service... " << endl;
	m_List = TQStringList();
}

%{APPNAME}::~%{APPNAME}()
{
	kdDebug() << "Going away... " << endl;
}

TQString %{APPNAME}::string(int idx)
{
	return *m_List.at(idx);
}

TQStringList %{APPNAME}::list()
{
	return m_List;
}

void %{APPNAME}::add(TQString arg)
{
	kdDebug() << "Adding " << arg << " to the list" << endl;
	m_List << arg;
}

bool %{APPNAME}::remove(TQString arg)
{
	TQStringList::Iterator it = m_List.tqfind(arg);
	if (it != m_List.end())
	{
		m_List.remove(it);
	}
	else
		return false;
	return true;
}

bool %{APPNAME}::exit()
{
	kapp->quit();
}