summaryrefslogtreecommitdiffstats
path: root/languages/ruby/app_templates/dcopservice/dcopservice.rb
diff options
context:
space:
mode:
Diffstat (limited to 'languages/ruby/app_templates/dcopservice/dcopservice.rb')
-rw-r--r--languages/ruby/app_templates/dcopservice/dcopservice.rb37
1 files changed, 37 insertions, 0 deletions
diff --git a/languages/ruby/app_templates/dcopservice/dcopservice.rb b/languages/ruby/app_templates/dcopservice/dcopservice.rb
new file mode 100644
index 00000000..94a03ec9
--- /dev/null
+++ b/languages/ruby/app_templates/dcopservice/dcopservice.rb
@@ -0,0 +1,37 @@
+
+class %{APPNAME} < KDE::DCOPObject
+
+ k_dcop 'QString string(int)',
+ 'QStringList list()',
+ 'void add(QString)',
+ 'bool remove(QString)',
+ 'bool exit()'
+
+ def initialize()
+ super("serviceInterface")
+ puts "Starting new service... "
+ @list = []
+ end
+
+ def string(idx)
+ return @list[idx]
+ end
+
+ def list()
+ return @list
+ end
+
+ def add(arg)
+ puts "Adding " + arg + " to the list"
+ @list << arg
+ end
+
+ def remove(arg)
+ @list.delete(arg) ? true : false
+ end
+
+ def exit()
+ $kapp.quit()
+ return true
+ end
+end