summaryrefslogtreecommitdiffstats
path: root/languages/ruby/app_templates/dcopservice/dcopservice.rb
blob: 94a03ec9ed40920835d43f4e9e487688d9d65f06 (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

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