aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Dominic K. <mdk@codethink.co.uk>2009-10-26 15:16:02 +0200
committerMichael Dominic K. <mdk@codethink.co.uk>2009-10-26 15:16:02 +0200
commit329de796534aa5231450de185bda9164aa547f67 (patch)
treea33d107a414ae7fe286ff08b60a5e8a095afb875
parenta4094efe8107c15a7e98bb7a6e7c96a0c0a1386f (diff)
Prepare for distributionmdk_forward_compatible2
-rw-r--r--.gitignore45
-rw-r--r--AUTHORS1
-rw-r--r--COPYING504
-rw-r--r--ChangeLog0
-rw-r--r--HACKING280
-rw-r--r--INSTALL.real53
-rw-r--r--MAINTAINERS2
-rw-r--r--Makefile.am33
-rw-r--r--Makefile.in527
-rw-r--r--NEWS1
-rw-r--r--README16
-rw-r--r--am/covoptioncheck.am10
-rw-r--r--am/qt.am35
-rw-r--r--am/tests.am63
-rwxr-xr-xautoclean.sh13
-rwxr-xr-xautogen.sh30
-rw-r--r--common/Makefile.am5
-rw-r--r--common/logging.cpp421
-rw-r--r--common/logging.h144
-rw-r--r--common/sconnect.h39
-rw-r--r--configure.ac127
-rw-r--r--debian/.gitignore28
-rw-r--r--debian/changelog400
-rw-r--r--debian/compat1
-rw-r--r--debian/context-properties-doc.install1
-rw-r--r--debian/contextkit-doc.install1
-rw-r--r--debian/contextkit-utils.install9
-rw-r--r--debian/control153
-rw-r--r--debian/copyright8
-rw-r--r--debian/libcontextprovider-dev.install3
-rw-r--r--debian/libcontextprovider-doc.install1
-rw-r--r--debian/libcontextprovider-tests.install6
-rw-r--r--debian/libcontextprovider0.install1
-rw-r--r--debian/libcontextsubscriber-dev.install3
-rw-r--r--debian/libcontextsubscriber-doc.install1
-rw-r--r--debian/libcontextsubscriber-tests.install10
-rw-r--r--debian/libcontextsubscriber0.dirs1
-rw-r--r--debian/libcontextsubscriber0.install4
-rw-r--r--debian/libcontextsubscriber0.postinst7
-rw-r--r--debian/libcontextsubscriber0.triggers1
-rw-r--r--debian/python-contextkit.install1
-rwxr-xr-xdebian/rules101
-rw-r--r--doc/.gitignore16
-rw-r--r--doc/Makefile.am23
-rw-r--r--doc/context-arch.txt642
-rw-r--r--doc/context-cron.txt106
-rw-r--r--doc/context-intro.txt12
-rw-r--r--doc/context-providers.txt169
-rw-r--r--doc/context-talk.txt282
-rw-r--r--doc/context-types.txt833
-rw-r--r--doc/demos.txt57
-rw-r--r--doc/myfilter.conf24
-rw-r--r--doc/protocol-suggestion.txt71
-rw-r--r--doc/use-cases.txt389
-rw-r--r--gtk-doc.make201
-rw-r--r--libcontextprovider/.gitignore4
-rw-r--r--libcontextprovider/Makefile.am18
-rw-r--r--libcontextprovider/context-provide/.gitignore1
-rw-r--r--libcontextprovider/context-provide/Makefile.am25
-rw-r--r--libcontextprovider/context-provide/commandwatcher.cpp288
-rw-r--r--libcontextprovider/context-provide/commandwatcher.h68
-rw-r--r--libcontextprovider/context-provide/context-provide.cpp124
-rw-r--r--libcontextprovider/contextprovider-1.0.pc.in11
-rw-r--r--libcontextprovider/customer-tests/Makefile.am19
-rw-r--r--libcontextprovider/customer-tests/c-api/.gitignore1
-rw-r--r--libcontextprovider/customer-tests/c-api/Makefile.am10
-rw-r--r--libcontextprovider/customer-tests/c-api/cprovidertests.c556
-rw-r--r--libcontextprovider/customer-tests/client/.gitignore1
-rw-r--r--libcontextprovider/customer-tests/client/Makefile.am13
-rw-r--r--libcontextprovider/customer-tests/client/client.cpp13
-rw-r--r--libcontextprovider/customer-tests/client/commandwatcher.cpp286
-rw-r--r--libcontextprovider/customer-tests/client/commandwatcher.h53
-rw-r--r--libcontextprovider/customer-tests/coverage-build/Makefile29
-rwxr-xr-xlibcontextprovider/customer-tests/runTests.sh30
-rw-r--r--libcontextprovider/customer-tests/subscription/.gitignore1
-rw-r--r--libcontextprovider/customer-tests/subscription/Makefile.am27
-rw-r--r--libcontextprovider/customer-tests/subscription/subscriptiontests.cpp303
-rw-r--r--libcontextprovider/customer-tests/subscription/subscriptiontests.h51
-rw-r--r--libcontextprovider/customer-tests/tests.xml26
-rw-r--r--libcontextprovider/customer-tests/types/.gitignore1
-rw-r--r--libcontextprovider/customer-tests/types/Makefile.am19
-rw-r--r--libcontextprovider/customer-tests/types/typestests.cpp229
-rw-r--r--libcontextprovider/customer-tests/types/typestests.h50
-rw-r--r--libcontextprovider/customer-tests/value-changes/.gitignore1
-rw-r--r--libcontextprovider/customer-tests/value-changes/Makefile.am19
-rw-r--r--libcontextprovider/customer-tests/value-changes/valuechangestests.cpp339
-rw-r--r--libcontextprovider/customer-tests/value-changes/valuechangestests.h45
-rw-r--r--libcontextprovider/doc/.gitignore2
-rw-r--r--libcontextprovider/doc/Makefile.am23
-rw-r--r--libcontextprovider/doc/doc.pri10
-rw-r--r--libcontextprovider/doc/doxy.cfg152
-rw-r--r--libcontextprovider/doc/lgpl-2.1.txt504
-rw-r--r--libcontextprovider/man/Makefile.am1
-rw-r--r--libcontextprovider/man/context-provide-v2.193
-rw-r--r--libcontextprovider/src/ContextProvider8
-rw-r--r--libcontextprovider/src/Makefile.am49
-rw-r--r--libcontextprovider/src/context_provider.h27
-rw-r--r--libcontextprovider/src/contextc.cpp237
-rw-r--r--libcontextprovider/src/contextc.h72
-rw-r--r--libcontextprovider/src/group.cpp132
-rw-r--r--libcontextprovider/src/group.h76
-rw-r--r--libcontextprovider/src/listeners.cpp76
-rw-r--r--libcontextprovider/src/listeners.h91
-rw-r--r--libcontextprovider/src/loggingfeatures.h36
-rw-r--r--libcontextprovider/src/manager.cpp226
-rw-r--r--libcontextprovider/src/manager.h73
-rw-r--r--libcontextprovider/src/manageradaptor.cpp70
-rw-r--r--libcontextprovider/src/manageradaptor.h53
-rw-r--r--libcontextprovider/src/property.cpp142
-rw-r--r--libcontextprovider/src/property.h78
-rw-r--r--libcontextprovider/src/queuedinvoker.cpp77
-rw-r--r--libcontextprovider/src/queuedinvoker.h55
-rw-r--r--libcontextprovider/src/service.cpp297
-rw-r--r--libcontextprovider/src/service.h68
-rw-r--r--libcontextprovider/src/servicebackend.cpp213
-rw-r--r--libcontextprovider/src/servicebackend.h79
-rw-r--r--libcontextprovider/src/subscriber.cpp166
-rw-r--r--libcontextprovider/src/subscriber.h71
-rw-r--r--libcontextprovider/src/subscriberadaptor.cpp54
-rw-r--r--libcontextprovider/src/subscriberadaptor.h54
-rw-r--r--libcontextprovider/unit-tests/.gitignore1
-rw-r--r--libcontextprovider/unit-tests/Makefile.am33
-rw-r--r--libcontextprovider/unit-tests/contextc/.gitignore11
-rw-r--r--libcontextprovider/unit-tests/contextc/Makefile.am22
-rw-r--r--libcontextprovider/unit-tests/contextc/contextcunittest.cpp326
-rw-r--r--libcontextprovider/unit-tests/contextc/group.h65
-rw-r--r--libcontextprovider/unit-tests/contextc/property.h65
-rw-r--r--libcontextprovider/unit-tests/contextc/service.h54
-rw-r--r--libcontextprovider/unit-tests/contextgroup/.gitignore9
-rw-r--r--libcontextprovider/unit-tests/contextgroup/Makefile.am22
-rw-r--r--libcontextprovider/unit-tests/contextgroup/contextgroupunittest.cpp177
-rw-r--r--libcontextprovider/unit-tests/contextgroup/property.h51
-rw-r--r--libcontextprovider/unit-tests/contextgroup/service.h38
-rw-r--r--libcontextprovider/unit-tests/manager/.gitignore11
-rw-r--r--libcontextprovider/unit-tests/manager/Makefile.am22
-rw-r--r--libcontextprovider/unit-tests/manager/managerunittest.cpp244
-rw-r--r--libcontextprovider/unit-tests/property/.gitignore7
-rw-r--r--libcontextprovider/unit-tests/property/Makefile.am22
-rw-r--r--libcontextprovider/unit-tests/property/manager.h63
-rw-r--r--libcontextprovider/unit-tests/property/propertyunittest.cpp238
-rw-r--r--libcontextprovider/unit-tests/property/service.h35
-rw-r--r--libcontextprovider/unit-tests/property/servicebackend.h47
-rw-r--r--libcontextprovider/unit-tests/service/.gitignore7
-rw-r--r--libcontextprovider/unit-tests/service/Makefile.am22
-rw-r--r--libcontextprovider/unit-tests/service/manager.h48
-rw-r--r--libcontextprovider/unit-tests/service/manageradaptor.h44
-rw-r--r--libcontextprovider/unit-tests/service/property.h52
-rw-r--r--libcontextprovider/unit-tests/service/servicebackend.h60
-rw-r--r--libcontextprovider/unit-tests/service/serviceunittest.cpp236
-rw-r--r--libcontextprovider/unit-tests/servicebackend/.gitignore5
-rw-r--r--libcontextprovider/unit-tests/servicebackend/Makefile.am22
-rw-r--r--libcontextprovider/unit-tests/servicebackend/manager.h48
-rw-r--r--libcontextprovider/unit-tests/servicebackend/manageradaptor.h44
-rw-r--r--libcontextprovider/unit-tests/servicebackend/servicebackendunittest.cpp165
-rw-r--r--libcontextprovider/unit-tests/subscriber/.gitignore7
-rw-r--r--libcontextprovider/unit-tests/subscriber/Makefile.am22
-rw-r--r--libcontextprovider/unit-tests/subscriber/manager.h58
-rw-r--r--libcontextprovider/unit-tests/subscriber/queuedinvoker.h50
-rw-r--r--libcontextprovider/unit-tests/subscriber/subscriberunittest.cpp298
-rw-r--r--libcontextsubscriber/.gitignore51
-rw-r--r--libcontextsubscriber/Makefile.am18
-rw-r--r--libcontextsubscriber/cli/Makefile.am27
-rw-r--r--libcontextsubscriber/cli/commandwatcher.cpp218
-rw-r--r--libcontextsubscriber/cli/commandwatcher.h48
-rw-r--r--libcontextsubscriber/cli/context-listen.cpp61
-rw-r--r--libcontextsubscriber/cli/propertylistener.cpp45
-rw-r--r--libcontextsubscriber/cli/propertylistener.h40
-rw-r--r--libcontextsubscriber/cli/wait-test/main.cpp73
-rw-r--r--libcontextsubscriber/cli/wait-test/wait-test.pro11
-rw-r--r--libcontextsubscriber/cls/Makefile.am25
-rw-r--r--libcontextsubscriber/cls/context-ls.cpp72
-rw-r--r--libcontextsubscriber/contextsubscriber-1.0.pc.in13
-rw-r--r--libcontextsubscriber/customer-tests/Makefile.am23
-rwxr-xr-xlibcontextsubscriber/customer-tests/asynchronicity/asynchronicity.py112
-rwxr-xr-xlibcontextsubscriber/customer-tests/asynchronicity/rapidchanges.py82
-rw-r--r--libcontextsubscriber/customer-tests/asynchronicity/slowfast.context15
-rwxr-xr-xlibcontextsubscriber/customer-tests/commander/commander_appearing.py92
-rwxr-xr-xlibcontextsubscriber/customer-tests/commander/commander_disabled.py60
-rwxr-xr-xlibcontextsubscriber/customer-tests/commander/commander_nonexistent.py78
-rwxr-xr-xlibcontextsubscriber/customer-tests/common/rec-kill.sh20
-rw-r--r--libcontextsubscriber/customer-tests/coverage-build/Makefile29
-rw-r--r--libcontextsubscriber/customer-tests/env.sh6
-rw-r--r--libcontextsubscriber/customer-tests/forward-compatible/Makefile.am20
-rw-r--r--libcontextsubscriber/customer-tests/forward-compatible/cache1.cdbbin2565 -> 0 bytes
-rw-r--r--libcontextsubscriber/customer-tests/forward-compatible/cache2.cdbbin2569 -> 0 bytes
-rw-r--r--libcontextsubscriber/customer-tests/forward-compatible/check-version.cpp74
-rwxr-xr-xlibcontextsubscriber/customer-tests/forward-compatible/test.sh6
-rwxr-xr-xlibcontextsubscriber/customer-tests/pluginchanging/pluginchanging.py68
-rw-r--r--libcontextsubscriber/customer-tests/pluginchanging/time1.context.temp4
-rw-r--r--libcontextsubscriber/customer-tests/pluginchanging/time2.context.temp4
-rwxr-xr-xlibcontextsubscriber/customer-tests/registry/registry.py86
-rwxr-xr-xlibcontextsubscriber/customer-tests/runTests.sh54
-rwxr-xr-xlibcontextsubscriber/customer-tests/subscription/multiprovider.py100
-rw-r--r--libcontextsubscriber/customer-tests/subscription/nonexistent.context7
-rwxr-xr-xlibcontextsubscriber/customer-tests/subscription/subscription.py704
-rw-r--r--libcontextsubscriber/customer-tests/testplugins/Makefile.am11
-rw-r--r--libcontextsubscriber/customer-tests/testplugins/timeplugin.cpp68
-rw-r--r--libcontextsubscriber/customer-tests/testplugins/timeplugin.h59
-rw-r--r--libcontextsubscriber/customer-tests/testplugins/timeplugin1/.gitignore2
-rw-r--r--libcontextsubscriber/customer-tests/testplugins/timeplugin1/Makefile.am33
-rw-r--r--libcontextsubscriber/customer-tests/testplugins/timeplugin2/.gitignore2
-rw-r--r--libcontextsubscriber/customer-tests/testplugins/timeplugin2/Makefile.am33
-rw-r--r--libcontextsubscriber/customer-tests/tests.xml100
-rw-r--r--libcontextsubscriber/customer-tests/update-contextkit-providers/.gitignore3
-rw-r--r--libcontextsubscriber/customer-tests/update-contextkit-providers/Battery.Charging_KEYDOC.expectedbin83 -> 0 bytes
-rw-r--r--libcontextsubscriber/customer-tests/update-contextkit-providers/Battery.Charging_KEYTYPE.expectedbin19 -> 0 bytes
-rw-r--r--libcontextsubscriber/customer-tests/update-contextkit-providers/Battery.Charging_PROVIDERS.expectedbin208 -> 0 bytes
-rw-r--r--libcontextsubscriber/customer-tests/update-contextkit-providers/KEYS.expectedbin143 -> 0 bytes
-rw-r--r--libcontextsubscriber/customer-tests/update-contextkit-providers/Makefile.am13
-rw-r--r--libcontextsubscriber/customer-tests/update-contextkit-providers/providers1.context9
-rw-r--r--libcontextsubscriber/customer-tests/update-contextkit-providers/providers2.context17
-rwxr-xr-xlibcontextsubscriber/customer-tests/update-contextkit-providers/regen.sh15
-rwxr-xr-xlibcontextsubscriber/customer-tests/update-contextkit-providers/test.sh70
-rw-r--r--libcontextsubscriber/demo/README27
-rw-r--r--libcontextsubscriber/demo/fast.context7
-rw-r--r--libcontextsubscriber/demo/slow.context7
-rw-r--r--libcontextsubscriber/doc/Makefile.am23
-rw-r--r--libcontextsubscriber/doc/doxy.cfg152
-rw-r--r--libcontextsubscriber/doc/lgpl-2.1.txt504
-rw-r--r--libcontextsubscriber/man/Makefile.am1
-rw-r--r--libcontextsubscriber/man/context-listen.155
-rw-r--r--libcontextsubscriber/man/context-ls.134
-rw-r--r--libcontextsubscriber/man/context-print-info.121
-rw-r--r--libcontextsubscriber/man/update-contextkit-providers.114
-rw-r--r--libcontextsubscriber/multithreading-tests/Makefile.am1
-rw-r--r--libcontextsubscriber/multithreading-tests/new-property-in-thread/.gitignore1
-rw-r--r--libcontextsubscriber/multithreading-tests/new-property-in-thread/Makefile.am17
-rw-r--r--libcontextsubscriber/multithreading-tests/new-property-in-thread/main.cpp20
-rw-r--r--libcontextsubscriber/multithreading-tests/new-property-in-thread/thread.h45
-rw-r--r--libcontextsubscriber/multithreading-tests/old-property-in-thread/.gitignore1
-rw-r--r--libcontextsubscriber/multithreading-tests/old-property-in-thread/Makefile.am17
-rw-r--r--libcontextsubscriber/multithreading-tests/old-property-in-thread/main.cpp25
-rw-r--r--libcontextsubscriber/multithreading-tests/old-property-in-thread/thread.h45
-rw-r--r--libcontextsubscriber/multithreading-tests/single-thread/.gitignore1
-rw-r--r--libcontextsubscriber/multithreading-tests/single-thread/Makefile.am17
-rw-r--r--libcontextsubscriber/multithreading-tests/single-thread/listener.h30
-rw-r--r--libcontextsubscriber/multithreading-tests/single-thread/main.cpp15
-rw-r--r--libcontextsubscriber/multithreading-tests/stress-test/.gitignore2
-rw-r--r--libcontextsubscriber/multithreading-tests/stress-test/1provider.cdbbin2727 -> 0 bytes
-rw-r--r--libcontextsubscriber/multithreading-tests/stress-test/2providers.cdbbin3423 -> 0 bytes
-rw-r--r--libcontextsubscriber/multithreading-tests/stress-test/Makefile.am17
-rw-r--r--libcontextsubscriber/multithreading-tests/stress-test/main.cpp23
-rwxr-xr-xlibcontextsubscriber/multithreading-tests/stress-test/provider.py42
-rwxr-xr-xlibcontextsubscriber/multithreading-tests/stress-test/runme.sh14
-rw-r--r--libcontextsubscriber/multithreading-tests/stress-test/thread.h135
-rw-r--r--libcontextsubscriber/multithreading-tests/using-backend-from-thread/.gitignore1
-rw-r--r--libcontextsubscriber/multithreading-tests/using-backend-from-thread/Makefile.am17
-rw-r--r--libcontextsubscriber/multithreading-tests/using-backend-from-thread/main.cpp25
-rw-r--r--libcontextsubscriber/multithreading-tests/using-backend-from-thread/thread.h39
-rw-r--r--libcontextsubscriber/multithreading-tests/wait-for-subscription-only-in-thread/.gitignore1
-rw-r--r--libcontextsubscriber/multithreading-tests/wait-for-subscription-only-in-thread/Makefile.am17
-rw-r--r--libcontextsubscriber/multithreading-tests/wait-for-subscription-only-in-thread/main.cpp20
-rw-r--r--libcontextsubscriber/multithreading-tests/wait-for-subscription-only-in-thread/thread.h52
-rw-r--r--libcontextsubscriber/multithreading-tests/wait-for-subscription-thread/.gitignore1
-rw-r--r--libcontextsubscriber/multithreading-tests/wait-for-subscription-thread/Makefile.am17
-rw-r--r--libcontextsubscriber/multithreading-tests/wait-for-subscription-thread/main.cpp25
-rw-r--r--libcontextsubscriber/multithreading-tests/wait-for-subscription-thread/thread.h47
-rw-r--r--libcontextsubscriber/sandbox/messaging-to-self/main.cpp20
-rw-r--r--libcontextsubscriber/sandbox/messaging-to-self/messaging-to-self.pro12
-rw-r--r--libcontextsubscriber/sandbox/messaging-to-self/myobject.h35
-rw-r--r--libcontextsubscriber/sandbox/messaging-to-self/mythread.h32
-rw-r--r--libcontextsubscriber/sandbox/messaging-to-self/queuedinvoker.cpp35
-rw-r--r--libcontextsubscriber/sandbox/messaging-to-self/queuedinvoker.h29
-rw-r--r--libcontextsubscriber/src/Makefile.am47
-rw-r--r--libcontextsubscriber/src/asyncdbusinterface.cpp61
-rw-r--r--libcontextsubscriber/src/asyncdbusinterface.h39
-rw-r--r--libcontextsubscriber/src/cdbreader.cpp158
-rw-r--r--libcontextsubscriber/src/cdbreader.h52
-rw-r--r--libcontextsubscriber/src/cdbwriter.cpp168
-rw-r--r--libcontextsubscriber/src/cdbwriter.h52
-rw-r--r--libcontextsubscriber/src/contextkitplugin.cpp169
-rw-r--r--libcontextsubscriber/src/contextkitplugin.h87
-rw-r--r--libcontextsubscriber/src/contextproperty.cpp336
-rw-r--r--libcontextsubscriber/src/contextproperty.h64
-rw-r--r--libcontextsubscriber/src/contextpropertyinfo.cpp419
-rw-r--r--libcontextsubscriber/src/contextpropertyinfo.h132
-rw-r--r--libcontextsubscriber/src/contextproviderinfo.h41
-rw-r--r--libcontextsubscriber/src/contextregistryinfo.cpp207
-rw-r--r--libcontextsubscriber/src/contextregistryinfo.h92
-rw-r--r--libcontextsubscriber/src/dbusnamelistener.cpp167
-rw-r--r--libcontextsubscriber/src/dbusnamelistener.h69
-rw-r--r--libcontextsubscriber/src/handlesignalrouter.cpp62
-rw-r--r--libcontextsubscriber/src/handlesignalrouter.h50
-rw-r--r--libcontextsubscriber/src/infobackend.cpp154
-rw-r--r--libcontextsubscriber/src/infobackend.h105
-rw-r--r--libcontextsubscriber/src/infocdbbackend.cpp220
-rw-r--r--libcontextsubscriber/src/infocdbbackend.h64
-rw-r--r--libcontextsubscriber/src/infokeydata.h43
-rw-r--r--libcontextsubscriber/src/infoxmlbackend.cpp360
-rw-r--r--libcontextsubscriber/src/infoxmlbackend.h68
-rw-r--r--libcontextsubscriber/src/iproviderplugin.h54
-rw-r--r--libcontextsubscriber/src/loggingfeatures.h32
-rw-r--r--libcontextsubscriber/src/nanoxml.cpp349
-rw-r--r--libcontextsubscriber/src/nanoxml.h83
-rw-r--r--libcontextsubscriber/src/propertyhandle.cpp301
-rw-r--r--libcontextsubscriber/src/propertyhandle.h83
-rw-r--r--libcontextsubscriber/src/provider.cpp365
-rw-r--r--libcontextsubscriber/src/provider.h88
-rw-r--r--libcontextsubscriber/src/queuedinvoker.cpp77
-rw-r--r--libcontextsubscriber/src/queuedinvoker.h54
-rw-r--r--libcontextsubscriber/src/safedbuspendingcallwatcher.h21
-rw-r--r--libcontextsubscriber/src/subscriberinterface.cpp170
-rw-r--r--libcontextsubscriber/src/subscriberinterface.h69
-rw-r--r--libcontextsubscriber/src/timedvalue.h49
-rw-r--r--libcontextsubscriber/unit-tests/Makefile.am39
-rw-r--r--libcontextsubscriber/unit-tests/cdb/.gitignore7
-rw-r--r--libcontextsubscriber/unit-tests/cdb/Makefile.am22
-rw-r--r--libcontextsubscriber/unit-tests/cdb/cdbunittest.cpp142
-rw-r--r--libcontextsubscriber/unit-tests/contextpropertyinfo/.gitignore5
-rw-r--r--libcontextsubscriber/unit-tests/contextpropertyinfo/Makefile.am28
-rw-r--r--libcontextsubscriber/unit-tests/contextpropertyinfo/contextpropertyinfounittest.cpp368
-rw-r--r--libcontextsubscriber/unit-tests/contextpropertyinfo/infobackend.h58
-rw-r--r--libcontextsubscriber/unit-tests/contextregistryinfo/.gitignore5
-rw-r--r--libcontextsubscriber/unit-tests/contextregistryinfo/Makefile.am28
-rw-r--r--libcontextsubscriber/unit-tests/contextregistryinfo/contextregistryinfounittest.cpp201
-rw-r--r--libcontextsubscriber/unit-tests/contextregistryinfo/infobackend.h53
-rw-r--r--libcontextsubscriber/unit-tests/handlesignalrouter/.gitignore5
-rw-r--r--libcontextsubscriber/unit-tests/handlesignalrouter/Makefile.am21
-rw-r--r--libcontextsubscriber/unit-tests/handlesignalrouter/propertyhandle.h57
-rw-r--r--libcontextsubscriber/unit-tests/handlesignalrouter/testhandlesignalrouter.cpp200
-rw-r--r--libcontextsubscriber/unit-tests/handlesignalrouter/testhandlesignalrouter.h49
-rw-r--r--libcontextsubscriber/unit-tests/infobackend/.gitignore19
-rw-r--r--libcontextsubscriber/unit-tests/infobackend/Makefile.am36
-rw-r--r--libcontextsubscriber/unit-tests/infobackend/infobackendunittest.cpp190
-rw-r--r--libcontextsubscriber/unit-tests/infocdbbackend/.gitignore22
-rw-r--r--libcontextsubscriber/unit-tests/infocdbbackend/Makefile.am37
-rw-r--r--libcontextsubscriber/unit-tests/infocdbbackend/infocdbbackendunittest.cpp303
-rw-r--r--libcontextsubscriber/unit-tests/infoxmlbackend/.gitignore19
-rw-r--r--libcontextsubscriber/unit-tests/infoxmlbackend/Makefile.am36
-rw-r--r--libcontextsubscriber/unit-tests/infoxmlbackend/infoxmlbackendunittest.cpp215
-rw-r--r--libcontextsubscriber/unit-tests/infoxmlbackend/providers1.src18
-rw-r--r--libcontextsubscriber/unit-tests/infoxmlbackend/providers2v1.src18
-rw-r--r--libcontextsubscriber/unit-tests/infoxmlbackend/providers2v2.src6
-rw-r--r--libcontextsubscriber/unit-tests/infoxmlbackend/providers3.src9
-rw-r--r--libcontextsubscriber/unit-tests/infoxmlbackend/providers4.src6
-rw-r--r--libcontextsubscriber/unit-tests/infoxmlbackend/providers5.src6
-rw-r--r--libcontextsubscriber/unit-tests/infoxmlbackend/providers6.src9
-rw-r--r--libcontextsubscriber/unit-tests/nanoxml/.gitignore4
-rw-r--r--libcontextsubscriber/unit-tests/nanoxml/Makefile.am23
-rw-r--r--libcontextsubscriber/unit-tests/nanoxml/broken.xml5
-rw-r--r--libcontextsubscriber/unit-tests/nanoxml/nanoxmlunittest.cpp261
-rw-r--r--libcontextsubscriber/unit-tests/nanoxml/test1.xml6
-rw-r--r--libcontextsubscriber/unit-tests/nanoxml/test2.xml5
-rw-r--r--libcontextsubscriber/unit-tests/nanoxml/test3.xml4
-rw-r--r--libcontextsubscriber/unit-tests/nanoxml/test4.xml8
-rw-r--r--libcontextsubscriber/unit-tests/propertyhandle/.gitignore9
-rw-r--r--libcontextsubscriber/unit-tests/propertyhandle/Makefile.am24
-rw-r--r--libcontextsubscriber/unit-tests/propertyhandle/contextpropertyinfo.h54
-rw-r--r--libcontextsubscriber/unit-tests/propertyhandle/contextregistryinfo.h44
-rw-r--r--libcontextsubscriber/unit-tests/propertyhandle/dbusnamelistener.h62
-rw-r--r--libcontextsubscriber/unit-tests/propertyhandle/provider.h79
-rw-r--r--libcontextsubscriber/unit-tests/propertyhandle/testpropertyhandle.cpp891
-rw-r--r--libcontextsubscriber/unit-tests/propertyhandle/testpropertyhandle.h66
-rw-r--r--libcontextsubscriber/unit-tests/provider/.gitignore9
-rw-r--r--libcontextsubscriber/unit-tests/provider/Makefile.am25
-rw-r--r--libcontextsubscriber/unit-tests/provider/contextkitplugin.h63
-rw-r--r--libcontextsubscriber/unit-tests/provider/handlesignalrouter.h46
-rw-r--r--libcontextsubscriber/unit-tests/provider/queuedinvoker.h51
-rw-r--r--libcontextsubscriber/unit-tests/provider/testprovider.cpp329
-rw-r--r--libcontextsubscriber/unit-tests/provider/testprovider.h53
-rw-r--r--libcontextsubscriber/unit-tests/util/Makefile.am1
-rw-r--r--libcontextsubscriber/unit-tests/util/fileutils.h85
-rw-r--r--libcontextsubscriber/update-contextkit-providers/Makefile.am21
-rw-r--r--libcontextsubscriber/update-contextkit-providers/cache.cdbbin2048 -> 0 bytes
-rw-r--r--libcontextsubscriber/update-contextkit-providers/update-contextkit-providers.cpp173
-rw-r--r--loadmem/Makefile.am (renamed from tools/loadmem/Makefile.am)0
-rw-r--r--loadmem/Makefile.in503
-rw-r--r--loadmem/loadmem.c (renamed from tools/loadmem/loadmem.c)0
-rw-r--r--ltmain.sh.as-needed.patch31
-rw-r--r--m4/.gitignore6
-rw-r--r--m4/ax_compare_version.m4174
-rw-r--r--m4/ax_version_tools.m461
-rw-r--r--m4/qt.m423
-rwxr-xr-xmakedeb41
-rw-r--r--myfilter.conf18
-rw-r--r--python/ContextKit/CTypesHelpers.py65
-rw-r--r--python/ContextKit/ContextProvider.py60
-rw-r--r--python/ContextKit/__init__.py0
-rw-r--r--python/ContextKit/cltool.py142
-rw-r--r--python/ContextKit/flexiprovider.py179
-rw-r--r--python/Makefile.am10
-rw-r--r--python/README18
-rwxr-xr-xpython/complex.py22
-rwxr-xr-xpython/context-provide66
-rw-r--r--python/context-provide.184
-rwxr-xr-xpython/context-rlwrap35
-rwxr-xr-xpython/simple.py12
-rw-r--r--spec/.gitignore6
-rw-r--r--spec/Context.owl7828
-rw-r--r--spec/Makefile.am72
-rw-r--r--spec/Manager.xml38
-rw-r--r--spec/Subscriber.xml55
-rw-r--r--spec/all.xml29
-rw-r--r--spec/context.xsd162
-rwxr-xr-xspec/context2asciidoc.pl197
-rw-r--r--spec/core.context816
-rw-r--r--spec/doc-generator.xsl1199
-rw-r--r--spec/generic-types.xml12
-rw-r--r--spec/myfilter.conf18
-rw-r--r--spec/spec-to-introspect.xsl51
-rw-r--r--spec/xs3p/CHANGES9
-rw-r--r--spec/xs3p/LICENSE.html519
-rw-r--r--spec/xs3p/README.txt224
-rw-r--r--spec/xs3p/examples/XMLSchema.xsd2492
-rw-r--r--spec/xs3p/examples/address.xsd55
-rw-r--r--spec/xs3p/examples/build.xml40
-rw-r--r--spec/xs3p/examples/ipo.xsd59
-rw-r--r--spec/xs3p/examples/links.xml6
-rw-r--r--spec/xs3p/examples/po.xsd66
-rw-r--r--spec/xs3p/examples/recursion.xsd85
-rw-r--r--spec/xs3p/examples/report.xsd84
-rw-r--r--spec/xs3p/examples/test_msxsl.bat19
-rw-r--r--spec/xs3p/examples/test_xalanj.bat19
-rw-r--r--spec/xs3p/examples/test_xsltproc.sh30
-rw-r--r--spec/xs3p/examples/xml.xsd80
-rw-r--r--spec/xs3p/links.dtd7
-rw-r--r--spec/xs3p/links.xsd20
-rw-r--r--spec/xs3p/xs3p.xsl8503
-rw-r--r--tools/Makefile.am1
-rwxr-xr-xtools/git-make-dist68
-rw-r--r--tools/loadmem/.gitignore1
-rw-r--r--tools/tiny_get_frontend.py34
-rw-r--r--tools/tiny_subscribe_frontend.py54
423 files changed, 1031 insertions, 52607 deletions
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index a333a903..00000000
--- a/.gitignore
+++ /dev/null
@@ -1,45 +0,0 @@
-.*.swp
-*.tar.bz2
-*.tar.gz
-Makefile
-Makefile.in
-aclocal.m4
-autom4te.cache
-compile
-/py-compile
-config.guess
-config.h
-config.h.in
-config.h.in~
-config.log
-config.status
-config.sub
-configure
-context.valid.stamp
-depcomp
-install-sh
-libtool
-ltmain.sh
-missing
-.dirstamp
-.deps
-*.o
-*.a
-*.lo
-*.la
-*.moc
-stamp-h1
-_package
-*.libs
-*.gcno
-*.gcda
-*.pyc
-lcov.html/
-lcov.info
-.project
-INSTALL
-build-stamp
-flexi-properties.xml
-mocs.cpp
-moc_*
-TAGS
diff --git a/AUTHORS b/AUTHORS
deleted file mode 100644
index cd477de3..00000000
--- a/AUTHORS
+++ /dev/null
@@ -1 +0,0 @@
-Rob Taylor <rob.taylor@codethink.co.uk>
diff --git a/COPYING b/COPYING
deleted file mode 100644
index 5ab7695a..00000000
--- a/COPYING
+++ /dev/null
@@ -1,504 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
diff --git a/ChangeLog b/ChangeLog
deleted file mode 100644
index e69de29b..00000000
--- a/ChangeLog
+++ /dev/null
diff --git a/HACKING b/HACKING
deleted file mode 100644
index f2cae842..00000000
--- a/HACKING
+++ /dev/null
@@ -1,280 +0,0 @@
-How to hack on the ContextKit
-=============================
-
-These are the coding and release guidelines for the ContextKit. They
-are quite general, so if you like them, feel free to copy them into
-your project.
-
-Build system
-------------
-
-We use the autotools in their 'foreign' strictness plus pkg-config.
-We don't use qmake, even for Qt programs or libraries. We have our
-own solution for handling Qt things, documented in am/qt.am.
-
-Upstream and Packaging
-----------------------
-
-We do not separate 'upstream' code development and packaging for
-Maemo. Both happen in the same branch.
-
-In the Maemo context, we don't get any benefit from separating the
-two, so we don't.
-
-Thus, all our packages are "native": we do not use Debian revision
-dashes such as "0.1-3" in our version numbers, we always use plain
-upstream versions such as "0.1".
-
-Documentation
--------------
-
-Documentation is in HTML and generally distributed in the tarballs and
-distribution tags. We do this so that recipients don't need all the
-crazy build tools that we use and still get some documentation.
-
-Thus, all documentation files should be added to EXTRA_DIST and
-MAINTAINERCLEANFILES.
-
-Since timestamps are not always preserved well enough when checking a
-distribution tag out of Git, it might happen that documentation is
-being regenerated also during a pure target build, and might fail.
-
-It's not yet totally clear how to cope with that: one approach is to
-have something like autotool's "missing", another might be to touch
-all 'interesting' files just before building. Let's see.
-
-Anyway, you can disable generating of documentation by passing
---disable-doc to configure.
-
-Environments
-------------
-
-Our code should be as portable as possible, but a few environments are
-more important than others.
-
-There are supported development environments, and compilation
-environments.
-
- - Development
-
- For fun and fame, our code should work in a typical Debian unstable
- and Ubuntu environment, augmented with our own packages that we build
- from source. (If it works in Fedora, too, cool!) This is our
- day-to-day development environment.
-
- The projects only need to work fully when installed. Thus, the
- projects must be cleanly installable in arbitrary prefixes. The
- following should work to install everything in $HOME/install:
-
- ./configure --prefix $HOME/install/
- make install
-
- The installed projects should then fully work with these settings:
-
- PATH=$HOME/install/bin/
- LD_LIBRARY_PATH=$HOME/install/lib/
- PKG_CONFIG_PATH=$HOME/install/lib/pkgconfig/
-
- The "master" branches on the mainline repos on PMO should always pass
- "make check" in the development environments, after doing the
- necessary autogen.sh gymnastics in a fresh checkout.
-
- For projects that can not be developed in Debian or Ubunute, do
- whatever needs to be done. Document this in a "HACKING" file in the
- top directory of the source tree.
-
- However, try to port the project to Debian/Ubuntu instead, maybe by
- making certain features optional or by importing the missing dependencies.
-
- - Compilation
-
- For pain and profit, the code also needs to compile in a Harmattan
- target in Scratchbox. We only use Scratchbox 1 for now, with the
- following devkits: perl, debian-etch, doctools.
-
- When in doubt, follow these instructions to set it up:
-
- https://projects.maemo.org/trac/sdk/wiki/Harmattan
-
- Distribution tags (see below) should be buildable with one of these
- two commands right after checking them out
-
- ./configure && make (for a upstream source tree)
- dpkg-buildpackage (for Debianized sources)
-
- Note that things like running ./autogen.sh or more generally
- regenerating files that are contained in distribution tags is not
- supported in the compilation environment.
-
-Coding style
-------------
-
-We follow the DUI coding style for C++ code. In brief:
-
- - No tab characters (0x09)
- - Linux style, but
- - Indentation offset is 4 and
- - Maximum line length is 120.
- - No editor specific settings in the files.
- - Code inside a namespace is not indented.
-
-For Python:
-
- - PEP 8, but
- - Maximum line length is 120.
-
-Generated files
----------------
-
-No generated file should be committed to a branch. After checking out
-(or exporting) a branch, running "./autogen.sh" will get the tree into
-a shape where "./configure && make" or "dpkg-buildpackage" will work.
-
-Distribution tags are different, see below.
-
-ChangeLogs
-----------
-
-There is no GNU-style ChangeLog. We assume that the VCS keeps a
-detailed log of the changes. Likewise, debian/changelog does not
-record detailed changes, just the stuff that would go into an
-announcement.
-
-We use debian/changelog instead of ./NEWS.
-
-Marking fixed bugs
-------------------
-
-When committing a change that is supposed to fix a bug, make a
-annotated tag for it with the name "fixes_NNNNN" where NNNNN is the
-Bugzilla bug number. Use the message "Fixes: NB#NNNNN - SUMMARY"
-where SUMMARY is of course the one-line summary of the bug.
-
-(The annotation message is there to carry the summary. Bugzilla is
-not visible to the outside, and we should give some hints about what
-kind of bugs we have fixed. With a public Bugzilla, a simple
-leightweight tag would suffice.)
-
-Making a distribution tag
--------------------------
-
-No generated file should be committed to a branch, but distribution
-tags should be buildable with "./configure && make" or
-"dpkg-buildpackage" right away after exporting them, without the need
-to run autogen.sh. The created Debian source package should be clean,
-and not contain any files that are not supposed to be distributed.
-
-In general, a tag should contain exactly the files that would be in a
-distribution tarball produced by "make dist". In essence, we use tags
-in a VCS repository instead of the traditional tarballs.
-
-Note that distribution tags are usually created in the development
-environment, outside of Scratchbox.
-
-Here is the general procedure:
-
-- Clean everything that can be generated.
-
- $ make maintainer-clean || make distclean
-
-- Recreate the build cruft.
-
- $ ./autogen.sh
-
-- Configure your source tree as needed for making a release.
-
- $ ./configure --enable-maintainer-mode --enable-gtk-doc
-
-- Build the source tree and do a "make distcheck"
-
- $ make
- $ make distcheck
-
-- Make the distribution tag with git-make-dist (in the tools/ directory).
-
- $ git-make-dist TAG
-
-The "git-make-dist" script runs "make distdir" and creates a tag with
-the contents of the created directory.
-
-Building a debian package
--------------------------
-
-After a git clone, you first have to build vala C sources and
-documentation. If you have extracted a distribution tarball, then you
-already have these files. Otherwise just do a ./configure, let's
-double check that all of the documentation tools and the vala compiler
-is found and make. After that you are ready to run
-'dpkg-buildpackage -us -uc -rfakeroot -b' to get your shiny new debian
-packages.
-
-Making releases
----------------
-
-Version numbers are bumped post-release: the version numbers in master
-and other branches always reflect the version that is going to be
-released next. Once a release has been made, the version numbers in
-the branch are immediately incremented. In addition, version numbers
-in branches have a "~unreleased" suffix to make this clear.
-
-Thus, configure.ac always contains the version that is going to be
-released next with a "~unreleased" suffix and debian/changelog
-contains a prepared entry for the next release with a "~unreleased"
-suffix.
-
-That suffix is there to make it clear that we are using the
-"post-release bump" schema. It also reduces confusion when you create
-a tarball or Debian package from a branch for testing purposes. Those
-tarballs and packages will be clearly marked to be 'unreleased', and
-can not be confused with the real releases. Do not distribute these
-unreleased packages to other people.
-
-If you do want to label multiple intermediate non-releases, use
-suffixes of the form "~unreleasedN". Do this by changing the existing
-debian/changelog entry in place. Do not create a new entry.
-
-Thus, as a rule, configure.ac and debian/changelog in a branch should
-always have a version number with a "~unreleased" suffix, and the
-distribution tags made from a branch should never have a version
-number with a "~unreleased" suffix. Also, no other entry in
-debian/changelog than the top-most one in a branch should have the
-"~unreleased" suffix.
-
-The procedure for making a release is as follows:
-
-- Make sure that you are in a releasable state. This includes running
- "make distcheck", running dpkg-buildpackage and checking the
- generated packages for obvious problems, maybe installing those
- packages and doing some smoke tests.
-
-- Remove the "~unreleased" suffix in configure.ac. You can also
- increase the version more generally at this time, such as from
- 0.1.5~unreleased to 0.2.0.
-
-- Do the same in debian/changelog, and also make sure that the
- 'release notes' in it are up-to-date.
-
-- Update the date line in the top-most entry so that it has your name
- and the current date and time.
-
-- Commit this with a message of "Released VERSION".
-
-- Make a annotated tag with the name "release_VERSION" and the message
- "Released VERSION."
-
-- Run all the steps in "Making a distribution tag". Use the plain
- VERSION as the tag name.
-
-- Bump the version in configure.ac by increasing the least significant
- component and add the "~unreleased" suffix again.
-
-- Add a new empty entry to debian/changelog with the same version that
- is now in configure.ac.
-
-- Commit this with the message "Prepare VERSION" where VERSION is the
- new version without the "~unreleased" suffix.
-
-- Push everything. Don't forget to push the tags as well. If you
- can't push at this time because you need to pull first, do that but
- be careful to merge the remote changes. Do not use "git pull
- --rebase" at this time.
diff --git a/INSTALL.real b/INSTALL.real
deleted file mode 100644
index 3a30cce3..00000000
--- a/INSTALL.real
+++ /dev/null
@@ -1,53 +0,0 @@
-Installation instructions for the ContextKit
---------------------------------------------
-
-A ContextKit release can usually be compiled with the following
-popular recipe:
-
- $ ./configure
- $ make
- $ make install
-
-If you want to modify the sources or if you have checked out the
-sources from a development branch, please read the following little
-survival guide:
-
-In general, recompiling ContextKit after touching a source file might
-require some tools that are not needed when just compiling a freshly
-unpacked release. Those tools might or might not be available (yet)
-in your distribution of choice.
-
-Specifically, many tools are not available in Maemo. Thus, the
-recommended way to work on the sources is to hack outside of Maemo,
-make a release there, and compile that release inside Maemo.
-
-The following procedure should work quite nicely.
-
-Bootstrap the buildsystem after checking out a source tree from Git.
-Do this outside of Maemo, in Debian or Ubuntu.
-
- $ ./autogen.sh
-
-This will check for all the maintainer tools that are needed. Install
-them until ./autogen.sh is happy.
-
- $ ./configure --enable-gtk-doc
- $ make
- $ make dist
-
-These steps build the source tree and get it into a shape where a
-release can be made.
-
-Now switch to Maemo and chdir back into the same source tree.
-
- $ make distclean
- $ ./configure --prefix /usr
- $ make
- $ make install
-
-This will recompile the target specific parts but will not regenerate
-files that are normally in a release tarball.
-
-Of course, you can stay inside Maemo until you make a change that
-causes make to run some unavailable tool. At that point, switch back
-to outside of Maemo and run "make dist" there.
diff --git a/MAINTAINERS b/MAINTAINERS
deleted file mode 100644
index 1ee6f642..00000000
--- a/MAINTAINERS
+++ /dev/null
@@ -1,2 +0,0 @@
-Marius Vollmer
-E-mail: marius.vollmer@nokia.com
diff --git a/Makefile.am b/Makefile.am
index f37e1164..eef40d2b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,32 +1 @@
-DISTCHECK_CONFIGURE_FLAGS = --disable-doc --disable-coverage
-
-AUTOMAKE_OPTIONS = subdir-objects
-ACLOCAL_AMFLAGS = -I m4
-
-SUBDIRS = \
- libcontextprovider \
- libcontextsubscriber \
- spec \
- doc \
- python \
- tools \
- common
-
-DISTCLEANFILES = lcov.info lcov.html
-MAINTAINERCLEANFILES = INSTALL
-
-check-sum:
- $(MAKE) -C libcontextprovider/unit-tests check-sum
- $(MAKE) -C libcontextsubscriber/unit-tests check-sum
-
-check-customer:
- $(MAKE) -C libcontextprovider/customer-tests check-customer
- $(MAKE) -C libcontextsubscriber/customer-tests check-customer
-
-coverage: covoptioncheck
- $(MAKE) -C libcontextsubscriber coverage \
- && $(MAKE) -C libcontextprovider coverage
-
-.PHONY: coverage check-customer check-sum
-
-include $(top_srcdir)/am/covoptioncheck.am
+SUBDIRS = loadmem
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 00000000..85ad67a0
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,527 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = tools
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
+ $(top_srcdir)/m4/ax_version_tools.m4 \
+ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+ASCIIDOC = @ASCIIDOC@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CDB_LIBS = @CDB_LIBS@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DBUS_CFLAGS = @DBUS_CFLAGS@
+DBUS_LIBS = @DBUS_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOT = @DOT@
+DOXYGEN = @DOXYGEN@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GCOV = @GCOV@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
+GREP = @GREP@
+HTML_DIR = @HTML_DIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LCOV = @LCOV@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MOC = @MOC@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+QtCore_CFLAGS = @QtCore_CFLAGS@
+QtCore_LIBS = @QtCore_LIBS@
+QtDBus_CFLAGS = @QtDBus_CFLAGS@
+QtDBus_LIBS = @QtDBus_LIBS@
+QtTest_CFLAGS = @QtTest_CFLAGS@
+QtTest_LIBS = @QtTest_LIBS@
+QtXml_CFLAGS = @QtXml_CFLAGS@
+QtXml_LIBS = @QtXml_LIBS@
+RANLIB = @RANLIB@
+RCC = @RCC@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SOURCE_HIGHLIGHT = @SOURCE_HIGHLIGHT@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XMLLINT = @XMLLINT@
+XSLTPROC = @XSLTPROC@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = loadmem
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign tools/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-ps: install-ps-recursive
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+ install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am check check-am clean clean-generic clean-libtool \
+ ctags ctags-recursive distclean distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/NEWS b/NEWS
deleted file mode 100644
index 49ac9de5..00000000
--- a/NEWS
+++ /dev/null
@@ -1 +0,0 @@
-See debian/changelog for news.
diff --git a/README b/README
deleted file mode 100644
index bbab2038..00000000
--- a/README
+++ /dev/null
@@ -1,16 +0,0 @@
-This is ContextKit, a framework for collecting contextual
-information from the bowels of the system, cleaning them up
-and offering them through a simple API.
-
-The ContextKit consists of:
-
-- libcontextprovider, a convenience library to export
- contextual properties to the rest of the system.
-
-- user documentation including a list of standard context properties
-
-- contextd, daemon for combining and refining contextual information
-
-- libcontextsubscriber, a library implementing
- the simple API for accessing the contextual information.
-
diff --git a/am/covoptioncheck.am b/am/covoptioncheck.am
deleted file mode 100644
index 8f61fa06..00000000
--- a/am/covoptioncheck.am
+++ /dev/null
@@ -1,10 +0,0 @@
-if CONTEXTKIT_COVERAGE
-covoptioncheck: # ok, we have coverage
-else
-covoptioncheck:
- @echo "The project has not been configured for coverage, check that you have gcov, lcov."
- @echo "Of course, do not use --disable-coverage"
- @exit 1
-endif
-
-.PHONY: covoptioncheck
diff --git a/am/qt.am b/am/qt.am
deleted file mode 100644
index b5a2453b..00000000
--- a/am/qt.am
+++ /dev/null
@@ -1,35 +0,0 @@
-## Basic idea from here: http://blog.hartwork.org/?p=133
-## If you want to do the qt moccing for your header files and link them
-## to your executable:
-# nodist_yourtarget_SOURCES = mocs.cpp
-# QT_TOMOC = $(filter %.h, $(yourtarget_SOURCES))
-# ^^^^ or you can use explicit header file listing here
-# include $(top_srcdir)/am/qt.am
-
-## If you have a .cpp file, which you want to moc, you have to use an
-## explicit dependency like this:
-# main.o: main.moc
-## and of course you have to put #include "main.moc" at the end of
-## main.cpp.
-## Declaring the cpp file in QT_TOMOC is not needed.
-
-QT_MOCS = $(QT_TOMOC:%.h=moc_%_h.cpp)
-
-# mocs.cpp depends on Makefile so that it is also regenerated when an
-# entry is removed from QT_MOCS.
-
-mocs.cpp: $(QT_MOCS) Makefile
- cat $(QT_MOCS) >mocs.cpp
-
-moc_%_h.cpp: %.h
- $(MOC) -o "$@" "$<"
-
-%.moc: %.cpp
- $(MOC) -o "$@" "$<"
-
-clean-moc-extra:
- rm -f moc_*.cpp mocs.cpp *.moc mocs.lo
-
-clean-local: clean-moc-extra
-
-.PHONY: clean-moc-extra
diff --git a/am/tests.am b/am/tests.am
deleted file mode 100644
index 26c3ca26..00000000
--- a/am/tests.am
+++ /dev/null
@@ -1,63 +0,0 @@
-# run every binary
-TESTS = $(check_PROGRAMS)
-
-if CONTEXTKIT_COVERAGE
-COV_CXXFLAGS=-ftest-coverage -fprofile-arcs -fno-elide-constructors
-COV_LIBS=-lgcov
-else
-COV_CXXFLAGS=
-COV_LIBS=
-endif
-
-# include header files from source as a last resource and use QTest, coverage
-AM_CXXFLAGS += $(QtTest_CFLAGS) $(COV_CXXFLAGS) -I$(top_srcdir)/common
-
-AM_LDFLAGS += $(QtTest_LIBS) $(COV_LIBS)
-
-# We need to put $(FROM_SOURCE) into BUILT_SOURCES so that header
-# files are copied before they are needed.
-BUILT_SOURCES = $(FROM_SOURCE)
-
-# recompile every file %.cpp in FROM_SOURCE as src_%.o in the current
-# test directory (so the mock objects don't have to be ABI compatible)
-$(FROM_SOURCE): %: $(FROM_SOURCE_DIR)/%
- ln -sf $< $@
-
-check_LIBRARIES = libsrc.a # library built from files in the real source
-nodist_libsrc_a_SOURCES = $(FROM_SOURCE)
-LDADD += $(check_LIBRARIES) $(top_builddir)/common/libcommon.la # add it to the linking
-
-# tests should be always debuggable, can't use AM_CXXFLAGS, because
-# that is too early
-CXXFLAGS += -O0 -g
-
-covdircheck:
- @if test "$(COVERAGE_FILES)" = "" ; then \
- echo "The directory hasn't been configured for coverage, please add COVERAGE_FILES variable to Makefile.am"; \
- exit 2; \
- fi
-
-SELECTED_FOR_COVERAGE = $(patsubst %.cpp, '*/unit-tests/*/%.cpp', $(COVERAGE_FILES))
-coverage: covoptioncheck covdircheck check
- @echo "building coverage"
- mkdir -p coverage
- lcov --directory . --capture --output-file coverage/all.cov
- lcov --extract coverage/all.cov $(SELECTED_FOR_COVERAGE) --output-file coverage/selected.cov
- lcov --extract coverage/all.cov '*/unit-tests/*/*.cpp' --output-file coverage/src.cov
- genhtml -o coverage/ coverage/src.cov
-
-clean-local:
- rm -rf coverage *.gcno *.gcda *.gcov $(FROM_SOURCE)
-
-# in maintainer mode, compile everything at make time, not at make check time
-all-am:
- if test "$(USE_MAINTAINER_MODE)" = yes; then \
- $(MAKE) $(AM_MAKEFLAGS) $(check_LIBRARIES) $(check_PROGRAMS); \
- fi
-
-$(top_builddir)/common/libcommon.la:
- $(MAKE) -C $(top_builddir)/common libcommon.la
-
-.PHONY: coverage covdircheck $(top_builddir)/common/libcommon.la
-
-include $(top_srcdir)/am/covoptioncheck.am
diff --git a/autoclean.sh b/autoclean.sh
deleted file mode 100755
index 37bee8a8..00000000
--- a/autoclean.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh -e
-
-cd $(dirname $0)
-
-make maintainer-clean || true
-echo Cleaning autotools files...
-find -type d -name autom4te.cache -print0 | xargs -0 rm -rf \;
-find -type f \( -name missing -o -name install-sh -o -name mkinstalldirs \
- -o -name depcomp -o -name ltmain.sh -o -name configure \
- -o -name config.sub -o -name config.guess -o -name aclocal.m4 \
- -o -name Makefile.in -o -name py-compile \) -print0 | xargs -0 rm -f
-rm -f m4/lt*m4 m4/libtool.m4
-# rm -f debian-devel/control debian-devel/rules install-stamp
diff --git a/autogen.sh b/autogen.sh
deleted file mode 100755
index cba209c8..00000000
--- a/autogen.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh -e
-
-cd $(dirname $0)
-autoreconf -i -f -v
-
-# Autoreconf overwrites INSTALL, but we have our own version of it.
-cp INSTALL.real INSTALL
-
-# Libtool 2.2 still reorders LDFLAGS badly, and they won't fix it before libtool 2.3 or 2.4
-# but we can leave without this
-if cat ltmain.sh.as-needed.patch | patch -t -p0 --dry-run
-then
- cat ltmain.sh.as-needed.patch | patch -t -p0
-fi
-
-run_configure=true
-for arg in $*; do
- case $arg in
- --no-configure)
- run_configure=false
- ;;
- *)
- ;;
- esac
-done
-
-if test $run_configure = true; then
- ./configure "$@"
-fi
-
diff --git a/common/Makefile.am b/common/Makefile.am
deleted file mode 100644
index 1e6ec507..00000000
--- a/common/Makefile.am
+++ /dev/null
@@ -1,5 +0,0 @@
-noinst_LTLIBRARIES=libcommon.la
-libcommon_la_SOURCES = logging.cpp logging.h sconnect.h
-
-AM_CXXFLAGS = $(QtCore_CFLAGS)
-LIBS += $(QtCore_LIBS)
diff --git a/common/logging.cpp b/common/logging.cpp
deleted file mode 100644
index 72c5b0fb..00000000
--- a/common/logging.cpp
+++ /dev/null
@@ -1,421 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "logging.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <QDateTime>
-#include <QFile>
-
-/*!
- \page Logging
-
- \brief The library (and ContexKit in general) use a simple logging system designed
- to unify the output and make the debugging easier.
-
- \section API
-
- Four types of log messages (presented here in the order of importance) are supported:
- \b Test, \b Debug, \b Warning and \b Critical.
-
- The first one, the \b Test message requires some attention. It's meant to be used
- from tests and unit-tests to log various stages of the test execution. It'll make
- the test output more easily filterable.
-
- The log messages can be used like this:
-
- \code
- contextTest() << "This is some message";
- contextDebug() << "My value is:" << someVariable;
- contextWarning() << "Expecting key:" << something.getKey();
- contextCritical() << 5 << "is bigger than" << 4;
- \endcode
-
- Notice that the logging framework (very much like ie \b qDebug) automatically
- ads whitespace. So:
-
- \code
- contextDebug() << "My value is" << 5 << "and should be 5";
- \endcode
-
- ...will actually print:
-
- \code
- My value is 5 and should be 5
- \endcode
-
- \section compilecontrol Compile-time verbosity control
-
- During the compile time certain defines can be used to turn-off debug messages.
- Those defines are:
-
- \code
- CONTEXT_LOG_HIDE_TEST
- CONTEXT_LOG_HIDE_DEBUG
- CONTEXT_LOG_HIDE_WARNING
- CONTEXT_LOG_HIDE_CRITICAL
- \endcode
-
- A given define makes a respective macro message evaluate to an empty code. To be precise:
- it makes the macro message evaluate to an inline do-nothing class that is optimized by the
- compiler to do nothing.
-
- When ie. \c CONTEXT_LOG_HIDE_DEBUG define is used to turn off \c contextDebug()
- messages, the actual string content of the debug messages is \b not included in the binary
- and during runtime the machine does not spend time evaluating it.
-
- Those compile-time control defines are integrated in the build/configure system.
-
- \section runtimecontrol Run-time verbosity control
-
- During run-time, the amount of debugging can be limited (filtered) but it can't be increased
- (expanded). In other words, if a package was compiled with warnings-only, it's not possible
- to make it show debug messages at runtime. But it is possible to make it criticals-only.
-
- The filtering happens via env variables. The major player is the \c CONTEXT_LOG_VERBOSITY variable
- which can be set to \c TEST, \c DEBUG, \c WARNING and \c CRITICAL. The \c CONTEXT_LOG_VERBOSITY
- specifies the minimal level of the messages shown. Ie. \c CONTEXT_LOG_VERBOSITY set to
- \c WARNING will show only warning and criticals.
-
- The format of the output can be tweaked with \c CONTEXT_LOG_HIDE_TIMESTAMPS and \c CONTEXT_LOG_USE_COLOR.
- The first one makes the messages shorter by skipping the timestamp info. The second one adds a
- little bit of ANSI coloring to the messages.
-
- \c CONTEXT_LOG_SHOW_MODULE will filter-out (kill) all messages \b except the ones coming from the
- specified module. Ie.:
-
- \code
- CONTEXT_LOG_SHOW_MODULE="subscriber" ./some-binary
- \endcode
-
- ...will run \c ./some-binary showing log messages \b only from \c subscriber module.
-
- Lastly, \c CONTEXT_LOG_HIDE_MODULE will hide log messages coming from the specified module.
- All other messages will be show.
-
- \section modules Modules in logging
-
- In previous section we discussed and mentioned modules. For the purpose of logging,
- a module is a piece of code (not neccesarily limited to one binary or shared object) that
- forms one component (feature-wise). Specyfying and naming the modules is used
- to set the origin of the logging messages.
-
- The logging module is set using the \c CONTEXT_LOG_MODULE_NAME define. It should be
- (in most cases) defined in the build system and automatically applied to the whole source code.
- Typically (with autotools) this can be achieved with something similar too:
-
- \code
- ...
- AM_CXXFLAGS = '-DCONTEXT_LOG_MODULE_NAME="libtest"'
- ...
- \endcode
-
- If \c CONTEXT_LOG_MODULE_NAME is undefined, the log messages will be marked as coming from an
- \b "Undefined" module.
-
-
- \section features Featues
-
- It's possible also to assign logging messages to feature groups and control the output
- based on that. Features can be compared to tags - one message can belong to zero or more
- features. To add to a feature to a log message:
-
- \code
- contextDebug() << contextFeature("threads") << "Message goes here" << someVariable;
- contextDebug() << contextFeature("threads") << contextFeature("something") << "Message...";
- \endcode
-
- It doesn't matter where features are added to the message. There is no specific order required.
- The following syntax is supported as well:
-
- \code
- contextDebug() << contextFeature("threads") << "Some message..." << contextFeature("another");
- \endcode
-
- There are two enviornment variables that control the output of messages vs. features: \b
- CONTEXT_LOG_SHOW_FEATURES and \b CONTEXT_LOG_HIDE_FEATURES. Both take a comma-separated
- list of features.
-
- If you specify CONTEXT_LOG_SHOW_FEATURES only messages with given features will be printed to
- the screen. If you specify \b CONTEXT_LOG_HIDE_FEATURES, messages with the specified features
- will be hidden (not displayed). For example:
-
- \code
- CONTEXT_LOG_SHOW_FEATURES="threads,util" ./some-binary
- \endcode
-
- ...will make \b only the messages belonging to "threads" or "util" features displayed.
-
- \code
- CONTEXT_LOG_HIDE_FEATURES="threads,util" ./some-binary
- \endcode
-
- ...will hide all logging messages belonging to "threads" and "util" feature groups.
-
- \section vanilla Vanilla
-
- If the default logging output is too much for you, it's possible to set a CONTEXT_LOG_VANILLA
- enviornment variable. This will simplify the logging output greatly -- no timestamps will be printed,
- no module information will be printed, no line/function/class info will be printed.
-*/
-
-/* ContextFeature */
-
-/*!
- \class ContextFeature
-
- \brief This class represents a "feature" in the logging framework/system.
-
- A feature can be ie. "multithreading", "introspection", "dbus" or anything that makes sense
- in your setup. Using features you can later get more filtered debug output. You most likely
- want to use this class like this:
-
-
- \code
- ...
- contextDebug() << ContextFeature("introspection") << "Message";
- ...
- \endcode
-
- One message can belong to many features or to none.
-*/
-
-/// Constructor for a new feature.\a name is the feature name.
-ContextFeature::ContextFeature(QString name) : featureName(name)
-{
-}
-
-/// Returns the name of the feature.
-QString ContextFeature::getName() const
-{
- return featureName;
-}
-
-/* ContextRealLogger */
-
-/*!
- \class ContextRealLogger
-
- \brief A real logging class.
-
- This is used by the actual macros to print messages.
-*/
-
-bool ContextRealLogger::showTest = true;
-bool ContextRealLogger::showDebug = true;
-bool ContextRealLogger::showWarning = true;
-bool ContextRealLogger::showCritical = true;
-bool ContextRealLogger::hideTimestamps = false;
-bool ContextRealLogger::useColor = false;
-char* ContextRealLogger::showModule = NULL;
-char* ContextRealLogger::hideModule = NULL;
-bool ContextRealLogger::initialized = false;
-bool ContextRealLogger::vanilla = false;
-QStringList ContextRealLogger::showFeatures = QStringList();
-QStringList ContextRealLogger::hideFeatures = QStringList();
-
-/// Initialize the class by checking the enviornment variables and setting
-/// the message output params. The log level is set from \c CONTEXT_LOG_VERBOSITY
-/// and from this env var the showTest, showDebug, showWarning... are set. By default
-/// everything is displayed at runtime. It's also possible to not show timestamps in
-/// messages and spice-up the output with some color.
-void ContextRealLogger::initialize()
-{
- if (getenv("CONTEXT_LOG_HIDE_TIMESTAMPS") != NULL)
- hideTimestamps = true;
-
- if (getenv("CONTEXT_LOG_USE_COLOR") != NULL)
- useColor = true;
-
- // Check feature enablers (showFeatures)
- const char *showFeaturesStr = getenv("CONTEXT_LOG_SHOW_FEATURES");
- if (showFeaturesStr) {
- foreach (QString f, QString(showFeaturesStr).split(','))
- showFeatures << f.trimmed();
- }
-
- // Check feature hide (hideFeatures)
- const char *hideFeaturesStr = getenv("CONTEXT_LOG_HIDE_FEATURES");
- if (hideFeaturesStr) {
- foreach (QString f, QString(hideFeaturesStr).split(','))
- hideFeatures << f.trimmed();
- }
-
- // Show/hide given module
- showModule = getenv("CONTEXT_LOG_SHOW_MODULE");
- hideModule = getenv("CONTEXT_LOG_HIDE_MODULE");
-
- // Vanilla
- if (getenv("CONTEXT_LOG_VANILLA"))
- vanilla = true;
-
- // Check and do verbosity
- const char *verbosity = getenv("CONTEXT_LOG_VERBOSITY");
- if (! verbosity)
- verbosity = "WARNING";
-
- if (strcmp(verbosity, "TEST") == 0) {
- // Do nothing, all left true
- } else if (strcmp(verbosity, "DEBUG") == 0) {
- showTest = false;
- } else if (strcmp(verbosity, "WARNING") == 0) {
- showTest = false;
- showDebug = false;
- } else if (strcmp(verbosity, "CRITICAL") == 0) {
- showTest = false;
- showDebug = false;
- showWarning = false;
- } else if (strcmp(verbosity, "NONE") == 0) {
- showDebug = false;
- showTest = false;
- showDebug = false;
- showWarning = false;
- }
-
- initialized = true;
-}
-
-/// Constructor. Called by the macros. \a func is the function name, \a file is
-/// is the current source file and \a line specifies the line number.
-ContextRealLogger::ContextRealLogger(int type, const char *module, const char *func, const char *file, int line)
- : QTextStream(), msgType(type), moduleName(module)
-{
- if (! initialized) {
- // This is not thread safe, but our initialization depends on
- // non-mutable parts anyways, so we should be ok.
- initialize();
- }
-
- setString(&data);
-
- // Add timestamp
- if (! hideTimestamps && ! vanilla)
- *this << QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss").toLocal8Bit().data();
-
- // Module name
- if (! vanilla)
- *this << QString("[" + QString(module) + "]").toLocal8Bit().data();
-
- // Message name
- switch(type) {
- case CONTEXT_LOG_MSG_TYPE_DEBUG:
- if (! vanilla)
- *this << "DEBUG";
- break;
- case CONTEXT_LOG_MSG_TYPE_WARNING:
- *this << ((useColor) ? "\033[103mWARNING\033[0m" : "WARNING");
- break;
- case CONTEXT_LOG_MSG_TYPE_CRITICAL:
- *this << ((useColor) ? "\033[101mCRITICAL\033[0m" : "CRITICAL");
- break;
- case CONTEXT_LOG_MSG_TYPE_TEST:
- *this << "TEST";
- break;
- default:
- *this << "UNKNOWN";
- break;
- }
-
- // File, line and function...
-
- if (! vanilla)
- *this << QString("[" + QString(file) + ":" + QString::number(line) + ":" + QString(func) + "]").toLocal8Bit().data();
-}
-
-bool ContextRealLogger::shouldPrint()
-{
- // First try to eliminated based on message type...
- if (msgType == CONTEXT_LOG_MSG_TYPE_DEBUG && ! showDebug)
- return false;
- else if (msgType == CONTEXT_LOG_MSG_TYPE_WARNING && ! showWarning)
- return false;
- else if (msgType == CONTEXT_LOG_MSG_TYPE_TEST && ! showTest)
- return false;
- else if (msgType == CONTEXT_LOG_MSG_TYPE_CRITICAL && ! showCritical)
- return false;
-
- // Now try to eliminate based on module name...
- if (showModule && strcmp(showModule, moduleName) != 0)
- return false;
-
- if (hideModule && strcmp(hideModule, moduleName) == 0)
- return false;
-
- // Now try to eliminate by feature name
- foreach(QString feature, features) {
- if (hideFeatures.contains(feature))
- return false;
- }
-
- if (showFeatures.length() > 0) {
- foreach(QString feature, showFeatures) {
- if (features.contains(feature))
- return true;
- }
- return false;
- }
-
- return true;
-}
-
-/// Append (print) all the features, separated with commas and wrapped in brackets.
-void ContextRealLogger::appendFeatures()
-{
- if (features.length() == 0)
- return;
-
- QTextStream::operator<<('[');
- int i;
-
- for (i = 0; i < features.length(); i++) {
- QTextStream::operator<<(QString("#" + features.at(i)));
- if (i < features.length() - 1)
- QTextStream::operator<<(", ");
- }
-
- QTextStream::operator<<(']');
-}
-
-/// Operator for appending features.
-ContextRealLogger& ContextRealLogger::operator<< (const ContextFeature &f)
-{
- features << f.getName();
- return *this;
-}
-
-/// Destructor, prints \b end-of-line before going down.
-ContextRealLogger::~ContextRealLogger()
-{
- if (shouldPrint()) {
- // The Trolls set STDERR to O_NONBLOCK, but ignores the EAGAIN
- // from write, so if your machine is heavily loaded and the
- // terminal can't keep up with our log messages you start to
- // lose them. Hack: just set STDERR to block before every
- // debug message.
- fcntl(STDERR_FILENO, F_SETFL, O_WRONLY);
- appendFeatures();
- QTextStream::operator<<('\n');
- QTextStream(stderr) << data;
- }
-
- setDevice(NULL);
-}
diff --git a/common/logging.h b/common/logging.h
deleted file mode 100644
index 23be7b15..00000000
--- a/common/logging.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef LOGGING_H
-#define LOGGING_H
-
-#include <QIODevice>
-#include <QString>
-#include <QStringList>
-#include <QTextStream>
-#include <QBuffer>
-#include <QDebug>
-
-#define CONTEXT_LOG_MSG_TYPE_TEST 1
-#define CONTEXT_LOG_MSG_TYPE_DEBUG 2
-#define CONTEXT_LOG_MSG_TYPE_WARNING 3
-#define CONTEXT_LOG_MSG_TYPE_CRITICAL 4
-
-#ifndef CONTEXT_LOG_MODULE_NAME
-#define CONTEXT_LOG_MODULE_NAME "unknown"
-#endif
-
-class ContextFeature
-{
-public:
- ContextFeature(QString name);
- QString getName() const;
-
-private:
- QString featureName;
-};
-
-class ContextRealLogger : public QTextStream
-{
-public:
- ContextRealLogger(int msgType, const char *module, const char *func, const char *file, int line);
- ~ContextRealLogger();
-
- static bool showTest; ///< Test messages enabled at runtime
- static bool showDebug; ///< Debug messages enabled at runtime
- static bool showWarning; ///< Warning messages enabled at runtime
- static bool showCritical; ///< Critical messages enabled at runtime
- static bool initialized; ///< Class initialized/env vars parsed
- static bool hideTimestamps; ///< Don't print timestamps
- static bool useColor; ///< Use simple colors for output (yellow for warnings, red for criticals)
- static char *showModule; ///< Show messages \b only from the specified module
- static char *hideModule; ///< Hide messages from the specified module
- static QStringList showFeatures; ///< Show messages with \b only the specified features
- static QStringList hideFeatures; ///< Hide messages with the specified features
- static bool vanilla; ///< Use vanilla (stripped-down) logging
-
- static void initialize();
-
- ContextRealLogger &operator<< (const ContextFeature&);
-
-// ContextRealLogger &operator<< (const char *str);
-
- template <typename T> ContextRealLogger &operator<< (const T& qSomething)
- {
- QString out;
- QDebug(&out) << qSomething;
- QTextStream::operator<<(out);
- return *this;
- }
-
-private:
-
- bool shouldPrint();
- void appendFeatures();
-
- int msgType; ///< Type of message we're representing.
- const char* moduleName; ///< The module name.
- QString data; ///< Holds the stream data.
- QStringList features;
-};
-
-/*!
- \class ContextZeroLogger
-
- \brief A fake logging class.
-
- When a certain debug message is disabled at a compile-time the debug macros expand to
- this class. It has all functions declared as \b inline and fundamentally kills all input
- targeted at it. The compiler optimizes the \b inline by not calling the functions at all and
- not storing the strings at all.
-*/
-
-class ContextZeroLogger
-{
-public:
- /// Constructor. Does nothing.
- inline ContextZeroLogger() {}
-
- /* Stubby ops */
- template <typename T> inline ContextZeroLogger &operator<< (const T&) { return *this;} ///< Does nothing.
-};
-
-/* Macro defs */
-
-#define contextFeature(name) (ContextFeature(name))
-
-#ifdef CONTEXT_LOG_HIDE_TEST
-#define contextTest() (ContextZeroLogger())
-#else
-#define contextTest() (ContextRealLogger(CONTEXT_LOG_MSG_TYPE_TEST, CONTEXT_LOG_MODULE_NAME, __PRETTY_FUNCTION__, __FILE__, __LINE__))
-#endif
-
-#ifdef CONTEXT_LOG_HIDE_DEBUG
-#define contextDebug() (ContextZeroLogger())
-#else
-#define contextDebug() (ContextRealLogger(CONTEXT_LOG_MSG_TYPE_DEBUG, CONTEXT_LOG_MODULE_NAME, __PRETTY_FUNCTION__, __FILE__, __LINE__))
-#endif
-
-#ifdef CONTEXT_LOG_HIDE_WARNING
-#define contextWarning() (ContextZeroLogger())
-#else
-#define contextWarning() (ContextRealLogger(CONTEXT_LOG_MSG_TYPE_WARNING, CONTEXT_LOG_MODULE_NAME, __PRETTY_FUNCTION__, __FILE__, __LINE__))
-#endif
-
-#ifdef CONTEXT_LOG_HIDE_CRITICAL
-#define contextCritical() (ContextZeroLogger())
-#else
-#define contextCritical() (ContextRealLogger(CONTEXT_LOG_MSG_TYPE_CRITICAL, CONTEXT_LOG_MODULE_NAME, __PRETTY_FUNCTION__, __FILE__, __LINE__))
-#endif
-
-#endif // LOGGING_H
diff --git a/common/sconnect.h b/common/sconnect.h
deleted file mode 100644
index 3743e9b2..00000000
--- a/common/sconnect.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef SCONNECT_H
-#define SCONNECT_H
-
-#include <QObject>
-#include <QDebug>
-
-inline void sconnect(const QObject *from, const char* fromSignal,
- const QObject *to, const char* toSignal, Qt::ConnectionType type = Qt::AutoConnection)
-{
- if (!QObject::connect(from, fromSignal, to, toSignal, type))
- qFatal(" *****************\n"
- "Connect returned false, aborting, enable core dumping (ulimit -c unlimited), \n"
- "enable debug (qmake CONFIG+=debug), recompile, rerun and then use the\n"
- "core file with gdb's backtrace to see the location.\n"
- " *****************\n");
-}
-
-#endif
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index 96c9c83f..00000000
--- a/configure.ac
+++ /dev/null
@@ -1,127 +0,0 @@
-AC_PREREQ([2.61])
-AC_INIT([ContextKit], [0.3.11~unreleased], [marius.vollmer@nokia.com], ContextKit)
-
-AC_CONFIG_SRCDIR([Makefile.am])
-AM_INIT_AUTOMAKE([-Wall -Werror foreign dist-bzip2 tar-ustar 1.9])
-
-AC_CONFIG_MACRO_DIR([m4])
-
-AC_PROG_CC
-CFLAGS="$CXXFLAGS -Wall"
-AC_PROG_CXX
-CXXFLAGS="$CXXFLAGS -Wall"
-AC_PROG_LIBTOOL
-AM_PATH_PYTHON
-
-# check for libraries
-PKG_CHECK_MODULES_SUBST([QtTest], [QtTest])
-PKG_CHECK_MODULES_SUBST([QtCore], [QtCore])
-PKG_CHECK_MODULES_SUBST([QtDBus], [QtDBus])
-PKG_CHECK_MODULES_SUBST([QtXml], [QtXml])
-# only for compiling c code
-PKG_CHECK_MODULES_SUBST([DBUS], [dbus-1])
-PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.12.0])
-
-AC_PROG_QT_MOC
-AC_PROG_QT_UIC
-AC_PROG_QT_RCC
-AC_CHECK_LIB([cdb], [cdb_make_start], [CDB_LIBS=-lcdb], [AC_MSG_ERROR([Can't find cdb library])])
-AC_SUBST([CDB_LIBS])
-
-# tools for documentation
-AX_FEATURE_DISABLEABLE([doc], [BUILD_DOCS], [disable building of documentation])
-AC_MSG_CHECKING([for gtk-doc])
-PKG_CHECK_EXISTS([gtk-doc >= 1.9],[AC_MSG_RESULT([yes])],
- [AC_MSG_RESULT([no])
- missing_deps_BUILD_DOCS="$missing_deps_BUILD_DOCS, gtk-doc >= 1.9"])
-HTML_DIR="${datadir}/gtk-doc/html"
-AC_SUBST([HTML_DIR])
-AX_DISABLE_FEATURE_ON_PROG([Dot drawing tool], [BUILD_DOCS], [DOT], [dot])
-AX_DISABLE_FEATURE_ON_PROG([Asciidoc], [BUILD_DOCS], [ASCIIDOC], [asciidoc], [8.2.7])
-AX_DISABLE_FEATURE_ON_PROG([source-highlight], [BUILD_DOCS], [SOURCE_HIGHLIGHT], [source-highlight])
-AX_DISABLE_FEATURE_ON_PROG([xsltproc], [BUILD_DOCS], [XSLTPROC], [xsltproc])
-AX_DISABLE_FEATURE_ON_PROG([xmllint], [BUILD_DOCS], [XMLLINT], [xmllint])
-AX_DISABLE_FEATURE_ON_PROG([doxygen], [BUILD_DOCS], [DOXYGEN], [doxygen])
-AM_CONDITIONAL([CONTEXTKIT_BUILD_DOCS], [test "$missing_deps_BUILD_DOCS" = ""])
-AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test "$missing_deps_BUILD_DOCS" = ""])
-AM_CONDITIONAL([ENABLE_GTK_DOC], [test "$missing_deps_BUILD_DOCS" = ""])
-
-# coverage tools
-AX_FEATURE_DISABLEABLE([coverage], [COVERAGE], [disable unittests' coverage support])
-AX_DISABLE_FEATURE_ON_PROG([GCov coverage recording tool], [COVERAGE], [GCOV], [gcov])
-AX_DISABLE_FEATURE_ON_PROG([LCov coverage visualization tool], [COVERAGE], [LCOV], [lcov])
-AM_CONDITIONAL([CONTEXTKIT_COVERAGE], [test "$missing_deps_COVERAGE" = ""])
-
-AC_CONFIG_FILES([
- Makefile
- doc/Makefile
- common/Makefile
- libcontextsubscriber/Makefile
- libcontextsubscriber/cli/Makefile
- libcontextsubscriber/cls/Makefile
- libcontextsubscriber/contextsubscriber-1.0.pc
- libcontextsubscriber/customer-tests/Makefile
- libcontextsubscriber/customer-tests/update-contextkit-providers/Makefile
- libcontextsubscriber/customer-tests/testplugins/Makefile
- libcontextsubscriber/customer-tests/testplugins/timeplugin1/Makefile
- libcontextsubscriber/customer-tests/testplugins/timeplugin2/Makefile
- libcontextsubscriber/customer-tests/forward-compatible/Makefile
- libcontextsubscriber/doc/Makefile
- libcontextsubscriber/man/Makefile
- libcontextsubscriber/src/Makefile
- libcontextsubscriber/unit-tests/Makefile
- libcontextsubscriber/unit-tests/cdb/Makefile
- libcontextsubscriber/unit-tests/infoxmlbackend/Makefile
- libcontextsubscriber/unit-tests/infocdbbackend/Makefile
- libcontextsubscriber/unit-tests/contextregistryinfo/Makefile
- libcontextsubscriber/unit-tests/contextpropertyinfo/Makefile
- libcontextsubscriber/unit-tests/infobackend/Makefile
- libcontextsubscriber/unit-tests/handlesignalrouter/Makefile
- libcontextsubscriber/unit-tests/propertyhandle/Makefile
- libcontextsubscriber/unit-tests/provider/Makefile
- libcontextsubscriber/unit-tests/util/Makefile
- libcontextsubscriber/unit-tests/nanoxml/Makefile
- libcontextsubscriber/multithreading-tests/Makefile
- libcontextsubscriber/multithreading-tests/new-property-in-thread/Makefile
- libcontextsubscriber/multithreading-tests/old-property-in-thread/Makefile
- libcontextsubscriber/multithreading-tests/single-thread/Makefile
- libcontextsubscriber/multithreading-tests/stress-test/Makefile
- libcontextsubscriber/multithreading-tests/using-backend-from-thread/Makefile
- libcontextsubscriber/multithreading-tests/wait-for-subscription-only-in-thread/Makefile
- libcontextsubscriber/multithreading-tests/wait-for-subscription-thread/Makefile
- libcontextsubscriber/update-contextkit-providers/Makefile
- libcontextprovider/contextprovider-1.0.pc
- libcontextprovider/Makefile
- libcontextprovider/doc/Makefile
- libcontextprovider/src/Makefile
- libcontextprovider/context-provide/Makefile
- libcontextprovider/man/Makefile
- libcontextprovider/unit-tests/Makefile
- libcontextprovider/unit-tests/manager/Makefile
- libcontextprovider/unit-tests/subscriber/Makefile
- libcontextprovider/unit-tests/contextgroup/Makefile
- libcontextprovider/unit-tests/property/Makefile
- libcontextprovider/unit-tests/contextc/Makefile
- libcontextprovider/unit-tests/service/Makefile
- libcontextprovider/unit-tests/servicebackend/Makefile
- libcontextprovider/customer-tests/Makefile
- libcontextprovider/customer-tests/subscription/Makefile
- libcontextprovider/customer-tests/client/Makefile
- libcontextprovider/customer-tests/value-changes/Makefile
- libcontextprovider/customer-tests/types/Makefile
- libcontextprovider/customer-tests/c-api/Makefile
- python/Makefile
- spec/Makefile
- tools/Makefile
- tools/loadmem/Makefile
-])
-
-AC_OUTPUT
-
-AX_FEATURE_SUMMARIZE([BUILD_DOCS],
- [Building of documentation is enabled],
- [Documentation won't be built])
-
-AX_FEATURE_SUMMARIZE([COVERAGE],
- [Unit testing coverage support is enabled],
- [Coverage won't be supported during unit testing])
diff --git a/debian/.gitignore b/debian/.gitignore
deleted file mode 100644
index 6ddad661..00000000
--- a/debian/.gitignore
+++ /dev/null
@@ -1,28 +0,0 @@
-contextkit-dbg
-contextkit-doc
-contextkit
-contextd-tests
-fake-context-provider
-libcontextprovider-dev
-libcontextprovider-doc
-libcontextprovider0
-libcontextprovider0-dbg
-python-contextkit
-tmp
-*.debhelper.log
-*.debhelper.log
-*.debhelper.log
-files
-contextkit.substvars
-*.postinst.debhelper
-*.postrm.debhelper
-*.prerm.debhelper
-*.preinst.debhelper
-*.substvars
-contextkit-utils/
-libcontextsubscriber-tests/
-libcontextprovider-tests/
-libcontextsubscriber-dev/
-libcontextsubscriber0-dbg/
-libcontextsubscriber-doc/
-libcontextsubscriber0/
diff --git a/debian/changelog b/debian/changelog
deleted file mode 100644
index abdb4e99..00000000
--- a/debian/changelog
+++ /dev/null
@@ -1,400 +0,0 @@
-contextkit (0.3.11~unreleased) unstable; urgency=low
-
- * Subscriber part of libcontextsubscriber now supports multiple
- providers for one property
- *
-
- -- Marja Hassinen <ext-marja.2.hassinen@nokia.com> Tue, 15 Oct 2009 16:25:04 +0300
-
-contextkit (0.3.10) unstable; urgency=low
-
- * Introspection part of libcontextsubscriber now supports multiple
- providers for one property.
- * New tool: context-ls for listing available context properties.
-
- Implemented: CntFr-324, CntFr-318, CntFr-343
-
- -- Marja Hassinen <ext-marja.2.hassinen@nokia.com> Tue, 15 Oct 2009 16:25:04 +0300
-
-contextkit (0.3.9) unstable; urgency=low
-
- * Parsing provider declarations with a nano dom parser which recognizes complex types.
- * Removed complex types from core.context, since they're not
- supported yet.
-
- Implemented: CntFr-337, CntFr-203
-
- -- Marja Hassinen <ext-marja.2.hassinen@nokia.com> Tue, 06 Oct 2009 15:00:00 +0300
-
-contextkit (0.3.8) unstable; urgency=low
-
- * libcontextsubscriber-tests lintian errors fixed.
- * Rewrote context-provide in C++, the UI has been changed, see
- context-provide-v2(1).
- * New package libcontextprovider-tests added, containing customer tests
- of the libcontextprovider.
-
- Implemented: CntFr-323
-
- -- Gergely Risko <gergely+context@risko.hu> Mon, 05 Oct 2009 09:02:50 +0300
-
-contextkit (0.3.7) unstable; urgency=low
-
- * Added a const promise to context_provider_install_group's first
- parameter in libcontextprovider C API.
- * Added cltool.py to python-contextkit, this is a tool for test writers,
- to make it easier to communicate with context-listen from python
- scripts.
- * Refactorings in libcontextprovider Qt API, should get rid of some race
- conditions; setConnection in Service is deprecated.
- * libcontextsubscriber's pkg-config file has been fixed, private
- libraries are in Requires.private now.
- * Lintian fixes, and a lintian override for libcontextsubscriber-tests
- * Maemo CI support
- * Fixes: NB#141008 - subscriber cannot subscribe to a provider if provider
- is started after subscriber
-
- -- Jean-Luc Lamadon <jean-luc.lamadon@nokia.com> Wed, 30 Sep 2009 10:29:46 +0300
-
-contextkit (0.3.6) unstable; urgency=low
-
- * Fixes: NB#140659 - waiting forever with Qt 4.6 if provider is not present
-
- -- Gergely Risko <gergely+context@risko.hu> Fri, 25 Sep 2009 11:28:56 +0300
-
-contextkit (0.3.5) unstable; urgency=low
-
- * Internal change: in the cdb we store serialized QVariants from now on.
- * Fixes: NB#119638 - debug + critical + error messages should go to
- stderr from the libcontextprovider library
- * Fixes: NB#121556 - C API of libcontextprovider uses Glib types
-
- Implemented: CntFr-305
-
- -- Gergely Risko <gergely+context@risko.hu> Mon, 22 Sep 2009 11:36:40 +0300
-
-contextkit (0.3.4) unstable; urgency=low
-
- * Added pluginchanging to distribution
-
- -- Jean-Luc Lamadon <jean-luc.lamadon@nokia.com> Fri, 18 Sep 2009 16:09:44 +0300
-
-contextkit (0.3.3) unstable; urgency=low
-
- * Fixed dependencies of libcontextsubscriber0-dbg.
- * Fixes: NB#133849 -libcontextsubscriber0 fails to upgrade in sb2.
- * Refactored libcontextsubscriber for future possibility to handle
- different protocols towards providers than the ContextKit
- D-Bus protocol.
- * Refactored libcontextprovider services to support reuse
- of the same dbus connection
-
- -- Jean-Luc Lamadon <jean-luc.lamadon@nokia.com> Thu, 17 Sep 2009 15:44:10 +0300
-
-contextkit (0.3.2) unstable; urgency=low
-
- * Fixed dependencies of libcontextprovider-dev.
-
- -- Marius Vollmer <marius.vollmer@nokia.com> Mon, 17 Aug 2009 18:58:06 +0300
-
-contextkit (0.3.1) unstable; urgency=low
-
- * Fixed Build-Dependencies.
-
- -- Marius Vollmer <marius.vollmer@nokia.com> Mon, 17 Aug 2009 16:26:04 +0300
-
-contextkit (0.3) unstable; urgency=low
-
- * Rewrote libcontextprovider in C++ and added C++ API for it. The old C
- API is still there and this version is binary and source compatible
- with previous versions.
-
- * The context daemon is in its own source package now. This makes this
- source package more platform independent, removing the Maemo specific
- bits.
-
- * Removed the fake-provider. Instead, the core property declarations
- are installed by the libcontextsubscriber package and are always
- available.
-
- If you are a provider for core properties, you now no longer need to
- include type declarations and documentation for them in your property
- declaration XML file. Just the names of the properties you provide
- are enough.
-
- * The default loggin level is now 'WARNING'. Set CONTEXT_LOG_VERBOSITY
- to 'DEBUG' if you want to see more.
-
- -- Marius Vollmer <marius.vollmer@nokia.com> Mon, 17 Aug 2009 15:35:04 +0300
-
-contextkit (0.2.12) unstable; urgency=low
-
- * Unbreak update-context-providers, it was still using
- @DEFAULT_CONTEXT_PROVIDERS@.
-
- -- Marius Vollmer <marius.vollmer@nokia.com> Mon, 20 Jul 2009 10:09:23 +0300
-
-contextkit (0.2.11) unstable; urgency=low
-
- * Include contextprovider.vapi in -dev package.
-
- -- Marius Vollmer <marius.vollmer@nokia.com> Fri, 17 Jul 2009 18:11:00 +0300
-
-contextkit (0.2.10) unstable; urgency=low
-
- * Fixes: NB#126195 - Context Commander won't start if latest
- libcontextsubscriber is installed.
-
- -- Jean-Luc Lamadon <jean-luc.lamadon@nokia.com> Fri, 03 Jul 2009 14:51:02 +0300
-
-contextkit (0.2.9) unstable; urgency=low
-
- * libcontextsubscriber is thread safe
-
- * Implemented: SWP#CntFr-231, SWP#CntFr-265
-
- -- Jean-Luc Lamadon <jean-luc.lamadon@nokia.com> Tue, 30 Jun 2009 09:09:41 +0300
-
-contextkit (0.2.8) unstable; urgency=low
-
- * lowmem plugin optimization
- * build system clean up
-
- -- Jean-Luc Lamadon <jean-luc.lamadon@nokia.com> Fri, 26 Jun 2009 15:15:04 +0300
-
-contextkit (0.2.7) unstable; urgency=low
-
- * Fixes: NB#121720 - context-provide cannot provide a False value for
- a boolean from the start
-
- * Implemented: SWP#CntFr-236, SWP#CntFr-39, SWP#CntFr-283
-
- -- Jean-Luc Lamadon <jean-luc.lamadon@nokia.com> Mon, 22 Jun 2009 08:53:56 +0300
-
-contextkit (0.2.6) unstable; urgency=low
-
- * Put some internal classes into the "ContextSubscriber" namespace so
- that they don't collide with like-named classes in libduivaluespace.
-
- (0.2.5 was never successfully released.)
-
- -- Gergely Risko <gergely+context@risko.hu> Tue, 09 Jun 2009 17:11:48 +0300
-
-contextkit (0.2.4) unstable; urgency=low
-
- * fixed the bug that libcontextsubscriber0 was not installable if no
- other components of the context framework were ever installed before
-
- -- Gergely Risko <gergely+context@risko.hu> Tue, 09 Jun 2009 17:11:48 +0300
-
-contextkit (0.2.3) unstable; urgency=low
-
- * contextd-tests package: bug fix in tests.xml
-
- -- Jean-Luc Lamadon <jean-luc.lamadon@nokia.com> Fri, 05 Jun 2009 08:24:08 +0300
-
-contextkit (0.2.2) unstable; urgency=low
-
- * Bug fixes in the fake property declarations.
- * Add System.MemoryPressure to new-style prop decls for contextd.
- * Remove fake properties that are now provided by sensord, from the
- new-style property declarations.
-
- -- Marius Vollmer <marius.vollmer@nokia.com> Thu, 04 Jun 2009 18:24:01 +0300
-
-contextkit (0.2.1) unstable; urgency=low
-
- * added lowmem plugin to contextd, which provides MemoryPressure property
-
- Implemented: SWP#CntFr-61
-
- -- Jean-Luc Lamadon <jean-luc.lamadon@nokia.com> Thu, 04 Jun 2009 14:19:39 +0300
-
-contextkit (0.2.0) unstable; urgency=low
-
- * context-provide's registry output file is now specified by
- CONTEXT_PROVIDE_REGISTRY_FILE and not CONTEXT_FLEXI_XML
- * added libcontextsubscriber{0{,-dbg},-dev,-doc}, the implementation of
- the new subscription helper library for creating context aware
- applications
-
- Implemented: SWP#CntFr-204
-
- -- Gergely Risko <gergely+context@risko.hu> Wed, 04 Jun 2009 08:40:14 +0300
-
-contextkit (0.1.10) unstable; urgency=low
-
- * Update fake-context-provider to not provide keys that are now provided
- by sensord.
-
- -- Marius Vollmer <marius.vollmer@nokia.com> Wed, 03 Jun 2009 19:07:06 +0300
-
-contextkit (0.1.9) unstable; urgency=low
-
- * context-provide's registry output file is now specified by
- CONTEXT_PROVIDE_REGISTRY_FILE and not CONTEXT_FLEXI_XML
-
- * Added new-style property declaration file to contextd, for use by the
- upcoming libcontextsubscriber.
-
- * Fixes: NB#119635 - ContextProvider library API checks it's input with
- assertions.
-
- -- Marius Vollmer <marius.vollmer@nokia.com> Mon, 01 Jun 2009 15:17:29 +0300
-
-contextkit (0.1.8) unstable; urgency=low
-
- * Added python-contextkit, which is a python binding for
- libcontextprovider and (in the future) libcontextsubscriber.
- * Added contextkit-utils, which only contains context-provide for now,
- it is a debug/test provider
-
- Implemented: SWP#CntFr-216
-
- -- Gergely Risko <gergely+context@risko.hu> Thu, 28 May 2009 11:25:27 +0300
-
-contextkit (0.1.7) unstable; urgency=low
-
- * Added the "fake provider", which just declares a lot of core
- properties but doesn't implement any of them, relying on the Context
- Commander to give them values.
-
- This provider is useful to give a pre-view to properties that are
- planned, and hopefully to gather early feedback about them.
-
- Implemented: SWP#CntFr-171.
-
- -- Marius Vollmer <marius.vollmer@nokia.com> Mon, 25 May 2009 18:44:23 +0300
-
-contextkit (0.1.6-2) unstable; urgency=low
-
- New upstream release.
-
- * contextd provides hal-based battery properties.
- * Couple of bug fixes related to properties handling
- and distributing vapi files.
-
- * Implemented: SWP#CntFr-39.
-
- -- Jean-Luc Lamadon <jean-luc.lamadon@nokia.com> Thu, 14 May 2009 07:34:05 +0300
-
-contextkit (0.1.6-1) unstable; urgency=low
-
- New upstream release.
-
- * contextd provides hal-based battery properties.
- * Couple of bug fixes related to properties handling.
-
- * Implemented: SWP#CntFr-39.
-
- -- Jean-Luc Lamadon <jean-luc.lamadon@nokia.com> Wed, 13 May 2009 19:53:34 +0300
-
-contextkit (0.1.5-1) unstable; urgency=low
-
- New upstream release.
-
- * Complete new libcontextprovider.
- * Documentation reorganized.
-
- * Implemented: SWP#CntFr-70, SWP#CntFr-68, SWP#CntFr-38,
- SWP#CntFr-8, SWP#CntFr-11, SWP#CntFr-36, SWP#CntFr-72,
- SWP#CntFr-96, SWP#CntFr-71, SWP#CntFr-80, SWP#CntFr-9,
- SWP#CntFr-10, SWP#CntFr-84, SWP#CntFr-74, SWP#CntFr-111,
- SWP#CntFr-110, SWP#CntFr-94, SWP#CntFr-137, SWP#CntFr-76,
- SWP#CntFr-7, SWP#CntFr-87, SWP#CntFr-1, SWP#CntFr-131,
- SWP#CntFr-130, SWP#CntFr-140, SWP#CntFr-135, SWP#CntFr-88,
- SWP#CntFr-132, SWP#CntFr-141, SWP#CntFr-155.
-
- -- Jean-Luc Lamadon <jean-luc.lamadon@nokia.com> Thu, 16 Apr 2009 16:48:36 +0300
-
-contextkit (0.1.3-4) unstable; urgency=low
-
- * Touch all our .vapis as well.
-
- -- Marius Vollmer <marius.vollmer@nokia.com> Wed, 25 Mar 2009 19:56:02 +0200
-
-contextkit (0.1.3-3) unstable; urgency=low
-
- * Touch all our .vala.stamps to avoid running valac during package
- building.
-
- -- Marius Vollmer <marius.vollmer@nokia.com> Wed, 25 Mar 2009 19:54:19 +0200
-
-contextkit (0.1.3-2) unstable; urgency=low
-
- * Ported bug fix from upstream: Don't crash when comparing nulls with
- non-nulls.
-
- -- Marius Vollmer <marius.vollmer@nokia.com> Wed, 25 Mar 2009 17:15:24 +0200
-
-contextkit (0.1.3-1) unstable; urgency=low
-
- New upstream release
-
- * More docs, mostly.
-
- -- Marius Vollmer <marius.vollmer@nokia.com> Tue, 24 Mar 2009 18:13:25 +0200
-
-contextkit (0.1.2-2) unstable; urgency=low
-
- * Rereleased with correctly generated buildcruft.
- * Don't use AM_MAINTAINER_MODE to avoid this in the future.
-
- -- Marius Vollmer <marius.vollmer@nokia.com> Fri, 13 Mar 2009 14:49:07 +0200
-
-contextkit (0.1.2-1) unstable; urgency=low
-
- New upstream release.
-
- * Add string support to libcontextprovider.
-
- -- Marius Vollmer <marius.vollmer@nokia.com> Thu, 12 Mar 2009 21:34:03 +0200
-
-contextkit (0.1.1-8) unstable; urgency=low
-
- * Added dbus-glib-1 to dependencies of contextprovider-1.0.
-
- -- Marius Vollmer <marius.vollmer@nokia.com> Tue, 03 Mar 2009 13:34:55 +0200
-
-contextkit (0.1.1-7) unstable; urgency=low
-
- * Forgot libdbus-1-dev, stupid.
-
- -- Marius Vollmer <marius.vollmer@nokia.com> Tue, 03 Mar 2009 12:45:37 +0200
-
-contextkit (0.1.1-6) unstable; urgency=low
-
- * Added needed dependencies to libcontextprovider-dev.
-
- -- Marius Vollmer <marius.vollmer@nokia.com> Tue, 03 Mar 2009 12:32:11 +0200
-
-contextkit (0.1.1-5) unstable; urgency=low
-
- * Don't clean docs.
-
- -- Marius Vollmer <marius.vollmer@nokia.com> Mon, 02 Mar 2009 22:48:25 +0200
-
-contextkit (0.1.1-4) unstable; urgency=low
-
- * Include docs in source distribution.
-
- -- Marius Vollmer <marius.vollmer@nokia.com> Mon, 02 Mar 2009 22:27:29 +0200
-
-contextkit (0.1.1-3) unstable; urgency=low
-
- * Don't remove files during distclean that we can't regenerate, such as
- the sources generated from Vala.
-
- -- Marius Vollmer <marius.vollmer@nokia.com> Mon, 02 Mar 2009 22:06:18 +0200
-
-contextkit (0.1.1-2) unstable; urgency=low
-
- * Don't try to build docs in debian/rules.
-
- -- Marius Vollmer <marius.vollmer@nokia.com> Mon, 02 Mar 2009 21:42:34 +0200
-
-contextkit (0.1.1-1) unstable; urgency=low
-
- * Initial release.
-
- -- Marius Vollmer <marius.vollmer@nokia.com> Wed, 07 Jan 2009 14:40:39 +0200
diff --git a/debian/compat b/debian/compat
deleted file mode 100644
index 7ed6ff82..00000000
--- a/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-5
diff --git a/debian/context-properties-doc.install b/debian/context-properties-doc.install
deleted file mode 100644
index 19e6e584..00000000
--- a/debian/context-properties-doc.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/share/maemo-doc/context-properties/*
diff --git a/debian/contextkit-doc.install b/debian/contextkit-doc.install
deleted file mode 100644
index 8d5f6b89..00000000
--- a/debian/contextkit-doc.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/share/doc/contextkit/html/*
diff --git a/debian/contextkit-utils.install b/debian/contextkit-utils.install
deleted file mode 100644
index 408cf376..00000000
--- a/debian/contextkit-utils.install
+++ /dev/null
@@ -1,9 +0,0 @@
-usr/bin/context-provide
-usr/bin/context-listen
-usr/bin/context-provide-internal
-usr/bin/context-ls
-usr/share/man/man1/context-provide.1
-usr/share/man/man1/context-provide-v2.1
-usr/share/man/man1/context-listen.1
-usr/share/man/man1/context-print-info.1
-usr/share/man/man1/context-ls.1
diff --git a/debian/control b/debian/control
deleted file mode 100644
index adae0a36..00000000
--- a/debian/control
+++ /dev/null
@@ -1,153 +0,0 @@
-Source: contextkit
-Section: misc
-Priority: optional
-Maintainer: Marius Vollmer <marius.vollmer@nokia.com>
-Build-Depends: debhelper (>= 5),
- automake1.9,
- python,
- python-central,
- libqt4-dev,
- libcdb-dev,
- libglib2.0-dev (>= 2.12.0),
- libdbus-1-dev,
- xsltproc,
- doxygen
-XS-Python-Version: all
-Standards-Version: 3.8.0
-
-Package: contextkit-doc
-Section: doc
-Architecture: all
-Provides: org-freedesktop-contextkit-doc
-Description: A framework for collecting contextual information
- ContextKit is a system for providing real-time context awareness to
- applications.
- .
- This package contains the documentation.
-
-Package: libcontextprovider0
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Conflicts: libduivaluespace0 (<< 0.9)
-Description: Helper library for providers of context properties
- The libcontextprovider library implements the provider side of the
- org.freedesktop.ContextKit D-Bus interface.
-
-Package: libcontextprovider0-dbg
-Priority: extra
-Architecture: any
-Depends: libcontextprovider0 (= ${binary:Version})
-Description: Helper library for providers of context properties
- The libcontextprovider library implements the provider side of the
- org.freedesktop.ContextKit D-Bus interface.
- .
- This package contains the debug symbols.
-
-Package: libcontextprovider-dev
-Section: libdevel
-Architecture: any
-Depends: libcontextprovider0 (= ${binary:Version}), libdbus-1-dev, libqt4-dev
-Description: Helper library for providers of context properties
- The libcontextprovider library implements the provider side of the
- org.freedesktop.ContextKit D-Bus interface.
- .
- This package contains the development files.
-
-Package: libcontextprovider-doc
-Section: doc
-Architecture: all
-Description: Helper library for providers of context properties
- The libcontextprovider library implements the provider side of the
- org.freedesktop.ContextKit D-Bus interface.
- .
- This package contains the documentation.
-
-Package: libcontextprovider-tests
-Section: devel
-Architecture: any
-Depends: libcontextprovider0, ${shlibs:Depends}
-XB-Maemo-CI-Packages: libcontextprovider0
-XB-Maemo-CI-Stage: staging, acceptance
-Description: libcontextprovider automated customer tests
- The libcontextprovider library implements the provider side of the
- org.freedesktop.ContextKit D-Bus interface.
- .
- This package contains an automated customer testsuite of the
- libcontextprovider library.
-
-Package: python-contextkit
-Section: python
-Architecture: any
-Provides: ${python:Provides}
-Depends: ${python:Depends}, python-gobject, libcontextprovider0
-XB-Python-Version: ${python:Versions}
-Description: Python bindings for ContextKit APIs
- This package contains Python bindings for the libcontextprovider
- C interface, which helps you writing providers in Python.
- .
- In the future it will contain the Python bindings for
- libcontextsubscriber too, but it is not ready yet.
- .
- If you are interested in some quick test tools for the ContextKit,
- please look into the package named contextkit-utils.
-
-Package: contextkit-utils
-Section: utils
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, python-contextkit, python-dbus, python
-Description: Command line utilities for ContextKit
- This package contains the context-provide and context-listen
- tools. You can use context-provide to quickly provide context
- properties from the command line, while with context-listen you can
- watch properties for changes.
-
-Package: libcontextsubscriber0
-Architecture: any
-Conflicts: libcontextprovider0 (<< 0.1.9)
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: Helper library for subscribers of context properties
- The libcontextsubscriber library implements the subscriber side of the
- org.freedesktop.ContextKit D-Bus interface.
-
-Package: libcontextsubscriber0-dbg
-Priority: extra
-Architecture: any
-Depends: libcontextsubscriber0 (= ${binary:Version})
-Description: Helper library for subscribers of context properties
- The libcontextsubscriber library implements the subscribers side of the
- org.freedesktop.ContextKit D-Bus interface.
- .
- This package contains the debug symbols.
-
-Package: libcontextsubscriber-dev
-Section: libdevel
-Architecture: any
-Depends: libcontextsubscriber0 (= ${binary:Version}), libqt4-dev
-Description: Helper library for subscribers of context properties
- The libcontextsubscriber library implements the subscriber side of the
- org.freedesktop.ContextKit D-Bus interface.
- .
- This package contains the development files.
-
-Package: libcontextsubscriber-doc
-Section: doc
-Architecture: all
-Description: Helper library for subscribers of context properties
- The libcontextsubscriber library implements the subscriber side of the
- org.freedesktop.ContextKit D-Bus interface.
- .
- This package contains the documentation.
-
-Package: libcontextsubscriber-tests
-Section: devel
-Architecture: any
-Depends: libcontextprovider0, libcontextsubscriber0, contextkit-utils, python-contextkit, ${shlibs:Depends}
-Recommends: python2.5, python (>= 2.5)
-XB-Maemo-CI-Packages: libcontextsubscriber0, libcontextprovider0
-XB-Maemo-CI-Stage: staging, acceptance
-Description: libcontextsubscriber automated customer tests
- The libcontextsubscriber library implements the subscriber side of the
- org.freedesktop.ContextKit D-Bus interface.
- .
- This package contains an automated customer testsuite of the
- libcontextsubscriber library.
diff --git a/debian/copyright b/debian/copyright
deleted file mode 100644
index 45b04e69..00000000
--- a/debian/copyright
+++ /dev/null
@@ -1,8 +0,0 @@
-Copyright (c) 2009 Nokia Corporation.
-
-This program, is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License version
-2.1 as published by the Free Software Foundation.
-
-The full text of the LGPL 2.1 can be found in
-/usr/share/common-licenses.
diff --git a/debian/libcontextprovider-dev.install b/debian/libcontextprovider-dev.install
deleted file mode 100644
index 66a128fb..00000000
--- a/debian/libcontextprovider-dev.install
+++ /dev/null
@@ -1,3 +0,0 @@
-usr/lib/libcontextprovider.so
-usr/lib/pkgconfig/contextprovider-1.0.pc
-usr/include/contextprovider/*
diff --git a/debian/libcontextprovider-doc.install b/debian/libcontextprovider-doc.install
deleted file mode 100644
index 40c0e805..00000000
--- a/debian/libcontextprovider-doc.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/share/doc/libcontextprovider-doc/html/*
diff --git a/debian/libcontextprovider-tests.install b/debian/libcontextprovider-tests.install
deleted file mode 100644
index e0357574..00000000
--- a/debian/libcontextprovider-tests.install
+++ /dev/null
@@ -1,6 +0,0 @@
-usr/share/libcontextprovider-tests/tests.xml
-usr/lib/libcontextprovider-tests/client
-usr/lib/libcontextprovider-tests/cprovidertests
-usr/lib/libcontextprovider-tests/subscriptiontests
-usr/lib/libcontextprovider-tests/typestests
-usr/lib/libcontextprovider-tests/valuechangestests
diff --git a/debian/libcontextprovider0.install b/debian/libcontextprovider0.install
deleted file mode 100644
index 54189091..00000000
--- a/debian/libcontextprovider0.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/libcontextprovider.so.*
diff --git a/debian/libcontextsubscriber-dev.install b/debian/libcontextsubscriber-dev.install
deleted file mode 100644
index 659d7f84..00000000
--- a/debian/libcontextsubscriber-dev.install
+++ /dev/null
@@ -1,3 +0,0 @@
-usr/lib/libcontextsubscriber.so
-usr/lib/pkgconfig/contextsubscriber-1.0.pc
-usr/include/contextsubscriber/*
diff --git a/debian/libcontextsubscriber-doc.install b/debian/libcontextsubscriber-doc.install
deleted file mode 100644
index a0c913e1..00000000
--- a/debian/libcontextsubscriber-doc.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/share/doc/libcontextsubscriber-doc/html/*
diff --git a/debian/libcontextsubscriber-tests.install b/debian/libcontextsubscriber-tests.install
deleted file mode 100644
index d833a467..00000000
--- a/debian/libcontextsubscriber-tests.install
+++ /dev/null
@@ -1,10 +0,0 @@
-usr/share/libcontextsubscriber-tests/*.xml
-usr/share/libcontextsubscriber-tests/commander/*.py
-usr/share/libcontextsubscriber-tests/subscription/*.py
-usr/share/libcontextsubscriber-tests/asynchronicity/*.py
-usr/share/libcontextsubscriber-tests/asynchronicity/slowfast.context
-usr/share/libcontextsubscriber-tests/registry/*.py
-usr/share/libcontextsubscriber-tests/pluginchanging/pluginchanging.py
-usr/share/libcontextsubscriber-tests/pluginchanging/time*.context.temp
-usr/share/libcontextsubscriber-tests/common/rec-kill.sh
-usr/lib/contextkit/subscriber-test-plugins/contextsubscribertime*.so
diff --git a/debian/libcontextsubscriber0.dirs b/debian/libcontextsubscriber0.dirs
deleted file mode 100644
index 67fef07d..00000000
--- a/debian/libcontextsubscriber0.dirs
+++ /dev/null
@@ -1 +0,0 @@
-usr/share/contextkit/providers
diff --git a/debian/libcontextsubscriber0.install b/debian/libcontextsubscriber0.install
deleted file mode 100644
index 1dfee022..00000000
--- a/debian/libcontextsubscriber0.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/bin/update-contextkit-providers
-usr/share/contextkit/core.context
-usr/share/man/man1/update-contextkit-providers.1
-usr/lib/libcontextsubscriber.so.*
diff --git a/debian/libcontextsubscriber0.postinst b/debian/libcontextsubscriber0.postinst
deleted file mode 100644
index 4f88372b..00000000
--- a/debian/libcontextsubscriber0.postinst
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-set -e
-
-update-contextkit-providers
-
-#DEBHELPER#
diff --git a/debian/libcontextsubscriber0.triggers b/debian/libcontextsubscriber0.triggers
deleted file mode 100644
index dd8847d2..00000000
--- a/debian/libcontextsubscriber0.triggers
+++ /dev/null
@@ -1 +0,0 @@
-interest /usr/share/contextkit/providers
diff --git a/debian/python-contextkit.install b/debian/python-contextkit.install
deleted file mode 100644
index 549aa9bf..00000000
--- a/debian/python-contextkit.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/python*/*-packages/ContextKit/*.py
diff --git a/debian/rules b/debian/rules
deleted file mode 100755
index 780e41dc..00000000
--- a/debian/rules
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/usr/bin/make -f
-# -*- makefile-mode -*-
-
-#export DH_VERBOSE=1
-
-LDFLAGS+=-Wl,--as-needed
-
-Makefile:
- ./configure --prefix /usr --sysconfdir=/etc --disable-doc --disable-coverage
-
-build: build-stamp
-build-stamp: Makefile
- dh_testdir
- $(MAKE) LDFLAGS='$(LDFLAGS)' all
- touch build-stamp
-
-clean: Makefile
- dh_testdir
- dh_testroot
- rm -f build-stamp
- $(MAKE) distclean
- dh_clean
-
-install:
-install: build
- dh_testdir
- dh_testroot
- dh_clean -k
- dh_installdirs
- $(MAKE) DESTDIR=`pwd`/debian/tmp/ install
-
- mkdir -p `pwd`/debian/tmp/usr/share/doc/libcontextprovider-doc
- rm -rf `pwd`/debian/tmp/usr/share/doc/libcontextprovider-doc/html
- cp -a libcontextprovider/doc/html `pwd`/debian/tmp/usr/share/doc/libcontextprovider-doc
-
- # install testsets under /usr/share
- mkdir -p debian/tmp/usr/share
-
- cp -rf libcontextsubscriber/customer-tests/commander debian/tmp/usr/share/libcontextsubscriber-tests/
- cp -rf libcontextsubscriber/customer-tests/asynchronicity debian/tmp/usr/share/libcontextsubscriber-tests/
- cp -rf libcontextsubscriber/customer-tests/subscription debian/tmp/usr/share/libcontextsubscriber-tests/
- cp -rf libcontextsubscriber/customer-tests/registry debian/tmp/usr/share/libcontextsubscriber-tests/
- cp -rf libcontextsubscriber/customer-tests/pluginchanging debian/tmp/usr/share/libcontextsubscriber-tests/
-
- mkdir debian/tmp/usr/share/libcontextsubscriber-tests/common
- cp libcontextsubscriber/customer-tests/common/*.sh debian/tmp/usr/share/libcontextsubscriber-tests/common
-
- chown -R root:root debian/tmp/usr/share/libcontextsubscriber-tests
-
- # set the executable flag on to all files that have a shebang line
- grep -rl '^#!' debian/tmp/usr/share/libcontextsubscriber-tests | xargs chmod +x
-
- mkdir -p `pwd`/debian/tmp/usr/share/doc/libcontextsubscriber-doc
- rm -rf `pwd`/debian/tmp/usr/share/doc/libcontextsubscriber-doc/html
- cp -a libcontextsubscriber/doc/html `pwd`/debian/tmp/usr/share/doc/libcontextsubscriber-doc
-
- dh_install --sourcedir=`pwd`/debian/tmp/
-
-binary-indep: build install
- dh_testdir -i
- dh_testroot -i
- dh_installchangelogs -i
- dh_installdocs -i
- dh_installexamples -i
- dh_installman -i
- dh_link -i
- dh_compress -i
- dh_fixperms -i
- dh_installdeb -i
- dh_gencontrol -i
- dh_md5sums -i
- dh_builddeb -i
-
-binary-arch: build install
- dh_testdir -a
- dh_testroot -a
- dh_installchangelogs -a
- dh_installdocs -a
- dh_installexamples -a
- dh_installmenu -a
- dh_installman -a
- dh_strip -p contextkit-utils
- dh_strip -p libcontextsubscriber-tests
- dh_strip -p libcontextprovider-tests
- dh_strip -p libcontextprovider0 --dbg-package="libcontextprovider0-dbg"
- dh_strip -p libcontextsubscriber0 --dbg-package="libcontextsubscriber0-dbg"
- dh_pycentral -ppython-contextkit
- dh_link -a
- dh_compress -a
- dh_fixperms -a
- dh_makeshlibs -a -V -Xcontextsubscribertime # do not add ldconfig calls because of testplugins
- dh_installdeb -a
- cp `pwd`/debian/libcontextsubscriber0.triggers `pwd`/debian/libcontextsubscriber0/DEBIAN/triggers
- chmod 0644 `pwd`/debian/libcontextsubscriber0/DEBIAN/triggers
- dh_shlibdeps -a
- dh_gencontrol -a
- dh_md5sums -a
- dh_builddeb -a
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install
diff --git a/doc/.gitignore b/doc/.gitignore
deleted file mode 100644
index 8906a606..00000000
--- a/doc/.gitignore
+++ /dev/null
@@ -1,16 +0,0 @@
-context-providers.html
-context-intro.html
-context-properties.html
-fig1.svg
-fig2.svg
-fig3.svg
-fig4.svg
-fig5.svg
-context-provider-schema.html
-context.html
-contextkit.html
-use-cases.html
-context-arch.html
-context-types.html
-fig3.png
-fig4.png
diff --git a/doc/Makefile.am b/doc/Makefile.am
deleted file mode 100644
index 45cd47d5..00000000
--- a/doc/Makefile.am
+++ /dev/null
@@ -1,23 +0,0 @@
-htmldir = $(datadir)/doc/contextkit/html/
-html_ASCIIDOCS = context-intro.txt context-providers.txt context-types.txt context-arch.txt use-cases.txt
-
-# Support for html_ASCIIDOCS and html_EXTRA
-
-html_DATA = $(html_EXTRA) \
- $(html_ASCIIDOCS:.txt=.html) \
- $(shell sed -n '/^\[dotty,/ { s/^.*,// ; s/].*// ; p }' $(html_ASCIIDOCS:%=$(srcdir)/%))
-
-html-local: $(html_EXTRA) $(html_ASCIIDOCS:.txt=.html)
-
-if CONTEXTKIT_BUILD_DOCS
-context-arch.html fig3.png fig4.png: context-arch.txt
-
-%.html: %.txt
- asciidoc -a toc --unsafe -f myfilter.conf $^
-endif
-
-EXTRA_DIST = $(html_ASCIIDOCS) \
- $(html_DATA) \
- myfilter.conf
-
-MAINTAINERCLEANFILES = $(html_DATA)
diff --git a/doc/context-arch.txt b/doc/context-arch.txt
deleted file mode 100644
index 767dcf35..00000000
--- a/doc/context-arch.txt
+++ /dev/null
@@ -1,642 +0,0 @@
-Context Framework Subsystem Architecture Description
-====================================================
-
-[width="30%"]
-|================================
-|Author | Marius Vollmer
-|Status | Draft
-|Version | {sys:date +%Y-%m-%d}
-|Approver | Olli Finni
-|================================
-
-Copyright (C) Nokia. All rights reserved.
-
-This material, including documentation and any related computer
-programs, is protected by copyright controlled by Nokia. All rights
-are reserved. Copying, including reproducing, storing, adapting or
-translating, any or all of this material requires the prior written
-consent of Nokia. This material also contains confidential
-information, which may not be disclosed to others without the prior
-written consent of Nokia.
-
-Nokia is a registered trademark of Nokia. Other company and product
-names mentioned herein may be trademarks or tradenames of their
-respective owners.
-
-
-Introduction
-------------
-
-The Context Framework, part of the Data Domain, provides a uniform,
-high level API to numerous context properties of the device. While
-many of these context properties are available without the context
-framework, each of them has its own specific way of accessing it. The
-context framework collects them all behind a uniform API, and
-applications thus have easy access to all of the context properties.
-
-The following lists some typical context properties:
-
-- Connectivity status of the device; whether it is connected to the
- Internet and by what means.
-
-- Location; the name of the current city.
-
-- Builtin sensors; orientation in space.
-
-- Current use; idle, plays media, web browsing.
-
-- Combined properties; current weather based on location and online
- weather database.
-
-More concretely, the information in the status bar of a device is
-provided exclusively by the Context Framework.
-
-Applications access context properties by using the +ContextProperty+
-class that is implemented in api:libcontextsubscriber.
-
-The context framework is modular: context properties from multiple
-independent components are directly combined in the
-+libcontextsubscriber+ API and applications can access them without
-needing to know who is ultimately providing them.
-
-A component that wants to directly provide context properties needs to
-implement the relevant interfaces defined by the context framework.
-Currently, the only supported way to do that is to use the
-api:libcontextprovider library.
-
-In addition to information from multiple sources, the context
-framework is a provider of context properties itself: there is a
-_context daemon_ that collects information from low-level and legacy
-interfaces. This context daemon is a good default location for
-implementing context properties and for absorbing properties from
-existing subsystems that have aqcuired them for historical reasons and
-would rather get rid of them.
-
-The concrete list of properties is ultimately defined by their
-providers, but the context framework is the central authority: the
-`official' list of context properties of the Maemo platform is defined
-and documented by the context framework.
-
-To summarize, the context framework contributes value to the Maemo
-platform in the following ways:
-
-- It implements and documents a high-level, uniform API to a set of
- context properties that are provided by multiple components.
-
-- It defines and documents the concrete list of properties of the
- Maemo platform. This includes harmonizing the context ontology with
- other industry efforts.
-
-- It implements context properties that do not naturally belong to
- other subsystems and coordinates the implementation of context
- properties that do belong in specific subsystems.
-
-- It provides a debugging and exploration tool for inspecting and
- controlling context properties.
-
-Thus, the Context Framework does not drive the behavior of the system,
-it only provides the information that is needed for other components
-to decide for themselves. To makes this reasonably easy, the context
-properties are at a high level of abstraction and express the coarse
-grained states of the device. For example, the properties tell you
-whether it is completely idle, in passive use playing some media, or
-in active use. They don't give a real-time view of CPU load.
-
-Architecture
-------------
-
-Concepts
-~~~~~~~~
-
-Context properties are collected from all providers that have
-registered themselves with the
-link:context-providers.html[+context-providers+] interface. For each
-provider, this registration information includes the list of its
-properties with type information and a short description for each, and
-the D-Bus bus name where the provider can be reached. Providers can
-be both on the session and on the system bus, and the registration
-information indicates which bus it is.
-
-This registration information is read by the +libcontextsubscriber+
-library and used by its +ContextProperty+ class to connect a requested
-property name to the right bus name.
-
-The registration information is compiled into a _cache_ that is
-optimized for use by +libcontextsubscriber+. When the set of
-registered properties changes, the cache is recompiled by a command
-line utility provided by the context framework. This will then
-trigger all libcontextsubscriber clients to reload the registry
-information, and existing +ContextProperty+ instances to be updated.
-
-(Note that the cache only caches property declarations, it does not
-ever contain the values of context properties.)
-
-When providers are installed from packages, recompilation of the cache
-happens automatically. _Triggers_ in the Context Framework packages
-are used to run the command line utility at the right times.
-
-The +libcontextsubscriber+ library gracefully handles start, stop and
-restart of providers. During system startup some applications may
-start to use the Context Framework before all providers are
-available. Properties become dynamically available as providers become
-available, and removed when providers are no longer available.
-
-Communication between a +ContextProperty+ and the provider happens
-using a private D-Bus interface. This interface allows for bulk
-retrieval of property values, bulk subscriptions, and bulk change
-notification.
-
-The values of properties are represented to clients as a +QVariant+
-value. Properties can have a special _null_ value when they are not
-available, either because they are not provided by any provider, or
-because the provider is not able to deliver a value. In other words,
-the types of all context properties are "maybe types": subscribers
-might get a value or not. In general, the _null_ value means that the
-real value of the property is unknown.
-
-The _null_ value is different from the empty string or the empty list.
-For example, the "Location.City" property, which denotes the name of
-the current city as a string, will be _null_ when the name of the city
-is unknown (either because the current location of the device is
-unknown or because the database that maps from locations to city names
-is not reachable), but it will be the empty string when the current
-location is known to be outside of any city.
-
-The absence of a value can have many reasons: no provider is available
-for this property, the provider has not yet delivered a value, or the
-provider is deliberately not delivering a value, which it can in turn
-have many reasons. For example, necessary hardware might not be
-present or its use might be disallowed by the current power management
-policy, or a needed online database might not reachable.
-
-The Context Framework makes no attempt to distinguish these different
-reasons. Subscribers should make good use of a value when they get
-it, but they must not fail catastrophically when no value is
-available, or when it takes longer than expected for it to become
-available.
-
-It is expected that eventually the statusbar plugins, such as the
-battery charge monitor and the connectivity indicators, exclusively
-use the context properties to retrieve the information they display.
-
-Context providers need to implement the private D-Bus interface. This
-is done with the api:libcontextprovider library. This library is used
-by the context daemon itself, which can serve as an extended example.
-
-The Connectivity Framework and the Sensor Framework are expected to be
-context providers as described above. Additional context properties,
-such as those related to the Location Framework, are implemented by
-the _context daemon_ contained in the Context Framework.
-
-The +contextd+ Context Daemon will implement all context properties
-that don't have a native provider. It will at least implement
-properties for the information contained in HAL and for location
-related information. It is expected that +contextd+ runs the
-necessary reverse geocoding operations at a reasonable frequency. It
-will also perform Content Framework queries to retrieve the values of
-certain properties.
-
-If necessary for security reasons, the +contextd+ might need to be
-split into multiple instances.
-
-
-System context
-~~~~~~~~~~~~~~
-
-The context framework decouples context subscribers from context
-providers.
-
-[dotty,fig3.png]
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-digraph G {
-
- graph [size="7,100"];
- node [shape=box, style=filled, fontsize=11];
- edge [fontsize=11];
-
-
- "Direct UI Framework" -> "Context Framework"
- "Policy Engine" -> "Context Framework"
- "Sensor" -> "Context Framework"
- "Content Framework" -> "Context Framework" [dir="both"]
-
- "Context Framework" -> "Internet Connectivity" [dir="back"]
- "Context Framework" -> "Location Framework"
- "Context Framework" -> "Freedesktop Essentials"
-
-}
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Structural view
-~~~~~~~~~~~~~~~
-
-The following figure summarizes the components of the Context
-Framework.
-
-[dotty,fig4.png]
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-digraph G {
-
- graph [size="7,100"];
- node [shape=box, style=filled, fontsize=11];
- edge [fontsize=11];
-
- { rank=source
- app [label="<<process>>\n\napplication"];
- }
-
- subgraph cluster0 {
- label="Context Framework"
-
- registry [label="<<XML documents>>\n\n/usr/share/context-providers/"];
- cache [label="<<CDB file>>\n\ncache.cdb"];
- libsub [label="<<library>>\n\nlibcontextsubscriber"];
- update [label="<<utility>>\n\nupdate-context-providers"];
- libprov [label="<<library>>\n\nlibcontextprovider"];
- contextd [label="<<process>>\n\ncontextd"];
-
- commander [label="<<utility>>\n\ncontext-commander"];
- corepros [label="<<XML document>>\n\ncore context\nproperty declarations", shape=note];
-
- // update -> registry [label="<<read>>"]
- // update -> cache [label="<<write>>"]
- registry -> update [label="<<read>>", dir="back"]
- cache -> update [label="<<write>>", dir="back"]
-
- libsub -> libprov [label="<<D-Bus>>"]
- libsub -> registry [label="<<read>>"]
- libsub -> cache [label="<<read>>"]
- libprov -> contextd [label="<<link>>", dir="back"]
- }
-
- {
- rank=sink
- props [label="<<XML document>>\n\nicd2-props.xml", shape=note];
- icd2 [label="<<process>>\n\nicd2"];
- libgeo [label="<<library>>\n\nlibgeo"];
- libhal [label="<<library>>\n\nlibhal"];
- }
-
- app -> libsub [label="<<link>>"]
-
- registry -> props [dir="back"]
- contextd -> libgeo [label="<<link>>"]
- contextd -> libhal [label="<<link>>"]
- libprov -> icd2 [label="<<link>>", dir="back"]
-}
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-There are two fundamental options for exporting information via the
-context framework:
-
-- The context daemon can use existing platform interfaces, such as
- HAL, to collect this information, process it, and export it as a
- context property.
- +
- This applies to: HAL, Location subsystem, Kernel.
-
-- The principal producer of the information, such as the +icd2+ daemon
- in the Connectivity subsystem, can use the libcontextprovider API
- and export the information directly to applications without using
- the context daemon as a middle man.
- +
- This applies to: Sensor Framework, possibly Connectivity subsystem
- (needs agreeement), possibly Telephony subsystem (needs agreement)
-
-
-Provided Interfaces
-~~~~~~~~~~~~~~~~~~~
-
-.+libcontextsubscriber+
-
-A C++ API for listening to context properties.
-
-link:libcontextsubscriber[Documentation]
-
-.+libcontextprovider+
-
-A C++ and C API for providing values of context properties.
-
-link:libcontextprovider[Documentation]
-
-.+context-properties+
-
-The canonical list of context properties in the Maemo platform. When
-a context property from the list is available, it must conform to its
-description there.
-
-link:context-properties.html[Documentation]
-
-.+context-providers+
-
-The interface to register providers of context properties. A provider
-must use the api:libcontextprovider API.
-
-link:context-providers.html[Documentation]
-
-
-
-Development support
-~~~~~~~~~~~~~~~~~~~
-
-No special features are needed in the Context Framework components to
-make them work in a Scratchbox environment. Availability of
-individual properties depends on the ability of their providers to run
-in Scratchbox. The +contextd+ Context Daemon runs but might not be
-able to provide all properties.
-
-The Context Framework provides a graphical tool called the Context
-Commander to watch all available context properties. This can be used
-to test context providers during development.
-
-In addition, the Context Commander can be used to force context
-properties of selected applications to arbitrary values. This can be
-used to test the reaction of applications to context changes.
-
-The Context Commander runs on the device and either show its UI on the
-device itself or exports it to an external X11 server. This way, the
-testing can be done without disturbing the display of the device
-itself.
-
-When started, the Context Commander takes control of all subscribers
-with their cooperation: when the
-"org.freedesktop.ContextKit.Commander" name appears on the session
-D-Bus, all ContextProperty instances redirect their subcription
-requests to it.
-
-There are vague ideas about integrating the Context Commander into
-Eclipse.
-
-Licenses
-~~~~~~~~
-
-The components of the Context Framework will be developed publically,
-under the umbrella of the freedesktop.org organization. All source
-code is licensed with LGPL 2.1, including the daemon and context
-commander.
-
-Non-free source code can safely interact with the Context Framework
-components.
-
-User Data, Settings, and Configurability
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-The Context Framework does not store user data and is not
-configurable.
-
-Configurability
-~~~~~~~~~~~~~~~
-
-See above.
-
-Packages
-~~~~~~~~
-
-.+contextkit+
-
-Languages:: C, C++, Vala
-
-License:: LGPL 2.1
-
-Provided interfaces:: libcontextsubscriber, libcontextprovider, context-providers, context-properties,
-
-Used interfaces:: libdbus, libgee, libglib, libcdb, libqt4-dbus, libqt4-xml, libqtcore4
-
-Binary packages::
- libcontextsubscriber0, libcontextsubscriber0-dbg, libcontextsubscriber-dev, libcontextsubscriber-doc,
- libcontextprovider0, libcontextprovider0-dbg, libcontextprovider-dev, libcontextprovider-doc,
- contextkit, contextkit-doc, context-dbg
-
-Sources:: https://dvcs.projects.maemo.org/git/?p=ContextKit
-
-.+context-commander+
-
-Languages:: C++
-
-License:: LGPL 2.1
-
-Provided interfaces:: none
-
-Used interfaces:: libcontextsubscriber, libqt4-dbus, libqt4-gui, libqt4-core
-
-Binary packages:: context-commander
-
-Sources:: https://dvcs.projects.maemo.org/git/?p=ContextCommander
-
-.+context-provider-example+
-
-Languages:: C
-
-License:: LGPL 2.1
-
-Provided interfaces:: Context.Example.* properties.
-
-Used interfaces:: libcontextprovider, sysfs files for accelerometer and ambient light sensor
-
-Binary packages:: context-provider-example
-
-Sources:: https://dvcs.projects.maemo.org/git/?p=ContextProviderExample
-
-.+context-subscriber-example+
-
-Languages:: C++
-
-License:: LGPL 2.1
-
-Provided interfaces:: none.
-
-Used interfaces:: Context.Example.* properties, libcontextsubscriber, libqt4-gui, libqt4-core
-
-Binary packages:: context-subscriber-example
-
-Sources:: https://dvcs.projects.maemo.org/git/?p=ContextSubscriberExample
-
-Performance
------------
-
-General
-~~~~~~~
-
-The Context Framework makes no real-time guarantees and does not rely
-on any.
-
-It is careful not to cause significant additional communication that
-wouldn't be needed anyway to communicate contextual information to the
-interested parties.
-
-We expect 5 to 10 providers, about 20 subscribers, each subscribed to
-an average of 5 properties. Property values can become arbitrarily
-big, but are expected to be mostly small, in the order of 10 bytes.
-The occasional big property value is expected to change
-correspondingly infrequently.
-
-Memory
-~~~~~~
-
-|========================================================================================
-| OneNAND | All files are stored on the OneNAND, in their FHS mandated places | 200 KiB
-| eMMC | Not used | 0
-| RAM/Idle | A couple of bytes per subscription plus a couple more per provided property | 200 KiB
-| RAM/Peak | The biggest property values might reach a KiB | 500 KiB
-|========================================================================================
-
-Runtime
-~~~~~~~
-
-The Context Framework allows subscribers and providers to directly
-connect to each other (incurring only the usual D-Bus daemon
-overhead). Context properties are expected to change only
-infrequently and providers are urged to throttle the rate of change.
-
-The contextd daemon is started on the first subscription to one of its
-properties. This is expected to happen on every boot since it
-provides properties that are used by other daemons, such as the
-context engine.
-
-Power consumption
-~~~~~~~~~~~~~~~~~
-
-Providers of context properties know at any time whether someone in
-the system is subscribed to them. This allows them to avoid expensive
-operations for producing values that are not needed.
-
-The documentation for subscribers urges them to take the cost of
-producing property values into consideration. The subscriber API
-offers an easy way to temporarily suspend a subscription.
-
-Sometimes, increased granularity of control over a property is needed:
-instead of just switching it on and off, the subscriber might want to
-request different levels of quality. For example, some subscribers
-might need a higher update frequency than others and are willing to
-pay the associated price in power consumption.
-
-The recommended way to implement this increased control is to offer
-multiple properties that deliver the same value but with different
-qualities-of-service. For example, there could be both
-"Location.HighResCoordinates" and "Location.LowResCoordinates"
-properties that both deliver the current geographical coordinates.
-Subscribing to "Location.HighResCoordinates", however, would cause the
-location to be updated more frequently and maybe even activate a GPS
-device, if available.
-
-Security Impact
----------------
-
-Different context properties might need to have different access
-restrictions. A context provider can implement these access
-restriction in whatever way works, but should preferrably use the
-existing features of the Security Framework.
-
-The Security Framework can control access per D-Bus bus connection.
-Thus, a given context provider should only implement properties with
-the same access rights and leave it to the Security Framework to allow
-or disallow connections to the provider as a whole.
-
-The Context Daemon needs to follow the same rules, of course.
-
-The libcontextsubscriber library listens for a special D-Bus bus name
-to appear and then allows the service behind that name to override all
-values of context properties. The library protects this special name
-with a security token so that only specially certified software can
-own this name. The context commander might or might not be certified
-in this way; instead of certifying it, it might be preferrable to
-require developers to explicitly disable the name protection (via a
-developer certificate or a general device unlocking ceremony) before
-they can use the context commander.
-
-Open Items
------------
-
-- The D-Bus interface needs to be reviewed and maybe redesigned. It
- might make sense to use one object path per property instead of one
- object path per subscriber like we do now.
-
-- Integration with Content Framework needs to be addressed. Snapshots
- of the current context need to be imported into the content database
- (as document tags, say) and content queries might be run
- periodically to provide contextual information (such as the ten most
- recently accessed documents).
-
-- The current plan for localization of context properties requires
- context providers to do it. They thusly need access to the current
- device language and rumour has it that everything about l10n is
- different in Harmattan.
-
-Appendices
-----------
-
-The Context Framework for Context Providers
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-The advantages of the Context Framework for application writers should
-be clear: they can access a rich set of useful contextual information
-with a simple API.
-
-The ultimate providers of this information, however, might feel that
-the context framework itself does not add significant value: after
-all, they already implement APIs to access all that information
-anyway. Hooking into the Context Framework means a duplication of
-effort and the requirement to express everything as a value (instead
-of a general query/response API) might be unwelcome.
-
-However, the unified API and central maintenance of the list of core
-properties carries a lot of value:
-
-- It makes using more contextual information trivial once you have
- used your first property.
-
-- It makes it possible to expose present and future context
- information in all kinds of places with a single effort. Once the
- context framework has been integrated into the Web runtime, into
- Python, or into any language that people care about, no additional
- effort is needed by anyone to track future developments of the
- context properties.
-
-- It decouples context providers from consumers. The context
- framework makes it possible to move the implementation of a property
- from one component to another without having to restart the
- consumers.
-
-- It makes it worthwhile to develop sophisticated tools such as the
- context commander and support for easy automated testing of context
- subscribers and providers.
-
-- It might allow some context providers to exit the "API business"
- altogether.
-+
-If a piece of information is available in a corner of the system but
-needed somewhere else, it is only human to see this as a nuisance
-and cobble together a few D-Bus methods to access that information.
-+
-The context framework provides a good alternative in those cases.
-
-It is thus our opinion that the context framework provides enough
-value to justify pushing it into other peoples subsystems, even if
-that means duplicated efforts.
-
-Moreover, the effort needed to integrate with the context framework is
-low.
-
-Relation to Policy Engine
-~~~~~~~~~~~~~~~~~~~~~~~~~
-
-The policy engine has the role in the Maemo platform to decide system
-global behavior and controls the various distributed enforcement
-points accordingly. This job will likely be done by OHMng.
-
-The policy engine can be both a subscriber to and provider of context
-properties. The policy engine will base its decisions (partly) on the
-current values of context properties and will publish (part of) its
-decisions as context properties.
-
-Most facts that need to be gathered as input for the policy engine can
-be communicted to it via the context framework. If necessary,
-non-public context properties can be defined that (while visible to
-everyone who knows where to look) are not maintained as part of the
-list of core properties.
-
-Decisions of the policy engine can be communicated to cooperating
-applications and potentially even to enforcement points. The set of
-values representable as context properties is quite rich so that
-hopefully all facts and decisions can be represented with them.
-
diff --git a/doc/context-cron.txt b/doc/context-cron.txt
deleted file mode 100644
index c26f4a09..00000000
--- a/doc/context-cron.txt
+++ /dev/null
@@ -1,106 +0,0 @@
-Context Cron Architecture Study
-===============================
-
-The Context Framework allows clients a view into the current state of
-the system. Clients can watch that state and react to it
-appropriately. Doing this, however, requires a running process
-somewhere.
-
-The Context Cron is a component that can be programmed to watch the
-system on behalf of other components. Conceptually, the Context Cron
-constantly evaluates a set of expressions, and if the value of a
-expression changes, the actions associated with that expression are
-executed.
-
-Input to the expression can come from various sources:
-
- - context properties,
-
- - settings,
-
- - content queries,
-
- - and the current time.
-
-There are two options for writing expressions, and we should select
-one of them:
-
- - All input could be mapped into RDF and SPARQL would be used to
- write the expressions.
-
- - SPARQL is extended so that context, settings, and time can be used
- as parameters in places where SparQL allows literals.
-
-The latter appears to allow more natural expressions. Mapping the
-rich values of context properties into RDF leads to covoluted graphs
-that are tedious to query.
-
-In general, it is not wrong to say that the Context Cron adds rich
-life queries to the Content Framework.
-
-When ever the result of a expression changes, Context Cron triggers
-the associated actions. Actions can be:
-
- - execution of a shell command,
-
- - sending of a D-Bus message or signal,
-
- - changing the value of a context property.
-
-The D-Bus message or signal can include the old and/or new value of
-the expression. Shell commands can read a representation of the
-values from stdin, in a number of formats.
-
-Actions are specified in a ad-hoc syntax, maybe XML.
-
-Queries can be 'armed' or 'unarmed'. A action only triggers when it
-is armed, and triggering a action unarms it. You need to explicitly
-arm it again once the action is done, or more generally, once you are
-ready for the next trigger.
-
-Queries can be added to Context Cron by dropping files into a
-well-known location, or via a D-Bus interface.
-
-Context and Settings Ontology
------------------------------
-
-Context properties and settings are key/value pairs. The values range
-over the "representational types" described in the Desktop Types
-document. That document also describes how the values map into RDF
-triples.
-
-Context properties are mapped into RDF as triples of the form
-
- "context" <key> <value>
-
-Settings are also key/value pairs with the same value range as context
-properties. They are mapped into triples like so:
-
- "setting" <key> <value>
-
-[ XXX - do this properly, using Turtle and namespace and everything.
-]
-
-In addition to this generic ontology that makes all context properties
-and all setings available to SparQL, there might also be specific
-context ontology that is better integrated with Nepomuk.
-
-For example, there is a node "CurrentLocation" with predicates
-"nlo:latitude" and "nlo:longitude".
-
-Examples
---------
-
-Create a new context property Location.NearPOIs whose value is a list
-of the currently near points of interest, sorted from closest to
-farthest. "Near" is defined to mean "can be reached in less than 1
-minute with the current velocity."
-
- SELECT ?poi
- WHERE
- {
- ?poi nlo:latitude ?lat;
- nlo:longitude ?lon.
- context Location.Latitude ?curlat;
- Location.Longitude ?curlon.
- }
diff --git a/doc/context-intro.txt b/doc/context-intro.txt
deleted file mode 100644
index e01c4851..00000000
--- a/doc/context-intro.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-Context Framework
-=================
-
-The Context Framework provides a uniform, high level API to numerous
-context properties of the device.
-
-Please follow the links for more details:
-
-- link:libcontextsubscriber[Documention of the high level API for clients]
-- link:context-properties.html[Documentation of context properties]
-- link:context-providers.html[Documentation for providers of context properties]
-- link:context-arch.html[Architecture description]
diff --git a/doc/context-providers.txt b/doc/context-providers.txt
deleted file mode 100644
index 0b3e5422..00000000
--- a/doc/context-providers.txt
+++ /dev/null
@@ -1,169 +0,0 @@
-How to provide context properties
-=================================
-
-Any component can provide its own key/value pairs and make them appear
-as a +ContextProperty+ for C++ (and in other forms for other
-languages).
-
-As a provider of context properties, you need to drop one or more
-_property declaration_ files into +/usr/share/contextkit/providers/+
-to register your properties with the context framework. This file
-follows a format described below and is used by +libcontextsubscriber+
-and others to find you when someone subscribes to your properties.
-The file is also used by the Context Commander to show descriptions of
-your properties and to learn about the possible values that a property
-can legally have.
-
-The property declaration files also inform the context framework how
-you want to be contacted. Right now, you have to implement the
-+org.freedesktop.ContextKit+ D-Bus interface, and register yourself on
-either the system or the session D-Bus with a suitable bus name. The
-choice of system or session bus and your bus name go into the property
-declaration file.
-
-The only supported way right now to implement the
-+org.freedesktop.ContextKit+ interface is to use the
-link:libcontextprovider[+libcontextprovider+] library.
-
-The name of the property declaration file must be
-"__bus-name__++.context++".
-
-The property declaration file
------------------------------
-
-The property declaration file contains XML and must follow
-link:context-provider-schema.html[this XML schema]. A simple example
-for the +Example.Random+ property looks like this:
-
-[source,xml]
-------------------
-<?xml version="1.0"?>
-<provider bus="session"
- service="com.example.RandomProvider">
- <key name="com.example.Random">
- <type>double</type>
- <doc>
- A random number between 0 and 1 that changes every now and then.
- </doc>
- </key>
-</provider>
-------------------
-
-This file declares the single property +com.example.Random+ and
-instructs the Content Framework to connect to the
-+com.example.RandomProvider+ bus name on the session D-Bus. It would
-be stored as
-+/usr/share/contextkit/providers/com.example.RandomProvider.context+
-
-You need to be careful when choosing property name; see the
-"Guidelines for property providers" section for how to avoid
-conflicts.
-
-When providing properties from the link:context-properties.html[core
-list], you need to follow additional rules to make sure that your
-property declarations and the centrally maintained core list do not
-fall out of synch. See the "Providing core properties" section for
-more about them.
-
-After installing a property declaration file into a directory +$dir+,
-you should usually execute +update-contextkit-providers+. This will
-update the various caches that clients like the +libcontextsubscriber+
-library use.
-
-But, if a property declaration file is installed via a Debian package,
-you should not call +update-contextkit-providers+ in your maintainer
-scripts. Triggers in the relevant packages take care of running
-update-contextkit-providers at the right time and only as often as
-necessary.
-
-The XML element tree in the property declaration file simply consists
-of a list of +key+ elements.
-
-A +key+ element in the property declaration tree can have a +doc+
-child element. The contents of this element should be plain text
-without any additional markup.
-
-Types
-~~~~~
-
-*NOTE:* This is preview of things that might come, or not. For now,
-just use a +type+ attribute in your +key+ elements with one of
-+"TRUTH"+, +"STRING"+, +"INT"+, or +"DOUBLE"+ as the value.
-
-ContextKit uses the experimental link:context-types.html[Desktop Type
-System]. A property declaration should have a +type+ element that
-conforms to the Desktop Type System.
-
-For example, a property that is a enumeration would be declared like
-this:
-
-[source,xml]
-------------------
-<key name="Economy">
- <type>
- <int-enum>
- <up val="1" doc="Getting better"/>
- <down val="2" doc="Getting worse"/>
- <even val="3" doc="Getting boring"/>
- </int-enum>
- </type>
- <doc>
- The current economic trend, as an enumerated value.
- </doc>
-</key>
-------------------
-
-
-Guidelines for property providers
----------------------------------
-
-Names
-~~~~~
-
-Context property names can contain any character except "/".
-
-Only core property names are allowed to start with a capital ASCII
-letter ("A" to "Z").
-
-When defining a new non-core property, you need to choose a unique
-prefix. Start with a reversed fully qualified domainname that you
-control, such as "com.nokia." or "org.gnome.". Then, if the first
-component is "org" and the second component is not a top-level domain,
-drop "org". Then convert the first character of the prefix to
-lower-case if it is one of "A" to "Z".
-
-For example, the GNOME project can use "gnome." as their prefix, KDE
-can use "kde.", and Nokia can use "com.nokia.".
-
-Providing core properties
--------------------------
-
-The Context Framework project maintains a list of _core properties_.
-These core properties are intended to cover the needs of most
-applications and be meaningful for many different devices.
-
-When you are implementing a provider for some of the core properties,
-you must of course make sure that you follow the specification of that
-property. You can not redefine its type or description in your
-property declaration file, obviously.
-
-Thus, for core properties, you should not include any +type+ or +doc+
-elements in your key declarations, just a +name+ element. The list of
-core properties is also known to context subcribers at run-time and
-will be used to fill in the missing details.
-
-For example, a property declaration file for core properties could
-look like this:
-
-[source,xml]
-------------------
-<?xml version="1.0"?>
-<provider bus="session"
- service="com.example.RandomProvider">
- <key name="Example.Random"/>
-</provider>
-------------------
-
-This just declares that the +Example.Random+ property can be
-subscribed to by contacting +com.example.RandomProvider+ on the
-session bus. It's type and documentation are found elsewhere.
diff --git a/doc/context-talk.txt b/doc/context-talk.txt
deleted file mode 100644
index bdf96808..00000000
--- a/doc/context-talk.txt
+++ /dev/null
@@ -1,282 +0,0 @@
------------------------
-
- ContextKit
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
--------------------------
-Context and Conversations
-
-* The stuff that happens around you.
-
-* Shared by the people that you interact with.
-
-* Implicit part of a conversation.
-
-* Ignoring context makes you look absent minded.
-
-
-
-
-
-
-
-
-
-
-
-
--------------------------
-Context and Computers
-
-* Conversation between Man and Machine also has context.
-
-* What has the user done with the computer? "Recent documents",
- "Browsing history", "Recently written emails", ...
-
-* Getting additional clues without help from user: time of day, day of
- week, geographical location, sitting still or moving, holding like a
- camera or like a phone, Internet connectivity, ..
-
-* Use those clues to improve the Man / Machine conversation.
-
-* "Essential Digital Companion". (Yeah, right)
-
-* Quite fuzzy, experimentation should be easy.
-
-
-
-
-
--------------------------
-Context and Connecting People
-
-* Computers facilitate conversations between people
-
-* People want to share their context with their peers.
-
-* Computers should help share the context of a conversation between
- people as well.
-
-
-
-
-
-
-
-
-
-
-
-
-
--------------------------
-So?
-
-* Bring together 'context providers'
-
- - DeviceKit, GeoClue, Meta tracker, Telepathy, BlueZ, ConnMan, oFono,
- Sensors, ...
-
-* Standardize high-level interfaces across desktops
-
- - GNOME, KDE, Maemo, Moblin, Sugar, ...
-
-* With bindings for all languages
-
- - C, Glib, Qt, Python, Perl, JavaScript, C#, ...
-
-* No silver bullet, regular programming, no magic enabler needed.
-
-* Restrict, simplify, do the minimal useful thing
-
-
-
--------------------------
-ContextKit
-
-* "Global variables for the Desktop"
-
-* Disciplined way of 'setting' those variables
-
-* Concrete list of variables
-
-* Rich type system
-
-* Well integrated into many languages
-
-
-
-
-
-
-
-
-
-
--------------------------
-Status
-
-* First generation framework done
-
-* Some properties defined
-
-* Some buy in from other Nokia research projects.
-
-* Only for Qt / C++ (sorry)
-
-* A bit too static still
-
-
-
-
-
-
-
-
-
-
--------------------------
-Architecture
-
-* Decoupled
-
-* Publish/subscribe for property values
-
-* Run-time introspection
-
-* XML property declarations with cache
-
-* No central daemon
-
-
-
-
-
-
-
-
-
-
--------------------------
-Demo and Docs
-
-* Context Commander
-
-* Subscriber
-
-* Provider
-
-
-
-
-
-
-
-
-
-
-
-
-
-
--------------------------
-Desktop Types
-
-* Little hobby of mine
-
-* Intersect a number of dynamic type systems to find the core
-
- - Null, numbers, strings, lists, maps
-
- Missing: association lists, turn out to be more useful
- than maps for interchange.
-
-* Define language neutral static types
-
- - Enums, time, coordinates, ...
-
-* Write bindings of static types for static languages, documentation
- systems, introspection APIs.
-
-
-
-
--------------------------
-Nano-DOM
-
-* Mapping of subset of XML into Desktop Types.
-
-* Used to define context properties
-
- <key name="Battery.ChargeLevel"
- type="percentage">
- <doc>...</doc>
- </key>
-
- <key>
- <name>Battery.ChargeLevel</name>
- <type>percentage</type>
- <doc>...</doc>
- </key>
-
- "key", { "name": "Battery.ChargeLevel", "type": "percentage",
- "doc": "..." }
-
-
--------------------------
-Static Desktop Type
-
-* Dynamic desktop types: simple, fixed.
-
-* Static desktop types: expressive, extensible
-
-* Hierarchy, parameters.
-
- <type name="uniform-list" base="list">
- <params>
- <type doc="Type of the elements"/>
- </params>
- <doc>...</doc>
- </type>
-
- <key name="Use.RecentDocuments">
- <type>
- <uniform-list type="nepomuk-uri"/>
- </type>
- <doc>...</doc>
- </key>
-
--------------------------
-Future
-
-* Finding a home on freedesktop.org
-
-* Lobbying for mind share
-
-* Adding GVariant and Python into the picture
-
-* Getting the D-Bus protocol right
-
-* Simple aggregation in client, maybe
-
- (Sum, append, average, max, ...)
-
-* 'Context Cron'
-
diff --git a/doc/context-types.txt b/doc/context-types.txt
deleted file mode 100644
index d7937578..00000000
--- a/doc/context-types.txt
+++ /dev/null
@@ -1,833 +0,0 @@
-A high-level type system for the Free Desktops
-==============================================
-
-Desktop environments are not just for starting applications anymore.
-Data is flowing freely between well-integrated components, and the
-easier the data flows, the better the integration of the components.
-
-Not all components are written in the same programming language, of
-course, and when letting data flow between them, it needs to be
-represented in many different ways. For example, GConf stores values
-differently than they travel over D-Bus, which is different again from
-how they are passed as GValues to signal handlers, which is different
-from how Perl wants to store it.
-
-The desktop environment is heading towards a cooperative, dynamic
-environment, and it needs a rich and strong type system to tie its
-components together. Sending lines of text over pipes and matching
-them against ad-hoc regular expressions just doesn't cut it.
-
-In an attempt to define such a common type system, this document
-collects many different systems for representing values, and unifies
-them by mapping the common dynamic type system into them.
-
-The common type system defined here is rich enough to represent any
-reasonable value; it's roughly equivalent to what dynamic languages
-like Perl and Python have.
-
-But it goes one crucial step further: it allows the definition of new
-abstract, intentional types. Intentional types give additional
-information about a value that is not available from the
-representation alone.
-
-For example, a integer can be used to denote a point in time by saying
-that it is the number of seconds since a certain epoch. All places
-that interact with such a value need to agree on this intention.
-
-This agreement can happen informally, via documentation or just plain
-common sense. Nothing wrong with that. It is, however, also helpful
-to formalize this so that documentation can be precise without much
-extra effort, up to a level where the machine itself is able to check
-whether everybody agrees on the intentional types.
-
-The age old battle between static and dynamic types also matters here:
-how much type information should be associated with the values
-themselves? The boundary is exactly between intentional and
-representational types. Intentional types are those that only the
-programmer or compiler know about, representational types are those
-that are only known at run-time.
-
-In a completely statically typed language, we only have raw bytes at
-run-time without any representational type information. All parts of
-the program need to agree that the intention is for those four bytes
-over there to be used as a 32-bit integer. Statically typed programs
-are littered with declarations of intentional types, and language
-processors use them to (more or less) check program consistency and to
-select the right division instruction based on whether the four bytes
-over there are intended to be a signed number or an unsigned one.
-
-In a dynamically typed language, values carry a lot of
-representational type information. Code can easily be polymorphic and
-do different things depending on whether a value is an integer or a
-string. It can also perform consistency checks at run-time, which is
-more robust than doing it at compile time, but doesn't go as far since
-intentional types are not available.
-
-Dynamic languages often don't have any means to declare intentional
-types for the benefit of the compiler; they only exist in the head of
-the programmer who expresses them by selecting the right operation
-manually. For example, if a string is intended to be a URL, you need
-to use 'utils.net.web.url.get_scheme (url)' explicitly. If the
-intentional type could have been declared in the language, it could
-have selected the right function automatically from just 'url.scheme()'.
-
-Thus, and coming back to the ground now, we define a concrete type
-system here with a rich representational part and a lightweight and
-flexible intentional part.
-
-For the representational part, we define how it is implemented for a
-number of existing value systems. For the intentional part, we define
-how it can be translated into a number of languages, both those with
-static type declaration and those where intent is mainly expressed by
-manually selecting the right operations.
-
-Intentional types are not optional; they are generally needed to make
-sense of values. A programmer learns about them by reading
-documentation; if a debugging tool needs to find out a intentional
-type at run-time, there must be some way to find it.
-
-This means that declaration languages like D-Bus introspection
-facilities and GConf schemas need to be extended to support our
-intentional types. Thus, purely declarative languages like these are
-also included in our list of supported languages.
-
-[source,C]
-----
-/* Witty example here. */
-----
-
-We also give a list of common intentional types, of course.
-
-This document then has three dimensions of extensibility:
-
-- A new value system can be added by defining how the representational
- part of the common type system maps to it.
-
-- A new language can be added by defining how intentional types are
- implemented in it, and by implementing all common intentional types.
-
-- A new common intentional type can be added by defining it and
- implementing it in all languages.
-
-The representational part of the common type system is not supposed to
-change frequently, but adding a new intentional type should be
-considered routine.
-
-The representation part of the common type system is restricted by the
-lowest common denominator of all the value system implementations that
-we want to include. We don't want to distort the existing value
-systems too much, and force people to write code that feels unnatural
-for them.
-
-For example, not all value systems can directly represent complex
-numbers or multiple precision integers, but any grown up type system
-should include them. We solve this conflict by relying on the
-intentional types: Instead of grafting complex numbers onto every
-value system, we only define a intentional type for them.
-
-Currently supported value systems: QVariant, D-Bus messages, GValue,
-GConfValue, GVariant, Python values, Perl values, JavaScript values,
-GKeyFile, JSON, YAML, Nepomuk ontologies, SQL, SparQL, Common Lisp
-values.
-
-Currently supported languages: Python, Perl, JavaScript, Java, C#, C++
-with QVariant, plain C++, C with D-Bus/GValue/GConfValue/GVariant,
-plain C, Vala, D-Bus introspection, D-Bus IDL (didl), GConf schema,
-our own XML schema.
-
-
-Representational types
-----------------------
-
-Converting a value from one representation to another is not
-guaranteed to be loss-less: if you convert the value back, it might be
-different and even have a different type. Intentional types are used
-to make sense of the value anyway. [ XXX - so maybe we shouldn't
-bother with representational types at all... ]
-
-Whenever there is a choice of representation in the following table,
-it should be taken to mean: Represent the value with the first
-alternative in the list that is possible, even if that loses
-precision.
-
-For example, a 64 bit signed integer is represented in GConf as a
-"int" if it fits, and as a "double" if not. It will always fit into a
-double, but it might mean chopping off some low bits.
-
-- null
-+
-The null value.
-+
- QVariant: QVariant::Null
- D-Bus: '()'
- GValue: G_TYPE_NONE
- GConf: empty GCONF_VALUE_LIST with type GCONF_VALUE_BOOL
- GVariant: '()'
- Perl: undef
- Python 2: None
- CL: nil
-
-- bool
-+
-A boolean
-+
- QVariant: QVariant::Bool
- D-Bus: 'b'
- GValue: G_TYPE_BOOLEAN
- GConf: GCONF_VALUE_BOOL
- GVariant: 'b'
- Perl: number, 0 or 1.
- Python 2: number, 0 or 1.
- CL: nil or t
-
-- int32
-+
-Signed 32 bit integer
-+
- QVariant: QVariant::Int
- D-Bus: 'i'
- GValue: G_TYPE_INT
- GConf: GCONF_VALUE_INT
- GVariant: 'i'
- Perl: number
- Python 2: int
- CL: number
-
-- int64
-+
-Signed 64 bit integer
-+
- QVariant: QVariant::LongLong
- D-Bus: 'x'
- GValue: G_TYPE_INT64
- GConf: GCONF_VALUE_INT or GCONF_VALUE_DOUBLE
- GVariant: 'x'
- Perl: number
- Python 2: int or long
- CL: number
-
-- uint32
-+
-Unsigned 32 bit integer
-+
- QVariant: QVariant::UInt
- D-Bus: 'u'
- GValue: G_TYPE_UINT
- GConf: GCONF_VALUE_INT or GCONF_VALUE_DOUBLE
- GVariant: 'u'
- Perl: number
- Python 2: int or long
- CL: number
-
-- uint64
-+
-Unsigned 64 bit integer
-+
- QVariant: QVariant::ULongLong
- D-Bus: 't'
- GValue: G_TYPE_UINT64
- GConf: GCONF_VALUE_INT or GCONF_VALUE_DOUBLE
- GVariant: 't'
- Perl: number
- Python 2: int or long
- CL: number
-
-- double
-+
-Double precision floating point number
-+
- QVariant: QVariant::Double
- D-Bus: 'd'
- GValue: G_TYPE_DOUBLE
- GConf: GCONF_VALUE_DOUBLE
- GVariant: 'd'
- Perl: number
- Python 2: double
- CL: number
-
-- string
-+
-String of Unicode code points
-+
- QVariant: QVariant::QString
- D-Bus: 's'
- GValue: G_TYPE_STRING
- GConf: GCONF_VALUE_STRING, UTF-8.
- GVariant: 's'
- Perl: string
- Python 2: unicode
- CL: string
-
-- list
-+
-List of values
-+
- QVariant: QVariant::List
- D-Bus: 'av'
- GValue: G_TYPE_POINTER pointing to a GSList of GValues.
- (XXX - find something better, must be somewhere.)
- GConf: GCONF_VALUE_LIST or chained GCONF_VALUE_PAIRs
- GVariant: 'av'
- Perl: array
- Python 2: list
- CL: list
-
-- map
-+
-Mapping from strings to values, with no duplicated keys.
-+
- QVariant: QVariant::Map
- D-Bus: 'a{sv}'
- GValue: G_TYPE_HASH_TABLE (?)
- GConf: Chain of GCONF_VALUE_PAIRs,
- with the cars being a pair of GCONF_VALUE_STRING and an
- arbitrary value.
- GVariant: 'a{sv}'
- Perl: hash
- Python: dict
- CL: alist
-
-A Nano-DOM
-----------
-
-The representational types can be used as a Nano-DOM for a subset of
-XML. This is useful when the small subset suffices but you still want
-to be enterprise ready. Intentional type definitions use this subset,
-for example, and are thus easily handled at run-time.
-
-Converting a piece of XML into its Nano-DOM representation proceeds
-according to simple rules:
-
- - First, all attributes of elements are converted to child elements,
- in order and at the beginning. Thus, the following XML fragments
- are quivalent:
-
- <bar size="12">...</bar>
-
- <bar><size>12</size>...</bar>
-
- - Then, text is turned into strings, and elements are turned into
- lists with the first element being a string with the name of the
- element. For example, this XML
-
- <foo>hello</foo>
-
- would be turned into this Python value
-
- ['foo', 'hello']
-
- When creating the strings for text, surrounding whitespace is
- removed.
-
-More examples:
-
- <key name="Example.Random"
- type="string">
- <doc>
- A random property.
- </doc>
- </key>
-
- =>
-
- ['key',
- ['name', 'Example.Random' ],
- ['type', 'string' ],
- ['doc', 'A random property.']
- ]
-
- <key name="Example.Random">
- <type>
- <uniform-list type="number"/>
- </type>
- </key>
-
- =>
-
- ['key',
- ['name', 'Example.Random' ],
- ['type',
- ['uniform-list', ['type', 'number' ] ]
- ]
- ]
-
-You can think of the Nano-DOM representation as a simple abstract
-syntax tree for XML.
-
-
-Intentional types
------------------
-
-The most important part by far of a intentional type definition is its
-documentation. The documentation is the thing that explains the
-intent to programmers, so that they can 'reify' the abstract
-intentional type into concrete code. For example, by reading the
-documentation, they know how to write a C++ class for the intentional
-type and add useful methods to it, or how to write a UI widget that
-allows displaying and maybe high-level editing of values of that type.
-
-Intentional types are _not_ a static type system. They are only a
-tool for cross-referencing documentation. Sometimes, intentional
-types are mapped into a static type system and the compiler will then
-perform some additonal checks at compile time, and the code using the
-types might look more natural, but that is not the main goal of the
-intentional types.
-
-In essence, intentional types use English as the 'formal' language to
-express their definitions. Their documentation should basically be a
-description of the set of values that are permissible for this type
-(by referring to other already defined intentional types or the
-representational types from above), and what they mean. For example,
-the "calendar-time" type could say that only "uint64" values are
-allowed, and that they are the number of nano-seconds since midnight
-January 1, UTC.
-
-Another example are enumerations: the documentation of
-"compass-direction" can say that the value is one of the four "int32"
-values 0, 90, 180, 270 where 0 means North, 90 means East, etc.
-
-As shown in the examples, intentional types have names, so that you
-can refer to them in the documentation of other types and in other
-places that refer to intentional types, such as in D-Bus introspection
-declarations.
-
-When other people refer to your type, they can provide a set of
-parameters to specialize it. You should document which parameters are
-meaningful and what they do, of course. You should also formally
-declare which paramaters are valid. (See below for concrete
-examples).
-
-Type parameters allow us to define a small set of fundamental and
-general types, which can be instantiated to create a wide range of
-useful types. For example, there is a generic "int-enum" type that
-can be turned into a specific enumeration via its parameters. A
-single UI widget could be written for "int-enum" that is then
-(automatically) parameterized at run-time with the concrete set of
-choices. The "int-enum" type is defined so that its parameters
-include the text to use for each enumeration choice, and the UI widget
-will get access to these parameters at run-time (as a map,
-incidentally).
-
-A intentional type definition can specify a "base" type for itself, by
-referring to another intentional type. This base can be used to make
-the documentation a bit more formal, and of course to provide
-parameters for the base type. For example, the documentation for the
-"compass-direction" type would not need to explicitly say that the
-numbers are "int32"s; it would just declare its base to be "int32".
-Even better, it sould say that it's actually a "int-enum" and specify
-the concrete values.
-
-
-In a context where a type is expected:
-
- NAME - refers to type named NAME
- <NAME>PARM...</NAME> - refers to type named NAME, specialized
- with PARM...
-
-Attributes for type definitions:
-
- name - the name (string)
- parms - valid paramaters (map from parm name to map of ...)
- doc - documentation (either string, or a map language code -> string)
- base - the base type (type)
-
-As an example, consider a hypothetical XML schema for describing
-key-value pairs. Let's also assume that this schema follows our
-Nano-DOM rules. It has a "key" element which needs name, doc and type
-attributes. The "type" attribute should refer to an intentional type
-of course. We can describe a key for the current temperature,
-expressed as one of "low", "medium", "high", in the following ways.
-
-First, we can refer to the predefined "three-level-enum" type, if
-there would be such a type. Documentation of the possible values is
-left to the definition of "three-level-enum", which presumably would
-tell us that they are the strings "low", "medium", and "high".
-
- <key>
- <name>Temperature</name>
- <doc>The current temperature.</doc>
- <type>three-level-enum</type>
- <key>
-
-Using the Nano-DOM rules, this can be shortened to:
-
- <key name="Temperature"
- doc="The current temperature"
- type="three-level-enum"/>
-
-Instead of referring to the pre-defined "three-level-enum" type, we
-can instantiate a "string-enum" explicitly, which is one of the
-pre-defined generic types.
-
- <key name="Temperature"
- doc="The current temperature">
- <type>
- <string-enum>
- <low doc="Brrrr"/>
- <medium doc="Comfy."/>
- <high doc="Siesta!"/>
- </string-enum>
- </type>
- </key>
-
-The common intentional types are defined in XML, as a list of "type"
-elements that have "name", "parms", "doc", and "base" child elements,
-as expected.
-
-In the following, we give the type definitions verbatim, as XML, as an
-extended example (and because the real XML definition of the types
-does not exist yet). In the future, this part of the document will be
-generated from the type definitions and will look nicer.
-
-Fundamental types
-~~~~~~~~~~~~~~~~~
-
- <typedef name="int32">
- <doc>
- A int32 value.
- </doc>
- </type>
-
- <type name="int64">
- <doc>
- A int64 value.
- </doc>
- </type>
-
- <type name="uint32">
- <doc>
- A uint32 value within the given limits.
- </doc>
- </type>
-
- <type name="uint64">
- <params>
- <min doc="Minimum value"/>
- <max doc="Maximum value"/>
- <params>
- <doc>
- A uint64 value within the given limits.
- </doc>
- </type>
-
- <type name="double">
- <params>
- <min doc="Minimum value"/>
- <max doc="Maximum value"/>
- <params>
- <doc>
- A double value within the given limits.
- </doc>
- </type>
-
- <type name="string">
- <parms>
- <must-match doc="Regular expression that must match"/>
- </parms>
- <doc>
- A string value that matches the given regular expression.
- </doc>
- </type>
-
- <type name="list">
- <params>
- <min doc="Minimum length"/>
- <max doc="Maximum length"/>
- <params>
- <doc>
- A list of arbitrary values, with the minimum and maximum
- length given by the "min" and "max" parameters, respectively.
- </doc>
- </type>
-
- <type name="map">
- <params>
- <keys doc="Allowed keys"/>
- </params>
- <doc>
- A map. If given, the "keys" parameter determines which keys are
- allowed. The "keys" parameter should be a map itself, from key
- names to a map with the attributes of the key. Attributes of a
- key are "doc" and "type".
- </doc>
- </type>
-
-Generic types
-~~~~~~~~~~~~~
-
- <type name="value">
- <doc>
- Any representable value.
- </doc>
- </type>
-
- <type name="number" base="value">
- <doc>
- A number, represented as either a "int32", "uint32", "int64", "uint64", or "double".
- </doc>
- </type>
-
- <type name="integer" base="number">
- <params>
- <min doc="Lower bound"/>
- <max doc="Upper bound"/>
- </params>
- <doc>
- A integer, represented as any of the numeric types. If the value
- is a "double", it is rounded to an integer, but not necessarily to
- the nearest. The "min" and "max" parameters, when given, constrain
- the range of the integer.
- </doc>
- </type>
-
- <type name="uniform-list" base="list">
- <params>
- <min doc="Minimum length"/>
- <max doc="Maximum length"/>
- <type doc="Type of the elements"/>
- </params>
- <doc>
- A list of values of the given type, with the
- minimum and maximum length given by the "min" and "max" parameters.
- The type of all elements is given by the "type" parameter.
- </doc>
- </type>
-
- <type name="string-enum" base="string">
- <parms>
- <rest doc="The possible values">
- </parms>
- <doc>
- This is the base type for enumerations of fixed strings. The
- parameters describe the possible values. Each parameter is one
- of the choices: the name of the parameter is the string for the choice
- itself and the value of the parameter is a map with further
- information of that choice, such as a "doc" entry.
- </doc>
- </type>
-
- <type name="int-enum" base="int32">
- <parms>
- <rest doc="The possible values">
- </parms>
- <doc>
- This is the base type for enumerations of fixed integers. The
- parameters describe the possible values. Each parameter is one
- of the choices: the name of the parameter is the symbolic name
- for the choice itself and the value of the parameter is a map
- with further information of that choice, such as a "val" entry
- for the numerical value for that choice, and a "doc" entry.
- </doc>
- </type>
-
-Specific types
-~~~~~~~~~~~~~~
-
- <type name="type">
- <doc>
- A type, represented as a map. The map is the one you get as the Nano-DOM
- for the type definiton. E.g., it will have "doc" mapped to a string,
- and "base" mapped to either a string or another map, etc.
- </doc>
- <base>
- <map>
- <allowed-keys>
- <name/>
- <parms/>
- <doc/>
- <base/>
- </allowed-keys>
- </map>
- </base>
- </type>
-
- <type name="geoloc">
- <doc>
- A list of two or three doubles giving a geographical location.
- The first number is latitude, the second longitude, both in degrees.
- If a third number is present, it is the altitude in meters.
- </doc>
- <base>
- <uniform-list min="2" max="3" type="double"/>
- </base>
- </type>
-
- <type name="temperature"
- base="double"
- doc="A temperature in Kelvin."/>
-
- <type name="screen-edge">
- <doc>
- Indicates an edge of a rectangular screen, relative to
- the natural orientation of the video hardware driving it.
- It can be one of the four strings "top", "left", "right",
- and "bottom".
- </doc>
- <base>
- <string-enum>
- <top/> <left/> <right/> <bottom/>
- </string-enum>
- </base>
- </type>
-
- <type name="screen-edge-ints">
- <doc>
- Indicates an edge of a rectangular screen, relative to
- the natural orientation of the video hardware driving it.
- It can be one of the four values "top", "left", "right",
- and "bottom", encoded as an integer.
- </doc>
- <base>
- <int-enum>
- <top val="0"/> <left val="1"/> <right val="2"/> <bottom val="3"/>
- </string-enum>
- </base>
- </type>
-
- <type name="energy" base="double">
- <doc>
- An amount of energy, in Joule.
- </doc>
- </type>
-
- <type name="power" base="double">
- <doc>
- A power, in Watt.
- </doc>
- </type>
-
- <type name="time" base="int64">
- <doc>
- A point in time, represented as the number of nano-seconds since
- 00:00 January 1, 1970, UTC.
- </doc>
- </type>
-
- <type name="duration" base="uint64">
- <doc>
- A time duration, in nano-seconds.
- </doc>
- </type>
-
- <type name="percentage" base="int32">
- <doc>
- A percentage.
- </doc>
- </type>
-
-
-Intentional types and static languages
---------------------------------------
-
-The normal use of intentional types is as follows: while programming
-in some language, you read some API documentation and find out that
-some argument to a function is of type "geoloc"; you then go to the
-documentation of "geoloc" and read how a "geoloc" works in your
-language.
-
-For C++ with QVariants, say, a geoloc could simply remain a list of
-two or three doubles, or it could be a QVariant::RectF with the height
-being abused as the altitude, a new QMetaType could be invented, or a
-completely new class could be defined that can be converted to and
-from a QVariant (together with an appropriate QMetaType). In any
-case, there will be a QVariant involved in there somewhere.
-
-In other words, we need C++ language bindings for the intentional
-types. These language bindings are maintained together with the
-intentional types.
-
-At the language boundaries, such as when marshalling and unmarshalling
-values for a D-Bus message, a geoloc value needs to be converted to
-and from a list of doubles. This conversion code is also maintained
-together with the language bindings. In any case, the types are well
-enough documented that the necessary code can be written manually if
-needed.
-
-
-C with GVariant
-~~~~~~~~~~~~~~~
-
-- geoloc
-
- typedef struct {
- double latitude;
- double longitude;
- double altitude; // NaN if unknown.
- } DGeoLoc;
-
-Rest is done with inheritance:
-
-- duration
-
- typedef int64_t DDuration;
-
-- screen-edge
-
- typedef char *DScreenEdge;
-
-- screen-edge-ints
-
- typedef int DScreenEdgeInts;
- #define D_SCREEN_EDGE_TOP 0
- #define D_SCREEN_EDGE_LEFT 1
- #define D_SCREEN_EDGE_RIGHT 2
- #define D_SCREEN_EDGE_BOTTOM 3
-
-- percentage
-
- typedef int DPercentage;
-
-- type
-
- typedef GVariant DGType;
-
-These definitions are in libdesktoptypes, built from the desktop-types
-source package, which includes everything else as well, such as this
-document, bindings for C++ with QVariant, etc.
-
-There is also g_variant_from_geoloc, etc.
-
-Then, libcontextprovider has context_provider_set_geoloc,
-context_provider_set_duration, etc, probably as macros using
-g_variant_from_geoloc. Maybe we can have support for doing this
-automatically.
-
-C++ with QVariant
-~~~~~~~~~~~~~~~~~
-
-Types should be compatible with C and have the same names.
-
-- geoloc
-+
- struct DGeoLoc {
- double latitude;
- double longitude;
- double altitude; // NaN if unknown.
-
- DGeoLoc();
- DGeoLoc(double, double);
- DGeoLoc(double, double, double);
-
- DGeoLoc (QVariant);
- operator QVariant ();
- };
-+
-Registered as "DGeoLoc" with QMetaType.
-
-- rest identical with C, except "type", hmm...
-
-This is in libdesktoptypes-qt, built from the same desktop-types as
-the C bindings.
-
-
-Run-time introspection for intentional types
---------------------------------------------
-
-libdesktoptypes contains an API for reading a type definition
-repository, in /usr/share/desktop-types/. It can lookup DType values
-given a name.
-
-A DType contains name, doc, parms, and base, of course.
-
-Existing introspection APIs need to be extended to return DTypes, as
-well.
diff --git a/doc/demos.txt b/doc/demos.txt
deleted file mode 100644
index 0add33bc..00000000
--- a/doc/demos.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-Demo / manual test descrption
-
-Feature to be demonstrated:
-- Dropping the context prefix both on provider side and on client side, when doing the dbus traffic.
-
-
-0.
-
-Versions used in this tests:
-
-Latest versions (27.5.2009) of DuiValueSpace and libcontextprovider:
-libcontextprovider0_0.1.8~unreleased_armel.deb
-libduivaluespace0_0.9~unreleased_armel.deb
-
-1a. Build the packages from ContextKit repository (branch removecontextprefix) inside scratchbox.
-Outside scratchbox:
-./autogen.sh --enable-gtk-doc
-./configure
-make
-make clean
-
-Inside scratchbox:
-./configure
-make
-dpkg-buildpackage -b -us -uc -rfakeroot
-
-1b. Build the packages from DuiValueSpace repository (branch dropping-context) inside scratchbox.
-
-Inside scratchbox:
-./configure
-make
-dpkg-buildpackage -b -us -uc -rfakeroot
-
-Note: When these versions are released, they can be obtained directly from Harmattan repository.
-
-
-3. Copy the .deb packages to the device and install them.
-
-On the device:
-4. Install context-subscriber-example.
-
-5. Start monitoring DBus traffic on system bus.
-dbus-monitor --system
-
-6. Run context-subscriber-example.
-
-7. Outcome: Even though the context-provider-example and context-subscriber-example use the keys with "Context." prefix, they still work together, and dbus-monitor shows that the keys are transmitted without the "Context." prefix.
-
-signal sender=:1.15 -> dest=(null destination) serial=38 path=/org/freedesktop/ContextKit/Subscribers/6; interface=org.freedesktop.ContextKit.Subscriber; member=Changed
- array [
- dict entry(
- string "Example.EdgeUp"
- variant int32 3
- )
- ]
- array [
- ]
diff --git a/doc/myfilter.conf b/doc/myfilter.conf
deleted file mode 100644
index d31d92bb..00000000
--- a/doc/myfilter.conf
+++ /dev/null
@@ -1,24 +0,0 @@
-# AsciiDoc filter for graphviz
-
-[svg-template]
-<div class="svg">
-<div class="title">{title}</div>
-<object type="image/svg+xml" data="{file}"></object>
-</div>
-
-[png-template]
-<div class="svg">
-<div class="title">{title}</div>
-<object type="image/png" data="{file}"/>
-</div>
-
-[blockdef-filter]
-ifdef::backend-xhtml11[]
-dotty-style=template="png-template",subs=(),posattrs=("style","file"),filter="dot -Tpng -o{outdir}/{file}; echo"
-endif::backend-xhtml11[]
-
-[macros]
-(?su)[\\]?(?P<name>api):(?P<target>\S*?)(\[(?P<attrlist>.*?)\])=
-
-[api-inlinemacro]
-<a href="../{target}/index.html">{0=<tt>{target}</tt>}</a>
diff --git a/doc/protocol-suggestion.txt b/doc/protocol-suggestion.txt
deleted file mode 100644
index 531d6cd5..00000000
--- a/doc/protocol-suggestion.txt
+++ /dev/null
@@ -1,71 +0,0 @@
-Subscription
-------------
-
-The subscription mechanism would involve sending a Subscribe()
-(preferably without reply) message to the subscriber, and one AddMatch()
-message to the D-Bus daemon for each property subscribed. Unsubscribing
-is similarly straightforward.
-
-This is based on the fact that the provider mainly is interested in the
-fact whether there exists someone at all interested in their exposed
-properties.
-
-However, to handle ungraceful subscribers who don't send Unsubscribe()
-messages when they go away, the provider needs to know its peers. It
-can do so by maintaining an association of property => subscribers
-(using the unique D-Bus name of the sender as subscriber). On receipt
-of an Unsubscribe() message, or a NameOwnerChanged() signal, it needs to
-check if the sender was subscribed to some properties and remove it from
-the mapping. If noone is interested in a property, it should cease
-updating the property to save resources.
-
-Signaling changes
------------------
-
-Properties would be represented as object paths. A subscriber emits a
-ValueChanged() signal whenever a value changes.
-
-One concern is the number of match rules in the D-Bus daemon. This
-approach effectively means one rule per each (subscriber, property)
-pair, contrary to the current way of one rule per subscriber.
-
-Suspending notifications
-
-
-Commanding
-----------
-
-Performance speculations
-------------------------
-
-However the number of messages
-
-With the current implementation, for N subscribers, there are N messages
-emitted (with different object paths). Including the hops between the
-D-Bus daemon that totals in 2*N messages, with the D-Bus daemon having
-to dispatch N incoming messages. Using the new scheme it's only N+1
-messages, and the daemon only has to dispatch 1 message.
-
-The D-Bus interface
--------------------
-
-METHOD VOID Subscribe(ARRAY OF STRING properties)
-
-[ If a subscriber needs to immediately get the value of a property, it
- should call the Get() method. ]
-
-SIGNAL ValueChanged(BOOL unknownp, VARIANT value)
-
-[ The old signature obviously has to change, as now we don't try to
- bundle several properties into one message. If the first boolean
- argument determines whether the value is known or unknown. In the
- latter case, the second argument is to be ignored. Alternatively, the
- unknown value could be represented specially, like an emtpy STRUCT on
- D-Bus, then the BOOL is omitted. ]
-
-METHOD VOID Unsubscribe(ARRAY OF STRING properties)
-
-METHOD VARIANT Get(STRING property)
-
-[ The provider shall _immediately_ return whatever value it has for the
- named property. If it's unknown, then that, but it must not block. ]
diff --git a/doc/use-cases.txt b/doc/use-cases.txt
deleted file mode 100644
index 4f483669..00000000
--- a/doc/use-cases.txt
+++ /dev/null
@@ -1,389 +0,0 @@
-ContextKit Use Cases
-====================
-
-Must Have
----------
-
-3:: Visualizing the situation - Connected/Disconnected. The menu items
-will have different visuals when offline if they require a connection
-to function optimally e.g. Email and online browsing. This should be
-integrated with the appearance of the home screen and within
-applications. (Homecreen, Menu, Connectivity)
-
- Connectivity.HasInternet
-
-5:: Automatic theme change e.g. time / location based themes
-(fun/entertainment). During working hours the theme indicates the user
-is at work, the time and location. The theme can change when work
-hours are typically finished or according to a calendar. When a
-workday is over or it is the weekend the theme could have a different
-feel.
-
- State.Situation
-
-10:: Create reminder to show the note (e.g. shopping list) next time
-visiting local store, create reminder to buy or do X when entering
-store / shopping mall / specific location and time.
-
- Location.PointOfInterest
-
-11:: Device informs me of timezone differences that may affect my
-communications: e.g. calling a contact in LA when in Finland a query
-is shown "it's 3am in LA - are you sure you wish to make the call?"
-
- Location.TimezoneOffset
-
-14:: If user is running and playlist ends then player will repeat the
-playlist rather than stop and require user action to reselect. There
-could be a visual to show the user the playlist is on repeat so they
-know what has happened when they stop.
-
- State.Situation == Running
-
-15:: View meeting location from Calendar meeting invitation, possibility
-to navigate to location from current position
-
- (maps people)
-
-16:: Device offers a city guide or map if in a new location (after
-checking that the local guide/map does not exist). User can choose to
-purchase and use.
-
- Location.City etc
-
-18:: Text-to-speech preview of messages (make "listen" option visible),
-learn if user always wants to hear messages in the car or not
-
- State.Situation == InCar (no learning)
-
-19:: The device becomes aware of the fact, that it is in an office
-environment and assumes a special “profile”, with e.g. discreet
-alarms, homescreen, theme
-
- State.Situation == InOffice
-
-20:: Get location and orientation data when using the device camera. For
-example, this data can be used to created automatic metadata and tags
-to photos and videos when combined with reverse geocoding online
-service or utilized to show nearby POIs and tappable links to them to
-see more info from web/Maps application when watching through the
-camera viewfinder (GPS+accelerometer+magnetometer)
-
- Map context into content ontology.
-
-21:: Automatically disable media online services and RSS feed updates
-when user is roaming or no free Wi-Fi connection available based on
-user preferences/settings
-
- Connectivity.HasInternet
- Connectivity.InternetIsFlatRate
-
-22:: When user is moving enlarge some of the buttons, so that it is
-easier to press those in all media applications
-(GPS+accelerometer). Adjusting the maps interface and/or available
-tools based on user's current activity or mode of traveling (walking,
-driving, etc.)
-
- State.Situation
-
-29:: Highlighted in the soup content and in contacts. Also related
-content can be highlighted in different applications (e.g. browsing
-photos, Jack comes near, all Jack’s pictures are highlighted)
-
- Environment.NearbyContacts
- Environment.ConnectedContacts
-
-30:: Displays relevant content useful for the user - traffic report
-widget in car and during commute time - transit (bus/train schedule,
-stops) information before and during commute time.
-
- State.Situation == Commuting
-
-32:: Connecting to best available connection. If Wlan is available and
-reliable the the device will connect through this. When it is not
-available the device will connect through the next best connect
-possibility. There may be settings for the device to behave
-differently on different connection types.
-
- State.Situation, but mostly connectivity people
-
-41:: Screen brightness increases/decreases depending on the
-environment. For example; driving car at night time, screen is not
-100% bright to save your eyes and not blind you.
-
- Hmmm.
-
-Should Have
------------
-
-4:: Most used applications, links, data (device learns usage
-frequency) appear on the home screen. Or the user can be prompted when
-accessing most used apps whether apps should be added to home screen
-for easy access. Unused apps on the home screen can fade away if not
-used e.g. in a few months? (Except when S&S service priority?)
-+
-Dynamic widgets on the Home screen based on context e.g. if user
-checks weather.com everyday via browser offer to add permanent weather
-widget to home screen.
-
-9:: Create reminder about telling a friend something e.g. when meeting
-him/her the next time (bluetooth/wlan proximity) or when calling next
-time. E.g. see a picture of daughter in Gallery => place reminder to
-book a dentist to her in the next "booking slot". This could also work
-with specific and related files being presented when in a meeting.
-
-12:: The device suggests volume increases in noisy environments. This
-may relate to ringing tone, music playback, movies etc. The volume
-increases in noisy environments and back to the original setting when
-the surrounding alters. The device learns the user patterns e.g. if
-the user regularly overrules suggested adjustments then after a while
-it is switched off.
-
-17:: Reduce WLAN energy consumption by optimizing
-activity. Automatically turn on / increase frequency of WLAN search
-when there is likely to be a hotspot nearby - turn scanning
-off/decrease frequency when it is unlikely (learning user's
-environments and schedule) - user does not have to manually
-activate/disable WLAN search.
-
-23:: Settings: The device learns what the most often used setting items
-are by the user, and always shows those most often used Setting items
-out of the category /or show them on the top of the list.
-
-26:: User is navigating from A to B, in search items "along the route"
-are emphasized (if not navigating, items "close to current location"
-are more important)
-
-27:: User has indicated that he has to be in certain location at certain
-time (e.g. calendar event, setting a "target location" in maps), alarm
-when it's time to leave (based on distance and optionally also traffic
-conditions, mode of traveling, etc.)
-
-28:: Some context-based recommendations, suggestions, etc. showed
-occasionally on the map (needs to be tested with the user if they like
-this..)
-
-34:: When device is on a desk or other hard surface the vibra is not
-used for alerting, just the nice ring tone I've selected
-
-35:: When the device is pulled from pocket/bag turn the background light
-on and show the now playing song/FM radio channel/Internet radio
-channel information on the screen automatically instead of tapping the
-screen or opening the screen lock (ambient light sensor)
-
-38:: When the device is in pocket, the sensitive level of touch screen
-could be lifted to allow small set of gestures even if the device is
-in the pocket (gestures through fabric)
-
-40:: When device is steadily on table and music is playing, the now
-playing view could start showing the song & artist names in large font
-sizes (easy to read even from long distance)
-
-42:: Unplugging headset pauses the music
-
-Nice to Have
-------------
-
-7:: Phone learns from the users behavior, e.g. a user calls home when
-leaving the office every weekday. The device adapts to this and
-provides easy and quick way to perform the task, the user may not be
-aware as the application will be launched in the background. This may
-be in the ‘soup’…the user can look into the future. They can see
-calendar events, and possibilities relating to their usage
-patterns…user can flick the item away if it is not right.
-
-8:: Meeting application: When in the meeting, business cards (with
-photos) are automatically exchanged and visualized in the UI so that
-they help the user to connect names with faces with sitting
-order. This also means contact details can be exchanged.
-
-24:: Application manager: Building In-device recommendation system: The
-devices learns the user’s preferences of applications (by
-analyzing/counting the usage of applications), the recommend the new
-applications to the user to download and install.
-
-25:: Personalization: The device learns the user’s personalization
-preferences (the device could learn this if the user transferring some
-personalization data from the old phone on the first time using the
-new device), and set automatically some personalization settings for
-the user (e.g. Ringing tone, background color, etc.)
-
-31:: The device is set to behave differently in certain modes. For
-example when you are driving you do not want to access your email and
-text messages so automatic messages are broadcasted to any contacts
-letting them know you are driving and will get back them when you are
-done...and possible provide more information.
-
-33:: Shouting “where are you” to the handbag, device turns the lights on
-(easier to find)
-
-36:: Shake device to play/show random media item
-
-37:: When jogging/walking detect the pace and UI could propose songs
-that would fit to the pace
-
-39:: Turn device to jump to next media item + turn to another direction
-to jump to previous media item (same with left/right swipes on touch
-screen)
-
-To be prioritized
------------------
-
-6:: Automatic connections and downloading content. The device
-automatically pulls relevant content, alerts, feed updates, people etc
-when it is connected (this may be set to a specific type of
-connection). The user can review this updated content when they have
-time. There could be a visual feature to show the user what content is
-new/updated. The user may need the ability to teach the device what
-they want to see and when. The device can also learn what the user
-looks at and their usage patterns. This may inform content management
-and filtering information.
-
-
-13:: If there are new albums available from my favorite artists my
-device has already gone and got if for me. I can do preview when
-convenient and then purchase the album if I want. The device suggests
-what I will like based on my usage patterns and links with relevant
-networks and friends. Content could be a playlist entitled "new music
-to try" or somehow be highlighted when appropriate e.g. when listening
-to music which connects in some way to what you're listening to at the
-time e.g. same artist. But as said before it bubbles to the surface,
-or catches you eye in some way, NOT with a pop-up looking for a yes/no
-response. Over time if you don’t play it, it would auto delete. Once
-it catches your eye it would then preview it, then if you want to keep
-it you do one click buy, no further download required, no waiting?
-(just download), just spontaneous enjoyment. Trick we learnt through a
-study is not to start 2nd guessing too soon as it takes time to learn
-and gain trust, on both sides of the relationship.
-
-43:: Weather and Location: Kate is now in Paris. She plans a bit about
-what she wants to do in Paris but she would like more suggestions. She
-checks her mobileand gets some suggestion about where she can go
-today. The mobile suggests that she’d better go to the Louvre museum
-rather than Eiffel tower today because it will be windy and cloudy.
-
-44:: Weather, location and speed: Michi is in Espoo and needs to go to
-Stockmann to meet his wife. He wants to buy some presents for his
-friends. He drives his car to the city center and worries about the
-heavy traffic jam. He put his mobile on the car dock to check a
-possible route. The mobile recommends to park his car at the nearest
-parking lot and take the subway directly to Stockmann.
-
-45:: Weather, location and time: Kate and friends are enjoying the open
-concert near Olympia stadium. The concert started at 7:00 PM and will
-end around 9:00 PM. The mobile suggests some places to get food after
-the concert. The recommended places are mostly in open areas as the
-weather is beautiful. There are free beer coupons on the screen with
-the recommendations. It is sunny outside so they pick on of the
-recommendations.
-
-46:: Weather, location and light: Roope is listening the music he owns
-on his mobile. It seems to be snowy outside and gets dark. His has his
-mobile set to offer him suggestions based on the weather and his
-listening patterns so his playlist suugests a playlist related to the
-snowing season and also has Christmas carols. This selection seems to
-be based on his listening pattern including favorite genre and
-artist. He’s satisfied with some of music on the list and starts play
-one of them.
-
-47:: When tagging there will be keyword suggestions from the context
-engine. E.g. Name of location, weather, office/home and so on. The
-user can browse contents by "cloudy" and photos shows cloudy pictures,
-as previously tagged by the user.
-
-48
-
-49:: User is enjoying media e.g. music player, (internet) radio, images,
-video or television and relevant adverts appear. Example: while
-viewing photos an advert for the local print shop is displayed
-
-50:: User creates or accepts an entry to calendar, maps or to-do-list,
-etc. and related adverts are shown. Example: user ads mom’s birthday
-into calendar and an advert for flowers appears or user plans a route
-in maps and special “Ibis” hotel offers appear along the route
-
-51:: User does a search for adverts based on a specific location or
-context (ad pull).
-+
-Example: a vegetarian tourist arrives at a railway station in an
-unknown city at Sunday 5pm, an ad-search shows English ads for
-vegetarian restaurants in the area which are open now
-
-52:: Users installs an application or widget on her phone which merges
-adverts with other content like weather, news or timetables. Example:
-user installs the “Helsinki weather” widget to her home screen which
-also shows the most appropriate local activities for the current
-weather
-
-53:: If the user visits selected services with Direct UI then adverts
-are more relevant. Example: if the user uses Hotmail from Direct UI
-then advertisers are allowed to know that she belongs to a specific
-target group and that she is currently in Helsinki
-
-
-Notes
------
-
-Widget recommendation in widget library based on users
-interestes, needs and most used applications
-
-Updates management: the canvas probably will be very long,
-there is no sense to update the widget all the time if they
-are invisible in the canvas. So we need some smart management
-system.
-
-Widget functionality: as we all know, the widget is very
-compact and only be able to provide limited functions, so it
-would be great if the widget can provide the functionality
-based on the context.
-
-Widget configuration: if the configuration in the
-corresponding applications has been changed, the widget itself
-might need to be updated too.This can happen automatically.
-
-Prioritize the sharing options based on the context. For
-example, if I am chatting with you, and then I go to share
-with friend, maybe your name should show up on the top. Or if
-the contact bluetooth device is nearby, it would be good if we
-can show it as options for the user.
-
-Send email to nearby contacts. E.g. People in the same meeting
-room to hare some documents
-
-Recipient status. It can give some indication when you can
-expect a reply
-
-Email must react somehow to changes in
-connectivity. E.g. Offering chance for offline browsing, if
-there is no connectivity
-
-Reacting to events. E.g. Silencing notifications of new
-messages when user is in a meeting.
-
-Kath and Hanna have activated WayFinder application, which
-dynamically shows the direction and distance to the other
-person. During the day, Hanna has found an interesting
-Portuguese restaurant and defined a WayFinder anchor point
-there. She now activates the anchor point and her phone shows
-the distance and direction to the restaurant. Kath and Hanna
-start walking towards the restaurant and are ready for a great
-night in Portugal.
-
-Kath has found a nice youth hostel. She takes a photo and
-phone adds compass and GPS information to it. Kath sends the
-MMS to Hanna so that they can find the place
-easily. Additionally location data can also be used in picture
-browser at home.
-
-These areas still need to provide use cases. I am chasing up
-asap.
-
-Assobrowsing
-Tagging
-Sharing
-Advertising - ideas in the vision document. The server is currenly down so this will be done tomorrow.
-Search - suggestions in general should utilize heavily the context information
-Clock & Calendar
-People - contacts
-Places & browser
-
diff --git a/gtk-doc.make b/gtk-doc.make
deleted file mode 100644
index fa7fd6c4..00000000
--- a/gtk-doc.make
+++ /dev/null
@@ -1,201 +0,0 @@
-# -*- mode: makefile -*-
-
-####################################
-# Everything below here is generic #
-####################################
-
-if GTK_DOC_USE_LIBTOOL
-GTKDOC_CC = $(LIBTOOL) --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-GTKDOC_LD = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
-GTKDOC_RUN = $(LIBTOOL) --mode=execute
-else
-GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
-GTKDOC_RUN = sh -c
-endif
-
-# We set GPATH here; this gives us semantics for GNU make
-# which are more like other make's VPATH, when it comes to
-# whether a source that is a target of one rule is then
-# searched for in VPATH/GPATH.
-#
-GPATH = $(srcdir)
-
-TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
-
-EXTRA_DIST = \
- $(content_files) \
- $(HTML_IMAGES) \
- $(DOC_MAIN_SGML_FILE) \
- $(DOC_MODULE)-sections.txt \
- $(DOC_MODULE)-overrides.txt
-
-DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
- $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp
-
-SCANOBJ_FILES = \
- $(DOC_MODULE).args \
- $(DOC_MODULE).hierarchy \
- $(DOC_MODULE).interfaces \
- $(DOC_MODULE).prerequisites \
- $(DOC_MODULE).signals
-
-REPORT_FILES = \
- $(DOC_MODULE)-undocumented.txt \
- $(DOC_MODULE)-undeclared.txt \
- $(DOC_MODULE)-unused.txt
-
-CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS)
-
-if ENABLE_GTK_DOC
-all-local: html-build.stamp
-else
-all-local:
-endif
-
-docs: html-build.stamp
-
-$(REPORT_FILES): sgml-build.stamp
-
-#### scan ####
-
-scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
- @echo 'gtk-doc: Scanning header files'
- @-chmod -R u+w $(srcdir)
- cd $(srcdir) && \
- gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES)
- if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \
- CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
- else \
- cd $(srcdir) ; \
- for i in $(SCANOBJ_FILES) ; do \
- test -f $$i || touch $$i ; \
- done \
- fi
- touch scan-build.stamp
-
-$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp
- @true
-
-#### templates ####
-
-tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
- @echo 'gtk-doc: Rebuilding template files'
- @-chmod -R u+w $(srcdir)
- cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS)
- touch tmpl-build.stamp
-
-tmpl.stamp: tmpl-build.stamp
- @true
-
-tmpl/*.sgml:
- @true
-
-
-#### xml ####
-
-sgml-build.stamp: tmpl.stamp $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files)
- @echo 'gtk-doc: Building XML'
- @-chmod -R u+w $(srcdir)
- cd $(srcdir) && \
- gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS)
- touch sgml-build.stamp
-
-sgml.stamp: sgml-build.stamp
- @true
-
-#### html ####
-
-html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
- @echo 'gtk-doc: Building HTML'
- @-chmod -R u+w $(srcdir)
- rm -rf $(srcdir)/html
- mkdir $(srcdir)/html
- mkhtml_options=""; \
- gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \
- if test "$(?)" = "0"; then \
- mkhtml_options=--path="$(srcdir)"; \
- fi
- cd $(srcdir)/html && gtkdoc-mkhtml $(mkhtml_options) $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
- test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
- @echo 'gtk-doc: Fixing cross-references'
- cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
- touch html-build.stamp
-
-##############
-
-clean-local:
- rm -f *~ *.bak
- rm -rf .libs
-
-distclean-local:
- cd $(srcdir) && \
- rm -rf xml $(REPORT_FILES) \
- $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
-
-maintainer-clean-local: clean
- cd $(srcdir) && rm -rf xml html
-
-install-data-local:
- installfiles=`echo $(srcdir)/html/*`; \
- if test "$$installfiles" = '$(srcdir)/html/*'; \
- then echo '-- Nothing to install' ; \
- else \
- if test -n "$(DOC_MODULE_VERSION)"; then \
- installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
- else \
- installdir="$(DESTDIR)$(TARGET_DIR)"; \
- fi; \
- $(mkinstalldirs) $${installdir} ; \
- for i in $$installfiles; do \
- echo '-- Installing '$$i ; \
- $(INSTALL_DATA) $$i $${installdir}; \
- done; \
- if test -n "$(DOC_MODULE_VERSION)"; then \
- mv -f $${installdir}/$(DOC_MODULE).devhelp2 \
- $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \
- mv -f $${installdir}/$(DOC_MODULE).devhelp \
- $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \
- fi; \
- ! which gtkdoc-rebase >/dev/null 2>&1 || \
- gtkdoc-rebase --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir} ; \
- fi
-
-uninstall-local:
- if test -n "$(DOC_MODULE_VERSION)"; then \
- installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
- else \
- installdir="$(DESTDIR)$(TARGET_DIR)"; \
- fi; \
- rm -rf $${installdir}
-
-#
-# Require gtk-doc when making dist
-#
-#if ENABLE_GTK_DOC
-#dist-check-gtkdoc:
-#else
-#dist-check-gtkdoc:
-# @echo "*** gtk-doc must be installed and enabled in order to make dist"
-# @false
-#endif
-
-# contextkit note: instead of checking the availability of gtk-doc,
-# just make the procedure, without hesitation. gtk-doc + distcheck is
-# so hacky and messed up that we haven't found out a better way yet
-dist-check-gtkdoc: html-build.stamp
-
-dist-hook: dist-check-gtkdoc dist-hook-local
- mkdir $(distdir)/tmpl
- mkdir $(distdir)/xml
- mkdir $(distdir)/html
- -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
- -cp $(srcdir)/xml/*.xml $(distdir)/xml
- cp $(srcdir)/html/* $(distdir)/html
- -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/
- -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/
- cd $(distdir) && rm -f $(DISTCLEANFILES)
- ! which gtkdoc-rebase >/dev/null 2>&1 || \
- gtkdoc-rebase --online --relative --html-dir=$(distdir)/html
-
-.PHONY : dist-hook-local docs
diff --git a/libcontextprovider/.gitignore b/libcontextprovider/.gitignore
deleted file mode 100644
index 5accd1a3..00000000
--- a/libcontextprovider/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-mocs.cpp
-contextprovider-1.0.pc
-/customer-tests/coverage-build/Makefile.coverage
-coverage/
diff --git a/libcontextprovider/Makefile.am b/libcontextprovider/Makefile.am
deleted file mode 100644
index 05a71ad2..00000000
--- a/libcontextprovider/Makefile.am
+++ /dev/null
@@ -1,18 +0,0 @@
-SUBDIRS = src unit-tests doc customer-tests context-provide man
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = contextprovider-1.0.pc
-
-check-sum:
- $(MAKE) -C unit-tests check-sum
-
-coverage: covoptioncheck
- $(MAKE) -C unit-tests coverage
- $(MAKE) -C customer-tests coverage
-
-check-customer:
- $(MAKE) -C customer-tests check-customer
-
-.PHONY: coverage check-sum
-
-include $(top_srcdir)/am/covoptioncheck.am
diff --git a/libcontextprovider/context-provide/.gitignore b/libcontextprovider/context-provide/.gitignore
deleted file mode 100644
index 646c5813..00000000
--- a/libcontextprovider/context-provide/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-context-provide-internal
diff --git a/libcontextprovider/context-provide/Makefile.am b/libcontextprovider/context-provide/Makefile.am
deleted file mode 100644
index 571ecd16..00000000
--- a/libcontextprovider/context-provide/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-bin_PROGRAMS = context-provide-internal
-context_provide_internal_SOURCES = context-provide.cpp commandwatcher.cpp commandwatcher.h
-
-AM_CXXFLAGS = $(QtCore_CFLAGS) $(QtDBus_CFLAGS) \
- '-DCONTEXT_LOG_MODULE_NAME="context-provide"'
-LIBS += $(QtCore_LIBS)
-
-# library dependency hack for seamless make
-AM_CXXFLAGS += -I$(srcdir)/../src \
- -I$(top_srcdir)/common
-
-context_provide_internal_LDADD = ../src/libcontextprovider.la $(top_builddir)/common/libcommon.la
-
-../src/libcontextprovider.la:
- $(MAKE) -C ../src libcontextprovider.la
-
-$(top_builddir)/common/libcommon.la:
- $(MAKE) -C $(top_builddir)/common libcommon.la
-
-.PHONY: ../src/libcontextprovider.la $(top_builddir)/common/libcommon.la
-
-# moccing
-nodist_context_provide_internal_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(context_provide_internal_SOURCES))
-include $(top_srcdir)/am/qt.am
diff --git a/libcontextprovider/context-provide/commandwatcher.cpp b/libcontextprovider/context-provide/commandwatcher.cpp
deleted file mode 100644
index 25092948..00000000
--- a/libcontextprovider/context-provide/commandwatcher.cpp
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * Copyright (C) 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "commandwatcher.h"
-#include "sconnect.h"
-#include <service.h>
-#include <QTextStream>
-#include <QFile>
-#include <QSocketNotifier>
-#include <QStringList>
-#include <QCoreApplication>
-#include <QDebug>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <QMap>
-#include <QDir>
-
-CommandWatcher::CommandWatcher(QString bn, QDBusConnection::BusType bt, int commandfd, QObject *parent) :
- QObject(parent), commandfd(commandfd), out(stdout), busName(bn), busType(bt)
-{
- commandNotifier = new QSocketNotifier(commandfd, QSocketNotifier::Read, this);
- sconnect(commandNotifier, SIGNAL(activated(int)), this, SLOT(onActivated()));
-}
-
-CommandWatcher::~CommandWatcher()
-{
- foreach(Property* p, properties) {
- delete p;
- }
-}
-
-void CommandWatcher::onActivated()
-{
- // read all available input to commandBuffer
- static QByteArray commandBuffer = "";
- static char buf[1024];
- int readSize;
- fcntl(commandfd, F_SETFL, O_NONBLOCK);
- while ((readSize = read(commandfd, &buf, 1024)) > 0)
- commandBuffer += QByteArray(buf, readSize);
-
- // handle all available whole input lines as commands
- int nextSeparator;
- while ((nextSeparator = commandBuffer.indexOf('\n')) != -1) {
- // split lines to separate commands by semicolons
- QStringList commands = QString::fromUtf8(commandBuffer.constData()).left(nextSeparator).split(";");
- foreach (QString command, commands)
- interpret(command.trimmed());
- commandBuffer.remove(0, nextSeparator + 1);
- }
-
- if (readSize == 0) // EOF
- QCoreApplication::exit(0);
-}
-
-void CommandWatcher::help()
-{
- qDebug() << "Available commands:\n";
- qDebug() << " add TYPE KEY [VALUE] - create new key with the given type";
- qDebug() << " KEY=VALUE - set KEY to the given VALUE";
- qDebug() << " unset KEY - sets KEY to unknown";
- qDebug() << " sleep INTERVAL - sleep the INTERVAL amount of seconds";
- qDebug() << " dump [FILENAME] - dump the xml content of the defined props";
- qDebug() << " start - (re)register everything on D-Bus";
- qDebug() << " exit - quit this program";
- qDebug() << "Any unique prefix of a command can be used as an abbreviation";
-}
-
-void CommandWatcher::interpret(const QString& command)
-{
- if (command == "") {
- // Show help
- help();
- } else if (command.contains('=')) {
- // Setter command
- setCommand(command);
- } else {
- QStringList args = command.split(" ");
- QString commandName = args[0];
- args.pop_front();
-
- // Interpret commands
- if (QString("add").startsWith(commandName)) {
- addCommand(args);
- } else if (QString("sleep").startsWith(commandName)) {
- sleepCommand(args);
- } else if (QString("exit").startsWith(commandName)) {
- exit(0);
- } else if (QString("dump").startsWith(commandName)) {
- dumpCommand(args);
- } else if (QString("start").startsWith(commandName)) {
- startCommand();
- } else if (QString("unset").startsWith(commandName)) {
- unsetCommand(args);
- } else
- help();
- }
- out.flush();
-}
-
-QString CommandWatcher::unquote(const QString& str)
-{
- QString m = str;
- if (m.startsWith('"'))
- m = m.right(m.length() - 1);
-
- if (m.endsWith('"'))
- m = m.left(m.length() - 1);
-
- return m;
-}
-
-void CommandWatcher::addCommand(const QStringList& args)
-{
- if (args.count() < 2) {
- qDebug() << "ERROR: need to specify both KEY and TYPE";
- return;
- }
-
- QString keyType = unquote(args.at(0)).toUpper();
- const QString keyName = unquote(args.at(1));
-
- if (keyType != "INT" && keyType != "STRING" &&
- keyType != "DOUBLE" && keyType != "TRUTH" && keyType != "BOOL") {
- qDebug() << "ERROR: Unknown type (has to be: INT, STRING, DOUBLE, BOOL or TRUTH)";
- return;
- }
- if (keyType == "BOOL") keyType = "TRUTH";
-
- if (properties.contains(keyName)) {
- qDebug() << "Already existing key, changing the type and value of it";
- types[keyName] = keyType;
- } else {
- types.insert(keyName, keyType);
- properties.insert(keyName, new Property(keyName));
- out << "Added key: " << keyName << " with type: " << keyType << endl;
- out.flush();
- }
-
- // handle default value
- if (args.count() > 2)
- setCommand(keyName + "=\"" + QStringList(args.mid(2)).join(" ") + "\"");
-}
-
-void CommandWatcher::sleepCommand(const QStringList& args)
-{
- if (args.count() < 1) {
- qDebug() << "ERROR: need to specify sleep INTERVAL";
- return;
- }
-
- int interval = unquote(args.at(0)).toInt();
- out << "Sleeping " << interval << " seconds" << endl;
- out.flush();
- sleep(interval);
-}
-
-void CommandWatcher::dumpCommand(const QStringList &args)
-{
- QString fileName;
- QString dirName;
-
- if (args.size() > 0)
- fileName = args[0];
- else
- fileName = QString("context-provide.context");
- if (!fileName.startsWith("/"))
- fileName = QString("./") + fileName;
-
- if (fileName.indexOf('/') != -1)
- dirName = QString(fileName.left(fileName.lastIndexOf('/'))) + "/";
-
- QDir dir(dirName);
- QString tmpPath = dir.absoluteFilePath("temp-XXXXXX");
- QByteArray templ = tmpPath.toUtf8();
- char *tmpPathChars = (char*) malloc(strlen(templ.data())+1);
- if (tmpPathChars == NULL)
- qFatal("Not enough memory");
- strcpy(tmpPathChars, templ.data());
- int fd = mkstemp(tmpPathChars);
- QFile f;
- f.open(fd, QIODevice::WriteOnly);
- QTextStream xml(&f);
-
- QString bType = (busType == QDBusConnection::SystemBus) ? "system" : "session";
- xml << "<?xml version=\"1.0\"?>\n";
- xml << QString("<provider bus=\"%1\" service=\"%2\">\n").arg(bType).arg(busName);
-
- foreach(QString key, properties.keys()) {
- xml << QString(" <key name=\"%1\">\n").arg(key);
- xml << QString(" <type>%1</type>\n").arg(types.value(key));
- xml << QString(" <doc>A phony but very flexible property.</doc>\n");
- xml << QString(" </key>\n");
- }
- xml << "</provider>\n";
-
- f.close();
- close(fd);
-
- // Atomically rename
- rename(tmpPathChars, fileName.toUtf8().constData());
- free(tmpPathChars);
-
- out << "Wrote " << fileName << endl;
- out.flush();
-}
-
-void CommandWatcher::setCommand(const QString& command)
-{
- const QString keyName = unquote(command.left(command.indexOf('=')).trimmed());
- const QString value = unquote(command.mid(command.indexOf('=')+1).trimmed());
-
- if (! types.contains(keyName)) {
- qDebug() << "ERROR: key" << keyName << "not known/added";
- return;
- }
-
- Property *prop = properties.value(keyName);
- const QString keyType = types.value(keyName);
- QVariant v;
-
- if (keyType == "INT")
- v = QVariant(value.toInt());
- else if (keyType == "STRING")
- v = QVariant(value);
- else if (keyType == "DOUBLE")
- v = QVariant(value.toDouble());
- else if (keyType == "TRUTH") {
- if (value == "True" || value == "true" || value == "1")
- v = QVariant(true);
- else
- v = QVariant(false);
- }
-
- out << "Setting key: " << keyName << " to value: " << v.toString() << endl;
- out.flush();
- prop->setValue(v);
-}
-
-void CommandWatcher::unsetCommand(const QStringList& args)
-{
- if (args.count() < 1) {
- qDebug() << "ERROR: need to specify key to unset";
- return;
- }
-
- QString keyName = unquote(args[0].trimmed());
-
- if (! types.contains(keyName)) {
- qDebug() << "ERROR: key" << keyName << "not known/added";
- return;
- }
-
- Property *prop = properties.value(keyName);
- out << "Setting key: " << keyName << " to unknown" << endl;
- out.flush();
- prop->unsetValue();
-}
-
-void CommandWatcher::startCommand()
-{
- Service service(busType, busName);
- if (!service.start()) {
- qDebug() << "Starting service failed";
- exit(2);
- }
- out << "Service started" << endl;
- out.flush();
-}
diff --git a/libcontextprovider/context-provide/commandwatcher.h b/libcontextprovider/context-provide/commandwatcher.h
deleted file mode 100644
index e8248599..00000000
--- a/libcontextprovider/context-provide/commandwatcher.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef COMMANDWATCHER_H
-#define COMMANDWATCHER_H
-
-#include <QObject>
-#include <QTextStream>
-#include "property.h"
-
-using namespace ContextProvider;
-
-class QFile;
-class QSocketNotifier;
-class QString;
-template <typename K, typename V> class QMap;
-
-class CommandWatcher : public QObject
-{
- Q_OBJECT
-
-public:
- CommandWatcher(QString busName, QDBusConnection::BusType busType, int commandfd, QObject *parent = 0);
- ~CommandWatcher();
- void addCommand(const QStringList& args);
-
-private:
- int commandfd;
- QSocketNotifier *commandNotifier;
- void interpret(const QString& command);
- QMap <QString, QString> types; // key -> type
- QMap <QString, Property*> properties; // property index
- void help();
- QString unquote(const QString& str);
- void unsetCommand(const QStringList& args);
- void setCommand(const QString& command);
- void sleepCommand(const QStringList& args);
- void flushCommand();
- void dumpCommand(const QStringList& args);
- void startCommand();
- QTextStream out;
- bool silent;
- QString busName;
- QDBusConnection::BusType busType;
-
-private slots:
- void onActivated();
-};
-
-#endif
diff --git a/libcontextprovider/context-provide/context-provide.cpp b/libcontextprovider/context-provide/context-provide.cpp
deleted file mode 100644
index c95b6aa4..00000000
--- a/libcontextprovider/context-provide/context-provide.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright (C) 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <QCoreApplication>
-#include <QString>
-#include <QStringList>
-#include <QMap>
-#include <QDebug>
-#include <stdlib.h>
-#include <service.h>
-#include "commandwatcher.h"
-
-using namespace ContextProvider;
-
-#define COMMANDER "org.freedesktop.ContextKit.Commander"
-
-int main(int argc, char **argv)
-{
- QCoreApplication app(argc, argv);
-
- QStringList args = app.arguments();
- QString busName;
- QDBusConnection::BusType busType = QDBusConnection::SessionBus;
- QTextStream out(stdout);
-
- // I hate libtool
-
- // Check that we are not called with our internal name
- if (args[0].endsWith("context-provide-internal") &&
- !args[0].endsWith("lt-context-provide-internal")) {
- out << "Please don't use this binary directly!\n";
- }
-
- if (args.contains("--help") || args.contains("-h") ||
- (args[0].endsWith("context-provide-internal") &&
- !args[0].endsWith("lt-context-provide-internal"))) {
- // Help? Show it and be gone.
- // FIXME: has to replace this with argv[0]
- out << "Usage: context-provide --v2 [--session | --system] [BUSNAME]\n";
- out << "BUSNAME is " COMMANDER " by default, and bus is session.\n";
- return 0;
- }
-
- // Silently dropping --v2
- if (args.contains("--v2")) {
- args.removeAll("--v2");
- }
-
- // session/system
- if (args.contains("--session")) {
- busType = QDBusConnection::SessionBus;
- args.removeAll("--session");
- }
-
- if (args.contains("--system")) {
- busType = QDBusConnection::SystemBus;
- args.removeAll("--system");
- }
-
- if (args.count() < 2) {
- // No arguments at all? Use commander by default.
- args.push_back(COMMANDER);
- }
-
- // Parameter? Extract the session bus and type from it.
- busName = args.at(1);
-
- Service service(busType, busName, false);
- service.setAsDefault();
-
- // 0 -> prog name
- // 1 -> busname
- // 2 -> type of prop1
- // 3 -> name of prop1
- // 4 -> value of prop1
- // 5 -> type of prop2
- // 6 -> name of prop2
- // 7 -> value of prop2
- // ...
- if (args.count() % 3 != 2) {
- qDebug() << "Wrong number of properties\n";
- return 1;
- }
-
- qDebug() << "Service:" << busName.toLocal8Bit().data() << "on" <<
- ((busType == QDBusConnection::SessionBus) ? "session" : "system");
-
-
- CommandWatcher commandWatcher(busName, busType, STDIN_FILENO, QCoreApplication::instance());
-
- for (int i=2; i < args.count(); i+=3)
- commandWatcher.addCommand(args.mid(i, 3));
-
- if (args.count() > 2) {
- qDebug() << "Autostarting the service, since you have had properties on the command line";
- if (!service.start()) {
- qDebug() << "Starting service failed";
- return 2;
- }
- } else {
- qDebug() << "SERVICE NOT STARTED, since you haven't had parameters on the command line";
- qDebug() << "Use the start command when you are ready to be registered on D-Bus";
- }
-
- return app.exec();
-}
diff --git a/libcontextprovider/contextprovider-1.0.pc.in b/libcontextprovider/contextprovider-1.0.pc.in
deleted file mode 100644
index 1a945048..00000000
--- a/libcontextprovider/contextprovider-1.0.pc.in
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: contextprovider
-Description: ContextKit Context Provider library
-Version: @VERSION@
-Requires: QtCore QtDBus dbus-1
-Libs: -L${libdir} -lcontextprovider
-Cflags: -I${includedir}/contextprovider
diff --git a/libcontextprovider/customer-tests/Makefile.am b/libcontextprovider/customer-tests/Makefile.am
deleted file mode 100644
index 70f25e3f..00000000
--- a/libcontextprovider/customer-tests/Makefile.am
+++ /dev/null
@@ -1,19 +0,0 @@
-SUBDIRS = client subscription value-changes types c-api
-
-coverage: covoptioncheck
- COVERAGE=1 ./runTests.sh
-.PHONY: coverage
-
-clean-local:
- -$(MAKE) -C coverage-build clean
- rm -rf coverage
-
-check-customer:
- ./runTests.sh
-
-libcontextprovidertestsdir = $(datadir)/libcontextprovider-tests
-libcontextprovidertests_DATA = tests.xml
-
-EXTRA_DIST = tests.xml coverage-build runTests.sh
-
-include $(top_srcdir)/am/covoptioncheck.am
diff --git a/libcontextprovider/customer-tests/c-api/.gitignore b/libcontextprovider/customer-tests/c-api/.gitignore
deleted file mode 100644
index 0e25a076..00000000
--- a/libcontextprovider/customer-tests/c-api/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-cprovidertests \ No newline at end of file
diff --git a/libcontextprovider/customer-tests/c-api/Makefile.am b/libcontextprovider/customer-tests/c-api/Makefile.am
deleted file mode 100644
index 70926172..00000000
--- a/libcontextprovider/customer-tests/c-api/Makefile.am
+++ /dev/null
@@ -1,10 +0,0 @@
-testdir = $(libdir)/libcontextprovider-tests
-test_PROGRAMS = cprovidertests
-
-cprovidertests_SOURCES = cprovidertests.c
-
-check-customer: $(test_PROGRAMS)
- PATH=../client:$$PATH CONTEXT_LOG_VERBOSITY=WARNING ./.libs/cprovidertests
-
-cprovidertests_CFLAGS = -I$(top_srcdir)/libcontextprovider/src $(GLIB_CFLAGS) $(DBUS_CFLAGS)
-cprovidertests_LDFLAGS = $(GLIB_LIBS) $(DBUS_LIBS) -L$(top_builddir)/libcontextprovider/src/.libs -lcontextprovider
diff --git a/libcontextprovider/customer-tests/c-api/cprovidertests.c b/libcontextprovider/customer-tests/c-api/cprovidertests.c
deleted file mode 100644
index e5431234..00000000
--- a/libcontextprovider/customer-tests/c-api/cprovidertests.c
+++ /dev/null
@@ -1,556 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-/* for dprintf */
-#define _GNU_SOURCE
-
-#include "context_provider.h"
-#include <stdio.h>
-#include <glib.h>
-#include <dbus/dbus.h>
-#include <assert.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <sys/socket.h>
-#include <string.h>
-
-/* Keys (names of the context properties) divided in groups.
-*/
-
-const char *group1_keys[] = {
- "Group1.Int",
- "Group1.Double",
- "Group1.Bool",
- "Group1.String",
- NULL
-};
-
-const char *group2_keys[] = {
- "Group2.Key1",
- "Group2.Key2",
- NULL
-};
-
-const char *single1_key = "Single1.Key";
-const char *single2_key = "Single2.Key";
-
-/*
- Subscription statuses of the keys.
-*/
-int group1_subscribed = 0;
-int group2_subscribed = 0;
-int single1_subscribed = 0;
-int single2_subscribed = 0;
-
-int group1_cb_callcount = 0;
-int group2_cb_callcount = 0;
-int single1_cb_callcount = 0;
-int single2_cb_callcount = 0;
-
-/*
- This function is called when the subscription status of the
- group group1 changes.
-*/
-void group1_cb(int subscribed, void* user_data)
-{
- group1_subscribed = subscribed;
- ++ group1_cb_callcount;
-}
-
-/*
- This function is called when the subscription status of the
- group group2 changes.
-*/
-void group2_cb(int subscribed, void* user_data)
-{
- group2_subscribed = subscribed;
- ++ group2_cb_callcount;
-}
-
-/*
- This function is called when the subscription status of the
- key single1 changes.
-*/
-void single1_cb(int subscribed, void* user_data)
-{
- single1_subscribed = subscribed;
- ++ single1_cb_callcount;
-}
-
-/*
- This function is called when the subscription status of the
- key single2 changes.
-*/
-void single2_cb(int subscribed, void* user_data)
-{
- single2_subscribed = subscribed;
- ++ single2_cb_callcount;
-}
-
-/* Pipes to and from the client program. The test program commands
- the client and checks the output through them.
- */
-int tube[2];
-char line_from_client[1024];
-int chars_read = 0;
-
-char* write_to_client(char* command)
-{
- fd_set read_fds;
- struct timeval tv;
- int ret = -1;
-
- /* Write the command to the client */
- dprintf(tube[1], "%s", command);
-
- /* Process the events until we can read from the client */
- do {
- /*fprintf(stderr, "processing\n");*/
- g_main_context_iteration(NULL, FALSE);
-
- FD_ZERO(&read_fds);
- FD_SET(tube[1], &read_fds);
- tv.tv_sec = 1;
- tv.tv_usec = 0;
-
- /* Note: the "number of file descriptors to check" is not
- 1. It means "starting from file descriptor 0, how many file
- descriptors I need to check".
- */
- ret = select(tube[1]+1, &read_fds, NULL, NULL, &tv);
- } while (ret == 0 || ret == -1);
-
- chars_read = read(tube[1], line_from_client, 1023);
- line_from_client[chars_read] = '\0';
- /*fprintf(stderr, "\"%s\"\n", line_from_client);*/
-
- return 0;
-}
-
-/* A helper function for comparing the actual output (from the client)
- to expected output.
- */
-int compare_output(char* expected)
-{
- int i = 0;
- if (strncmp(line_from_client, expected, chars_read - 1)) {
- fprintf(stderr, "\nActual output : \"%s\"\n", line_from_client);
- fprintf(stderr, "Expected output: \"%s\"\n", expected);
- fprintf(stderr, "Characters read: \"");
- for (i=0; i < chars_read; ++i) fprintf(stderr, "*");
- fprintf(stderr, "\n");
- return 1;
- }
- return 0;
-}
-
-/*
- Test cases. Note that the test cases are *not* independent and
- include only a minimal set of tests for the C api.
-*/
-int test_init()
-{
- /* Test: initialize using the library */
- int ret = context_provider_init (DBUS_BUS_SESSION,
- "org.freedesktop.ContextKit.testProvider");
- /* Expected result: return value == success */
- if (!ret) return 1;
-
- /* Install 2 groups of keys and 2 single keys */
-
- // FIXME: (char **) can be removed if the API got fixed
- context_provider_install_group((char **)group1_keys, TRUE,
- group1_cb, NULL);
- context_provider_install_group((char **)group2_keys, FALSE,
- group2_cb, NULL);
- context_provider_install_key(single1_key, TRUE,
- single1_cb, NULL);
- context_provider_install_key(single2_key, FALSE,
- single2_cb, NULL);
-
- /* Process the events, hoping that the DBus objects now get
- * initialized properly */
- while (g_main_context_pending(NULL)) {
- g_main_context_iteration(NULL, FALSE);
- }
- return 0;
-}
-
-int test_get_subscriber()
-{
- /* Test: Command the client to execute GetSubscriber over DBus. */
- write_to_client("getsubscriber "
- "session org.freedesktop.ContextKit.testProvider\n");
-
- /* Expected result: the client got a correct subscriber path */
- int mismatch = compare_output("GetSubscriber returned "
- "/org/freedesktop/ContextKit/Subscriber/0\n");
- if (mismatch) return 1;
- return 0;
-}
-
-int test_subscription()
-{
- /* Test: Command the client to execute Subscribe over DBus. */
- write_to_client("subscribe org.freedesktop.ContextKit.testProvider "
- "Group1.Int\n");
-
- /* Expected result: the client got the key as Unknown */
- int mismatch = compare_output("Known keys: Unknown keys: Group1.Int \n");
- if (mismatch) return 1;
-
- /* Expected result: we are notified that the client is now subscribed */
- if (!group1_subscribed) return 1;
- if (group1_cb_callcount != 1) return 1;
-
- /* Test: set a value to a key and command the client to subscribe to it */
- context_provider_set_double("Group1.Double", 55.2);
- write_to_client("subscribe org.freedesktop.ContextKit.testProvider "
- "Group1.Double\n");
-
- /* Expected result: the client got the key and the value */
- mismatch = compare_output("Known keys: Group1.Double(double:55.2) "
- "Unknown keys: \n");
- if (mismatch) return 1;
-
- /* Expected result: we are still subscribed but not notified again */
- if (!group1_subscribed) return 1;
- if (group1_cb_callcount != 1) return 1;
-
- /* Test: set 2 more values and command the client to subscribe to them */
- context_provider_set_string("Group1.String", "teststring");
- context_provider_set_boolean("Group1.Bool", 1);
-
- write_to_client("subscribe org.freedesktop.ContextKit.testProvider "
- "Group1.String Group1.Bool Invalid.Key\n");
-
- /* Expected result: the client got the keys and the values */
- mismatch = compare_output("Known keys: Group1.Bool(bool:true) "
- "Group1.String(QString:teststring) "
- "Unknown keys: \n");
- if (mismatch) return 1;
-
- /* Expected result: we are still subscribed but not notified again */
- if (!group1_subscribed) return 1;
- if (group1_cb_callcount != 1) return 1;
-
- /* Expected result: during the whole test, non-relevant callbacks
- * are not called */
- if (group2_cb_callcount != 0) return 1;
- if (single1_cb_callcount != 0) return 1;
- if (single2_cb_callcount != 0) return 1;
-
- return 0;
-}
-
-int test_callbacks()
-{
- /* Test: Command the client to subscribe to a property */
- write_to_client("subscribe org.freedesktop.ContextKit.testProvider "
- "Single1.Key\n");
-
- /* Expected result: we are notified that the client is now subscribed */
- if (!single1_subscribed) return 1;
- if (single1_cb_callcount != 1) return 1;
-
- /* Test: Command the client to unsubscribe */
- write_to_client("unsubscribe org.freedesktop.ContextKit.testProvider "
- "Single1.Key\n");
-
- /* Expected result: we are notified that the client is now unsubscribed */
- if (single1_subscribed) return 1;
- if (single1_cb_callcount != 2) return 1;
-
- return 0;
-}
-
-int test_value_changes()
-{
- /* Test: change a subscribed property and command the client to
- * wait the Changed signal */
- context_provider_set_double("Group1.Double", -41.987);
- write_to_client("waitforchanged 3000\n");
-
- /* Expected result: the client got the signal */
- int mismatch = compare_output("Changed signal received, parameters: "
- "Known keys: Group1.Double(double:-41.987) "
- "Unknown keys: \n");
- if (mismatch) return 1;
-
- write_to_client("resetsignalstatus\n");
-
- /* Test: value changes to unknown */
- context_provider_set_null("Group1.String");
- write_to_client("waitforchanged 3000\n");
-
- /* Expected result: the client got the signal */
- mismatch = compare_output("Changed signal received, parameters: "
- "Known keys: "
- "Unknown keys: Group1.String \n");
- if (mismatch) return 1;
-
- write_to_client("resetsignalstatus\n");
-
- /* Test: non-subscribed property changes */
- context_provider_set_integer("Group2.Key1", -365);
- write_to_client("waitforchanged 3000\n");
-
- /* Expected result: the client doesn't get a signal */
- mismatch = compare_output("Timeout\n");
- if (mismatch) return 1;
-
- /* Test: two properties change at the same time */
- context_provider_set_integer("Group1.Int", 343);
- context_provider_set_boolean("Group1.Bool", 0);
-
- write_to_client("waitforchanged 3000\n");
-
- /* Expected result: the client gets both in the same signal */
- mismatch = compare_output("Changed signal received, parameters: "
- "Known keys: Group1.Bool(bool:false) "
- "Group1.Int(int:343) "
- "Unknown keys: \n");
- if (mismatch) return 1;
-
- write_to_client("resetsignalstatus\n");
-
- /* Test: set two properties the same values they already have */
- context_provider_set_integer("Group1.Int", 343);
- context_provider_set_boolean("Group1.Bool", 0);
-
- write_to_client("waitforchanged 3000\n");
-
- /* Expected result: the client doesn't get a signal */
- mismatch = compare_output("Timeout\n");
- if (mismatch) return 1;
-
- return 0;
-}
-
-int test_unsubscription()
-{
- /* Test: Command the client to unsubscribe from all Group1 keys. */
- write_to_client("unsubscribe org.freedesktop.ContextKit.testProvider "
- "Group1.Int Group1.Bool Group1.Double Group1.String\n");
- /* Expected result: we are notified that group1 is no longer
- * subscribed to*/
- if (group1_subscribed) return 1;
- if (group1_cb_callcount != 2) return 1;
-
- /* Expected result: during the whole test, non-relevant callbacks
- * are not called */
- if (group2_cb_callcount != 0) return 1;
- if (single1_cb_callcount != 2) return 1;
- if (single2_cb_callcount != 0) return 1;
-
- /* Test: unsubscribed properties change */
- context_provider_set_integer("Group1.Int", -8);
- context_provider_set_null("Group1.Bool");
-
- write_to_client("waitforchanged 3000\n");
-
- /* Expected result: the client doesn't get a signal */
- int mismatch = compare_output("Timeout\n");
- if (mismatch) return 1;
-
- return 0;
-}
-
-int test_resetting_values()
-{
- /* Note: group1 and single1 were initialized with
- * reset-to-null=true, group2 and single2 with reset-to-null=false */
-
- /* Test: Command the client to subscribe */
- write_to_client("subscribe org.freedesktop.ContextKit.testProvider "
- "Group1.Int Group2.Key2 Single1.Key Single2.Key\n");
- /* Expected result: the key is in the unknown list*/
- int mismatch = compare_output("Known keys: "
- "Unknown keys: Group1.Int Group2.Key2 "
- "Single1.Key Single2.Key \n");
- if (mismatch) return 1;
-
- /* Test: Set a value to the key */
- context_provider_set_integer("Group1.Int", 44);
- context_provider_set_integer("Group2.Key2", 100);
- context_provider_set_string("Single1.Key", "something");
- context_provider_set_string("Single2.Key", "else");
- write_to_client("waitforchanged 3000\n");
-
- /* Expected result: the client got the signal */
- mismatch = compare_output("Changed signal received, parameters: "
- "Known keys: Group1.Int(int:44) "
- "Group2.Key2(int:100) "
- "Single1.Key(QString:something) "
- "Single2.Key(QString:else) Unknown keys: \n");
- if (mismatch) return 1;
-
- /* Test: Unsubscribe from the keys */
- write_to_client("unsubscribe org.freedesktop.ContextKit.testProvider "
- "Group1.Int Group2.Key2 Single1.Key Single2.Key\n");
-
- /* Test: Subscribe again */
- write_to_client("subscribe org.freedesktop.ContextKit.testProvider "
- "Group1.Int Group2.Key2 Single1.Key Single2.Key\n");
- /* Expected result: the key Group.Int is in the unknown list --
- even if we previously set a value. But the key Group2.Key2 has
- kept its value. The same for Single1.Key and Single2.Key.*/
- mismatch = compare_output("Known keys: Group2.Key2(int:100) "
- "Single2.Key(QString:else) "
- "Unknown keys: Group1.Int Single1.Key \n");
- if (mismatch) return 1;
-
- return 0;
-}
-
-int test_stopping()
-{
- /* Test: Stop the service */
- context_provider_stop();
-
- /* Expected result: the client can no longer get a subscriber */
- write_to_client("getsubscriber "
- "session org.freedesktop.ContextKit.testProvider\n");
-
- /* Expected result: the client got a correct subscriber path */
- int mismatch = compare_output("GetSubscriber error: invalid reply\n");
- if (mismatch) return 1;
-
- return 0;
-}
-
-int run_tests()
-{
- int ret;
-
- fprintf(stderr, "Running test_init... ");
- ret = test_init();
- if (ret) {
- fprintf(stderr, "FAIL\n");
- return ret;
- }
- fprintf(stderr, "PASS\n");
-
- /* Uncomment this if you want to run the test program as a
- stand-alone provider:*/
- /* while (1) g_main_context_iteration(NULL, FALSE);*/
-
- fprintf(stderr, "Running test_get_subscriber... ");
- ret = test_get_subscriber();
- if (ret) {
- fprintf(stderr, "FAIL\n");
- return ret;
- }
- fprintf(stderr, "PASS\n");
-
- fprintf(stderr, "Running test_subscription... ");
- ret = test_subscription();
- if (ret) {
- fprintf(stderr, "FAIL\n");
- return ret;
- }
- fprintf(stderr, "PASS\n");
-
- fprintf(stderr, "Running test_callbacks... ");
- ret = test_callbacks();
- if (ret) {
- fprintf(stderr, "FAIL\n");
- return ret;
- }
- fprintf(stderr, "PASS\n");
-
- fprintf(stderr, "Running test_value_changes... ");
- ret = test_value_changes();
- if (ret) {
- fprintf(stderr, "FAIL\n");
- return ret;
- }
- fprintf(stderr, "PASS\n");
-
- fprintf(stderr, "Running test_unsubscription... ");
- ret = test_unsubscription();
- if (ret) {
- fprintf(stderr, "FAIL\n");
- return ret;
- }
- fprintf(stderr, "PASS\n");
-
- fprintf(stderr, "Running test_resetting_values... ");
- ret = test_resetting_values();
- if (ret) {
- fprintf(stderr, "FAIL\n");
- return ret;
- }
- fprintf(stderr, "PASS\n");
-
-
- fprintf(stderr, "Running test_stopping... ");
- ret = test_stopping();
- if (ret) {
- fprintf(stderr, "FAIL\n");
- return ret;
- }
- fprintf(stderr, "PASS\n");
-
- /* All tests successful */
- return 0;
-}
-
-int main(int argc, char **argv)
-{
- GMainLoop *loop;
- int ret;
-
- /* Initialization */
- loop = g_main_loop_new (NULL, FALSE);
-
- /* Start the client program */
- ret = socketpair(AF_UNIX, SOCK_STREAM, 0, tube);
- assert(ret == 0);
-
- if (fork() == 0) {
- /* child process */
- close(tube[1]);
- dup2(tube[0], 0); /* standard input from the stream pipe */
- dup2(tube[0], 1); /* standard output to the same descriptor */
- close(2); /* close stderr to reduce output when running the test */
-
- char* arg_list[] = {"client", NULL};
- execvp("client", arg_list);
-
- return 1;
- } else {
- /* parent process */
- close(tube[0]);
- sleep(1);
-
- /* Test cases */
- int ret = run_tests();
-
- /* Command the client to exit */
- close(tube[1]);
-
- /* Return the success / failure value */
- return ret;
- }
- return 0;
-}
diff --git a/libcontextprovider/customer-tests/client/.gitignore b/libcontextprovider/customer-tests/client/.gitignore
deleted file mode 100644
index 2a11f8b9..00000000
--- a/libcontextprovider/customer-tests/client/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-client \ No newline at end of file
diff --git a/libcontextprovider/customer-tests/client/Makefile.am b/libcontextprovider/customer-tests/client/Makefile.am
deleted file mode 100644
index 400deea0..00000000
--- a/libcontextprovider/customer-tests/client/Makefile.am
+++ /dev/null
@@ -1,13 +0,0 @@
-testdir = $(libdir)/libcontextprovider-tests
-test_PROGRAMS = client
-
-client_SOURCES = client.cpp commandwatcher.h commandwatcher.cpp
-
-AM_CXXFLAGS = $(QtCore_CFLAGS) $(QtDBus_CFLAGS) -I$(top_srcdir)/common
-
-LIBS += $(QtCore_LIBS) $(QtDBus_LIBS)
-
-# moccing
-nodist_client_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(client_SOURCES))
-include $(top_srcdir)/am/qt.am
diff --git a/libcontextprovider/customer-tests/client/client.cpp b/libcontextprovider/customer-tests/client/client.cpp
deleted file mode 100644
index 11198df0..00000000
--- a/libcontextprovider/customer-tests/client/client.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "commandwatcher.h"
-
-#include <QCoreApplication>
-#include <QDebug>
-
-int main(int argc, char **argv)
-{
- QCoreApplication app(argc, argv);
-
- new CommandWatcher(STDIN_FILENO, QCoreApplication::instance());
-
- return app.exec();
-}
diff --git a/libcontextprovider/customer-tests/client/commandwatcher.cpp b/libcontextprovider/customer-tests/client/commandwatcher.cpp
deleted file mode 100644
index f596be28..00000000
--- a/libcontextprovider/customer-tests/client/commandwatcher.cpp
+++ /dev/null
@@ -1,286 +0,0 @@
-#include "commandwatcher.h"
-#include "sconnect.h"
-#include <QFile>
-#include <QSocketNotifier>
-#include <QStringList>
-#include <QMap>
-#include <QDBusInterface>
-#include <QDBusReply>
-#include <QDBusObjectPath>
-#include <QCoreApplication>
-#include <QDebug>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <QtDBus/QtDBus>
-
-CommandWatcher::CommandWatcher(int commandfd, QObject *parent) :
- QObject(parent), commandfd(commandfd), out(stdout), changedSignalReceived(false)
-{
- fcntl(commandfd, F_SETFL, O_NONBLOCK);
- commandNotifier = new QSocketNotifier(commandfd, QSocketNotifier::Read, this);
- sconnect(commandNotifier, SIGNAL(activated(int)), this, SLOT(onActivated()));
- help();
-}
-
-void CommandWatcher::onActivated()
-{
- // read all available input to commandBuffer
- static QByteArray commandBuffer = "";
- static char buf[1024];
- int readSize;
- while ((readSize = read(commandfd, &buf, 1024)) > 0)
- commandBuffer += QByteArray(buf, readSize);
-
- // handle all available whole input lines as commands
- int nextSeparator;
- while ((nextSeparator = commandBuffer.indexOf('\n')) != -1) {
- // split lines to separate commands by semicolons
- QStringList commands = QString::fromUtf8(commandBuffer.constData()).left(nextSeparator).split(";");
- foreach (QString command, commands)
- interpret(command.trimmed());
- commandBuffer.remove(0, nextSeparator + 1);
- }
-
- if (readSize == 0) // EOF
- QCoreApplication::exit(0);
-}
-
-void CommandWatcher::help()
-{
- qDebug() << "Available commands:";
- qDebug() << " getsubscriber BUSTYPE BUSNAME - execute GetSubscriber over DBus";
- qDebug() << " subscribe BUSNAME KEY... - subscribe to keys for a known BUSNAME";
- qDebug() << " unsubscribe BUSNAME KEY... - unsubscribe from keys for a known BUSNAME";
- qDebug() << " resetsignalstatus - forget any previously received Changed signals";
- qDebug() << " waitforchanged TIMEOUT - wait until the Changed signal arrives over DBus";
- qDebug() << "Any prefix of a command can be used as an abbreviation";
-}
-
-void CommandWatcher::interpret(const QString& command)
-{
- if (command == "") {
- help();
- } else {
- QStringList args = command.split(" ");
- QString commandName = args[0];
- args.pop_front();
-
- if (QString("getsubscriber").startsWith(commandName)) {
- if (args.size() == 2) {
- // Create the DBus connection to the correct bus (session or system)
- QString busType = args.at(0);
- if (busType == "session" || busType == "system") {
- // Store the bus type
- QString busName = args.at(1);
- connectionTypes.insert(busName, busType);
- callGetSubscriber(getConnection(busType), busName);
- }
- else {
- // Print the error message to output (so that the test program waiting for input won't block)
- out << "Error: invalid bus type " << busType << endl;
- }
- }
- else {
- out << "Error: wrong number of parameters" << endl;
- }
- } else if (QString("subscribe").startsWith(commandName)) {
- if (args.size() >= 1) {
- QString busName = args[0];
- args.pop_front();
- callSubscribe(busName, args);
- }
- else
- out << "Error: wrong number of parameters" << endl;
- } else if (QString("unsubscribe").startsWith(commandName)) {
- if (args.size() >= 1) {
- QString busName = args[0];
- args.pop_front();
- callUnsubscribe(busName, args);
- }
- else
- out << "Error: wrong number of parameters" << endl;
- } else if (QString("resetsignalstatus").startsWith(commandName)) {
- resetSignalStatus();
- } else if (QString("waitforchanged").startsWith(commandName)) {
- if (args.size() == 1) {
- bool conversionOk = false;
- int timeout = args.at(0).toInt(&conversionOk);
- if (! conversionOk) {
- out << "Error: parameter " << args.at(0) << " cannot be converted to int" << endl;
- return;
- }
- waitForChanged(timeout);
- }
- else {
- out << "Error: wrong number of parameters" << endl;
- }
- }
- else {
- out << "Error: invalid command" << endl;
- }
- }
-}
-
-void CommandWatcher::callGetSubscriber(QDBusConnection connection, const QString& busName)
-{
- // Call GetSubscriber synchronously
- QDBusInterface manager(busName, "/org/freedesktop/ContextKit/Manager",
- "org.freedesktop.ContextKit.Manager", connection);
- QDBusReply<QDBusObjectPath> reply = manager.call("GetSubscriber");
- if (reply.isValid()) {
- // Store the subscriber path
- QString subscriberPath = reply.value().path();
- subscriberPaths.insert(busName, subscriberPath);
- // And print it out
- out << "GetSubscriber returned " << subscriberPath << endl;
-
- // Start listening to the Changed signal
- connection.connect(busName, subscriberPath, "org.freedesktop.ContextKit.Subscriber", "Changed",
- this, SLOT(onChanged(QMap<QString, QVariant>, QStringList)));
- }
- else {
- out << "GetSubscriber error: invalid reply" << endl;
- // Nullify the subscriber path so that we don't use it accidentally later
- subscriberPaths.remove(busName);
- }
-}
-
-void CommandWatcher::callSubscribe(const QString& busName, const QStringList& args)
-{
- QString subscriberPath = subscriberPaths[busName];
- if (subscriberPath != "") {
- // We have a proper subscriber path
-
- QDBusConnection connection = getConnection(connectionTypes[busName]);
-
- QDBusInterface subscriber(busName, subscriberPath,
- "org.freedesktop.ContextKit.Subscriber", connection);
-
- // Call Subscribe "synchronously", by first
- // constructing an asynchronous call and then waiting
- // for it to be finished. For some reason, it seems
- // that extracting the QMap<QString, QVariant> is
- // tricky without using QDBusPendingReply.
- QDBusPendingReply<QMap<QString, QVariant>, QStringList> reply = subscriber.asyncCall("Subscribe", args);
- reply.waitForFinished();
- if (!reply.isValid()) {
- out << "Subscribe error: invalid reply" << endl;
- return;
- }
-
- QMap<QString, QVariant> knownValues = reply.argumentAt<0>();
- QStringList unknownKeys = reply.argumentAt<1>();
- // Print the return value description
- out << describeValuesAndUnknowns(knownValues, unknownKeys) << endl;
- }
- else {
- out << "Subscribe error: we don't have a subscriber for bus name " << busName << endl;
- }
-}
-
-void CommandWatcher::callUnsubscribe(const QString& busName, const QStringList& args)
-{
- QString subscriberPath = subscriberPaths[busName];
- if (subscriberPath != "") {
- // We have a proper subscriber path
-
- QDBusConnection connection = getConnection(connectionTypes[busName]);
-
- QDBusInterface subscriber(busName, subscriberPath,
- "org.freedesktop.ContextKit.Subscriber", connection);
- // Call Unsubscribe synchronously
- subscriber.call("Unsubscribe", args);
-
- out << "Unsubscribe called" << endl;
- }
- else {
- out << "Unsubscribe error: we don't have a subscriber for bus name " << busName << endl;
- }
-}
-
-void CommandWatcher::resetSignalStatus()
-{
- changedSignalReceived = false;
- changedSignalParameters.clear();
- out << "Signal status resetted" << endl;
-}
-
-void CommandWatcher::waitForChanged(int timeout)
-{
- QTime t;
- t.start();
- while (changedSignalReceived == false && t.elapsed() < timeout) {
- QCoreApplication::processEvents(QEventLoop::AllEvents);
- }
- if (changedSignalReceived) {
- out << "Changed signal received, parameters: " << changedSignalParameters.at(0) << endl;
- }
- else {
- out << "Timeout" << endl;
- }
-}
-
-void CommandWatcher::onChanged(QMap<QString, QVariant> knownValues, QStringList unknownKeys)
-{
- changedSignalReceived = true;
- changedSignalParameters.append(describeValuesAndUnknowns(knownValues, unknownKeys));
-}
-
-QString CommandWatcher::describeValuesAndUnknowns(const QMap<QString, QVariant>& knownValues, QStringList unknownKeys)
-{
- // Compose a string representation of the parameters
- QString parameterDescription;
-
- QStringList knownKeys(knownValues.keys());
- knownKeys.sort();
- unknownKeys.sort();
-
- parameterDescription += "Known keys: ";
- foreach (const QString& key, knownKeys) {
- QVariant value = knownValues[key];
- parameterDescription += (key + "(" + value.typeName() + ":" + describeQVariant(value) + ") ");
- }
-
- parameterDescription +="Unknown keys: ";
- foreach (const QString& key, unknownKeys) {
- parameterDescription += (key + " ");
- }
-
- return parameterDescription;
-}
-
-QString CommandWatcher::describeQVariant(QVariant value)
-{
- QVariant::Type type = value.type();
-
- if (type == QVariant::Bool || type == QVariant::Int || type == QVariant::Double || type == QVariant::String) {
- // Automatic conversion is OK
- return value.toString();
- }
- if (type == QVariant::StringList) {
- return value.toStringList().join("/");
- }
- if (type == QVariant::UserType) {
- QDBusArgument dbusArgument = value.value<QDBusArgument >();
-
- return "";
- /* FIXME: How to extract types like QDate, QTime from this?
- If we know, what type to expect, it goes like this:
-
- QDate date;
- dbusArgument >> date;
- return date.toString();
-
- But how do we find out what type to expect?
- */
- }
- return "";
-}
-
-QDBusConnection CommandWatcher::getConnection(const QString& busType)
-{
- if (busType == "system")
- return QDBusConnection::systemBus();
- return QDBusConnection::sessionBus();
-}
diff --git a/libcontextprovider/customer-tests/client/commandwatcher.h b/libcontextprovider/customer-tests/client/commandwatcher.h
deleted file mode 100644
index 22d7a326..00000000
--- a/libcontextprovider/customer-tests/client/commandwatcher.h
+++ /dev/null
@@ -1,53 +0,0 @@
-#ifndef COMMANDWATCHER_H
-#define COMMANDWATCHER_H
-
-#include <QObject>
-#include <QString>
-#include <QDBusConnection>
-#include <QTextStream>
-#include <QStringList>
-
-class QSocketNotifier;
-
-class CommandWatcher : public QObject
-{
- Q_OBJECT
-public:
- CommandWatcher(int commandfd, QObject *parent = 0);
-private:
- int commandfd;
- QSocketNotifier *commandNotifier;
- void interpret(const QString& command);
- static void help();
- // Processing commands
- void callGetSubscriber(QDBusConnection connection, const QString& busName);
- void callSubscribe(const QString& busName, const QStringList& args);
- void callUnsubscribe(const QString& busName, const QStringList& args);
- void resetSignalStatus();
- void waitForChanged(int timeout);
-
- // Helpers
- QDBusConnection getConnection(const QString& busType);
- QString describeValuesAndUnknowns(const QMap<QString, QVariant>& knownValues, QStringList unknownKeys);
- QString describeQVariant(QVariant value);
-
-private slots:
- void onActivated();
- void onChanged(QMap<QString, QVariant> knownValues, QStringList unknownKeys);
-
-private:
- // The subscriber paths we get from different connections. Note: a
- // restriction: we cannot be connected to [session bus, name x]
- // and [system bus, name x] at the same time.
- QMap<QString, QString> subscriberPaths;
-
- // Connection types for each provider bus name
- QMap<QString, QString> connectionTypes;
-
- QTextStream out;
-
- // Stored data about recevied Changed signals
- bool changedSignalReceived;
- QStringList changedSignalParameters;
-};
-#endif
diff --git a/libcontextprovider/customer-tests/coverage-build/Makefile b/libcontextprovider/customer-tests/coverage-build/Makefile
deleted file mode 100644
index 6f2f925f..00000000
--- a/libcontextprovider/customer-tests/coverage-build/Makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-# The basic idea is that you are using CCache for compiling, so we are
-# happily cleaning your original build, because it can be rebuilt in 2
-# seconds, but coverage build is slow, so we only build coverage for
-# customer tests, not always.
-
-# If you want to build a libcontextprovider with coverage support,
-# you have to run make in this directory, the output is in
-# .libs/libcontextprovider.so.0.0.0
-
-all: clean-orig Makefile.coverage
- $(MAKE) -C ../../../common # redo it now, so it won't be rebuilt with coverage
- $(MAKE) -f Makefile.coverage VPATH=../../src CXXFLAGS=--coverage
-
-Makefile.coverage: ../../src/Makefile clean-orig
- cat $< | sed 's,^srcdir =.*,srcdir = ../../src, ; s,^top_builddir =.*,top_builddir = ../../.., ; s,^top_srcdir =.*,top_srcdir = ../../..,' >$@
- rm -rf .deps
- cp -av ../../src/.deps .
-
-clean: clean-orig
- -$(MAKE) -f Makefile.coverage clean
- rm -f *.gcno
- rm -rf .deps
- rm -rf .libs
- rm -f Makefile.coverage
-
-clean-orig:
- $(MAKE) -C ../../src clean
-
-.PHONY: all clean clean-orig
diff --git a/libcontextprovider/customer-tests/runTests.sh b/libcontextprovider/customer-tests/runTests.sh
deleted file mode 100755
index c88e5967..00000000
--- a/libcontextprovider/customer-tests/runTests.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh -e
-
-DIRS="subscription value-changes types c-api"
-
-make -C client
-
-if [ -n "$COVERAGE" ]
-then
- make -C coverage-build
- export LD_LIBRARY_PATH=../coverage-build/.libs:$LD_LIBRARY_PATH
- rm -rf coverage-build/.libs/*.gcda
-else
- export LD_LIBRARY_PATH=../../src/.libs:$LD_LIBRARY_PATH
- make -C ../src
-fi
-
-for i in $DIRS
-do
- make -C $i check-customer
-done
-
-if [ -n "$COVERAGE" ]
-then
- echo "computing coverage"
- rm -rf coverage
- mkdir -p coverage
- lcov --directory coverage-build/.libs/ --capture --output-file coverage/all.cov
- lcov --extract coverage/all.cov '*/src/*.cpp' --output-file coverage/src.cov
- genhtml -o coverage/ coverage/src.cov
-fi
diff --git a/libcontextprovider/customer-tests/subscription/.gitignore b/libcontextprovider/customer-tests/subscription/.gitignore
deleted file mode 100644
index a520fecb..00000000
--- a/libcontextprovider/customer-tests/subscription/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-subscriptiontests
diff --git a/libcontextprovider/customer-tests/subscription/Makefile.am b/libcontextprovider/customer-tests/subscription/Makefile.am
deleted file mode 100644
index 6d6dc42b..00000000
--- a/libcontextprovider/customer-tests/subscription/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-testdir = $(libdir)/libcontextprovider-tests
-test_PROGRAMS = subscriptiontests
-
-subscriptiontests_SOURCES = subscriptiontests.cpp \
- subscriptiontests.h
-
-check-customer: $(test_PROGRAMS)
- PATH=../client:$$PATH CONTEXT_LOG_VERBOSITY=WARNING ./.libs/subscriptiontests
-
-AM_CXXFLAGS = $(QtCore_CFLAGS) $(QtDBus_CFLAGS) $(QtTest_CFLAGS) -I$(srcdir)/../../src \
- -I$(top_srcdir)/common
-
-LIBS += $(QtCore_LIBS) $(QtDBus_LIBS) $(QtTest_LIBS)
-subscriptiontests_LDADD = ../../src/libcontextprovider.la $(top_builddir)/common/libcommon.la
-
-../../src/libcontextprovider.la:
- $(MAKE) -C ../../src libcontextprovider.la
-
-$(top_builddir)/common/libcommon.la:
- $(MAKE) -C $(top_builddir)/common libcommon.la
-
-.PHONY: ../../libcontextprovider.la $(top_builddir)/libcommon.la
-
-# moccing
-nodist_subscriptiontests_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(subscriptiontests_SOURCES))
-include $(top_srcdir)/am/qt.am
diff --git a/libcontextprovider/customer-tests/subscription/subscriptiontests.cpp b/libcontextprovider/customer-tests/subscription/subscriptiontests.cpp
deleted file mode 100644
index edd52ae3..00000000
--- a/libcontextprovider/customer-tests/subscription/subscriptiontests.cpp
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * This file is part of libcontextprovider.
- *
- * Copyright (C) 2009 Nokia Corporation.
- *
- * Contact: Jean-Luc Lamadon <jean-luc.lamadon@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "subscriptiontests.h"
-#include "sconnect.h"
-
-#include "service.h"
-#include "property.h"
-
-#include <QtTest/QtTest>
-#include <QProcess>
-#include <QStringList>
-
-namespace ContextProvider {
-
-void SubscriptionTests::initTestCase()
-{
-}
-
-void SubscriptionTests::cleanupTestCase()
-{
-}
-
-// Before each test
-void SubscriptionTests::init()
-{
- // Create the services
- service1 = new Service(QDBusConnection::SessionBus, "org.freedesktop.ContextKit.testProvider1");
- test_int = new Property(*service1, "Test.Int");
- test_double = new Property(*service1, "Test.Double");
-
- service2 = new Service(QDBusConnection::SessionBus, "org.freedesktop.ContextKit.testProvider2");
- test_string = new Property (*service2, "Test.String");
- test_bool = new Property(*service2, "Test.Bool");
-
- // Process the events so that the services get started
- QCoreApplication::processEvents(QEventLoop::AllEvents);
-
- // Initialize test program state
- isReadyToRead = false;
-
- // Start the client
- client = new QProcess();
- sconnect(client, SIGNAL(readyReadStandardOutput()), this, SLOT(readStandardOutput()));
- client->start("client");
- // Record whether the client was successfully started
- clientStarted = client->waitForStarted();
-}
-
-// After each test
-void SubscriptionTests::cleanup()
-{
- // Stop the client
- if (clientStarted) {
- client->kill();
- client->waitForFinished();
- }
- delete client; client = NULL;
-
- delete service1; service1 = NULL;
- delete service2; service2 = NULL;
-
- delete test_int; test_int = NULL;
- delete test_double; test_double = NULL;
- delete test_bool; test_bool = NULL;
- delete test_string; test_string = NULL;
-
- // ServiceBackedns are deleted in a deferred way, thus we need to
- // get them deleted
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
-}
-
-void SubscriptionTests::testGetSubscriber()
-{
- // Check that the initialization went well.
- // Doing this only in init() is not enough; doesn't stop the test case.
- QVERIFY(clientStarted);
-
- QString actual = writeToClient("getsubscriber session org.freedesktop.ContextKit.testProvider1\n");
-
- QString expected("GetSubscriber returned /org/freedesktop/ContextKit/Subscriber/0");
- QCOMPARE(actual.simplified(), expected.simplified());
-}
-
-void SubscriptionTests::testGetSubscriberTwice()
-{
- // Check that the initialization went well.
- // Doing this only in init() is not enough; doesn't stop the test case.
- QVERIFY(clientStarted);
-
- // Ask the client to call GetSubscriber
- QString result1 = writeToClient("getsubscriber session org.freedesktop.ContextKit.testProvider1\n");
-
- // Ask the client to call GetSubscriber again
- QString result2 = writeToClient("getsubscriber session org.freedesktop.ContextKit.testProvider1\n");
-
- // Expected result: the client got the same subscriber path twice
- QCOMPARE(result1, result2);
-}
-
-// Note: These tests don't verify that different clients get different
-// subscribers. We might want to add a test case here.
-
-void SubscriptionTests::subscribeReturnValueForUnknownProperty()
-{
- // Check that the initialization went well.
- // Doing this only in init() is not enough; doesn't stop the test case.
- QVERIFY(clientStarted);
-
- // Ask the client to call GetSubscriber, ignore the result
- writeToClient("getsubscriber session org.freedesktop.ContextKit.testProvider1\n");
-
- // Ask the client to call Subscribe with 1 valid key. The property
- // is currently unknown since we haven't set a value for it.
- QString actual = writeToClient("subscribe org.freedesktop.ContextKit.testProvider1 Test.Int\n");
-
- // Expected result: The return value of Subscribe contains the key as unknown.
- QString expected("Known keys: Unknown keys: Test.Int");
- QCOMPARE(actual.simplified(), expected.simplified());
-}
-
-void SubscriptionTests::subscribeReturnValueForKnownProperty()
-{
- // Check that the initialization went well.
- // Doing this only in init() is not enough; doesn't stop the test case.
- QVERIFY(clientStarted);
-
- // Ask the client to call GetSubscriber, ignore the result
- writeToClient("getsubscriber session org.freedesktop.ContextKit.testProvider1\n");
-
- // Set a value for a property
- test_double->setValue(-8.22);
-
- // Ask the client to call Subscribe with 1 valid key. The property
- // has a value we just set.
- QString actual = writeToClient("subscribe org.freedesktop.ContextKit.testProvider1 Test.Double\n");
-
- // Expected result: The return value of Subscribe contains the key and its value.
- QString expected("Known keys: Test.Double(double:-8.22) Unknown keys: ");
- QCOMPARE(actual.simplified(), expected.simplified());
-}
-
-void SubscriptionTests::subscribeReturnValueForInvalidProperty()
-{
- // Check that the initialization went well.
- // Doing this only in init() is not enough; doesn't stop the test case.
- QVERIFY(clientStarted);
-
- // Ask the client to call GetSubscriber, ignore the result
- writeToClient("getsubscriber session org.freedesktop.ContextKit.testProvider1\n");
-
- // Ask the client to call Subscribe with 1 invalid key.
- QString actual = writeToClient("subscribe org.freedesktop.ContextKit.testProvider1 Test.Invalid\n");
-
- // Expected result: The return value of Subscribe contains the key as unknown.
- QString expected("Known keys: Unknown keys: ");
- QCOMPARE(actual.simplified(), expected.simplified());
-}
-
-void SubscriptionTests::subscriberNotifications()
-{
- // Check that the initialization went well.
- // Doing this only in init() is not enough; doesn't stop the test case.
- QVERIFY(clientStarted);
-
- QSignalSpy intItemFirst(test_int, SIGNAL(firstSubscriberAppeared(const QString&)));
- QSignalSpy intItemLast(test_int, SIGNAL(lastSubscriberDisappeared(const QString&)));
- QSignalSpy doubleItemFirst(test_double, SIGNAL(firstSubscriberAppeared(const QString&)));
- QSignalSpy doubleItemLast(test_double, SIGNAL(lastSubscriberDisappeared(const QString&)));
- QSignalSpy stringItemFirst(test_string, SIGNAL(firstSubscriberAppeared(const QString&)));
- QSignalSpy stringItemLast(test_string, SIGNAL(lastSubscriberDisappeared(const QString&)));
- QSignalSpy boolItemFirst(test_bool, SIGNAL(firstSubscriberAppeared(const QString&)));
- QSignalSpy boolItemLast(test_bool, SIGNAL(lastSubscriberDisappeared(const QString&)));
-
- // Ask the client to call GetSubscriber (for both provider bus names), ignore the result
- writeToClient("getsubscriber session org.freedesktop.ContextKit.testProvider1\n");
- writeToClient("getsubscriber session org.freedesktop.ContextKit.testProvider2\n");
-
- // Test: ask the client to call Subscribe with 2 valid keys
- writeToClient("subscribe org.freedesktop.ContextKit.testProvider1 Test.Int Test.Double\n");
-
- // Expected result: we get the notifications for the subscribed keys
- QCOMPARE(intItemFirst.count(), 1);
- QCOMPARE(intItemLast.count(), 0);
-
- QCOMPARE(doubleItemFirst.count(), 1);
- QCOMPARE(doubleItemLast.count(), 0);
-
- // But not for the other ones
- QCOMPARE(stringItemFirst.count(), 0);
- QCOMPARE(stringItemLast.count(), 0);
-
- QCOMPARE(boolItemFirst.count(), 0);
- QCOMPARE(boolItemLast.count(), 0);
-
- // Clear the results
- intItemFirst.clear();
- doubleItemFirst.clear();
-
- // Test: subscribe to one more key (note different bus name)
- writeToClient("subscribe org.freedesktop.ContextKit.testProvider2 Test.Bool\n");
-
- // Expected result: a notification for the corresponding property, not for others
- QCOMPARE(intItemFirst.count(), 0);
- QCOMPARE(intItemLast.count(), 0);
-
- QCOMPARE(doubleItemFirst.count(), 0);
- QCOMPARE(doubleItemLast.count(), 0);
-
- QCOMPARE(boolItemFirst.count(), 1);
- QCOMPARE(boolItemLast.count(), 0);
-
- QCOMPARE(stringItemFirst.count(), 0);
- QCOMPARE(stringItemLast.count(), 0);
-
- // Clear the results
- boolItemFirst.clear();
-
- // Test: Unsubscribe from one of the keys
- writeToClient("unsubscribe org.freedesktop.ContextKit.testProvider1 Test.Double\n");
-
- // Expected result:
- QCOMPARE(intItemFirst.count(), 0);
- QCOMPARE(intItemLast.count(), 0);
-
- QCOMPARE(doubleItemFirst.count(), 0);
- QCOMPARE(doubleItemLast.count(), 1);
-
- QCOMPARE(boolItemFirst.count(), 0);
- QCOMPARE(boolItemLast.count(), 0);
-
- QCOMPARE(stringItemFirst.count(), 0);
- QCOMPARE(stringItemLast.count(), 0);
-
- // Clear the results
- doubleItemLast.clear();
-
- // Unsubscribe from the rest of the keys, too
- writeToClient("unsubscribe org.freedesktop.ContextKit.testProvider1 Test.Int\n");
- writeToClient("unsubscribe org.freedesktop.ContextKit.testProvider2 Test.Bool\n");
-
- // Expected result:
- QCOMPARE(intItemFirst.count(), 0);
- QCOMPARE(intItemLast.count(), 1);
-
- QCOMPARE(doubleItemFirst.count(), 0);
- QCOMPARE(doubleItemLast.count(), 0);
-
- QCOMPARE(boolItemFirst.count(), 0);
- QCOMPARE(boolItemLast.count(), 1);
-
- QCOMPARE(stringItemFirst.count(), 0);
- QCOMPARE(stringItemLast.count(), 0);
-
- // Clear the results
- intItemLast.clear();
- boolItemLast.clear();
-}
-
-void SubscriptionTests::readStandardOutput()
-{
- isReadyToRead = true;
-}
-
-QString SubscriptionTests::writeToClient(const char* input)
-{
- isReadyToRead = false;
- client->write(input);
- client->waitForBytesWritten();
- // Blocking for reading operation is bad idea since the client
- // expects provider to reply to dbus calls
-
- while (!isReadyToRead) {
- QCoreApplication::processEvents(QEventLoop::AllEvents);
- }
- // Return the output from the client
- return client->readAll();
-}
-
-
-} // end namespace
-
-QTEST_MAIN(ContextProvider::SubscriptionTests);
diff --git a/libcontextprovider/customer-tests/subscription/subscriptiontests.h b/libcontextprovider/customer-tests/subscription/subscriptiontests.h
deleted file mode 100644
index 17785e9a..00000000
--- a/libcontextprovider/customer-tests/subscription/subscriptiontests.h
+++ /dev/null
@@ -1,51 +0,0 @@
-#include <QObject>
-
-class QProcess;
-
-namespace ContextProvider {
-
-class Service;
-class Property;
-
-class SubscriptionTests : public QObject
-{
- Q_OBJECT
-
-private:
- Service* service1;
- Property* test_int;
- Property* test_double;
-
- Service* service2;
- Property* test_string;
- Property* test_bool;
-
- QProcess *client;
- bool isReadyToRead;
-
-private slots:
- void initTestCase();
- void cleanupTestCase();
- void init();
- void cleanup();
-
- void testGetSubscriber();
- void testGetSubscriberTwice();
-
- void subscribeReturnValueForUnknownProperty();
- void subscribeReturnValueForKnownProperty();
- void subscribeReturnValueForInvalidProperty();
-
- void subscriberNotifications();
-
-public slots:
- void readStandardOutput();
-
-private:
- QString writeToClient(const char* input);
-
-private:
- bool clientStarted;
-};
-
-} // end namespace
diff --git a/libcontextprovider/customer-tests/tests.xml b/libcontextprovider/customer-tests/tests.xml
deleted file mode 100644
index 1d1fed53..00000000
--- a/libcontextprovider/customer-tests/tests.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<testdefinition version="0.1">
- <suite name="libcontextprovider-tests">
- <set name="libcontextprovider suite" description="libcontextprovider tests">
- <pre_steps>
- </pre_steps>
- <case name="libprov001" description="C API of libcontextprovider" requirement="" timeout="50">
- <step expected_result="0">. /tmp/session_bus_address.user;export PATH=$PATH:.;cd /usr/lib/libcontextprovider-tests/;./cprovidertests</step>
- </case>
- <case name="libprov002" description="Clients subscribing to properties" requirement="" timeout="50">
- <step expected_result="0">. /tmp/session_bus_address.user;export PATH=$PATH:.;cd /usr/lib/libcontextprovider-tests/;./subscriptiontests</step>
- </case>
- <case name="libprov003" description="Properties of different types" requirement="" timeout="50">
- <step expected_result="0">. /tmp/session_bus_address.user;export PATH=$PATH:.;cd /usr/lib/libcontextprovider-tests/;./typestests</step>
- </case>
- <case name="libprov004" description="Clients getting value change notifications" requirement="" timeout="50">
- <step expected_result="0">. /tmp/session_bus_address.user;export PATH=$PATH:.;cd /usr/lib/libcontextprovider-tests/;./valuechangestests</step>
- </case>
-
- <environments>
- <scratchbox>false</scratchbox>
- <hardware>true</hardware>
- </environments>
- </set>
- </suite>
-</testdefinition>
diff --git a/libcontextprovider/customer-tests/types/.gitignore b/libcontextprovider/customer-tests/types/.gitignore
deleted file mode 100644
index 82ac9a25..00000000
--- a/libcontextprovider/customer-tests/types/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-typestests \ No newline at end of file
diff --git a/libcontextprovider/customer-tests/types/Makefile.am b/libcontextprovider/customer-tests/types/Makefile.am
deleted file mode 100644
index 469920b9..00000000
--- a/libcontextprovider/customer-tests/types/Makefile.am
+++ /dev/null
@@ -1,19 +0,0 @@
-testdir = $(libdir)/libcontextprovider-tests
-test_PROGRAMS = typestests
-
-typestests_SOURCES = typestests.cpp typestests.h
-
-check-customer: $(test_PROGRAMS)
- PATH=../client:$$PATH CONTEXT_LOG_VERBOSITY=WARNING ./.libs/typestests
-
-AM_CXXFLAGS = $(QtCore_CFLAGS) $(QtDBus_CFLAGS) $(QtTest_CFLAGS) -I$(srcdir)/../../src -I$(top_srcdir)/common
-LIBS += $(QtCore_LIBS) $(QtDBus_LIBS) $(QtTest_LIBS)
-typestests_LDADD = ../../src/libcontextprovider.la
-../../src/libcontextprovider.la:
- $(MAKE) -C ../../src libcontextprovider.la
-.PHONY: ../../libcontextprovider.la
-
-# moccing
-nodist_typestests_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(typestests_SOURCES))
-include $(top_srcdir)/am/qt.am
diff --git a/libcontextprovider/customer-tests/types/typestests.cpp b/libcontextprovider/customer-tests/types/typestests.cpp
deleted file mode 100644
index 0ac6043d..00000000
--- a/libcontextprovider/customer-tests/types/typestests.cpp
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * This file is part of libcontextprovider.
- *
- * Copyright (C) 2009 Nokia Corporation.
- *
- * Contact: Jean-Luc Lamadon <jean-luc.lamadon@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "typestests.h"
-#include "sconnect.h"
-
-#include <QtTest/QtTest>
-#include <QStringList>
-#include <QProcess>
-
-namespace ContextProvider {
-
-void TypesTests::initTestCase()
-{
-}
-
-void TypesTests::cleanupTestCase()
-{
-}
-
-// Before each test
-void TypesTests::init()
-{
- // Start the services
- service = new Service(QDBusConnection::SessionBus, "org.freedesktop.ContextKit.testProvider1");
-
- intItem = new Property(*service, "Test.Int");
- stringItem = new Property(*service, "Test.String");
- boolItem = new Property(*service, "Test.Bool");
- doubleItem = new Property(*service, "Test.Double");
- stringListItem = new Property(*service, "Test.StringList");
- charItem = new Property(*service, "Test.Char");
- dateItem = new Property(*service, "Test.Date");
- timeItem = new Property (*service, "Test.Time");
-
- // Process the events so that the service gets started
- QCoreApplication::processEvents(QEventLoop::AllEvents);
-
- // Initialize test program state
- isReadyToRead = false;
-
- // Start the client
- client = new QProcess();
- sconnect(client, SIGNAL(readyReadStandardOutput()), this, SLOT(readStandardOutput()));
- client->start("client");
- // Record whether the client was successfully started
- clientStarted = client->waitForStarted();
-}
-
-// After each test
-void TypesTests::cleanup()
-{
- // Stop the client
- if (clientStarted) {
- client->kill();
- client->waitForFinished();
- }
- delete client; client = NULL;
-
- // Stop the service
- service->stop();
-
- delete service; service = NULL;
-
- delete intItem; intItem = NULL;
- delete doubleItem; doubleItem = NULL;
- delete boolItem; boolItem = NULL;
- delete stringItem; stringItem = NULL;
- delete stringListItem; stringListItem = NULL;
- delete charItem; charItem = NULL;
- delete timeItem; timeItem = NULL;
- delete dateItem; dateItem = NULL;
-
- // ServiceBackedns are deleted in a deferred way, thus we need to
- // get them deleted
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
-}
-
-void TypesTests::typesInReturnValueOfSubscribe()
-{
- // Check that the initialization went well.
- // Doing this only in init() is not enough; doesn't stop the test case.
- QVERIFY(clientStarted);
-
- // Ask the client to call GetSubscriber, ignore the result
- writeToClient("getsubscriber session org.freedesktop.ContextKit.testProvider1\n");
-
- // Set some values to the properties
- intItem->setValue(4510);
- doubleItem->setValue(-9.031);
- stringItem->setValue("this-is-a-test-string");
- boolItem->setValue(false);
- QStringList temp;
- temp << "string1" << "string2";
- stringListItem->setValue(temp);
- charItem->setValue(QChar('g'));
- dateItem->setValue(QDate(2009, 8, 5));
- timeItem->setValue(QTime(14, 30, 20));
-
- // Test: subscribe to properties
- QString actual = writeToClient("subscribe org.freedesktop.ContextKit.testProvider1 Test.Int Test.Double "
- "Test.String Test.Bool\n");
-
- // Expected result: the values are printed correctly
- QString expected ="Known keys: Test.Bool(bool:false) Test.Double(double:-9.031) Test.Int(int:4510) "
- "Test.String(QString:this-is-a-test-string) Unknown keys: ";
- QCOMPARE(actual.simplified(), expected.simplified());
-
- // Test: subscribe to more properties
- actual = writeToClient("subscribe org.freedesktop.ContextKit.testProvider1 Test.StringList\n");
-
- // Expected result: the values are printed correctly
- expected = "Known keys: Test.StringList(QStringList:string1/string2) Unknown keys: ";
- QCOMPARE(actual.simplified(), expected.simplified());
-
- /* FIXME: Other types are not working yet.
- // Test: subscribe to more properties
- actual = writeToClient("subscribe org.freedesktop.ContextKit.testProvider1 test.date\n");
-
- // Expected result: the values are printed correctly
- expected = "Known keys: test.stringlist(QDBusArgument:) Unknown keys: ";
- QCOMPARE(actual.simplified(), expected.simplified());
- */
-}
-
-void TypesTests::typesInChangeSignal()
-{
- // Check that the initialization went well.
- // Doing this only in init() is not enough; doesn't stop the test case.
- QVERIFY(clientStarted);
-
- // Ask the client to call GetSubscriber, ignore the result
- writeToClient("getsubscriber session org.freedesktop.ContextKit.testProvider1\n");
-
- // Set some values to the properties
- intItem->setValue(4510);
- doubleItem->setValue(-9.031);
- stringItem->setValue("this-is-a-test-string");
- boolItem->setValue(false);
- QStringList temp;
- temp << "string1" << "string2";
- stringListItem->setValue(temp);
- charItem->setValue(QChar('g'));
- dateItem->setValue(QDate(2009, 8, 5));
- timeItem->setValue(QTime(14, 30, 20));
-
- // Subscribe to properties, ignore the return values
- writeToClient("subscribe org.freedesktop.ContextKit.testProvider1 Test.Int Test.Double "
- "Test.String Test.Bool\n");
- writeToClient("subscribe org.freedesktop.ContextKit.testProvider1 Test.StringList\n");
- //writeToClient("subscribe org.freedesktop.ContextKit.testProvider1 test.char test.date test.time\n");
- // FIXME: Complex types not working yet!
-
- // Test: modify the properties
- intItem->setValue(-11);
- doubleItem->setValue(4.88);
- stringItem->setValue("anotherstring");
- boolItem->setValue(true);
- // And tell the client to wait for Changed signal
- QString actual = writeToClient("waitforchanged 3000\n");
-
- // Expected result: The client got the Changed signal with correct values
- QString expected = "Changed signal received, parameters: Known keys: Test.Bool(bool:true) Test.Double(double:4.88) "
- "Test.Int(int:-11) Test.String(QString:anotherstring) Unknown keys:";
-
- QCOMPARE(actual.simplified(), expected.simplified());
-
- // Reset the client (make it forget the previous Changed signal)
- writeToClient("resetsignalstatus\n");
-
- // Test: modify the properties
- temp.clear();
- temp << "something" << "else" << "here";
- stringListItem->setValue(temp);
- // And tell the client to wait for Changed signal
- actual = writeToClient("waitforchanged 3000\n");
-
- // Expected result: The client got the Changed signal with correct values
- expected = "Changed signal received, parameters: Known keys: "
- "Test.StringList(QStringList:something/else/here) Unknown keys:";
-
- QCOMPARE(actual.simplified(), expected.simplified());
-}
-
-
-void TypesTests::readStandardOutput()
-{
- isReadyToRead = true;
-}
-
-QString TypesTests::writeToClient(const char* input)
-{
- isReadyToRead = false;
- client->write(input);
- client->waitForBytesWritten();
- // Blocking for reading operation is bad idea since the client
- // expects provider to reply to dbus calls
-
- while (!isReadyToRead) {
- QCoreApplication::processEvents(QEventLoop::AllEvents);
- }
- // Return the output from the client
- return client->readAll();
-}
-
-
-} // end namespace
-
-QTEST_MAIN(ContextProvider::TypesTests);
diff --git a/libcontextprovider/customer-tests/types/typestests.h b/libcontextprovider/customer-tests/types/typestests.h
deleted file mode 100644
index 64e67406..00000000
--- a/libcontextprovider/customer-tests/types/typestests.h
+++ /dev/null
@@ -1,50 +0,0 @@
-#include <QString>
-#include <QObject>
-
-#include "service.h"
-#include "property.h"
-
-class QProcess;
-
-namespace ContextProvider {
-
-class Property;
-
-class TypesTests : public QObject
-{
- Q_OBJECT
-
-private:
- Service* service;
- Property* intItem;
- Property* stringItem;
- Property* boolItem;
- Property* doubleItem;
- Property* stringListItem;
- Property* charItem;
- Property* dateItem;
- Property* timeItem;
-
- QProcess *client;
- bool isReadyToRead;
-
-private slots:
- void initTestCase();
- void cleanupTestCase();
- void init();
- void cleanup();
-
- void typesInReturnValueOfSubscribe();
- void typesInChangeSignal();
-
-public slots:
- void readStandardOutput();
-
-private:
- QString writeToClient(const char* input);
-
-private:
- bool clientStarted;
-};
-
-} // end namespace
diff --git a/libcontextprovider/customer-tests/value-changes/.gitignore b/libcontextprovider/customer-tests/value-changes/.gitignore
deleted file mode 100644
index 42203e75..00000000
--- a/libcontextprovider/customer-tests/value-changes/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-valuechangestests \ No newline at end of file
diff --git a/libcontextprovider/customer-tests/value-changes/Makefile.am b/libcontextprovider/customer-tests/value-changes/Makefile.am
deleted file mode 100644
index 1ccf3215..00000000
--- a/libcontextprovider/customer-tests/value-changes/Makefile.am
+++ /dev/null
@@ -1,19 +0,0 @@
-testdir = $(libdir)/libcontextprovider-tests
-test_PROGRAMS = valuechangestests
-
-valuechangestests_SOURCES = valuechangestests.cpp valuechangestests.h
-
-check-customer: $(test_PROGRAMS)
- PATH=../client:$$PATH CONTEXT_LOG_VERBOSITY=WARNING ./.libs/valuechangestests
-
-AM_CXXFLAGS = $(QtCore_CFLAGS) $(QtDBus_CFLAGS) $(QtTest_CFLAGS) -I$(srcdir)/../../src -I$(top_srcdir)/common
-LIBS += $(QtCore_LIBS) $(QtDBus_LIBS) $(QtTest_LIBS)
-valuechangestests_LDADD = ../../src/libcontextprovider.la
-../../src/libcontextprovider.la:
- $(MAKE) -C ../../src libcontextprovider.la
-.PHONY: ../../libcontextprovider.la
-
-# moccing
-nodist_valuechangestests_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(valuechangestests_SOURCES))
-include $(top_srcdir)/am/qt.am
diff --git a/libcontextprovider/customer-tests/value-changes/valuechangestests.cpp b/libcontextprovider/customer-tests/value-changes/valuechangestests.cpp
deleted file mode 100644
index d9dc6a36..00000000
--- a/libcontextprovider/customer-tests/value-changes/valuechangestests.cpp
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * This file is part of libcontextprovider.
- *
- * Copyright (C) 2009 Nokia Corporation.
- *
- * Contact: Jean-Luc Lamadon <jean-luc.lamadon@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "valuechangestests.h"
-#include "sconnect.h"
-
-#include "service.h"
-#include "property.h"
-
-#include <QtTest/QtTest>
-#include <QStringList>
-#include <QProcess>
-
-namespace ContextProvider {
-
-void ValueChangesTests::initTestCase()
-{
-}
-
-void ValueChangesTests::cleanupTestCase()
-{
-}
-
-// Before each test
-void ValueChangesTests::init()
-{
- // Start the services
- service = new Service(QDBusConnection::SessionBus, "org.freedesktop.ContextKit.testProvider1");
- test_int = new Property(*service, "Test.Int");
- test_double = new Property(*service, "Test.Double");
-
- // Process the events so that the services get started
- QCoreApplication::processEvents(QEventLoop::AllEvents);
-
- // Initialize test program state
- isReadyToRead = false;
-
- // Start the client
- client = new QProcess();
- sconnect(client, SIGNAL(readyReadStandardOutput()), this, SLOT(readStandardOutput()));
- client->start("client");
- // Record whether the client was successfully started
- clientStarted = client->waitForStarted();
-}
-
-// After each test
-void ValueChangesTests::cleanup()
-{
- // Stop the client
- if (clientStarted) {
- client->kill();
- client->waitForFinished();
- }
- delete client; client = NULL;
-
- delete service; service = NULL;
-
- delete test_int; test_int = NULL;
- delete test_double; test_double = NULL;
-
- // ServiceBackedns are deleted in a deferred way, thus we need to
- // get them deleted
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
-}
-
-void ValueChangesTests::subscribedPropertyChanges()
-{
- // Check that the initialization went well.
- // Doing this only in init() is not enough; doesn't stop the test case.
- QVERIFY(clientStarted);
-
- // Ask the client to call GetSubscriber, ignore the result
- writeToClient("getsubscriber session org.freedesktop.ContextKit.testProvider1\n");
-
- // Subscribe to a property (which is currently unknown)
- writeToClient("subscribe org.freedesktop.ContextKit.testProvider1 Test.Double\n");
-
- // Test: Change the value of the property
- test_double->setValue(51.987);
- // and tell the client to wait for the Changed signal
- QString actual = writeToClient("waitforchanged 3000\n");
-
- // Expected result: the client got the Changed signal
- QString expected = "Changed signal received, parameters: Known keys: Test.Double(double:51.987) Unknown keys:";
-
- QCOMPARE(actual.simplified(), expected.simplified());
-
- // Reset the signal status of the client (makes it forget that it has received the signal)
- writeToClient("resetsignalstatus\n");
-
- // Test: Change a property to unknown
- test_double->unsetValue();
- // and tell the client to wait for the Changed signal
- actual = writeToClient("waitforchanged 3000\n");
-
- // Expected result: the client got the Changed signal
- expected = "Changed signal received, parameters: Known keys: Unknown keys: Test.Double";
-
- QCOMPARE(actual.simplified(), expected.simplified());
-}
-
-void ValueChangesTests::nonsubscribedPropertyChanges()
-{
- // Check that the initialization went well.
- // Doing this only in init() is not enough; doesn't stop the test case.
- QVERIFY(clientStarted);
-
- // Ask the client to call GetSubscriber, ignore the result
- writeToClient("getsubscriber session org.freedesktop.ContextKit.testProvider1\n");
-
- // Subscribe to a property (which is currently unknown)
- writeToClient("subscribe org.freedesktop.ContextKit.testProvider1 Test.Double\n");
-
- // Test: Change the value of the property
- test_int->setValue(100);
- // and tell the client to wait for the Changed signal
- QString actual = writeToClient("waitforchanged 3000\n");
-
- // Expected result: the client didn't get the Changed signal since it wasn't subscribed
- QString expected = "Timeout";
-
- QCOMPARE(actual.simplified(), expected.simplified());
-
- // Reset the signal status of the client (makes it forget that it has received the signal)
- writeToClient("resetsignalstatus\n");
-
- // Test: Change a property to unknown
- test_int->unsetValue();
- // and tell the client to wait for the Changed signal
- actual = writeToClient("waitforchanged 3000\n");
-
- // Expected result: the client didn't get the Changed signal since it wasn't subscribed
- expected = "Timeout";
-
- QCOMPARE(actual.simplified(), expected.simplified());
-}
-
-void ValueChangesTests::unsubscribedPropertyChanges()
-{
- // Check that the initialization went well.
- // Doing this only in init() is not enough; doesn't stop the test case.
- QVERIFY(clientStarted);
-
- // Ask the client to call GetSubscriber, ignore the result
- writeToClient("getsubscriber session org.freedesktop.ContextKit.testProvider1\n");
-
- // Subscribe to a property (which is currently unknown)
- writeToClient("subscribe org.freedesktop.ContextKit.testProvider1 Test.Double\n");
-
- // Unsubscribe from the property
- writeToClient("unsubscribe org.freedesktop.ContextKit.testProvider1 Test.Double\n");
-
- // Test: Change the value of the property
- test_int->setValue(100);
- // and tell the client to wait for the Changed signal
- QString actual = writeToClient("waitforchanged 3000\n");
-
- // Expected result: the client didn't get the Changed signal since it wasn't subscribed
- QString expected = "Timeout";
-
- QCOMPARE(actual.simplified(), expected.simplified());
-
- // Reset the signal status of the client (makes it forget that it has received the signal)
- writeToClient("resetsignalstatus\n");
-
- // Test: Change a property to unknown
- test_int->unsetValue();
- // and tell the client to wait for the Changed signal
- actual = writeToClient("waitforchanged 3000\n");
-
- // Expected result: the client didn't get the Changed signal since it wasn't subscribed
- expected = "Timeout";
-
- QCOMPARE(actual.simplified(), expected.simplified());
-}
-
-void ValueChangesTests::twoPropertiesChange()
-{
- // Check that the initialization went well.
- // Doing this only in init() is not enough; doesn't stop the test case.
- QVERIFY(clientStarted);
-
- // Ask the client to call GetSubscriber, ignore the result
- writeToClient("getsubscriber session org.freedesktop.ContextKit.testProvider1\n");
-
- // Subscribe to 2 properties (which are currently unknown)
- writeToClient("subscribe org.freedesktop.ContextKit.testProvider1 Test.Int Test.Double\n");
-
- // Test: Change the value of both properties
- test_int->setValue(100);
- test_double->setValue(4.111);
- // and tell the client to wait for the Changed signal
- QString actual = writeToClient("waitforchanged 3000\n");
-
- // Expected result: the client gets one Changed signal with both properties
- QString expected = "Changed signal received, parameters: Known keys: Test.Double(double:4.111) "
- "Test.Int(int:100) Unknown keys:";
-
- QCOMPARE(actual.simplified(), expected.simplified());
-
- // Reset the signal status of the client (makes it forget that it has received the signal)
- writeToClient("resetsignalstatus\n");
-
- // Test: Set both properties to unknown
- test_int->unsetValue();
- test_double->unsetValue();
- // and tell the client to wait for the Changed signal
- actual = writeToClient("waitforchanged 3000\n");
-
- // Expected result: the client gets one Changed signal with both properties
- expected = "Changed signal received, parameters: Known keys: Unknown keys: Test.Double Test.Int";
-
- QCOMPARE(actual.simplified(), expected.simplified());
-
-}
-
-void ValueChangesTests::sameValueSet()
-{
- // Check that the initialization went well.
- // Doing this only in init() is not enough; doesn't stop the test case.
- QVERIFY(clientStarted);
-
- // Ask the client to call GetSubscriber, ignore the result
- writeToClient("getsubscriber session org.freedesktop.ContextKit.testProvider1\n");
-
- // Set a value to a property
- test_int->setValue(555);
-
- // Subscribe to 2 properties (one is currently unknown, the other has a value)
- writeToClient("subscribe org.freedesktop.ContextKit.testProvider1 Test.Int Test.Double\n");
-
- // Test: Set the value of the property to its current value
- test_int->setValue(555);
- // and tell the client to wait for the Changed signal
- QString actual = writeToClient("waitforchanged 3000\n");
-
- // Expected result: the client didn't get the Changed signal since the value didn't really change
- QString expected = "Timeout";
-
- QCOMPARE(actual.simplified(), expected.simplified());
-
- // Reset the signal status of the client (makes it forget that it has received the signal)
- writeToClient("resetsignalstatus\n");
-
- // Test: Unset a property which is already unknown
- test_double->unsetValue();
- // and tell the client to wait for the Changed signal
- actual = writeToClient("waitforchanged 3000\n");
-
- // Expected result: the client didn't get the Changed signal since the value didn't really change
- expected = "Timeout";
-
- QCOMPARE(actual.simplified(), expected.simplified());
-}
-
-void ValueChangesTests::changesBetweenZeroAndUnknown()
-{
- // Check that the initialization went well.
- // Doing this only in init() is not enough; doesn't stop the test case.
- QVERIFY(clientStarted);
-
- // Ask the client to call GetSubscriber, ignore the result
- writeToClient("getsubscriber session org.freedesktop.ContextKit.testProvider1\n");
-
- // Subscribe to a property (which is currently unknown)
- QString actual = writeToClient("subscribe org.freedesktop.ContextKit.testProvider1 Test.Int\n");
-
- // Verify that the property really was unknown
- QString expected = "Known keys: Unknown keys: Test.Int";
- QCOMPARE(actual.simplified(), expected.simplified());
-
- // Test: Change the value of the property to 0
- test_int->setValue(0);
- // and tell the client to wait for the Changed signal
- actual = writeToClient("waitforchanged 3000\n");
-
- // Expected result: the client got the Changed signal
- expected = "Changed signal received, parameters: Known keys: Test.Int(int:0) Unknown keys:";
-
- QCOMPARE(actual.simplified(), expected.simplified());
-
- // Reset the signal status of the client (makes it forget that it has received the signal)
- writeToClient("resetsignalstatus\n");
-
- // Test: Change the property to unknown again
- test_int->unsetValue();
- // and tell the client to wait for the Changed signal
- actual = writeToClient("waitforchanged 3000\n");
-
- // Expected result: the client got the Changed signal
- expected = "Changed signal received, parameters: Known keys: Unknown keys: Test.Int";
-
- QCOMPARE(actual.simplified(), expected.simplified());
-}
-
-void ValueChangesTests::readStandardOutput()
-{
- isReadyToRead = true;
-}
-
-QString ValueChangesTests::writeToClient(const char* input)
-{
- isReadyToRead = false;
- client->write(input);
- client->waitForBytesWritten();
- // Blocking for reading operation is bad idea since the client
- // expects provider to reply to dbus calls
-
- while (!isReadyToRead) {
- QCoreApplication::processEvents(QEventLoop::AllEvents);
- }
- // Return the output from the client
- return client->readAll();
-}
-
-
-} // end namespace
-
-QTEST_MAIN(ContextProvider::ValueChangesTests);
diff --git a/libcontextprovider/customer-tests/value-changes/valuechangestests.h b/libcontextprovider/customer-tests/value-changes/valuechangestests.h
deleted file mode 100644
index 6041f2e7..00000000
--- a/libcontextprovider/customer-tests/value-changes/valuechangestests.h
+++ /dev/null
@@ -1,45 +0,0 @@
-#include <QString>
-#include <QObject>
-
-class QProcess;
-
-namespace ContextProvider {
-
-class Property;
-class Service;
-
-class ValueChangesTests : public QObject
-{
- Q_OBJECT
-
-private:
- Service* service;
- Property* test_int;
- Property* test_double;
-
- QProcess *client;
- bool isReadyToRead;
- bool clientStarted;
-
- QString writeToClient(const char* input);
-
-private slots:
- void initTestCase();
- void cleanupTestCase();
- void init();
- void cleanup();
-
- void subscribedPropertyChanges();
- void nonsubscribedPropertyChanges();
- void unsubscribedPropertyChanges();
-
- void twoPropertiesChange();
- void sameValueSet();
-
- void changesBetweenZeroAndUnknown();
-
-public slots:
- void readStandardOutput();
-};
-
-} // end namespace
diff --git a/libcontextprovider/doc/.gitignore b/libcontextprovider/doc/.gitignore
deleted file mode 100644
index 66a72567..00000000
--- a/libcontextprovider/doc/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-doxygen.log
-html
diff --git a/libcontextprovider/doc/Makefile.am b/libcontextprovider/doc/Makefile.am
deleted file mode 100644
index 627b7778..00000000
--- a/libcontextprovider/doc/Makefile.am
+++ /dev/null
@@ -1,23 +0,0 @@
-if CONTEXTKIT_BUILD_DOCS
-all-local: doxygen
-endif
-
-DOXYCFG = $(srcdir)/doxy.cfg
-
-doxygen:
- @if test x$(srcdir) = x. ; then \
- echo srcdir=$(srcdir) $(DOXYGEN) $(DOXYCFG); \
- srcdir=$(srcdir) $(DOXYGEN) $(DOXYCFG); \
- else \
- echo This is a VPATH build, so not building doxygen; \
- fi
-
-EXTRA_DIST = $(DOXYCFG) html
-
-distclean-local:
- rm -f doxygen.log
-
-maintainer-clean-local:
- rm -rf html
-
-.PHONY: doxygen
diff --git a/libcontextprovider/doc/doc.pri b/libcontextprovider/doc/doc.pri
deleted file mode 100644
index ffb8ae3f..00000000
--- a/libcontextprovider/doc/doc.pri
+++ /dev/null
@@ -1,10 +0,0 @@
-DOXYGEN_BIN=doxygen
-
-QMAKE_EXTRA_UNIX_TARGETS += doc
-doc.target = doc
-isEmpty(DOXYGEN_BIN) {
- doc.commands = @echo "Unable to detect doxygen in PATH"
-} else {
- doc.commands = @$${DOXYGEN_BIN} doc/doxy.cfg ;
-}
-doc.depends = FORCE
diff --git a/libcontextprovider/doc/doxy.cfg b/libcontextprovider/doc/doxy.cfg
deleted file mode 100644
index ed8f8408..00000000
--- a/libcontextprovider/doc/doxy.cfg
+++ /dev/null
@@ -1,152 +0,0 @@
-PROJECT_NAME = libcontextprovider
-PROJECT_NUMBER =
-OUTPUT_DIRECTORY = .
-OUTPUT_LANGUAGE = English
-DISABLE_INDEX = NO
-EXTRACT_ALL = YES
-EXTRACT_PRIVATE = NO
-HIDE_UNDOC_MEMBERS = NO
-HIDE_UNDOC_CLASSES = NO
-HIDE_UNDOC_RELATIONS = YES
-BRIEF_MEMBER_DESC = YES
-REPEAT_BRIEF = YES
-ALWAYS_DETAILED_SEC = NO
-FULL_PATH_NAMES = NO
-STRIP_FROM_PATH =
-INTERNAL_DOCS = NO
-CLASS_DIAGRAMS = YES
-SOURCE_BROWSER = NO
-INLINE_SOURCES = NO
-STRIP_CODE_COMMENTS = YES
-CASE_SENSE_NAMES = NO
-VERBATIM_HEADERS = YES
-SHOW_INCLUDE_FILES = YES
-JAVADOC_AUTOBRIEF = YES
-INHERIT_DOCS = YES
-INLINE_INFO = YES
-SORT_MEMBER_DOCS = YES
-TAB_SIZE = 8
-ENABLED_SECTIONS =
-
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-QUIET = YES
-WARNINGS = YES
-WARN_IF_UNDOCUMENTED = YES
-WARN_FORMAT = "File: $file (row: $line) $text"
-WARN_LOGFILE = "doxygen.log"
-
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-
-#FILE_VERSION_FILTER = "git-log --pretty=format:%H -n 1"
-INPUT = $(srcdir)/../src/ $(srcdir)/../../common/
-FILE_PATTERNS = *.cpp *.h ContextProvider
-RECURSIVE = YES
-EXCLUDE =
-EXCLUDE_PATTERNS = moc_*.cpp *_p.h *_p.cpp ui_* *._* mocs.cpp
-IMAGE_PATH =
-INPUT_FILTER =
-
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-ALPHABETICAL_INDEX = YES
-COLS_IN_ALPHA_INDEX = 5
-IGNORE_PREFIX =
-
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-GENERATE_TESTLIST = YES
-GENERATE_HTML = YES
-HTML_OUTPUT = html
-# HTML_HEADER = @srcdir@/header.html
-# HTML_FOOTER = @srcdir@/footer.html
-HTML_STYLESHEET =
-HTML_ALIGN_MEMBERS = YES
-GENERATE_HTMLHELP = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-GENERATE_LATEX = NO
-#LATEX_OUTPUT = latex
-#COMPACT_LATEX = NO
-#PAPER_TYPE = a4wide
-#EXTRA_PACKAGES =
-#LATEX_HEADER =
-#PDF_HYPERLINKS = NO
-#LATEX_BATCHMODE = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-GENERATE_RTF = NO
-#RTF_OUTPUT = rtf
-#COMPACT_RTF = NO
-#RTF_HYPERLINKS = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-GENERATE_MAN = NO
-#MAN_OUTPUT = man
-#MAN_EXTENSION = .3
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-ENABLE_PREPROCESSING = YES
-MACRO_EXPANSION = NO
-SEARCH_INCLUDES = YES
-INCLUDE_PATH =
-PREDEFINED =
-EXPAND_ONLY_PREDEF = YES
-
-#---------------------------------------------------------------------------
-# Configuration::addtions related to external references
-#---------------------------------------------------------------------------
-
-#TAGFILES = qt.tag
-# GENERATE_TAGFILE = YES
-#ALLEXTERNALS = NO
-#PERL_PATH = /scratchbox/tools/bin
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-HAVE_DOT = NO
-CLASS_GRAPH = NO
-COLLABORATION_GRAPH = NO
-INCLUDE_GRAPH = NO
-GRAPHICAL_HIERARCHY = NO
-#DOT_PATH = /scratchbox/devkits/doctools/bin/
-
-#---------------------------------------------------------------------------
-# Configuration::addtions related to the search engine
-#---------------------------------------------------------------------------
-
-SEARCHENGINE = NO
-#CGI_NAME = search.cgi
-#CGI_URL =
-#DOC_URL =
-#DOC_ABSPATH =
-#BIN_ABSPATH = /usr/local/bin/
-# EXT_DOC_PATHS =
-
-ALIASES += internal="\cond INTERNAL"
-ALIASES += internal_end="\endcond"
-
-ALIASES += reimp="\cond REIMPLEMENTATION"
-ALIASES += reimp_end="\endcond"
diff --git a/libcontextprovider/doc/lgpl-2.1.txt b/libcontextprovider/doc/lgpl-2.1.txt
deleted file mode 100644
index 5ab7695a..00000000
--- a/libcontextprovider/doc/lgpl-2.1.txt
+++ /dev/null
@@ -1,504 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
diff --git a/libcontextprovider/man/Makefile.am b/libcontextprovider/man/Makefile.am
deleted file mode 100644
index 7d5d33d0..00000000
--- a/libcontextprovider/man/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-dist_man_MANS = context-provide-v2.1
diff --git a/libcontextprovider/man/context-provide-v2.1 b/libcontextprovider/man/context-provide-v2.1
deleted file mode 100644
index 855a5521..00000000
--- a/libcontextprovider/man/context-provide-v2.1
+++ /dev/null
@@ -1,93 +0,0 @@
-.TH context-provide-v2 1 Sep-27-2009
-
-.SH NAME
-context-provide-v2
-- A tool to provide ContextKit properties to debug and inspect applictions
-
-.SH SYNOPSIS
-.B context-provide \fI--v2\fR [\fI--session\fR | \fI--system\fR] \fR[\fIBUSNAME\fR] [\fITYPE\fR \fINAME\fR \fIINITVALUE\fR]...
-
-.SH IMPORTANT USAGE NOTE
-Please note that you have to use this program as \fBcontext-provide
---v2\fR for now, where \fB--v2\fR is really mandatory. When the
-transition from old
-.BR context-provide (1)
-is over, this limitation will
-be relaxed, and it will be possible to just call \fBcontext-provide\fR.
-
-.SH DESCRIPTION
-\fBcontext-provide --v2\fR is an interactive tool to set (provide)
-properties of the ContextKit. It can be used to simulate an actual
-provider to debug applications using the ContextKit. When launched,
-the tool presents a simple console where commands can be issued to
-provide new keys and set their values.
-
-Properties can also be provided on the command line with \fITYPE\fR
-\fINAME\fR \fIINITVALUE\fR triplets.
-
-If at least one property is specified on the command line the service
-is autostarted and will start providing the properties right away,
-otherwise you have to use the \fBstart\fR command after all of the
-properties have been added by \fBadd\fR invocations. In both cases
-the service name registered for the service on D-Bus will be \fIBUSNAME\fR.
-
-.SH OPTIONS
-.TP
-\fB--system\fR
-Use the system bus.
-.TP
-\fB--session\fR
-Use the session bus (the default).
-
-.SH COMMANDS
-.TP
-\fBadd\fR \fITYPE\FR \fIKEY\fR [\fIINITVALUE\fR]
-adds a key named \fIKEY\fR with the given \fITYPE\fR to the list of
-provided properties. The initial value will be \fIINITVALUE\fR if
-specified, otherwise unset (null). This has to be called before an
-attempt is made to set a key value. \fITYPE\fR can be: STRING, INT,
-BOOL, DOUBLE. Example: "add INT Battery.Status 20".
-.TP
-\fIKEY\fB=\fIVALUE\fR
-sets the given \fIKEY\fR value to the new \fIVALUE\fR. Example: "Battery.Status=99".
-.TP
-\fBunset\fR \fIKEY\fR
-sets the given \fIKEY\fR to non specified (null).
-.TP
-\fBsleep\fR \fIINTERVAL\fR
-sleeps and blocks the main loop for the given amount of seconds. Used
-mainly for internal testing purposes. Example: "sleep 10".
-.TP
-\fBdump\fR [\fIFILENAME\fR]
-dumps the currently added properties to an XML .context file defined
-by the \fIFILENAME\fR, the default is 'context-provide.context' in the
-current directory.
-.TP
-\fBstart\fR
-try publish the \fIBUSNAME\fR of the provider on D-Bus, exit if it fails.
-.TP
-\fBexit\fR
-exit from the program.
-
-.SH EXAMPLE SESSIONS
-Starts up a provider, initially having a single integer property named
-an.example with the default value of 42.
-
- ./context-provide dbus.service.name int an.example 42
-
-Starts up the provider on the system bus without any properties, then
-add some through the command line interface, note that in this case
-you have to use the \fBstart\fR command after the properties have been
-specified:
-
- ./context-provide --system org.bottomdrawer.kit2000
- add INT example.int 33
- add STRING example.string
- start
- example.string = value1
- example.string = value2
- unset example.int
-
-.SH SEE ALSO
-.BR context-listen (1),
-.BR context-provide (1)
diff --git a/libcontextprovider/src/ContextProvider b/libcontextprovider/src/ContextProvider
deleted file mode 100644
index 70fa62de..00000000
--- a/libcontextprovider/src/ContextProvider
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef CONTEXT_PROVIDER_H
-#define CONTEXT_PROVIDER_H
-
-#include "context/service.h"
-#include "context/property.h"
-#include "context/group.h"
-
-#endif
diff --git a/libcontextprovider/src/Makefile.am b/libcontextprovider/src/Makefile.am
deleted file mode 100644
index 51ea844e..00000000
--- a/libcontextprovider/src/Makefile.am
+++ /dev/null
@@ -1,49 +0,0 @@
-lib_LTLIBRARIES = libcontextprovider.la
-
-libcontextprovider_la_SOURCES = loggingfeatures.h \
- service.h \
- service.cpp \
- property.h \
- property.cpp \
- manager.h \
- manager.cpp \
- manageradaptor.h \
- manageradaptor.cpp \
- group.h \
- group.cpp \
- subscriber.cpp \
- subscriber.h \
- subscriberadaptor.h \
- subscriberadaptor.cpp \
- queuedinvoker.h \
- queuedinvoker.cpp \
- contextc.h \
- contextc.cpp \
- listeners.h \
- listeners.cpp \
- context_provider.h \
- servicebackend.h \
- servicebackend.cpp
-
-includecontextproviderdir=$(includedir)/contextprovider
-includecontextprovider_HEADERS = ContextProvider contextc.h context_provider.h
-includecontextprovidercontextdir=$(includecontextproviderdir)/context
-includecontextprovidercontext_HEADERS = service.h property.h group.h
-
-AM_CXXFLAGS = $(QtCore_CFLAGS) $(QtDBus_CFLAGS) $(DBUS_CFLAGS) \
- -I$(top_srcdir)/common \
- '-DCONTEXT_LOG_MODULE_NAME="libcontextprovider"'
-
-LIBS += $(QtCore_LIBS) $(QtDBus_LIBS)
-libcontextprovider_la_LIBADD=$(top_builddir)/common/libcommon.la
-
-$(top_builddir)/common/libcommon.la:
- $(MAKE) -C $(top_builddir)/common libcommon.la
-
-.PHONY: $(top_builddir)/common/libcommon.la
-
-# moccing
-nodist_libcontextprovider_la_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(libcontextprovider_la_SOURCES))
-include $(top_srcdir)/am/qt.am
-
diff --git a/libcontextprovider/src/context_provider.h b/libcontextprovider/src/context_provider.h
deleted file mode 100644
index 023a2966..00000000
--- a/libcontextprovider/src/context_provider.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef CONTEXT_PROVIDER_H
-#define CONTEXT_PROVIDER_H
-
-#include "contextc.h"
-
-#endif
diff --git a/libcontextprovider/src/contextc.cpp b/libcontextprovider/src/contextc.cpp
deleted file mode 100644
index 2abe1fd0..00000000
--- a/libcontextprovider/src/contextc.cpp
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "contextc.h"
-#include "service.h"
-#include "property.h"
-#include "group.h"
-#include "logging.h"
-#include "sconnect.h"
-#include "listeners.h"
-#include "loggingfeatures.h"
-
-#include <QCoreApplication>
-
-namespace ContextProvider {
-}
-
-using namespace ContextProvider;
-
-/*!
- \page CApi C Api
-
- \brief The libcontextprovider library offers a simple plain-C API to be used
- from any C program.
-
- \section Usage
-
- \code
- context_provider_init(DBUS_BUS_SESSION, "org.test.provider");
-
- context_provider_install_key("Battery.OnBattery", 0, NULL, NULL);
- context_provider_install_key("Battery.ChargePercentage", 0, NULL, NULL);
-
- context_provider_set_boolean("Battery.OnBattery", 1);
- context_provider_set_integer("Battery.ChargePercentage", 55);
- \endcode
-
- The above code snippet starts a service at "org.test.provider" with two
- keys ("Battery.OnBattery", "Battery.ChargePercentage") and sets their
- respective values.
-
- Note: If the provider used other D-Bus bindings than QDBus, the
- service name ("org.test.provider") needs to be unique, i.e., the
- provider process should not register it itself.
-
- \section Callbacks
-
- The context_provider_install_key function and context_provider_install_group function
- take arguments specyfying the callback function. The callback is executed when the
- subscription status changes for the key or the key group (first subscriber
- appears or last subscriber goes away). Basing on this info the provider can
- manage it's resources. It's okay also to use the callback function to actually
- set the value.
-
- \code
- void callback_function_example(int subscribed, void* user_data)
- {
- if (subscribed) {
- // First subscriber appeared.
- // Start ie. pooling the data.
- } else {
- // Last subscribed disappeared.
- // Stop pooling data, release resources.
- }
- }
- \endcode
-*/
-
-static Service *cService;
-
-QList<Listener*> *listeners = NULL;
-
-char argv[] = "libcontextprovider";
-char* p= argv;
-int argc = 1;
-QCoreApplication* app = 0;
-
-/// Initializes and starts the service with a given \a bus_type and a \a bus_name.
-/// The \a bus_type can be DBUS_BUS_SESSION or DBUS_BUS_SYSTEM. This function can be
-/// called only once till a matching context_provider_stop is called.
-int context_provider_init (DBusBusType bus_type, const char* bus_name)
-{
- contextDebug() << F_C << bus_name;
-
- if (QCoreApplication::instance() == 0) {
- // No QCoreApplication created, so crate one.
- // This will also create an event dispatcher (QEventDispatcherGlibPrivate.)
- app = new QCoreApplication(argc, &p);
- }
-
- if (cService != NULL) {
- contextCritical() << "Service already initialize. You can only initialize one service with C API";
- return 0;
- }
-
- cService = new Service(bus_type == DBUS_BUS_SESSION
- ? QDBusConnection::SessionBus
- : QDBusConnection::SystemBus,
- bus_name);
- listeners = new QList<Listener*>;
-
- return 1;
-}
-
-/// Stops the currently started service with context_provider_init. After calling
-/// this function a new service can be started by calling context_provider_init.
-void context_provider_stop (void)
-{
- contextDebug() << F_C;
- if (cService) {
- contextDebug() << "Stopping service";
-
- // Delete all listeners
- if (listeners) {
- foreach (Listener *listener, *listeners)
- delete listener;
- }
- delete listeners; listeners = NULL;
-
- delete cService;
- cService = NULL;
- }
- // FIXME: Do we need to do something with the QCoreApplication we might have constructed?
-}
-
-/// Installs (adds) a \a key to be provided by the service. The callback function \a
-/// subscription_changed_cb will be called with the passed user data \a subscription_changed_cb_target
-/// when the status of the subscription changes -- when the first subscriber appears or the
-/// last subscriber disappears. The \a clear_values_on_subscribe when enabled will automatically
-/// clear (set to null/undetermined) the group keys on first subscribe.
-void context_provider_install_key (const char* key,
- int clear_values_on_subscribe,
- ContextProviderSubscriptionChangedCallback subscription_changed_cb,
- void* subscription_changed_cb_target)
-{
- contextDebug() << F_C << key;
-
- if (! cService) {
- contextCritical() << "Can't install key:" << key << "because no service started.";
- return;
- }
-
- listeners->append(new PropertyListener(*cService, key,
- clear_values_on_subscribe,
- subscription_changed_cb, subscription_changed_cb_target));
- cService->restart();
-}
-
-/// Installs (adds) a \a key_group to be provided by the service. The \a key_group is a NULL-terminated
-/// array containing the keys. The callback function \a subscription_changed_cb will be called with the
-/// passed user data \a subscription_changed_cb_target when the status of the subscription changes --
-/// when the first subscriber appears or the last subscriber disappears. The \a clear_values_on_subscribe
-/// when enabled will automatically clear (set to null/undetermined) the group keys on first subscribe.
-void context_provider_install_group (char* const * key_group,
- int clear_values_on_subscribe,
- ContextProviderSubscriptionChangedCallback subscription_changed_cb,
- void* subscription_changed_cb_target)
-{
- contextDebug() << F_C;
-
- if (! cService) {
- contextCritical() << "Can't install key group because no service started.";
- return;
- }
-
- QStringList keys;
- int i = 0;
- while(key_group[i] != NULL) {
- QString key = QString(key_group[i]);
-
- keys << key;
- i++;
- }
-
- listeners->append(new GroupListener(*cService, keys,
- clear_values_on_subscribe,
- subscription_changed_cb, subscription_changed_cb_target));
- cService->restart();
-}
-
-/// Sets the \a key to a specified integer \a value.
-void context_provider_set_integer (const char* key, int value)
-{
- contextDebug() << F_C << key << value;
- if (cService)
- cService->setValue(key, value);
-}
-
-/// Sets the \a key to a specified double \a value.
-void context_provider_set_double (const char* key, double value)
-{
- contextDebug() << F_C << key << value;
- if (cService)
- cService->setValue(key, value);
-}
-
-/// Sets the \a key to a specified boolean \a value.
-void context_provider_set_boolean (const char* key, int value)
-{
- contextDebug() << F_C << key << value;
- if (cService)
- cService->setValue(key, (value != 0));
-}
-
-/// Sets the \a key to a specified string \a value.
-void context_provider_set_string (const char* key, const char* value)
-{
- contextDebug() << F_C << key << value;
- if (cService)
- cService->setValue(key, value);
-}
-
-/// Sets the \a key to NULL. In other words - unsets the key.
-void context_provider_set_null (const char* key)
-{
- contextDebug() << F_C << key;
- if (cService)
- cService->setValue(key, QVariant());
-}
diff --git a/libcontextprovider/src/contextc.h b/libcontextprovider/src/contextc.h
deleted file mode 100644
index ee5ea3de..00000000
--- a/libcontextprovider/src/contextc.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef CONTEXT_C_H
-#define CONTEXT_C_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdlib.h>
-#include <dbus/dbus.h>
-
-typedef void (*ContextProviderSubscriptionChangedCallback) (int subscribe, void* user_data);
-
-int
-context_provider_init (DBusBusType bus_type,
- const char* bus_name);
-
-void
-context_provider_stop (void);
-
-void
-context_provider_install_key (const char* key,
- int clear_values_on_subscribe,
- ContextProviderSubscriptionChangedCallback subscription_changed_cb,
- void* subscription_changed_cb_target);
-
-void
-context_provider_install_group (char* const * key_group,
- int clear_values_on_subscribe,
- ContextProviderSubscriptionChangedCallback subscription_changed_cb,
- void* subscription_changed_cb_target);
-
-void
-context_provider_set_integer (const char* key, int value);
-
-void
-context_provider_set_double (const char* key, double value);
-
-void
-context_provider_set_boolean (const char* key, int value);
-
-void
-context_provider_set_string (const char* key, const char* value);
-
-void
-context_provider_set_null (const char* key);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/libcontextprovider/src/group.cpp b/libcontextprovider/src/group.cpp
deleted file mode 100644
index 16fe8166..00000000
--- a/libcontextprovider/src/group.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "group.h"
-#include "service.h"
-#include "property.h"
-#include "sconnect.h"
-#include "logging.h"
-#include "loggingfeatures.h"
-
-namespace ContextProvider {
-
-/*! \class Group ContextProvider ContextProvider
-
- \brief Groups the firstSubscriberAppeared and
- lastSubscriberDisappeared from multiple Property objects together.
-
- Group is useful in cases when multiple properties are provided by
- the same source, such as a hardware sensor. When any of these
- properties is subscribed to, the source needs to be turned on, and
- when none of these properties are subscribed to, the source needs
- to be turned off.
-
- For example,
- \code
- Property location("Location");
- Property altitude("Altitude");
-
- Group gps;
- gps << location << altitude;
-
- connect(gps, SIGNAL(firstSubscriberAppeared()), this, SLOT(turnGpsOn()));
- connect(gps, SIGNAL(lastSubscriberDisappeared()), this, SLOT(onGpsOff()));
- \endcode
-
- This way, the provider doesn't need to store the subscription
- statuses of the related keys.
-
- Initially, none of the Property objects related to a Group
- are subscribed to. When some of them are subscribed to,
- Group emits the firstSubscriberAppeared signal. When all
- of them are again unsubscribed, Group emits the
- lastSubscriberDisappeared signal.
-
-*/
-
-struct GroupPrivate {
- int propertiesSubscribedTo;
- QSet<const Property *> properties;
-};
-
-/// Contructs an empty Group object with the given parent.
-Group::Group(QObject* parent)
- : QObject(parent)
-{
- contextDebug() << F_GROUP << "Creating new Group";
-
- priv = new GroupPrivate;
- priv->propertiesSubscribedTo = 0;
-}
-
-/// Adds a Property object to the Group. The Property object needs to
-/// exist as long as the Group object is in use.
-void Group::add(const Property &property)
-{
- contextDebug() << F_GROUP << "Adding property" << property.key();
-
- priv->properties << &property;
- sconnect(&property, SIGNAL(firstSubscriberAppeared(const QString&)),
- this, SLOT(onFirstSubscriberAppeared()));
- sconnect(&property, SIGNAL(lastSubscriberDisappeared(const QString&)),
- this, SLOT(onLastSubscriberDisappeared()));
-}
-
-/// Returns the set of properties currently belonging to the Group.
-QSet<const Property *> Group::getProperties()
-{
- return priv->properties;
-}
-
-/// Called when some of the watched Property objects are subscribed to.
-void Group::onFirstSubscriberAppeared()
-{
- ++(priv->propertiesSubscribedTo);
- if (priv->propertiesSubscribedTo == 1) {
- contextDebug() << F_GROUP << F_SIGNALS << "First subscriber appeared for group";
- emit firstSubscriberAppeared();
- }
-}
-
-/// Called when all of the watched Property objects are unsubscribed from.
-void Group::onLastSubscriberDisappeared()
-{
- --(priv->propertiesSubscribedTo);
- if (priv->propertiesSubscribedTo == 0) {
- contextDebug() << F_GROUP << F_SIGNALS << "Last subscriber gone for group";
- emit lastSubscriberDisappeared();
- }
-}
-
-/// Returns true iff any Property objects in the group are subscribed to.
-bool Group::isSubscribedTo() const
-{
- return (priv->propertiesSubscribedTo > 0);
-}
-
-/// Destructor
-Group::~Group()
-{
- contextDebug() << F_GROUP << F_DESTROY << "Destroying Group";
- delete priv;
-}
-
-} // end namespace
diff --git a/libcontextprovider/src/group.h b/libcontextprovider/src/group.h
deleted file mode 100644
index 9969a6e7..00000000
--- a/libcontextprovider/src/group.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef GROUP_H
-#define GROUP_H
-
-#include <QObject>
-#include <QSet>
-#include <QStringList>
-
-namespace ContextProvider {
-
-class Property;
-class Service;
-
-class GroupPrivate;
-
-class Group : public QObject
-{
- Q_OBJECT
-
-public:
- explicit Group(QObject* parent = 0);
- ~Group();
-
- void add(const Property &prop);
-
- bool isSubscribedTo() const;
- QSet<const Property *> getProperties();
-
- inline Group &operator<<(const Property &prop)
- { add(prop); return *this; }
-
- inline Group &operator<<(const Property *prop)
- { add(*prop); return *this; }
-
-signals:
- /// Emitted when the group of Context objects is subscribed
- /// to. I.e., when none of them were subscribed to and now some of
- /// them were subscribed to.
- void firstSubscriberAppeared();
-
- /// Emitted when the group of Context objects is unsubscribed
- /// from. I.e., when some of them were subscribed to and now all of
- /// them were unsubscribed from.
- void lastSubscriberDisappeared();
-
-private slots:
- void onFirstSubscriberAppeared();
- void onLastSubscriberDisappeared();
-
-private:
- GroupPrivate *priv;
-};
-
-} // end namespace
-
-#endif
diff --git a/libcontextprovider/src/listeners.cpp b/libcontextprovider/src/listeners.cpp
deleted file mode 100644
index 8c200b7c..00000000
--- a/libcontextprovider/src/listeners.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "listeners.h"
-#include "sconnect.h"
-
-namespace ContextProvider {
-
-Listener::Listener(bool clears, ContextProviderSubscriptionChangedCallback cb, void *dt)
- : callback(cb), user_data(dt), clearsOnSubscribe(clears)
-{
-}
-
-void Listener::onFirstSubscriberAppeared()
-{
- if (clearsOnSubscribe)
- clear();
-
- if (callback)
- callback(1, user_data);
-}
-
-void Listener::onLastSubscriberDisappeared()
-{
- if (callback)
- callback(0, user_data);
-}
-
-PropertyListener::PropertyListener(Service &service, const QString &key,
- bool clears, ContextProviderSubscriptionChangedCallback cb, void *dt)
- : Listener(clears, cb, dt), prop(service, key, this)
-{
- sconnect(&prop, SIGNAL(firstSubscriberAppeared(QString)), this, SLOT(onFirstSubscriberAppeared()));
- sconnect(&prop, SIGNAL(lastSubscriberDisappeared(QString)), this, SLOT(onLastSubscriberDisappeared()));
-}
-
-void PropertyListener::clear()
-{
- prop.unsetValue();
-}
-
-GroupListener::GroupListener(Service &service, const QStringList &keys,
- bool clears, ContextProviderSubscriptionChangedCallback cb, void *dt)
- : Listener(clears, cb, dt)
-{
- foreach (const QString &key, keys)
- group << new Property(service, key, this);
- sconnect(&group, SIGNAL(firstSubscriberAppeared()), this, SLOT(onFirstSubscriberAppeared()));
- sconnect(&group, SIGNAL(lastSubscriberDisappeared()), this, SLOT(onLastSubscriberDisappeared()));
-}
-
-void GroupListener::clear()
-{
- foreach(const Property *p, group.getProperties())
- ((Property *)p)->unsetValue();
-}
-
-} // end namespace
diff --git a/libcontextprovider/src/listeners.h b/libcontextprovider/src/listeners.h
deleted file mode 100644
index db561eb8..00000000
--- a/libcontextprovider/src/listeners.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef LISTENERS_H
-#define LISTENERS_H
-
-#include <QObject>
-#include <QString>
-#include <QStringList>
-
-#include "service.h"
-#include "property.h"
-#include "group.h"
-#include "contextc.h"
-
-namespace ContextProvider {
-
-class PropertyListener;
-class Listener;
-class ContextGroupListener;
-
-class Listener : public QObject
-{
- Q_OBJECT
-
-public:
- Listener(bool clears, ContextProviderSubscriptionChangedCallback cb, void *dt);
-
-private slots:
- void onFirstSubscriberAppeared();
- void onLastSubscriberDisappeared();
-
-protected:
- virtual void clear() = 0;
-
-private:
- ContextProviderSubscriptionChangedCallback callback;
- void *user_data;
- bool clearsOnSubscribe;
-};
-
-class PropertyListener : public Listener
-{
- Q_OBJECT
-
-public:
- PropertyListener(Service &service, const QString &key,
- bool clears, ContextProviderSubscriptionChangedCallback cb, void *dt);
- Property prop;
-
-protected:
- virtual void clear();
-};
-
-class GroupListener : public Listener
-{
- Q_OBJECT
-
-public:
- GroupListener(Service &service, const QStringList &keys,
- bool clears, ContextProviderSubscriptionChangedCallback cb, void *dt);
-
-protected:
- virtual void clear();
-
-private:
- Group group;
- QStringList keyList;
-};
-
-} // end namespace
-
-#endif
diff --git a/libcontextprovider/src/loggingfeatures.h b/libcontextprovider/src/loggingfeatures.h
deleted file mode 100644
index b64ac385..00000000
--- a/libcontextprovider/src/loggingfeatures.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef FEATURES_H
-#define FEATURES_H
-
-#define F_SERVICE (ContextFeature("service"))
-#define F_SERVICE_BACKEND (ContextFeature("servicebackend"))
-#define F_PROPERTY (ContextFeature("property"))
-#define F_MANAGER (ContextFeature("manager"))
-#define F_SUBSCRIBER (ContextFeature("subscriber"))
-#define F_GROUP (ContextFeature("group"))
-#define F_DESTROY (ContextFeature("destroy"))
-#define F_SIGNALS (ContextFeature("signals"))
-#define F_DBUS (ContextFeature("dbus"))
-#define F_C (ContextFeature("cbindings"))
-
-#endif
diff --git a/libcontextprovider/src/manager.cpp b/libcontextprovider/src/manager.cpp
deleted file mode 100644
index 951a059a..00000000
--- a/libcontextprovider/src/manager.cpp
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "manager.h"
-#include "logging.h"
-#include "subscriber.h"
-#include "loggingfeatures.h"
-
-namespace ContextProvider {
-
-/*!
- \class Manager
- \brief Manager implements the org.freedesktop.ContextKit.Manager DBus
- interface. (With the help of ManagerAdaptor.) It creates and manages the
- Subscriber objects. There is one Manager object per each service.
-
- Manager is responsible of allocating Subscriber objects to clients. It
- ensures that each client gets a unique Subscriber object (even if it executes
- GetSubscriber multiple times). When a client terminates its DBus connection,
- the Manager (through the help of the adapter) deletes the corresponding
- Subscriber object.
-
- Each service started gets it's own Manager object that manages the keys
- belonging to the service. The Manager is registered as the
- org.freedesktop.ContextKit.Manager on the bus belonging to the service.
-*/
-
-Manager::Manager() : subscriberCounter(0)
-{
- contextDebug() << F_MANAGER << "Creating new Manager";
- qRegisterMetaType<QVariant>("QVariant");
-}
-
-/// Add a key to this Manager. Duplicate keys will be ignored with a
-/// warning.
-void Manager::addKey(const QString &key)
-{
- if (keysToValues.contains(key))
- contextWarning() << "Key:" << key << "is already provided, duplicate?";
- else {
- contextDebug() << F_MANAGER << "Adding key:" << key << "to the list of provided keys";
- keysToValues.insert(key, QVariant());
- keysToSubscriptionCount.insert(key, 0);
- }
-}
-
-/// Destroys the Manager. Also destroys all the belonging subscriber objects created
-/// through getSubscriber().
-Manager::~Manager()
-{
- contextDebug() << F_MANAGER << F_DESTROY << "Destroying Manager";
-
- // Delete here because while deleting those subscribers might
- // call us (increase/decrease count).
- foreach (Subscriber *subscriber, busNamesToSubscribers)
- delete subscriber;
-}
-
-/// Gives the Subscriber object to a client with a given \a busName.
-/// If the client is new, creates a new Subscriber object and gives
-/// it to the client. If the client has requested a Subscriber previously,
-/// returns the same object.
-Subscriber* Manager::getSubscriber(const QString &busName)
-{
- contextDebug() << F_MANAGER << "Get subscriber called for bus name:" << busName;
-
- if (busNamesToSubscribers.contains(busName)) {
- contextDebug() << F_MANAGER << "Subscriber already present for" << busName;
- return busNamesToSubscribers.value(busName);
- }
-
- QString subscriberPath = QString("/org/freedesktop/ContextKit/Subscriber/%1").arg(subscriberCounter);
- contextDebug() << F_MANAGER << F_DBUS << "Creating new subscriber, subscriber path is" << subscriberPath;
- subscriberCounter++;
-
- Subscriber *subscriber = new Subscriber(subscriberPath, this);
- busNamesToSubscribers.insert(busName, subscriber);
-
- return subscriber;
-}
-
-/// Returns true if the Manager has a Subscriber object with the given \a name.
-/// The \a name is the bus name.
-bool Manager::hasSubscriberWithBusName(const QString &name) const
-{
- return busNamesToSubscribers.contains(name);
-}
-
-/// Informs the Manager that the specified bus name is now gone.
-/// The manager should remove all the subscribers created with this busname.
-void Manager::busNameIsGone(const QString &busName)
-{
- if (busNamesToSubscribers.contains(busName)) {
- Subscriber *subscriber = busNamesToSubscribers.value(busName);
- contextDebug() << F_MANAGER << F_DBUS << "Subscriber with bus name:" << busName << "and path:" << subscriber->dbusPath() << "is being removed";
- busNamesToSubscribers.remove(busName);
- delete subscriber;
- }
-}
-
-/// Returns true if the given \a key is valid for this Manager. In other words,
-/// returns true if the \a key is managed by this manager.
-bool Manager::keyIsValid(const QString &key) const
-{
- // The value-list is also our list of valid keys
- return (keysToValues.contains(key));
-}
-
-/// Increases the subscription count for the given \a key. The Manager will
-/// emit a firstSubscriberAppeared signal if this is the first subscription.
-/// This is called by the child Subscriber objects.
-void Manager::increaseSubscriptionCount(const QString &key)
-{
- if (! keysToSubscriptionCount.contains(key)) {
- contextCritical() << "Can't increase subscription count for non-existent key" << key;
- return;
- }
-
- int currentCount = keysToSubscriptionCount.value(key);
- currentCount++;
- keysToSubscriptionCount.insert(key, currentCount);
-
- contextDebug() << F_MANAGER << "Subscription count for" << key << "is now" << currentCount;
-
- // First subscritpion for this key? Let others know.
- if (currentCount == 1)
- emit firstSubscriberAppeared(key);
-}
-
-/// Decreases the subscription count for the given \a key. The Manager will
-/// emit a lastSubscriberDisappeared signal if this is the last subscription.
-/// This is called by the child Subscriber objects.
-void Manager::decreaseSubscriptionCount(const QString &key)
-{
- if (! keysToSubscriptionCount.contains(key)) {
- contextCritical() << F_MANAGER << "Can't decrease subscription count for non-existent key" << key;
- return;
- }
-
- int currentCount = keysToSubscriptionCount.value(key);
- currentCount--;
-
- if (currentCount < 0) {
- contextWarning() << "Tried setting key:" << key << "subscription count to < 0, should not happen";
- return;
- }
-
- keysToSubscriptionCount.insert(key, currentCount);
-
- contextDebug() << F_MANAGER << "Subscription count for" << key << "is now" << currentCount;
-
- // Last subscritpion for this key? Let others know.
- if (currentCount == 0)
- emit lastSubscriberDisappeared(key);
-}
-
-/// Sets the given \a key to a new value \a v. This triggers the emission of
-/// the Manager::keyValueChanged signal.
-void Manager::setKeyValue(const QString &key, const QVariant &v)
-{
- if (! keysToValues.contains(key)) {
- contextWarning() << "Manager does not contain key" << key << "can't set it's value";
- return;
- }
-
- if (v == keysToValues.value(key)) {
- // Same value, skip
- return;
- }
-
- contextDebug() << F_MANAGER << "Setting key:" << key << "to type:" << v.typeName();
- keysToValues.insert(key, v);
- emit keyValueChanged(key, v);
-}
-
-/// Returns the current value of the \a key. The returned QVariant
-/// is invalid if the value is undetermined or they key is not valid
-/// for this Manager.
-QVariant Manager::getKeyValue(const QString &key)
-{
- // FIXME Unify with setKeyValue check
- if (! keysToValues.contains(key)) {
- contextWarning() << "Manager does not contain key" << key << "can't get it's value";
- return QVariant();
- }
-
- return QVariant(keysToValues.value(key));
-}
-
-/// Returns the current subscription count for the given \a key.
-/// Returns -1 if the key could not be found.
-int Manager::getSubscriptionCount(const QString &key) const
-{
- if (! keysToSubscriptionCount.contains(key)) {
- contextWarning() << "Requested subscription count for non-existent key" << key;
- return -1;
- }
-
- return keysToSubscriptionCount.value(key);
-}
-
-/// Returns the list of keys handled by this Manager.
-QStringList Manager::getKeys()
-{
- return QStringList(keysToValues.keys());
-}
-
-} // namespace ContextProvider
diff --git a/libcontextprovider/src/manager.h b/libcontextprovider/src/manager.h
deleted file mode 100644
index 5c48e982..00000000
--- a/libcontextprovider/src/manager.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef MANAGER_H
-#define MANAGER_H
-
-#include <QHash>
-#include <QObject>
-#include <QStringList>
-#include <QVariant>
-
-namespace ContextProvider {
-
-class Subscriber;
-
-class Manager : public QObject
-{
- Q_OBJECT
-
-public:
- Manager();
- ~Manager();
-
- Subscriber* getSubscriber(const QString &busName);
- bool keyIsValid(const QString &key) const;
- void increaseSubscriptionCount(const QString &key);
- void decreaseSubscriptionCount(const QString &key);
- void setKeyValue(const QString &key, const QVariant &v);
- QVariant getKeyValue(const QString &key);
- int getSubscriptionCount(const QString &key) const;
- void busNameIsGone(const QString &key);
- bool hasSubscriberWithBusName(const QString &name) const;
- void addKey(const QString &key);
- QStringList getKeys();
-
-signals:
- /// Emitted when the first subscriber appears for the specified \a key.
- void firstSubscriberAppeared(const QString &key);
-
- /// Emitted when the last subscriber disappears from the specified \a key.
- void lastSubscriberDisappeared(const QString &key);
-
- /// Emitted when a \a key managed by the Manager changes to value \a newValue.
- void keyValueChanged(const QString &key, const QVariant& newValue);
-
-private:
- QHash<QString, Subscriber*> busNamesToSubscribers; ///< List of subscribers. BusName to Subscriber mapping.
- QHash<QString, QVariant> keysToValues; ///< Values for keys. Key name to QVariant mapping.
- QHash<QString, int> keysToSubscriptionCount; ///< Subscription count. Key name to integer mapping.
- int subscriberCounter; ///< A simple counter (iterator) to name the subscribers uniquely.
-};
-
-} // namespace ContextProvider
-
-#endif
diff --git a/libcontextprovider/src/manageradaptor.cpp b/libcontextprovider/src/manageradaptor.cpp
deleted file mode 100644
index f5f0fb06..00000000
--- a/libcontextprovider/src/manageradaptor.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <QDBusConnection>
-#include "manageradaptor.h"
-#include "subscriberadaptor.h"
-#include "logging.h"
-#include "sconnect.h"
-
-namespace ContextProvider {
-
-/*!
- \class ManagerAdaptor
- \brief A DBus adaptor for implementing the org.freedesktop.ContextKit.Manager
- interface. The primary operation to perform through this adaptor is to get the
- subscriber.
-*/
-
-/// Constructor. Creates new adaptor for the given manager with the given
-/// dbus connection. The connection \a conn is not retained.
-ManagerAdaptor::ManagerAdaptor(Manager* manager, QDBusConnection *conn)
- : QDBusAbstractAdaptor(manager), manager(manager), connection(conn)
-{
- sconnect((QObject*) connection->interface(), SIGNAL(serviceOwnerChanged(const QString&, const QString&, const QString&)),
- this, SLOT(OnServiceOwnerChanged(const QString &, const QString&, const QString&)));
-}
-
-/// Executes Manager::getSubscriber on the managed Manager.
-QDBusObjectPath ManagerAdaptor::GetSubscriber(const QDBusMessage &msg)
-{
- Subscriber *subscriber = manager->getSubscriber(msg.service());
-
- // FIXME: probably it is easier to do this in manager
- if (!connection->objectRegisteredAt(subscriber->dbusPath())) {
- new SubscriberAdaptor(subscriber);
- connection->registerObject(subscriber->dbusPath(), subscriber);
- }
-
- return QDBusObjectPath(subscriber->dbusPath());
-}
-
-/// Dbus interface slot. The ManagerAdaptor listens for dbus bus names changing
-/// to notify the managed Manager that a bus name is gone. It does it through
-/// Manager::busNameIsGone function.
-void ManagerAdaptor::OnServiceOwnerChanged(const QString &name, const QString &oldName, const QString &newName)
-
-{
- if (newName == "")
- manager->busNameIsGone(name);
-}
-
-} // namespace ContextProvider
diff --git a/libcontextprovider/src/manageradaptor.h b/libcontextprovider/src/manageradaptor.h
deleted file mode 100644
index e311da59..00000000
--- a/libcontextprovider/src/manageradaptor.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef MANAGERADAPTOR_H
-#define MANAGERADAPTOR_H
-
-#include <QObject>
-#include <QDBusAbstractAdaptor>
-#include <QDBusMessage>
-#include <QDBusConnection>
-#include <QDBusObjectPath>
-#include "manager.h"
-
-namespace ContextProvider {
-
-class ManagerAdaptor: public QDBusAbstractAdaptor
-{
- Q_OBJECT
- Q_CLASSINFO("D-Bus Interface", "org.freedesktop.ContextKit.Manager")
-
-public:
- ManagerAdaptor (Manager* manager, QDBusConnection *connection);
-
-public slots:
- QDBusObjectPath GetSubscriber(const QDBusMessage &msg);
- void OnServiceOwnerChanged(const QString&, const QString&, const QString&);
-
-private:
- Manager *manager; ///< The managed object.
- QDBusConnection *connection; ///< The connection to operate on.
-};
-
-} // namespace ContextProvider
-
-#endif
diff --git a/libcontextprovider/src/property.cpp b/libcontextprovider/src/property.cpp
deleted file mode 100644
index 4668bd99..00000000
--- a/libcontextprovider/src/property.cpp
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "service.h"
-#include "servicebackend.h"
-#include "property.h"
-#include "logging.h"
-#include "manager.h"
-#include "sconnect.h"
-#include "loggingfeatures.h"
-
-
-namespace ContextProvider {
-
-/*!
- \class Property ContextProvider ContextProvider
-
- \brief A Property object represents a context property, i.e., a
- key-value pair.
-
- Each Property object is associated with a Service object at
- construction time.
-*/
-
-struct PropertyPrivate {
- Manager *manager;
- QString myKey;
-};
-
-/// Create a Property object on \a service for the key \a k.
-Property::Property(Service &service, const QString &k, QObject* parent)
- : QObject(parent)
-{
- init(service.backend->manager(), k);
-}
-
-/// Create a Property object on the default service for the key \a k.
-/// The default service can be set with Service::setAsDefault().
-Property::Property(const QString &k, QObject* parent)
- : QObject(parent)
-{
- if (ServiceBackend::defaultServiceBackend == NULL) {
- contextCritical() << "No default service set.";
- abort();
- }
-
- init (ServiceBackend::defaultServiceBackend->manager(), k);
-}
-
-void Property::init (Manager *manager, const QString &key)
-{
- contextDebug() << F_PROPERTY << "Creating new Property for key:" << key;
-
- priv = new PropertyPrivate;
- priv->myKey = key;
- priv->manager = manager;
-
- priv->manager->addKey (priv->myKey);
- sconnect(priv->manager, SIGNAL(firstSubscriberAppeared(const QString&)),
- this, SLOT(onManagerFirstSubscriberAppeared(const QString&)));
- sconnect(priv->manager, SIGNAL(lastSubscriberDisappeared(const QString&)),
- this, SLOT(onManagerLastSubscriberDisappeared(const QString&)));
-}
-
-/// Returns true if the key is set (it's value is determined).
-bool Property::isSet() const
-{
- return (priv->manager->getKeyValue(priv->myKey) != QVariant());
-}
-
-/// Returns the name of the key this Property represents.
-QString Property::key() const
-{
- return priv->myKey;
-}
-
-/// Unsets the value. This is equivalent to setting it to a null
-/// QVariant.
-void Property::unsetValue()
-{
- priv->manager->setKeyValue(priv->myKey, QVariant());
-}
-
-/// Sets the property value to QVariant \a v.
-void Property::setValue(const QVariant &v)
-{
- priv->manager->setKeyValue(priv->myKey, v);
-}
-
-/// Returns the current value of the property. The returned QVariant is invalid
-/// if the key value is undetermined or the Property is invalid.
-QVariant Property::value()
-{
- return priv->manager->getKeyValue(priv->myKey);
-}
-
-/// Called by Manager when first subscriber appears. Delegated if
-/// this concerns us.
-void Property::onManagerFirstSubscriberAppeared(const QString &key)
-{
- if (key == priv->myKey) {
- contextDebug() << F_SIGNALS << F_PROPERTY << "First subscriber appeared for key:" << key;
- emit firstSubscriberAppeared(key);
- }
-}
-
-/// Called by Manager when last subscriber disappears. Delegate if
-/// this concerns us.
-void Property::onManagerLastSubscriberDisappeared(const QString &key)
-{
- if (key == priv->myKey) {
- contextDebug() << F_SIGNALS << F_PROPERTY << "Last subscriber disappeared for key:" << key;
- emit lastSubscriberDisappeared(key);
- }
-}
-
-/// Destructor.
-Property::~Property()
-{
- contextDebug() << F_PROPERTY << F_DESTROY << "Destroying Property for key:" << priv->myKey;
- delete priv;
-}
-
-} // end namespace
diff --git a/libcontextprovider/src/property.h b/libcontextprovider/src/property.h
deleted file mode 100644
index b3a7082a..00000000
--- a/libcontextprovider/src/property.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef PROPERTY_H
-#define PROPERTY_H
-
-#include <QObject>
-#include <QString>
-#include <QStringList>
-#include <QDBusConnection>
-#include <QHash>
-#include <QVariant>
-
-namespace ContextProvider {
-
-class Service;
-class Manager;
-
-class PropertyPrivate;
-
-class Property : public QObject
-{
- Q_OBJECT
-
-public:
- explicit Property(Service &service, const QString &key, QObject *parent = 0);
- explicit Property(const QString &key, QObject *parent = 0);
- virtual ~Property();
-
- QString key() const;
- bool isSet() const;
-
- void setValue(const QVariant &v);
- QVariant value();
- void unsetValue();
-
-private:
- PropertyPrivate *priv;
- void init (Manager *manger, const QString &key);
-
-private slots:
- void onManagerFirstSubscriberAppeared(const QString &key);
- void onManagerLastSubscriberDisappeared(const QString &key);
-
-signals:
- /// This is emitted when the first subscriber appears for this
- /// Property. It can be used e.g. to start the actual process of
- /// harvesting the data needed for this Property.
- void firstSubscriberAppeared(const QString &key);
-
- /// This is emitted when the last subscriber disappears for this
- /// Property. It can be used e.g. to stop the process of
- /// harvesting the data needed for this Property (and save
- /// resources).
- void lastSubscriberDisappeared(const QString &key);
-};
-
-} // end namespace
-
-#endif
diff --git a/libcontextprovider/src/queuedinvoker.cpp b/libcontextprovider/src/queuedinvoker.cpp
deleted file mode 100644
index 8a7b09e6..00000000
--- a/libcontextprovider/src/queuedinvoker.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "queuedinvoker.h"
-
-#include <QMetaObject>
-#include <QThread>
-#include <QDebug>
-#include <QMutexLocker>
-
-namespace ContextProvider {
-
-/*! \class QueuedInvoker
- \brief A class that can invoke its own methods in a delayed way.
-
- Via the method QueuedInvoker::queueOnce, the given method is set
- to be invoked when the event loop of the object is entered. Each
- method is queued at most once. QueuedInvoker sends a signal to
- itself, and when the signal is processed, the method is invoked.
-
- QueuedInvoker is normally used by subclassing it.
-
-*/
-
-QueuedInvoker::QueuedInvoker(QObject* parent)
- : QObject(parent)
-{
- connect(this, SIGNAL(queuedCall(const char *)),
- this, SLOT(onQueuedCall(const char *)),
- Qt::QueuedConnection);
-}
-
-//! Slot which is executed when the event loop of this object
-//! runs. Calls all the methods in the queue.
-void QueuedInvoker::onQueuedCall(const char *method)
-{
- QMutexLocker locker(&callQueueLock);
- callQueue.remove(method);
- locker.unlock();
- if (!QMetaObject::invokeMethod(this, method, Qt::DirectConnection)) {
- qFatal(" *****************\n"
- "Erroneous usage of queueOnce(%s)\n"
- " *****************\n", method);
- }
-}
-
-//! Sets the method \a method to be invoked when the event loop of
-//! this object runs next time. If the method was already in the
-//! queue, it won't be inserted again.
-void QueuedInvoker::queueOnce(const char *method)
-{
- QMutexLocker locker(&callQueueLock);
- if (!callQueue.contains(method)) {
- emit queuedCall(method);
- callQueue.insert(method);
- }
-}
-
-} // namespace ContextProvider
diff --git a/libcontextprovider/src/queuedinvoker.h b/libcontextprovider/src/queuedinvoker.h
deleted file mode 100644
index 8f1e8896..00000000
--- a/libcontextprovider/src/queuedinvoker.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef QUEUEDINVOKER_H
-#define QUEUEDINVOKER_H
-
-#include <QObject>
-#include <QMutex>
-#include <QSet>
-#include <QString>
-
-namespace ContextProvider {
-
-class QueuedInvoker : public QObject
-{
- Q_OBJECT
-
-public:
- QueuedInvoker(QObject* parent = 0);
-
-private slots:
- void onQueuedCall(const char *method);
-
-signals:
- void queuedCall(const char *method);
-
-protected:
- void queueOnce(const char *method);
-
-private:
- QMutex callQueueLock; ///< Protects the callQueue
- QSet<QString> callQueue; ///< Methods to be invoked
-};
-
-} // namespace ContextProvider
-
-#endif
diff --git a/libcontextprovider/src/service.cpp b/libcontextprovider/src/service.cpp
deleted file mode 100644
index 7a0edf8d..00000000
--- a/libcontextprovider/src/service.cpp
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "service.h"
-#include "servicebackend.h"
-#include "property.h"
-#include "logging.h"
-#include "manager.h"
-#include "manageradaptor.h"
-#include "sconnect.h"
-#include "loggingfeatures.h"
-#include <QDBusConnection>
-#include <QDebug>
-
-namespace ContextProvider {
-
-/*!
-
- \mainpage Providing values for Context properties
-
- This library implements the provider side of the ContextKit's D-Bus
- protocol. It has both a C++ and a C interface, so you can choose
- which you prefer. For the documentation of the C API, see \ref CApi.
-
- The C++ interface consists mainly of the three classes Service,
- Property, and Group in the namespace ContextProvider. They are
- declared in the ContextProvider header file.
-
- Thus, you would typically gain access to the classes like this
-
- \code
- #include <ContextProvider>
-
- using namespace ContextProvider;
-
- Service my_service (...);
- \endcode
-
- If you prefer not to have generic names like "Service" in your code,
- you can of course skip the "using" declaration and refer to the
- classes as "ContextProvider::Service", etc. If that is too long,
- consider a namespace alias like this:
-
- \code
- #include <ContextProvider>
-
- namespace CP = ContextProvider;
-
- CP::Service my_service (...);
- \endcode
-
- The basic pattern to use this library is to create a Service
- instance to represent you on D-Bus and then to add Property
- instances to it for the keys that you want to provide. Once this is
- done, you can call Property::set() at any time to change the value
- of the property.
-
- Communication with clients happens asynchronously and this library
- needs a running event loop for that.
-
- Thus, a simple provider might look like this:
-
- \code
- #include <ContextProvider>
-
- using namespace ContextProvider;
-
- void main(int argc, char **argv)
- {
- QApplication app(argc, argv);
-
- Service my_service(QDBusConnection::SessionBus, "com.example.simple");
- Property my_property(my_service, "Example.Simple");
-
- // set initial value of property
- my_property.set(100);
-
- app.exec();
- }
- \endcode
-
- If you need to know when someone actually subscribes to one of
- your values, you can connect to the firstSubscriberAppeared and
- lastSubscriberDisappeared signals of the Property instances. You
- can also use a Group if you are only interested in whether at least
- one of a set of Property objects is subscribed to.
-*/
-
-/*!
- \class Service
-
- \brief A Service object is a proxy representing a service on D-Bus
- that implements the ContextKit interface. The lifespan of the
- Service object is not tied to the real service lifespan. This way
- a service can be accessed and controlled from different parts of
- the code.
-
- When you first create a Service object with given bus type / bus
- name parameters the real D-Bus service instance is actually
- created and started. Future references to this bus type / bus
- name will give you a Service instance that points to the very same
- service as the first Service initialization that started it. In
- other words, we can say that the Service class represents a proxy
- interface to the real D-Bus service.
-
- When the last instance of Service is destroyed, the real service
- is automatically terminated and destroyed (there is a simple ref
- counting mechanism involved to guarantee that).
-
- Consider the following examples:
-
- \code
- Service *s1 = new Service(QDBusConnection::SessionBus, "com.example.simple");
- Service *s2 = new Service(QDBusConnection::SessionBus, "com.example.simple");
- // s1 and s2 represent the same service
-
- s2->stop();
- // Both s1 and s2 are now stopped
-
- s1->start();
- // Both s1 and s2 are now started
-
- delete s1; // s2 is still valid, service is present
- delete s2; // the "com.example.simple" just disappeared from D-Bus
- \endcode
-
- Every Property object must be associated with a Service object.
-
- A Service can be running or stopped. When it is running, it is
- visible via D-Bus and clients can subscribe to its properties.
-
- It is undefined what happens when you add a Property object to a
- running service. Likewise, it is undefined what happens when you
- add a Property to a Group while the Service of that Property
- object is running.
-
- Thus, it is best to create a Service object, add all Property
- objects to it immediately, create the Group objects for them, and
- then enter the main loop.
-
- Libcontextprovider can share the same QDBusConnection that is used
- in the provider program. In that case, the Service must be created
- by passing the QDBusConnection. The Service will not register any
- service name on the connection. It is advisable to register the
- service name as late as possible, after initializing all Services
- and Properties and after registering other objects the provider
- declares on D-Bus.
-
- \code
- int main(int argc, char** argv) {
- QCoreApplication app(argc, argv);
- QDBusConnection systemBus = QDBusConnection::SystemBus();
-
- // D-Bus registrations can happen before or after initializing
- // the Services and Properties
- connection.registerObject(...);
-
- // Now myService will share the connection and won't register
- // any service name
- Service *myService = new Service(systemBus);
- Property* property = new Property(myService, "My.Property");
-
- // Important: registering the service name should be done as
- // late as possible, to prevent clients from connecting to us
- // before all objects have been registered.
- connection.registerService("my.service.name");
-
- return app.exec();
- }
- \endcode
-
-*/
-
-/// Creates a Service proxy object which shares the \a connection with
-/// the provider program. The Service will not register any service
-/// name on the conneciton. If the service is accessed for the first
-/// time it'll be created and set up. If the service with the given
-/// parameters already exists the created object represents a
-/// controller to a previously-created service. A new Service will be
-/// started when it is constructed.
-Service::Service(QDBusConnection connection, QObject *parent)
-{
- // this singleton accessor method always autostart
- backend = ServiceBackend::instance(connection);
- backend->ref();
-}
-
-
-/// Creates a Service proxy object for \a busName on the bus indicated
-/// by \a busType. The Service will register the given \a busName on
-/// D-Bus. If the service is accessed for the first time it'll be
-/// created and set up. If the service with the given parameters
-/// already exists the created object represents a controller to a
-/// previously-created service. A new Service will be started when it
-/// is constructed if \a autoStart is true (which is the default).
-Service::Service(QDBusConnection::BusType busType, const QString &busName, bool autoStart, QObject* parent)
- : QObject(parent)
-{
- backend = ServiceBackend::instance(busType, busName, autoStart);
- backend->ref();
-}
-
-/// A convenient constructor, where autoStart is always true.
-Service::Service(QDBusConnection::BusType busType, const QString &busName, QObject* parent)
- : QObject(parent)
-{
- backend = ServiceBackend::instance(busType, busName, true);
- backend->ref();
-}
-
-/// Destroys this Service instance. The actual service on D-Bus is
-/// destroyed and stopped if this object is a last instance pointing
-/// at the actual service with the given constructor parameters
-/// (QDBusConnection or bus type and bus name).
-Service::~Service()
-{
- contextDebug() << F_SERVICE << F_DESTROY << "Destroying Service";
- backend->unref();
-}
-
-/// Sets the Service object as the default one to use when
-/// constructing Property objects.
-void Service::setAsDefault()
-{
- backend->setAsDefault();
-}
-
-/// Set the value of \a key to \a val. A property named \a key must
-/// have been registered already, by creating a Property object for
-/// it.
-void Service::setValue(const QString &key, const QVariant &val)
-{
- backend->manager()->setKeyValue(key, val);
-}
-
-/// Set (override) the QDBusConnection used by the
-/// Service. Deprecated; use constructor with QDBusConnection
-/// parameter instead.
-void Service::setConnection(const QDBusConnection &connection)
-{
- qCritical("[ContextProvider] Service::setConnection() is deprecated; use Service(QDBusConnection).");
- backend->stop();
- backend->connection = connection;
- backend->start();
-}
-
-/// Start the Service again after it has been stopped. In the case of
-/// shared connection, the objects will be registered to D-Bus. In the
-/// case of non-shared connection, also the service name will be
-/// registered on D-Bus. Returns true on success, false otherwise.
-bool Service::start()
-{
- return backend->start();
-}
-
-/// Stop the service. In the case of shared connection, this will
-/// cause the related objects to be unregistered, but the bus name
-/// will still be on D-Bus. In the case of non-shared connection, this
-/// will cause the service to disappear from D-Bus completely.
-void Service::stop()
-{
- backend->stop();
-}
-
-/// Stop and start the service. This function cannot be used when the
-/// Service shares a QDBusConnection with the provider program. When
-/// that is the case, you must stop the service, unregister the D-Bus
-/// bus name, register it again (to force clients of context
-/// properties to resubscribe), and finally start the service again.
-void Service::restart()
-{
- if (backend->sharedConnection())
- qFatal("[ContextProvider] Service::restart() is not compatible with shared connections");
-
- stop();
- start();
-}
-
-} // end namespace
diff --git a/libcontextprovider/src/service.h b/libcontextprovider/src/service.h
deleted file mode 100644
index 87156602..00000000
--- a/libcontextprovider/src/service.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef SERVICE_H
-#define SERVICE_H
-
-#include <QObject>
-#include <QString>
-#include <QStringList>
-#include <QDBusConnection>
-#include <QHash>
-#include <QVariant>
-
-class ServiceUnitTest;
-
-namespace ContextProvider {
-
-class Manager;
-class Property;
-class ServiceBackend;
-
-class Service : public QObject
-{
- Q_OBJECT
-
-public:
- explicit Service(QDBusConnection connection, QObject *parent = 0);
- Service(QDBusConnection::BusType busType, const QString &busName, QObject *parent = 0);
- Service(QDBusConnection::BusType busType, const QString &busName, bool autoStart, QObject *parent = 0);
- virtual ~Service();
-
- bool start();
- void stop();
- void restart();
-
- void setAsDefault();
-
- void setValue(const QString &key, const QVariant &val);
- void setConnection(const QDBusConnection &connection);
-
-private:
- ServiceBackend *backend;
-
- friend class Property;
- friend class ::ServiceUnitTest;
-};
-
-} // end namespace
-
-#endif
diff --git a/libcontextprovider/src/servicebackend.cpp b/libcontextprovider/src/servicebackend.cpp
deleted file mode 100644
index 03160644..00000000
--- a/libcontextprovider/src/servicebackend.cpp
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "servicebackend.h"
-#include "logging.h"
-#include "manager.h"
-#include "manageradaptor.h"
-#include "sconnect.h"
-#include "loggingfeatures.h"
-
-namespace ContextProvider {
-
-/*!
- \class ServiceBackend ContextKit ContextKit
-
- \brief A ServiceBackend is the real worker behind Service.
-
- Multiple Service instances can share same ServiceBackend.
- The backend is the actual worker that operates on D-Bus,
- has a Manager and registers properties.
-
- The Service class actually proxies all methods to the ServiceBackend.
-*/
-
-QHash<QString, ServiceBackend*> ServiceBackend::instances;
-ServiceBackend *ServiceBackend::defaultServiceBackend;
-
-/// Creates new ServiceBackend with the given QDBusConnection. The
-/// backend automatically creates it's Manager. The connection will be
-/// shared between Service and the provider program, and the
-/// ServiceBackend will not register any service names.
-ServiceBackend::ServiceBackend(QDBusConnection connection) :
- connection(connection),
- refCount(0),
- busName("") // shared connection
-{
- contextDebug() << F_SERVICE_BACKEND << "Creating new ServiceBackend for" << busName;
-}
-
-/// Creates new ServiceBackend with the given QDBusConnection and a
-/// service name to register. The backend automatically creates it's
-/// Manager. The connection will not be shared between the Service and
-/// the provider program.
-ServiceBackend::ServiceBackend(QDBusConnection connection, const QString &busName) :
- connection(connection),
- refCount(0),
- busName(busName) // private connection
-{
- contextDebug() << F_SERVICE_BACKEND << "Creating new ServiceBackend for" << busName;
-}
-
-/// Destroys the ServiceBackend. The backend is stopped. If this
-/// backend is the defaultServiceBackend, the defaultServiceBackend is
-/// set back to NULL.
-ServiceBackend::~ServiceBackend()
-{
- contextDebug() << F_SERVICE_BACKEND << F_DESTROY << "Destroying Service";
- stop();
- if (ServiceBackend::defaultServiceBackend == this)
- ServiceBackend::defaultServiceBackend = 0;
-}
-
-/// Returns the Manager associated with this backend.
-Manager *ServiceBackend::manager()
-{
- return &myManager;
-}
-
-/// Set the value of \a key to \a val. A property named \a key must
-/// have been registered already, by creating a Property object for
-/// it.
-void ServiceBackend::setValue(const QString &key, const QVariant &val)
-{
- myManager.setKeyValue(key, val);
-}
-
-/// Start the Service again after it has been stopped. In the case of
-/// shared connection, the objects will be registered to D-Bus. In the
-/// case of non-shared connection, also the service name will be
-/// registered on D-Bus. Returns true on success, false otherwise.
-bool ServiceBackend::start()
-{
- ManagerAdaptor *managerAdaptor = new ManagerAdaptor(&myManager, &connection);
-
- // Register object
- if (managerAdaptor && !connection.registerObject("/org/freedesktop/ContextKit/Manager", &myManager)) {
- contextCritical() << F_SERVICE_BACKEND << "Failed to register the Manager object for" << busName;
- contextCritical() << F_SERVICE_BACKEND << "Error:" << connection.lastError();
- return false;
- }
-
- if (!sharedConnection()) {
- if (!connection.registerService(busName)) {
- contextCritical() << F_SERVICE_BACKEND << "Failed to register service with name" << busName;
- stop();
- return false;
- }
- }
- return true;
-}
-
-/// Stop the service. In the case of shared connection, this will
-/// cause the related objects to be unregistered, but the bus name
-/// will still be on D-Bus. In the case of non-shared connection, this
-/// will cause the service to disappear from D-Bus completely.
-void ServiceBackend::stop()
-{
- contextDebug() << F_SERVICE_BACKEND << "Stopping service for bus:" << busName;
-
- // Unregister service name
- if (!sharedConnection())
- connection.unregisterService(busName);
- // Unregister manager
- connection.unregisterObject("/org/freedesktop/ContextKit/Manager");
- // FIXME: unregister subscribers
-}
-
-/// Sets the ServiceBackend object as the default one to use when
-/// constructing Property objects.
-void ServiceBackend::setAsDefault()
-{
- if (defaultServiceBackend) {
- contextCritical() << F_SERVICE_BACKEND << "Default service already set.";
- return;
- }
-
- defaultServiceBackend = this;
-}
-
-/// Increase the reference count by one. Service calls this.
-void ServiceBackend::ref()
-{
- refCount++;
-}
-
-/// Decrease the reference count by one. Service calls this. If the
-/// reference count goes to zero, stop the ServiceBackend instance,
-/// remove it from the instance store and schedule it to be deleted.
-void ServiceBackend::unref()
-{
- refCount--;
-
- if (refCount == 0) {
- stop();
- QString key = instances.key(this);
- if (key != "")
- instances.remove(key);
- else
- contextCritical() << "Backend couldn't find itself in the instance store";
- deleteLater(); // "delete this" would be probably unsafe
- }
-}
-
-/// Returns a ServiceBackend instance for a given \a
-/// connection. Creates the instance if it does not exist yet.
-ServiceBackend* ServiceBackend::instance(QDBusConnection connection)
-{
- QString lookup = connection.name();
- contextDebug() << F_SERVICE << "Creating new Service for" << lookup;
-
- if (!instances.contains(lookup)) {
- ServiceBackend* backend = new ServiceBackend(connection);
- backend->start();
- instances.insert(lookup, backend);
- }
- return instances[lookup];
-}
-
-/// Returns a ServiceBackend instance for a given \a busType and \a
-/// busName. Creates the instance if it does not exist yet.
-ServiceBackend* ServiceBackend::instance(QDBusConnection::BusType busType,
- const QString &busName, bool autoStart)
-{
- QString lookup = QString("contextprovider_") +
- ((busType == QDBusConnection::SessionBus) ? "session" : "system") +
- busName;
- contextDebug() << F_SERVICE << "Creating new Service for" << lookup;
-
- if (!instances.contains(lookup)) {
- ServiceBackend* backend = new ServiceBackend(
- QDBusConnection::connectToBus(busType, busName),
- busName);
- if (autoStart) backend->start();
- instances.insert(lookup, backend);
- }
- return instances[lookup];
-}
-
-/// Returns true iff the ServiceBackend shares its QDBusConnection
-/// with the provider program.
-bool ServiceBackend::sharedConnection()
-{
- return busName == "";
-}
-} // end namespace
diff --git a/libcontextprovider/src/servicebackend.h b/libcontextprovider/src/servicebackend.h
deleted file mode 100644
index 27f8c9ad..00000000
--- a/libcontextprovider/src/servicebackend.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef SERVICEBACKEND_H
-#define SERVICEBACKEND_H
-
-#include "manager.h"
-#include <QObject>
-#include <QString>
-#include <QStringList>
-#include <QDBusConnection>
-#include <QHash>
-#include <QVariant>
-
-class ServiceBackendUnitTest;
-
-namespace ContextProvider {
-
-class Property;
-class ServiceBackendPrivate;
-
-class ServiceBackend : public QObject
-{
- Q_OBJECT
-
-public:
- explicit ServiceBackend(QDBusConnection connection);
- ServiceBackend(QDBusConnection connection, const QString &busName);
- virtual ~ServiceBackend();
-
- bool sharedConnection();
- bool start();
- void stop();
-
- void setAsDefault();
- void setValue(const QString &key, const QVariant &val);
- Manager *manager();
-
- void ref();
- void unref();
-
- static ServiceBackend* instance(QDBusConnection connection);
- static ServiceBackend* instance(QDBusConnection::BusType busType,
- const QString &busName,
- bool autoStart);
- static ServiceBackend *defaultServiceBackend;
- friend class ::ServiceBackendUnitTest;
- friend class Service;
-
-private:
- Manager myManager;
- QDBusConnection connection;
- int refCount;
- QString busName;
-
- static QHash <QString, ServiceBackend*> instances;
-};
-
-} // end namespace
-
-#endif
diff --git a/libcontextprovider/src/subscriber.cpp b/libcontextprovider/src/subscriber.cpp
deleted file mode 100644
index 4b3f5ba9..00000000
--- a/libcontextprovider/src/subscriber.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <QDebug>
-
-#include "subscriber.h"
-#include "logging.h"
-#include "manager.h"
-#include "sconnect.h"
-#include "loggingfeatures.h"
-
-namespace ContextProvider {
-
-/*!
- \class Subscriber
- \brief Subscriber implements the org.freedesktop.ContextKit.Subscriber DBus
- interface with help of the SubsciberAdaptor.
-
- Subscriber lets the user to suscribe to or unsubscribe from properties and
- get informed when their values change.
-*/
-
-/// Constructor. Creates a new Subscriber with the given \a dbusPath object path and
-/// a parent Manager \a man. The Subscriber will use the Manager to obtain values etc.
-Subscriber::Subscriber(const QString& dbusPath, Manager *man) : QueuedInvoker(), path(dbusPath), manager(man)
-{
- contextDebug() << F_SUBSCRIBER << "New subscriber object created with path" << dbusPath;
- sconnect(man, SIGNAL(keyValueChanged(const QString&, const QVariant&)),
- this, SLOT(onManagerKeyValueChanged(const QString&)));
-}
-
-/// Destroys the subscriber. Decreases the subscription count on the parent Manager
-/// before going down.
-Subscriber::~Subscriber()
-{
- contextDebug() << F_SUBSCRIBER << F_DESTROY << "Subscriber with path" << path << "destroyed, decreasing subscription counts";
- // Decrease all the subscription counts
- foreach (QString key, subscribedKeys)
- manager->decreaseSubscriptionCount(key);
-}
-
-/// For the given list of \a keys, creates a map and undetermined list using the
-/// keys values from the parent Manager.
-void Subscriber::buildMapAndUndetermined(const QStringList &keys, QMap<QString, QVariant> &map, QStringList &undetermined)
-{
- foreach (QString key, keys) {
- QVariant v = manager->getKeyValue(key);
- if (v.isValid())
- map.insert(key, v);
- else if (! undetermined.contains(key))
- undetermined.append(key);
- }
-}
-
-/// Subscribes to te specified list of \a keys. The keys for which values could not
-/// be determined are placed in the \c undetermined list. Otherwise the current values are
-/// placed in the returned map in a key -> value order.
-QMap<QString, QVariant> Subscriber::subscribe(const QStringList &keys, QStringList &undetermined)
-{
- contextDebug() << F_SUBSCRIBER << F_DBUS << "Subscribe called with" << keys.size() << "keys";
-
- QStringList newKeys;
- QStringList valueKeys;
-
- foreach(QString key, keys) {
- if (! manager->keyIsValid(key))
- contextWarning() << "Key:" << key << "is not a valid key";
- else if (! subscribedKeys.contains(key) && ! newKeys.contains(key)) {
- contextDebug() << F_SUBSCRIBER << "Key:" << key << "not yet subscribed, adding to new keys to subscribe";
- newKeys.append(key);
- valueKeys.append(key);
- manager->increaseSubscriptionCount(key);
- } else {
- contextWarning() << "Trying to subscribe to key:" << key << "but it's already subscribed";
- valueKeys.append(key);
- }
- }
-
- subscribedKeys += newKeys;
-
- QMap<QString, QVariant> map;
- buildMapAndUndetermined(valueKeys, map, undetermined);
-
- return map;
-}
-
-/// Unsubscribes from the passed list of keys.
-void Subscriber::unsubscribe(const QStringList &keys)
-{
- contextDebug() << F_SUBSCRIBER << F_DBUS << "Unsubscribe called with" << keys.size() << "keys";
-
- QStringList removedKeys;
- foreach(QString key, keys) {
- if (! subscribedKeys.contains(key))
- contextWarning() << "Trying to unsubscribe from key:" << key << "but key is not subscribed";
- else
- removedKeys.append(key);
- }
-
- foreach (QString key, removedKeys) {
- contextDebug() << F_SUBSCRIBER << "Unsubscribing from previously subscribed key:" << key;
- subscribedKeys.removeOne(key);
- manager->decreaseSubscriptionCount(key);
- }
-}
-
-/// Returns the dbus object path for this Subscriber.
-QString Subscriber::dbusPath() const
-{
- return path;
-}
-
-/// Returns true if the Subscriber is currently subscribed to the specified key.
-bool Subscriber::isSubscribedToKey(const QString &key)
-{
- return (subscribedKeys.contains(key));
-}
-
-/// This is executed when on the parent Manager key changes. If the key concerns us
-/// (we're subscribed to it) we schedule a handling operation to be executed in the next
-/// mainloop run.
-void Subscriber::onManagerKeyValueChanged(const QString &key)
-{
- if (! subscribedKeys.contains(key)) {
- contextDebug() << F_SUBSCRIBER << F_SIGNALS << key << "value changed, ignoring (not subscribed)";
- return;
- }
-
- contextDebug() << F_SUBSCRIBER << F_SIGNALS << "subscribed key:" << key << "changed, will handled the change in a sec";
- changedKeys.append(key);
- queueOnce("handleChanged");
-}
-
-/// This is executed via QueuedInvoker. We emit a Subscriber::changed signal with the new
-/// values for the changed properties fetched from parent Manager.
-void Subscriber::handleChanged()
-{
- contextDebug() << F_SUBSCRIBER << "Handling the changed keys etc.";
-
- QStringList undetermined;
- QMap<QString, QVariant> map;
-
- buildMapAndUndetermined(changedKeys, map, undetermined);
- emit changed(map, undetermined);
- changedKeys.clear();
-}
-
-} // namespace ContextProvider
diff --git a/libcontextprovider/src/subscriber.h b/libcontextprovider/src/subscriber.h
deleted file mode 100644
index 10d3a9d9..00000000
--- a/libcontextprovider/src/subscriber.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef SUBSCRIBER_H
-#define SUBSCRIBER_H
-
-#include <QObject>
-#include <QMap>
-#include <QString>
-#include <QStringList>
-#include <QVariant>
-#include "queuedinvoker.h"
-
-namespace ContextProvider {
-
-class Manager;
-
-class Subscriber : public QueuedInvoker
-{
- Q_OBJECT
-
-public:
- Subscriber(const QString &dbusPath, Manager *manager);
- ~Subscriber();
-
- QMap<QString, QVariant> subscribe(const QStringList &keys, QStringList &undetermined);
- void unsubscribe(const QStringList &keys);
- QString dbusPath() const;
- bool isSubscribedToKey(const QString &key);
-
-private:
- QString path; ///< Dbus object path.
- Manager *manager; ///< Parent Manager (service).
- QStringList subscribedKeys; ///< List of keys we're currently subscribed to.
- QStringList changedKeys; ///< List of keys that got changed and need to be processed in Subscriber::handleChanged.
-
- void buildMapAndUndetermined(const QStringList &keys, QMap<QString, QVariant> &map, QStringList &undetermined);
-
-private slots:
- void onManagerKeyValueChanged(const QString &key);
- Q_INVOKABLE void handleChanged();
-
-signals:
- /// Emitted when any of the subscribed keys changes it's value. The \a values map contains
- /// a mapping of keys -> new values. The \a undetermined list contains the names of keys
- /// that could not be determined. The \a values and \a undetermined contains only the keys
- /// that actually changed value.
- void changed(const QMap<QString, QVariant> &values, const QStringList &undetermined);
-};
-
-} // namespace ContextProvider
-
-#endif
diff --git a/libcontextprovider/src/subscriberadaptor.cpp b/libcontextprovider/src/subscriberadaptor.cpp
deleted file mode 100644
index ef09f878..00000000
--- a/libcontextprovider/src/subscriberadaptor.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "subscriberadaptor.h"
-#include "sconnect.h"
-
-namespace ContextProvider {
-
-/*!
- \class SubscriberAdaptor
- \brief A DBus adaptor for implementing the org.freedesktop.ContextKit.Subscriber
- interface. Using the Subscriber the remote client can subscribe and unsubscribe
- from keys.
-*/
-
-/// Constructor. Creates new adaptor for the given \a subscriber Subscriber object.
-SubscriberAdaptor::SubscriberAdaptor(Subscriber* subscriber)
- : QDBusAbstractAdaptor (subscriber), subscriber(subscriber)
-{
- sconnect(subscriber, SIGNAL(changed(const QMap<QString, QVariant>&, const QStringList&)),
- this, SIGNAL(Changed(const QMap<QString, QVariant>&, const QStringList&)));
-}
-
-/// Performs the Subscriber::subscribe method to subscribe to a given set of keys.
-QMap<QString, QVariant> SubscriberAdaptor::Subscribe(const QStringList &keys, QStringList &undetermined)
-{
- return subscriber->subscribe(keys, undetermined);
-}
-
-/// Performs the Subscriber::unsubscribe method to unsubscribe from a given set of keys.
-void SubscriberAdaptor::Unsubscribe(const QStringList &keys)
-{
- return subscriber->unsubscribe(keys);
-}
-
-} // namespace ContextProvider
diff --git a/libcontextprovider/src/subscriberadaptor.h b/libcontextprovider/src/subscriberadaptor.h
deleted file mode 100644
index b3fa793a..00000000
--- a/libcontextprovider/src/subscriberadaptor.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef SUBSCRIBER_ADAPTOR_H
-#define SUBSCRIBER_ADAPTOR_H
-
-#include "subscriber.h"
-#include <QObject>
-#include <QDBusAbstractAdaptor>
-#include <QMap>
-#include <QStringList>
-
-namespace ContextProvider {
-
-class SubscriberAdaptor: public QDBusAbstractAdaptor
-{
- Q_OBJECT
- Q_CLASSINFO("D-Bus Interface", "org.freedesktop.ContextKit.Subscriber")
-
-public:
- SubscriberAdaptor(Subscriber* subscriber);
-
-public slots:
- QMap<QString, QVariant> Subscribe(const QStringList &keys, QStringList &undetermined);
- void Unsubscribe(const QStringList &keys);
-
-private:
- Subscriber *subscriber; ///< The managed object.
-
-signals:
- void Changed(const QMap<QString, QVariant> &values, const QStringList &undetermined);
-};
-
-} // namespace ContextProvider
-
-#endif
diff --git a/libcontextprovider/unit-tests/.gitignore b/libcontextprovider/unit-tests/.gitignore
deleted file mode 100644
index 4ebc8aea..00000000
--- a/libcontextprovider/unit-tests/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-coverage
diff --git a/libcontextprovider/unit-tests/Makefile.am b/libcontextprovider/unit-tests/Makefile.am
deleted file mode 100644
index 06e32d94..00000000
--- a/libcontextprovider/unit-tests/Makefile.am
+++ /dev/null
@@ -1,33 +0,0 @@
-SUBDIRS = manager \
- subscriber \
- property \
- contextgroup \
- contextc \
- service \
- servicebackend
-
-check-sum: all
- @list='$(SUBDIRS)'; for subdir in $$list; do \
- (cd $$subdir && tput bold && echo $$subdir:\ && tput sgr0 && ( $(MAKE) $(AM_MAKEFLAGS) check 2>/dev/null | grep '^Total' | grep -v '^make' ) ) \
- done
-
-coverage: covoptioncheck
- @list='$(SUBDIRS)'; for subdir in $$list; do \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) coverage) \
- done
- mkdir -p coverage
- lcov $(patsubst %, -a %/coverage/selected.cov, $(SUBDIRS)) -o coverage/selecteds.cov
- @echo "real sources: `cd $(abs_top_srcdir) && pwd`"
- @echo "build: $(abs_top_builddir)"
- cat coverage/selecteds.cov | \
- sed "s,`cd $(abs_top_builddir) && pwd`,`cd $(abs_top_srcdir) && pwd`," | \
- sed 's,unit-tests/.*mock_,src/,' | \
- sed 's,unit-tests/.*src_,src/,' >coverage/sedded.cov
- genhtml --prefix `cd $(abs_top_srcdir) && pwd` -o coverage/ coverage/sedded.cov
-
-clean-local:
- rm -rf coverage
-
-.PHONY: coverage check-sum
-
-include $(top_srcdir)/am/covoptioncheck.am
diff --git a/libcontextprovider/unit-tests/contextc/.gitignore b/libcontextprovider/unit-tests/contextc/.gitignore
deleted file mode 100644
index 79ca8837..00000000
--- a/libcontextprovider/unit-tests/contextc/.gitignore
+++ /dev/null
@@ -1,11 +0,0 @@
-contextcunittest
-contextc.cpp
-contextc.h
-sconnect.h
-logging.h
-logging.cpp
-loggingfeatures.h
-listeners.h
-listeners.cpp
-signalgrouper.h
-signalgrouper.cpp
diff --git a/libcontextprovider/unit-tests/contextc/Makefile.am b/libcontextprovider/unit-tests/contextc/Makefile.am
deleted file mode 100644
index 91c0f4dc..00000000
--- a/libcontextprovider/unit-tests/contextc/Makefile.am
+++ /dev/null
@@ -1,22 +0,0 @@
-check_PROGRAMS = contextcunittest
-
-# test's sources
-contextcunittest_SOURCES = contextcunittest.cpp service.h property.h group.h
-
-COVERAGE_FILES = contextc.cpp listeners.cpp
-
-# do the testing, coverage, etc. stuff
-# tests.am is using +=, so we have to set a value here for these four always
-AM_CXXFLAGS = $(QtCore_CFLAGS) $(QtDBus_CFLAGS) $(DBUS_CFLAGS)
-AM_LDFLAGS = $(QtCore_LIBS) $(QtDBus_LIBS)
-FROM_SOURCE = loggingfeatures.h contextc.h contextc.cpp listeners.h listeners.cpp
-FROM_SOURCE_DIR = $(srcdir)/../../src
-LDADD =
-include $(top_srcdir)/am/tests.am
-
-nodist_contextcunittest_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(contextcunittest_SOURCES) $(FROM_SOURCE))
-include $(top_srcdir)/am/qt.am
-
-# when MOCing from .cpp file, you also has to help the dependency tracker
-contextcunittest.o: contextcunittest.moc
diff --git a/libcontextprovider/unit-tests/contextc/contextcunittest.cpp b/libcontextprovider/unit-tests/contextc/contextcunittest.cpp
deleted file mode 100644
index 68454999..00000000
--- a/libcontextprovider/unit-tests/contextc/contextcunittest.cpp
+++ /dev/null
@@ -1,326 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <QtTest/QtTest>
-#include <QtCore>
-#include <stdlib.h>
-#include "service.h"
-#include "property.h"
-#include "group.h"
-#include "contextc.h"
-
-namespace ContextProvider {
-
-QList<Property*> propertyList;
-QList<Group*> groupList;
-QStringList keysList;
-
-QString lastBusName = NULL;
-QDBusConnection::BusType lastConnectionType;
-QVariant *lastVariantSet = NULL;
-int lastSubscribed = 0;
-void *lastUserData = NULL;
-
-/* Mocked implementation of Group */
-
-Group::Group(QObject *parent)
-{
- groupList.append(this);
-}
-
-void Group::add(const Property &prop)
-{
- props.insert (&prop);
- keyList.append (prop.getKey());
-}
-
-Group::~Group()
-{
- groupList.removeAll(this);
-}
-
-QSet<const Property *> Group::getProperties()
-{
- return props;
-}
-
-void Group::fakeFirst()
-{
- emit firstSubscriberAppeared();
-}
-
-void Group::fakeLast()
-{
- emit lastSubscriberDisappeared();
-}
-
-/* Mocked implementation of Property */
-
-void resetVariants()
-{
- delete lastVariantSet;
- lastVariantSet = NULL;
-}
-
-void emitFirstOn(const QString &k)
-{
- foreach (Property* c, propertyList) {
- if (c->getKey() == k)
- c->fakeFirst();
- }
-
- foreach (Group* cg, groupList) {
- if (cg->keyList.contains(k))
- cg->fakeFirst();
- }
-}
-
-void emitLastOn(const QString &k)
-{
- foreach (Property* c, propertyList) {
- if (c->getKey() == k)
- c->fakeLast();
- }
-
- foreach (Group* cg, groupList) {
- if (cg->keyList.contains(k))
- cg->fakeLast();
- }
-}
-
-Service::Service(QDBusConnection::BusType busType, const QString &busName, QObject *parent)
-{
- lastBusName = busName;
- lastConnectionType = busType;
- keysList.clear();
-}
-
-void Service::start()
-{
-}
-
-void Service::stop()
-{
-}
-
-void Service::restart()
-{
-}
-
-
-void Service::setValue (const QString &key, const QVariant &val)
-{
- delete lastVariantSet;
- lastVariantSet = new QVariant(val);
-}
-
-void Property::setValue(const QVariant &v)
-{
- delete lastVariantSet;
- lastVariantSet = new QVariant(v);
-}
-
-void Property::unsetValue()
-{
- delete lastVariantSet;
- lastVariantSet = NULL;
-}
-
-Property::Property(const QString &name, QObject *obj)
- : QObject(obj), key(name)
-{
- delete lastVariantSet;
- lastVariantSet = NULL;
- propertyList.append(this);
- keysList.append(name);
-}
-
-Property::Property(Service &, const QString &name, QObject *obj)
- : QObject(obj), key(name)
-{
- delete lastVariantSet;
- lastVariantSet = NULL;
- propertyList.append(this);
- keysList.append(name);
-}
-
-Property::~Property()
-{
- propertyList.removeAll(this);
-}
-
-const QString Property::getKey() const
-{
- return key;
-}
-
-void Property::fakeFirst()
-{
- emit firstSubscriberAppeared(key);
-}
-
-void Property::fakeLast()
-{
- emit lastSubscriberDisappeared(key);
-}
-
-class ContextCUnitTest : public QObject
-{
- Q_OBJECT
-
-private slots:
- void init();
- void startStopStart();
- void installKey();
- void installGroup();
- void setInterger();
- void setBoolean();
- void setString();
- void setDouble();
- void clearKeyOnSubscribeKey();
- void clearKeyOnSubscribeGroup();
-};
-
-void MagicCallback(int subscribed, void *user_data)
-{
- lastSubscribed = subscribed;
- lastUserData = user_data;
-}
-
-// Before each test
-void ContextCUnitTest::init()
-{
- context_provider_stop();
- int res = context_provider_init(DBUS_BUS_SESSION, "com.test.provider");
- QCOMPARE(res, 1);
- QCOMPARE(lastBusName, QString("com.test.provider"));
- QCOMPARE(keysList.size(), 0);
- QCOMPARE(lastConnectionType, QDBusConnection::SessionBus);
-}
-
-void ContextCUnitTest::startStopStart()
-{
- context_provider_stop();
- QCOMPARE(context_provider_init(DBUS_BUS_SESSION, "com.test.provider"), 1);
- QCOMPARE(context_provider_init(DBUS_BUS_SESSION, "com.test.provider"), 0);
- context_provider_stop();
- QCOMPARE(context_provider_init(DBUS_BUS_SESSION, "com.test.provider"), 1);
-}
-
-void ContextCUnitTest::installKey()
-{
- context_provider_install_key("Battery.OnBattery", 0, MagicCallback, this);
- context_provider_install_key("Battery.Power", 0, MagicCallback, this);
- QVERIFY(keysList.contains("Battery.OnBattery"));
- QVERIFY(keysList.contains("Battery.Power"));
- QCOMPARE(keysList.length(), 2);
-
- emitFirstOn("Battery.OnBattery");
- QCOMPARE(lastSubscribed, 1);
- QCOMPARE(lastUserData, this);
-
- emitLastOn("Battery.Power");
- QCOMPARE(lastSubscribed, 0);
- QCOMPARE(lastUserData, this);
-
- emitFirstOn("Battery.Something");
- QCOMPARE(lastSubscribed, 0);
- QCOMPARE(lastUserData, this);
-}
-
-void ContextCUnitTest::installGroup()
-{
- const char *keys[] = {
- "Location.Lat",
- "Location.Lon",
- NULL
- };
- context_provider_install_group((char **)keys, 0, MagicCallback, this);
- QVERIFY(keysList.contains("Location.Lat"));
- QVERIFY(keysList.contains("Location.Lon"));
- QCOMPARE(keysList.length(), 2);
-
- emitFirstOn("Location.Lat");
- QCOMPARE(lastSubscribed, 1);
- QCOMPARE(lastUserData, this);
-
- emitLastOn("Location.Lat");
- QCOMPARE(lastSubscribed, 0);
- QCOMPARE(lastUserData, this);
-}
-
-void ContextCUnitTest::setInterger()
-{
- context_provider_install_key("Battery.OnBattery", 0, MagicCallback, this);
- context_provider_set_integer("Battery.OnBattery", 666);
- QCOMPARE(*lastVariantSet, QVariant(666));
-}
-
-void ContextCUnitTest::setBoolean()
-{
- context_provider_install_key("Battery.OnBattery", 0, MagicCallback, this);
- context_provider_set_boolean("Battery.OnBattery", 1);
- QCOMPARE(*lastVariantSet, QVariant(1));
-}
-
-void ContextCUnitTest::setString()
-{
- context_provider_install_key("Battery.OnBattery", 0, MagicCallback, this);
- context_provider_set_string("Battery.OnBattery", "testing");
- QCOMPARE(*lastVariantSet, QVariant("testing"));
-}
-
-void ContextCUnitTest::setDouble()
-{
- context_provider_install_key("Battery.OnBattery", 0, MagicCallback, this);
- context_provider_set_double("Battery.OnBattery", 1.23);
- QCOMPARE(*lastVariantSet, QVariant(1.23));
-}
-
-void ContextCUnitTest::clearKeyOnSubscribeKey()
-{
- context_provider_install_key("Battery.OnBattery", 1, MagicCallback, this);
- context_provider_set_integer("Battery.OnBattery", 666);
- emitFirstOn("Battery.OnBattery");
- QVERIFY(lastVariantSet == NULL);
-}
-
-void ContextCUnitTest::clearKeyOnSubscribeGroup()
-{
- const char *keys[] = {
- "Location.Lat",
- "Location.Lon",
- NULL
- };
-
- context_provider_install_group((char **)keys, 1, MagicCallback, this);
-
- context_provider_set_integer("Location.Lat", 123);
- context_provider_set_integer("Location.Lat", 456);
- emitFirstOn("Location.Lat");
- QVERIFY(lastVariantSet == NULL);
-}
-
-#include "contextcunittest.moc"
-
-} // end namespace
-
-QTEST_MAIN(ContextProvider::ContextCUnitTest);
diff --git a/libcontextprovider/unit-tests/contextc/group.h b/libcontextprovider/unit-tests/contextc/group.h
deleted file mode 100644
index 1a3e7b5d..00000000
--- a/libcontextprovider/unit-tests/contextc/group.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef GROUP_H
-#define GROUP_H
-
-#include <QObject>
-#include <QSet>
-#include <QStringList>
-
-namespace ContextProvider {
-
-class Property;
-
-class Group : public QObject
-{
- Q_OBJECT
-
-public:
- explicit Group(QObject* parent = 0);
- ~Group();
-
- QStringList keyList;
- void fakeFirst();
- void fakeLast();
-
- QSet<const Property *> getProperties();
-
- void add(const Property &prop);
-
- inline Group &operator<<(const Property &prop)
- { add(prop); return *this; }
-
- inline Group &operator<<(const Property *prop)
- { add(*prop); return *this; }
-
-signals:
- void firstSubscriberAppeared();
- void lastSubscriberDisappeared();
-
-private:
- QSet<const Property *> props;
-};
-
-} // end namespace
-
-#endif
diff --git a/libcontextprovider/unit-tests/contextc/property.h b/libcontextprovider/unit-tests/contextc/property.h
deleted file mode 100644
index 9f0073c8..00000000
--- a/libcontextprovider/unit-tests/contextc/property.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef PROPERTY_H
-#define PROPERTY_H
-
-#include <QObject>
-#include <QString>
-#include <QStringList>
-#include <QDBusConnection>
-#include <QHash>
-#include <QVariant>
-
-namespace ContextProvider {
-
-class Manager;
-
-class Property : public QObject
-{
- Q_OBJECT
-
-public:
- explicit Property(const QString &key, QObject *parent = 0);
- explicit Property(Service &, const QString &key, QObject *parent = 0);
- ~Property();
-
- void setValue(const QVariant &v);
- void unsetValue();
- const QString getKey() const;
-
- static bool initService(QDBusConnection::BusType busType, const QString &busName, const QStringList &keys);
- static void stopService(const QString &name);
-
- void fakeFirst();
- void fakeLast();
-
-signals:
- void firstSubscriberAppeared(const QString &key);
- void lastSubscriberDisappeared(const QString &key);
-
-private:
- QString key;
-};
-
-} // end namespace
-
-#endif
diff --git a/libcontextprovider/unit-tests/contextc/service.h b/libcontextprovider/unit-tests/contextc/service.h
deleted file mode 100644
index 01057f63..00000000
--- a/libcontextprovider/unit-tests/contextc/service.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef SERVICE_H
-#define SERVICE_H
-
-#include <QObject>
-#include <QString>
-#include <QStringList>
-#include <QDBusConnection>
-#include <QHash>
-#include <QVariant>
-
-namespace ContextProvider {
-
-class Manager;
-
-class Service : QObject
-{
- Q_OBJECT
-
-public:
- explicit Service(QDBusConnection::BusType busType, const QString &busName, QObject *parent = 0);
-
- void start();
- void stop();
- void restart();
-
- void setAsDefault();
-
- void setValue (const QString &key, const QVariant &val);
-};
-
-} // end namespace
-
-#endif
diff --git a/libcontextprovider/unit-tests/contextgroup/.gitignore b/libcontextprovider/unit-tests/contextgroup/.gitignore
deleted file mode 100644
index c607b34a..00000000
--- a/libcontextprovider/unit-tests/contextgroup/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-contextgroup.cpp
-contextgroup.h
-sconnect.h
-contextgroupunittest
-logging.h
-logging.cpp
-loggingfeatures.h
-group.cpp
-group.h
diff --git a/libcontextprovider/unit-tests/contextgroup/Makefile.am b/libcontextprovider/unit-tests/contextgroup/Makefile.am
deleted file mode 100644
index 0e475aef..00000000
--- a/libcontextprovider/unit-tests/contextgroup/Makefile.am
+++ /dev/null
@@ -1,22 +0,0 @@
-check_PROGRAMS = contextgroupunittest
-
-# test's sources
-contextgroupunittest_SOURCES = contextgroupunittest.cpp service.h property.h
-
-COVERAGE_FILES = group.cpp
-
-# do the testing, coverage, etc. stuff
-# tests.am is using +=, so we have to set a value here for these four always
-AM_CXXFLAGS = $(QtCore_CFLAGS)
-AM_LDFLAGS = $(QtCore_LIBS)
-FROM_SOURCE = loggingfeatures.h group.h group.cpp # copy these files from the real source
-FROM_SOURCE_DIR = $(srcdir)/../../src
-LDADD =
-include $(top_srcdir)/am/tests.am
-
-nodist_contextgroupunittest_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(contextgroupunittest_SOURCES) $(FROM_SOURCE))
-include $(top_srcdir)/am/qt.am
-
-# when MOCing from .cpp file, you also has to help the dependency tracker
-contextgroupunittest.o: contextgroupunittest.moc
diff --git a/libcontextprovider/unit-tests/contextgroup/contextgroupunittest.cpp b/libcontextprovider/unit-tests/contextgroup/contextgroupunittest.cpp
deleted file mode 100644
index 01fb034a..00000000
--- a/libcontextprovider/unit-tests/contextgroup/contextgroupunittest.cpp
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "group.h" // Object to be tested
-#include "service.h"
-#include "property.h"
-
-#include <QObject>
-#include <QSignalSpy>
-#include <QTest>
-
-namespace ContextProvider {
-
-// Mock implementation of the Property class
-
-QMap<QString, Property*> createdObjects;
-
-Property::Property(Service &service, QString key, QObject* parent)
- : myKey(key)
-{
- // Store the created object
- createdObjects.insert(key, this);
-}
-
-Property::Property(QString key, QObject* parent)
- : myKey(key)
-{
- // Store the created object
- createdObjects.insert(key, this);
-}
-
-const QString &Property::key() const
-{
- return myKey;
-}
-
-class ContextGroupUnitTest : public QObject
-{
- Q_OBJECT
-
-private slots:
- void init();
- void cleanup();
-
- void oneProperty();
- void twoProperties();
-
-private:
- // Object to be tested
- Group* contextGroup;
- // Mock objects
- Property* property1;
- Property* property2;
-};
-
-// Before each test
-void ContextGroupUnitTest::init()
-{
- property1 = new Property("test.key.1");
- property2 = new Property("test.key.2");
- createdObjects.clear();
-}
-
-// After each test
-void ContextGroupUnitTest::cleanup()
-{
- delete contextGroup;
- contextGroup = 0;
- delete property1;
- property1 = 0;
- delete property2;
- property2 = 0;
-}
-
-void ContextGroupUnitTest::oneProperty()
-{
- // Create the object to be tested
- contextGroup = new Group();
- *contextGroup << property1;
-
- // Start spying on signals
- QSignalSpy firstSpy(contextGroup, SIGNAL(firstSubscriberAppeared()));
- QSignalSpy lastSpy(contextGroup, SIGNAL(lastSubscriberDisappeared()));
-
- // Test: check the initial subscription status
- // Expected result: the group is not subscribed to
- QCOMPARE(contextGroup->isSubscribedTo(), false);
-
- // Test: property is subscribed to
- emit property1->firstSubscriberAppeared("test.key.1");
-
- // Expected result: the Group emits the firstSubscriberAppeared signal
- QCOMPARE(firstSpy.count(), 1);
- QCOMPARE(lastSpy.count(), 0);
- // And the group is subscribed to
- QCOMPARE(contextGroup->isSubscribedTo(), true);
-
- // Test: property is unsubscribed from
- emit property1->lastSubscriberDisappeared("test.key.1");
-
- // Expected result: the Group emits the lastSubscriberDisappeared signal
- QCOMPARE(firstSpy.count(), 1);
- QCOMPARE(lastSpy.count(), 1);
- // And the group is not subscribed to
- QCOMPARE(contextGroup->isSubscribedTo(), false);
-}
-
-void ContextGroupUnitTest::twoProperties()
-{
- // Create the object to be tested
- contextGroup = new Group();
- *contextGroup << property1 << property2;
-
- // Start spying on signals
- QSignalSpy firstSpy(contextGroup, SIGNAL(firstSubscriberAppeared()));
- QSignalSpy lastSpy(contextGroup, SIGNAL(lastSubscriberDisappeared()));
-
- // Test: property 1 is subscribed to
- emit property1->firstSubscriberAppeared("test.key.1");
-
- // Expected result: the Group emits the firstSubscriberAppeared signal
- QCOMPARE(firstSpy.count(), 1);
- QCOMPARE(lastSpy.count(), 0);
- // And the group is subscribed to
- QCOMPARE(contextGroup->isSubscribedTo(), true);
-
- // Test: property 2 is subscribed to
- emit property2->firstSubscriberAppeared("test.key.2");
-
- // Expected result: the Group doesn't emit anything
- QCOMPARE(firstSpy.count(), 1);
- QCOMPARE(lastSpy.count(), 0);
- // And the group is still subscribed to
- QCOMPARE(contextGroup->isSubscribedTo(), true);
-
- // Test: property 1 is unsubscribed from
- emit property1->lastSubscriberDisappeared("test.key.1");
-
- // Expected result: the Group doesn't emit anything
- QCOMPARE(firstSpy.count(), 1);
- QCOMPARE(lastSpy.count(), 0);
- // And the group is still subscribed to
- QCOMPARE(contextGroup->isSubscribedTo(), true);
-
- // Test: property 2 is unsubscribed from
- emit property2->lastSubscriberDisappeared("test.key.2");
-
- // Expected result: the Group emits the lastSubscriberDisappeared signal
- QCOMPARE(firstSpy.count(), 1);
- QCOMPARE(lastSpy.count(), 1);
- // And the group is not subscribed to
- QCOMPARE(contextGroup->isSubscribedTo(), false);
-}
-
-#include "contextgroupunittest.moc"
-
-} // end namespace
-
-QTEST_MAIN(ContextProvider::ContextGroupUnitTest);
diff --git a/libcontextprovider/unit-tests/contextgroup/property.h b/libcontextprovider/unit-tests/contextgroup/property.h
deleted file mode 100644
index 90c784f5..00000000
--- a/libcontextprovider/unit-tests/contextgroup/property.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef PROPERTY_H
-#define PROPERTY_H
-
-// This is a mock implementation
-
-#include <QObject>
-
-namespace ContextProvider {
-
-class Property : public QObject
-{
- Q_OBJECT
-public:
- Property(QString key, QObject* parent = 0);
- Property(Service &service, QString key, QObject* parent = 0);
-
- const QString &key() const;
-
- QString myKey;
-
-signals:
- void firstSubscriberAppeared(const QString &key);
- void lastSubscriberDisappeared(const QString &key);
-
- friend class ContextGroupUnitTest;
-};
-
-} // end namespace
-
-#endif
diff --git a/libcontextprovider/unit-tests/contextgroup/service.h b/libcontextprovider/unit-tests/contextgroup/service.h
deleted file mode 100644
index c2c5405b..00000000
--- a/libcontextprovider/unit-tests/contextgroup/service.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef SERVICE_H
-#define SERVICE_H
-
-// This is a mock implementation
-
-#include <QObject>
-
-namespace ContextProvider {
-
-class Service : public QObject
-{
- Q_OBJECT
-};
-
-} // end namespace
-
-#endif
diff --git a/libcontextprovider/unit-tests/manager/.gitignore b/libcontextprovider/unit-tests/manager/.gitignore
deleted file mode 100644
index 9427d087..00000000
--- a/libcontextprovider/unit-tests/manager/.gitignore
+++ /dev/null
@@ -1,11 +0,0 @@
-logging.cpp
-logging.h
-loggingfeatures.h
-manager.h
-manager.cpp
-subscriber.cpp
-subscriber.h
-managerunittest
-queuedinvoker.cpp
-queuedinvoker.h
-sconnect.h
diff --git a/libcontextprovider/unit-tests/manager/Makefile.am b/libcontextprovider/unit-tests/manager/Makefile.am
deleted file mode 100644
index 3743bd1a..00000000
--- a/libcontextprovider/unit-tests/manager/Makefile.am
+++ /dev/null
@@ -1,22 +0,0 @@
-check_PROGRAMS = managerunittest
-
-# test's sources
-managerunittest_SOURCES = managerunittest.cpp
-
-COVERAGE_FILES = manager.cpp
-
-# do the testing, coverage, etc. stuff
-# tests.am is using +=, so we have to set a value here for these four always
-AM_CXXFLAGS = $(QtCore_CFLAGS) $(QtDBus_CFLAGS)
-AM_LDFLAGS = $(QtCore_LIBS) $(QtDBus_LIBS)
-FROM_SOURCE = queuedinvoker.cpp queuedinvoker.h subscriber.h subscriber.cpp loggingfeatures.h manager.cpp manager.h # copy these files from the real source
-FROM_SOURCE_DIR = $(srcdir)/../../src
-LDADD =
-include $(top_srcdir)/am/tests.am
-
-nodist_managerunittest_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(managerunittest_SOURCES) $(FROM_SOURCE))
-include $(top_srcdir)/am/qt.am
-
-# when MOCing from .cpp file, you also has to help the dependency tracker
-managerunittest.o: managerunittest.moc
diff --git a/libcontextprovider/unit-tests/manager/managerunittest.cpp b/libcontextprovider/unit-tests/manager/managerunittest.cpp
deleted file mode 100644
index 50c18654..00000000
--- a/libcontextprovider/unit-tests/manager/managerunittest.cpp
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <QtTest/QtTest>
-#include <QtCore>
-#include <stdlib.h>
-#include "manager.h"
-#include "subscriber.h"
-
-using namespace ContextProvider;
-
-class ManagerUnitTest : public QObject
-{
- Q_OBJECT
-
-private slots:
- void init();
- void cleanup();
- void keys();
- void duplicateKeys();
- void values();
- void subscriptionCount();
- void subscriptionCountNonExistent();
- void getSubscriber();
- void getKeys();
- void busNameIsGone();
- void subscribeAndUnsubscribe();
- void setKeyValue();
- void getKeyValue();
- void getKeyValueInvalid();
- void setKeyValueSame();
- void setKeyValueNonExistent();
-
-private:
- Manager *manager;
-};
-
-// Before each test
-void ManagerUnitTest::init()
-{
- manager = new Manager();
- manager->addKey("Battery.Power");
- manager->addKey("Battery.Voltage");
- manager->addKey("Battery.AboutToExplode");
-}
-
-// After each test
-void ManagerUnitTest::cleanup()
-{
- delete manager;
-}
-
-void ManagerUnitTest::keys()
-{
- QVERIFY(manager->keyIsValid("Battery.Power"));
- QVERIFY(manager->keyIsValid("Battery.Voltage"));
- QVERIFY(manager->keyIsValid("Battery.AboutToExplode"));
- QVERIFY(manager->keyIsValid("Battery.Something") == false);
-}
-
-void ManagerUnitTest::getKeys()
-{
- QStringList keys = manager->getKeys();
- QCOMPARE(keys.length(), 3);
- QVERIFY(keys.contains("Battery.Power"));
- QVERIFY(keys.contains("Battery.Voltage"));
- QVERIFY(keys.contains("Battery.AboutToExplode"));
-}
-
-void ManagerUnitTest::duplicateKeys()
-{
- Manager *m = new Manager();
- m->addKey("Battery.Voltage");
- m->addKey("Battery.Voltage");
- m->addKey("Battery.Power");
-
- QVERIFY(m->keyIsValid("Battery.Power"));
- QVERIFY(m->keyIsValid("Battery.Voltage"));
-
- delete m;
-}
-
-void ManagerUnitTest::values()
-{
- QVERIFY(manager->getKeyValue("Battery.Power").isValid() == FALSE);
- QVERIFY(manager->getKeyValue("Battery.Voltage").isValid() == FALSE);
- QVERIFY(manager->getKeyValue("Battery.AboutToExplode").isValid() == FALSE);
- QVERIFY(manager->getKeyValue("Battery.Something").isValid() == FALSE);
-}
-
-void ManagerUnitTest::subscriptionCount()
-{
- QCOMPARE(manager->getSubscriptionCount("Battery.Power"), 0);
- QCOMPARE(manager->getSubscriptionCount("Battery.Voltage"), 0);
- QCOMPARE(manager->getSubscriptionCount("Battery.AboutToExplode"), 0);
-
- QSignalSpy spy1(manager, SIGNAL(firstSubscriberAppeared(QString)));
- QSignalSpy spy2(manager, SIGNAL(lastSubscriberDisappeared(QString)));
-
- manager->increaseSubscriptionCount("Battery.Voltage");
- QCOMPARE(manager->getSubscriptionCount("Battery.Voltage"), 1);
- QCOMPARE(spy1.count(), 1);
- QList<QVariant> args1 = spy1.takeFirst();
- QCOMPARE(args1.at(0).toString(), QString("Battery.Voltage"));
-
- manager->increaseSubscriptionCount("Battery.Voltage");
- QCOMPARE(manager->getSubscriptionCount("Battery.Voltage"), 2);
- QCOMPARE(spy1.count(), 0);
-
- manager->decreaseSubscriptionCount("Battery.Voltage");
- QCOMPARE(manager->getSubscriptionCount("Battery.Voltage"), 1);
- QCOMPARE(spy2.count(), 0);
-
- manager->decreaseSubscriptionCount("Battery.Voltage");
- QCOMPARE(manager->getSubscriptionCount("Battery.Voltage"), 0);
- QCOMPARE(spy2.count(), 1);
- QList<QVariant> args2 = spy2.takeFirst();
- QCOMPARE(args2.at(0).toString(), QString("Battery.Voltage"));
-
- // Check if following decrease does not trigger a fire
- manager->decreaseSubscriptionCount("Battery.Voltage");
- QCOMPARE(manager->getSubscriptionCount("Battery.Voltage"), 0);
- QCOMPARE(spy2.count(), 0);
-}
-
-void ManagerUnitTest::subscriptionCountNonExistent()
-{
- QCOMPARE(manager->getSubscriptionCount("Battery.Power"), 0);
- QCOMPARE(manager->getSubscriptionCount("Battery.Voltage"), 0);
- QCOMPARE(manager->getSubscriptionCount("Battery.NonExistent"), -1);
-
- QSignalSpy spy1(manager, SIGNAL(firstSubscriberAppeared(QString)));
- QSignalSpy spy2(manager, SIGNAL(lastSubscriberDisappeared(QString)));
-
- manager->increaseSubscriptionCount("Battery.NonExistent");
- QCOMPARE(manager->getSubscriptionCount("Battery.NonExistent"), -1);
- QCOMPARE(spy1.count(), 0);
-
- manager->decreaseSubscriptionCount("Battery.NonExistent");
- QCOMPARE(manager->getSubscriptionCount("Battery.NonExistent"), -1);
- QCOMPARE(spy2.count(), 0);
-}
-
-void ManagerUnitTest::getSubscriber()
-{
- Subscriber *s1 = manager->getSubscriber("some:name");
- QVERIFY(s1 != NULL);
-
- Subscriber *s2 = manager->getSubscriber("some:name");
- QVERIFY(s2 != NULL);
- QVERIFY(s1 == s2);
- QCOMPARE(manager->hasSubscriberWithBusName("some:name"), true);
-}
-
-void ManagerUnitTest::busNameIsGone()
-{
- Subscriber *s1 = manager->getSubscriber("some:name");
- QVERIFY(s1 != NULL);
-
- QCOMPARE(manager->hasSubscriberWithBusName("some:name"), true);
- manager->busNameIsGone("some:name");
- QCOMPARE(manager->hasSubscriberWithBusName("some:name"), false);
-}
-
-void ManagerUnitTest::subscribeAndUnsubscribe()
-{
- Subscriber *s = manager->getSubscriber("some:name");
- QVERIFY(s != NULL);
-
- QStringList keys;
- QStringList undetermined;
- keys.append("Battery.Voltage");
-
- QMap <QString, QVariant> values = s->subscribe(keys, undetermined);
- QCOMPARE(values.size() + undetermined.size(), keys.size());
-
- QCOMPARE(manager->getSubscriptionCount("Battery.Voltage"), 1);
-
- s->unsubscribe(keys);
-
- QCOMPARE(manager->getSubscriptionCount("Battery.Voltage"), 0);
- QCOMPARE(manager->hasSubscriberWithBusName("some:name"), true);
-}
-
-void ManagerUnitTest::setKeyValue()
-{
- QSignalSpy spy(manager, SIGNAL(keyValueChanged(const QString&, const QVariant&)));
- manager->setKeyValue("Battery.Power", QVariant(100));
- QCOMPARE(spy.count(), 1);
- QList<QVariant> args = spy.takeFirst();
- QCOMPARE(args.at(0).toString(), QString("Battery.Power"));
- // FIXME FIXME FIXME
- //QCOMPARE(args.at(1).toInt(), 100);
-}
-
-void ManagerUnitTest::getKeyValue()
-{
- QCOMPARE(manager->getKeyValue("Battery.Power"), QVariant());
- manager->setKeyValue("Battery.Power", QVariant(86));
- QCOMPARE(manager->getKeyValue("Battery.Power"), QVariant(86));
-}
-
-void ManagerUnitTest::getKeyValueInvalid()
-{
- QCOMPARE(manager->getKeyValue("Battery.Something"), QVariant());
- manager->setKeyValue("Battery.Something", QVariant(86));
- QCOMPARE(manager->getKeyValue("Battery.Something"), QVariant());
-}
-
-void ManagerUnitTest::setKeyValueSame()
-{
- QSignalSpy spy(manager, SIGNAL(keyValueChanged(const QString&, const QVariant&)));
- manager->setKeyValue("Battery.Power", QVariant(100));
- manager->setKeyValue("Battery.Power", QVariant(100));
- QCOMPARE(spy.count(), 1);
-}
-
-void ManagerUnitTest::setKeyValueNonExistent()
-{
- QSignalSpy spy(manager, SIGNAL(keyValueChanged(const QString&, const QVariant&)));
- manager->setKeyValue("Battery.NonExistent", QVariant(100));
- QCOMPARE(spy.count(), 0);
-}
-
-#include "managerunittest.moc"
-QTEST_MAIN(ManagerUnitTest);
diff --git a/libcontextprovider/unit-tests/property/.gitignore b/libcontextprovider/unit-tests/property/.gitignore
deleted file mode 100644
index 46ac6455..00000000
--- a/libcontextprovider/unit-tests/property/.gitignore
+++ /dev/null
@@ -1,7 +0,0 @@
-propertyunittest
-property.cpp
-property.h
-sconnect.h
-logging.h
-logging.cpp
-loggingfeatures.h
diff --git a/libcontextprovider/unit-tests/property/Makefile.am b/libcontextprovider/unit-tests/property/Makefile.am
deleted file mode 100644
index 6ad56004..00000000
--- a/libcontextprovider/unit-tests/property/Makefile.am
+++ /dev/null
@@ -1,22 +0,0 @@
-check_PROGRAMS = propertyunittest
-
-# test's sources
-propertyunittest_SOURCES = propertyunittest.cpp manager.h service.h servicebackend.h
-
-COVERAGE_FILES = property.cpp
-
-# do the testing, coverage, etc. stuff
-# tests.am is using +=, so we have to set a value here for these four always
-AM_CXXFLAGS = $(QtCore_CFLAGS) $(QtDBus_CFLAGS)
-AM_LDFLAGS = $(QtCore_LIBS) $(QtDBus_LIBS)
-FROM_SOURCE = loggingfeatures.h property.cpp property.h # copy these files from the real source
-FROM_SOURCE_DIR = $(srcdir)/../../src
-LDADD =
-include $(top_srcdir)/am/tests.am
-
-nodist_propertyunittest_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(propertyunittest_SOURCES) $(FROM_SOURCE))
-include $(top_srcdir)/am/qt.am
-
-# when MOCing from .cpp file, you also has to help the dependency tracker
-propertyunittest.o: propertyunittest.moc
diff --git a/libcontextprovider/unit-tests/property/manager.h b/libcontextprovider/unit-tests/property/manager.h
deleted file mode 100644
index 9aed0020..00000000
--- a/libcontextprovider/unit-tests/property/manager.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef MANAGER_H
-#define MANAGER_H
-
-#include <QDBusObjectPath>
-#include <QDBusMessage>
-#include <QHash>
-#include <QObject>
-#include <QDBusConnection>
-#include <QStringList>
-
-namespace ContextProvider {
-
-class Subscriber;
-
-class Manager : public QObject
-{
- Q_OBJECT
-
-public:
- Manager();
- void addKey(const QString &key);
- bool keyIsValid(const QString &key) const;
- void increaseSubscriptionCount(const QString &key);
- void decreaseSubscriptionCount(const QString &key);
- const QVariant keyValue(const QString &key);
- void setKeyValue(const QString &key, const QVariant &v);
- QVariant getKeyValue(const QString &key);
- void fakeFirst(const QString &key);
- void fakeLast(const QString &key);
- QStringList getKeys();
-
-signals:
- void firstSubscriberAppeared(const QString &key);
- void lastSubscriberDisappeared(const QString &key);
-
-private:
- QStringList keys;
-};
-
-} // namespace ContextProvider
-
-#endif
diff --git a/libcontextprovider/unit-tests/property/propertyunittest.cpp b/libcontextprovider/unit-tests/property/propertyunittest.cpp
deleted file mode 100644
index be3402b3..00000000
--- a/libcontextprovider/unit-tests/property/propertyunittest.cpp
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <QtTest/QtTest>
-#include <QtCore>
-#include <stdlib.h>
-#include "service.h"
-#include "property.h"
-#include "manager.h"
-
-namespace ContextProvider {
-
-Manager *manager;
-ServiceBackend *serviceBackend;
-QVariant *lastVariantSet = NULL;
-
-void resetVariants()
-{
- delete lastVariantSet;
- lastVariantSet = NULL;
-}
-
-bool Manager::keyIsValid(const QString &key) const
-{
- return (keys.contains(key));
-}
-
-void Manager::increaseSubscriptionCount(const QString &key)
-{
-}
-
-void Manager::decreaseSubscriptionCount(const QString &key)
-{
-}
-
-const QVariant Manager::keyValue(const QString &key)
-{
- return QVariant();
-}
-
-void Manager::setKeyValue(const QString &key, const QVariant &v)
-{
- delete lastVariantSet;
- lastVariantSet = new QVariant(v);
-}
-
-QStringList Manager::getKeys()
-{
- return keys;
-}
-
-QVariant Manager::getKeyValue(const QString &key)
-{
- if (lastVariantSet)
- return QVariant(*lastVariantSet);
- else
- return QVariant();
-}
-
-void Manager::fakeFirst(const QString &key)
-{
- emit firstSubscriberAppeared(key);
-}
-
-void Manager::fakeLast(const QString &key)
-{
- emit lastSubscriberDisappeared(key);
-}
-
-Manager::Manager()
-{
-}
-
-void Manager::addKey(const QString &key)
-{
- keys << key;
-}
-
-// Mock implementation of Service
-
-Service::Service()
-{
- backend = new ContextProvider::ServiceBackend();
-}
-
-// Mock implementation of ServiceBackend
-ServiceBackend* ServiceBackend::defaultServiceBackend = NULL;
-
-Manager *ServiceBackend::manager()
-{
- return ContextProvider::manager;
-}
-
-class PropertyUnitTest : public QObject
-{
- Q_OBJECT
-
- Service service;
- Property* battery_voltage;
- Property* battery_is_charging;
-
-private slots:
- void initTestCase();
- void init();
- void cleanup();
- void getProperty();
- void checkSignals();
- void setGetBool();
- void setGetInt();
- void setGetDouble();
- void setGetString();
- void setGetQVariant();
- void unset();
-};
-
-// Before all tests
-void PropertyUnitTest::initTestCase()
-{
-}
-
-void PropertyUnitTest::init()
-{
- manager = new Manager();
- battery_voltage = new Property(service, "Battery.Voltage");
- battery_is_charging = new Property(service, "Battery.IsCharging");
-}
-
-void PropertyUnitTest::cleanup()
-{
- delete battery_voltage; battery_voltage = NULL;
- delete battery_is_charging; battery_is_charging = NULL;
- delete manager; manager = NULL;
-}
-
-void PropertyUnitTest::getProperty()
-{
- QCOMPARE(battery_voltage->key(), QString("Battery.Voltage"));
-}
-
-void PropertyUnitTest::checkSignals()
-{
- resetVariants();
-
- QSignalSpy spy1(battery_voltage, SIGNAL(firstSubscriberAppeared(QString)));
- QSignalSpy spy2(battery_voltage, SIGNAL(lastSubscriberDisappeared(QString)));
-
- manager->fakeFirst("Battery.Voltage");
-
- QCOMPARE(spy1.count(), 1);
- QList<QVariant> args1 = spy1.takeFirst();
- QCOMPARE(args1.at(0).toString(), QString("Battery.Voltage"));
-
- manager->fakeLast("Battery.Voltage");
-
- QCOMPARE(spy2.count(), 1);
- QList<QVariant> args2 = spy2.takeFirst();
- QCOMPARE(args2.at(0).toString(), QString("Battery.Voltage"));
-}
-
-void PropertyUnitTest::setGetBool()
-{
- resetVariants();
- battery_is_charging->setValue(true);
- QCOMPARE(*lastVariantSet, QVariant(true));
- QCOMPARE(battery_is_charging->value(), QVariant(true));
-}
-
-void PropertyUnitTest::setGetInt()
-{
- resetVariants();
- battery_voltage->setValue(666);
- QCOMPARE(*lastVariantSet, QVariant(666));
- QCOMPARE(battery_voltage->value(), QVariant(666));
- QVERIFY(battery_voltage->isSet());
-}
-
-void PropertyUnitTest::setGetDouble()
-{
- resetVariants();
- battery_voltage->setValue(0.456);
- QCOMPARE(*lastVariantSet, QVariant(0.456));
- QCOMPARE(battery_voltage->value(), QVariant(0.456));
- QVERIFY(battery_voltage->isSet());
-}
-
-void PropertyUnitTest::setGetString()
-{
- resetVariants();
- battery_voltage->setValue(QString("Hello!"));
- QCOMPARE(*lastVariantSet, QVariant(QString("Hello!")));
- QCOMPARE(battery_voltage->value(), QVariant("Hello!"));
- QVERIFY(battery_voltage->isSet());
-}
-
-void PropertyUnitTest::setGetQVariant()
-{
- resetVariants();
- battery_voltage->setValue(QVariant(123));
- QCOMPARE(*lastVariantSet, QVariant(123));
- QCOMPARE(battery_voltage->value(), QVariant(123));
- QVERIFY(battery_voltage->isSet());
-}
-
-void PropertyUnitTest::unset()
-{
- resetVariants();
- QVERIFY(battery_voltage->isSet() == false);
- battery_voltage->setValue(QVariant(123));
- QVERIFY(battery_voltage->isSet());
- QCOMPARE(battery_voltage->value(), QVariant(123));
- battery_voltage->unsetValue();
- QCOMPARE(battery_voltage->value(), QVariant());
- QVERIFY(!battery_voltage->isSet());
-}
-
-#include "propertyunittest.moc"
-
-} // end namespace
-
-QTEST_MAIN(ContextProvider::PropertyUnitTest);
diff --git a/libcontextprovider/unit-tests/property/service.h b/libcontextprovider/unit-tests/property/service.h
deleted file mode 100644
index cbb14c34..00000000
--- a/libcontextprovider/unit-tests/property/service.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-#include <QObject>
-#include "servicebackend.h"
-
-namespace ContextProvider {
-
-class Property;
-class Manager;
-
-class Service : public QObject
-{
-public:
- Service();
- ServiceBackend *backend;
-};
-}
diff --git a/libcontextprovider/unit-tests/property/servicebackend.h b/libcontextprovider/unit-tests/property/servicebackend.h
deleted file mode 100644
index 52d0faf6..00000000
--- a/libcontextprovider/unit-tests/property/servicebackend.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef SERVICEBACKEND_H
-#define SERVICEBACKEND_H
-
-#include <QObject>
-#include <QString>
-#include <QStringList>
-#include <QDBusConnection>
-#include <QHash>
-#include <QVariant>
-
-namespace ContextProvider {
-
-class Manager;
-
-class ServiceBackend : QObject
-{
- Q_OBJECT
-
-public:
- Manager *manager();
- static ServiceBackend *defaultServiceBackend;
-};
-
-} // end namespace
-
-#endif
diff --git a/libcontextprovider/unit-tests/service/.gitignore b/libcontextprovider/unit-tests/service/.gitignore
deleted file mode 100644
index 6720a581..00000000
--- a/libcontextprovider/unit-tests/service/.gitignore
+++ /dev/null
@@ -1,7 +0,0 @@
-coverage
-loggingfeatures.h
-queuedinvoker.cpp
-queuedinvoker.h
-service.cpp
-service.h
-serviceunittest
diff --git a/libcontextprovider/unit-tests/service/Makefile.am b/libcontextprovider/unit-tests/service/Makefile.am
deleted file mode 100644
index 8e9d8ef8..00000000
--- a/libcontextprovider/unit-tests/service/Makefile.am
+++ /dev/null
@@ -1,22 +0,0 @@
-check_PROGRAMS = serviceunittest
-
-# test's sources
-serviceunittest_SOURCES = serviceunittest.cpp manager.h manageradaptor.h property.h servicebackend.h
-
-COVERAGE_FILES = service.cpp
-
-# do the testing, coverage, etc. stuff
-# tests.am is using +=, so we have to set a value here for these four always
-AM_CXXFLAGS = $(QtCore_CFLAGS) $(QtDBus_CFLAGS)
-AM_LDFLAGS = $(QtCore_LIBS) $(QtDBus_LIBS)
-FROM_SOURCE = loggingfeatures.h service.cpp service.h queuedinvoker.h queuedinvoker.cpp
-FROM_SOURCE_DIR = $(srcdir)/../../src
-LDADD =
-include $(top_srcdir)/am/tests.am
-
-nodist_serviceunittest_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(serviceunittest_SOURCES) $(FROM_SOURCE))
-include $(top_srcdir)/am/qt.am
-
-# when MOCing from .cpp file, you also has to help the dependency tracker
-serviceunittest.o: serviceunittest.moc
diff --git a/libcontextprovider/unit-tests/service/manager.h b/libcontextprovider/unit-tests/service/manager.h
deleted file mode 100644
index 6627f608..00000000
--- a/libcontextprovider/unit-tests/service/manager.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef MANAGER_H
-#define MANAGER_H
-
-#include <QHash>
-#include <QObject>
-#include <QStringList>
-#include <QVariant>
-
-namespace ContextProvider {
-
-class Subscriber;
-
-class Manager : public QObject
-{
- Q_OBJECT
-
-public:
- Manager();
-
- void addKey(const QString &key);
- void setKeyValue(const QString &key, const QVariant &v);
- QVariant getKeyValue(const QString &key);
-};
-
-} // namespace ContextProvider
-
-#endif
diff --git a/libcontextprovider/unit-tests/service/manageradaptor.h b/libcontextprovider/unit-tests/service/manageradaptor.h
deleted file mode 100644
index 9c816919..00000000
--- a/libcontextprovider/unit-tests/service/manageradaptor.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef MANAGERADAPTOR_H
-#define MANAGERADAPTOR_H
-
-#include <QObject>
-#include <QDBusAbstractAdaptor>
-#include <QDBusMessage>
-#include <QDBusConnection>
-#include <QDBusObjectPath>
-#include "manager.h"
-
-namespace ContextProvider {
-
-class ManagerAdaptor: public QObject
-{
- Q_OBJECT
-
-public:
- ManagerAdaptor (Manager* manager, QDBusConnection *connection);
-};
-
-} // namespace ContextProvider
-
-#endif
diff --git a/libcontextprovider/unit-tests/service/property.h b/libcontextprovider/unit-tests/service/property.h
deleted file mode 100644
index 5cb8a6dd..00000000
--- a/libcontextprovider/unit-tests/service/property.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef PROPERTY_H
-#define PROPERTY_H
-
-// This is a mock implementation
-
-#include <QObject>
-
-namespace ContextProvider {
-
-class Manager;
-class Service;
-
-class Property : public QObject
-{
- Q_OBJECT
-public:
- Property(QString key, QObject* parent = 0);
- Property(Service &service, QString key, QObject* parent = 0);
-
- void setManager(Manager *);
-
- QString key();
-
-signals:
- void firstSubscriberAppeared(const QString &key);
- void lastSubscriberDisappeared(const QString &key);
-};
-
-} // end namespace
-
-#endif
diff --git a/libcontextprovider/unit-tests/service/servicebackend.h b/libcontextprovider/unit-tests/service/servicebackend.h
deleted file mode 100644
index d158d5be..00000000
--- a/libcontextprovider/unit-tests/service/servicebackend.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef SERVICEBACKEND_H
-#define SERVICEBACKEND_H
-
-#include <QObject>
-#include <QString>
-#include <QStringList>
-#include <QDBusConnection>
-#include <QHash>
-#include <QVariant>
-
-namespace ContextProvider {
-
-class Manager;
-
-class ServiceBackend : QObject
-{
- Q_OBJECT
-
-public:
- explicit ServiceBackend(QDBusConnection connection, const QString &busName = "");
- Manager *manager();
- static ServiceBackend *defaultServiceBackend;
-
- void setAsDefault();
-
- void ref();
- void unref();
- bool sharedConnection();
- bool start();
- void stop();
- static ServiceBackend* instance(QDBusConnection connection);
- static ServiceBackend* instance(QDBusConnection::BusType busType,
- const QString &busName, bool autoStart = true);
- QDBusConnection connection;
-};
-
-} // end namespace
-
-#endif
diff --git a/libcontextprovider/unit-tests/service/serviceunittest.cpp b/libcontextprovider/unit-tests/service/serviceunittest.cpp
deleted file mode 100644
index 3247e20b..00000000
--- a/libcontextprovider/unit-tests/service/serviceunittest.cpp
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <QtTest/QtTest>
-#include <QtCore>
-#include <stdlib.h>
-#include "manager.h"
-#include "service.h"
-#include "servicebackend.h"
-#include "property.h"
-#include "manageradaptor.h"
-
-using namespace ContextProvider;
-
-#define STATE_UNDEFINED 0
-#define STATE_STOPPED 1
-#define STATE_STARTED 2
-#define STATE_RESTARTED 3
-
-int lastState = STATE_UNDEFINED;
-
-QString *lastKey = NULL;
-QVariant *lastValue = NULL;
-Manager *lastManager = NULL;
-QDBusConnection *lastConnection = NULL;
-
-/* Mocked ServiceBackend */
-
-ServiceBackend* ServiceBackend::defaultServiceBackend = NULL;
-
-ServiceBackend::ServiceBackend(QDBusConnection connection, const QString &busName) :
- connection(connection)
-{
- lastState = STATE_UNDEFINED;
-}
-
-Manager* ServiceBackend::manager()
-{
- return new Manager();
-}
-
-void ServiceBackend::setAsDefault()
-{
- defaultServiceBackend = this;
-}
-
-void ServiceBackend::ref()
-{
-}
-
-void ServiceBackend::unref()
-{
-}
-
-bool ServiceBackend::start()
-{
- if (lastState <= STATE_STOPPED) {
- lastState = STATE_STARTED;
- return true;
- } else
- return false;
-}
-
-void ServiceBackend::stop()
-{
- lastState = STATE_STOPPED;
-}
-
-bool ServiceBackend::sharedConnection()
-{
- return false;
-}
-
-ServiceBackend* ServiceBackend::instance(QDBusConnection connection)
-{
- return new ServiceBackend(connection);
-}
-
-ServiceBackend* ServiceBackend::instance(QDBusConnection::BusType busType,
- const QString &busName, bool autoStart)
-{
- ServiceBackend *r = new ServiceBackend(QDBusConnection::sessionBus(), busName);
- if (autoStart)
- r->start();
-
- return r;
-}
-
-/* Mocked Manager */
-
-Manager::Manager()
-{
-}
-
-void Manager::addKey(const QString &key)
-{
-}
-
-void Manager::setKeyValue(const QString &key, const QVariant &v)
-{
- lastValue = new QVariant(v);
- lastKey = new QString(key);
-}
-
-QVariant Manager::getKeyValue(const QString &key)
-{
- return QVariant();
-}
-
-/* Mocked manager adaptor */
-
-ManagerAdaptor::ManagerAdaptor(Manager *m, QDBusConnection *c)
-{
- lastManager = m;
- lastConnection = c;
-}
-
-/* Mocked Property */
-
-void Property::setManager(Manager *)
-{
-}
-
-QString Property::key()
-{
- return "XXX";
-}
-
-/* Service unit test */
-
-class ServiceUnitTest : public QObject
-{
- Q_OBJECT
-
-private slots:
- void init();
- void cleanup();
- void sanityCheck();
- void defaults();
- void setValue();
- void start();
- void setConnection();
-
-private:
- Service *service;
-
- friend class ContextProvider::Service;
-};
-
-// Before each test
-void ServiceUnitTest::init()
-{
- service = new Service(QDBusConnection::SessionBus, "test.com");
-}
-
-// After each test
-void ServiceUnitTest::cleanup()
-{
- delete service;
-
- lastKey = NULL;
- lastValue = NULL;
- lastManager = NULL;
- lastConnection = NULL;
-}
-
-void ServiceUnitTest::sanityCheck()
-{
- QVERIFY(service->backend != NULL);
-}
-
-void ServiceUnitTest::defaults()
-{
- QVERIFY(service->backend->defaultServiceBackend == NULL);
- service->setAsDefault();
- QVERIFY(service->backend->defaultServiceBackend == service->backend);
-
- Service *otherService = new Service(QDBusConnection::SessionBus, "test2");
- otherService->setAsDefault();
- QVERIFY(service->backend->defaultServiceBackend == otherService->backend);
- delete otherService;
-}
-
-void ServiceUnitTest::setValue()
-{
- service->setValue("Battery.ChargeLevel", 99);
- QCOMPARE(*lastKey, QString("Battery.ChargeLevel"));
- QCOMPARE(lastValue->toInt(), 99);
-}
-
-void ServiceUnitTest::start()
-{
- QVERIFY(lastState == STATE_STARTED);
-
- service->stop();
- QCOMPARE(lastState, STATE_STOPPED);
-
- QCOMPARE(service->start(), true);
- QCOMPARE(lastState, STATE_STARTED);
-
- QCOMPARE(service->start(), false);
- QCOMPARE(lastState, STATE_STARTED);
-
- service->restart();
- QCOMPARE(lastState, STATE_STARTED);
-}
-
-void ServiceUnitTest::setConnection()
-{
- QCOMPARE(service->backend->connection.name(), QString("qt_default_session_bus"));
- QDBusConnection conn = QDBusConnection::connectToBus(QDBusConnection::SessionBus, "test_bus_name");
- service->setConnection(conn);
- QCOMPARE(service->backend->connection.name(), QString("test_bus_name"));
-}
-
-
-#include "serviceunittest.moc"
-QTEST_MAIN(ServiceUnitTest);
diff --git a/libcontextprovider/unit-tests/servicebackend/.gitignore b/libcontextprovider/unit-tests/servicebackend/.gitignore
deleted file mode 100644
index 51ec2c8b..00000000
--- a/libcontextprovider/unit-tests/servicebackend/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-coverage
-loggingfeatures.h
-servicebackend.cpp
-servicebackend.h
-servicebackendunittest
diff --git a/libcontextprovider/unit-tests/servicebackend/Makefile.am b/libcontextprovider/unit-tests/servicebackend/Makefile.am
deleted file mode 100644
index 3ff4d395..00000000
--- a/libcontextprovider/unit-tests/servicebackend/Makefile.am
+++ /dev/null
@@ -1,22 +0,0 @@
-check_PROGRAMS = servicebackendunittest
-
-# test's sources
-servicebackendunittest_SOURCES = servicebackendunittest.cpp manager.h manageradaptor.h
-
-COVERAGE_FILES = servicebackend.cpp
-
-# do the testing, coverage, etc. stuff
-# tests.am is using +=, so we have to set a value here for these four always
-AM_CXXFLAGS = $(QtCore_CFLAGS) $(QtDBus_CFLAGS)
-AM_LDFLAGS = $(QtCore_LIBS) $(QtDBus_LIBS)
-FROM_SOURCE = loggingfeatures.h servicebackend.cpp servicebackend.h
-FROM_SOURCE_DIR = $(srcdir)/../../src
-LDADD =
-include $(top_srcdir)/am/tests.am
-
-nodist_servicebackendunittest_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(servicebackendunittest_SOURCES) $(FROM_SOURCE))
-include $(top_srcdir)/am/qt.am
-
-# when MOCing from .cpp file, you also has to help the dependency tracker
-servicebackendunittest.o: servicebackendunittest.moc
diff --git a/libcontextprovider/unit-tests/servicebackend/manager.h b/libcontextprovider/unit-tests/servicebackend/manager.h
deleted file mode 100644
index 6627f608..00000000
--- a/libcontextprovider/unit-tests/servicebackend/manager.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef MANAGER_H
-#define MANAGER_H
-
-#include <QHash>
-#include <QObject>
-#include <QStringList>
-#include <QVariant>
-
-namespace ContextProvider {
-
-class Subscriber;
-
-class Manager : public QObject
-{
- Q_OBJECT
-
-public:
- Manager();
-
- void addKey(const QString &key);
- void setKeyValue(const QString &key, const QVariant &v);
- QVariant getKeyValue(const QString &key);
-};
-
-} // namespace ContextProvider
-
-#endif
diff --git a/libcontextprovider/unit-tests/servicebackend/manageradaptor.h b/libcontextprovider/unit-tests/servicebackend/manageradaptor.h
deleted file mode 100644
index 9c816919..00000000
--- a/libcontextprovider/unit-tests/servicebackend/manageradaptor.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef MANAGERADAPTOR_H
-#define MANAGERADAPTOR_H
-
-#include <QObject>
-#include <QDBusAbstractAdaptor>
-#include <QDBusMessage>
-#include <QDBusConnection>
-#include <QDBusObjectPath>
-#include "manager.h"
-
-namespace ContextProvider {
-
-class ManagerAdaptor: public QObject
-{
- Q_OBJECT
-
-public:
- ManagerAdaptor (Manager* manager, QDBusConnection *connection);
-};
-
-} // namespace ContextProvider
-
-#endif
diff --git a/libcontextprovider/unit-tests/servicebackend/servicebackendunittest.cpp b/libcontextprovider/unit-tests/servicebackend/servicebackendunittest.cpp
deleted file mode 100644
index c1c05640..00000000
--- a/libcontextprovider/unit-tests/servicebackend/servicebackendunittest.cpp
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <QtTest/QtTest>
-#include <QtCore>
-#include <stdlib.h>
-#include "manager.h"
-#include "servicebackend.h"
-#include "manageradaptor.h"
-
-using namespace ContextProvider;
-
-struct ContextProvider::ServiceBackendPrivate {
- QDBusConnection::BusType busType;
- QString busName;
- Manager *manager;
- QDBusConnection *connection;
- QDBusConnection *implicitConnection;
- int refCount;
- bool registeredService;
-};
-
-QString *lastKey = NULL;
-QVariant *lastValue = NULL;
-Manager *lastManager = NULL;
-QDBusConnection *lastConnection = NULL;
-
-/* Mocked manager adaptor */
-
-ManagerAdaptor::ManagerAdaptor(Manager *m, QDBusConnection *c)
-{
- lastManager = m;
- lastConnection = c;
-}
-
-/* Mocked Manager */
-
-Manager::Manager()
-{
- lastManager = this;
-}
-
-void Manager::addKey(const QString &key)
-{
-}
-
-void Manager::setKeyValue(const QString &key, const QVariant &v)
-{
- lastValue = new QVariant(v);
- lastKey = new QString(key);
-}
-
-QVariant Manager::getKeyValue(const QString &key)
-{
- return QVariant();
-}
-
-class ServiceBackendUnitTest : public QObject
-{
- Q_OBJECT
-
-private slots:
- void init();
- void sanity();
- void defaults();
- void setValue();
- void refCouting();
- void manager();
- void startAndStop();
-
-private:
- ServiceBackend *serviceBackend;
-
- friend class ContextProvider::ServiceBackend;
-};
-
-// Before each test
-void ServiceBackendUnitTest::init()
-{
- serviceBackend = new ServiceBackend(QDBusConnection::sessionBus(), "test.com");
-}
-
-void ServiceBackendUnitTest::manager()
-{
- QVERIFY(lastManager != NULL);
- QVERIFY(serviceBackend->manager() == lastManager);
-}
-
-void ServiceBackendUnitTest::sanity()
-{
- QVERIFY(serviceBackend != NULL);
-}
-
-void ServiceBackendUnitTest::defaults()
-{
- QVERIFY(ServiceBackend::defaultServiceBackend == NULL);
- serviceBackend->setAsDefault();
- QVERIFY(ServiceBackend::defaultServiceBackend == serviceBackend);
-
- // Set another
- ServiceBackend *anotherOne = new ServiceBackend(QDBusConnection::sessionBus(), "another.com");
- anotherOne->setAsDefault();
- QVERIFY(ServiceBackend::defaultServiceBackend == serviceBackend);
-
- delete serviceBackend;
- QVERIFY(ServiceBackend::defaultServiceBackend == NULL);
-}
-
-void ServiceBackendUnitTest::refCouting()
-{
- QCOMPARE(serviceBackend->refCount, 0);
- serviceBackend->ref();
- QCOMPARE(serviceBackend->refCount, 1);
- serviceBackend->unref();
- QCOMPARE(serviceBackend->refCount, 0);
-}
-
-void ServiceBackendUnitTest::startAndStop()
-{
- QVERIFY(serviceBackend->connection.objectRegisteredAt("/org/freedesktop/ContextKit/Manager") == 0);
- serviceBackend->start();
-
- QTest::qWait(100);
- QVERIFY(serviceBackend->connection.objectRegisteredAt("/org/freedesktop/ContextKit/Manager") != 0);
- serviceBackend->stop();
- serviceBackend->start();
- QTest::qWait(100);
- QVERIFY(serviceBackend->connection.objectRegisteredAt("/org/freedesktop/ContextKit/Manager") != 0);
-
- QTest::qWait(100);
- serviceBackend->stop();
- QVERIFY(serviceBackend->connection.objectRegisteredAt("/org/freedesktop/ContextKit/Manager") == 0);
-
- serviceBackend->stop();
- QTest::qWait(100);
- QVERIFY(serviceBackend->connection.objectRegisteredAt("/org/freedesktop/ContextKit/Manager") == 0);
-}
-
-void ServiceBackendUnitTest::setValue()
-{
- serviceBackend->setValue("Battery.ChargeLevel", 99);
- QCOMPARE(*lastKey, QString("Battery.ChargeLevel"));
- QCOMPARE(lastValue->toInt(), 99);
-}
-
-#include "servicebackendunittest.moc"
-QTEST_MAIN(ServiceBackendUnitTest);
diff --git a/libcontextprovider/unit-tests/subscriber/.gitignore b/libcontextprovider/unit-tests/subscriber/.gitignore
deleted file mode 100644
index 8e68c3c2..00000000
--- a/libcontextprovider/unit-tests/subscriber/.gitignore
+++ /dev/null
@@ -1,7 +0,0 @@
-logging.cpp
-logging.h
-loggingfeatures.h
-subscriber.cpp
-subscriber.h
-subscriberunittest
-sconnect.h
diff --git a/libcontextprovider/unit-tests/subscriber/Makefile.am b/libcontextprovider/unit-tests/subscriber/Makefile.am
deleted file mode 100644
index 30d7cf9c..00000000
--- a/libcontextprovider/unit-tests/subscriber/Makefile.am
+++ /dev/null
@@ -1,22 +0,0 @@
-check_PROGRAMS = subscriberunittest
-
-# test's sources
-subscriberunittest_SOURCES = subscriberunittest.cpp manager.h queuedinvoker.h
-
-COVERAGE_FILES = subscriber.cpp
-
-# do the testing, coverage, etc. stuff
-# tests.am is using +=, so we have to set a value here for these four always
-AM_CXXFLAGS = $(QtCore_CFLAGS) $(QtDBus_CFLAGS)
-AM_LDFLAGS = $(QtCore_LIBS) $(QtDBus_LIBS)
-FROM_SOURCE = subscriber.h subscriber.cpp loggingfeatures.h # copy these files from the real source
-FROM_SOURCE_DIR = $(srcdir)/../../src
-LDADD =
-include $(top_srcdir)/am/tests.am
-
-nodist_subscriberunittest_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(subscriberunittest_SOURCES) $(FROM_SOURCE))
-include $(top_srcdir)/am/qt.am
-
-# when MOCing from .cpp file, you also has to help the dependency tracker
-subscriberunittest.o: subscriberunittest.moc
diff --git a/libcontextprovider/unit-tests/subscriber/manager.h b/libcontextprovider/unit-tests/subscriber/manager.h
deleted file mode 100644
index 6479e491..00000000
--- a/libcontextprovider/unit-tests/subscriber/manager.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef MANAGER_H
-#define MANAGER_H
-
-#include <QDBusObjectPath>
-#include <QDBusMessage>
-#include <QHash>
-#include <QObject>
-#include <QDBusConnection>
-#include <QStringList>
-
-namespace ContextProvider {
-
-class Subscriber;
-
-class Manager : public QObject
-{
- Q_OBJECT
-
-public:
- bool keyIsValid(const QString &key) const;
- void increaseSubscriptionCount(const QString &key);
- void decreaseSubscriptionCount(const QString &key);
- QVariant getKeyValue(const QString &key) const;
- void setKeyValue(const QString &key, const QVariant &v);
-
- QStringList increaseCalls;
- QStringList decreaseCalls;
-
- void emitKeyValueChanged(const QString &key, const QVariant& newValue);
-
-signals:
- void keyValueChanged(const QString &key, const QVariant& newValue);
-};
-
-} // namespace ContextProvider
-
-#endif
diff --git a/libcontextprovider/unit-tests/subscriber/queuedinvoker.h b/libcontextprovider/unit-tests/subscriber/queuedinvoker.h
deleted file mode 100644
index 4a2d3508..00000000
--- a/libcontextprovider/unit-tests/subscriber/queuedinvoker.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef QUEUEDINVOKER_H
-#define QUEUEDINVOKER_H
-
-// This is a mock implementation
-
-#include <QObject>
-#include <QString>
-#include <QStringList>
-
-namespace ContextProvider {
-
-class QueuedInvoker : public QObject
-{
- Q_OBJECT
-
-public:
- QueuedInvoker();
- void callAllMethodsInQueue();
-
-protected:
- void queueOnce(const char *method);
-
-private:
- QStringList methodsToCall;
-};
-
-} // namespace ContextProvider
-
-#endif
diff --git a/libcontextprovider/unit-tests/subscriber/subscriberunittest.cpp b/libcontextprovider/unit-tests/subscriber/subscriberunittest.cpp
deleted file mode 100644
index cc92ec97..00000000
--- a/libcontextprovider/unit-tests/subscriber/subscriberunittest.cpp
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <QtTest/QtTest>
-#include <QtCore>
-#include <stdlib.h>
-#include "manager.h"
-#include "subscriber.h"
-#include "queuedinvoker.h"
-#include "logging.h"
-
-/* Queued invoker mock implementation */
-
-namespace ContextProvider {
-
-QueuedInvoker::QueuedInvoker()
-{
-}
-
-void QueuedInvoker::queueOnce(const char *method)
-{
- contextDebug() << "queueonce" << QString(method);
- if (!methodsToCall.contains(QString(method))) {
- methodsToCall.push_back(method);
- }
-}
-
-void QueuedInvoker::callAllMethodsInQueue()
-{
- while (!methodsToCall.empty()) {
- QString method = methodsToCall.front();
- methodsToCall.pop_front();
- if (!QMetaObject::invokeMethod(this, method.toStdString().c_str(), Qt::DirectConnection)) {
- qFatal(" *****************\n"
- "Erroneous usage of queueOnce\n"
- " *****************\n");
- }
- }
-}
-
-/* Manager mock implementation */
-
-bool Manager::keyIsValid(const QString &key) const
-{
- if (key == "Battery.OnBattery" || key == "Battery.Voltage" || key == "Battery.OverCharged")
- return true;
- else
- return false;
-}
-
-void Manager::increaseSubscriptionCount(const QString &key)
-{
- increaseCalls.append(key);
-}
-
-void Manager::decreaseSubscriptionCount(const QString &key)
-{
- decreaseCalls.append(key);
-}
-
-QVariant Manager::getKeyValue(const QString &key) const
-{
- if (key == "Battery.OverCharged")
- return QVariant(true);
- else
- return QVariant();
-}
-
-void Manager::emitKeyValueChanged(const QString &key, const QVariant& newValue)
-{
- emit keyValueChanged(key, newValue);
-}
-
-} // namespace ContextProvider
-
-/* SubscriberUnitTest */
-
-using namespace ContextProvider;
-
-class SubscriberUnitTest : public QObject
-{
- Q_OBJECT
-
-private slots:
- void init();
- void cleanup();
- void path();
- void subscribeAndUnsubscribe();
- void subscribeToInvalid();
- void subscribeTwice();
- void unsubscribeFromInvalid();
- void unsubscribeTwice();
- void keyValueChangeUnsubscribed();
- void keyValueChangeSubscribed();
-
-private:
- Subscriber *subscriber;
- Manager *manager;
-};
-
-// Before each test
-void SubscriberUnitTest::init()
-{
- manager = new Manager();
- subscriber = new Subscriber("/some/path", manager);
-}
-
-// After each test
-void SubscriberUnitTest::cleanup()
-{
- delete subscriber;
- delete manager;
-}
-
-void SubscriberUnitTest::path()
-{
- QCOMPARE(subscriber->dbusPath(), QString("/some/path"));
-}
-
-void SubscriberUnitTest::subscribeAndUnsubscribe()
-{
- QStringList keys1;
- keys1.append("Battery.OnBattery");
- keys1.append("Battery.Voltage");
- QStringList undetermined;
-
- QMap<QString, QVariant> map = subscriber->subscribe(keys1, undetermined);
- QCOMPARE(undetermined.size(), 2);
- QVERIFY(subscriber->isSubscribedToKey("Battery.OnBattery"));
- QVERIFY(subscriber->isSubscribedToKey("Battery.Voltage"));
-
- QCOMPARE(manager->increaseCalls.count("Battery.OnBattery"), 1);
- QCOMPARE(manager->increaseCalls.count("Battery.Voltage"), 1);
- QCOMPARE(manager->decreaseCalls.count("Battery.OnBattery"), 0);
- QCOMPARE(manager->decreaseCalls.count("Battery.Voltage"), 0);
-
- QStringList keys2;
- keys2.append("Battery.Voltage");
- subscriber->unsubscribe(keys2);
- QVERIFY(subscriber->isSubscribedToKey("Battery.OnBattery"));
- QVERIFY(subscriber->isSubscribedToKey("Battery.Voltage") == false);
-
- QCOMPARE(manager->decreaseCalls.count("Battery.OnBattery"), 0);
- QCOMPARE(manager->decreaseCalls.count("Battery.Voltage"), 1);
- QCOMPARE(manager->increaseCalls.count("Battery.OnBattery"), 1);
- QCOMPARE(manager->increaseCalls.count("Battery.Voltage"), 1);
-}
-
-void SubscriberUnitTest::subscribeToInvalid()
-{
- QStringList keys1;
- keys1.append("Battery.OnBattery");
- keys1.append("Battery.Voltage");
- keys1.append("Battery.NonExistant");
- QStringList undetermined;
-
- QMap<QString, QVariant> map = subscriber->subscribe(keys1, undetermined);
- QCOMPARE(undetermined.size(), 2);
- QVERIFY(subscriber->isSubscribedToKey("Battery.OnBattery"));
- QVERIFY(subscriber->isSubscribedToKey("Battery.Voltage"));
- QVERIFY(subscriber->isSubscribedToKey("Battery.NonExistant") == false);
-
- QCOMPARE(manager->increaseCalls.count("Battery.OnBattery"), 1);
- QCOMPARE(manager->increaseCalls.count("Battery.Voltage"), 1);
- QCOMPARE(manager->increaseCalls.count("Battery.NonExistant"), 0);
- QCOMPARE(manager->decreaseCalls.count("Battery.OnBattery"), 0);
- QCOMPARE(manager->decreaseCalls.count("Battery.Voltage"), 0);
- QCOMPARE(manager->decreaseCalls.count("Battery.NonExistant"), 0);
-}
-
-void SubscriberUnitTest::subscribeTwice()
-{
- QStringList keys1;
- keys1.append("Battery.OnBattery");
- keys1.append("Battery.OnBattery");
- QStringList undetermined;
-
- QMap<QString, QVariant> map1 = subscriber->subscribe(keys1, undetermined);
- QCOMPARE(undetermined.size(), 1);
- QVERIFY(subscriber->isSubscribedToKey("Battery.OnBattery"));
-
- QCOMPARE(manager->increaseCalls.count("Battery.OnBattery"), 1);
- QCOMPARE(manager->decreaseCalls.count("Battery.OnBattery"), 0);
-
- // Try again...
- QStringList keys2;
- keys2.append("Battery.OnBattery");
-
- QMap<QString, QVariant> map2 = subscriber->subscribe(keys2, undetermined);
- QCOMPARE(undetermined.size(), 1);
- QVERIFY(subscriber->isSubscribedToKey("Battery.OnBattery"));
-
- QCOMPARE(manager->increaseCalls.count("Battery.OnBattery"), 1);
- QCOMPARE(manager->decreaseCalls.count("Battery.OnBattery"), 0);
-}
-
-void SubscriberUnitTest::unsubscribeFromInvalid()
-{
- QStringList keys1;
- keys1.append("Battery.OnBattery");
- QStringList undetermined;
-
- subscriber->subscribe(keys1, undetermined);
- QVERIFY(subscriber->isSubscribedToKey("Battery.OnBattery"));
-
- QCOMPARE(manager->increaseCalls.count("Battery.OnBattery"), 1);
- QCOMPARE(manager->decreaseCalls.count("Battery.OnBattery"), 0);
-
- QStringList keys2;
- keys2.append("Battery.Invalid");
- subscriber->unsubscribe(keys2);
- QVERIFY(subscriber->isSubscribedToKey("Battery.OnBattery") == true);
- QVERIFY(subscriber->isSubscribedToKey("Battery.Invalid") == false);
-
- QCOMPARE(manager->increaseCalls.count("Battery.OnBattery"), 1);
- QCOMPARE(manager->decreaseCalls.count("Battery.OnBattery"), 0);
- QCOMPARE(manager->increaseCalls.count("Battery.Invalid"), 0);
- QCOMPARE(manager->decreaseCalls.count("Battery.Invalid"), 0);
-}
-
-void SubscriberUnitTest::unsubscribeTwice()
-{
- QStringList keys1;
- keys1.append("Battery.OnBattery");
- QStringList undetermined;
-
- subscriber->subscribe(keys1, undetermined);
- QVERIFY(subscriber->isSubscribedToKey("Battery.OnBattery"));
-
- QCOMPARE(manager->increaseCalls.count("Battery.OnBattery"), 1);
- QCOMPARE(manager->decreaseCalls.count("Battery.OnBattery"), 0);
-
- subscriber->unsubscribe(keys1);
- QVERIFY(subscriber->isSubscribedToKey("Battery.OnBattery") == false);
-
- QCOMPARE(manager->increaseCalls.count("Battery.OnBattery"), 1);
- QCOMPARE(manager->decreaseCalls.count("Battery.OnBattery"), 1);
-
- subscriber->unsubscribe(keys1);
- QVERIFY(subscriber->isSubscribedToKey("Battery.OnBattery") == false);
-
- QCOMPARE(manager->increaseCalls.count("Battery.OnBattery"), 1);
- QCOMPARE(manager->decreaseCalls.count("Battery.OnBattery"), 1);
-}
-
-void SubscriberUnitTest::keyValueChangeUnsubscribed()
-{
- QSignalSpy spy(subscriber, SIGNAL(changed(QMap<QString, QVariant>, QStringList)));
- manager->emitKeyValueChanged("Battery.Something", QVariant(55));
- subscriber->callAllMethodsInQueue();
- QCOMPARE(spy.count(), 0);
-}
-
-void SubscriberUnitTest::keyValueChangeSubscribed()
-{
- QStringList keys;
- keys.append("Battery.OnBattery");
- keys.append("Battery.OverCharged");
- keys.append("Battery.Voltage");
- QStringList undetermined;
- subscriber->subscribe(keys, undetermined);
-
- QSignalSpy spy(subscriber, SIGNAL(changed(QMap<QString, QVariant>, QStringList)));
- manager->emitKeyValueChanged("Battery.OverCharged", QVariant(true));
- manager->emitKeyValueChanged("Battery.OnBattery", QVariant());
- subscriber->callAllMethodsInQueue();
- QCOMPARE(spy.count(), 1);
-
- QList<QVariant> args = spy.takeFirst();
-
- QMap<QString, QVariant> map = args.at(0).toMap();
- QCOMPARE(map.size(), 1);
- QCOMPARE(map.value("Battery.OverCharged"), QVariant(true));
-
- QCOMPARE(args.at(1).toList().count(), 1);
- QCOMPARE(args.at(1).toList().at(0).toString(), QString("Battery.OnBattery"));
-}
-
-#include "subscriberunittest.moc"
-QTEST_MAIN(SubscriberUnitTest);
diff --git a/libcontextsubscriber/.gitignore b/libcontextsubscriber/.gitignore
deleted file mode 100644
index 616c4958..00000000
--- a/libcontextsubscriber/.gitignore
+++ /dev/null
@@ -1,51 +0,0 @@
-libmocs.a
-libmock.a
-*.o
-*.la
-*.a
-moc_*.cpp
-mock_*.cpp
-mocmock_*.cpp
-mocs.cpp
-
-Makefile
-
-# Auto-generated
-contextsubscriber-1.0.pc
-
-# Ignore resource forks
-._*
-
-# Ignore TextMate projects
-*.tmproj
-
-# Tests
-/unit-tests/contextregistryinfo-xml-static/contextregistryinfounittest-xml-static
-/unit-tests/contextregistryinfo-cdb-static/contextregistryinfounittest-cdb-static
-/unit-tests/contextregistryinfo-xml-dynamic/contextregistryinfounittest-xml-dynamic
-/unit-tests/contextregistryinfo-cdb-dynamic/contextregistryinfounittest-cdb-dynamic
-/unit-tests/contextpropertyinfo-xml-static/contextpropertyinfounittest-xml-static
-/unit-tests/contextpropertyinfo-cdb-static/contextpropertyinfounittest-cdb-static
-/unit-tests/contextpropertyinfo-xml-dynamic/contextpropertyinfounittest-xml-dynamic
-/unit-tests/contextpropertyinfo-cdb-dynamic/contextpropertyinfounittest-cdb-dynamic
-/unit-tests/cdb/cdbunittest
-/unit-tests/provider/provider-unit-tests
-/unit-tests/propertyhandle/propertyhandle-unit-tests
-/unit-tests/handlesignalrouter/handlesignalrouter-unit-tests
-/unit-tests/contextregistryinfo-xml-dynamic/providers.context
-/unit-tests/*/*.moc
-coverage/
-
-/customer-tests/testplugins/contextsubscribertime1.so
-/customer-tests/testplugins/contextsubscribertime2.so
-/customer-tests/coverage-build/Makefile.coverage
-
-# Other binaries
-/cli/context-listen
-/cls/context-ls
-/update-tool/update-tool
-/update-contextkit-providers/update-contextkit-providers
-
-# Docs
-doc/html
-doc/doxygen.log
diff --git a/libcontextsubscriber/Makefile.am b/libcontextsubscriber/Makefile.am
deleted file mode 100644
index 35609d42..00000000
--- a/libcontextsubscriber/Makefile.am
+++ /dev/null
@@ -1,18 +0,0 @@
-SUBDIRS = src unit-tests customer-tests multithreading-tests cli cls update-contextkit-providers doc man
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = contextsubscriber-1.0.pc
-
-check-sum:
- $(MAKE) -C unit-tests check-sum
-
-check-customer:
- $(MAKE) -C customer-tests check-customer
-
-coverage: covoptioncheck
- $(MAKE) -C unit-tests coverage
- $(MAKE) -C customer-tests coverage
-
-.PHONY: coverage check-sum
-
-include $(top_srcdir)/am/covoptioncheck.am
diff --git a/libcontextsubscriber/cli/Makefile.am b/libcontextsubscriber/cli/Makefile.am
deleted file mode 100644
index 43fe4c95..00000000
--- a/libcontextsubscriber/cli/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-bin_PROGRAMS = context-listen
-context_listen_SOURCES = context-listen.cpp \
- propertylistener.h propertylistener.cpp commandwatcher.h \
- commandwatcher.cpp
-
-AM_CXXFLAGS = $(QtCore_CFLAGS) $(QtDBus_CFLAGS) \
- '-DCONTEXT_LOG_MODULE_NAME="context-listen"'
-LIBS += $(QtCore_LIBS)
-
-# library dependency hack for seamless make in cli/
-AM_CXXFLAGS += -I$(srcdir)/../src \
- -I$(top_srcdir)/common
-
-context_listen_LDADD = ../src/libcontextsubscriber.la $(top_builddir)/common/libcommon.la
-
-../src/libcontextsubscriber.la:
- $(MAKE) -C ../src libcontextsubscriber.la
-
-$(top_builddir)/common/libcommon.la:
- $(MAKE) -C $(top_builddir)/common libcommon.la
-
-.PHONY: ../src/libcontextsubscriber.la $(top_builddir)/common/libcommon.la
-
-# moccing
-nodist_context_listen_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(context_listen_SOURCES))
-include $(top_srcdir)/am/qt.am
diff --git a/libcontextsubscriber/cli/commandwatcher.cpp b/libcontextsubscriber/cli/commandwatcher.cpp
deleted file mode 100644
index aa761c9d..00000000
--- a/libcontextsubscriber/cli/commandwatcher.cpp
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Copyright (C) 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "commandwatcher.h"
-#include "sconnect.h"
-#include "contextproperty.h"
-#include "propertylistener.h"
-#include <QTextStream>
-#include <QFile>
-#include <QSocketNotifier>
-#include <QStringList>
-#include <QCoreApplication>
-#include "contextpropertyinfo.h"
-#include <QDebug>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <QMap>
-
-CommandWatcher::CommandWatcher(int commandfd, QMap<QString, ContextProperty*> *properties, QObject *parent) :
- QObject(parent), commandfd(commandfd), properties(properties)
-{
- commandNotifier = new QSocketNotifier(commandfd, QSocketNotifier::Read, this);
- sconnect(commandNotifier, SIGNAL(activated(int)), this, SLOT(onActivated()));
- help();
-}
-
-void CommandWatcher::onActivated()
-{
- // read all available input to commandBuffer
- static QByteArray commandBuffer = "";
- static char buf[1024];
- int readSize;
- fcntl(commandfd, F_SETFL, O_NONBLOCK);
- while ((readSize = read(commandfd, &buf, 1024)) > 0)
- commandBuffer += QByteArray(buf, readSize);
-
- // handle all available whole input lines as commands
- int nextSeparator;
- while ((nextSeparator = commandBuffer.indexOf('\n')) != -1) {
- // split lines to separate commands by semicolons
- QStringList commands = QString::fromUtf8(commandBuffer.constData()).left(nextSeparator).split(";");
- foreach (QString command, commands)
- interpret(command.trimmed());
- commandBuffer.remove(0, nextSeparator + 1);
- }
-
- if (readSize == 0) // EOF
- QCoreApplication::exit(0);
-}
-
-void CommandWatcher::help()
-{
- qDebug() << "Available commands:";
- qDebug() << " new KEY... - create context properties";
- qDebug() << " delete KEY... - delete context properties";
- qDebug() << " subscribe KEY... - subscribe to keys";
- qDebug() << " waitforsubscription KEY... - subscribe to keys";
- qDebug() << " unsubscribe KEY... - unsubscribe from keys";
- qDebug() << " value KEY [DEF] - get value for a key";
- qDebug() << " key KEY - get the key for a key (rather useless)";
- qDebug() << " ikey KEY - get the info()->key for a key (rather useless)";
- qDebug() << " man KEY - get the info()->doc for a key";
- qDebug() << " type KEY - get the info()->type for a key";
- qDebug() << " plugin KEY - get the info()->plugin for a key";
- qDebug() << " constructionstring KEY - get the info()->constructionstring for a key";
- qDebug() << " providers KEY - get the info()->providers for a key";
- qDebug() << " flush - write FLUSHED to stderr and stdout";
- qDebug() << "Any prefix of a command can be used as an abbreviation";
-}
-
-void CommandWatcher::interpret(const QString& command) const
-{
- QTextStream out(stdout);
- QTextStream err(stderr);
- if (command == "") {
- help();
- } else {
- QStringList args = command.split(" ");
- QString commandName = args[0];
- args.pop_front();
-
- if (args.size() == 0 && !QString("flush").startsWith(commandName)) {
- help();
- return;
- }
-
- if (QString("new").startsWith(commandName)) {
- foreach (QString key, args)
- if (properties->contains(key))
- qDebug() << "key already exists: " << key;
- else {
- properties->insert(key, new ContextProperty(key, QCoreApplication::instance()));
- new PropertyListener(properties->value(key));
- }
- } else if (QString("delete").startsWith(commandName)) {
- foreach (QString key, args)
- if (properties->contains(key))
- delete properties->take(key);
- else
- qDebug() << "no such key:" << key;
- } else if (QString("subscribe").startsWith(commandName)) {
- foreach (QString key, args)
- if (properties->contains(key))
- properties->value(key)->subscribe();
- else
- qDebug() << "no such key:" << key;
- } else if (QString("waitforsubscription").startsWith(commandName)) {
- foreach (QString key, args)
- if (properties->contains(key)) {
- properties->value(key)->waitForSubscription();
- out << "wait finished for " << key << endl;
- } else
- qDebug() << "no such key:" << key;
- } else if (QString("unsubscribe").startsWith(commandName)) {
- foreach (QString key, args)
- if (properties->contains(key))
- properties->value(key)->unsubscribe();
- else
- qDebug() << "no such key:" << key;
- } else if (QString("value").startsWith(commandName)) {
- QString key = args[0];
- if (properties->contains(key)) {
- QVariant value;
- if (args.size() > 1) {
- value = properties->value(key)->value(args[1]);
- } else {
- value = properties->value(key)->value();
- }
- if (value.isNull())
- out << "value is Unknown" << endl;
- else
- out << "value: " << value.typeName() << ":" << value.toString() << endl;
- } else
- qDebug() << "no such key:" << key;
- } else if (QString("key").startsWith(commandName)) {
- QString key = args[0];
- if (properties->contains(key))
- out << "key: " << properties->value(key)->key() << endl;
- else
- qDebug() << "no such key:" << key;
- } else if (QString("ikey").startsWith(commandName)) {
- QString key = args[0];
- if (properties->contains(key))
- out << "ikey: " << properties->value(key)->info()->key() << endl;
- else
- qDebug() << "no such key:" << key;
- } else if (QString("man").startsWith(commandName)) {
- QString key = args[0];
- if (properties->contains(key))
- out << "man: " << properties->value(key)->info()->doc() << endl;
- else
- qDebug() << "no such key:" << key;
- } else if (QString("type").startsWith(commandName)) {
- QString key = args[0];
- if (properties->contains(key))
- out << "type: " << properties->value(key)->info()->type() << endl;
- else
- qDebug() << "no such key:" << key;
- } else if (QString("plugin").startsWith(commandName)) {
- QString key = args[0];
- if (properties->contains(key)) {
- QList<ContextProviderInfo> providers = properties->value(key)->info()->providers();
- if (providers.size() > 0)
- out << "plugin: " << providers.at(0).plugin << endl;
- else
- out << "no plugin for key:" << key << endl;
- } else
- qDebug() << "no such key:" << key;
- } else if (QString("constructionstring").startsWith(commandName)) {
- QString key = args[0];
- if (properties->contains(key)) {
- QList<ContextProviderInfo> providers = properties->value(key)->info()->providers();
- if (providers.size() > 0)
- out << "constructionstring: " << providers.at(0).constructionString << endl;
- else
- out << "no constructionString for key:" << key << endl;
- } else
- qDebug() << "no such key:" << key;
- } else if (QString("providers").startsWith(commandName)) {
- QString key = args[0];
- if (properties->contains(key)) {
- out << "providers: ";
- QList<ContextProviderInfo> providers = properties->value(key)->info()->providers();
-
- foreach(ContextProviderInfo info, providers)
- out << info.constructionString << "@" << info.plugin << " ";
-
- out << endl;
- } else
- qDebug() << "no such key:" << key;
- } else if (QString("flush").startsWith(commandName)) {
- out << "FLUSHED" << endl;
- out.flush();
- err << "FLUSHED" << endl;
- err.flush();
- } else
- help();
- }
-}
diff --git a/libcontextsubscriber/cli/commandwatcher.h b/libcontextsubscriber/cli/commandwatcher.h
deleted file mode 100644
index 6d283ea1..00000000
--- a/libcontextsubscriber/cli/commandwatcher.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef COMMANDWATCHER_H
-#define COMMANDWATCHER_H
-
-#include <QObject>
-class QFile;
-class QTextStream;
-class QSocketNotifier;
-class ContextProperty;
-class QString;
-template <typename K, typename V> class QMap;
-
-class CommandWatcher : public QObject
-{
- Q_OBJECT
-public:
- CommandWatcher(int commandfd, QMap<QString, ContextProperty*> *properties, QObject *parent = 0);
-private:
- int commandfd;
- QSocketNotifier *commandNotifier;
- void interpret(const QString& command) const;
- QMap<QString, ContextProperty*> *properties;
- static void help();
-
-private slots:
- void onActivated();
-};
-#endif
diff --git a/libcontextsubscriber/cli/context-listen.cpp b/libcontextsubscriber/cli/context-listen.cpp
deleted file mode 100644
index 978fe9ac..00000000
--- a/libcontextsubscriber/cli/context-listen.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "contextproperty.h"
-#include "propertylistener.h"
-#include "commandwatcher.h"
-#include <QCoreApplication>
-#include <QString>
-#include <QStringList>
-#include <QMap>
-#include <QDebug>
-#include <stdlib.h>
-
-int main(int argc, char **argv)
-{
- if (getenv("CONTEXT_CLI_DISABLE_TYPE_CHECK"))
- ContextProperty::setTypeCheck(false);
- else
- ContextProperty::setTypeCheck(true);
-
- if (getenv("CONTEXT_CLI_IGNORE_COMMANDER"))
- ContextProperty::ignoreCommander();
-
- QCoreApplication app(argc, argv);
-
- QStringList args = app.arguments();
- if (args.count() <= 1)
- qWarning() << "Started without properties, if you want properties at startup, pass them as arguments";
-
- QMap<QString, ContextProperty*> properties;
-
- args.pop_front();
- foreach (QString key, args) {
- if (properties[key] == 0) {
- properties[key] = new ContextProperty(key, QCoreApplication::instance());
- new PropertyListener(properties[key]);
- }
- }
-
- new CommandWatcher(STDIN_FILENO, &properties, QCoreApplication::instance());
-
- return app.exec();
-}
diff --git a/libcontextsubscriber/cli/propertylistener.cpp b/libcontextsubscriber/cli/propertylistener.cpp
deleted file mode 100644
index 3d6a1eb5..00000000
--- a/libcontextsubscriber/cli/propertylistener.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "propertylistener.h"
-#include "contextproperty.h"
-#include "sconnect.h"
-#include <QDebug>
-#include <QVariant>
-
-PropertyListener::PropertyListener(ContextProperty *prop) :
- QObject(prop), prop(prop)
-{
- sconnect(prop, SIGNAL(valueChanged()), this, SLOT(onValueChanged()));
- qDebug() << prop->key() << " subscribtion started";
-}
-
-void PropertyListener::onValueChanged()
-{
- QTextStream out(stdout);
- out << prop->key();
- if (prop->value().isNull()) {
- out << " is Unknown";
- } else {
- out << " = " << prop->value().typeName() << ":" << prop->value().toString();
- }
- out << endl;
-}
diff --git a/libcontextsubscriber/cli/propertylistener.h b/libcontextsubscriber/cli/propertylistener.h
deleted file mode 100644
index 8f2fd856..00000000
--- a/libcontextsubscriber/cli/propertylistener.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef PROPERTYLISTENER_H
-#define PROPERTYLISTENER_H
-
-#include <QObject>
-
-class ContextProperty;
-
-class PropertyListener : public QObject
-{
- Q_OBJECT
-public:
- PropertyListener(ContextProperty *prop);
-private slots:
- void onValueChanged();
-private:
- ContextProperty *prop;
-};
-
-#endif
diff --git a/libcontextsubscriber/cli/wait-test/main.cpp b/libcontextsubscriber/cli/wait-test/main.cpp
deleted file mode 100644
index 9f4e748f..00000000
--- a/libcontextsubscriber/cli/wait-test/main.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-#include <QTimer>
-#include <QDebug>
-#include <QWaitCondition>
-#include <QMutex>
-#include <QCoreApplication>
-
-int i=0;
-
-class MyTimer:public QTimer
-{
- Q_OBJECT;
-public:
- MyTimer()
- {
- connect(this, SIGNAL(timeout()),
- this, SLOT(timedout()));
- start(10000);
- setSingleShot(true);
- }
-public slots:
- void timedout()
- {
- qDebug() << "timed out, wake up everyone";
- i=1;
- }
-};
-
-class MyTimerWaiter:public QTimer
-{
- Q_OBJECT;
-public:
- MyTimerWaiter()
- {
- connect(this, SIGNAL(timeout()),
- this, SLOT(timedout()));
- start(0);
- }
-public slots:
- void timedout()
- {
- qDebug() << "timed out, so starting to wait";
- while(i == 0) {
- qDebug() << "I'm entering processEvents";
- QCoreApplication::processEvents(QEventLoop::WaitForMoreEvents);
- qDebug() << "I've been exited from processEvents";
- usleep(1000000);
- }
-
- qDebug() << "I've been awakened";
- exit(1);
- }
-};
-
-int main(int argc, char **argv)
-{
- QCoreApplication app(argc, argv);
-
-// MyTimerWaiter waiter;
- MyTimer timer;
-
- while(i == 0) {
- qDebug() << "I'm entering processEvents";
- QCoreApplication::processEvents(QEventLoop::WaitForMoreEvents);
- qDebug() << "I've been exited from processEvents";
- }
-
- qDebug() << "NOT starting the main loop";
- return 0;
-
- return app.exec();
-}
-
-#include "main.moc"
diff --git a/libcontextsubscriber/cli/wait-test/wait-test.pro b/libcontextsubscriber/cli/wait-test/wait-test.pro
deleted file mode 100644
index 6555dbef..00000000
--- a/libcontextsubscriber/cli/wait-test/wait-test.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-######################################################################
-# Automatically generated by qmake (2.01a) Tue May 12 17:17:46 2009
-######################################################################
-
-TEMPLATE = app
-TARGET =
-DEPENDPATH += .
-INCLUDEPATH += .
-
-# Input
-SOURCES += main.cpp
diff --git a/libcontextsubscriber/cls/Makefile.am b/libcontextsubscriber/cls/Makefile.am
deleted file mode 100644
index 82fc46ce..00000000
--- a/libcontextsubscriber/cls/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-bin_PROGRAMS = context-ls
-context_ls_SOURCES = context-ls.cpp
-
-AM_CXXFLAGS = $(QtCore_CFLAGS) $(QtDBus_CFLAGS) \
- '-DCONTEXT_LOG_MODULE_NAME="context-ls"'
-LIBS += $(QtCore_LIBS)
-
-# library dependency hack for seamless make in cls/
-AM_CXXFLAGS += -I$(srcdir)/../src \
- -I$(top_srcdir)/common
-
-context_ls_LDADD = ../src/libcontextsubscriber.la $(top_builddir)/common/libcommon.la
-
-../src/libcontextsubscriber.la:
- $(MAKE) -C ../src libcontextsubscriber.la
-
-$(top_builddir)/common/libcommon.la:
- $(MAKE) -C $(top_builddir)/common libcommon.la
-
-.PHONY: ../src/libcontextsubscriber.la $(top_builddir)/common/libcommon.la
-
-# moccing
-# nodist_context_ls_SOURCES = mocs.cpp
-# QT_TOMOC = $(filter %.h, $(context_ls_SOURCES))
-# include $(top_srcdir)/am/qt.am
diff --git a/libcontextsubscriber/cls/context-ls.cpp b/libcontextsubscriber/cls/context-ls.cpp
deleted file mode 100644
index 58026b99..00000000
--- a/libcontextsubscriber/cls/context-ls.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-#include <contextregistryinfo.h>
-#include <contextpropertyinfo.h>
-#include <QCoreApplication>
-#include <QString>
-#include <QStringList>
-#include <QMap>
-#include <QDebug>
-#include <stdlib.h>
-
-int main(int argc, char **argv)
-{
- int retValue = 1;
- {
- QCoreApplication app(argc, argv);
-
- QStringList args = app.arguments();
- QString backendName = "";
- bool doc = false;
- bool provided = false;
- bool longListing = false;
- bool hasFilter = false;
- QString filter = "*";
-
- args.pop_front();
- foreach (QString arg, args) {
- if (arg == "--xml" || arg == "-x") {
- backendName = "xml";
- } else if (arg == "--cdb" || arg == "-c") {
- backendName = "cdb";
- } else if (arg == "--provided" || arg == "-p") {
- provided = true;
- } else if (arg == "--long" || arg == "-l") {
- longListing = true;
- } else if (arg == "--doc" || arg == "-d") {
- doc = true;
- } else {
- if (hasFilter) {
- qWarning("WARNING: Only the first filter string is considered.");
- } else {
- hasFilter = true;
- filter = arg;
- }
- }
- }
-
- ContextRegistryInfo *regInfo = ContextRegistryInfo::instance(backendName);
- QStringList keys = regInfo->listKeys();
-
- QRegExp rx(filter, Qt::CaseSensitive, QRegExp::Wildcard);
- QTextStream out(stdout);
- foreach (QString key, keys) {
- if (!rx.exactMatch(key))
- continue;
- ContextPropertyInfo info(key);
- if (provided && !info.provided())
- continue;
- if (longListing) {
- for (int i = 0; i < info.providers().size(); i++ )
- out << key << "\t" << info.type() << "\t" << info.providers()[i].plugin << "\t"
- << info.providers()[i].constructionString << "\n";
- } else
- out << key << "\n";
- if (doc) {
- out << "Documentation: " << info.doc() << "\n";
- }
- retValue = 0;
- }
- out.flush();
-
- }
- return retValue;
-}
diff --git a/libcontextsubscriber/contextsubscriber-1.0.pc.in b/libcontextsubscriber/contextsubscriber-1.0.pc.in
deleted file mode 100644
index 7cf40a48..00000000
--- a/libcontextsubscriber/contextsubscriber-1.0.pc.in
+++ /dev/null
@@ -1,13 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: contextsubscriber
-Description: ContextKit Context Subscriber library
-Version: @VERSION@
-Requires: QtCore
-Requires.private: QtDBus QtXml
-Libs: -L${libdir} -lcontextsubscriber
-Libs.private: @CDB_LIBS@
-Cflags: -I${includedir}/contextsubscriber
diff --git a/libcontextsubscriber/customer-tests/Makefile.am b/libcontextsubscriber/customer-tests/Makefile.am
deleted file mode 100644
index dd7b65d5..00000000
--- a/libcontextsubscriber/customer-tests/Makefile.am
+++ /dev/null
@@ -1,23 +0,0 @@
-SUBDIRS = update-contextkit-providers testplugins forward-compatible
-
-libcontextsubscribertestsdir = $(datadir)/libcontextsubscriber-tests
-libcontextsubscribertests_DATA = tests.xml
-
-coverage: covoptioncheck
- COVERAGE=1 ./runTests.sh
-.PHONY: coverage
-
-check-customer:
- ./runTests.sh
-
-clean-local:
- -$(MAKE) -C coverage-build clean
- rm -rf coverage
-
-CLEANFILES = *.pyc
-
-EXTRA_DIST = asynchronicity commander subscription runTests.sh \
- tests.xml common registry pluginchanging env.sh \
- coverage-build forward-compatible
-
-include $(top_srcdir)/am/covoptioncheck.am
diff --git a/libcontextsubscriber/customer-tests/asynchronicity/asynchronicity.py b/libcontextsubscriber/customer-tests/asynchronicity/asynchronicity.py
deleted file mode 100755
index e75f3276..00000000
--- a/libcontextsubscriber/customer-tests/asynchronicity/asynchronicity.py
+++ /dev/null
@@ -1,112 +0,0 @@
-#!/usr/bin/env python
-##
-## Copyright (C) 2008, 2009 Nokia. All rights reserved.
-##
-## Contact: Marius Vollmer <marius.vollmer@nokia.com>
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public License
-## version 2.1 as published by the Free Software Foundation.
-##
-## This library is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-## 02110-1301 USA
-##
-##
-## This test:
-## - starts up two providers (with one properties each)
-## - issues a sleep 3 in one of them
-## - subscribes to both properties/providers
-## - reads the value from the non-sleeping one
-## - reads the value from the sleeping one
-## - the time difference between the two reads must be 2 seconds at least
-
-import sys
-import os
-import time
-import unittest
-from ContextKit.cltool import CLTool
-
-class Asynchronous(unittest.TestCase):
- def testAsynchronicity(self):
- """
- Description
- This test verifies that the asynchronicity of the subscriber
- library
-
- Pre-conditions
- 2 Providers started with context-provide tool.
- Each provider offers one property.
- 1 provider is delayed (3s).
-
- Steps
- Subscribe to both properties
- Verify that return values are correct
- Measure the time elapsed between the reception of the 2 values.
-
- Post-conditions
- Kill providers
-
- References
- None
- """
-
- # start the client
- provider_slow = CLTool("context-provide", "--v2", "com.nokia.slow",
- "int","test.slow","42")
- provider_slow.expect(CLTool.STDOUT, "Setting key", 10) # wait for it
- provider_fast = CLTool("context-provide", "--v2", "com.nokia.fast",
- "int","test.fast","44")
- provider_fast.expect(CLTool.STDOUT, "Setting key", 10) # wait for it
- context_client = CLTool("context-listen")
- context_client.expect(CLTool.STDERR, "Available commands", 10) # wait for it
-
- provider_slow.comment("provider_slow sleep time started at" + str(time.time()))
-
- provider_slow.send("sleep 3")
- provider_slow.expect(CLTool.STDOUT, "Sleeping", 3) # wait for it
-
- context_client.send("n test.slow ; n test.fast")
-
- # check the fast property
- self.assert_(context_client.expect(CLTool.STDOUT,
- CLTool.wanted("test.fast", "int", "44"),
- 3), # timeout == 3 seconds
- "Bad value for the fast property, wanted 44")
- fast_time = time.time()
- context_client.comment("Fast property arrived with good value at: " + str(fast_time))
-
- # check the slow property
- self.assert_(context_client.expect(CLTool.STDOUT,
- CLTool.wanted("test.slow", "int", "42"),
- 10), # timeout == 10 seconds max, but 5 is enough usually
- "Bad value for the slow property, wanted 42")
- slow_time = time.time()
- context_client.comment("Slow property arrived with good value at: " + str(slow_time))
-
- if slow_time - fast_time < 1.5:
- provider_slow.printio()
- context_client.printio()
- self.assert_(False,
- "The arrival time of the fast and slow property is not far enough from each other")
-
- # context_client.printio()
-
- provider_slow.kill()
- provider_fast.kill()
-
-def runTests():
- suiteInstallation = unittest.TestLoader().loadTestsFromTestCase(Asynchronous)
-
- result = unittest.TextTestRunner(verbosity=2).run(suiteInstallation)
- return len(result.errors + result.failures)
-
-if __name__ == "__main__":
- sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 1)
- sys.exit(runTests())
diff --git a/libcontextsubscriber/customer-tests/asynchronicity/rapidchanges.py b/libcontextsubscriber/customer-tests/asynchronicity/rapidchanges.py
deleted file mode 100755
index f58aa887..00000000
--- a/libcontextsubscriber/customer-tests/asynchronicity/rapidchanges.py
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/usr/bin/env python
-##
-## Copyright (C) 2008, 2009 Nokia. All rights reserved.
-##
-## Contact: Marius Vollmer <marius.vollmer@nokia.com>
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public License
-## version 2.1 as published by the Free Software Foundation.
-##
-## This library is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-## 02110-1301 USA
-##
-##
-## This test:
-## - starts up a provider with one property
-## - starts a client, verifies that the value arrives
-## - suspends the client (so it stops processing D-Bus messages)
-## - sets new value for the property twice in the provider
-## - resumes the client
-## - verifies that the client receives only one valueChanged signal
-
-import sys
-import os
-import unittest
-from ContextKit.cltool import CLTool
-
-class RapidChanges(unittest.TestCase):
- def testRapidChanges(self):
- """
- Description
- This test verifies that the subscriber library doesn't emit
- unnecessary valueChanged signals (in spite of receiving multiple
- D-Bus messages in the same main loop iteration).
-
- Steps
- 1. starts up a provider with one property
- 2. starts a client, verifies that the value arrives
- 3. suspends the client (so it stops processing D-Bus messages)
- 4. sets new value for the property twice in the provider
- 5. resumes the client
- 6. verifies that the client receives only one valueChanged signal
- """
-
- provider_fast = CLTool("context-provide", "--v2", "com.nokia.fast",
- "int","test.fast","44")
- provider_fast.expect(CLTool.STDOUT, "Setting key", 10)
- context_client = CLTool("context-listen", "test.fast")
- self.assert_(context_client.expect(CLTool.STDOUT,
- CLTool.wanted("test.fast", "int", "44"),
- 3), # timeout == 3 seconds
- "Bad value for the fast property, wanted 44")
-
- context_client.suspend()
- provider_fast.send("test.fast = 34")
- provider_fast.expect(CLTool.STDOUT, "Setting key", 10)
- provider_fast.send("test.fast = 54")
- provider_fast.expect(CLTool.STDOUT, "Setting key", 10)
- context_client.resume()
- # /.^/ is a regexp that doesn't match anything
- context_client.expect(CLTool.STDOUT, ".^", 3, wantdump=False)
- self.assertEqual(context_client.last_output, "test.fast = int:54\n",
- "expected a single valueChanged")
-
- provider_fast.close()
- context_client.close()
-
-def runTests():
- suiteInstallation = unittest.TestLoader().loadTestsFromTestCase(RapidChanges)
- result = unittest.TextTestRunner(verbosity=2).run(suiteInstallation)
- return len(result.errors + result.failures)
-
-if __name__ == "__main__":
- sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 1)
- sys.exit(runTests())
diff --git a/libcontextsubscriber/customer-tests/asynchronicity/slowfast.context b/libcontextsubscriber/customer-tests/asynchronicity/slowfast.context
deleted file mode 100644
index 3530adb6..00000000
--- a/libcontextsubscriber/customer-tests/asynchronicity/slowfast.context
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0"?>
-<xml>
- <provider bus="session" service="com.nokia.slow">
- <key name="test.slow">
- <type>INT</type>
- <doc>A phony but very flexible property.</doc>
- </key>
- </provider>
- <provider bus="session" service="com.nokia.fast">
- <key name="test.fast">
- <type>INT</type>
- <doc>A phony but very flexible property.</doc>
- </key>
- </provider>
-</xml>
diff --git a/libcontextsubscriber/customer-tests/commander/commander_appearing.py b/libcontextsubscriber/customer-tests/commander/commander_appearing.py
deleted file mode 100755
index 37d662ef..00000000
--- a/libcontextsubscriber/customer-tests/commander/commander_appearing.py
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/usr/bin/env python
-##
-## This file is part of ContextKit.
-##
-## Copyright (C) 2008, 2009 Nokia. All rights reserved.
-##
-## Contact: Marius Vollmer <marius.vollmer@nokia.com>
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public License
-## version 2.1 as published by the Free Software Foundation.
-##
-## This library is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-## 02110-1301 USA
-##
-##
-## This test:
-## - starts up a client and a provider
-## - checks for the provided values on the client stdout
-## - starts a commander with a different value for that property
-## - checks the output for the changed value
-## - changes the value inside the commander to unknown, check it
-## - changes the value inside the commander back to some meaningful value, check it
-## - kills the commander
-## - checks that value goes back to normal
-##
-
-import sys
-import os
-import unittest
-from ContextKit.cltool import CLTool
-
-class CommanderAppearing(unittest.TestCase):
- def tearDown(self):
- os.unlink('context-provide.context')
-
- def testCommanderFunctionality(self):
- provider = CLTool("context-provide", "--v2", "com.nokia.test", "int", "test.int", "42")
- provider.send("dump")
- provider.expect(CLTool.STDOUT, "Wrote", 10) # wait for it
-
- listen = CLTool("context-listen", "test.int")
-
- self.assert_(listen.expect(CLTool.STDOUT,
- CLTool.wanted("test.int", "int", "42"),
- 10),
- "Bad value initially from the real provider, wanted 42")
-
- commander = CLTool("context-provide", "--v2")
- commander.send("add int test.int 4242")
- commander.send("start")
- commander.expect(CLTool.STDOUT, "Added", 10) # wait for it
-
- self.assert_(listen.expect(CLTool.STDOUT,
- CLTool.wanted("test.int", "int", "4242"),
- 1),
- "Value after commander has been started is wrong, wanted 4242")
-
- commander.send("unset test.int")
- listen.comment("commander commanded test.int to unknown")
- self.assert_(listen.expect(CLTool.STDOUT,
- CLTool.wantedUnknown("test.int"),
- 1),
- "Value after commander has changed it to unknown is wrong")
-
- commander.send("test.int = 1235")
- self.assert_(listen.expect(CLTool.STDOUT,
- CLTool.wanted("test.int", "int", "1235"),
- 1),
- "Value after commander has changed it is wrong, wanted 1235")
-
- commander.kill()
- listen.comment("Commander killed")
- self.assert_(listen.expect(CLTool.STDOUT,
- CLTool.wanted("test.int", "int", "42"),
- 1),
- "Value after killing the commander is wrong, wanted 42")
-
-def runTests():
- suiteInstallation = unittest.TestLoader().loadTestsFromTestCase(CommanderAppearing)
- result = unittest.TextTestRunner(verbosity=2).run(suiteInstallation)
- return len(result.errors + result.failures)
-
-if __name__ == "__main__":
- sys.exit(runTests())
diff --git a/libcontextsubscriber/customer-tests/commander/commander_disabled.py b/libcontextsubscriber/customer-tests/commander/commander_disabled.py
deleted file mode 100755
index 5e3a6648..00000000
--- a/libcontextsubscriber/customer-tests/commander/commander_disabled.py
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/usr/bin/env python
-##
-## This file is part of ContextKit.
-##
-## Copyright (C) 2008, 2009 Nokia. All rights reserved.
-##
-## Contact: Marius Vollmer <marius.vollmer@nokia.com>
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public License
-## version 2.1 as published by the Free Software Foundation.
-##
-## This library is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-## 02110-1301 USA
-##
-##
-## This test:
-## - starts up a client with commanding disabled and a provider
-## - starts a commander with a different value for that property
-## - checks for the provider provided value on the client stdout
-##
-
-import sys
-import os
-import unittest
-from ContextKit.cltool import CLTool
-
-class CommanderDisabled(unittest.TestCase):
- def tearDown(self):
- os.unlink('context-provide.context')
-
- def testCommanderFunctionality(self):
- provider = CLTool("context-provide", "--v2", "contextkit.test", "int", "test.int", "42")
- provider.send("dump")
- provider.expect(CLTool.STDOUT, "Wrote", 10) # wait for it
- commander = CLTool("context-provide", "--v2")
- commander.send("add int test.int 4242")
- commander.send("start")
- commander.expect(CLTool.STDOUT, "Added", 10) # wait for it
- os.environ["CONTEXT_CLI_IGNORE_COMMANDER"] = ""
- listen = CLTool("context-listen", "test.int")
- self.assert_(listen.expect(CLTool.STDOUT,
- CLTool.wanted("test.int", "int", "42"),
- 1),
- "Provider provided value is wrong")
-
-def runTests():
- suiteInstallation = unittest.TestLoader().loadTestsFromTestCase(CommanderDisabled)
- result = unittest.TextTestRunner(verbosity=2).run(suiteInstallation)
- return len(result.errors + result.failures)
-
-if __name__ == "__main__":
- sys.exit(runTests())
diff --git a/libcontextsubscriber/customer-tests/commander/commander_nonexistent.py b/libcontextsubscriber/customer-tests/commander/commander_nonexistent.py
deleted file mode 100755
index e892a7fd..00000000
--- a/libcontextsubscriber/customer-tests/commander/commander_nonexistent.py
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/usr/bin/env python
-##
-## This file is part of ContextKit.
-##
-## Copyright (C) 2008, 2009 Nokia. All rights reserved.
-##
-## Contact: Marius Vollmer <marius.vollmer@nokia.com>
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public License
-## version 2.1 as published by the Free Software Foundation.
-##
-## This library is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-## 02110-1301 USA
-##
-##
-## This test:
-## - starts up a client and a provider
-## - starts a commander with a different value and type for a provider
-## provided property and with a new string non-provided property
-## - checks that the client gets an error for the provider provided property
-## - checks that the client gets the new string non-provided property
-## - changes the non-provided property's type to int and checks it
-## (so this proves that type checks are always off for commander properties)
-
-import sys
-import os
-import unittest
-from ContextKit.cltool import CLTool
-
-class CommanderNonExistent(unittest.TestCase):
- def tearDown(self):
- os.unlink('context-provide.context')
-
- def testCommanderFunctionality(self):
- provider = CLTool("context-provide", "--v2", "com.nokia.test", "int", "test.int", "42")
- provider.send("dump")
- self.assert_(provider.expect(CLTool.STDOUT, "Wrote", 10)) # wait for it
- listen = CLTool("context-listen", "test.int", "test.string")
- commander = CLTool("context-provide", "--v2")
- commander.send("add string test.int foobar")
- commander.send("add string test.string barfoo")
- commander.send("start")
- commander.expect(CLTool.STDOUT, "Added", 10) # wait for it
- commander.expect(CLTool.STDOUT, "Added", 10) # wait for it
-
- self.assert_(listen.expect(CLTool.STDERR,
- 'Provider error, bad type for "test.int" wanted: "INT" got: QString',
- 1),
- "Type check didn't work")
-
- # check the non-existent property
- self.assert_(listen.expect(CLTool.STDOUT,
- CLTool.wanted("test.string", "QString", "barfoo"),
- 1),
- "Non-existent property couldn't be commanded")
-
- # change the type of the non-existent property
- commander.send("add int test.string 42")
- self.assert_(listen.expect(CLTool.STDOUT,
- CLTool.wanted("test.string", "int", "42"),
- 1),
- "Non-existent property's type couldn't be overwritten")
-
-def runTests():
- suiteInstallation = unittest.TestLoader().loadTestsFromTestCase(CommanderNonExistent)
- result = unittest.TextTestRunner(verbosity=2).run(suiteInstallation)
- return len(result.errors + result.failures)
-
-if __name__ == "__main__":
- sys.exit(runTests())
diff --git a/libcontextsubscriber/customer-tests/common/rec-kill.sh b/libcontextsubscriber/customer-tests/common/rec-kill.sh
deleted file mode 100755
index 73907224..00000000
--- a/libcontextsubscriber/customer-tests/common/rec-kill.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-dokill() {
- for cpid in `cat /proc/[0-9]*/stat 2>/dev/null | cut -d\ -f1,4 | grep " $1" | cut -d' ' -f1`
- do
- dokill $cpid
- done
- kill -9 $1 > /dev/null 2>&1
-}
-
-if test $# = 0
-then
- echo "usage: $0 <top pid to kill>"
- exit 1
-fi
-
-for pid in $*
-do
- dokill $pid
-done
diff --git a/libcontextsubscriber/customer-tests/coverage-build/Makefile b/libcontextsubscriber/customer-tests/coverage-build/Makefile
deleted file mode 100644
index d10ff2ca..00000000
--- a/libcontextsubscriber/customer-tests/coverage-build/Makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-# The basic idea is that you are using CCache for compiling, so we are
-# happily cleaning your original build, because it can be rebuilt in 2
-# seconds, but coverage build is slow, so we only build coverage for
-# customer tests, not always.
-
-# If you want to build a libcontextsubscriber with coverage support,
-# you have to run make in this directory, the output is in
-# .libs/libcontextsubscriber.so.0.0.0
-
-all: clean-orig Makefile.coverage
- $(MAKE) -C ../../../common # redo it now, so it won't be rebuilt with coverage
- $(MAKE) -f Makefile.coverage VPATH=../../src CXXFLAGS=--coverage
-
-Makefile.coverage: ../../src/Makefile clean-orig
- cat $< | sed 's,^srcdir =.*,srcdir = ../../src, ; s,^top_builddir =.*,top_builddir = ../../.., ; s,^top_srcdir =.*,top_srcdir = ../../..,' >$@
- rm -rf .deps
- cp -av ../../src/.deps .
-
-clean: clean-orig
- -$(MAKE) -f Makefile.coverage clean
- rm -f *.gcno
- rm -rf .deps
- rm -rf .libs
- rm -f Makefile.coverage
-
-clean-orig:
- $(MAKE) -C ../../src clean
-
-.PHONY: all clean clean-orig \ No newline at end of file
diff --git a/libcontextsubscriber/customer-tests/env.sh b/libcontextsubscriber/customer-tests/env.sh
deleted file mode 100644
index a9c9c5c8..00000000
--- a/libcontextsubscriber/customer-tests/env.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-export PYTHONPATH=$PYTHONPATH:../../../python
-export CONTEXT_PROVIDERS=.
-export LD_LIBRARY_PATH=../../src/.libs:../../../libcontextprovider/src/.libs
-export PATH=../../../python:../../../libcontextprovider/context-provide:../../cli:../../cls:$PATH
diff --git a/libcontextsubscriber/customer-tests/forward-compatible/Makefile.am b/libcontextsubscriber/customer-tests/forward-compatible/Makefile.am
deleted file mode 100644
index 50f89ea0..00000000
--- a/libcontextsubscriber/customer-tests/forward-compatible/Makefile.am
+++ /dev/null
@@ -1,20 +0,0 @@
-EXTRA_DIST = cache1.cdb cache2.cdb test.sh
-
-bin_PROGRAMS = check-version
-
-AM_CXXFLAGS = -I$(srcdir)/../../src $(QtXml_CFLAGS) $(QtCore_CFLAGS) $(QtDBus_CFLAGS) \
- '-DCONTEXT_LOG_MODULE_NAME="check-version"' \
- '-DDEFAULT_CONTEXT_PROVIDERS="./"'
-
-AM_LDFLAGS = $(QtXml_LIBS) $(QtCore_LIBS)
-
-check_version_SOURCES = check-version.cpp
-
-check_version_LDADD = ../../src/libcontextsubscriber.la
-../../src/libcontextsubscriber.la:
- $(MAKE) -C ../../src libcontextsubscriber.la
-.PHONY: ../../src/libcontextsubscriber.la
-
-check-customer:
- $(MAKE) -C @abs_top_srcdir@ all
- ./test.sh
diff --git a/libcontextsubscriber/customer-tests/forward-compatible/cache1.cdb b/libcontextsubscriber/customer-tests/forward-compatible/cache1.cdb
deleted file mode 100644
index e50622de..00000000
--- a/libcontextsubscriber/customer-tests/forward-compatible/cache1.cdb
+++ /dev/null
Binary files differ
diff --git a/libcontextsubscriber/customer-tests/forward-compatible/cache2.cdb b/libcontextsubscriber/customer-tests/forward-compatible/cache2.cdb
deleted file mode 100644
index 6295c6ab..00000000
--- a/libcontextsubscriber/customer-tests/forward-compatible/cache2.cdb
+++ /dev/null
Binary files differ
diff --git a/libcontextsubscriber/customer-tests/forward-compatible/check-version.cpp b/libcontextsubscriber/customer-tests/forward-compatible/check-version.cpp
deleted file mode 100644
index 90daf7c1..00000000
--- a/libcontextsubscriber/customer-tests/forward-compatible/check-version.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <QCoreApplication>
-#include <QDir>
-#include <QDebug>
-#include <stdlib.h>
-#include "contextregistryinfo.h"
-#include "contextpropertyinfo.h"
-
-void fail()
-{
- QFile::remove("cache.cdb");
- exit(128);
-}
-
-int main(int argc, char **argv)
-{
- QCoreApplication app(argc, argv);
-
- QFile::remove("cache.cdb");
- if (! QFile::copy("cache1.cdb", "cache.cdb")) {
- qDebug() << "Can't copy cache1.cdb!";
- fail();
- }
-
- if (! ContextRegistryInfo::instance()->listKeys().contains("Battery.OnBattery")) {
- qDebug() << "Battery.OnBattery not found in cache1.cdb!";
- fail();
- }
-
- ContextPropertyInfo info1("Battery.OnBattery");
- if (info1.provided() != true) {
- qDebug() << "Battery.OnBattery should be provided!";
- fail();
- }
-
- QFile::remove("cache.cdb");
- if (! QFile::copy("cache2.cdb", "cache.cdb")) {
- qDebug() << "Can't copy cache2.cdb!";
- fail();
- }
-
- for (int i = 0; i < 1000; i++)
- app.processEvents();
-
- ContextPropertyInfo info2("Battery.OnBattery");
- if (info2.provided() == true) {
- qDebug() << "Battery.OnBattery should not be provided!";
- fail();
- }
-
- QFile::remove("cache.cdb");
- return 0;
-}
-
diff --git a/libcontextsubscriber/customer-tests/forward-compatible/test.sh b/libcontextsubscriber/customer-tests/forward-compatible/test.sh
deleted file mode 100755
index 6de044a3..00000000
--- a/libcontextsubscriber/customer-tests/forward-compatible/test.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash -e
-
-export CONTEXT_CORE_DECLARATIONS=/dev/null
-export CONTEXT_PROVIDERS=./
-./check-version
-exit 0
diff --git a/libcontextsubscriber/customer-tests/pluginchanging/pluginchanging.py b/libcontextsubscriber/customer-tests/pluginchanging/pluginchanging.py
deleted file mode 100755
index b4e569a5..00000000
--- a/libcontextsubscriber/customer-tests/pluginchanging/pluginchanging.py
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/usr/bin/env python
-##
-## This file is part of ContextKit.
-##
-## Copyright (C) 2009 Nokia. All rights reserved.
-##
-## Contact: Marius Vollmer <marius.vollmer@nokia.com>
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public License
-## version 2.1 as published by the Free Software Foundation.
-##
-## This library is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-## 02110-1301 USA
-##
-##
-## Requires python2.5-gobject and python2.5-dbus
-##
-import sys
-import unittest
-import os
-from ContextKit.cltool import CLTool
-
-class Subscription(unittest.TestCase):
- def tearDown(self):
- os.remove('time.context')
-
- def testChangingPlugin(self):
- os.environ["CONTEXT_PROVIDERS"] = "."
- if os.path.isdir("../testplugins"):
- # for your local machine
- os.environ["CONTEXT_SUBSCRIBER_PLUGINS"] = "../testplugins"
- else:
- # if libcontextsubscriber-tests is installed
- os.environ["CONTEXT_SUBSCRIBER_PLUGINS"] = "/usr/lib/contextkit/subscriber-test-plugins"
-
- if not os.path.exists(os.environ["CONTEXT_SUBSCRIBER_PLUGINS"] + "/" + "contextsubscribertime1.so") \
- or not os.path.exists(os.environ["CONTEXT_SUBSCRIBER_PLUGINS"] + "/" + "contextsubscribertime2.so"):
- self.assert_(False, "Couldn't find the test time plugins")
-
- self.context_client = CLTool("context-listen", "Test.Time")
- self.context_client.expect(CLTool.STDERR, "Available commands", 10) # wait for it
-
- # Copy the declaration file, declaring libcontextsubscribertime1 plugin.
- os.system('cp time1.context.temp time.context.temp')
- os.system('mv time.context.temp time.context')
- #print "now reading"
-
- # Expect value coming from plugin libcontextsubscribertime1
- self.assert_(self.context_client.expect(CLTool.STDOUT, "Test.Time = QString:Time1:", 10))
-
- # Modify the registry so that the key is now provided by libcontextsubscribertime2
- os.system('cp time2.context.temp time.context.temp')
- os.system('mv time.context.temp time.context')
-
- # Expect value coming from plugin libcontextsubscribertime2
- self.assert_(self.context_client.expect(CLTool.STDOUT, "Test.Time = QString:Time2:", 10))
-
-if __name__ == "__main__":
- sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 1)
- unittest.main()
diff --git a/libcontextsubscriber/customer-tests/pluginchanging/time1.context.temp b/libcontextsubscriber/customer-tests/pluginchanging/time1.context.temp
deleted file mode 100644
index d2cf9881..00000000
--- a/libcontextsubscriber/customer-tests/pluginchanging/time1.context.temp
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0"?>
-<provider xmlns="http://contextkit.freedesktop.org/Provider" plugin="/contextsubscribertime1" constructionString="time">
- <key name="Test.Time"><type>STRING</type></key>
-</provider>
diff --git a/libcontextsubscriber/customer-tests/pluginchanging/time2.context.temp b/libcontextsubscriber/customer-tests/pluginchanging/time2.context.temp
deleted file mode 100644
index c5476168..00000000
--- a/libcontextsubscriber/customer-tests/pluginchanging/time2.context.temp
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0"?>
-<provider xmlns="http://contextkit.freedesktop.org/Provider" plugin="/contextsubscribertime2" constructionString="time">
- <key name="Test.Time"><type>STRING</type></key>
-</provider>
diff --git a/libcontextsubscriber/customer-tests/registry/registry.py b/libcontextsubscriber/customer-tests/registry/registry.py
deleted file mode 100755
index 629946f3..00000000
--- a/libcontextsubscriber/customer-tests/registry/registry.py
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/usr/bin/env python
-##
-## This file is part of ContextKit.
-##
-## Copyright (C) 2008, 2009 Nokia. All rights reserved.
-##
-## Contact: Marius Vollmer <marius.vollmer@nokia.com>
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public License
-## version 2.1 as published by the Free Software Foundation.
-##
-## This library is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-## 02110-1301 USA
-##
-
-import sys
-import os
-import unittest
-from ContextKit.cltool import CLTool
-
-class PrintInfoRunning(unittest.TestCase):
- def tearDown(self):
- os.unlink('context-provide.context')
-
- def testReturnValue(self):
- provider = CLTool("context-provide", "--v2", "com.nokia.test",
- "int", "test.int", "-5",
- "string", "test.string", "something",
- "double", "test.double", "4.231",
- "truth", "test.truth", "False")
- provider.send("dump")
- self.assert_(provider.expect(CLTool.STDOUT, "Wrote ./context-provide.context", 10)) # wait for it
- info_client = CLTool("context-ls","test.*")
-
- returnValue = info_client.wait()
- self.assertEqual(returnValue, 0, "context-ls exited with return value != 0")
- provider.kill()
-
-class PrintingProperties(unittest.TestCase):
- def tearDown(self):
- os.unlink('context-provide.context')
-
- def testProperties(self):
- provider = CLTool("context-provide", "--v2", "com.nokia.test",
- "int", "test.int", "-5",
- "string", "test.string", "something",
- "double", "test.double", "4.231",
- "truth", "test.truth", "False")
- provider.send("dump")
- self.assert_(provider.expect(CLTool.STDOUT, "Wrote ./context-provide.context", 10),
- "context-provide.context couldn't been written by context-provide")
- info_client = CLTool("context-ls","-l","-d","test.*")
-
- expected_results = ["\ntest.int\tINT\tcontextkit-dbus\tsession:com.nokia.test\n",
- "\ntest.double\tDOUBLE\tcontextkit-dbus\tsession:com.nokia.test\n",
- "\ntest.truth\tTRUTH\tcontextkit-dbus\tsession:com.nokia.test\n",
- "\ntest.string\tSTRING\tcontextkit-dbus\tsession:com.nokia.test\n",
- "\nDocumentation: A phony but very flexible property.\n"]
-
- self.assert_(info_client.expectAll(CLTool.STDOUT,
- expected_results,
- 1),
- "Bad introspection result from context-ls")
-
-def runTests():
- suitePrintInfoRunning = unittest.TestLoader().loadTestsFromTestCase(PrintInfoRunning)
- suiteProperties = unittest.TestLoader().loadTestsFromTestCase(PrintingProperties)
-
- errors = []
- result = unittest.TextTestRunner(verbosity=2).run(suitePrintInfoRunning)
- errors += result.errors + result.failures
- result = unittest.TextTestRunner(verbosity=2).run(suiteProperties)
- errors += result.errors + result.failures
-
- return len(errors)
-
-if __name__ == "__main__":
- sys.exit(runTests())
diff --git a/libcontextsubscriber/customer-tests/runTests.sh b/libcontextsubscriber/customer-tests/runTests.sh
deleted file mode 100755
index 50e18366..00000000
--- a/libcontextsubscriber/customer-tests/runTests.sh
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/bash -e
-
-cd $(dirname $0)
-DIRS="commander subscription asynchronicity registry pluginchanging"
-. ./env.sh
-
-make -C ../../libcontextprovider/src
-make -C ../../libcontextprovider/context-provide
-make -C ../cli
-make -C ../cls
-make -C ../update-contextkit-providers
-
-if [ -n "$COVERAGE" ]
-then
- make -C coverage-build
- export LD_LIBRARY_PATH=../coverage-build/.libs:$LD_LIBRARY_PATH
- export PATH=../../../python:../../../libcontextprovider/context-provide:../../cli/.libs:../../cls/.libs:$PATH
- rm -rf coverage-build/.libs/*.gcda
-else
- make -C ../src
-fi
-
-make -C testplugins
-
-if pkg-config contextprovider-1.0 || [ -e ../../libcontextprovider/src/.libs/libcontextprovider.so ]
-then
- for dir in $DIRS; do
- echo "Running tests in $dir"
- cd $dir
- for file in *.py; do
- python2.5 $file
- done
- cd ..
- done
-else
- echo "libcontextprovider is not installed nor built"
- exit 1
-fi
-
-echo "Running update-contextkit-providers customer check"
-cd update-contextkit-providers ; ./test.sh ; cd ..
-
-echo "Running forward-compatible customer check"
-cd forward-compatible ; ./test.sh ; cd ..
-
-if [ -n "$COVERAGE" ]
-then
- echo "computing coverage"
- rm -rf coverage
- mkdir -p coverage
- lcov --directory coverage-build/.libs/ --capture --output-file coverage/all.cov
- lcov --extract coverage/all.cov '*/src/*.cpp' --output-file coverage/src.cov
- genhtml -o coverage/ coverage/src.cov
-fi
diff --git a/libcontextsubscriber/customer-tests/subscription/multiprovider.py b/libcontextsubscriber/customer-tests/subscription/multiprovider.py
deleted file mode 100755
index 02013797..00000000
--- a/libcontextsubscriber/customer-tests/subscription/multiprovider.py
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/usr/bin/env python
-##
-## Copyright (C) 2008, 2009 Nokia. All rights reserved.
-##
-## Contact: Marius Vollmer <marius.vollmer@nokia.com>
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public License
-## version 2.1 as published by the Free Software Foundation.
-##
-## This library is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-## 02110-1301 USA
-
-import sys
-import os
-import unittest
-from ContextKit.cltool import CLTool
-
-class MultiProvider(unittest.TestCase):
- def testMultipleProviders(self):
- """
- Description
- This test verifies correct client behavior in the presence of
- multiple providers.
-
- Steps
- 1. starts up a client
- 2. starts two providers (X and Y) providing the same P property
- 3. X sets P to V1 and verifies that the client got it
- 4. Y sets P to V2 and likewise verifies in the client
- 5. Y sets P to NULL, the client verifies that P goes back to V1
- 6. Y sets P to V3, the client verifies P == V3
- 7. Y is removed from the registry, client verifies that P == V1
- 8. X is removed from the registry, client verifies that P == NULL
- """
- client = CLTool("context-listen", "test.prop")
- client.expect(CLTool.STDERR, "Available commands", 3)
-
- provider_x = CLTool("context-provide", "--v2", "test.X",
- "int", "test.prop", "44")
- provider_x.send("dump x.context")
- provider_x.expect(CLTool.STDOUT, "Wrote", 10)
-
- provider_y = CLTool("context-provide", "--v2", "test.Y",
- "int", "test.prop", "22")
- provider_y.send("dump y.context")
- provider_y.expect(CLTool.STDOUT, "Wrote", 10)
-
- provider_x.send("test.prop = 55");
- provider_x.expect(CLTool.STDOUT, "Setting key", 10)
- self.assert_(client.expect(CLTool.STDOUT,
- CLTool.wanted("test.prop", "int", "55"),
- 3))
-
- provider_y.send("test.prop = 77");
- provider_y.expect(CLTool.STDOUT, "Setting key", 10)
- self.assert_(client.expect(CLTool.STDOUT,
- CLTool.wanted("test.prop", "int", "77"),
- 3))
-
- provider_y.send("unset test.prop");
- provider_y.expect(CLTool.STDOUT, "Setting key", 10)
- self.assert_(client.expect(CLTool.STDOUT,
- CLTool.wanted("test.prop", "int", "55"),
- 3))
-
- provider_y.send("test.prop = 99");
- provider_y.expect(CLTool.STDOUT, "Setting key", 10)
- self.assert_(client.expect(CLTool.STDOUT,
- CLTool.wanted("test.prop", "int", "99"),
- 3))
-
- provider_y.close()
- os.unlink("y.context")
- self.assert_(client.expect(CLTool.STDOUT,
- CLTool.wanted("test.prop", "int", "55"),
- 3))
-
- provider_x.close()
- os.unlink("x.context")
- self.assert_(client.expect(CLTool.STDOUT,
- CLTool.wantedUnknown("test.prop"),
- 3))
- client.close()
-
-def runTests():
- suiteInstallation = unittest.TestLoader().loadTestsFromTestCase(MultiProvider)
- result = unittest.TextTestRunner(verbosity=2).run(suiteInstallation)
- return len(result.errors + result.failures)
-
-if __name__ == "__main__":
- sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 1)
- sys.exit(runTests())
diff --git a/libcontextsubscriber/customer-tests/subscription/nonexistent.context b/libcontextsubscriber/customer-tests/subscription/nonexistent.context
deleted file mode 100644
index 12e1562f..00000000
--- a/libcontextsubscriber/customer-tests/subscription/nonexistent.context
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0"?>
-<provider bus="session" service="com.nokia.non.existent">
- <key name="test.nonexistent">
- <type>INT</type>
- <doc>A property for a non-existent provider.</doc>
- </key>
-</provider>
diff --git a/libcontextsubscriber/customer-tests/subscription/subscription.py b/libcontextsubscriber/customer-tests/subscription/subscription.py
deleted file mode 100755
index 91e304bd..00000000
--- a/libcontextsubscriber/customer-tests/subscription/subscription.py
+++ /dev/null
@@ -1,704 +0,0 @@
-#!/usr/bin/env python
-##
-## @file contextOrientationTCs.py
-## This file is part of ContextKit.
-##
-## Copyright (C) 2008, 2009 Nokia. All rights reserved.
-##
-## Contact: Marius Vollmer <marius.vollmer@nokia.com>
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public License
-## version 2.1 as published by the Free Software Foundation.
-##
-## This library is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-## 02110-1301 USA
-##
-##
-## Requires python2.5-gobject and python2.5-dbus
-##
-import sys
-import unittest
-import os
-from ContextKit.cltool import CLTool
-
-class Subscription(unittest.TestCase):
- def tearDown(self):
- os.unlink('./context-provide.context')
-
- def testValue(self):
- """
- Description
- Subscribe to 4 properties covering basic data types
- Query the value of the property
- (when it's known or unknown, with and without a default value)
-
- Pre-conditions
- Provider started via context-provide tool.
- 4 data types supported int, bool, double and string
-
- Steps
- Subscribe to the properties, int, bool, double, string
- Change value of type int from the provider to a known value
- Query the value (both with and without a default value) and assert the result
- Change value of type int from the provider to unknown
- Query the value (both with and without a default value) and assert the result
-
- Post-conditions
- Kill provider
-
- References
- None
- """
-
- provider = CLTool("context-provide", "--v2", "com.nokia.test",
- "int","test.int","1",
- "string","test.string","foobar",
- "double","test.double","2.5",
- "truth","test.truth","True")
- provider.send("dump")
- provider.expect(CLTool.STDOUT, "Wrote", 10) # wait for it
- listen = CLTool("context-listen", "test.double", "test.string", "test.int", "test.truth")
- self.assert_(
- listen.expectAll(CLTool.STDOUT,
- ["\ntest.double = double:2.5\n",
- "\ntest.int = int:1\n",
- "\ntest.string = QString:foobar\n",
- "\ntest.truth = bool:true\n"],
- 10),
- "Actual key values pairs do not match expected")
-
- provider.send("test.int = 100")
- listen.expect(CLTool.STDOUT, "int:100", 10) # wait for it
- listen.send("value test.int")
- self.assert_(
- listen.expect(CLTool.STDOUT,
- "\nvalue: int:100\n",
- 1),
- "Value command returned wrong value")
-
- listen.send("value test.int defaultValue")
- self.assert_(
- listen.expect(CLTool.STDOUT,
- "\nvalue: int:100\n",
- 1),
- "Value command returned wrong value")
-
- provider.send("unset test.int")
- listen.expect(CLTool.STDOUT, "Unknown", 10) # wait for it
- listen.send("value test.int")
- self.assert_(
- listen.expect(CLTool.STDOUT,
- "\nvalue is Unknown\n",
- 1),
- "Value command returned wrong value")
-
- listen.send("value test.int defaultValue")
- self.assert_(
- listen.expect(CLTool.STDOUT,
- "\nvalue: QString:defaultValue\n",
- 1),
- "Value command returned wrong value")
-
- listen.send("key test.int")
- self.assert_(
- listen.expect(CLTool.STDOUT,
- "\nkey: test.int\n",
- 1),
- "Key command returned wrong value")
-
- provider.close()
- listen.close()
-
- def testInfos(self):
- """
- Description
- Subscribe to 4 properties covering basic data types
-
- Pre-conditions
- Provider started via context-provide tool.
- 4 data types supported int, bool, double and string
-
- Steps
- Subscribe to the properties, int, bool, double, string
- Assert the returned information for key, description and type
-
- Post-conditions
- Kill provider
-
- References
- None
- """
-
- provider = CLTool("context-provide", "--v2", "com.nokia.test",
- "int","test.int","1",
- "string","test.string","foobar",
- "double","test.double","2.5",
- "truth","test.truth","True")
- provider.expect(CLTool.STDOUT, "Setting key: test.truth", 10) # wait for it
- provider.send("dump")
- provider.expect(CLTool.STDOUT, "Wrote", 10) # wait for it
- listen = CLTool("context-listen", "test.double", "test.string", "test.int", "test.truth")
- listen.expectAll(CLTool.STDOUT,
- ["\ntest.double = double:2.5\n",
- "\ntest.int = int:1\n",
- "\ntest.string = QString:foobar\n",
- "\ntest.truth = bool:true\n"],
- 10) # wait for it
- listen.send("ikey test.int")
-
- self.assert_(
- listen.expect(CLTool.STDOUT,
- "\nikey: test.int\n",
- 1),
- "ikey didn't work")
-
- listen.send("man test.truth")
- self.assert_(
- listen.expect(CLTool.STDOUT,
- "\nman: A phony but very flexible property.\n",
- 1),
- "man didn't work")
-
- listen.send("type test.double")
- self.assert_(
- listen.expect(CLTool.STDOUT,
- "\ntype: DOUBLE\n",
- 1),
- "type didn't work")
- provider.close()
- listen.close()
-
- def testTypes(self):
- provider = CLTool("context-provide", "--v2", "com.nokia.test",
- "int","test.int","1",
- "string","test.string","foobar",
- "double","test.double","2.5",
- "truth","test.truth","True")
- provider.expect(CLTool.STDOUT, "Setting key: test.truth", 10) # wait for it
- provider.send("dump")
- provider.expect(CLTool.STDOUT, "Wrote", 10) # wait for it
- listen = CLTool("context-listen", "test.double", "test.string", "test.int", "test.truth", "test.fake")
- listen.expectAll(CLTool.STDOUT,
- ["\ntest.double = double:2.5\n",
- "\ntest.int = int:1\n",
- "\ntest.string = QString:foobar\n",
- "\ntest.truth = bool:true\n"],
- 10) # wait for it
-
- # test querying the type of all properties
- listen.send("type test.int")
- self.assert_(
- listen.expect(CLTool.STDOUT,
- "\ntype: INT\n",
- 1))
-
- listen.send("type test.double")
- self.assert_(
- listen.expect(CLTool.STDOUT,
- "\ntype: DOUBLE\n",
- 1))
-
- listen.send("type test.truth")
- self.assert_(
- listen.expect(CLTool.STDOUT,
- "\ntype: TRUTH\n",
- 1))
-
- listen.send("type test.string")
- self.assert_(
- listen.expect(CLTool.STDOUT,
- "\ntype: STRING\n",
- 1))
-
- listen.send("type test.fake")
- self.assert_(
- listen.expect(CLTool.STDOUT,
- "\ntype:\n",
- 1))
-
- provider.close()
- listen.close()
-
- def testProviders(self):
- provider = CLTool("context-provide", "--v2", "com.nokia.test",
- "int","test.int","1",
- "string","test.string","foobar",
- "double","test.double","2.5",
- "truth","test.truth","True")
- provider.expect(CLTool.STDOUT, "Setting key: test.truth", 10) # wait for it
- provider.send("dump")
- provider.expect(CLTool.STDOUT, "Wrote", 10) # wait for it
- listen = CLTool("context-listen", "test.double", "test.string", "test.int", "test.truth", "test.fake")
- listen.expectAll(CLTool.STDOUT,
- ["\ntest.double = double:2.5\n",
- "\ntest.int = int:1\n",
- "\ntest.string = QString:foobar\n",
- "\ntest.truth = bool:true\n"],
- 10) # wait for it
-
- # test querying the provider(s)
- listen.send("providers test.int")
- self.assert_(
- listen.expect(CLTool.STDOUT,
- "\nproviders: session:com.nokia.test@contextkit-dbus\n",
- 1))
-
- listen.send("providers test.fake")
- self.assert_(
- listen.expect(CLTool.STDOUT,
- "\nproviders:\n",
- 1))
- provider.close()
- listen.close()
-
- def testAllDataTypes(self):
- """
- Description
- Subscribe to 4 properties covering basic data types
-
- Pre-conditions
- Provider started via context-provide tool.
- 4 data types supported int, bool, double and string
-
- Steps
- Subscribe to the properties, int, bool, double, string
- Properties values
-
- Post-conditions
- Kill provider
-
- References
- None
- """
-
- provider = CLTool("context-provide", "--v2", "com.nokia.test",
- "int","test.int","1",
- "string","test.string","foobar",
- "double","test.double","2.5",
- "truth","test.truth","True")
- provider.expect(CLTool.STDOUT, "Setting key: test.truth", 10) # wait for it
- provider.send("dump")
- provider.expect(CLTool.STDOUT, "Wrote", 10) # wait for it
- listen = CLTool("context-listen", "test.double", "test.string", "test.int", "test.truth")
- self.assert_(
- listen.expectAll(CLTool.STDOUT,
- ["\ntest.double = double:2.5\n",
- "\ntest.int = int:1\n",
- "\ntest.string = QString:foobar\n",
- "\ntest.truth = bool:true\n"],
- 10),
- "Actual key values pairs do not match expected")
- provider.close()
- listen.close()
-
- def testTruthTypePermutations(self):
- """
- Description
- Subscribe to 4 properties covering basic data types
-
- Pre-conditions
- Provider started via context-provide tool.
- 4 data types supported int, bool, double and string
-
- Steps
- Subscribe to the properties, int, bool, double, string
- Change property of type bool to False, None and True
- Property value of type bool is updated to False, None and True
-
- Post-conditions
- Kill provider
-
- References
- None
- """
- provider = CLTool("context-provide", "--v2", "com.nokia.test", "truth", "test.truth", "False")
- provider.expect(CLTool.STDOUT, "Setting key: test.truth", 10) # wait for it
- provider.send("dump")
- provider.expect(CLTool.STDOUT, "Wrote", 10) # wait for it
- provider.send("test.truth = False")
- provider.expect(CLTool.STDOUT, "Setting", 10) # wait for it
- listen = CLTool("context-listen", "test.truth")
- self.assert_(
- listen.expect(CLTool.STDOUT,
- "\ntest.truth = bool:false\n",
- 3),
- "setting to false didn't work")
-
- provider.send("unset test.truth")
- self.assert_(
- listen.expect(CLTool.STDOUT,
- "\ntest.truth is Unknown\n",
- 1),
- "setting to unknown didn't work")
-
- provider.send("test.truth = True")
- self.assert_(
- listen.expect(CLTool.STDOUT,
- "\ntest.truth = bool:true\n",
- 1),
- "setting to true didn't work")
- provider.close()
- listen.close()
-
- def testStringTypePermutations(self):
- """
- Description
- Subscribe to 4 properties covering basic data types
-
- Pre-conditions
- Provider started via context-provide tool.
- 4 data types supported int, bool, double and string
-
- Steps
- Subscribe to the properties, int, bool, double, string
- Change property of type string to empty string and None
- Property value of type bool is updated to empty string and None
-
- Post-conditions
- Kill provider
-
- References
- None
- """
- provider = CLTool("context-provide", "--v2", "com.nokia.test", "string", "test.string", "something")
- provider.expect(CLTool.STDOUT, "Setting key: test.string", 10) # wait for it
- provider.send("dump")
- provider.expect(CLTool.STDOUT, "Wrote", 10) # wait for it
- listen = CLTool("context-listen", "test.string")
- listen.expect(CLTool.STDERR, "Available commands", 10) # wait for it
-
- self.assert_(
- listen.expect(CLTool.STDOUT,
- "\ntest.string = QString:something\n",
- 1),
- "setting to 'something' didn't work")
-
- provider.send('test.string = ""')
- self.assert_(
- listen.expect(CLTool.STDOUT,
- "\ntest.string = QString:\n",
- 1),
- "setting to empty string didn't work")
-
- provider.send('unset test.string')
- self.assert_(
- listen.expect(CLTool.STDOUT,
- "\ntest.string is Unknown\n",
- 1),
- "setting to null didn't work")
-
- provider.close()
- listen.close()
-
-class MultipleSubscribers(unittest.TestCase):
- def setUp(self):
- self.flexiprovider = CLTool("context-provide", "--v2","com.nokia.test",
- "int","test.int","1",
- "string","test.string","foobar",
- "double","test.double","2.5",
- "truth","test.truth","True")
- self.flexiprovider.expect(CLTool.STDOUT, "Setting key: test.truth", 10) # wait for it
- self.flexiprovider.send("dump")
- self.flexiprovider.expect(CLTool.STDOUT, "Wrote", 10) # wait for it
- self.context_client1 = CLTool("context-listen","test.int","test.double","test.string","test.truth")
- self.context_client2 = CLTool("context-listen","test.int","test.double")
- self.context_client3 = CLTool("context-listen","test.int","test.string","test.truth")
- self.context_client4 = CLTool("context-listen","test.int","test.double","test.string")
- self.context_client1.expect(CLTool.STDERR, "Available commands", 10) # wait for it
- self.context_client2.expect(CLTool.STDERR, "Available commands", 10) # wait for it
- self.context_client3.expect(CLTool.STDERR, "Available commands", 10) # wait for it
- self.context_client4.expect(CLTool.STDERR, "Available commands", 10) # wait for it
-
- def tearDown(self):
- self.flexiprovider.close()
- self.context_client1.close()
- self.context_client2.close()
- self.context_client3.close()
- self.context_client4.close()
- os.unlink('./context-provide.context')
-
- def testInitialSubscription(self):
- """
- Description
- 4 subscribers instantiate multiple properties of 4 basic data types
-
- Pre-conditions
- Provider started via context-provide tool.
- 4 data types supported int, bool, double and string
-
- Steps
- Subscribe to the properties, int, bool, double, string
- Subscribers receive initial values from provider
-
- Post-conditions
- Kill provider
-
- References
- None
- """
-
- client1_expected = ["\ntest.double = double:2.5\n",
- "\ntest.int = int:1\n",
- "\ntest.string = QString:foobar\n",
- "\ntest.truth = bool:true\n"]
- client2_expected = ["\ntest.double = double:2.5\n",
- "\ntest.int = int:1\n"]
- client3_expected = ["\ntest.int = int:1\n",
- "\ntest.string = QString:foobar\n",
- "\ntest.truth = bool:true\n"]
- client4_expected = ["\ntest.double = double:2.5\n",
- "\ntest.int = int:1\n",
- "\ntest.string = QString:foobar\n"]
-
- self.assert_(self.context_client1.expectAll(CLTool.STDOUT, client1_expected, 1), "Actual key values pairs do not match expected")
- self.assert_(self.context_client2.expectAll(CLTool.STDOUT, client2_expected, 1), "Actual key values pairs do not match expected")
- self.assert_(self.context_client3.expectAll(CLTool.STDOUT, client3_expected, 1), "Actual key values pairs do not match expected")
- self.assert_(self.context_client4.expectAll(CLTool.STDOUT, client4_expected, 1), "Actual key values pairs do not match expected")
-
- def testValueChanged(self):
- """
- Description
- 4 subscribers instantiate multiple properties of 4 basic data types
-
- Pre-conditions
- Provider started via context-provide tool.
- 4 data types supported int, bool, double and string
-
- Steps
- Subscribe to the properties, int, bool, double, string
- Values are changed successively from the provider
- Subscribers receive updated values
-
- Post-conditions
- Kill provider
-
- References
- None
- """
- client1_expected = ["\ntest.double = double:2.5\n",
- "\ntest.int = int:1\n",
- "\ntest.string = QString:foobar\n",
- "\ntest.truth = bool:true\n"]
- client2_expected = ["\ntest.double = double:2.5\n",
- "\ntest.int = int:1\n"]
- client3_expected = ["\ntest.int = int:1\n",
- "\ntest.string = QString:foobar\n",
- "\ntest.truth = bool:true\n"]
- client4_expected = ["\ntest.double = double:2.5\n",
- "\ntest.int = int:1\n",
- "\ntest.string = QString:foobar\n"]
-
- self.assert_(self.context_client1.expectAll(CLTool.STDOUT, client1_expected, 1), "Actual key values pairs do not match expected")
- self.assert_(self.context_client2.expectAll(CLTool.STDOUT, client2_expected, 1), "Actual key values pairs do not match expected")
- self.assert_(self.context_client3.expectAll(CLTool.STDOUT, client3_expected, 1), "Actual key values pairs do not match expected")
- self.assert_(self.context_client4.expectAll(CLTool.STDOUT, client4_expected, 1), "Actual key values pairs do not match expected")
-
- self.flexiprovider.send("test.double = -5.3")
- client1_expected = "\ntest.double = double:-5.3\n"
- client2_expected = "\ntest.double = double:-5.3\n"
- client4_expected = "\ntest.double = double:-5.3\n"
-
- self.assert_(self.context_client1.expect(CLTool.STDOUT, client1_expected, 1), "Actual key values pairs do not match expected")
- self.assert_(self.context_client2.expect(CLTool.STDOUT, client2_expected, 1), "Actual key values pairs do not match expected")
- self.assert_(self.context_client4.expect(CLTool.STDOUT, client4_expected, 1), "Actual key values pairs do not match expected")
-
- self.context_client3.send("type test.truth")
-
- client3_expected = "\ntype: TRUTH\n"
-
- self.assert_(self.context_client3.expect(CLTool.STDOUT, client3_expected, 1), "Actual key values pairs do not match expected")
-
- self.flexiprovider.send("unset test.truth")
- client1_expected = "\ntest.truth is Unknown\n"
- client3_expected = "\ntest.truth is Unknown\n"
-
- self.assert_(self.context_client1.expect(CLTool.STDOUT, client1_expected, 1), "Actual key values pairs do not match expected")
- self.assert_(self.context_client3.expect(CLTool.STDOUT, client3_expected, 1), "Actual key values pairs do not match expected")
-
-class MultipleProviders(unittest.TestCase):
- def tearDown(self):
- os.unlink('./context-provide1.context')
- os.unlink('./context-provide2.context')
-
- def testTwoProviders(self):
- provider1 = CLTool("context-provide", "--v2","com.nokia.test",
- "truth","test.truth","True")
- provider1.expect(CLTool.STDOUT, "Setting key: test.truth", 10) # wait for it
- provider1.send("dump context-provide1.context")
- provider1.expect(CLTool.STDOUT, "Wrote", 10) # wait for it
-
- provider2 = CLTool("context-provide", "--v2","com.nokia.test2",
- "int","test.int","24")
- provider2.expect(CLTool.STDOUT, "Setting key: test.int", 10) # wait for it
- provider2.send("dump context-provide2.context")
- provider2.expect(CLTool.STDOUT, "Wrote", 10) # wait for it
-
- listen = CLTool("context-listen","test.int","test.truth")
- listen.expect(CLTool.STDERR, "Available commands", 10) # wait for it
-
- provider2.send("test.int = -68")
-
- self.assert_(
- listen.expect(CLTool.STDOUT,
- "\ntest.int = int:-68\n",
- 1))
-
- provider1.send("test.truth = False")
-
- self.assert_(
- listen.expect(CLTool.STDOUT,
- "\ntest.truth = bool:false\n",
- 1))
- provider1.close()
- provider2.close()
- listen.close()
-
-class SubscriptionPause (unittest.TestCase):
- def tearDown(self):
- self.provider.close()
- self.listen.close()
- os.unlink('context-provide.context')
-
- def testPause(self):
- """
- Description
- A subscriber successively subscribes and unsubscribes from a property
-
- Pre-conditions
- Provider started via context-provide tool.
- 2 properties of data type int
-
- Steps
- Subscribe to a property
- Subscriber receives updated value
- Unsubscribe from the property
- Subscriber does not receive updated value
- Resubscribe to the property
- Subscriber receives updated value
-
- Post-conditions
- Kill provider
-
- References
- None
- """
-
- self.provider = CLTool("context-provide", "--v2","com.nokia.test",
- "int","test.int","1")
- self.provider.expect(CLTool.STDOUT, "Setting key: test.int", 10) # wait for it
- self.provider.send("dump")
- self.provider.expect(CLTool.STDOUT, "Wrote", 10) # wait for it
- self.listen = CLTool("context-listen","test.int")
- self.listen.expect(CLTool.STDERR, "Available commands", 10) # wait for it
-
- self.assert_(
- self.listen.expect(CLTool.STDOUT,
- "\ntest.int = int:1\n",
- 1))
-
- self.provider.send("test.int = -5")
- self.assert_(
- self.listen.expect(CLTool.STDOUT,
- "\ntest.int = int:-5\n",
- 1))
-
- self.listen.send("unsubscribe test.int")
- self.provider.send("test.int = 3")
- self.assertFalse(
- self.listen.expect(CLTool.STDOUT,
- "\ntest.int = int:3\n",
- 1,
- False))
-
- self.listen.send("subscribe test.int")
- self.assert_(
- self.listen.expect(CLTool.STDOUT,
- "\ntest.int = int:3\n",
- 1))
-
- self.provider.send("test.int = 6")
- self.assert_(
- self.listen.expect(CLTool.STDOUT,
- "\ntest.int = int:6\n",
- 1))
-
- def testWaitForSubscribe(self):
- """
- Description
- Subscriber blocks until WaitForSubsciption returns
-
- Pre-conditions
- Provider started via context-provide tool.
- 1 data type supported int
-
- Steps
- Delete the property test.int
- Delay the provider
- Subscribe to the property test.int
- Subscriber blocks until the subscription is complete
-
- Post-conditions
- Kill provider
-
- References
- None
- """
- self.provider = CLTool("context-provide", "--v2","com.nokia.test",
- "int","test.int","1")
- self.provider.expect(CLTool.STDOUT, "Setting key: test.int", 10) # wait for it
- self.provider.send("dump")
- self.provider.expect(CLTool.STDOUT, "Wrote", 10) # wait for it
- self.provider.send("sleep 3")
- self.provider.expect(CLTool.STDOUT, "Sleep", 10) # wait for it
- self.listen = CLTool("context-listen")
- self.listen.send("new test.int")
- self.listen.send("waitforsubscription test.int")
-
- expected = ["\ntest.int = int:1\n",
- "\nwait finished for test.int\n"]
-
- # I don't get it quickly
- self.assertFalse(
- self.listen.expectAll(CLTool.STDOUT,
- expected,
- 1,
- False))
- # but get it after a while
- self.assert_(self.listen.expectAll(CLTool.STDOUT, expected, 5))
-
-class SubscriptionWaitError (unittest.TestCase):
- def testWaitForSubscribeFail(self):
- """
- Description
- Subscriber blocks until WaitForSubsciption returns, even if provider is not on DBus (specific to ContextKitPlugin)
-
- Pre-conditions
- Provider does exist for the property in the registry but it is not running
-
- Steps
- Subscribe and wait for the property
-
- Post-conditions
- The wait returned in 3 seconds (enough for testing that provider is not on D-Bus)
- """
- context_client = CLTool("context-listen")
- context_client.send("n test.nonexistent")
- context_client.send("w test.nonexistent")
-
- self.assert_(context_client.expect(CLTool.STDOUT,
- "wait finished for test.nonexistent",
- 3),
- "Wait for subscription is probably in a dead state")
- context_client.close()
-
-if __name__ == "__main__":
- sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 1)
- unittest.main()
diff --git a/libcontextsubscriber/customer-tests/testplugins/Makefile.am b/libcontextsubscriber/customer-tests/testplugins/Makefile.am
deleted file mode 100644
index c28eb314..00000000
--- a/libcontextsubscriber/customer-tests/testplugins/Makefile.am
+++ /dev/null
@@ -1,11 +0,0 @@
-SUBDIRS = timeplugin1 timeplugin2
-EXTRA_DIST = timeplugin.cpp timeplugin.h
-
-# they are needed for running ../pluginchanging tests locally
-all-local:
- ln -sf timeplugin1/.libs/contextsubscribertime1.so .
- ln -sf timeplugin2/.libs/contextsubscribertime2.so .
-
-clean-local:
- rm -f contextsubscribertime1.so
- rm -f contextsubscribertime2.so
diff --git a/libcontextsubscriber/customer-tests/testplugins/timeplugin.cpp b/libcontextsubscriber/customer-tests/testplugins/timeplugin.cpp
deleted file mode 100644
index 6e3c4df0..00000000
--- a/libcontextsubscriber/customer-tests/testplugins/timeplugin.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "timeplugin.h"
-#include "sconnect.h"
-
-#include "logging.h"
-
-#include <QDateTime>
-
-/// The factory method for constructing the IPropertyProvider instance.
-IProviderPlugin* pluginFactory(QString /*constructionString*/)
-{
- // Note: it's the caller's responsibility to delete the plugin if
- // needed.
- return new ContextSubscriberTime::TimePlugin();
-}
-
-namespace ContextSubscriberTime {
-
-TimePlugin::TimePlugin()
-{
- contextDebug();
- prefix = TIME_PLUGIN_PREFIX;
- timer.setInterval(2000);
- sconnect(&timer, SIGNAL(timeout()), this, SLOT(onTimeout()));
- QMetaObject::invokeMethod(this, "ready", Qt::QueuedConnection);
-}
-
-void TimePlugin::subscribe(QSet<QString> keys)
-{
- contextDebug() << keys;
- foreach(const QString& key, keys) {
- emit subscribeFinished(key);
- }
- timer.start();
-}
-
-void TimePlugin::unsubscribe(QSet<QString> keys)
-{
- timer.stop();
-}
-
-void TimePlugin::onTimeout()
-{
- contextDebug() << "Timeout";
- emit valueChanged("Test.Time", QDateTime::currentDateTime().toString().prepend(prefix));
-}
-
-} // end namespace
diff --git a/libcontextsubscriber/customer-tests/testplugins/timeplugin.h b/libcontextsubscriber/customer-tests/testplugins/timeplugin.h
deleted file mode 100644
index 3a51fb5a..00000000
--- a/libcontextsubscriber/customer-tests/testplugins/timeplugin.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-/*
-This is a test plugin for customer tests.
-*/
-
-#ifndef TIMEPLUGIN_H
-#define TIMEPLUGIN_H
-
-#include "iproviderplugin.h" // For IProviderPlugin definition
-#include <QTimer>
-
-using ContextSubscriber::IProviderPlugin;
-
-extern "C" {
- IProviderPlugin* pluginFactory(QString constructionString);
-}
-
-namespace ContextSubscriberTime
-{
-
-class TimePlugin : public IProviderPlugin
-{
- Q_OBJECT
-
-public:
- explicit TimePlugin();
- virtual void subscribe(QSet<QString> keys);
- virtual void unsubscribe(QSet<QString> keys);
-
-private slots:
- void onTimeout();
-
-private:
- QTimer timer;
- QString prefix;
-};
-}
-
-#endif
diff --git a/libcontextsubscriber/customer-tests/testplugins/timeplugin1/.gitignore b/libcontextsubscriber/customer-tests/testplugins/timeplugin1/.gitignore
deleted file mode 100644
index d79521dc..00000000
--- a/libcontextsubscriber/customer-tests/testplugins/timeplugin1/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-timeplugin.cpp
-timeplugin.h
diff --git a/libcontextsubscriber/customer-tests/testplugins/timeplugin1/Makefile.am b/libcontextsubscriber/customer-tests/testplugins/timeplugin1/Makefile.am
deleted file mode 100644
index 1bfee787..00000000
--- a/libcontextsubscriber/customer-tests/testplugins/timeplugin1/Makefile.am
+++ /dev/null
@@ -1,33 +0,0 @@
-plugindir = $(libdir)/contextkit/subscriber-test-plugins/
-plugin_LTLIBRARIES = contextsubscribertime1.la
-contextsubscribertime1_la_SOURCES = timeplugin.cpp timeplugin.h
-
-BUILT_SOURCES = $(contextsubscribertime1_la_SOURCES)
-timeplugin.cpp: ../timeplugin.cpp
- ln -sf $< $@
-timeplugin.h: ../timeplugin.h
- ln -sf $< $@
-
-clean-local:
- rm -f timeplugin.cpp timeplugin.h
-
-AM_CXXFLAGS = -I$(top_srcdir)/common \
- -I$(srcdir)/../../../src $(QtCore_CFLAGS) \
- $(QtDBus_CFLAGS) \
- '-DCONTEXT_LOG_MODULE_NAME="time1plugin"' \
- '-DTIME_PLUGIN_PREFIX="Time1: "'
-
-contextsubscribertime1_la_LDFLAGS = -avoid-version -module
-
-$(top_builddir)/common/libcommon.a:
- $(MAKE) -C $(top_builddir)/common libcommon.a
-
-LIBS += $(CDB_LIBS) $(QtCore_LIBS) $(QtDBus_LIBS)
-contextsubscribertime1_la_LIBADD=$(top_builddir)/common/libcommon.la
-
-.PHONY: $(top_builddir)/common/libcommon.la
-
-# moccing
-nodist_contextsubscribertime1_la_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(contextsubscribertime1_la_SOURCES))
-include $(top_srcdir)/am/qt.am
diff --git a/libcontextsubscriber/customer-tests/testplugins/timeplugin2/.gitignore b/libcontextsubscriber/customer-tests/testplugins/timeplugin2/.gitignore
deleted file mode 100644
index d79521dc..00000000
--- a/libcontextsubscriber/customer-tests/testplugins/timeplugin2/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-timeplugin.cpp
-timeplugin.h
diff --git a/libcontextsubscriber/customer-tests/testplugins/timeplugin2/Makefile.am b/libcontextsubscriber/customer-tests/testplugins/timeplugin2/Makefile.am
deleted file mode 100644
index 537159b0..00000000
--- a/libcontextsubscriber/customer-tests/testplugins/timeplugin2/Makefile.am
+++ /dev/null
@@ -1,33 +0,0 @@
-plugindir = $(libdir)/contextkit/subscriber-test-plugins/
-plugin_LTLIBRARIES = contextsubscribertime2.la
-contextsubscribertime2_la_SOURCES = timeplugin.cpp timeplugin.h
-
-BUILT_SOURCES = $(contextsubscribertime2_la_SOURCES)
-timeplugin.cpp: ../timeplugin.cpp
- ln -sf $< $@
-timeplugin.h: ../timeplugin.h
- ln -sf $< $@
-
-clean-local:
- rm -f timeplugin.cpp timeplugin.h
-
-AM_CXXFLAGS = -I$(top_srcdir)/common \
- -I$(srcdir)/../../../src $(QtCore_CFLAGS) \
- $(QtDBus_CFLAGS) \
- '-DCONTEXT_LOG_MODULE_NAME="time2plugin"' \
- '-DTIME_PLUGIN_PREFIX="Time2: "'
-
-contextsubscribertime2_la_LDFLAGS = -avoid-version -module
-
-$(top_builddir)/common/libcommon.a:
- $(MAKE) -C $(top_builddir)/common libcommon.a
-
-LIBS += $(CDB_LIBS) $(QtCore_LIBS) $(QtDBus_LIBS)
-contextsubscribertime2_la_LIBADD=$(top_builddir)/common/libcommon.la
-
-.PHONY: $(top_builddir)/common/libcommon.la
-
-# moccing
-nodist_contextsubscribertime2_la_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(contextsubscribertime2_la_SOURCES))
-include $(top_srcdir)/am/qt.am
diff --git a/libcontextsubscriber/customer-tests/tests.xml b/libcontextsubscriber/customer-tests/tests.xml
deleted file mode 100644
index 19d44ad8..00000000
--- a/libcontextsubscriber/customer-tests/tests.xml
+++ /dev/null
@@ -1,100 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<testdefinition version="0.1">
- <!-- Test suite, name mandatory - the same as test package name -->
- <suite name="libcontextsubscriber-tests">
- <!-- At least one set per suite, name and description mandatory -->
- <set name="libcontextsubscriber suite" description="libcontextsubscriber tests">
- <!-- Possibly some pre-steps to execute before running the test cases -->
- <pre_steps>
- </pre_steps>
- <!-- At least one case per set, name mandatory, description mandatory, other optional -->
- <case name="libsub001" description="This test verifies that the asynchronicity of the subscriber library" requirement="" timeout="20">
- <!-- At least one step per test, expected_result optional - tells which return code is considered passed -->
- <step expected_result="0">. /tmp/session_bus_address.user; export CONTEXT_PROVIDERS=.;cd /usr/share/libcontextsubscriber-tests/asynchronicity;python /usr/share/libcontextsubscriber-tests/asynchronicity/asynchronicity.py</step>
- </case>
- <!-- At least one case per set, name mandatory, description mandatory, other optional -->
- <case name="libsub002" description="This test verifies that properties are overriden by commander" requirement="" timeout="20">
- <!-- At least one step per test, expected_result optional - tells which return code is considered passed -->
- <step expected_result="0">. /tmp/session_bus_address.user;export CONTEXT_PROVIDERS=.;cd /usr/share/libcontextsubscriber-tests/commander;python /usr/share/libcontextsubscriber-tests/commander/commander_appearing.py</step>
- </case>
- <!-- At least one case per set, name mandatory, description mandatory, other optional -->
- <case name="libsub003" description="This test verifies that nonexistent properties are handled by commander" requirement="" timeout="20">
- <!-- At least one step per test, expected_result optional - tells which return code is considered passed -->
- <step expected_result="0">. /tmp/session_bus_address.user;export CONTEXT_PROVIDERS=.;cd /usr/share/libcontextsubscriber-tests/commander;python /usr/share/libcontextsubscriber-tests/commander/commander_nonexistent.py</step>
- </case>
- <!-- At least one case per set, name mandatory, description mandatory, other optional -->
- <case name="libsub004" description="This test verifies that disabling commander restore actual properties values" requirement="" timeout="20">
- <!-- At least one step per test, expected_result optional - tells which return code is considered passed -->
- <step expected_result="0">. /tmp/session_bus_address.user;export CONTEXT_PROVIDERS=.;cd /usr/share/libcontextsubscriber-tests/commander;python /usr/share/libcontextsubscriber-tests/commander/commander_disabled.py</step>
- </case>
- <!-- At least one case per set, name mandatory, description mandatory, other optional -->
- <case name="libsub005" description="getting info from introspection API" requirement="" timeout="20">
- <!-- At least one step per test, expected_result optional - tells which return code is considered passed -->
- <step expected_result="0">. /tmp/session_bus_address.user;export CONTEXT_PROVIDERS=.;cd /usr/share/libcontextsubscriber-tests/registry;python /usr/share/libcontextsubscriber-tests/registry/registry.py</step>
- </case>
- <case name="libsub006" description="This test verifies that subscription to properties" requirement="" timeout="20">
- <!-- At least one step per test, expected_result optional - tells which return code is considered passed -->
- <step expected_result="0">. /tmp/session_bus_address.user;export CONTEXT_PROVIDERS=.;cd /usr/share/libcontextsubscriber-tests/subscription;python /usr/share/libcontextsubscriber-tests/subscription/subscription.py Subscription.testValue</step>
- </case>
- <case name="libsub007" description="This test verifies that subscription to properties" requirement="" timeout="20">
- <!-- At least one step per test, expected_result optional - tells which return code is considered passed -->
- <step expected_result="0">. /tmp/session_bus_address.user;export CONTEXT_PROVIDERS=.;cd /usr/share/libcontextsubscriber-tests/subscription;python /usr/share/libcontextsubscriber-tests/subscription/subscription.py Subscription.testInfos</step>
- </case>
- <case name="libsub007b" description="Reading the type information from introspection" requirement="" timeout="20">
- <step expected_result="0">. /tmp/session_bus_address.user;export CONTEXT_PROVIDERS=.;cd /usr/share/libcontextsubscriber-tests/subscription;python /usr/share/libcontextsubscriber-tests/subscription/subscription.py Subscription.testTypes</step>
- </case>
- <case name="libsub007c" description="Reading the provider information from introspection" requirement="" timeout="20">
- <step expected_result="0">. /tmp/session_bus_address.user;export CONTEXT_PROVIDERS=.;cd /usr/share/libcontextsubscriber-tests/subscription;python /usr/share/libcontextsubscriber-tests/subscription/subscription.py Subscription.testProviders</step>
- </case>
- <case name="libsub008" description="This test verifies that subscription to properties" requirement="" timeout="20">
- <!-- At least one step per test, expected_result optional - tells which return code is considered passed -->
- <step expected_result="0">. /tmp/session_bus_address.user;export CONTEXT_PROVIDERS=.;cd /usr/share/libcontextsubscriber-tests/subscription;python /usr/share/libcontextsubscriber-tests/subscription/subscription.py Subscription.testAllDataTypes</step>
- </case>
- <!-- Environments optional - tells where the tests are run -->
- <case name="libsub009" description="This test verifies that subscription to properties" requirement="" timeout="20">
- <!-- At least one step per test, expected_result optional - tells which return code is considered passed -->
- <step expected_result="0">. /tmp/session_bus_address.user;export CONTEXT_PROVIDERS=.;cd /usr/share/libcontextsubscriber-tests/subscription;python /usr/share/libcontextsubscriber-tests/subscription/subscription.py Subscription.testTruthTypePermutations</step>
- </case>
- <case name="libsub010" description="This test verifies that subscription to properties" requirement="" timeout="20">
- <!-- At least one step per test, expected_result optional - tells which return code is considered passed -->
- <step expected_result="0">. /tmp/session_bus_address.user;export CONTEXT_PROVIDERS=.;cd /usr/share/libcontextsubscriber-tests/subscription;python /usr/share/libcontextsubscriber-tests/subscription/subscription.py Subscription.testStringTypePermutations</step>
- </case>
- <case name="libsub011" description="This test verifies that subscription to properties" requirement="" timeout="20">
- <!-- At least one step per test, expected_result optional - tells which return code is considered passed -->
- <step expected_result="0">. /tmp/session_bus_address.user;export CONTEXT_PROVIDERS=.;cd /usr/share/libcontextsubscriber-tests/subscription;python /usr/share/libcontextsubscriber-tests/subscription/subscription.py MultipleSubscribers.testInitialSubscription</step>
- </case>
- <case name="libsub012" description="This test verifies that subscription to properties" requirement="" timeout="20">
- <!-- At least one step per test, expected_result optional - tells which return code is considered passed -->
- <step expected_result="0">. /tmp/session_bus_address.user;export CONTEXT_PROVIDERS=.;cd /usr/share/libcontextsubscriber-tests/subscription;python /usr/share/libcontextsubscriber-tests/subscription/subscription.py MultipleSubscribers.testValueChanged</step>
- </case>
- <case name="libsub013" description="This test verifies that subscription to properties" requirement="" timeout="20">
- <!-- At least one step per test, expected_result optional - tells which return code is considered passed -->
- <step expected_result="0">. /tmp/session_bus_address.user;export CONTEXT_PROVIDERS=.;cd /usr/share/libcontextsubscriber-tests/subscription;python /usr/share/libcontextsubscriber-tests/subscription/subscription.py MultipleProviders.testTwoProviders</step>
- </case>
- <case name="libsub014" description="This test verifies that subscription to properties" requirement="" timeout="20">
- <!-- At least one step per test, expected_result optional - tells which return code is considered passed -->
- <step expected_result="0">. /tmp/session_bus_address.user;export CONTEXT_PROVIDERS=.;cd /usr/share/libcontextsubscriber-tests/subscription;python /usr/share/libcontextsubscriber-tests/subscription/subscription.py SubscriptionPause.testPause</step>
- </case>
- <case name="libsub015" description="This test verifies that subscription to properties" requirement="" timeout="20">
- <!-- At least one step per test, expected_result optional - tells which return code is considered passed -->
- <step expected_result="0">. /tmp/session_bus_address.user;export CONTEXT_PROVIDERS=.;cd /usr/share/libcontextsubscriber-tests/subscription;python /usr/share/libcontextsubscriber-tests/subscription/subscription.py SubscriptionPause.testWaitForSubscribe</step>
- </case>
- <case name="libsub016" description="Plugin loading of libcontextsubscriber" requirement="" timeout="20">
- <step expected_result="0">. /tmp/session_bus_address.user;export CONTEXT_PROVIDERS=.; cd /usr/share/libcontextsubscriber-tests/pluginchanging;python /usr/share/libcontextsubscriber-tests/pluginchanging/pluginchanging.py</step>
- </case>
- <case name="libsub017" description="Multiple providers"
- requirement="" timeout="20">
- <step expected_result="0">. /tmp/session_bus_address.user;export CONTEXT_PROVIDERS=.; cd /usr/share/libcontextsubscriber-tests/subscription; python multiprovider.py</step>
- </case>
- <case name="libsub018" description="Rapid changes"
- requirement="" timeout="20">
- <step expected_result="0">. /tmp/session_bus_address.user;export CONTEXT_PROVIDERS=.; cd /usr/share/libcontextsubscriber-tests/asynchronicity; python rapidchanges.py</step>
- </case>
-
- <environments>
- <scratchbox>false</scratchbox>
- <hardware>true</hardware>
- </environments>
- </set>
- </suite>
-</testdefinition>
diff --git a/libcontextsubscriber/customer-tests/update-contextkit-providers/.gitignore b/libcontextsubscriber/customer-tests/update-contextkit-providers/.gitignore
deleted file mode 100644
index 5d2eaf58..00000000
--- a/libcontextsubscriber/customer-tests/update-contextkit-providers/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-KEYS.actual
-cache.cdb
-
diff --git a/libcontextsubscriber/customer-tests/update-contextkit-providers/Battery.Charging_KEYDOC.expected b/libcontextsubscriber/customer-tests/update-contextkit-providers/Battery.Charging_KEYDOC.expected
deleted file mode 100644
index 6a9608c1..00000000
--- a/libcontextsubscriber/customer-tests/update-contextkit-providers/Battery.Charging_KEYDOC.expected
+++ /dev/null
Binary files differ
diff --git a/libcontextsubscriber/customer-tests/update-contextkit-providers/Battery.Charging_KEYTYPE.expected b/libcontextsubscriber/customer-tests/update-contextkit-providers/Battery.Charging_KEYTYPE.expected
deleted file mode 100644
index 3815ca9d..00000000
--- a/libcontextsubscriber/customer-tests/update-contextkit-providers/Battery.Charging_KEYTYPE.expected
+++ /dev/null
Binary files differ
diff --git a/libcontextsubscriber/customer-tests/update-contextkit-providers/Battery.Charging_PROVIDERS.expected b/libcontextsubscriber/customer-tests/update-contextkit-providers/Battery.Charging_PROVIDERS.expected
deleted file mode 100644
index b0e26196..00000000
--- a/libcontextsubscriber/customer-tests/update-contextkit-providers/Battery.Charging_PROVIDERS.expected
+++ /dev/null
Binary files differ
diff --git a/libcontextsubscriber/customer-tests/update-contextkit-providers/KEYS.expected b/libcontextsubscriber/customer-tests/update-contextkit-providers/KEYS.expected
deleted file mode 100644
index 063dd82a..00000000
--- a/libcontextsubscriber/customer-tests/update-contextkit-providers/KEYS.expected
+++ /dev/null
Binary files differ
diff --git a/libcontextsubscriber/customer-tests/update-contextkit-providers/Makefile.am b/libcontextsubscriber/customer-tests/update-contextkit-providers/Makefile.am
deleted file mode 100644
index 4c21ecea..00000000
--- a/libcontextsubscriber/customer-tests/update-contextkit-providers/Makefile.am
+++ /dev/null
@@ -1,13 +0,0 @@
-check-customer:
- $(MAKE) -C @abs_top_srcdir@ all
- ./test.sh
-
-clean-local:
- rm -f *.actual *.cdb
-
-EXTRA_DIST = test.sh \
- Battery.Charging_KEYDOC.expected \
- Battery.Charging_KEYTYPE.expected \
- KEYS.expected \
- providers1.context providers2.context \
- Battery.Charging_PROVIDERS.expected
diff --git a/libcontextsubscriber/customer-tests/update-contextkit-providers/providers1.context b/libcontextsubscriber/customer-tests/update-contextkit-providers/providers1.context
deleted file mode 100644
index 8b5d8aff..00000000
--- a/libcontextsubscriber/customer-tests/update-contextkit-providers/providers1.context
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0"?>
-<provider bus="session" service="org.freedesktop.ContextKit.contextd1">
- <key name="Battery.LowBattery">
- <type>TRUTH</type>
- <doc>
- This is true when battery is low
- </doc>
- </key>
-</provider>
diff --git a/libcontextsubscriber/customer-tests/update-contextkit-providers/providers2.context b/libcontextsubscriber/customer-tests/update-contextkit-providers/providers2.context
deleted file mode 100644
index b7117303..00000000
--- a/libcontextsubscriber/customer-tests/update-contextkit-providers/providers2.context
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0"?>
-<xml>
- <provider bus="system" service="org.freedesktop.ContextKit.contextd2">
- <key name="Battery.Charging">
- <type>TRUTH</type>
- <doc>
- This is true when battery is charging
- </doc>
- </key>
- </provider>
- <provider bus="system" service="org.freedesktop.ContextKit.contextd1">
- <key name="Battery.ChargePercentage">
- <type>INT</type>
- <doc>This is a charge percentage of the battery</doc>
- </key>
- </provider>
-</xml>
diff --git a/libcontextsubscriber/customer-tests/update-contextkit-providers/regen.sh b/libcontextsubscriber/customer-tests/update-contextkit-providers/regen.sh
deleted file mode 100755
index 9f28424d..00000000
--- a/libcontextsubscriber/customer-tests/update-contextkit-providers/regen.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/bash -e
-
-function regendb {
- cdb -q "cache.cdb" "$1" > "$2.expected"
-}
-
-export CONTEXT_CORE_DECLARATIONS=.
-../../update-contextkit-providers/update-contextkit-providers .
-
-regendb "KEYS" "KEYS"
-regendb "Battery.Charging:KEYTYPE" "Battery.Charging_KEYTYPE"
-regendb "Battery.Charging:KEYDOC" "Battery.Charging_KEYDOC"
-regendb "Battery.Charging:PROVIDERS" "Battery.Charging_PROVIDERS"
-echo "Regen succeeded!"
-exit 0
diff --git a/libcontextsubscriber/customer-tests/update-contextkit-providers/test.sh b/libcontextsubscriber/customer-tests/update-contextkit-providers/test.sh
deleted file mode 100755
index 7f800ce2..00000000
--- a/libcontextsubscriber/customer-tests/update-contextkit-providers/test.sh
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/bin/bash -e
-
-export CONTEXT_CORE_DECLARATIONS=/dev/null
-export CONTEXT_PROVIDERS=./
-
-# Remove all temp files
-function clean {
- `rm -f *.actual`
- `rm -f *.cdb`
-}
-
-# Compare file $1 to $2 and display diff if different
-function compare {
- f=`diff -u "$1" "$2"`
- if [ $? != 0 ] ; then
- echo "$1 and $2 differ!"
- echo "$f"
- clean
- exit 128
- fi
-}
-
-# Query the database $1 using the cdb tool and echo results to $1.actual
-function querydb {
- cdb -q "cache.cdb" "$1" > "$2.actual"
-}
-
-# Check the keys in the existing cache.cdb database
-function dotest {
- querydb "KEYS" "KEYS"
- compare "KEYS.expected" "KEYS.actual"
-
- querydb "Battery.Charging:KEYTYPE" "Battery.Charging_KEYTYPE"
- compare "Battery.Charging_KEYTYPE.expected" "Battery.Charging_KEYTYPE.actual"
-
- querydb "Battery.Charging:KEYDOC" "Battery.Charging_KEYDOC"
- compare "Battery.Charging_KEYDOC.expected" "Battery.Charging_KEYDOC.actual"
-
- querydb "Battery.Charging:PROVIDERS" "Battery.Charging_PROVIDERS"
- compare "Battery.Charging_PROVIDERS.expected" "Battery.Charging_PROVIDERS.actual"
-}
-
-# Ensure that the cache file permissions are ok
-function checkperm {
- perms=`stat -c %a cache.cdb`
- if [ "$perms" != "644" ] ; then
- echo "Permissions of cache.db are not 644!"
- clean
- exit 128
- fi
-}
-
-BASEDIR=`dirname $0`
-
-# Test using command line param
-export CONTEXT_PROVIDERS="/tmp/wrong/path"
-../../update-contextkit-providers/.libs/update-contextkit-providers "./"
-dotest
-checkperm
-clean
-
-# Test using env var
-export CONTEXT_PROVIDERS="./"
-../../update-contextkit-providers/.libs/update-contextkit-providers
-dotest
-checkperm
-clean
-
-echo "All ok!"
-exit 0
diff --git a/libcontextsubscriber/demo/README b/libcontextsubscriber/demo/README
deleted file mode 100644
index 4bade57b..00000000
--- a/libcontextsubscriber/demo/README
+++ /dev/null
@@ -1,27 +0,0 @@
-libcontextsubscriber is using only asynchronous DBUS calls to
-communicate with the providers/commander. Here is the process to
-demonstrate it.
-
-You will need 3 terminals, one for the context-listen, one for a "slow
-provider" and one for a "fast provider". Both of the providers will
-be emulated by using the flexiprovider.
-
-terminal all: start from the directory of this README file
-
-terminal fast> cd ../../python/
-terminal fast> ./context-provide com.nokia.fast int test.fast 316
-
-terminal slow> cd ../../python/
-terminal slow> ./context-provide com.nokia.slow int test.slow 530
-terminal slow (inside python)> import time; time.sleep(10)
-
-terminal cli> export CONTEXT_PROVIDERS=.
-terminal cli> ../cli/context-listen test.fast test.slow
-
-terminal fast (inside python)> set('test.fast', 613)
-
-On terminal cli, you will see that the fast property is received at
-start, the change to 613 is also immediately available, in spite of we
-are waiting for the slow provider's subscription object. After the
-sleep(10) is over in slow provider the initial value from there is
-also received.
diff --git a/libcontextsubscriber/demo/fast.context b/libcontextsubscriber/demo/fast.context
deleted file mode 100644
index df724b75..00000000
--- a/libcontextsubscriber/demo/fast.context
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0"?>
-<provider bus="session" service="com.nokia.fast">
- <key name="test.fast">
- <type>INT</type>
- <doc>A phony but very flexible property.</doc>
- </key>
-</provider>
diff --git a/libcontextsubscriber/demo/slow.context b/libcontextsubscriber/demo/slow.context
deleted file mode 100644
index c7d71858..00000000
--- a/libcontextsubscriber/demo/slow.context
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0"?>
-<provider bus="session" service="com.nokia.slow">
- <key name="test.slow">
- <type>INT</type>
- <doc>A phony but very flexible property.</doc>
- </key>
-</provider>
diff --git a/libcontextsubscriber/doc/Makefile.am b/libcontextsubscriber/doc/Makefile.am
deleted file mode 100644
index 627b7778..00000000
--- a/libcontextsubscriber/doc/Makefile.am
+++ /dev/null
@@ -1,23 +0,0 @@
-if CONTEXTKIT_BUILD_DOCS
-all-local: doxygen
-endif
-
-DOXYCFG = $(srcdir)/doxy.cfg
-
-doxygen:
- @if test x$(srcdir) = x. ; then \
- echo srcdir=$(srcdir) $(DOXYGEN) $(DOXYCFG); \
- srcdir=$(srcdir) $(DOXYGEN) $(DOXYCFG); \
- else \
- echo This is a VPATH build, so not building doxygen; \
- fi
-
-EXTRA_DIST = $(DOXYCFG) html
-
-distclean-local:
- rm -f doxygen.log
-
-maintainer-clean-local:
- rm -rf html
-
-.PHONY: doxygen
diff --git a/libcontextsubscriber/doc/doxy.cfg b/libcontextsubscriber/doc/doxy.cfg
deleted file mode 100644
index 5318846e..00000000
--- a/libcontextsubscriber/doc/doxy.cfg
+++ /dev/null
@@ -1,152 +0,0 @@
-PROJECT_NAME = libcontextsubscriber
-PROJECT_NUMBER =
-OUTPUT_DIRECTORY = .
-OUTPUT_LANGUAGE = English
-DISABLE_INDEX = NO
-EXTRACT_ALL = YES
-EXTRACT_PRIVATE = YES
-HIDE_UNDOC_MEMBERS = NO
-HIDE_UNDOC_CLASSES = NO
-HIDE_UNDOC_RELATIONS = YES
-BRIEF_MEMBER_DESC = YES
-REPEAT_BRIEF = YES
-ALWAYS_DETAILED_SEC = NO
-FULL_PATH_NAMES = NO
-STRIP_FROM_PATH =
-INTERNAL_DOCS = NO
-CLASS_DIAGRAMS = YES
-SOURCE_BROWSER = NO
-INLINE_SOURCES = NO
-STRIP_CODE_COMMENTS = YES
-CASE_SENSE_NAMES = NO
-VERBATIM_HEADERS = YES
-SHOW_INCLUDE_FILES = YES
-JAVADOC_AUTOBRIEF = YES
-INHERIT_DOCS = YES
-INLINE_INFO = YES
-SORT_MEMBER_DOCS = YES
-TAB_SIZE = 8
-ENABLED_SECTIONS =
-
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-QUIET = YES
-WARNINGS = YES
-WARN_IF_UNDOCUMENTED = YES
-WARN_FORMAT = "File: $file (row: $line) $text"
-WARN_LOGFILE = "doxygen.log"
-
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-
-#FILE_VERSION_FILTER = "git-log --pretty=format:%H -n 1"
-INPUT = $(srcdir)/../src/ $(srcdir)/../update-contextkit-providers/ $(srcdir)/../../common/
-FILE_PATTERNS = *.cpp *.h
-RECURSIVE = YES
-EXCLUDE =
-EXCLUDE_PATTERNS = moc_*.cpp *_p.h *_p.cpp ui_*.h *._*
-IMAGE_PATH =
-INPUT_FILTER =
-
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-ALPHABETICAL_INDEX = YES
-COLS_IN_ALPHA_INDEX = 5
-IGNORE_PREFIX =
-
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-GENERATE_TESTLIST = YES
-GENERATE_HTML = YES
-HTML_OUTPUT = html
-# HTML_HEADER = @srcdir@/header.html
-# HTML_FOOTER = @srcdir@/footer.html
-HTML_STYLESHEET =
-HTML_ALIGN_MEMBERS = YES
-GENERATE_HTMLHELP = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-GENERATE_LATEX = NO
-#LATEX_OUTPUT = latex
-#COMPACT_LATEX = NO
-#PAPER_TYPE = a4wide
-#EXTRA_PACKAGES =
-#LATEX_HEADER =
-#PDF_HYPERLINKS = NO
-#LATEX_BATCHMODE = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-GENERATE_RTF = NO
-#RTF_OUTPUT = rtf
-#COMPACT_RTF = NO
-#RTF_HYPERLINKS = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-GENERATE_MAN = NO
-#MAN_OUTPUT = man
-#MAN_EXTENSION = .3
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-ENABLE_PREPROCESSING = YES
-MACRO_EXPANSION = NO
-SEARCH_INCLUDES = YES
-INCLUDE_PATH =
-PREDEFINED = DOXYGEN_ONLY
-EXPAND_ONLY_PREDEF = YES
-
-#---------------------------------------------------------------------------
-# Configuration::addtions related to external references
-#---------------------------------------------------------------------------
-
-#TAGFILES = qt.tag
-# GENERATE_TAGFILE = YES
-#ALLEXTERNALS = NO
-#PERL_PATH = /scratchbox/tools/bin
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-HAVE_DOT = NO
-CLASS_GRAPH = NO
-COLLABORATION_GRAPH = NO
-INCLUDE_GRAPH = NO
-GRAPHICAL_HIERARCHY = NO
-#DOT_PATH = /scratchbox/devkits/doctools/bin/
-
-#---------------------------------------------------------------------------
-# Configuration::addtions related to the search engine
-#---------------------------------------------------------------------------
-
-SEARCHENGINE = NO
-#CGI_NAME = search.cgi
-#CGI_URL =
-#DOC_URL =
-#DOC_ABSPATH =
-#BIN_ABSPATH = /usr/local/bin/
-# EXT_DOC_PATHS =
-
-ALIASES += internal="\cond INTERNAL"
-ALIASES += internal_end="\endcond"
-
-ALIASES += reimp="\cond REIMPLEMENTATION"
-ALIASES += reimp_end="\endcond"
diff --git a/libcontextsubscriber/doc/lgpl-2.1.txt b/libcontextsubscriber/doc/lgpl-2.1.txt
deleted file mode 100644
index 5ab7695a..00000000
--- a/libcontextsubscriber/doc/lgpl-2.1.txt
+++ /dev/null
@@ -1,504 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
diff --git a/libcontextsubscriber/man/Makefile.am b/libcontextsubscriber/man/Makefile.am
deleted file mode 100644
index a4ab4fbf..00000000
--- a/libcontextsubscriber/man/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-dist_man_MANS = update-contextkit-providers.1 context-listen.1 context-print-info.1 context-ls.1
diff --git a/libcontextsubscriber/man/context-listen.1 b/libcontextsubscriber/man/context-listen.1
deleted file mode 100644
index dcce118e..00000000
--- a/libcontextsubscriber/man/context-listen.1
+++ /dev/null
@@ -1,55 +0,0 @@
-.TH context-listen 1 May-29-2009
-.SH NAME
-context-listen
-- a simple test client to listen to changes in context properties from different providers.
-.SH SYNOPSIS
-.B context-listen\fR [\fIPROPERTY\fR]...
-.SH DESCRIPTION
-context-listen will listen for changes in the properties and notify
-the user about them. At least one property has to be given. In order
-to find the appropriate provider for each of the properties
-context-listen reads the ./cache.cdb or if it doesn't
-exist then all the XML files in the present directory. Check
-libcontextprovider documentation for the format of these XML files and
-how to convert them to a cdb cache. Send EOF on stdin to terminate the
-running context-listen.
-.SH ENVIRONMENT VARIABLES
-.TP 8
-CONTEXT_CLI_DISABLE_TYPE_CHECK
-when defined context-listen will not croak about type mismatch
-between the expected and actual type.
-.TP 8
-CONTEXT_CLI_IGNORE_COMMANDER
-when defined context-listen will become immune to the commander,
-i.e. it will not be affected by context-commander at all.
-.TP 8
-CONTEXT_PROVIDERS
-may define a directory containing the provider descriptor cdb or XML
-files. If it is not set, a compiled-in registry prefix path will be used (usually
-/usr/share/contextkit/providers).
-.SH ARGUMENTS
-context-listen takes a list of properties as arguments.
-Properties are dot separated names, like Context.Location.Latitude.
-Obviously a property have to be provided by some provider to be any useful.
-.SH COMMAND LINE INTERFACE
-context-listen can be commanded on its standard input, the available
-commands can be seen at startup on stderr. All debugging/error messages
-are directed to stderr.
-.SH EXAMPLES
-.TP 8
-context-provide my.test.provider int mun.testi.property 42
-Creates a test provider with a single int property. Keep this running.
-.TP 8
-context-listen mun.testi.property
-starts context-listen listening for changes in the
-property 'mun.testi.property' from the
-provider 'my.test.provider'. This should be running in the same
-directory (from an other terminal) or CONTEXT_PROVIDERS should be set
-accordingly.
-.TP 8
-set('mun.testi.property', 59)
-The above command typed in the first terminal running context-provider
-will change the property and the change will be visible in the second
-terminal running context-listen.
-.SH SEE ALSO
-context-provide(1)
diff --git a/libcontextsubscriber/man/context-ls.1 b/libcontextsubscriber/man/context-ls.1
deleted file mode 100644
index 2addf463..00000000
--- a/libcontextsubscriber/man/context-ls.1
+++ /dev/null
@@ -1,34 +0,0 @@
-.TH context-ls 1 Sep-29-2009
-.SH NAME
-context-ls
-- inspects the context property registry.
-.SH SYNOPSIS
-.B context-ls [OPTIONS] [filter]
-.SH DESCRIPTION
-context-ls is a simple tool to introspect (inspect) the current context properties registry. It will list all the properties defined in the registry and optionally filter them through a regular expression. Additional parameters can be specified to tweak the output.
-.SH OPTIONS
-.TP 17
---xml, -x
-force the usage of the xml registry.
-.TP 17
---cdb, -c
-force the usage of the cdb (cached database) registry.
-.TP 17
---provided, -p
-show only the properties which are provided (have a defined provider).
-.TP 17
---long, -l
-long(detailed) listing format. If there are several providers for property, one line is printed per provider.
-.TP 17
---doc, -d
-print documentation of the property after the property.
-.TP 17
-filter
-limit the output to the entries matching the specified wildcard expression.
-.SH EXAMPLES
-.TP 8
-context-ls -l
-Creates long listing of all properties
-.TP 8
-context-ls -p 'Bl*'
-Creates short listing of all provided properties which name start with string 'Bl'.
diff --git a/libcontextsubscriber/man/context-print-info.1 b/libcontextsubscriber/man/context-print-info.1
deleted file mode 100644
index e924d00a..00000000
--- a/libcontextsubscriber/man/context-print-info.1
+++ /dev/null
@@ -1,21 +0,0 @@
-.TH context-print-info 1 July-03-2009
-.SH NAME
-context-print-info
-- a simple client to print out the registry information of given properties
-.SH SYNOPSIS
-.B context-print-info\fR [\fIPROPERTY\fR]...
-.SH DESCRIPTION
-context-print-info prints out the following information for the
-properties given as parameter: key, existence in registy, provider
-D-Bus type and name, and documentation.
-.SH ENVIRONMENT VARIABLES
-.TP 8
-CONTEXT_PROVIDERS
-may define a directory containing the provider descriptor cdb or XML
-files. If it is not set, a compiled-in registry prefix path will be used (usually
-/usr/share/contextkit/providers).
-.SH ARGUMENTS
-context-print-info takes a list of properties as arguments.
-Properties are dot separated names, like Context.Location.Latitude.
-.SH SEE ALSO
-context-listen(1)
diff --git a/libcontextsubscriber/man/update-contextkit-providers.1 b/libcontextsubscriber/man/update-contextkit-providers.1
deleted file mode 100644
index a5f7a9ab..00000000
--- a/libcontextsubscriber/man/update-contextkit-providers.1
+++ /dev/null
@@ -1,14 +0,0 @@
-.TH update-contextkit-providers 1 May-18-2009
-.SH NAME
-update-contextkit-providers
-- updates the cached cache.cdb context properties registry database.
-.SH SYNOPSIS
-.B update-contextkit-providers [directory]
-.SH DESCRIPTION
-update-contextkit-providers reads the context properties registry (in xml format) and produces an updated cached database - cache.cdb. The database is used by libcontextsubscrbier for quick introspection of the registry.
-.SH OPTIONS
-.TP 13
-directory
-the location containing the xml registry. The database will be written there.
-If no directory is specified, update-contextkit-providers will use the CONTEXT_PROVIDERS environment variable.
-If that is not preset as well, a compiled-in registry prefix path will be used (usually /usr/share/contextkit/providers).
diff --git a/libcontextsubscriber/multithreading-tests/Makefile.am b/libcontextsubscriber/multithreading-tests/Makefile.am
deleted file mode 100644
index 8da6191d..00000000
--- a/libcontextsubscriber/multithreading-tests/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = new-property-in-thread old-property-in-thread single-thread stress-test wait-for-subscription-only-in-thread wait-for-subscription-thread using-backend-from-thread
diff --git a/libcontextsubscriber/multithreading-tests/new-property-in-thread/.gitignore b/libcontextsubscriber/multithreading-tests/new-property-in-thread/.gitignore
deleted file mode 100644
index 4390dc85..00000000
--- a/libcontextsubscriber/multithreading-tests/new-property-in-thread/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-run-test
diff --git a/libcontextsubscriber/multithreading-tests/new-property-in-thread/Makefile.am b/libcontextsubscriber/multithreading-tests/new-property-in-thread/Makefile.am
deleted file mode 100644
index 6e80e6d8..00000000
--- a/libcontextsubscriber/multithreading-tests/new-property-in-thread/Makefile.am
+++ /dev/null
@@ -1,17 +0,0 @@
-noinst_PROGRAMS = run-test
-run_test_SOURCES = main.cpp thread.h
-
-AM_CXXFLAGS = $(QtCore_CFLAGS)
-LIBS += $(QtCore_LIBS)
-
-# library dependency hack for seamless make in cli/
-AM_CXXFLAGS += -I$(srcdir)/../../src
-run_test_LDADD = ../../src/libcontextsubscriber.la
-../../src/libcontextsubscriber.la:
- $(MAKE) -C ../../src libcontextsubscriber.la
-.PHONY: ../../src/libcontextsubscriber.la
-
-# moccing
-nodist_run_test_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(run_test_SOURCES))
-include $(top_srcdir)/am/qt.am
diff --git a/libcontextsubscriber/multithreading-tests/new-property-in-thread/main.cpp b/libcontextsubscriber/multithreading-tests/new-property-in-thread/main.cpp
deleted file mode 100644
index 3ab015fb..00000000
--- a/libcontextsubscriber/multithreading-tests/new-property-in-thread/main.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-#include <contextproperty.h>
-
-#include "thread.h"
-
-#include <QCoreApplication>
-#include <QThread>
-
-int main(int argc, char** argv)
-{
- QCoreApplication app(argc, argv);
-
- qDebug() << "MAIN THREAD:" << QCoreApplication::instance()->thread();
-
- // Start a thread which will create the ContextProperty.
- Thread thread;
- thread.start();
-
- return app.exec();
-}
-
diff --git a/libcontextsubscriber/multithreading-tests/new-property-in-thread/thread.h b/libcontextsubscriber/multithreading-tests/new-property-in-thread/thread.h
deleted file mode 100644
index dd9951b3..00000000
--- a/libcontextsubscriber/multithreading-tests/new-property-in-thread/thread.h
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef THREAD_H
-#define THREAD_H
-
-#include <contextproperty.h>
-
-#include <QThread>
-#include <QDebug>
-
-class Listener : public QObject
-{
- Q_OBJECT
-
-public:
- Listener()
- {
- cp = new ContextProperty("test.int");
- connect(cp, SIGNAL(valueChanged()), this, SLOT(onValueChanged()));
- }
-
- ContextProperty* cp;
-
-public slots:
- void onValueChanged()
- {
- qDebug() << "Listener::valueChanged(), and current thread is" << QThread::currentThread();
- qDebug() << "The value is:" << cp->value();
- exit(1);
- }
-};
-
-class Thread : public QThread
-{
- Q_OBJECT
-
-protected:
- void run()
- {
- qDebug() << "SUB THREAD:" << QThread::currentThread();
- Listener listener;
- exec();
- }
-
-};
-
-#endif
diff --git a/libcontextsubscriber/multithreading-tests/old-property-in-thread/.gitignore b/libcontextsubscriber/multithreading-tests/old-property-in-thread/.gitignore
deleted file mode 100644
index 4390dc85..00000000
--- a/libcontextsubscriber/multithreading-tests/old-property-in-thread/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-run-test
diff --git a/libcontextsubscriber/multithreading-tests/old-property-in-thread/Makefile.am b/libcontextsubscriber/multithreading-tests/old-property-in-thread/Makefile.am
deleted file mode 100644
index 6e80e6d8..00000000
--- a/libcontextsubscriber/multithreading-tests/old-property-in-thread/Makefile.am
+++ /dev/null
@@ -1,17 +0,0 @@
-noinst_PROGRAMS = run-test
-run_test_SOURCES = main.cpp thread.h
-
-AM_CXXFLAGS = $(QtCore_CFLAGS)
-LIBS += $(QtCore_LIBS)
-
-# library dependency hack for seamless make in cli/
-AM_CXXFLAGS += -I$(srcdir)/../../src
-run_test_LDADD = ../../src/libcontextsubscriber.la
-../../src/libcontextsubscriber.la:
- $(MAKE) -C ../../src libcontextsubscriber.la
-.PHONY: ../../src/libcontextsubscriber.la
-
-# moccing
-nodist_run_test_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(run_test_SOURCES))
-include $(top_srcdir)/am/qt.am
diff --git a/libcontextsubscriber/multithreading-tests/old-property-in-thread/main.cpp b/libcontextsubscriber/multithreading-tests/old-property-in-thread/main.cpp
deleted file mode 100644
index c21c9d7f..00000000
--- a/libcontextsubscriber/multithreading-tests/old-property-in-thread/main.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-#include <contextproperty.h>
-
-#include "thread.h"
-
-#include <QCoreApplication>
-#include <QDebug>
-
-int main(int argc, char** argv)
-{
- QCoreApplication app(argc, argv);
-
- qDebug() << "Main thread is" << QThread::currentThread();
-
- ContextProperty* cp = new ContextProperty("test.int");
- delete cp;
- // Creating a ContextProperty will result in creating a PropertyHandle,
- // and the PropertyHandle is not deleted ever.
-
- // Start a thread which will create the same ContextProperty.
- Thread thread;
- thread.start();
-
- return app.exec();
-}
-
diff --git a/libcontextsubscriber/multithreading-tests/old-property-in-thread/thread.h b/libcontextsubscriber/multithreading-tests/old-property-in-thread/thread.h
deleted file mode 100644
index ec84afdf..00000000
--- a/libcontextsubscriber/multithreading-tests/old-property-in-thread/thread.h
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef THREAD_H
-#define THREAD_H
-
-#include <contextproperty.h>
-
-#include <QThread>
-#include <QDebug>
-
-class Listener : public QObject
-{
- Q_OBJECT
-
-public:
- Listener()
- {
- cp = new ContextProperty("test.int");
- connect(cp, SIGNAL(valueChanged()), this, SLOT(onValueChanged()));
- }
-
- ContextProperty* cp;
-
-public slots:
- void onValueChanged()
- {
- qDebug() << "Listener::valueChanged(), and current thread is" << QThread::currentThread();
- qDebug() << "The value is:" << cp->value();
- exit(1);
- }
-};
-
-class Thread : public QThread
-{
- Q_OBJECT
-
-protected:
- void run()
- {
- qDebug() << "Thread::run(), and current thread is" << QThread::currentThread();
- Listener listener;
- exec();
- }
-
-};
-
-#endif
diff --git a/libcontextsubscriber/multithreading-tests/single-thread/.gitignore b/libcontextsubscriber/multithreading-tests/single-thread/.gitignore
deleted file mode 100644
index 4390dc85..00000000
--- a/libcontextsubscriber/multithreading-tests/single-thread/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-run-test
diff --git a/libcontextsubscriber/multithreading-tests/single-thread/Makefile.am b/libcontextsubscriber/multithreading-tests/single-thread/Makefile.am
deleted file mode 100644
index 3cec50b8..00000000
--- a/libcontextsubscriber/multithreading-tests/single-thread/Makefile.am
+++ /dev/null
@@ -1,17 +0,0 @@
-noinst_PROGRAMS = run-test
-run_test_SOURCES = main.cpp listener.h
-
-AM_CXXFLAGS = $(QtCore_CFLAGS)
-LIBS += $(QtCore_LIBS)
-
-# library dependency hack for seamless make in cli/
-AM_CXXFLAGS += -I$(srcdir)/../../src
-run_test_LDADD = ../../src/libcontextsubscriber.la
-../../src/libcontextsubscriber.la:
- $(MAKE) -C ../../src libcontextsubscriber.la
-.PHONY: ../../src/libcontextsubscriber.la
-
-# moccing
-nodist_run_test_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(run_test_SOURCES))
-include $(top_srcdir)/am/qt.am
diff --git a/libcontextsubscriber/multithreading-tests/single-thread/listener.h b/libcontextsubscriber/multithreading-tests/single-thread/listener.h
deleted file mode 100644
index 9980f62a..00000000
--- a/libcontextsubscriber/multithreading-tests/single-thread/listener.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef LISTENER_H
-#define LISTENER_H
-
-#include <contextproperty.h>
-
-#include <QDebug>
-
-class Listener : public QObject
-{
- Q_OBJECT
-
-public:
- Listener()
- {
- cp = new ContextProperty("test.int");
- connect(cp, SIGNAL(valueChanged()), this, SLOT(onValueChanged()));
- }
-
- ContextProperty* cp;
-
-public slots:
- void onValueChanged()
- {
- qDebug() << "Listener::valueChanged()";
- qDebug() << "The value is:" << cp->value();
- exit(1);
- }
-};
-
-#endif
diff --git a/libcontextsubscriber/multithreading-tests/single-thread/main.cpp b/libcontextsubscriber/multithreading-tests/single-thread/main.cpp
deleted file mode 100644
index 16dd2f65..00000000
--- a/libcontextsubscriber/multithreading-tests/single-thread/main.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <contextproperty.h>
-
-#include "listener.h"
-
-#include <QCoreApplication>
-
-
-int main(int argc, char** argv)
-{
- QCoreApplication app(argc, argv);
-
- Listener listener;
-
- return app.exec();
-}
diff --git a/libcontextsubscriber/multithreading-tests/stress-test/.gitignore b/libcontextsubscriber/multithreading-tests/stress-test/.gitignore
deleted file mode 100644
index e08dedad..00000000
--- a/libcontextsubscriber/multithreading-tests/stress-test/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-run-test
-cache.cdb
diff --git a/libcontextsubscriber/multithreading-tests/stress-test/1provider.cdb b/libcontextsubscriber/multithreading-tests/stress-test/1provider.cdb
deleted file mode 100644
index 58655ef3..00000000
--- a/libcontextsubscriber/multithreading-tests/stress-test/1provider.cdb
+++ /dev/null
Binary files differ
diff --git a/libcontextsubscriber/multithreading-tests/stress-test/2providers.cdb b/libcontextsubscriber/multithreading-tests/stress-test/2providers.cdb
deleted file mode 100644
index 98324d4c..00000000
--- a/libcontextsubscriber/multithreading-tests/stress-test/2providers.cdb
+++ /dev/null
Binary files differ
diff --git a/libcontextsubscriber/multithreading-tests/stress-test/Makefile.am b/libcontextsubscriber/multithreading-tests/stress-test/Makefile.am
deleted file mode 100644
index 6e80e6d8..00000000
--- a/libcontextsubscriber/multithreading-tests/stress-test/Makefile.am
+++ /dev/null
@@ -1,17 +0,0 @@
-noinst_PROGRAMS = run-test
-run_test_SOURCES = main.cpp thread.h
-
-AM_CXXFLAGS = $(QtCore_CFLAGS)
-LIBS += $(QtCore_LIBS)
-
-# library dependency hack for seamless make in cli/
-AM_CXXFLAGS += -I$(srcdir)/../../src
-run_test_LDADD = ../../src/libcontextsubscriber.la
-../../src/libcontextsubscriber.la:
- $(MAKE) -C ../../src libcontextsubscriber.la
-.PHONY: ../../src/libcontextsubscriber.la
-
-# moccing
-nodist_run_test_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(run_test_SOURCES))
-include $(top_srcdir)/am/qt.am
diff --git a/libcontextsubscriber/multithreading-tests/stress-test/main.cpp b/libcontextsubscriber/multithreading-tests/stress-test/main.cpp
deleted file mode 100644
index d7c334bd..00000000
--- a/libcontextsubscriber/multithreading-tests/stress-test/main.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "thread.h"
-#include <QCoreApplication>
-
-int main(int argc, char** argv)
-{
- QCoreApplication app(argc, argv);
-
- int maxTasks = 0;
- int maxTasks2 = 0;
- int task = -1;
-
- if (argc > 1 && atoi(argv[1]) > 0)
- maxTasks = atoi(argv[1]);
- if (argc > 2 && atoi(argv[2]) > 0)
- maxTasks2 = atoi(argv[2]);
- if (argc > 3 && atoi(argv[3]) > 0)
- task = atoi(argv[3]);
-
- TestRunner tests(maxTasks, "test.int", task);
- TestRunner tests2(maxTasks2, "test2.int", task);
-
- return app.exec();
-}
diff --git a/libcontextsubscriber/multithreading-tests/stress-test/provider.py b/libcontextsubscriber/multithreading-tests/stress-test/provider.py
deleted file mode 100755
index 748929a4..00000000
--- a/libcontextsubscriber/multithreading-tests/stress-test/provider.py
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/python
-"""A test provider for the stress testing."""
-
-
-# change registry this often [msec]
-registryChangeTimeout = 2017
-
-
-from ContextKit.flexiprovider import *
-import gobject
-import time
-import os
-
-def update():
- t = time.time()
- dt = int(1000*(t - round(t)))
- gobject.timeout_add(1000 - dt, update)
- v = int(round(t))
- fp.set('test.int', v)
- fp.set('test.int2', v)
- print t
- return False
-
-pcnt = 0
-def chgRegistry():
- global pcnt
- pcnt += 1
- if pcnt % 2:
- print "1 provider"
- os.system('cp 1provider.cdb tmp.cdb; mv tmp.cdb cache.cdb')
- else:
- print "2 providers"
- os.system('cp 2providers.cdb tmp.cdb; mv tmp.cdb cache.cdb')
- return True
-
-
-gobject.timeout_add(1000, update)
-# uncoment this to see the "Bus error" XXX
-gobject.timeout_add(registryChangeTimeout, chgRegistry)
-
-fp = Flexiprovider([INT('test.int'), INT('test.int2')], 'my.test.provider', 'session')
-fp.run()
diff --git a/libcontextsubscriber/multithreading-tests/stress-test/runme.sh b/libcontextsubscriber/multithreading-tests/stress-test/runme.sh
deleted file mode 100755
index a2aa73d6..00000000
--- a/libcontextsubscriber/multithreading-tests/stress-test/runme.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-# RunMe & ReadMe
-#
-# provider.py will run flexiprovider and update test.int every second to the POSIX time.
-# Additionally, it will change the registry every two seconds.
-#
-# stress-test takes two int arguments: the number of threads using the first and the second provider.
-#
-# Compiling: for now, use qmake & make. Sorry.
-
-#xterm -e 'rlwrap ../../../python/context-provide my.test.provider int test.int 0 int test.int2 0' &
-#xterm -e 'rlwrap ../../../python/context-provide my.test2.provider int test2.int 0 int test2.int2 0' &
-
-xterm -e './provider.py' &
-CONTEXT_PROVIDERS=../stress-test/ ./run-test 3 3
diff --git a/libcontextsubscriber/multithreading-tests/stress-test/thread.h b/libcontextsubscriber/multithreading-tests/stress-test/thread.h
deleted file mode 100644
index 44cbf7c8..00000000
--- a/libcontextsubscriber/multithreading-tests/stress-test/thread.h
+++ /dev/null
@@ -1,135 +0,0 @@
-#ifndef STRESS_H
-#define STRESS_H
-
-#include <contextproperty.h>
-
-#include <time.h>
-#include <QThread>
-#include <QDebug>
-
-#define NUM_TESTS 9
-
-/*
- * A thread doing something with a ContextProperty.
- *
- * First creates a ContextProperty tracking \c propertyName, then does some simple thing
- * with it based on the \c task number, then finally the ContextProperty is deleted.
- */
-class Thread : public QThread
-{
- Q_OBJECT
-
-public:
- Thread(const int task, const QString& propertyName) : task(task), propertyName(propertyName) {};
-
-protected:
- void run() {
- // create property do something and delete it
- ContextProperty* cp = new ContextProperty(propertyName);
- int value, realValue;
-
- switch (task) {
- case 1: // check value
- cp->waitForSubscription();
- value = cp->value().toInt();
- realValue = time(0);
- if (value != realValue && value != 0) {
- msleep(100); // give it 0.1 sec to arrive
- value = cp->value().toInt();
- if (value != realValue && value != 0)
- qDebug() << "*** value mismatch:" << propertyName << value << realValue;
- }
- break;
-
- case 2: // wait 0-2000 msec before deleting
- msleep(qrand()%2000);
- break;
-
- case 3: // unsubscribe
- cp->unsubscribe();
- break;
-
- case 4: // unsubscribe and wait a bit
- cp->unsubscribe();
- msleep(qrand()%2000);
- break;
-
- case 5: // unsubscribe and subscribe
- cp->unsubscribe();
- cp->subscribe();
- break;
-
- case 6: // unsubscribe, wait a bit then subscribe and wait some more
- cp->unsubscribe();
- msleep(qrand()%2000);
- cp->subscribe();
- msleep(qrand()%2000);
- break;
-
- case 7: // subscribe
- cp->subscribe();
- break;
-
- case 8: // subscribe
- msleep(qrand()%100);
- cp->subscribe();
- msleep(qrand()%100);
- break;
-
- default:; // just create and delete
- }
-
- delete(cp);
- exit();
- }
-
-private:
- int task;
- QString propertyName;
-
-};
-
-
-/*
- * Starts \c maxThreads number of threads doing simple tests wit ContextProperty \c propertyName
- * until stopped. The tasks are choosen randomly with equal weight. Whenever a thread stops
- * an other one will start, ad infinitum.
- */
-class TestRunner : public QObject
-{
- Q_OBJECT
-
-private:
- int maxThreads;
- QSet<Thread*> threads;
- QString propertyName;
- int count;
- int defaultTask;
-
-public:
- TestRunner(const int maxThreads, const QString& propertyName, int task = -1) :
- maxThreads(maxThreads), propertyName(propertyName), count(0), defaultTask(task) {
- for (int i = 0; i < maxThreads; i++)
- addThread();
- }
-
- void addThread() {
- int task = defaultTask != -1 ? defaultTask : qrand() % NUM_TESTS ;
- qDebug() << "** starting" << propertyName << task << "/" << ++count;
- Thread* t = new Thread(task, propertyName);
- QObject::connect(t, SIGNAL(finished()), this, SLOT(onThreadFinished()));
- threads.insert(t);
- t->start();
- }
-
-public slots:
- void onThreadFinished() {
- Thread* t = (Thread*) QObject::sender();
- if (threads.remove(t)) {
- delete t;
- addThread();
- }
- }
-};
-
-#endif
diff --git a/libcontextsubscriber/multithreading-tests/using-backend-from-thread/.gitignore b/libcontextsubscriber/multithreading-tests/using-backend-from-thread/.gitignore
deleted file mode 100644
index 4390dc85..00000000
--- a/libcontextsubscriber/multithreading-tests/using-backend-from-thread/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-run-test
diff --git a/libcontextsubscriber/multithreading-tests/using-backend-from-thread/Makefile.am b/libcontextsubscriber/multithreading-tests/using-backend-from-thread/Makefile.am
deleted file mode 100644
index b5883842..00000000
--- a/libcontextsubscriber/multithreading-tests/using-backend-from-thread/Makefile.am
+++ /dev/null
@@ -1,17 +0,0 @@
-noinst_PROGRAMS = run-test
-run_test_SOURCES = main.cpp thread.h
-
-AM_CXXFLAGS = $(QtCore_CFLAGS) $(QtDBus_CFLAGS)
-LIBS += $(QtCore_LIBS) $(QtDBus_LIBS)
-
-# library dependency hack for seamless make in cli/
-AM_CXXFLAGS += -I$(srcdir)/../../src
-run_test_LDADD = ../../src/libcontextsubscriber.la
-../../src/libcontextsubscriber.la:
- $(MAKE) -C ../../src libcontextsubscriber.la
-.PHONY: ../../src/libcontextsubscriber.la
-
-# moccing
-nodist_run_test_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(run_test_SOURCES))
-include $(top_srcdir)/am/qt.am
diff --git a/libcontextsubscriber/multithreading-tests/using-backend-from-thread/main.cpp b/libcontextsubscriber/multithreading-tests/using-backend-from-thread/main.cpp
deleted file mode 100644
index a6a7c8aa..00000000
--- a/libcontextsubscriber/multithreading-tests/using-backend-from-thread/main.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-#include <contextproperty.h>
-
-#include "thread.h"
-
-#include <QCoreApplication>
-#include <QDebug>
-
-int main(int argc, char** argv)
-{
- QCoreApplication app(argc, argv);
-
- qDebug() << "Main thread is" << QThread::currentThread();
-
- // Start a thread which will use the backend
- Thread* thread = new Thread();
- thread->start();
-
- thread->wait();
- // Kill the thread
- qDebug() << "Thread stopped, deleting it";
- delete thread;
- qDebug() << "Entering main event loop";
-
- return app.exec();
-}
diff --git a/libcontextsubscriber/multithreading-tests/using-backend-from-thread/thread.h b/libcontextsubscriber/multithreading-tests/using-backend-from-thread/thread.h
deleted file mode 100644
index cd77a298..00000000
--- a/libcontextsubscriber/multithreading-tests/using-backend-from-thread/thread.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef THREAD_H
-#define THREAD_H
-
-#include <contextproperty.h>
-#include <contextpropertyinfo.h>
-
-#include <QThread>
-#include <QDebug>
-
-class Listener : public QObject
-{
- Q_OBJECT
-
-public:
- Listener()
- {
- cp = new ContextProperty("test.int");
- qDebug() << "Provider is: " << cp->info()->providerDBusName();
- }
-
- ContextProperty* cp;
-};
-
-class Thread : public QThread
-{
- Q_OBJECT
-
-protected:
- void run()
- {
- qDebug() << "Thread::run(), and current thread is" << QThread::currentThread();
- Listener listener;
-
- qDebug() << "Returning from run";
- }
-
-};
-
-#endif
diff --git a/libcontextsubscriber/multithreading-tests/wait-for-subscription-only-in-thread/.gitignore b/libcontextsubscriber/multithreading-tests/wait-for-subscription-only-in-thread/.gitignore
deleted file mode 100644
index 4390dc85..00000000
--- a/libcontextsubscriber/multithreading-tests/wait-for-subscription-only-in-thread/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-run-test
diff --git a/libcontextsubscriber/multithreading-tests/wait-for-subscription-only-in-thread/Makefile.am b/libcontextsubscriber/multithreading-tests/wait-for-subscription-only-in-thread/Makefile.am
deleted file mode 100644
index 6e80e6d8..00000000
--- a/libcontextsubscriber/multithreading-tests/wait-for-subscription-only-in-thread/Makefile.am
+++ /dev/null
@@ -1,17 +0,0 @@
-noinst_PROGRAMS = run-test
-run_test_SOURCES = main.cpp thread.h
-
-AM_CXXFLAGS = $(QtCore_CFLAGS)
-LIBS += $(QtCore_LIBS)
-
-# library dependency hack for seamless make in cli/
-AM_CXXFLAGS += -I$(srcdir)/../../src
-run_test_LDADD = ../../src/libcontextsubscriber.la
-../../src/libcontextsubscriber.la:
- $(MAKE) -C ../../src libcontextsubscriber.la
-.PHONY: ../../src/libcontextsubscriber.la
-
-# moccing
-nodist_run_test_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(run_test_SOURCES))
-include $(top_srcdir)/am/qt.am
diff --git a/libcontextsubscriber/multithreading-tests/wait-for-subscription-only-in-thread/main.cpp b/libcontextsubscriber/multithreading-tests/wait-for-subscription-only-in-thread/main.cpp
deleted file mode 100644
index 1a1727b7..00000000
--- a/libcontextsubscriber/multithreading-tests/wait-for-subscription-only-in-thread/main.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-#include <contextproperty.h>
-
-#include "thread.h"
-
-#include <QCoreApplication>
-#include <QThread>
-
-int main(int argc, char** argv)
-{
- QCoreApplication app(argc, argv);
-
- qDebug() << "MAIN THREAD:" << QCoreApplication::instance()->thread();
-
- // Start a thread which will create the ContextProperty.
- Thread thread;
- thread.start();
-
- qDebug() << "Entering main loop";
- return app.exec();
-}
diff --git a/libcontextsubscriber/multithreading-tests/wait-for-subscription-only-in-thread/thread.h b/libcontextsubscriber/multithreading-tests/wait-for-subscription-only-in-thread/thread.h
deleted file mode 100644
index e92af6f2..00000000
--- a/libcontextsubscriber/multithreading-tests/wait-for-subscription-only-in-thread/thread.h
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef THREAD_H
-#define THREAD_H
-
-#include <contextproperty.h>
-
-#include <QThread>
-#include <QDebug>
-
-class Listener : public QObject
-{
- Q_OBJECT
-
-public:
- Listener()
- {
- cp = new ContextProperty("test.int");
- connect(cp, SIGNAL(valueChanged()), this, SLOT(onValueChanged()));
- qDebug() << "**** Starting to wait";
- cp->waitForSubscription();
- qDebug() << "**** Waiting is done";
- qDebug() << "After waiting, the value is" << cp->value();
- sleep(1);
- qDebug() << "After waiting 1 s more, the value is" << cp->value();
-
- }
-
- ContextProperty* cp;
-
-public slots:
- void onValueChanged()
- {
- qDebug() << "Listener::valueChanged(), and current thread is" << QThread::currentThread();
- qDebug() << "The value is:" << cp->value();
-// exit(1);
- }
-};
-
-class Thread : public QThread
-{
- Q_OBJECT
-
-protected:
- void run()
- {
- qDebug() << "SUB THREAD:" << QThread::currentThread();
- Listener listener;
- exec();
- }
-
-};
-
-#endif
diff --git a/libcontextsubscriber/multithreading-tests/wait-for-subscription-thread/.gitignore b/libcontextsubscriber/multithreading-tests/wait-for-subscription-thread/.gitignore
deleted file mode 100644
index 4390dc85..00000000
--- a/libcontextsubscriber/multithreading-tests/wait-for-subscription-thread/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-run-test
diff --git a/libcontextsubscriber/multithreading-tests/wait-for-subscription-thread/Makefile.am b/libcontextsubscriber/multithreading-tests/wait-for-subscription-thread/Makefile.am
deleted file mode 100644
index 6e80e6d8..00000000
--- a/libcontextsubscriber/multithreading-tests/wait-for-subscription-thread/Makefile.am
+++ /dev/null
@@ -1,17 +0,0 @@
-noinst_PROGRAMS = run-test
-run_test_SOURCES = main.cpp thread.h
-
-AM_CXXFLAGS = $(QtCore_CFLAGS)
-LIBS += $(QtCore_LIBS)
-
-# library dependency hack for seamless make in cli/
-AM_CXXFLAGS += -I$(srcdir)/../../src
-run_test_LDADD = ../../src/libcontextsubscriber.la
-../../src/libcontextsubscriber.la:
- $(MAKE) -C ../../src libcontextsubscriber.la
-.PHONY: ../../src/libcontextsubscriber.la
-
-# moccing
-nodist_run_test_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(run_test_SOURCES))
-include $(top_srcdir)/am/qt.am
diff --git a/libcontextsubscriber/multithreading-tests/wait-for-subscription-thread/main.cpp b/libcontextsubscriber/multithreading-tests/wait-for-subscription-thread/main.cpp
deleted file mode 100644
index 44390e2d..00000000
--- a/libcontextsubscriber/multithreading-tests/wait-for-subscription-thread/main.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-#include <contextproperty.h>
-
-#include "thread.h"
-
-#include <QCoreApplication>
-#include <QThread>
-
-int main(int argc, char** argv)
-{
- QCoreApplication app(argc, argv);
-
- qDebug() << "MAIN THREAD:" << QCoreApplication::instance()->thread();
-
- // Start a thread which will create the ContextProperty.
- Thread thread;
- thread.start();
-
- sleep(2);
- ContextProperty *cp = new ContextProperty("test.int");
- cp->waitForSubscription();
- qDebug() << "waiting is done in the main";
-
- return app.exec();
-}
-
diff --git a/libcontextsubscriber/multithreading-tests/wait-for-subscription-thread/thread.h b/libcontextsubscriber/multithreading-tests/wait-for-subscription-thread/thread.h
deleted file mode 100644
index 7766fe68..00000000
--- a/libcontextsubscriber/multithreading-tests/wait-for-subscription-thread/thread.h
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef THREAD_H
-#define THREAD_H
-
-#include <contextproperty.h>
-
-#include <QThread>
-#include <QDebug>
-
-class Listener : public QObject
-{
- Q_OBJECT
-
-public:
- Listener()
- {
- cp = new ContextProperty("test.int");
- connect(cp, SIGNAL(valueChanged()), this, SLOT(onValueChanged()));
- cp->waitForSubscription();
- qDebug() << "Waiting is done";
- }
-
- ContextProperty* cp;
-
-public slots:
- void onValueChanged()
- {
- qDebug() << "Listener::valueChanged(), and current thread is" << QThread::currentThread();
- qDebug() << "The value is:" << cp->value();
-// exit(1);
- }
-};
-
-class Thread : public QThread
-{
- Q_OBJECT
-
-protected:
- void run()
- {
- qDebug() << "SUB THREAD:" << QThread::currentThread();
- Listener listener;
- exec();
- }
-
-};
-
-#endif
diff --git a/libcontextsubscriber/sandbox/messaging-to-self/main.cpp b/libcontextsubscriber/sandbox/messaging-to-self/main.cpp
deleted file mode 100644
index aafda83c..00000000
--- a/libcontextsubscriber/sandbox/messaging-to-self/main.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-#include <QCoreApplication>
-#include <QDebug>
-#include <QThread>
-#include "myobject.h"
-#include "mythread.h"
-
-int main(int argc, char **argv)
-{
- QCoreApplication app(argc, argv);
-
- qDebug() << "main thread:" << QThread::currentThread();
-
- MyObject a;
- MyThread t(&a);
- t.start();
-
-// sleep(1);
-
- return app.exec();
-}
diff --git a/libcontextsubscriber/sandbox/messaging-to-self/messaging-to-self.pro b/libcontextsubscriber/sandbox/messaging-to-self/messaging-to-self.pro
deleted file mode 100644
index bafbb027..00000000
--- a/libcontextsubscriber/sandbox/messaging-to-self/messaging-to-self.pro
+++ /dev/null
@@ -1,12 +0,0 @@
-######################################################################
-# Automatically generated by qmake (2.01a) Mon Jun 15 11:49:08 2009
-######################################################################
-
-TEMPLATE = app
-TARGET =
-DEPENDPATH += .
-INCLUDEPATH += .
-
-# Input
-HEADERS += myobject.h mythread.h queuedinvoker.h
-SOURCES += main.cpp queuedinvoker.cpp
diff --git a/libcontextsubscriber/sandbox/messaging-to-self/myobject.h b/libcontextsubscriber/sandbox/messaging-to-self/myobject.h
deleted file mode 100644
index 155ebf3b..00000000
--- a/libcontextsubscriber/sandbox/messaging-to-self/myobject.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef MYOBJECT_H
-#define MYOBJECT_H
-
-#include "queuedinvoker.h"
-#include <QDebug>
-#include <QThread>
-
-class MyObject : public QueuedInvoker
-{
- Q_OBJECT
-
-private:
- int x;
-
-public:
- MyObject() : x(0)
- {
- }
-
- Q_INVOKABLE void five()
- {
- qDebug() << "MyObject::five" << QThread::currentThread() << ++x;
- }
- Q_INVOKABLE void six()
- {
- qDebug() << "MyObject::six" << QThread::currentThread() << ++x;
- }
- Q_INVOKABLE void seven()
- {
- qDebug() << "MyObject::seven" << QThread::currentThread() << ++x;
- }
-};
-#endif
-
-
diff --git a/libcontextsubscriber/sandbox/messaging-to-self/mythread.h b/libcontextsubscriber/sandbox/messaging-to-self/mythread.h
deleted file mode 100644
index 4170ccf8..00000000
--- a/libcontextsubscriber/sandbox/messaging-to-self/mythread.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef MYTHREAD_H
-#define MYTHREAD_H
-
-#include <QThread>
-#include <QDebug>
-#include "myobject.h"
-
-class MyThread : public QThread
-{
- Q_OBJECT
-
-private:
- MyObject *obj;
-
-public:
- MyThread(MyObject *obj) : obj(obj)
- {
- }
-
-protected:
- void run()
- {
- qDebug() << QThread::currentThread();
- obj->queueOnce("five");
- obj->queueOnce("six");
- obj->queueOnce("five");
- obj->queueOnce("five");
- obj->queueOnce("six");
- obj->queueOnce("seven");
- }
-};
-#endif
diff --git a/libcontextsubscriber/sandbox/messaging-to-self/queuedinvoker.cpp b/libcontextsubscriber/sandbox/messaging-to-self/queuedinvoker.cpp
deleted file mode 100644
index 85dbb7d1..00000000
--- a/libcontextsubscriber/sandbox/messaging-to-self/queuedinvoker.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-#include "queuedinvoker.h"
-
-#include <QMetaObject>
-#include <QThread>
-#include <QDebug>
-#include <QMutexLocker>
-
-QueuedInvoker::QueuedInvoker()
-{
- connect(this, SIGNAL(queuedCall(const char *)),
- this, SLOT(onQueuedCall(const char *)),
- Qt::QueuedConnection);
-}
-
-void QueuedInvoker::onQueuedCall(const char *method)
-{
- QMutexLocker locker(&callQueueLock);
- callQueue.remove(method);
- qDebug() << "Hope that i'm in the main loop" << QThread::currentThread();
- locker.unlock();
- if (!QMetaObject::invokeMethod(this, method, Qt::DirectConnection)) {
- qFatal(" *****************\n"
- "Erroneous usage of queueOnce(%s)\n"
- " *****************\n", method);
- }
-}
-
-void QueuedInvoker::queueOnce(const char *method)
-{
- QMutexLocker locker(&callQueueLock);
- if (!callQueue.contains(method)) {
- emit queuedCall(method);
- callQueue.insert(method);
- }
-}
diff --git a/libcontextsubscriber/sandbox/messaging-to-self/queuedinvoker.h b/libcontextsubscriber/sandbox/messaging-to-self/queuedinvoker.h
deleted file mode 100644
index 8f81f26e..00000000
--- a/libcontextsubscriber/sandbox/messaging-to-self/queuedinvoker.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef QUEUEDINVOKER_H
-#define QUEUEDINVOKER_H
-
-#include <QObject>
-#include <QMutex>
-#include <QSet>
-#include <QString>
-
-class QueuedInvoker : public QObject
-{
- Q_OBJECT
-
-public:
- QueuedInvoker();
-
-private slots:
- void onQueuedCall(const char *method);
-
-signals:
- void queuedCall(const char *method);
-
-public:
- void queueOnce(const char *method);
-
-private:
- QMutex callQueueLock;
- QSet<QString> callQueue;
-};
-#endif
diff --git a/libcontextsubscriber/src/Makefile.am b/libcontextsubscriber/src/Makefile.am
deleted file mode 100644
index c404128b..00000000
--- a/libcontextsubscriber/src/Makefile.am
+++ /dev/null
@@ -1,47 +0,0 @@
-lib_LTLIBRARIES = libcontextsubscriber.la
-libcontextsubscriber_la_SOURCES = contextproperty.cpp \
- contextproperty.h propertyhandle.cpp propertyhandle.h \
- provider.cpp provider.h safedbuspendingcallwatcher.h \
- subscriberinterface.h subscriberinterface.cpp \
- contextpropertyinfo.cpp contextpropertyinfo.h \
- contextregistryinfo.cpp contextregistryinfo.h infobackend.h \
- infobackend.cpp infoxmlbackend.h infoxmlbackend.cpp \
- infokeydata.h cdbwriter.h cdbwriter.cpp cdbreader.cpp \
- cdbreader.h infocdbbackend.cpp infocdbbackend.h \
- dbusnamelistener.h dbusnamelistener.cpp handlesignalrouter.cpp \
- handlesignalrouter.h queuedinvoker.cpp queuedinvoker.h \
- loggingfeatures.h contextkitplugin.h contextkitplugin.cpp \
- iproviderplugin.h contextproviderinfo.h nanoxml.h nanoxml.cpp \
- asyncdbusinterface.cpp timedvalue.h
-
-includecontextsubscriberdir=$(includedir)/contextsubscriber
-includecontextsubscriber_HEADERS = contextproperty.h \
- contextpropertyinfo.h contextregistryinfo.h iproviderplugin.h \
- contextproviderinfo.h asyncdbusinterface.h
-
-AM_CXXFLAGS = -I$(top_srcdir)/common \
- $(QtCore_CFLAGS) $(QtXml_CFLAGS) $(QtDBus_CFLAGS) \
- '-DDEFAULT_CONTEXT_SUBSCRIBER_PLUGINS="@libdir@/contextkit/subscriber-plugins"' \
- '-DDEFAULT_CONTEXT_PROVIDERS="@datadir@/contextkit/providers/"' \
- '-DDEFAULT_CONTEXT_CORE_DECLARATIONS="@datadir@/contextkit/core.context"' \
- '-DCONTEXT_LOG_MODULE_NAME="libcontextsubscriber"'
-
-$(top_builddir)/common/libcommon.la:
- $(MAKE) -C $(top_builddir)/common libcommon.la
-
-LIBS += $(CDB_LIBS) $(QtCore_LIBS) $(QtXml_LIBS) $(QtDBus_LIBS)
-libcontextsubscriber_la_LIBADD=$(top_builddir)/common/libcommon.la
-
-.PHONY: $(top_builddir)/common/libcommon.la
-
-# moccing
-nodist_libcontextsubscriber_la_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(libcontextsubscriber_la_SOURCES))
-include $(top_srcdir)/am/qt.am
-
-# because if you change configure parameter DEFAULT_CONTEXT_PROVIDERS,
-# you should do a recompile
-infocdbbackend.lo infoxmlbackend.lo: Makefile
-
-# and the same for DEFAULT_CONTEXT_SUBSCRIBER_PLUGINS
-provider.lo: Makefile
diff --git a/libcontextsubscriber/src/asyncdbusinterface.cpp b/libcontextsubscriber/src/asyncdbusinterface.cpp
deleted file mode 100644
index 11f6e984..00000000
--- a/libcontextsubscriber/src/asyncdbusinterface.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "asyncdbusinterface.h"
-#include <QObject>
-#include <QDBusConnection>
-#include <QString>
-
-/*!
- \class AsyncDBusInterface
-
- \brief This is a workaround for QtDBus to be asynchronous.
-
- In QtDBus, the QDBusInterface class which the developer is supposed
- to use makes introspection calls synchronously. It is not clear
- (and not documented), what is the benefit of these introspection
- calls, probably invalid use and some errors are catched earlier if
- introspection data is available.
-
- However this introspection data is requested synchronously, so
- constructing a new QDBusInterface can block your thread if the
- endpoint serving that introspection data on D-Bus is stuck.
-
- ContextKit tries to be asynchronous, so this behavior of
- QDBusInterface is unacceptable and this is why
- QDBusAbstractInterface has to be used instead (it is simpler, it
- doesn't use introspection at all).
-
- Unfortunately QDBusAbstractInterface only has a protected
- constructor, so we need this wrapper class, which makes that
- constructor available to us.
-
- So this class is internal to ContextKit, it is distributed only,
- because we use it in several subprojects, do not use it through
- ContextKit. If you find this useful, copy the source instead.
-*/
-AsyncDBusInterface::AsyncDBusInterface(const QString &service, const QString &path,
- const QString &interface,
- const QDBusConnection &connection,
- QObject *parent)
- : QDBusAbstractInterface(service, path, interface.toLatin1().data(), connection, parent)
-{
-}
diff --git a/libcontextsubscriber/src/asyncdbusinterface.h b/libcontextsubscriber/src/asyncdbusinterface.h
deleted file mode 100644
index 6ec8a2c6..00000000
--- a/libcontextsubscriber/src/asyncdbusinterface.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef ASYNCDBUSINTERFACE_H
-#define ASYNCDBUSINTERFACE_H
-
-class QString;
-class QObject;
-class QDBusConnection;
-
-#include <QDBusAbstractInterface>
-
-class AsyncDBusInterface : public QDBusAbstractInterface
-{
-public:
- AsyncDBusInterface(const QString &service, const QString &path,
- const QString &interface,
- const QDBusConnection &connection,
- QObject *parent = 0);
-};
-#endif
diff --git a/libcontextsubscriber/src/cdbreader.cpp b/libcontextsubscriber/src/cdbreader.cpp
deleted file mode 100644
index 42bdb865..00000000
--- a/libcontextsubscriber/src/cdbreader.cpp
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <stdlib.h>
-#include <cdb.h>
-#include <fcntl.h>
-#include <QDebug>
-#include <QByteArray>
-#include <QFile>
-#include <QDataStream>
-#include "cdbreader.h"
-#include "logging.h"
-#include "loggingfeatures.h"
-
-
-/*!
- \class CDBReader
-
- \brief A wrapper class to read data from a tiny-cdb database.
-
- This class is not a part of the public API. The reader operates
- on string-qvariant pairs: can read a qvariant value for a string
- key or a list of qvariant values for a string key. The reader
- automatically closes the underlying filesystem resource on
- destruction but can be also closed manually.
-
- Reading from a closed reader will return empty strings.
-*/
-
-/// Constructs a new CDBReader reading from cdb database at \a dbpath
-/// \param dbpath Path to the database.
-CDBReader::CDBReader(const QString &dbpath, QObject *parent)
- : QObject(parent), path(dbpath)
-{
- contextDebug() << F_CDB << "cdb reader created for:" << dbpath;
- cdb = NULL;
- fd = 0;
-
- reopen();
-}
-
-/// Destroys the object automatically closing the database and file.
-CDBReader::~CDBReader()
-{
- contextDebug() << F_CDB << F_DESTROY << "CDBReader::~CDBReader, dbpath:" << path;
- close();
-}
-
-/// Closes the reader and the underlying file on the filesystem.
-void CDBReader::close()
-{
- if (cdb) {
- free(cdb);
- cdb = NULL;
- }
-
- if (fd > 0) {
- ::close(fd);
- fd = 0;
- }
-}
-
-/// Reopens the reader for reading.
-/// It will first close the current reader if it's open.
-void CDBReader::reopen()
-{
- close();
-
- if (! QFile::exists(path))
- return;
-
- fd = open(path.toLocal8Bit().constData(), O_RDONLY);
-
- if (fd > 0) {
- cdb = calloc(1, sizeof(struct cdb));
- if (cdb_init((struct cdb*) cdb, fd) != 0) {
- free(cdb);
- cdb = NULL;
- }
- }
-}
-
-/// Returns all values associated with the given key from the database.
-/// \param key The key name in the database.
-QVariantList CDBReader::valuesForKey(const QString &key) const
-{
- if (! cdb) {
- contextDebug() << F_CDB << "Trying to read values for key:" << key << "from database that is closed!";
- return QVariantList();
- }
-
- QVariantList list;
- QByteArray utf8Data = key.toUtf8();
- unsigned int klen = utf8Data.size();
- const char *kval = utf8Data.constData();
-
- struct cdb_find cdbf;
- cdb_findinit(&cdbf, (struct cdb*) cdb, kval, klen);
-
- while(cdb_findnext(&cdbf) > 0) {
- unsigned int vpos = cdb_datapos((struct cdb*) cdb);
- unsigned int vlen = cdb_datalen((struct cdb*) cdb);
- char *val = (char *) malloc(vlen);
- cdb_read((struct cdb*) cdb, val, vlen, vpos);
- QByteArray valArray(val, vlen);
- QDataStream ds(&valArray, QIODevice::ReadOnly);
- QVariant valVariant;
- ds >> valVariant;
- list << valVariant;
- free(val);
- }
-
- return list;
-}
-
-/// Returns a value for the given \a key.
-/// First value is returned if there are many values for one key.
-/// \param key The key name in the database.
-QVariant CDBReader::valueForKey(const QString &key) const
-{
- QVariantList ret = valuesForKey(key);
- if (ret.size() == 0) return QVariant();
- return ret[0];
-}
-
-/// Returns the current state of the reader. Reader is not readable if
-/// it was created with a path that doesn't exist or if it was closed.
-bool CDBReader::isReadable()
-{
- return (fd > 0);
-}
-
-/// Returns the file descriptor used by the reader. Returns 0
-/// when the reader is closed.
-int CDBReader::fileDescriptor() const
-{
- return fd;
-}
-
-
diff --git a/libcontextsubscriber/src/cdbreader.h b/libcontextsubscriber/src/cdbreader.h
deleted file mode 100644
index 51330c3b..00000000
--- a/libcontextsubscriber/src/cdbreader.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef CDBREADER_H
-#define CDBREADER_H
-
-#include <QStringList>
-#include <QObject>
-#include <QVariant>
-#include <QVariantList>
-#include <QByteArray>
-
-class CDBReader : public QObject
-{
- Q_OBJECT
-
-public:
- explicit CDBReader(const QString &dbpath, QObject *parent = 0);
- virtual ~CDBReader();
-
- void close();
- void reopen();
- QVariantList valuesForKey(const QString &key) const;
- QVariant valueForKey(const QString &key) const;
- bool isReadable();
- int fileDescriptor() const;
-
-private:
- QString path; ///< Path pointing to the database.
- void *cdb; ///< Cdb library object used for reading.
- int fd; ///< A file descriptor to the database.
-};
-
-#endif
diff --git a/libcontextsubscriber/src/cdbwriter.cpp b/libcontextsubscriber/src/cdbwriter.cpp
deleted file mode 100644
index cf04a811..00000000
--- a/libcontextsubscriber/src/cdbwriter.cpp
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <cdb.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include "cdbwriter.h"
-#include "logging.h"
-#include "loggingfeatures.h"
-
-/*!
- \class CDBWriter
-
- \brief A wrapper class to write data (create) tiny-cdb databases.
-
- This class is not a part of the public API. The writer operates
- on string-qvariant pairs. QVariant values can be associated with
- string keys. Several operations are supported - adding, replacing
- and inserting. Those operations differ in how they handle existing
- keys with same name.
-
- The writer automatically cloes the filesystem resource on destruction but
- can be also closed manually. Writing to a closed writer has no effect.
-*/
-
-/// Constructs a new CDBWriter to write to a cdb database at \a dbpath
-/// \param dbpath Path to the database.
-CDBWriter::CDBWriter(const QString &path, QObject *parent)
- : QObject(parent)
-{
- contextDebug() << F_CDB << "cdb writer created for:" << path;
-
- cdbm = NULL;
- fd = 0;
-
- fd = open(path.toUtf8().constData(), O_RDWR | O_CREAT, 0644);
-
- if (fd > 0) {
- cdbm = calloc(1, sizeof(struct cdb_make));
- cdb_make_start((struct cdb_make *) cdbm, fd);
- }
-}
-
-/// Constructs a new CDBWriter to write to a cdb database at a file
-/// descriptor \a fd. You should not manipulate the \a fd after calling
-/// this function.
-/// \param fd An open file descriptor.
-CDBWriter::CDBWriter(int fdd, QObject *parent)
- : QObject(parent)
-{
- contextDebug() << F_CDB << "cdb writer created for file descriptor:" << fdd;
-
- cdbm = NULL;
- fd = fdd;
-
- if (fd > 0) {
- cdbm = calloc(1, sizeof(struct cdb_make));
- cdb_make_start((struct cdb_make *) cdbm, fd);
- }
-}
-
-/// Destroys the object closing the file beforehand.
-CDBWriter::~CDBWriter()
-{
- contextDebug() << F_CDB << F_DESTROY << "CDBWriter::~CDBWriter";
- close();
-}
-
-/// Add a new \a key with \a val to the database. If a value
-/// for this key already exists, another one is added.
-/// \param key Key name as string.
-/// \param val Value as string.
-void CDBWriter::add(const QString &key, const QVariant &val)
-{
- put(key, val, CDB_PUT_ADD);
-}
-
-/// Insert a new \a key with \a val to the database. If a value
-/// for this key already exists, nothing is done.
-/// \param key Key name as string.
-/// \param val Value as string.
-void CDBWriter::insert(const QString &key, const QVariant &val)
-{
- put(key, val, CDB_PUT_INSERT);
-}
-
-/// Insert a new \a key with \a val to the database. If a value
-/// for this key already exists, the old value is replaced with the
-/// new one.
-/// \param key Key name as string.
-/// \param val Value as string.
-void CDBWriter::replace(const QString &key, const QVariant &val)
-{
- put(key, val, CDB_PUT_REPLACE);
-}
-
-/// Closes the writer and the underlying filesystem resource for writing.
-void CDBWriter::close()
-{
- if (cdbm) {
- cdb_make_finish((struct cdb_make *) cdbm);
- free(cdbm);
- cdbm = NULL;
- }
-
- if (fd > 0) {
- ::close(fd);
- fd = 0;
- }
-}
-
-/// Returns the file descriptor used by the writer. Returns 0
-/// when the writer is closed.
-int CDBWriter::fileDescriptor() const
-{
- return fd;
-}
-
-/// Returns \a true if the writer is writable. The writer is not writable
-/// after it has been closed or the target path is not accessible.
-bool CDBWriter::isWritable()
-{
- return (fd > 0);
-}
-
-/* Private */
-
-/// Puts a new \a key with value \a val into the database. Depending
-/// on the \a flag the key is added, inserted or replaced. The public
-/// methods of this class are wrapperes of this method with proper flags.
-void CDBWriter::put(const QString &key, const QVariant &val, int flag)
-{
- if (! cdbm)
- return;
-
- QByteArray keyUtf8Data = key.toUtf8();
- int klen = keyUtf8Data.size();
- const char *kval = keyUtf8Data.constData();
-
- QByteArray valArray;
- QDataStream ds(&valArray, QIODevice::Truncate | QIODevice::WriteOnly);
- ds << val;
- int vlen = valArray.size();
- const char *vval = valArray.constData();
-
- cdb_make_put((struct cdb_make *) cdbm,
- kval, klen,
- vval, vlen,
- (cdb_put_mode) flag);
-}
diff --git a/libcontextsubscriber/src/cdbwriter.h b/libcontextsubscriber/src/cdbwriter.h
deleted file mode 100644
index b7067612..00000000
--- a/libcontextsubscriber/src/cdbwriter.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef CDBWRITER_H
-#define CDBWRITER_H
-
-#include <QObject>
-#include <QString>
-#include <QVariant>
-
-class CDBWriter : public QObject
-{
- Q_OBJECT
-
-public:
- explicit CDBWriter(const QString &path, QObject *parent = 0);
- explicit CDBWriter(int fd, QObject *parent = 0);
- virtual ~CDBWriter();
-
- void add(const QString &key, const QVariant &val);
- void insert(const QString &key, const QVariant &val);
- void replace(const QString &key, const QVariant &val);
- void close();
- bool isWritable();
- int fileDescriptor() const;
-
-private:
- void *cdbm; ///< A cdb library structure used to read data.
- int fd; ///< A file descriptor pointing to the database.
-
- void put(const QString &key, const QVariant &val, int flag);
-};
-
-#endif
diff --git a/libcontextsubscriber/src/contextkitplugin.cpp b/libcontextsubscriber/src/contextkitplugin.cpp
deleted file mode 100644
index a4ed0738..00000000
--- a/libcontextsubscriber/src/contextkitplugin.cpp
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "contextkitplugin.h"
-#include "logging.h"
-#include "subscriberinterface.h"
-#include "sconnect.h"
-#include <QStringList>
-#include <QTimer>
-
-/// Creates a new instance, the service to connect to has to be passed
-/// in \c constructionString in the format <tt>[session|dbus]:servicename</tt>.
-ContextSubscriber::IProviderPlugin* contextKitPluginFactory(QString constructionString)
-{
- QStringList constr = constructionString.split(":");
- if (constr.size() != 2) {
- contextCritical() << "Bad syntax for contextkit-dbus plugin:" << constructionString;
- return 0;
- }
- if (constr[0] == "session")
- return new ContextSubscriber::ContextKitPlugin(QDBusConnection::sessionBus(), constr[1]);
- else if (constr[0] == "system")
- return new ContextSubscriber::ContextKitPlugin(QDBusConnection::systemBus(), constr[1]);
-
- contextCritical() << "Unknown bus type: " << constructionString;
- return 0;
-}
-
-namespace ContextSubscriber {
-
-/*!
- \class ContextKitPlugin
- \brief Implementation of the ContextKit D-Bus protocol.
-*/
-
-const QString ContextKitPlugin::managerPath = "/org/freedesktop/ContextKit/Manager";
-const QString ContextKitPlugin::managerIName = "org.freedesktop.ContextKit.Manager";
-
-/// Creates subscriber and manager interface, tries to get a
-/// subscriber instance from the manager and starts listening for
-/// provider appearing and disappearing on D-Bus.
-ContextKitPlugin::ContextKitPlugin(const QDBusConnection bus, const QString& busName)
- : providerListener(new DBusNameListener(bus, busName, this)),
- subscriberInterface(0),
- managerInterface(0),
- connection(new QDBusConnection(bus)),
- busName(busName)
-{
- // Notice if the provider on the dbus comes and goes
- sconnect(providerListener, SIGNAL(nameAppeared()),
- this, SLOT(onProviderAppeared()));
- sconnect(providerListener, SIGNAL(nameDisappeared()),
- this, SLOT(onProviderDisappeared()));
-
- // Listen to the provider appearing and disappearing, but don't
- // perform the initial NameHasOwner check. We try to connect to
- // the provider at startup, whether it's present or not.
- providerListener->startListening(false);
- QMetaObject::invokeMethod(this, "onProviderAppeared", Qt::QueuedConnection);
-}
-
-/// Gets a new subscriber interface from manager when the provider
-/// appears.
-void ContextKitPlugin::onProviderAppeared()
-{
- contextDebug() << "ContextKitPlugin::onProviderAppeared";
-
- delete subscriberInterface;
- subscriberInterface = 0;
- delete managerInterface;
- managerInterface = new AsyncDBusInterface(busName, managerPath, managerIName, *connection, this);
- if (!managerInterface->callWithCallback("GetSubscriber",
- QList<QVariant>(),
- this,
- SLOT(onDBusGetSubscriberFinished(QDBusObjectPath)),
- SLOT(onDBusGetSubscriberFailed(QDBusError)))) {
- emit failed(QString("Wasn't able to call GetSubscriber on the managerinterface: ") +
- managerInterface->lastError().message());
- }
-}
-
-/// Delete our subscriber interface when the provider goes away.
-void ContextKitPlugin::onProviderDisappeared()
-{
- contextDebug() << "ContextKitPlugin::onProviderDisappeared";
- delete subscriberInterface;
- subscriberInterface = 0;
- emit failed("Provider went away");
-}
-
-/// Starts using the fresh subscriber interface when it is returned by
-/// the manager in response to the GetSubscriber call.
-void ContextKitPlugin::onDBusGetSubscriberFinished(QDBusObjectPath objectPath)
-{
- delete subscriberInterface;
- subscriberInterface = new SubscriberInterface(*connection, busName, objectPath.path(), this);
- sconnect(subscriberInterface,
- SIGNAL(valuesChanged(QMap<QString, QVariant>)),
- this,
- SLOT(onDBusValuesChanged(QMap<QString, QVariant>)));
- sconnect(subscriberInterface,
- SIGNAL(subscribeFinished(QList<QString>)),
- this,
- SLOT(onDBusSubscribeFinished(QList<QString>)));
- sconnect(subscriberInterface,
- SIGNAL(subscribeFailed(QList<QString>, QString)),
- this,
- SLOT(onDBusSubscribeFailed(QList<QString>, QString)));
-
- emit ready();
-}
-
-void ContextKitPlugin::onDBusGetSubscriberFailed(QDBusError err)
-{
- emit failed("Was unable to get subscriber object on dbus: " + err.message());
-}
-
-/// Signals the Provider that the subscribe is finished.
-void ContextKitPlugin::onDBusSubscribeFinished(QList<QString> keys)
-{
- foreach (const QString& key, keys)
- emit subscribeFinished(key);
-}
-
-/// Signals the Provider that the subscribe is failed.
-void ContextKitPlugin::onDBusSubscribeFailed(QList<QString> keys, QString error)
-{
- foreach (const QString& key, keys)
- emit subscribeFailed(key, error);
-}
-
-/// Forwards the subscribe request to the wire.
-void ContextKitPlugin::subscribe(QSet<QString> keys)
-{
- subscriberInterface->subscribe(keys);
-}
-
-/// Forwards the unsubscribe request to the wire.
-void ContextKitPlugin::unsubscribe(QSet<QString> keys)
-{
- subscriberInterface->unsubscribe(keys);
-}
-
-/// Forwards value changes from the wire to the upper layer (Provider).
-void ContextKitPlugin::onDBusValuesChanged(QMap<QString, QVariant> values)
-{
- foreach (const QString& key, values.keys())
- emit valueChanged(key, values[key]);
-}
-
-}
diff --git a/libcontextsubscriber/src/contextkitplugin.h b/libcontextsubscriber/src/contextkitplugin.h
deleted file mode 100644
index 5fd3b8d2..00000000
--- a/libcontextsubscriber/src/contextkitplugin.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef CONTEXTKITPLUGIN_H
-#define CONTEXTKITPLUGIN_H
-
-#include "dbusnamelistener.h"
-#include "subscriberinterface.h"
-#include "provider.h"
-#include "iproviderplugin.h"
-#include "asyncdbusinterface.h"
-#include <QString>
-#include <QDBusConnection>
-#include <QDBusObjectPath>
-#include <QSet>
-#include <QVariant>
-#include <QMap>
-
-extern "C" {
- ContextSubscriber::IProviderPlugin* contextKitPluginFactory(QString constructionString);
-}
-
-namespace ContextSubscriber {
-class ContextKitPlugin : public IProviderPlugin
-{
- Q_OBJECT
-
-public:
- ContextKitPlugin(const QDBusConnection bus, const QString& busName);
- void subscribe(QSet<QString> keys);
- void unsubscribe(QSet<QString> keys);
-
-signals:
-#ifdef DOXYGEN_ONLY
- void ready(); ///< Emitted when the GetSubscriber call returns successfully.
- void failed(QString error); ///< Emitted when the GetSubscriber call fails or provider not on D-Bus at all.
- void subscribeFinished(QString key); ///< Emitted when Subscribe call succeeds on D-Bus.
- void subscribeFailed(QString failedKey, QString error); ///< Emitted when Subscribe call fails on D-Bus.
- void valueChanged(QString key, QVariant value); ///< Emitted when ValueChanged signal comes on D-Bus
-#endif
-
-private slots:
- void onDBusValuesChanged(QMap<QString, QVariant> values);
- void onDBusGetSubscriberFinished(QDBusObjectPath objectPath);
- void onDBusGetSubscriberFailed(QDBusError err);
- void onDBusSubscribeFinished(QList<QString> keys);
- void onDBusSubscribeFailed(QList<QString> keys, QString error);
- void onProviderAppeared();
- void onProviderDisappeared();
-
-private:
- QMap<QString, QVariant>& mergeNullsWithMap(QMap<QString, QVariant> &map, QStringList nulls) const;
-
- DBusNameListener *providerListener; ///< Listens to provider's (dis)appearance over DBus
- SubscriberInterface *subscriberInterface; ///< The D-Bus interface for the Subscriber object
- QDBusAbstractInterface *managerInterface; ///< The D-Bus interface for the Manager object
-
- QDBusConnection *connection; ///< The connection to DBus
- QString busName; ///< The D-Bus service name of the ContextKit provider connected to
-
- static const QString managerIName; ///< org.freedesktop.ContextKit.Manager
- static const QString subscriberIName; ///< org.freedesktop.ContextKit.Subscriber
- static const QString managerPath; ///< /org/freedesktop/ContextKit/Manager
-};
-
-
-}
-
-#endif
diff --git a/libcontextsubscriber/src/contextproperty.cpp b/libcontextsubscriber/src/contextproperty.cpp
deleted file mode 100644
index 30f29b45..00000000
--- a/libcontextsubscriber/src/contextproperty.cpp
+++ /dev/null
@@ -1,336 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-/*!
- \mainpage Context Properties
-
- \brief The Context Framework allows you to access system- and
- session-wide named values. Examples are context properties like the
- current geographical location. You can receive notifications about
- changes to these values, and you can also easily subscribe and
- unsubscribe from change notifications to help with managing power
- consumption.
-
- \section Overview
-
- The Context Properties are key/value pairs. The keys are
- strings and the values are QVariants.
-
- Key are arranged in a hierarchical namespace like in this example
- of two contextual properties
-
- \code
- Screen.TopEdge = "left"
- Screen.IsCovered = false
- \endcode
-
- Although the key names can be considered to form a tree (with
- "Screen" at the root) there is no semantic relationship between
- parent and child nodes in the tree: the key "Screen" is unrelated
- to "Screen.TopEdge". In particular, change notifications do not
- travel up the tree.
-
- The \ref Introspection section describes in detail how to get a list of
- existing keys and examine their capabilities.
-
- Programmers access the key/value pairs through instances of the
- ContextProperty class. These instances allow applications to
- access the values and receive change notifications.
-
- Example:
- \code
- ContextProperty *topEdge = new ContextProperty("Screen.TopEdge");
- QObject::connect(topEdge, SIGNAL(valueChanged()),
- this, SLOT(topEdgeChanged()));
- \endcode
-
- In your edgeUpChanged method you are able to retrieve the value of the property:
- \code
- qWarning() << "The edge " << topEdge->value() << " is up";
- \endcode
-
- Creating a ContextProperty instance for a key causes the program
- to 'subscribe' to this key. The values for some keys might be
- expensive to determine, so you should only subscribe to those keys
- that you are currently interested in. You can temporarily
- unsubscribe from a key without destroying the ContextProperty
- instance by using the unsubscribe() member function. Later, you
- can resume the subscription by calling the subscribe() member
- function.
-
- \code
- void onScreenBlank ()
- {
- topEdge->unsubscribe();
- }
-
- void onScreenUnblank ()
- {
- topEdge->subscribe();
- }
- \endcode
-
- All the context properties can be used anytime, not depending on
- whether the provider of the property is installed or running. If
- the system/provider cannot provide you with a value, the value of
- the context property will be null. If for some reason you are
- interested in property metadata (such as a key's current provider,
- availability, etc.) you should consult the \ref Introspection API.
-*/
-
-#include "contextproperty.h"
-#include "propertyhandle.h"
-#include "sconnect.h"
-#include "logging.h"
-#include "loggingfeatures.h"
-
-#include <QCoreApplication>
-#include <QThread>
-
-using namespace ContextSubscriber;
-
-/*!
- \class ContextPropertyPrivate
-
- \brief The private parts of the ContextProperty class.
-*/
-
-struct ContextPropertyPrivate
-{
- PropertyHandle *handle; ///< The common handle behind this context property
- bool subscribed; ///< True, if we are subscribed to the handle behind us
- QVariant value; ///< Our knowledge of the value. Needed because several
- /// valueChanged signals might be emitted (queued) by the
- /// PropertyHandle, without us handling them.
-};
-
-/*!
- \class ContextProperty
-
- \brief The ContextProperty class allows access to keys and their
- values.
-
- The value is available with the value() member function and change
- notifications are delivered via the valueChanged() signal.
-
- You can explicity subscribe and unsubscribe using the subscribe()
- and unsubscribe() member functions. A ContextProperty is
- initially subscribed.
-
- When a ContextProperty is in the unsubscribed state, it usually
- keeps its last value. This is not guaranteed however: more than
- one ContextProperty might exist in your process for the same key,
- and as long as one of them is subscribed, all of them might receive
- new values. The valueChanged() signal is never emitted if the
- property is unsubscribed.
-
- A ContextProperty is generally asynchronous and relies on a running
- event loop. Subscriptions and unsubcriptions are only handled and
- new values are only received when your program enters the event
- loop.
-
- ContextProperty objects can be created only after the
- Q(Core)Application is constructed.
-
- When a ContextProperty is first created or goes from the
- unsubcribed to the subscribed state later on, it is temporarily in
- an intermediate 'subscribing' state. This state lasts until the
- negotiations with the provider of the key are over (or an error
- occurs) and the key's current value is known to the
- ContextProperty.
-
- Thus, there is a time after creating a ContextProperty (or
- subscribing it again) where value() might be out of sync with the
- provider of the key. If you need to wait for this time to be over,
- you can not rely on the valueChanged() signal being emitted.
- This signal is only emitted when the value actually changes, which
- might not happen when subscription is over.
-
- Instead, you can use the waitForSubscription() member function.
- This function runs a recursive event loop, if necessary, until the
- ContextProperty is fully subscribed.
-
- Thus, the recommended way is to first create all ContextProperty
- instances that your program needs and QObject::connect their
- valueChanged() signals, then to call waitForSubscription() on those values
- that are needed to create the initial user interface.
-
- It is important to create all needed ContextProperty instances
- before calling waitForSubscription() on any of them. Subscriptions
- are usually bundled together behind the scenes so that they can all
- be done with a single round trip to the provider. Interleaving
- creation of ContextProperties with calls to waitForSubscription()
- would prevent this optimization.
-
- \note The \c ContextProperty class follows the usual QObject rules
- for non-GUI classes in multi-threaded programs. In Qt terminology,
- the ContextProperty class is reentrant but not thread-safe. This
- means that you can create ContextProperty instances in any thread
- and then freely use these instance in their threads, but you can
- not use a single instance concurrently from multiple threads.
-
- \note Please pay special attention to how signals and slots work in
- a multi-threaded program: by default, a slot is emitted in the
- thread that called QObject::connect(). For this to happen
- reliably, the thread needs to run a event loop.
-
- \note See the Qt documentation for \c QThread and related classes
- for more details.
- */
-
-/// Constructs a new ContextProperty for \a key and subscribes to it.
-ContextProperty::ContextProperty(const QString &key, QObject* parent)
- : QObject(parent), priv(0)
-{
- priv = new ContextPropertyPrivate;
-
- priv->handle = PropertyHandle::instance(key);
- priv->subscribed = false;
-
- subscribe();
-}
-
-/// Unsubscribes from the ContextProperty and destroys it.
-ContextProperty::~ContextProperty()
-{
- contextDebug() << F_DESTROY << "ContextProperty::~ContextProperty";
- unsubscribe();
- delete priv;
-}
-
-/// Returns the key.
-QString ContextProperty::key() const
-{
- return priv->handle->key();
-}
-
-/// Returns the current value.
-QVariant ContextProperty::value() const
-{
- return priv->handle->value();
-}
-
-/// Returns the current value, or the value \a def if the current
-/// value is \c null.
-QVariant ContextProperty::value(const QVariant &def) const
-{
- QVariant val = priv->handle->value();
- if (val.isNull())
- return def;
- else
- return val;
-}
-
-// A safety measure to avoid emitting unnecessary signals, see
-// ContextPropertyPrivate::value.
-void ContextProperty::onValueChanged()
-{
- QVariant newValue = priv->handle->value();
- if (priv->value != newValue ||
- priv->value.isNull() != newValue.isNull() ||
- priv->value.type() != newValue.type())
- {
- priv->value = newValue;
- emit valueChanged();
- }
-}
-
-/// Starts subscribtion to the context property, if it isn't
-/// subscribed already. If you need to wait for it to be complete, use
-/// waitForSubscription().
-void ContextProperty::subscribe() const
-{
- if (priv->subscribed)
- return;
-
- // We create a queued connection, because otherwise we run
- // the users' valueChanged() handlers with locks and if they do
- // something fancy (for example unsubscribe) it can cause a
- // deadlock.
- sconnect(priv->handle, SIGNAL(valueChanged()), this, SLOT(onValueChanged()), Qt::QueuedConnection);
- priv->handle->subscribe();
- priv->subscribed = true;
-}
-
-/// Unsubscribes from the context property, if it is currently
-/// subscribed. Unsubscribing informs the rest of the system that no
-/// effort needs to be spent to keep the value up-to-date. However,
-/// the value might still change when it can happen 'for free'. In
-/// this case the valueChanged() signal won't be emitted.
-void ContextProperty::unsubscribe() const
-{
- if (!priv->subscribed)
- return;
-
- QObject::disconnect(priv->handle, SIGNAL(valueChanged()), this, SIGNAL(valueChanged()));
- priv->handle->unsubscribe();
- priv->subscribed = false;
-}
-
-/// Suspends the execution of the current thread until subcription is
-/// complete for this context property. This might cause the main
-/// event loop of your program to run and consequently signals might
-/// get emitted (including the valueChanged() signal of this
-/// property). Calling this function while the subscription is not in
-/// progress (because it has completed already or because the property
-/// is currently unsubscribed) does nothing. Calling this function
-/// from a thread which is not the main thread results in busy looping.
-void ContextProperty::waitForSubscription() const
-{
- if (!priv->subscribed)
- return;
-
- while (priv->handle->isSubscribePending()) {
- if (QThread::currentThread() == QCoreApplication::instance()->thread()) {
- // This is not a busy loop, since the QEventLoop::WaitForMoreEvents flag
- QCoreApplication::processEvents(QEventLoop::WaitForMoreEvents);
- } else {
- usleep(100000); // 0.1 second
- }
- }
-}
-
-/// Sets all of the ContextProperty instances immune to 'external
-/// commanding'. This is only intended to be used by the Context
-/// Commander itself, so that it can use ContextProperties without
-/// tripping over itself. Don't use this.
-void ContextProperty::ignoreCommander()
-{
- PropertyHandle::ignoreCommander();
-}
-
-/// Returns the metadata about this property, please refer to \ref
-/// Introspection for details.
-const ContextPropertyInfo* ContextProperty::info() const
-{
- return priv->handle->info();
-}
-
-/// Enables or disables all of the ContextProperty instances'
-/// type-check feature. If it is enabled and the received value from
-/// the provider doesn't match the expected type, you will get an
-/// error message on the stderr and the value won't be updated. If you
-/// use this method, you have to use it before starting any threads.
-void ContextProperty::setTypeCheck(bool newTypeCheck)
-{
- PropertyHandle::setTypeCheck(newTypeCheck);
-}
-
diff --git a/libcontextsubscriber/src/contextproperty.h b/libcontextsubscriber/src/contextproperty.h
deleted file mode 100644
index d354d853..00000000
--- a/libcontextsubscriber/src/contextproperty.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef CONTEXTPROPERTY_H
-#define CONTEXTPROPERTY_H
-
-#include <QObject>
-#include <QVariant>
-#include <QString>
-
-class ContextPropertyPrivate;
-class ContextPropertyInfo;
-
-class ContextProperty : public QObject
-{
- Q_OBJECT
-
-public:
- explicit ContextProperty(const QString &key, QObject *parent = 0);
-
- virtual ~ContextProperty();
-
- QString key() const;
- QVariant value(const QVariant &def) const;
- QVariant value() const;
-
- const ContextPropertyInfo* info() const;
-
- void subscribe () const;
- void unsubscribe () const;
-
- void waitForSubscription () const;
-
- static void ignoreCommander();
- static void setTypeCheck(bool typeCheck);
-
-signals:
- void valueChanged(); ///< Emitted whenever the value of the property changes and the property is subscribed.
-
-private:
- ContextPropertyPrivate *priv;
-private slots:
- void onValueChanged();
-};
-
-#endif
diff --git a/libcontextsubscriber/src/contextpropertyinfo.cpp b/libcontextsubscriber/src/contextpropertyinfo.cpp
deleted file mode 100644
index 3a478cd4..00000000
--- a/libcontextsubscriber/src/contextpropertyinfo.cpp
+++ /dev/null
@@ -1,419 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "contextpropertyinfo.h"
-#include "infobackend.h"
-#include "sconnect.h"
-#include "logging.h"
-#include "loggingfeatures.h"
-#include <QMutex>
-#include <QMutexLocker>
-
-/*!
- \page Introspection
-
- \brief The Context Framework maintains a registry defining which
- context properties are currently provided and by whom. The
- introspection API of libcontextsubscriber allows you to inspect
- the current state of the registry and observe its changes.
-
- \section Overview
-
- The introspection is provided via two classes: ContextRegistryInfo and
- ContextPropertyInfo.
-
- ContextRegistryInfo provides a high-level view to the registry
- contents. You can use it to obtain info about the list of
- currently available keys or e.g. get a list of keys for one
- particular provider. ContextRegistryInfo is a singleton instance
- which is created on the first access.
-
- ContextPropertyInfo is used to obtain metadata about one
- particular key. Once created, it can be used to retrieve the type
- and provider information (DBus bus type and name) of the
- introspected key. It also provides a signal to listen for changes
- happening to a key.
-
- \section Usage
-
- \code
- // To get a list of all keys in the registry
- ContextRegistryInfo *context = ContextRegistryInfo::instance();
- QStringList currentKeys = context->listKeys();
- \endcode
-
- Using the ContextPropertyInfo is even more straight-forward.
-
- \code
- // To check the type of a particular key
- ContextPropertyInfo propInfo("Battery.ChargeLevel");
- QString propType = propInfo.type();
- \endcode
-
- The introspection API in general never asserts (never fails). It'll return empty strings
- on errors or if data is missing. For example:
-
- \code
- ContextPropertyInfo propInfo("Something.That.Doesnt.Exist");
- propInfo.type(); // ...returns empty string
- propInfo.doc(); // ...returns empty string
- \endcode
-
- You can use this functionality to wait for keys to become available in the registry.
- Just create a ContextPropertyInfo for a key that you're expecting to become present
- and connect to the \c changed signal.
-
- \code
- ContextPropertyInfo propInfo("Something.That.Doesnt.Exist");
- propInfo.declared(); // false
- // Connect something to the changed signal, keep checking it
- \endcode
-
- \section xmlvscdb XML vs.CDB
-
- When the introspection API is first used, a backend choice is being made. \b CDB backend
- (reading data from \c 'cache.cdb' ) is used if the tiny database cache file exists
- in the registry. The standard (slower) \b XML backend is used in other cases.
-
- It's possible to force a usage of a particular backend.
- This can be done by calling the \c instance method with a string name of the backend:
-
- \code
- ContextRegistryInfo::instance("cdb"); // or "xml"
- \endcode
-
- This needs to be done early enough before the introspection API is first used.
- For more information about the \b xml and \cdb backends read the \ref UpdatingContextProviders page.
-
-*/
-
-/*!
- \page MigratingFromDuiValueSpace
-
- \brief libcontextsubscriber is a replacement library for DuiValueSpace which is deprecated.
-
- DuiValueSpace, the old subscription library providing the keys, is deprecated. This library
- is a replacement for it, providing better API and better implementation while maintaining the
- same core ideas and structure.
-
- \section quicklook A quick look
-
- The following code for creating a handle for a context property:
-
- \code
- DuiValueSpaceItem topEdge("Context.Screen.TopEdge");
- QObject::connect(&topEdge, SIGNAL(valueChanged()),
- this, SLOT(topEdgeChanged()));
- \endcode
-
- becomes:
-
- \code
- ContextProperty topEdge("Screen.TopEdge");
- QObject::connect(&topEdge, SIGNAL(valueChanged()),
- this, SLOT(topEdgeChanged()));
- \endcode
-
- The following code for listing the available context keys:
-
- \code
- DuiValueSpaceItem::listKeys();
- \endcode
-
- becomes:
-
- \code
- ContextRegistryInfo::instance()->listKeys();
- \endcode
-
- \section prefix The Context. prefix
-
- In \b DuiValueSpace and accompanying packages, the properties used to
- have a "Context." prefix. For example:
-
- \code
- Context.Screen.TopEdge
- Context.Screen.IsCovered
- \endcode
-
- This 'Context.' has been dropped now from \b libcontextsubscriber and
- all the provider packages. Providers now explicitly provide properties
- with keys like:
-
- \code
- Screen.TopEdge
- Screen.IsCovered
- \endcode
-
- For compatibility reasons the 'Context.' prefix is still supported in
- newer releases of \b DuiValueSpace. The \b DuiValueSpace library transparently
- adds the 'Context.' prefix to all access functions.
-
- A call to:
-
- \code
- DuiValueSpaceItem topEdge("Context.Screen.TopEdge");
- \endcode
-
- ...is internally in \b DuiValueSpace converted to actual \c Screen.TopEdge
- wire access. This mechanism has been introduced to make the
- \b DuiValueSpace and \b libcontextsubscriber libraries parallel-installable.
-
- It's expected that all \b DuiValueSpace clients migrate to \b libcontextsubscriber
- eventually and \b DuiValueSpace library will be removed.
-
- \warning When migrating to \b libcontextsubscriber make sure to remove the 'Context.'
- from you key access paths.
-*/
-
-/*!
- \class ContextPropertyInfo
-
- \brief A class to introspect a context property details.
-
- This class is used to obtain information about a given key in the context registry.
- The information can be provided either from xml files or from a cdb database.
- It's possible to query the type, the provider and the documentation of the given
- key/property.
-*/
-
-/// Constructs a new ContextPropertyInfo for \a key with the given \a parent.
-/// The object can be used to perform introspection on the given \a key.
-/// \param key The full name of the key.
-ContextPropertyInfo::ContextPropertyInfo(const QString &key, QObject *parent)
- : QObject(parent)
-{
- keyName = key;
-
- if (key != "") {
- InfoBackend* infoBackend = InfoBackend::instance();
- sconnect(infoBackend, SIGNAL(keyChanged(QString)),
- this, SLOT(onKeyChanged(QString)));
-
- cachedType = infoBackend->typeForKey(keyName);
- cachedDoc = infoBackend->docForKey(keyName);
- cachedDeclared = infoBackend->keyDeclared(keyName);
- cachedProviders = infoBackend->providersForKey(keyName);
- }
-}
-
-/// Returns the full name of the introspected key.
-QString ContextPropertyInfo::key() const
-{
- QMutexLocker lock(&cacheLock);
- return keyName;
-}
-
-/// Returns the doc (documentation) for the introspected key.
-QString ContextPropertyInfo::doc() const
-{
- QMutexLocker lock(&cacheLock);
- return cachedDoc;
-}
-
-/// Returns the type name for the introspected key.
-QString ContextPropertyInfo::type() const
-{
- QMutexLocker lock(&cacheLock);
- return cachedType;
-}
-
-/// DEPRECATED Returns true if the key exists in the registry.
-/// This function is deprecated, use declared() instead.
-bool ContextPropertyInfo::exists() const
-{
- contextWarning() << F_DEPRECATION << "ContextPropertyInfo::exists() is deprecated.";
- QMutexLocker lock(&cacheLock);
- return cachedDeclared;
-}
-
-/// Returns true if the key is declared in the registry
-/// (it "exists").
-bool ContextPropertyInfo::declared() const
-{
- QMutexLocker lock(&cacheLock);
- return cachedDeclared;
-}
-
-/// Returns true if the key is provided by someone.
-bool ContextPropertyInfo::provided() const
-{
- QMutexLocker lock(&cacheLock);
- return (cachedProviders.size() > 0);
-}
-
-/// DEPRECATED Returns the name of the plugin supplying this property.
-/// This function is deprecated, use providers() instead.
-QString ContextPropertyInfo::plugin() const
-{
- contextWarning() << F_DEPRECATION << "ContextPropertyInfo::plugin() is deprecated.";
- return plugin_i();
-}
-
-QString ContextPropertyInfo::plugin_i() const
-{
- QMutexLocker lock(&cacheLock);
- if (cachedProviders.size() == 0)
- return "";
- else
- return cachedProviders.at(0).plugin;
-}
-
-/// DEPRECATED Returns the construction parameter for the Provider supplying this property
-/// This function is deprecated, use providers() instead.
-QString ContextPropertyInfo::constructionString() const
-{
- contextWarning() << F_DEPRECATION << "ContextPropertyInfo::constructionString() is deprecated.";
- return constructionString_i();
-}
-
-QString ContextPropertyInfo::constructionString_i() const
-{
- QMutexLocker lock(&cacheLock);
- if (cachedProviders.size() == 0)
- return "";
- else
- return cachedProviders.at(0).constructionString;
-}
-
-/// DEPRECATED Returns the dbus name of the provider supplying this
-/// property/key. This function is maintained for backwards
-/// compatibility. Use providers() instead.
-QString ContextPropertyInfo::providerDBusName_i() const
-{
- QMutexLocker lock(&cacheLock);
- if (cachedProviders.size() == 0)
- return "";
- else {
- QString plg = cachedProviders.at(0).plugin;
- QString constructionString = cachedProviders.at(0).constructionString;
- if (plg == "contextkit-dbus")
- return constructionString.split(":").last();
- else
- return "";
- }
-}
-
-/// DEPRECATED Returns the dbus name of the provider supplying this
-/// property/key. This function is maintained for backwards
-/// compatibility. Use listProviders() instead.
-QString ContextPropertyInfo::providerDBusName() const
-{
- contextWarning() << F_DEPRECATION << "ContextPropertyInfo::providerDBusName() is deprecated.";
- return providerDBusName_i();
-}
-QDBusConnection::BusType ContextPropertyInfo::providerDBusType_i() const
-{
- QMutexLocker lock(&cacheLock);
- QString busType = "";
-
- if (cachedProviders.size() > 0) {
- QString plg = cachedProviders.at(0).plugin;
- QString constructionString = cachedProviders.at(0).constructionString;
- if (plg == "contextkit-dbus")
- busType = constructionString.split(":").first();
- }
-
- if (busType == "system")
- return QDBusConnection::SystemBus;
- else /* if (busType == "session") */
- return QDBusConnection::SessionBus;
-}
-
-
-/// DEPRECATED Returns the bus type of the provider supplying this property/key.
-/// Ie. if it's a session bus or a system bus. This function is
-/// maintained for backwards compatibility. Use listProviders() instead.
-QDBusConnection::BusType ContextPropertyInfo::providerDBusType() const
-{
- contextWarning() << F_DEPRECATION << "ContextPropertyInfo::providerDBusType() is deprecated.";
- return providerDBusType_i();
-}
-
-/* Slots */
-
-/// This slot is connected to the \a keyChanged signal of the
-/// actual infobackend instance. It's executed on every change to any
-/// of the keys. We first check if the data concerns us. Next we
-/// update the cached values and fire the actual signals.
-void ContextPropertyInfo::onKeyChanged(const QString& key)
-{
- QMutexLocker lock(&cacheLock);
-
- if (key != keyName)
- return;
-
- // Update caches
- QString cachedType = InfoBackend::instance()->typeForKey(keyName);
- cachedDoc = InfoBackend::instance()->docForKey(keyName);
- cachedDeclared = InfoBackend::instance()->keyDeclared(keyName);
- cachedProviders = InfoBackend::instance()->providersForKey(keyName);
-
- // Release the lock before emitting the signals; otherwise
- // listeners trying to access cached values would create a
- // deadlock.
- lock.unlock();
-
- // Emit the needed signals
- emit changed(keyName);
- emit typeChanged(cachedType);
- emit existsChanged(cachedDeclared);
- emit providedChanged((cachedProviders.size() > 0));
-
- emit providerChanged(providerDBusName_i());
- emit providerDBusTypeChanged(providerDBusType_i());
- emit pluginChanged(plugin_i(), constructionString_i());
-}
-
-/// Returns a list of providers that provide this key.
-const QList<ContextProviderInfo> ContextPropertyInfo::providers() const
-{
- QMutexLocker lock(&cacheLock);
- return cachedProviders;
-}
-
-/// Called when people connect to signals. Used to emit deprecation warnings
-/// when people connect to deprecated signals.
-void ContextPropertyInfo::connectNotify(const char *_signal)
-{
- QObject::connectNotify(_signal);
- QLatin1String signal(_signal);
-
- if (signal == SIGNAL(providerChanged(QString)))
- contextWarning() << F_DEPRECATION << "ContextPropertyInfo::providerChanged signal is deprecated.";
- else if (signal == SIGNAL(providerDBusTypeChanged(QDBusConnection::BusType)))
- contextWarning() << F_DEPRECATION << "ContextPropertyInfo::providerDBusTypeChanged signal is deprecated.";
- else if (signal == SIGNAL(typeChanged(QString)))
- contextWarning() << F_DEPRECATION << "ContextPropertyInfo::typeChanged signal is deprecated.";
- else if (signal == SIGNAL(existsChanged(bool)))
- contextWarning() << F_DEPRECATION << "ContextPropertyInfo::existsChanged signal is deprecated.";
- else if (signal == SIGNAL(providedChanged(bool)))
- contextWarning() << F_DEPRECATION << "ContextPropertyInfo::providedChanged signal is deprecated.";
- else if (signal == SIGNAL(pluginChanged(QString,QString)))
- contextWarning() << F_DEPRECATION << "ContextPropertyInfo::pluginChanged signal is deprecated.";
-}
-
-/// Returns resolution strategy for this property. Resolution strategy defines how values
-/// are computed in relation to multiple providers being present for one property.
-ContextPropertyInfo::ResolutionStrategy ContextPropertyInfo::resolutionStrategy() const
-{
- return ContextPropertyInfo::LastValue;
-}
diff --git a/libcontextsubscriber/src/contextpropertyinfo.h b/libcontextsubscriber/src/contextpropertyinfo.h
deleted file mode 100644
index d1af63c7..00000000
--- a/libcontextsubscriber/src/contextpropertyinfo.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef CONTEXTPROPERTYINFO_H
-#define CONTEXTPROPERTYINFO_H
-
-#include <QVariant>
-#include <QStringList>
-#include <QObject>
-#include <QDBusConnection>
-#include <QMutex>
-#include "contextproviderinfo.h"
-
-class ContextPropertyInfo : public QObject
-{
- Q_OBJECT
-
-public:
- enum ResolutionStrategy { LastValue };
-
- explicit ContextPropertyInfo(const QString &key, QObject *parent = 0);
-
- /// Destroys the object.
- virtual ~ContextPropertyInfo() {}
-
- QString key() const;
- QString doc() const;
- QString type() const;
- bool exists() const;
- bool declared() const;
- bool provided() const;
-
- QString providerDBusName() const;
- QDBusConnection::BusType providerDBusType() const;
-
- QString plugin() const;
- QString constructionString() const;
- virtual const QList<ContextProviderInfo> providers() const;
- ResolutionStrategy resolutionStrategy() const;
-
-protected:
- virtual void connectNotify(const char *signal);
-
-private:
- QString keyName; ///< The name of the key his ContextPropertyInfo represents.
- QString cachedDoc; ///< Cached documentation of the key.
- QString cachedType; ///< Cached (stored) type of the key.
- bool cachedDeclared; ///< Cached state of the key (existance).
- QList<ContextProviderInfo> cachedProviders; ///< Cached list of providers for this key.
- mutable QMutex cacheLock; ///< Lock for the cache.
-
- QString providerDBusName_i() const;
- QDBusConnection::BusType providerDBusType_i() const;
- QString plugin_i() const;
- QString constructionString_i() const;
-
-private slots:
- void onKeyChanged(const QString& key);
-
-signals:
- /// DEPRECATED, use changed() signal.
- /// Emitted when the provider of the key changes. The \a newProvider
- /// contains the name of the new provider. This is a strict signal -
- /// it's emitted only when there was an actual change in the value.
- /// \param newProvider The DBus name of the new provider.
- void providerChanged(const QString& newProvider);
-
- /// DEPRECATED, use changed() signal.
- /// Emitted when the bus type of provider of the key changes. The
- /// \a newBusType is the type of new bus This is a strict signal -
- /// it's emitted only when there was an actual change in the value.
- /// \param newBusType The DBus bus type of the provider.
- void providerDBusTypeChanged(QDBusConnection::BusType newBusType);
-
- /// DEPRECATED, use changed() signal.
- /// Emitted when the key type changes. The \a newType is the new type
- /// of the introspected key. This is a strict signal - it's emitted only
- /// when there was an actual change in the value.
- /// \param newType The new type of the key.
- void typeChanged(const QString& newType);
-
- /// DEPRECATED, use changed() signal.
- /// Emitted when the key existance in the registry changes. The \a exists
- /// is the new state of the introspected key. This is a strict signal - it's
- /// emitted only when there was an actual change in the state. Using this
- /// signal you can wait (watch) for various keys to become available.
- /// \param exists The new state of the key.
- void existsChanged(bool exists);
-
- /// DEPRECATED, use changed() signal.
- /// Emitted when the key gets a provider or loses a provider. The \a provided
- /// is the new state of the introspected key. This is a strict signal - it's
- /// emitted only when there was an actual change in the state. Using this
- /// signal you can wait (watch) for various keys to become available.
- /// \param provided The new state of the key.
- void providedChanged(bool provided);
-
- /// DEPRECATED, use changed() signal.
- /// Emitted when the libcontextsubscriber plugin providing the key
- /// changes, or the construction parameter to give to the plugin
- /// changes.. The \a plugin is the name of the new plugin
- /// providing the key and the \a constructionString is the new
- /// construction parameter to give to the plugin.
- void pluginChanged(QString plugin, QString constructionString);
-
- /// Emitted when any of the key parameters/data changes.
- /// This is not a strict signal - it might be emitted even when
- /// no actual change happened.
- void changed(QString key);
-
- friend class ContextPropertyInfoUnitTest;
-};
-
-#endif // CONTEXTPROPERTYINFO_H
diff --git a/libcontextsubscriber/src/contextproviderinfo.h b/libcontextsubscriber/src/contextproviderinfo.h
deleted file mode 100644
index 9278e433..00000000
--- a/libcontextsubscriber/src/contextproviderinfo.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef CONTEXTPROVIDERINFO_H
-#define CONTEXTPROVIDERINFO_H
-
-#include <QObject>
-#include <QString>
-
-struct ContextProviderInfo
-{
- QString plugin;
- QString constructionString;
- ContextProviderInfo(const QString& plugin, const QString& constructionString)
- : plugin(plugin), constructionString(constructionString) { }
- bool operator<(const ContextProviderInfo& other) const
- {
- return plugin < other.plugin ||
- (plugin == other.plugin && constructionString < other.constructionString);
- }
-};
-
-#endif // CONTEXTPROVIDERINFO
diff --git a/libcontextsubscriber/src/contextregistryinfo.cpp b/libcontextsubscriber/src/contextregistryinfo.cpp
deleted file mode 100644
index 561631f0..00000000
--- a/libcontextsubscriber/src/contextregistryinfo.cpp
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "contextregistryinfo.h"
-#include "infobackend.h"
-#include "sconnect.h"
-#include "logging.h"
-#include "loggingfeatures.h"
-#include "contextproviderinfo.h"
-#include <QMutex>
-#include <QMutexLocker>
-#include <QCoreApplication>
-
-/*!
- \class ContextRegistryInfo
-
- \brief A class to introspect the registry contents.
-
- This is a singelton class used to obtain information about the keys (properties)
- in the registry database. The information can be provided either from xml files
- or from a cdb database. It's possible to list all the keys in the registry and
- also list all keys belonging to a one particular provider.
-*/
-
-ContextRegistryInfo* ContextRegistryInfo::registryInstance = NULL;
-
-/* Public */
-
-/// Returns the singleton instance of the ContextRegistryInfo. The object
-/// is constructed automaticall on first access.
-/// \param backendName the optional name of the backend to use (force).
-
-ContextRegistryInfo* ContextRegistryInfo::instance(const QString &backendName)
-{
- static QMutex mutex;
- QMutexLocker locker(&mutex);
- if (! registryInstance) {
- InfoBackend::instance(backendName);
- registryInstance = new ContextRegistryInfo;
-
- InfoBackend* infoBackend = InfoBackend::instance();
-
- sconnect(infoBackend, SIGNAL(keysChanged(QStringList)),
- registryInstance, SLOT(onKeysChanged(QStringList)));
-
- sconnect(infoBackend, SIGNAL(keysAdded(QStringList)),
- registryInstance, SLOT(onKeysAdded(QStringList)));
-
- sconnect(infoBackend, SIGNAL(keysRemoved(QStringList)),
- registryInstance, SLOT(onKeysRemoved(QStringList)));
-
- sconnect(infoBackend, SIGNAL(listChanged()),
- registryInstance, SLOT(onListChanged()));
-
- // Move the backend to the main thread
- registryInstance->moveToThread(QCoreApplication::instance()->thread());
- }
-
- return registryInstance;
-}
-
-/// Returns the list of all the keys currently availible in the registry.
-QStringList ContextRegistryInfo::listKeys() const
-{
- return InfoBackend::instance()->listKeys();
-}
-
-/// Returns the list of all the keys associated with the given provider.
-QStringList ContextRegistryInfo::listKeys(QString providerName) const
-{
- contextWarning() << F_DEPRECATION << "ContextRegistryInfo::listKeys(QString provider) is deprecated.";
-
- QSet<QString> keys;
-
- foreach (QString key, listKeys()) {
- foreach (ContextProviderInfo info, InfoBackend::instance()->providersForKey(key)) {
- if (info.plugin == "contextkit-dbus" &&
- info.constructionString.split(":").last() == providerName) {
- keys.insert(key);
- }
- }
- }
-
- return keys.toList();
-}
-
-/// DEPRECATED Returns the list of all the keys associated with the given plugin.
-QStringList ContextRegistryInfo::listKeysForPlugin(QString plugin) const
-{
- contextWarning() << F_DEPRECATION << "ContextRegistryInfo::listKeysForPlugin() is deprecated.";
-
- QSet<QString> keys;
-
- foreach (QString key, listKeys()) {
- foreach (ContextProviderInfo info, InfoBackend::instance()->providersForKey(key)) {
- if (info.plugin == plugin) {
- keys.insert(key);
- }
- }
-
- }
-
- return keys.toList();
-}
-
-/// DEPRECATED Returns the list of all unique providers in the registry.
-/// The lists consist of strings with dbus names of the providers.
-QStringList ContextRegistryInfo::listProviders() const
-{
- contextWarning() << F_DEPRECATION << "ContextRegistryInfo::listProviders() is deprecated.";
-
- QSet<QString> providers;
-
- foreach (QString key, listKeys()) {
- foreach (ContextProviderInfo info, InfoBackend::instance()->providersForKey(key)) {
- if (info.plugin == "contextkit-dbus") {
- providers.insert(info.constructionString.split(":").last());
- }
- }
- }
-
- return providers.toList();
-}
-
-/// DEPRECATED Returns the list of all unique plugins in the registry.
-QStringList ContextRegistryInfo::listPlugins() const
-{
- contextWarning() << F_DEPRECATION << "ContextRegistryInfo::listPlugins() is deprecated.";
-
- QSet<QString> plugins;
-
- foreach (QString key, listKeys()) {
- foreach (ContextProviderInfo info, InfoBackend::instance()->providersForKey(key)) {
- plugins.insert(info.plugin);
- }
- }
-
- return plugins.toList();
-}
-
-/// Returns the name of the currently used registry backend. Ie. "cdb" or "xml".
-QString ContextRegistryInfo::backendName() const
-{
- return InfoBackend::instance()->name();
-}
-
-/* Slots */
-
-/// This is connected to the \a keysChanged of the actual info backend instance.
-/// Will be removed when deprecated keysChanged() signal is removed.
-void ContextRegistryInfo::onKeysChanged(const QStringList& currentKeys)
-{
- emit(keysChanged(currentKeys));
-}
-
-/// This is connected to the \a keysAdded of the actual info backend instance.
-/// Will be removed when deprecated keysAdded() signal is removed.
-void ContextRegistryInfo::onKeysAdded(const QStringList& newKeys)
-{
- emit(keysAdded(newKeys));
-}
-
-/// This is connected to the \a keysRemoved of the actual info backend instance.
-/// Will be removed when deprecated keysRemoved() signal is removed.
-void ContextRegistryInfo::onKeysRemoved(const QStringList& removedKeys)
-{
- emit(keysRemoved(removedKeys));
-}
-
-/// Called when people connect to signals. Used to emit deprecation warnings
-/// when people connect to deprecated signals.
-void ContextRegistryInfo::connectNotify(const char *signal)
-{
- QObject::connectNotify(signal);
-
- if (signal == SIGNAL(keysChanged(QStringList)))
- contextWarning() << F_DEPRECATION << "ContextRegistryInfo::keysChanged signal is deprecated.";
- else if (signal == SIGNAL(keysAdded(QStringList)))
- contextWarning() << F_DEPRECATION << "ContextRegistryInfo::keysAdded signal is deprecated.";
- else if (signal == SIGNAL(keysRemoved(QStringList)))
- contextWarning() << F_DEPRECATION << "ContextRegistryInfo::keysRemoved signal is deprecated.";
-}
-
-/// This is connected to the \a listChanged of the actual info backend instance.
-/// Gets called when the list of keys changes.
-void ContextRegistryInfo::onListChanged()
-{
- emit changed();
-}
diff --git a/libcontextsubscriber/src/contextregistryinfo.h b/libcontextsubscriber/src/contextregistryinfo.h
deleted file mode 100644
index 55a5fb2a..00000000
--- a/libcontextsubscriber/src/contextregistryinfo.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef CONTEXTREGISTRYINFO_H
-#define CONTEXTREGISTRYINFO_H
-
-#include <QVariant>
-#include <QStringList>
-#include <QObject>
-
-class ContextRegistryInfo : public QObject
-{
- Q_OBJECT
-
-public:
-
- static ContextRegistryInfo* instance(const QString &backendName = "");
-
- QStringList listKeys() const;
- QStringList listKeys(QString providername) const;
- QStringList listKeysForPlugin(QString plugin) const;
- QStringList listProviders() const;
- QStringList listPlugins() const;
- QString backendName() const;
-
-private:
- ContextRegistryInfo() {}; ///< Private constructor. Do not use.
- ContextRegistryInfo(const ContextRegistryInfo&); ///< Private constructor. Do not use.
- ContextRegistryInfo& operator=(const ContextRegistryInfo&); ///< Private operator. Do not use.
-
- /// Holds the actual pointer to the singelton instance.
- /// Mutex protected during creation.
- static ContextRegistryInfo* registryInstance;
-
-protected:
- void connectNotify(const char *signal);
-
-private slots:
- void onKeysChanged(const QStringList& currentKeys);
- void onKeysAdded(const QStringList& newKeys);
- void onKeysRemoved(const QStringList& removedKeys);
- void onListChanged();
-
-signals:
- /// DEPRECATED use changed signal instead.
- /// Emitted when the registry changes. For performance reasons
- /// this is not a strict signal - it's emitted also even when no actual
- /// changes happened to the key content. For strict monitoring of a partular
- /// key use the \a ContextPropertyInfo.
- /// \param currentKeys List of all the keys that are now in the registry.
- void keysChanged(const QStringList& currentKeys);
-
- /// DEPRECATED use changed signal instead.
- /// Emitted when new keys become availible in the registry.
- /// The list contains only the new keys.
- /// \param newKeys New keys that appeared in the regisitry.
- void keysAdded(const QStringList& newKeys);
-
- /// DEPRECATED use changed signal instead.
- /// Emitted when keys disappear (are removed) from the registry.
- /// The list contains only the removed keys.
- /// \param removedKeys The list of removed keys.
- void keysRemoved(const QStringList& removedKeys);
-
- /// Emitted when the list of provided keys changes (keys were
- /// added or removed). This is not a strict signal - it's possible
- /// for the emission to happen even if no actual change
- /// happened.
- void changed();
-
- friend class ContextRegistryInfoUnitTest;
-};
-
-#endif
diff --git a/libcontextsubscriber/src/dbusnamelistener.cpp b/libcontextsubscriber/src/dbusnamelistener.cpp
deleted file mode 100644
index 2d7ae96e..00000000
--- a/libcontextsubscriber/src/dbusnamelistener.cpp
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "dbusnamelistener.h"
-#include "safedbuspendingcallwatcher.h"
-#include "sconnect.h"
-#include "logging.h"
-
-#include <QDBusConnectionInterface>
-#include <QPair>
-#include <QMap>
-#include <QString>
-
-namespace ContextSubscriber {
-
-/*! \class DBusNameListener
-
- \brief Listens for changes in a specific service name on a D-Bus bus,
- optionally gets the initial state of the service name.
-
- When you create an instance of this class, it won't open any D-Bus
- connections. When startListening is called, the instance connects to
- the NameOwnerChanged D-Bus signal. It can also check the current
- status of the service by executing an asynchronous NameHasOwner
- call.
-
- If the specified service appears on D-Bus, it will emit the \c
- nameAppeared() signal, if disappears, then the nameDisappeared()
- signal. An initial query and signal emission will be done if \c
- initialCheck is true, which is the default.
-
- Anytime you can check with <tt>isServicePresent()</tt> if according
- to our current knowledge (last signal emission) the service is
- present or not. This means that if \c initialCheck is false,
- <tt>isServicePresent()</tt> can return false, even though the service
- is present.
-*/
-DBusNameListener::DBusNameListener(QDBusConnection::BusType busType, const QString &busName, QObject *parent) :
- QObject(parent), servicePresent(Unknown), busType(busType), busName(busName), listeningStarted(false), connection(0)
-{
- // Don't do anything, until the user initiates the listening by calling startListening.
-}
-
-DBusNameListener::DBusNameListener(const QDBusConnection bus, const QString &busName, QObject *parent) :
- QObject(parent), servicePresent(Unknown), busName(busName), listeningStarted(false), connection(0)
-{
- // we copy the connection so we can safely delete it in the destructor
- connection = new QDBusConnection(bus);
-}
-
-DBusNameListener::~DBusNameListener()
-{
- delete connection;
- connection = 0;
-}
-
-/// Start listening to the NameOwnerChanged signal over D-Bus. If \a
-/// nameHasOwnerCheck is true, also send a NameHasOwner query to D-Bus
-/// (asyncronously).
-void DBusNameListener::startListening(bool nameHasOwnerCheck)
-{
- if (listeningStarted) return;
-
- listeningStarted = true;
- // if we were initialized without a connection, we have to create our own
- if (connection == 0) {
- if (busType == QDBusConnection::SystemBus) {
- connection = new QDBusConnection(QDBusConnection::systemBus());
- }
- else if (busType == QDBusConnection::SessionBus) {
- connection = new QDBusConnection(QDBusConnection::sessionBus());
- }
- else {
- return;
- }
- }
-
- sconnect(connection->interface(),
- SIGNAL(serviceOwnerChanged(const QString&, const QString&, const QString&)),
- this,
- SLOT(onServiceOwnerChanged(const QString&, const QString&, const QString&)));
-
- // Check if the service is already there
- if (nameHasOwnerCheck) {
- if (connection->isConnected() == false) {
- setServiceGone();
- }
- QDBusPendingCall nameHasOwnerCall = connection->interface()->asyncCall("NameHasOwner", busName);
- SafeDBusPendingCallWatcher *watcher = new SafeDBusPendingCallWatcher(nameHasOwnerCall, this);
- sconnect(watcher, SIGNAL(finished(QDBusPendingCallWatcher *)),
- this, SLOT(onNameHasOwnerFinished(QDBusPendingCallWatcher *)));
- }
-}
-
-/// This slot is called when DBusNameOwnerChanged signal arrives and
-/// it just filters the name and if we are interested in the name it
-/// emits the <tt>nameAppeared()</tt> or <tt>nameDisappeared()</tt>
-/// signal.
-void DBusNameListener::onServiceOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner)
-{
- contextDebug() << "name owner change" << name << oldOwner << newOwner;
- if (name == busName) {
- if (oldOwner == "") {
- setServicePresent();
- } else if (newOwner == "") {
- setServiceGone();
- }
- }
-}
-
-void DBusNameListener::setServicePresent()
-{
- if (servicePresent != Present) {
- servicePresent = Present;
- emit nameAppeared();
- }
-}
-
-void DBusNameListener::setServiceGone()
-{
- if (servicePresent != NotPresent) {
- servicePresent = NotPresent;
- emit nameDisappeared();
- }
-}
-
-/// Handling of the asynchronous reply of the initial query.
-void DBusNameListener::onNameHasOwnerFinished(QDBusPendingCallWatcher* watcher)
-{
- QDBusPendingReply<bool> reply = *watcher;
- if (reply.isError() == false && reply.argumentAt<0>() == true) {
- // The name has an owner
- setServicePresent();
- }
- else {
- // PropertyHandle's are waiting for any signal if they have initiated the
- // "is commander there" check. So notify also the opposite case.
- setServiceGone();
- }
-}
-
-/// Return our current understanding (not present, present, unknown)
-/// of the presence of the watched service.
-DBusNameListener::ServicePresence DBusNameListener::isServicePresent() const
-{
- return servicePresent;
-}
-
-} // end namespace
diff --git a/libcontextsubscriber/src/dbusnamelistener.h b/libcontextsubscriber/src/dbusnamelistener.h
deleted file mode 100644
index 5efcf9c2..00000000
--- a/libcontextsubscriber/src/dbusnamelistener.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef DBUSNAMELISTENER_H
-#define DBUSNAMELISTENER_H
-
-#include <QObject>
-#include <QString>
-#include <QDBusConnection>
-
-class QDBusPendingCallWatcher;
-
-namespace ContextSubscriber {
-
-
-class DBusNameListener : public QObject
-{
- Q_OBJECT
-public:
- enum ServicePresence {NotPresent = 0, Present, Unknown};
-
- explicit DBusNameListener(QDBusConnection::BusType busType, const QString &busName, QObject *parent = 0);
- explicit DBusNameListener(const QDBusConnection bus, const QString &busName, QObject *parent = 0);
- virtual ~DBusNameListener();
-
- void startListening(bool nameHasOwnerCheck);
-
- ServicePresence isServicePresent() const;
-
-private slots:
- void onServiceOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner);
- void onNameHasOwnerFinished(QDBusPendingCallWatcher* watcher);
-
-private:
- ServicePresence servicePresent; ///< Our current understanding about the service name's state
- QDBusConnection::BusType busType; ///< The service bus type we are interested in
- QString busName; ///< The service name we are interested in
- bool listeningStarted;
- QDBusConnection* connection;
-
- void setServicePresent();
- void setServiceGone();
-
-signals:
- void nameAppeared();
- void nameDisappeared();
-};
-
-} // end namespace
-
-#endif
diff --git a/libcontextsubscriber/src/handlesignalrouter.cpp b/libcontextsubscriber/src/handlesignalrouter.cpp
deleted file mode 100644
index aa9e6372..00000000
--- a/libcontextsubscriber/src/handlesignalrouter.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "handlesignalrouter.h"
-#include "propertyhandle.h"
-
-namespace ContextSubscriber {
-
-/*!
- \class HandleSignalRouter
-
- \brief Routes the <tt>valueChanged()</tt> and the
- <tt>subscribeFinished()</tt> signals to the correct \c
- PropertyHandle object.
-
- This is an optimization, so we don't have to connect all of the
- providers to all of the <tt>PropertyHandle</tt>s of that provider.
-*/
-
-
-HandleSignalRouter HandleSignalRouter::myInstance;
-
-HandleSignalRouter::HandleSignalRouter()
-{
-}
-
-HandleSignalRouter* HandleSignalRouter::instance()
-{
- return &myInstance;
-}
-
-void HandleSignalRouter::onValueChanged(QString key)
-{
- PropertyHandle* handle = PropertyHandle::instance(key);
- handle->onValueChanged();
-}
-
-void HandleSignalRouter::onSubscribeFinished(Provider *provider, QString key)
-{
- PropertyHandle* handle = PropertyHandle::instance(key);
- handle->setSubscribeFinished(provider);
-}
-
-} // end namespace
diff --git a/libcontextsubscriber/src/handlesignalrouter.h b/libcontextsubscriber/src/handlesignalrouter.h
deleted file mode 100644
index 59a45c6e..00000000
--- a/libcontextsubscriber/src/handlesignalrouter.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef HANDLESIGNALROUTER_H
-#define HANDLESIGNALROUTER_H
-
-#include <QObject>
-#include <QString>
-#include <QVariant>
-
-namespace ContextSubscriber {
-
-class Provider;
-
-class HandleSignalRouter : public QObject
-{
- Q_OBJECT
-public:
- static HandleSignalRouter* instance();
-
-public slots:
- void onValueChanged(QString key);
- void onSubscribeFinished(Provider *provider, QString key);
-
-private:
- HandleSignalRouter();
- static HandleSignalRouter myInstance; ///< Singleton instance
-};
-
-} // end namespace
-
-#endif
diff --git a/libcontextsubscriber/src/infobackend.cpp b/libcontextsubscriber/src/infobackend.cpp
deleted file mode 100644
index 6b5e0e50..00000000
--- a/libcontextsubscriber/src/infobackend.cpp
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "infobackend.h"
-#include "infoxmlbackend.h"
-#include "infocdbbackend.h"
-#include <QMutex>
-#include <QDebug>
-#include <QCoreApplication>
-#include <QMutexLocker>
-
-
-/*!
- \class InfoBackend
-
- \brief An abstract (pure virtual) singleton class that represents the actual
- registry backend.
-
- This class is not exported in the public API. It provides a list methods that need
- to be implemented by a concrete registry backend implementation. The InfoBackend instance
- is a singleton that is created on first access. This class (the instance of it) is
- used by ContextRegistryInfo and ContextPropertyInfo classes.
-*/
-
-InfoBackend* InfoBackend::backendInstance = NULL;
-
-/// Constructs the object. The \a connectCount is 0 on start.
-InfoBackend::InfoBackend(QObject *parent) : QObject(parent)
-{
- connectCount = 0;
-}
-
-/// Returns the actual singleton instance, creates it on first access. Mutex-protected.
-/// ContextRegistryInfo and ContextPropertyInfo use this method to access the backend.
-/// The optional \a backendName specifies the backend to force, ie: 'xml' or 'cdb'.
-InfoBackend* InfoBackend::instance(const QString &backendName)
-{
- static QMutex mutex;
- QMutexLocker locker(&mutex);
- if (!backendInstance)
- {
- // Backend instance doesn't exist -> create it
- if (backendName == "xml")
- backendInstance = new InfoXmlBackend;
- else if (backendName == "cdb")
- backendInstance = new InfoCdbBackend;
- else {
- if (InfoCdbBackend::databaseExists())
- backendInstance = new InfoCdbBackend;
- else
- backendInstance = new InfoXmlBackend;
- }
-
- // Move the backend to the main thread
- backendInstance->moveToThread(QCoreApplication::instance()->thread());
-
- qAddPostRoutine(destroyInstance);
- }
-
- return backendInstance;
-}
-
-/// Given the \a currentKeys list of keys and the \a oldKeys list of keys,
-/// emit a signal containing the new keys (keys that are in \a currentKeys
-/// but are no in \a oldKeys). To be removed in future.
-void InfoBackend::checkAndEmitKeysAdded(const QStringList &currentKeys,
- const QStringList &oldKeys)
-{
- QStringList addedKeys;
- foreach (QString key, currentKeys) {
- if (! oldKeys.contains(key))
- addedKeys << key;
- }
-
- if (addedKeys.size() > 0)
- emit keysAdded(addedKeys);
-}
-
-/// Given the \a currentKeys list of keys and the \a oldKeys list of keys,
-/// emit a signal containing the removed keys (keys that are in \a oldKeys
-/// but are no in \a currentKeys). To be removed in future.
-void InfoBackend::checkAndEmitKeysRemoved(const QStringList &currentKeys,
- const QStringList &oldKeys)
-{
- QStringList removedKeys;
- foreach (QString key, oldKeys) {
- if (! currentKeys.contains(key))
- removedKeys << key;
- }
-
- if (removedKeys.size() > 0)
- emit keysRemoved(removedKeys);
-}
-
-/// Given the \a currentKeys list of keys and the \a oldKeys list of keys,
-/// emit a keyChanged signal containing the union of those two lists.
-void InfoBackend::checkAndEmitKeyChanged(const QStringList &currentKeys,
- const QStringList &oldKeys)
-{
- foreach(QString key, oldKeys) {
- emit keyChanged(key);
- }
-
- foreach(QString key, currentKeys) {
- if (! oldKeys.contains(key))
- emit keyChanged(key);
- }
-}
-
-/* Protected */
-
-/// Called each time we have a signal connection. Increases the connect count.
-void InfoBackend::connectNotify(const char *signal)
-{
- QObject::connectNotify(signal);
- connectCount++;
-}
-
-/// Called each time we have a signal disconnection. Decreases the connect count.
-void InfoBackend::disconnectNotify(const char *signal)
-{
- QObject::disconnectNotify(signal);
- connectCount--;
-}
-
-/* Private */
-
-/// Called before the application is destroyed. Deletes the backend instance.
-/// This is to ensure that the QFileSystemWatcher in backends gets deleted
-/// before the application terminates (otherwise weird issues follow).
-void InfoBackend::destroyInstance()
-{
- delete backendInstance;
- backendInstance = NULL;
-}
-
diff --git a/libcontextsubscriber/src/infobackend.h b/libcontextsubscriber/src/infobackend.h
deleted file mode 100644
index 24c7d089..00000000
--- a/libcontextsubscriber/src/infobackend.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef INFOBACKEND_H
-#define INFOBACKEND_H
-
-#include <QVariant>
-#include <QStringList>
-#include <QObject>
-#include "contextproviderinfo.h"
-
-#define BACKEND_COMPATIBILITY_NAMESPACE "http://contextkit.freedesktop.org/Provider"
-
-class InfoBackend : public QObject
-{
- Q_OBJECT
-
-public:
-
- static InfoBackend* instance(const QString &backendName = "");
-
- /// Returns the name of the backend, ie: 'xml'.
- virtual QString name() const = 0;
-
- /// Returns the list of all the keys in the registry.
- virtual QStringList listKeys() const = 0;
-
- /// Returns a type for the given \a key.
- virtual QString typeForKey(QString key) const = 0;
-
- /// Returns the documentation for the given \a key name.
- virtual QString docForKey(QString key) const = 0;
-
- /// Returns true if the given key exists.
- virtual bool keyDeclared(QString key) const = 0;
-
- /// Returns a list of providers for the given key.
- virtual const QList<ContextProviderInfo> providersForKey(QString key) const = 0;
-
-signals:
- /// Emitted when key list changes. ContextRegistryInfo listens on that.
- void keysChanged(const QStringList& currentKeys);
-
- /// Emitted when new keys are added. ContextRegistryInfo listens on that.
- void keysAdded(const QStringList& newKeys);
-
- /// Emitted when keys are removed. ContextRegistryInfo listens on that.
- void keysRemoved(const QStringList& removedKeys);
-
- /// Emitted when key data/info changes. ContextPropertyInfo instances listen on that.
- void keyChanged(const QString& key);
-
- /// Emitted when the key list changes. ContextRegistryInfo listens on that.
- void listChanged();
-
-protected:
- virtual void connectNotify(const char *signal);
- virtual void disconnectNotify(const char *signal);
-
-private:
- int connectCount; ///< Number of connections to signals. Used to optimized signal emission when 0.
-
- InfoBackend(QObject *parent = 0);
-
- /// Private constructor. Do not use.
- InfoBackend(const InfoBackend&);
-
- void checkAndEmitKeysAdded(const QStringList &currentKeys, const QStringList &oldKeys);
- void checkAndEmitKeysRemoved(const QStringList &currentKeys, const QStringList &oldKeys);
- void checkAndEmitKeyChanged(const QStringList &currentKeys, const QStringList &oldKeys);
-
- /// Private operator. Do not use.
- InfoBackend& operator=(const InfoBackend&);
-
- static InfoBackend* backendInstance; ///< Holds a pointer to the instance of the singelton.
- static void destroyInstance();
-
- friend class InfoXmlBackend;
- friend class InfoCdbBackend;
- friend class InfoTestBackend;
- friend class InfoXmlBackendUnitTest;
- friend class InfoCdbBackendUnitTest;
- friend class InfoBackendUnitTest;
-
-};
-
-#endif // INFOBACKEND_H
diff --git a/libcontextsubscriber/src/infocdbbackend.cpp b/libcontextsubscriber/src/infocdbbackend.cpp
deleted file mode 100644
index 44acef51..00000000
--- a/libcontextsubscriber/src/infocdbbackend.cpp
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <QFileInfo>
-#include <QDir>
-#include <QDebug>
-#include <QFile>
-#include <stdlib.h>
-#include <QHash>
-#include "sconnect.h"
-#include "infocdbbackend.h"
-#include "logging.h"
-#include "loggingfeatures.h"
-#include "contextproviderinfo.h"
-
-/*!
- \class InfoCdbBackend
-
- \brief Implements the InfoBackend for reading data from a cdb database.
-
- This class is not exported in the public API. It does not cache any data
- to optimize the memory consumption. It's assumed that most data is anyways
- cached (as needed) in the ContextPropertyInfo and the cdb key-based access
- (no enumetation) is fast anyways. It observers the \c cache.cdb
- with a file system watcher.
-*/
-
-InfoCdbBackend::InfoCdbBackend(QObject *parent)
- : InfoBackend(parent), reader(InfoCdbBackend::databasePath())
-{
- contextDebug() << F_CDB << "Initializing cdb backend with database:" << InfoCdbBackend::databasePath();
-
- sconnect(&watcher, SIGNAL(fileChanged(QString)), this, SLOT(onDatabaseFileChanged(QString)));
- sconnect(&watcher, SIGNAL(directoryChanged(QString)), this, SLOT(onDatabaseDirectoryChanged(QString)));
- watch();
- checkCompatibility();
-}
-
-/// Returns 'cdb'.
-QString InfoCdbBackend::name() const
-{
- return QString("cdb");
-}
-
-QStringList InfoCdbBackend::variantListToStringList(const QVariantList &l)
-{
- QStringList ret;
- foreach (QVariant v, l)
- ret << v.toString();
-
- return ret;
-}
-
-QStringList InfoCdbBackend::listKeys() const
-{
- if (databaseCompatible)
- return variantListToStringList(reader.valuesForKey("KEYS"));
- else
- return QStringList();
-}
-
-QString InfoCdbBackend::typeForKey(QString key) const
-{
- if (databaseCompatible)
- return reader.valueForKey(key + ":KEYTYPE").toString();
- else
- return QString();
-}
-
-QString InfoCdbBackend::docForKey(QString key) const
-{
- if (databaseCompatible)
- return reader.valueForKey(key + ":KEYDOC").toString();
- else
- return QString();
-}
-
-bool InfoCdbBackend::keyDeclared(QString key) const
-{
- if (!databaseCompatible)
- return false;
- else if (reader.valuesForKey("KEYS").contains(key))
- return true;
- else
- return false;
-}
-
-/// Returns true if the database file is present.
-bool InfoCdbBackend::databaseExists()
-{
- QFile file(databasePath());
- return file.exists();
-}
-
-/// Returns the full path to the database.
-/// Takes the \c CONTEXT_PROVIDERS env variable into account.
-QString InfoCdbBackend::databasePath()
-{
- const char *regpath = getenv("CONTEXT_PROVIDERS");
- if (! regpath)
- regpath = DEFAULT_CONTEXT_PROVIDERS;
-
- return QDir(regpath).filePath("cache.cdb");
-}
-
-/// Returns the full path to the database directory.
-/// Takes the \c CONTEXT_PROVIDERS env variable into account.
-QString InfoCdbBackend::databaseDirectory()
-{
- const char *regpath = getenv("CONTEXT_PROVIDERS");
- if (! regpath)
- regpath = DEFAULT_CONTEXT_PROVIDERS;
-
- return QString(regpath);
-}
-
-/* Private */
-
-/// Update the database compatibility field.
-void InfoCdbBackend::checkCompatibility()
-{
- if (!reader.isReadable())
- databaseCompatible = false;
- else {
- QString version = reader.valueForKey("VERSION").toString();
- if (version != "" && version != BACKEND_COMPATIBILITY_NAMESPACE) {
- databaseCompatible = false;
- contextWarning() << F_CDB << "Incompatible database version:" << version;
- } else
- databaseCompatible = true;
- }
-}
-
-/// Start watching directory and database path IF we're not watching
-/// it already and IF the directory/file exists.
-void InfoCdbBackend::watch()
-{
- if (! watcher.directories().contains(InfoCdbBackend::databaseDirectory()) &&
- QDir(InfoCdbBackend::databaseDirectory()).exists(InfoCdbBackend::databaseDirectory()))
- watcher.addPath(InfoCdbBackend::databaseDirectory());
- if (! watcher.files().contains(InfoCdbBackend::databasePath()) &&
- QFile::exists(InfoCdbBackend::databasePath()))
- watcher.addPath(InfoCdbBackend::databasePath());
-}
-
-/* Slots */
-
-/// Called when the database changes. Reopens the database and emits
-/// the change signals. If database does not exist it bails out but keeps observing.
-void InfoCdbBackend::onDatabaseFileChanged(const QString &path)
-{
- QStringList oldKeys = listKeys();
-
- contextDebug() << F_CDB << InfoCdbBackend::databasePath() << "changed, re-opening database.";
-
- reader.reopen();
- watch();
-
- // Check the version
- if (reader.isReadable())
- checkCompatibility();
-
- // If nobody is watching us anyways, drop out now and skip
- // the further processing. This could be made more granular
- // (ie. in many cases nobody will be watching on added/removed)
- // but will be watching on changed.
- if (connectCount == 0)
- return;
-
- QStringList currentKeys = listKeys();
-
- // Emissions
- checkAndEmitKeysAdded(currentKeys, oldKeys); // DEPRECATED emission
- checkAndEmitKeysRemoved(currentKeys, oldKeys); // DEPRECATED emission
- emit keysChanged(listKeys()); // DEPRECATED emission
-
- emit listChanged();
- checkAndEmitKeyChanged(currentKeys, oldKeys);
-}
-
-/// Called when the directory with cache.db chanes. We start to observe this
-/// directory only when we don't have the cache.db in the first place.
-void InfoCdbBackend::onDatabaseDirectoryChanged(const QString &path)
-{
- if (reader.isReadable() != QFile::exists(InfoCdbBackend::databasePath()))
- onDatabaseFileChanged(path);
-}
-
-const QList<ContextProviderInfo> InfoCdbBackend::providersForKey(QString key) const
-{
- QVariant providers = reader.valueForKey(key + ":PROVIDERS");
- QList<ContextProviderInfo> lst;
-
- if (!databaseCompatible)
- return lst;
-
- foreach (QVariant variant, providers.toList())
- lst << ContextProviderInfo(variant.toHash().value("plugin").toString(),
- variant.toHash().value("constructionString").toString());
-
- return lst;
-}
diff --git a/libcontextsubscriber/src/infocdbbackend.h b/libcontextsubscriber/src/infocdbbackend.h
deleted file mode 100644
index 28a51a1d..00000000
--- a/libcontextsubscriber/src/infocdbbackend.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef INFOCDBBACKEND_H
-#define INFOCDBBACKEND_H
-
-#include <QStringList>
-#include <QObject>
-#include <QString>
-#include <QFileSystemWatcher>
-#include "cdbreader.h"
-#include "infobackend.h"
-#include "contextproviderinfo.h"
-
-class InfoCdbBackend : public InfoBackend
-{
- Q_OBJECT
-
-public:
- explicit InfoCdbBackend(QObject *parent = 0);
-
- virtual QString name() const;
- virtual QStringList listKeys() const;
- virtual QString typeForKey(QString key) const;
- virtual QString docForKey(QString key) const;
- virtual bool keyDeclared(QString key) const;
- virtual const QList<ContextProviderInfo> providersForKey(QString key) const;
-
- static QString databaseDirectory();
- static QString databasePath();
- static bool databaseExists();
-
-private:
- QFileSystemWatcher watcher; ///< A watched object obsering the database file. Delivers synced notifications.
- CDBReader reader; ///< The cdb reader object used to access the cdb database.
- bool databaseCompatible; ///< If the currently open database is compatible (versions match).
- void watch();
- static QStringList variantListToStringList(const QVariantList &l);
- void checkCompatibility();
-
-private slots:
- void onDatabaseFileChanged(const QString &path);
- void onDatabaseDirectoryChanged(const QString &path);
-};
-
-#endif // INFOCDBBACKEND_H
diff --git a/libcontextsubscriber/src/infokeydata.h b/libcontextsubscriber/src/infokeydata.h
deleted file mode 100644
index 0ea20325..00000000
--- a/libcontextsubscriber/src/infokeydata.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef INFOKEYDATA_H
-#define INFOKEYDATA_H
-
-#include <QString>
-
-/*!
- \struct InfoKeyData
-
- \brief Simple storage class that groups info about a given key.
-
- This struct is not a part of the public API. It's used by the InfoXmlBackend that
- keeps in memory a hash of InfoKeyData instances for each key.
-*/
-
-struct InfoKeyData
-{
- QString name; ///< Name of the we're storing data for.
- QString type; ///< Type of the key.
- QString doc; ///< Doc for the key.
-};
-
-#endif // INFOKEYDATA_H
diff --git a/libcontextsubscriber/src/infoxmlbackend.cpp b/libcontextsubscriber/src/infoxmlbackend.cpp
deleted file mode 100644
index de4912ea..00000000
--- a/libcontextsubscriber/src/infoxmlbackend.cpp
+++ /dev/null
@@ -1,360 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <QFileInfo>
-#include <QDir>
-#include <QMutex>
-#include <QXmlSimpleReader>
-#include <QXmlInputSource>
-#include <QFile>
-#include <QList>
-#include <stdlib.h>
-#include "sconnect.h"
-#include "infoxmlbackend.h"
-#include "logging.h"
-#include "loggingfeatures.h"
-#include "contextproviderinfo.h"
-#include "nanoxml.h"
-
-/*!
- \class InfoXmlBackend
-
- \brief Implements the InfoBackend for reading data from a directory
- with xml files.
-
- This class is not exported in the public API. It keeps all the data cached
- in the memory. It's assumed that this backend is not going to be used live in
- production systems and does not need to be ultra-fast (instead, implementation
- simplicity and corectness are preffered). For fast backend see the InfoCdbBackend.
-*/
-
-InfoXmlBackend::InfoXmlBackend(QObject *parent)
- : InfoBackend(parent)
-{
- /* Thinking about locking... the watcher notifications are delivered synced,
- so asuming the changes in the dir are atomic this is all we need. */
-
- contextDebug() << F_XML << "Initializing xml backend with path:" << InfoXmlBackend::registryPath();
-
- QDir dir = QDir(InfoXmlBackend::registryPath());
- if (! dir.exists() || ! dir.isReadable()) {
- contextWarning() << "Registry path" << InfoXmlBackend::registryPath()
- << "is not a directory or is not readable!";
- } else {
- watcher.addPath(InfoXmlBackend::registryPath());
- sconnect(&watcher, SIGNAL(directoryChanged(QString)), this, SLOT(onDirectoryChanged(QString)));
- sconnect(&watcher, SIGNAL(fileChanged(QString)), this, SLOT(onFileChanged(QString)));
- }
-
- regenerateKeyDataList();
-}
-
-/// Returns 'xml'.
-QString InfoXmlBackend::name() const
-{
- return QString("xml");
-}
-
-QStringList InfoXmlBackend::listKeys() const
-{
- QStringList list;
-
- // FIXME Hmm, we could return just the keyDataHash.keys itself here...
- foreach (QString key, keyDataHash.keys()) {
- list << keyDataHash.value(key).name;
- }
-
- return list;
-}
-
-QString InfoXmlBackend::typeForKey(QString key) const
-{
- if (! keyDataHash.contains(key))
- return "";
-
- return keyDataHash.value(key).type;
-}
-
-QString InfoXmlBackend::docForKey(QString key) const
-{
- if (! keyDataHash.contains(key))
- return "";
-
- return keyDataHash.value(key).doc;
-}
-
-bool InfoXmlBackend::keyDeclared(QString key) const
-{
- if (keyDataHash.contains(key))
- return true;
- else
- return false;
-}
-
-/// Returns the full path to the registry directory. Takes the
-/// \c CONTEXT_PROVIDERS env variable into account.
-QString InfoXmlBackend::registryPath()
-{
- const char *regpath = getenv("CONTEXT_PROVIDERS");
- if (! regpath)
- regpath = DEFAULT_CONTEXT_PROVIDERS;
-
- return QString(regpath);
-}
-
-/// Returns the full path to the core property declaration file. Takes
-/// the \c CONTEXT_CORE_DECLARATIONS env variable into account.
-QString InfoXmlBackend::coreDeclPath()
-{
- const char *corepath = getenv("CONTEXT_CORE_DECLARATIONS");
- if (! corepath)
- corepath = DEFAULT_CONTEXT_CORE_DECLARATIONS;
-
- return QString(corepath);
-}
-
-/* Slots */
-
-/// Called when one of the parsed XML files changed. This
-/// triggers a whole registry rebuild + signal emissions.
-void InfoXmlBackend::onFileChanged(const QString &path)
-{
- // If one of the watched xml files changed this it pretty much
- // an unconditional reload message for us.
-
- contextDebug() << F_XML << path << "changed.";
-
- QStringList oldKeys = listKeys();
- regenerateKeyDataList();
- QStringList currentKeys = listKeys();
-
- // In the cdb (fast) backend we do check if anybody is watching
- // before doing this list processing. But in xml backend the perf
- // is not an issue.
-
- // Emissions
- checkAndEmitKeysAdded(currentKeys, oldKeys); // DEPRECATED emission
- checkAndEmitKeysRemoved(currentKeys, oldKeys); // DEPRECATED emission
- emit keysChanged(listKeys()); // DEPRECATED emission
-
- emit listChanged();
- checkAndEmitKeyChanged(currentKeys, oldKeys);
-}
-
-/// Called when the registry directory changed (ie. file removed or added).
-/// Triggers a whole registry rebuild + signal emissions. It detects a situation
-/// when a added/removed file was not a parsed(xml) file.
-void InfoXmlBackend::onDirectoryChanged(const QString &path)
-{
- // It could be that some other file was added to the directory which
- // we don't care about anyways.
-
- QDir dir = QDir(registryPath());
- dir.setFilter(QDir::Files);
- dir.setNameFilters(QStringList("*.context"));
-
- // It's enough for us to compare sizes here, not actual content (filenames). The
- // latter case is always handled by the fileChanged.
-
- if (dir.entryInfoList().size() == countOfFilesInLastParse)
- return;
-
- contextDebug() << F_XML << registryPath() << "directory changed.";
-
- QStringList oldKeys = listKeys();
- regenerateKeyDataList();
- QStringList currentKeys = listKeys();
-
- // In the cdb (fast) backend we do check if anybody is watching
- // before doing this list processing. But in xml backend the perf
- // is not an issue.
-
- // Emissions
- checkAndEmitKeysAdded(currentKeys, oldKeys); // DEPRECATED emission
- checkAndEmitKeysRemoved(currentKeys, oldKeys); // DEPRECATED emission
- emit keysChanged(listKeys()); // DEPRECATED emission
-
- emit listChanged();
- checkAndEmitKeyChanged(currentKeys, oldKeys);
-}
-
-/* Private */
-
-/// Clears all the stored data about the registry and parses it
-/// all over again.
-void InfoXmlBackend::regenerateKeyDataList()
-{
- keyDataHash.clear();
- keyProvidersHash.clear();
- countOfFilesInLastParse = 0;
-
- // Stop watching all files. We do keep wathching the dir though.
- QStringList watchedFiles = watcher.files();
- if (watchedFiles.size() > 0)
- watcher.removePaths(watchedFiles);
-
- contextDebug() << F_XML << "Reading core declarations from:" << InfoXmlBackend::coreDeclPath();
- readKeyDataFromXml (InfoXmlBackend::coreDeclPath());
-
- contextDebug() << F_XML << "Re-reading xml contents from" << InfoXmlBackend::registryPath();
-
- // Read the core property declarations.
- // For each xml file in the registry we parse it and
- // add it to our hash. We did some sanity checks in the constructor
- // so we skip them now.
-
- QDir dir = QDir(registryPath());
-
- // Bail out now if no directory
- if (! dir.exists() || ! dir.isReadable())
- return;
-
- dir.setFilter(QDir::Files);
- dir.setNameFilters(QStringList("*.context"));
-
- QFileInfoList list = dir.entryInfoList();
- for (int i = 0; i < list.size(); ++i) {
- QFileInfo f = list.at(i);
- readKeyDataFromXml(f.filePath());
-
- if (! watcher.files().contains(f.filePath()))
- watcher.addPath(f.filePath());
-
- countOfFilesInLastParse++;
- }
-}
-
-/// Convert a subset of new-style type names to the currently used
-/// old-style type names. This way we can slowly fade in new-style
-/// types.
-QString InfoXmlBackend::canonicalizeType (const QString &type)
-{
- if (type == "bool")
- return "TRUTH";
- else if (type == "int32")
- return "INT";
- else if (type == "string")
- return "STRING";
- else if (type == "double")
- return "DOUBLE";
- else
- return type;
-}
-
-/// Parse the given QVariant tree which is supposed to be a key tree.
-void InfoXmlBackend::parseKey(const QVariant &keyTree, const QVariant &providerTree)
-{
- QString key = NanoXml::keyValue("name", keyTree).toString();
- QString plugin = NanoXml::keyValue("plugin", providerTree).toString();
- QString constructionString = NanoXml::keyValue("constructionString", providerTree).toString();
- QString type = canonicalizeType(NanoXml::keyValue("type", keyTree).toString());
- QString doc = NanoXml::keyValue("doc", keyTree).toString();
-
- // Warn about description mismatch or add new
- if (keyDataHash.contains(key)) {
- InfoKeyData keyData = keyDataHash.value(key);
-
- if (type != "" && keyData.type != type)
- contextWarning() << F_XML << key << "already has type declared -" << keyData.type;
-
- if (doc != "" && keyData.doc != doc)
- contextWarning() << F_XML << key << "already has doc declared -" << keyData.doc;
- } else {
- InfoKeyData keyData;
- keyData.name = key;
- keyData.type = type;
- keyData.doc = doc;
-
- contextDebug() << F_XML << "Adding new key" << key << "with type:" << keyData.type;
- keyDataHash.insert(key, keyData);
- }
-
- // Add provider details
- ContextProviderInfo providerInfo(plugin, constructionString);
-
- // Suport old-style XML...
- if (providerInfo.plugin == "") {
- QString currentProvider = NanoXml::keyValue("service", providerTree).toString();
- QString currentBus = NanoXml::keyValue("bus", providerTree).toString();
-
- if (currentBus != "" && currentProvider != "") {
- providerInfo.plugin = "contextkit-dbus";
- providerInfo.constructionString = currentBus + ":" + currentProvider;
- } else
- providerInfo.constructionString = "";
- }
-
- // If providerInfo is empty, do not add to the list
- if (providerInfo.plugin == "") {
- contextDebug() << F_XML << "Not adding provider info for key" << key << "no data";
- return;
- } else
- contextDebug() << F_XML << "Adding provider info for key" << key << "plugin:" << providerInfo.plugin << "constructionString:" << providerInfo.constructionString;
-
- // Add to the list of providers
- QList<ContextProviderInfo> list;
- if (keyProvidersHash.contains(key))
- list = keyProvidersHash.value(key);
-
- list.append(providerInfo);
- keyProvidersHash.insert(key, list);
-}
-
-/// Parses a given \a path file and adds it's contents to the hash.
-/// Also adds the file to the watcher (starts observing it).
-void InfoXmlBackend::readKeyDataFromXml(const QString &path)
-{
- contextDebug() << F_XML << "Reading keys from" << path;
-
- NanoXml nano(path);
-
- // Check if format is all ok
- if (nano.didFail()) {
- contextWarning() << F_XML << "Reading" << path << "failed, parsing error.";
- return;
- }
-
- // Check the version of the file
- if (nano.namespaceUri() != "" && nano.namespaceUri() != BACKEND_COMPATIBILITY_NAMESPACE) {
- contextWarning() << F_XML << "Reading" << path << "failed, invalid version:" << nano.namespaceUri();
- return;
- }
-
- if (nano.root().toList().at(0).toString() == "provider" ||
- nano.root().toList().at(0).toString() == "properties") {
- // One provider. Iterate over each key.
- foreach (QVariant keyTree, nano.keyValues("key")) {
- parseKey(keyTree, nano.root());
- }
- } else {
- // Multiple providers... iterate over providers and keys
- foreach (QVariant providerTree, nano.keyValues("provider")) {
- foreach (QVariant keyTree, NanoXml::keyValues("key", providerTree)) {
- parseKey(keyTree, providerTree);
- }
- }
- }
-}
-
-const QList<ContextProviderInfo> InfoXmlBackend::providersForKey(QString key) const
-{
- return keyProvidersHash.value(key);
-}
diff --git a/libcontextsubscriber/src/infoxmlbackend.h b/libcontextsubscriber/src/infoxmlbackend.h
deleted file mode 100644
index 00c9ef60..00000000
--- a/libcontextsubscriber/src/infoxmlbackend.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef INFOXMLBACKEND_H
-#define INFOXMLBACKEND_H
-
-#include <QStringList>
-#include <QObject>
-#include <QFileInfo>
-#include <QString>
-#include <QHash>
-#include <QFileSystemWatcher>
-#include "infobackend.h"
-#include "infokeydata.h"
-#include "contextproviderinfo.h"
-
-class InfoXmlBackend : public InfoBackend
-{
- Q_OBJECT
-
-public:
- explicit InfoXmlBackend(QObject *parent = 0);
-
- virtual QString name() const;
- virtual QStringList listKeys() const;
- virtual QString typeForKey(QString key) const;
- virtual QString docForKey(QString key) const;
- virtual bool keyDeclared(QString key) const;
- virtual const QList<ContextProviderInfo> providersForKey(QString key) const;
-
- static QString registryPath();
- static QString coreDeclPath();
-
-private slots:
- void onDirectoryChanged(const QString &path);
- void onFileChanged(const QString &path);
-
-private:
- QFileSystemWatcher watcher; ///< A watched object obsering the database file. Delivers synced notifications.
- QHash <QString, InfoKeyData> keyDataHash; ///< This hash contains the full state of registry in memory.
- QHash <QString, QList<ContextProviderInfo> > keyProvidersHash; ///< This hash contains providers for keys.
- int countOfFilesInLastParse; ///< The number of xml files we parsed in last registry update.
-
- void regenerateKeyDataList();
- void readKeyDataFromXml(const QString &path);
- QString canonicalizeType (const QString &type);
- void parseKey(const QVariant &keyTree, const QVariant &providerTree);
-};
-
-#endif // INFOXMLBACKEND_H
diff --git a/libcontextsubscriber/src/iproviderplugin.h b/libcontextsubscriber/src/iproviderplugin.h
deleted file mode 100644
index dcd4342c..00000000
--- a/libcontextsubscriber/src/iproviderplugin.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef IPROVIDERPLUGIN_H
-#define IPROVIDERPLUGIN_H
-
-#include <QObject>
-#include <QVariant>
-
-namespace ContextSubscriber {
-
-/* This is not a public API of ContextKit, please do not write third
- * party plugins for the ContextKit client library without first
- * contacting us.
- */
-
-class IProviderPlugin : public QObject
-{
- Q_OBJECT
-public:
- virtual void subscribe(QSet<QString> keys) = 0;
- virtual void unsubscribe(QSet<QString> keys) = 0;
-
-signals:
- void ready();
- void failed(QString error);
- void subscribeFinished(QString key);
- void subscribeFailed(QString failedKey, QString error);
- void valueChanged(QString key, QVariant value);
-};
-
-typedef IProviderPlugin* (*PluginFactoryFunc)(QString constructionString);
-
-}
-
-#endif
diff --git a/libcontextsubscriber/src/loggingfeatures.h b/libcontextsubscriber/src/loggingfeatures.h
deleted file mode 100644
index 060ff202..00000000
--- a/libcontextsubscriber/src/loggingfeatures.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef LOGGINGFEATURES_H
-#define LOGGINGFEATURES_H
-
-#define F_DEPRECATION (ContextFeature("deprecation"))
-#define F_THREADS (ContextFeature("threads"))
-#define F_XML (ContextFeature("xml"))
-#define F_CDB (ContextFeature("cdb"))
-#define F_DESTROY (ContextFeature("destroy"))
-#define F_PLUGINS (ContextFeature("plugins"))
-
-#endif
diff --git a/libcontextsubscriber/src/nanoxml.cpp b/libcontextsubscriber/src/nanoxml.cpp
deleted file mode 100644
index e7da9b60..00000000
--- a/libcontextsubscriber/src/nanoxml.cpp
+++ /dev/null
@@ -1,349 +0,0 @@
-/*
- * Copyright (C) 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "nanoxml.h"
-#include <QDebug>
-
-/*!
- \class NanoXml
-
- \brief Parses XML files into a nano dom.
-
- This class is not exported in the public API. It's used to parse a formatted
- XML into a nanodom tree. To learn about the nanadom please read the documentation
- on the desktop types.
-
- Short overview - the following XML is being turned into the following semantic
- structure:
-
- \code
- <key name="Example.Random" type="string">
- <doc>A random property.</doc>
- </key>
-
- ['key',
- ['name', 'Example.Random' ],
- ['type', 'string' ],
- ['doc', 'A random property.']
- ]
- \endcode
-
- Another example:
-
- \code
- <key name="Example.Random">
- <type>
- <uniform-list type="number"/>
- </type>
- </key>
-
- ['key',
- ['name', 'Example.Random' ],
- ['type',
- ['uniform-list', ['type', 'number' ] ]
- ]
- ]
- \endcode
-*/
-
-/// Constructor. Creates a new nanodom tree reading XML data from path. After creating
-/// the object you should check the didFail to see if parsing succeded.
-NanoXml::NanoXml(const QString& path)
-{
- current = NULL;
-
- QFile f(path);
- QXmlInputSource source (&f);
- QXmlSimpleReader reader;
-
- reader.setContentHandler(this);
- failed = ! reader.parse(source);
-}
-
-/// Destructor.
-NanoXml::~NanoXml()
-{
- delete current;
-}
-
-/// Parser internal. Add a value (item) \a v to the current list on the stack.
-void NanoXml::addValue(const QString& v)
-{
- current->append(QVariant(v));
-}
-
-/// Parser internal. Creates a new list and pushes it to the top of the stack.
-void NanoXml::pushList()
-{
- if (current)
- stack.push(current);
-
- current = new QList<QVariant> ();
-}
-
-/// Parser internal. Pops one list from the stack. Closes the list and attaches
-/// it to the previoius list on the stack.
-void NanoXml::popList()
-{
- if (current == NULL) {
- // FIXME: Warning goes here
- return;
- }
-
- QVariant currentListAsVariant(*current);
- delete current;
-
- if (stack.count() > 0) {
- current = stack.pop();
- current->append(currentListAsVariant);
- } else {
- current = NULL;
- rootVariant = currentListAsVariant;
- }
-}
-
-/// Called when a namespace prefix mapping starts. We use this to get the
-/// xml version.
-bool NanoXml::startPrefixMapping(const QString &prefix, const QString &uri)
-{
- nspace = uri;
- return true;
-}
-
-/// Called by the XML parser when parsing starts.
-bool NanoXml::startElement(const QString&, const QString&, const QString &name, const QXmlAttributes &attrs)
-{
- pushList();
- addValue(name);
-
- for (int i = 0; i< attrs.count(); i++) {
- pushList();
- addValue(attrs.localName(i));
- addValue(attrs.value(i));
- popList();
- }
-
- return true;
-}
-
-/// Called by the XML parser when parsing starts.
-bool NanoXml::endElement(const QString&, const QString&, const QString &name)
-{
- popList();
- return true;
-}
-
-/// Called by the XML parser when parsing starts.
-bool NanoXml::characters(const QString &chars)
-{
- QString trimmed = chars.trimmed();
-
- if (trimmed != "")
- addValue(trimmed);
-
- return true;
-}
-
-/// Returns the root of the nanodom tree. If parsing XML failed, it will return
-/// and empty QVariant. Otherwise it returns a QVariant containing a list of other
-/// QVariants.
-const QVariant& NanoXml::root()
-{
- return rootVariant;
-}
-
-/// Returns the namespace URI of the parsed (source) XML document. Empty if
-/// it wasn't specified.
-const QString NanoXml::namespaceUri()
-{
- return nspace;
-}
-
-/// Returns true if parsing failed. Fals otherwise. Use it to check if the nanodom
-/// tree is fine and usable.
-bool NanoXml::didFail()
-{
- return failed;
-}
-
-/// Dumps a QVariant into a multi-line string for debugging purposes.
-QString NanoXml::dumpTree(const QVariant &tree, int level)
-{
- QString s;
- for (int i = 0; i < level; i++)
- s += " ";
-
- if (tree.type() == QVariant::String)
- s += tree.toString() + "\n";
- else if (tree.type() == QVariant::List) {
- s += "[\n";
-
- foreach(QVariant v, tree.toList())
- s += NanoXml::dumpTree(v, level + 1);
-
- for (int i = 0; i < level; i++)
- s += " ";
-
- s += "]\n";
- }
-
- return s;
-}
-
-/* Local accessors */
-
-/// Returns the sub (the trailing) after a given \a key in the root nanodom tree.
-QVariant NanoXml::keySub(const QString &key)
-{
- return NanoXml::keySub(key, rootVariant);
-}
-
-/// 1st level accessor. Returns a value for a \a key in the root nanodom tree.
-QVariant NanoXml::keyValue(const QString &key)
-{
- return NanoXml::keyValue(key, rootVariant);
-}
-
-/// Returns the list of QVariants matching the \a key in the root tree. A QVariant
-/// node matches if it's a list by and it's first element is \a key.
-QVariantList NanoXml::keyValues(const QString &key)
-{
- return NanoXml::keyValues(key, rootVariant);
-}
-
-/// 2nd level accessor. Returns a value for a \a key1 \a key2 in the root nanodom tree.
-QVariant NanoXml::keyValue(const QString &key1, const QString &key2)
-{
- return NanoXml::keyValue(key1, key2, rootVariant);
-}
-
-/// 3rd level accessor. Returns a value for a \a key1 \a key2 \a key3 in the root nanodom tree.
-QVariant NanoXml::keyValue(const QString &key1, const QString &key2, const QString &key3)
-{
- return NanoXml::keyValue(key1, key2, key3, rootVariant);
-}
-
-/// 4rd level accessor. Returns a value for a \a key1 \a key2 \a key3 \a key4 in the root nanodom tree.
-QVariant NanoXml::keyValue(const QString &key1, const QString &key2, const QString &key3,
- const QString &key4)
-{
- return NanoXml::keyValue(key1, key2, key3, key4, rootVariant);
-}
-
-/// 5th level accessor. Returns a value for a \a key1 \a key2 \a key3 \a key4 \a key5 in the root nanodom tree.
-QVariant NanoXml::keyValue(const QString &key1, const QString &key2, const QString &key3,
- const QString &key4, const QString &key5)
-{
- return NanoXml::keyValue(key1, key2, key3, key4, key5, rootVariant);
-}
-
-/* Static accessors */
-
-/// Returns the sub (the trailing) after a given \a key in the specified \a dom tree.
-QVariant NanoXml::keySub(const QString &key, const QVariant &dom)
-{
- const QVariant keyVariant(key); // So we can directly compare...
-
- // We expect the dom to be a list...
- if (dom.type() != QVariant::List)
- return QVariant();
-
- foreach(QVariant child, dom.toList())
- {
- if (child.type() == QVariant::List && child.toList().count() > 0 &&
- child.toList().at(0) == keyVariant) {
- QVariantList lst = child.toList();
- lst.removeAt(0);
- return QVariant(lst);
- }
- }
-
- return QVariant();
-}
-
-/// Returns the list of QVariants matching the \a key in a given tree. A QVariant
-/// node matches if it's a list by and it's first element is \a key.
-QVariantList NanoXml::keyValues(const QString &key, const QVariant &dom)
-{
- QVariantList lst;
- const QVariant keyVariant(key); // So we can directly compare...
-
- // We expect the dom to be a list...
- if (dom.type() != QVariant::List)
- return lst;
-
- foreach(QVariant child, dom.toList())
- {
- if (child.type() == QVariant::List && child.toList().count() > 0 &&
- child.toList().at(0) == keyVariant) {
- lst.append(child);
- }
- }
-
- return lst;
-}
-
-/// 1st level accessor. Returns a value for a \a key in the given \a dom tree.
-QVariant NanoXml::keyValue(const QString &key, const QVariant &dom)
-{
- const QVariant keyVariant(key); // So we can directly compare...
-
- // We expect the dom to be a list...
- if (dom.type() != QVariant::List)
- return QVariant();
-
- foreach(QVariant child, dom.toList())
- {
- if (child.type() == QVariant::List && child.toList().count() == 2 &&
- child.toList().at(0) == keyVariant)
- return child.toList().at(1);
- }
-
- return QVariant();
-}
-
-/// 2nd level accessor. Returns a value for a \a key1 \a key2 in the given \a dom tree.
-QVariant NanoXml::keyValue(const QString &key1, const QString &key2, const QVariant &dom)
-{
- return NanoXml::keyValue(key2, keySub(key1, dom));
-}
-
-/// 3rd level accessor. Returns a value for a \a key1 \a key2 \a key3 in the given \a dom tree.
-QVariant NanoXml::keyValue(const QString &key1, const QString &key2, const QString &key3,
- const QVariant &dom)
-{
- return NanoXml::keyValue(key2, key3, keySub(key1, dom));
-}
-
-/// 4rd level accessor. Returns a value for a \a key1 \a key2 \a key3 \a key4 in the given \a dom tree.
-QVariant NanoXml::keyValue(const QString &key1, const QString &key2, const QString &key3,
- const QString &key4, const QVariant &dom)
-{
- return NanoXml::keyValue(key2, key3, key4, keySub(key1, dom));
-}
-
-/// 5th level accessor. Returns a value for a \a key1 \a key2 \a key3 \a key4 \a key5 in the given \a dom tree.
-QVariant NanoXml::keyValue(const QString &key1, const QString &key2, const QString &key3,
- const QString &key4, const QString &key5, const QVariant &dom)
-{
- return NanoXml::keyValue(key2, key3, key4, key5, keySub(key1, dom));
-}
-
diff --git a/libcontextsubscriber/src/nanoxml.h b/libcontextsubscriber/src/nanoxml.h
deleted file mode 100644
index 9c36f536..00000000
--- a/libcontextsubscriber/src/nanoxml.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef NANOXML_H
-#define NANOXML_H
-
-#include <QVariant>
-#include <QStringList>
-#include <QObject>
-#include <QXmlDefaultHandler>
-#include <QStack>
-
-class NanoXml : public QObject, QXmlDefaultHandler
-{
- Q_OBJECT
-
-public:
- NanoXml(const QString& path);
- ~NanoXml();
- const QVariant& root();
- const QString namespaceUri();
- bool didFail();
-
- QVariant keySub(const QString &key);
- QVariant keyValue(const QString &key);
- QVariant keyValue(const QString &key1, const QString &key2);
- QVariant keyValue(const QString &key1, const QString &key2, const QString &key3);
- QVariant keyValue(const QString &key1, const QString &key2, const QString &key3,
- const QString &key4);
- QVariant keyValue(const QString &key1, const QString &key2, const QString &key3,
- const QString &key4, const QString &key5);
- QVariantList keyValues(const QString &key);
-
- static QVariant keySub(const QString &key, const QVariant &dom);
- static QVariant keyValue(const QString &key, const QVariant &dom);
- static QVariant keyValue(const QString &key1, const QString &key2, const QVariant &dom);
- static QVariant keyValue(const QString &key1, const QString &key2, const QString &key3,
- const QVariant &dom);
- static QVariant keyValue(const QString &key1, const QString &key2, const QString &key3,
- const QString &key4, const QVariant &dom);
- static QVariant keyValue(const QString &key1, const QString &key2, const QString &key3,
- const QString &key4, const QString &key5, const QVariant &dom);
- static QVariantList keyValues(const QString &key, const QVariant &dom);
-
- static QString dumpTree(const QVariant &tree, int level);
-
-private:
- QList<QVariant> *current; ///< The current list that we're adding to. Top of the stack, kinda.
- QStack<QList <QVariant>* > stack; ///< The stack of lists.
- QVariant rootVariant; ///< The nanodom root. A list of QVariants usually.
- bool failed; ///< This is set by the parser to signify an error.
- QString nspace; ///< Stores the namespace uri.
-
- void pushList();
- void addValue(const QString& v);
- void popList();
-
-public:
- bool startElement(const QString&, const QString&, const QString &name, const QXmlAttributes &attrs);
- bool endElement(const QString&, const QString&, const QString &name);
- bool startPrefixMapping(const QString &prefix, const QString &uri);
- bool characters(const QString &chars);
-};
-
-#endif // NANOXML_H
diff --git a/libcontextsubscriber/src/propertyhandle.cpp b/libcontextsubscriber/src/propertyhandle.cpp
deleted file mode 100644
index fff44aad..00000000
--- a/libcontextsubscriber/src/propertyhandle.cpp
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "propertyhandle.h"
-#include "provider.h"
-#include "sconnect.h"
-#include "contextpropertyinfo.h"
-#include "contextregistryinfo.h"
-#include "contextproviderinfo.h"
-#include "dbusnamelistener.h"
-#include "logging.h"
-#include "loggingfeatures.h"
-
-#include <QThread>
-#include <QDebug>
-#include <QMutex>
-#include <QMutexLocker>
-#include <QCoreApplication>
-#include <QReadLocker>
-#include <QWriteLocker>
-
-namespace ContextSubscriber {
-
-static const QDBusConnection::BusType commanderDBusType = QDBusConnection::SessionBus;
-static const QString commanderDBusName = "org.freedesktop.ContextKit.Commander";
-static const ContextProviderInfo commanderInfo("contextkit-dbus", "session:org.freedesktop.ContextKit.Commander");
-
-DBusNameListener* PropertyHandle::commanderListener = new DBusNameListener(commanderDBusType, commanderDBusName);
-bool PropertyHandle::commandingEnabled = true;
-bool PropertyHandle::typeCheckEnabled = false;
-
-/*!
- \class PropertyHandle
-
- \brief A common handle for a context property.
-
- Only one handle exists at a time for a context property, no matter
- how much ContextProperty objects are created for it.
-
- Communication with the provider is done through the \c myProvider \c
- Provider instance, which is updated when needed
- because of registry changes. Handling of disappearance from the
- DBus and then reappearance on the DBus of the same provider is
- handled privately by \c Provider. If we don't know
- the current provider for this handle, then the \c myProvider pointer
- is 0.
-
- PropertyHandle and Provider instances are never deleted;
- they stick around until the process is terminated.
-
- All of the PropertyHandle instances and Property provider instances
- are always created with the \c QCoreApplication's thread as the
- thread where they live. This is needed, because user threads can go
- away and we would like to have only one DBus connection.
-*/
-
-PropertyHandle::PropertyHandle(const QString& key)
- : myInfo(0), subscribeCount(0), myKey(key)
-{
- // Read the information about the provider. This needs to be
- // done before calling updateProvider.
- myInfo = new ContextPropertyInfo(myKey, this);
-
- // Start listening to changes in property introspection (e.g., added to registry, plugin changes)
- sconnect(myInfo, SIGNAL(changed(QString)),
- this, SLOT(updateProvider()));
-
- // Start listening for the context commander, and also initiate a
- // NameHasOwner check.
-
- // Because of the waitForSubscription() feature, we immediately need to
- // subscribe to the real providers when the commander presence becomes
- // known. So, these connect()s need to be synchronous (not queued).
- sconnect(commanderListener, SIGNAL(nameAppeared()),
- this, SLOT(updateProvider()));
- sconnect(commanderListener, SIGNAL(nameDisappeared()),
- this, SLOT(updateProvider()));
-
- commanderListener->startListening(true);
-
- // Check if commander is already there:
- DBusNameListener::ServicePresence commanderPresence = commanderListener->isServicePresent();
- if (commanderPresence != DBusNameListener::Unknown) {
- // The status of the commander is known, so we can connect to
- // the provider (or commander) immediately.
- updateProvider();
- }
- // Otherwise, delay connecting to the provider until we know
- // whether commander is present.
-
-
- // Move the PropertyHandle (and all children) to main thread.
- moveToThread(QCoreApplication::instance()->thread());
-}
-
-void PropertyHandle::ignoreCommander()
-{
- commandingEnabled = false;
-}
-
-void PropertyHandle::setTypeCheck(bool typeCheck)
-{
- typeCheckEnabled = typeCheck;
-}
-
-/// Decides who is the current provider of this property and sets up
-/// \c myProvider accordingly. If the provider has changed then
-/// renews the subscriptions.
-void PropertyHandle::updateProvider()
-{
- QList<Provider*> newProviders;
- contextDebug() << F_PLUGINS;
-
- if (commandingEnabled && commanderListener->isServicePresent() == DBusNameListener::Present) {
- // If commander is present it should be able to override the
- // property, so connect to it.
- newProviders << Provider::instance(commanderInfo);
- } else {
- // The myInfo object doesn't have to be re-created, because it
- // just routes the function calls to a registry backend.
-
- foreach (ContextProviderInfo info, myInfo->providers())
- newProviders << Provider::instance(info);
- contextDebug() << newProviders.size() << "providers for" << myKey;
- }
- if (subscribeCount > 0) {
- // Unsubscribe from old providers and subscribe to the new ones.
- foreach (Provider *oldprovider, myProviders)
- oldprovider->unsubscribe(myKey);
- pendingSubscriptions.clear();
- foreach (Provider *newprovider, newProviders)
- if (newprovider->subscribe(myKey))
- pendingSubscriptions << newprovider;
- }
- myProviders = newProviders;
- // Trigger computing the new value as the providers have changed.
- onValueChanged();
-}
-
-/// Sets \c subscribePending to false.
-void PropertyHandle::setSubscribeFinished(Provider *provider)
-{
- pendingSubscriptions.remove(provider);
-}
-
-/// Increase the \c subscribeCount of this context property and
-/// subscribe to it through the \c myProvider instance if neccessary.
-void PropertyHandle::subscribe()
-{
- contextDebug() << F_THREADS << "PropertyHandle::subscribe" << QThread::currentThread();
-
- QMutexLocker locker(&subscribeCountLock);
- ++subscribeCount;
- if (subscribeCount == 1) {
- pendingSubscriptions.clear();
- foreach (Provider *provider, myProviders)
- if (provider->subscribe(myKey))
- pendingSubscriptions << provider;
- }
-}
-
-/// Decrease the \c subscribeCount of this context property and
-/// unsubscribe from it through the \c myProvider instance if
-/// neccessary.
-void PropertyHandle::unsubscribe()
-{
- QMutexLocker locker(&subscribeCountLock);
- --subscribeCount;
- if (subscribeCount == 0) {
- pendingSubscriptions.clear();
- foreach (Provider *provider, myProviders)
- provider->unsubscribe(myKey);
- }
-}
-
-QString PropertyHandle::key() const
-{
- return myKey;
-}
-
-QVariant PropertyHandle::value() const
-{
- QReadLocker lock(&valueLock);
- return myValue;
-}
-
-bool PropertyHandle::isSubscribePending() const
-{
- // We wait until commander presence is unknown ...
- if (commanderListener->isServicePresent() == DBusNameListener::Unknown)
- return true;
- // ... or until we get some value ...
- if (!myValue.isNull())
- return false;
- // ... or all pending subscriptions finished.
- return pendingSubscriptions.size() != 0;
-}
-
-/// Used by the \c HandleSignalRouter to change the value of the
-/// property. Before changing the value it checks the type if type
-/// checks are enabled. The verification errors are signalled on the
-/// stderr. After the check it updates the value and emits the
-/// valueChanged() signal.
-void PropertyHandle::onValueChanged()
-{
- bool found = false;
- TimedValue latest = QVariant();
-
- foreach (Provider *provider, myProviders) {
- TimedValue current = provider->get(myKey);
- if (current.value.isNull())
- continue;
- if (!found) {
- found = true;
- latest = current;
- } else if (latest < current)
- latest = current;
- }
- QVariant newValue;
- if (found)
- newValue = latest.value;
-
- if (typeCheckEnabled // type checks enabled
- && !newValue.isNull() // variable is non-null
- && myInfo->type() != "") { // the type is found in the registry
-
- bool checked = false;
- QString myType = myInfo->type();
- if (myType == "STRING") {
- checked = (QVariant::String == newValue.type());
- } else if (myType == "TRUTH") {
- checked = (QVariant::Bool == newValue.type());
- } else if (myType == "DOUBLE") {
- checked = (QVariant::Double == newValue.type());
- } else if (myType == "INT") {
- checked = (QVariant::Int == newValue.type());
- }
-
- if (!checked) {
- contextCritical() << "Provider error, bad type for " << myKey <<
- "wanted:" << myType << "got:" << newValue.typeName();
- return;
- }
- }
-
- QWriteLocker lock(&valueLock);
- // Since QVariant(QVariant::Int) == QVariant(0), it's not enough to check
- // whether myValue and newValue are unequal. Also, for completeness we
- // don't want to lose a valueChanged signal if the type changes.
- if (myValue != newValue ||
- myValue.isNull() != newValue.isNull() ||
- myValue.type() != newValue.type())
- {
- myValue = newValue;
- emit valueChanged();
- }
-}
-
-const ContextPropertyInfo* PropertyHandle::info() const
-{
- return myInfo;
-}
-
-PropertyHandle* PropertyHandle::instance(const QString& key)
-{
- // Container for singletons
- static QMap<QString, PropertyHandle*> handleInstances;
-
- // Protect the handleInstances. Documentation of QMap doesn't tell
- // if it can be read concurrently, so, read-write locking might
- // not be enough.
-
- static QMutex handleInstancesLock;
- QMutexLocker locker(&handleInstancesLock);
- if (!handleInstances.contains(key)) {
- // The handle does not exist, so create it
- handleInstances.insert(key, new PropertyHandle(key));
- }
-
- return handleInstances[key];
-}
-
-} // end namespace
diff --git a/libcontextsubscriber/src/propertyhandle.h b/libcontextsubscriber/src/propertyhandle.h
deleted file mode 100644
index e6f06897..00000000
--- a/libcontextsubscriber/src/propertyhandle.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef PROPERTYHANDLE_H
-#define PROPERTYHANDLE_H
-
-#include <QObject>
-#include <QString>
-#include <QVariant>
-#include <QSet>
-#include <QReadWriteLock>
-#include <QMutex>
-
-class ContextPropertyInfo;
-
-namespace ContextSubscriber {
-
-class Provider;
-class DBusNameListener;
-
-class PropertyHandle : public QObject
-{
- Q_OBJECT
-
-public:
- void subscribe();
- void unsubscribe();
-
- QString key() const;
- QVariant value() const;
- bool isSubscribePending() const;
- const ContextPropertyInfo* info() const;
-
- static PropertyHandle* instance(const QString& key);
-
- void onValueChanged();
- void setSubscribeFinished(Provider *provider);
- static void ignoreCommander();
- static void setTypeCheck(bool typeCheck);
-
-signals:
- void valueChanged();
-
-private slots:
- void updateProvider();
-
-private:
- PropertyHandle(const QString& key);
-
- QSet<Provider*> pendingSubscriptions; ///< Providers pending subscription
- QList<Provider*> myProviders; ///< Providers of this property
- ContextPropertyInfo *myInfo; ///< Metadata for this property
- unsigned int subscribeCount; ///< Number of subscribed ContextProperty objects subscribed to this property
- QMutex subscribeCountLock;
- QString myKey; ///< Key of this property
- mutable QReadWriteLock valueLock;
- QVariant myValue; ///< Current value of this property
- static DBusNameListener *commanderListener; ///< Listener for ContextCommander's (dis)appearance
- static bool commandingEnabled; ///< Whether the properties can be directed to ContextCommander
- static bool typeCheckEnabled; ///< Whether we check the type of the value received from the provider
-};
-
-} // end namespace
-
-#endif
diff --git a/libcontextsubscriber/src/provider.cpp b/libcontextsubscriber/src/provider.cpp
deleted file mode 100644
index 9444cbd9..00000000
--- a/libcontextsubscriber/src/provider.cpp
+++ /dev/null
@@ -1,365 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "provider.h"
-#include "iproviderplugin.h"
-#include "handlesignalrouter.h"
-#include "sconnect.h"
-#include "contextkitplugin.h"
-#include "logging.h"
-#include "loggingfeatures.h"
-#include <QTimer>
-#include <QMutexLocker>
-#include <QCoreApplication>
-#include <QThread>
-#include <QLibrary>
-
-namespace ContextSubscriber {
-
-/*!
- \class IProviderPlugin
- \brief Interface for provider plugins.
-
- Note: this interface is private, currently it is not advised to use
- it and create ContextKit subscriber plugins on your own, we can and
- will change this interface anytime in the future even between small
- bugfix releases.
-
- Every Provider instance contains exactly one plugin (pointer) with
- this interface which is constructed on initialization time and never
- change after that. This way the concrete protocol (dbus, shared
- memory, etc.) between the library and the provider is abstracted.
-
- The Provider instance communicates need for subscribe and
- unsubscribe calls (on the wire) using the \c subscribe and \c
- unsubscribe methods.
-
- When the plugin is constructed, it should emit the signal ready()
- when it is ready to take in subscriptions. However, the signal
- ready() should not be emitted in the plugin constructor. If the
- plugin is able to take in subscriptions immediately, you can use
- QMetaObject::invokeMethod with QueuedConnection to emit the signal
- when the main loop is entered the next time.
-
- The plugin can fail or became ready again anytime because of things
- happening on the wire inside the plugin (socket closed, dbus service
- appears/disappears). Whenever the plugin has new information about
- this it should emit the signal \c ready or \c failed accordingly.
-
- When the plugin is ready, it has to be able to handle \c subscribe
- and \c unsubscribe function calls. Also, after emitting \c ready it
- should be in a state where it is not subscribed to anything on the
- wire, since immediately after \c ready is emitted, the provider will
- place a subscribe call with all of the properties that should be
- subscribed.
-
- Subscription failures or successes can be signaled with emitting \c
- subscribeFailed and \c subscribeFinished.
-
- At last, but not least, the plugin can emit \c valueChanged, when it
- has a new value for any property. It is not required to only signal
- new values, the library takes care of keeping the old value and only
- emit change signals to the upper layers if the new value is really
- new.
-
- An implementation of this interface doesn't have to care about
- threads at all, all of the methods, starting from the constructor
- will be only called from inside the Qt event loop of the main
- thread. This means that neither the constructor nor the \c
- subscribe, \c unsubscribe calls should block. They have to finish
- as soon as possible and signal the results later via signals.
-
- \class Provider
- \brief Connects to a group of properties via the help of a plugin.
-
- Each instance of this class keeps a plugin dependent communication
- channel (DBus, shared memory, etc.) open and handles subscriptions,
- value changes of the properties belonging to the provider on the
- other end of the channel.
-
- This class is thread safe, the \c instance, \c subscribe and \c
- unsubscribe methods can be called from any threads. However this
- class also guarantees that the signal \c subscribeFinished and \c
- valueChanged will be always emitted from inside the main thread's
- main loop.
-
- \fn void Provider::subscribeFinished(QSet<QString> keys)
- \brief Emitted when the subscription procedure for \c keys finished
- (either succeeded, either failed) */
-
-/// Stores the passed plugin name and construction paramater, then
-/// moves into the main thread and queues a constructPlugin call.
-Provider::Provider(const ContextProviderInfo& providerInfo)
- : plugin(0), pluginState(INITIALIZING), providerInfo(providerInfo)
-{
- // Move the PropertyHandle (and all children) to main thread.
- moveToThread(QCoreApplication::instance()->thread());
-
- queueOnce("constructPlugin");
-}
-
-/// Decides which plugin to instantiate based on the \c plugin passed
-/// to the constructor. Always called in the main loop after the
-/// constructor is finished. Each plugin library implements a
-/// function which can create new instances of that plugin (TODO: come
-/// up with the name of the function).
-void Provider::constructPlugin()
-{
- contextDebug() << F_PLUGINS;
- if (providerInfo.plugin == "contextkit-dbus") {
- plugin = contextKitPluginFactory(providerInfo.constructionString);
- }
- else if (providerInfo.plugin.startsWith("/")) {
- // Dynamically loaded plugins have to start with a '/', otherwise we consider them internal.
- // Enable overriding the plugin location with an environment variable
- const char *pluginPath = getenv("CONTEXT_SUBSCRIBER_PLUGINS");
- if (! pluginPath)
- pluginPath = DEFAULT_CONTEXT_SUBSCRIBER_PLUGINS;
-
- QString pluginFilename(pluginPath);
- // Allow pluginPath to have a trailing / or not
- if (pluginFilename.endsWith("/")) {
- pluginFilename.chop(1);
- }
-
- pluginFilename.append(providerInfo.plugin);
-
- QLibrary library(pluginFilename);
- library.load();
-
- if (library.isLoaded()) {
- PluginFactoryFunc factory = (PluginFactoryFunc) library.resolve("pluginFactory");
- if (factory) {
- contextDebug() << "Resolved factory function";
- plugin = factory(providerInfo.constructionString);
- } else {
- contextCritical() << "Error resolving function pluginFactory from plugin" << pluginFilename;
- }
- }
- else {
- contextCritical() << "Error loading plugin" << pluginFilename << ":" << library.errorString();
- }
- }
- else {
- contextCritical() << "Illegal plugin name" << providerInfo.plugin << ", doesn't start with /";
- }
-
- if (plugin == 0) {
- pluginState = FAILED;
- handleSubscribes();
- return;
- }
-
- // Connect the signal of changing values to the class who handles it
- HandleSignalRouter* handleSignalRouter = HandleSignalRouter::instance();
- sconnect(plugin, SIGNAL(valueChanged(QString, QVariant)),
- this, SLOT(onPluginValueChanged(QString, QVariant)));
- sconnect(this, SIGNAL(valueChanged(QString)),
- handleSignalRouter, SLOT(onValueChanged(QString)));
-
- sconnect(plugin, SIGNAL(ready()),
- this, SLOT(onPluginReady()));
- sconnect(plugin, SIGNAL(failed(QString)),
- this, SLOT(onPluginFailed(QString)));
-
- sconnect(plugin, SIGNAL(subscribeFinished(QString)),
- this, SLOT(onPluginSubscribeFinished(QString)), Qt::QueuedConnection);
- sconnect(plugin, SIGNAL(subscribeFailed(QString, QString)),
- this, SLOT(onPluginSubscribeFailed(QString, QString)), Qt::QueuedConnection);
- sconnect(this, SIGNAL(subscribeFinished(Provider *,QString)),
- handleSignalRouter, SLOT(onSubscribeFinished(Provider *,QString)));
-}
-
-/// Updates \c pluginState to \c READY and requests subscription for
-/// the keys that should be subscribed.
-void Provider::onPluginReady()
-{
- contextDebug();
-
- QMutexLocker lock(&subscribeLock);
- // Renew the subscriptions (if any).
- // Renewing happens when a provider has disappeared and now it appeared again.
- toUnsubscribe.clear();
- toSubscribe.clear();
- toSubscribe += subscribedKeys;
- pluginState = READY;
- lock.unlock();
- handleSubscribes();
-}
-
-/// Updates \c pluginState to \c FAILED and signals subscribeFinished
-/// for keys we are trying to subscribe to.
-void Provider::onPluginFailed(QString error)
-{
- contextWarning() << error;
-
- QMutexLocker lock(&subscribeLock);
- pluginState = FAILED;
- lock.unlock();
- handleSubscribes();
-}
-
-/// The plugin has finished subscribing to a key, signals this fact to
-/// the upper layer. The final API for this is the
-/// <tt>waitForSubscription()</tt> method in \c ContextProperty.
-void Provider::signalSubscribeFinished(QString key)
-{
- QMutexLocker lock(&subscribeLock);
- if (subscribedKeys.contains(key))
- emit subscribeFinished(this, key);
-}
-
-/// Forwards the call to \c signalSubscribeFinished.
-void Provider::onPluginSubscribeFinished(QString key)
-{
- contextDebug() << key;
-
- signalSubscribeFinished(key);
-}
-
-/// Forwards the call to \c signalSubscribeFinished, after logging a
-/// warning.
-void Provider::onPluginSubscribeFailed(QString key, QString error)
-{
- contextWarning() << key << error;
-
- signalSubscribeFinished(key);
-}
-
-/// Schedules a property to be subscribed to. Returns true if and
-/// only if the main loop has to run for the subscription to be
-/// finalized.
-bool Provider::subscribe(const QString &key)
-{
- QMutexLocker lock(&subscribeLock);
- // Note: the intention is saved in all cases; whether we can really subscribe or not.
- subscribedKeys.insert(key);
-
- // If the key was scheduled to be unsubscribed then remove that
- // scheduling, and return false.
- if (toUnsubscribe.contains(key)) {
- toUnsubscribe.remove(key);
- return false;
- }
-
- // Schedule the key to be subscribed to and return true
- contextDebug() << "Inserting the key to toSubscribe" << QThread::currentThread();
-
- // Really schedule the key to be subscribed to
- toSubscribe.insert(key);
-
- queueOnce("handleSubscribes");
-
- return true;
-}
-
-/// Schedules a property to be unsubscribed from when the main loop is
-/// entered the next time.
-void Provider::unsubscribe(const QString &key)
-{
- QMutexLocker lock(&subscribeLock);
- // Save the intention of the higher level
- subscribedKeys.remove(key);
-
- // Schedule the key to be unsubscribed from
- if (toSubscribe.contains(key)) {
- // The key was scheduled to be subscribed
- // Remove that scheduling, and nothing else needs to be done.
- toSubscribe.remove(key);
- }
- else {
- // Really schedule the key to be unsubscribed from
- toUnsubscribe.insert(key);
-
- queueOnce("handleSubscribes");
- }
-}
-
-/// Executed when the main loop is entered and we have previously
-/// scheduled subscriptions / unsubscriptions.
-void Provider::handleSubscribes()
-{
- contextDebug() << "Provider::handleSubscribes in thread" << QThread::currentThread();
-
- QMutexLocker lock(&subscribeLock);
-
- switch (pluginState) {
- case READY:
- if (toSubscribe.size() > 0) plugin->subscribe(toSubscribe);
- if (toUnsubscribe.size() > 0) plugin->unsubscribe(toUnsubscribe);
- toSubscribe.clear();
- toUnsubscribe.clear();
- break;
- case FAILED:
- // it failed for good.
- contextDebug() << "Plugin init has failed";
- if (toSubscribe.size() > 0)
- foreach (QString key, toSubscribe)
- emit subscribeFinished(this, key);
- toSubscribe.clear();
- toUnsubscribe.clear();
- break;
- case INITIALIZING:
- // we just have to wait,
- break;
- }
-
- contextDebug() << "Provider::handleSubscribes processed";
-}
-
-/// Forwards the \c newValue for \c key received from the plugin to
-/// the upper layers via \c HandleSignalRouter.
-void Provider::onPluginValueChanged(QString key, QVariant newValue)
-{
- QMutexLocker lock(&subscribeLock);
- if (subscribedKeys.contains(key)) {
- // FIXME: try out if everything works with lock.unlock() here
- values.insert(key, TimedValue(newValue));
- emit valueChanged(key);
- }
- else
- contextWarning() << "Received a property not subscribed to:" << key;
-}
-
-TimedValue Provider::get(const QString &key) const
-{
- return values.value(key, TimedValue(QVariant()));
-}
-
-/// Returns a singleton for the named \c plugin with the \c constructionString.
-Provider* Provider::instance(const ContextProviderInfo& providerInfo)
-{
- // Singleton instance container
- // plugin path, constructionstring -> Provider
- static QMap<ContextProviderInfo, Provider*> providerInstances;
-
- static QMutex providerInstancesLock;
- QMutexLocker locker(&providerInstancesLock);
- if (!providerInstances.contains(providerInfo))
- providerInstances.insert(providerInfo, new Provider(providerInfo));
-
- contextDebug() << "Returning provider instance for" << providerInfo.plugin
- << ":" << providerInfo.constructionString;
-
- return providerInstances[providerInfo];
-}
-
-} // end namespace
diff --git a/libcontextsubscriber/src/provider.h b/libcontextsubscriber/src/provider.h
deleted file mode 100644
index e7ff609b..00000000
--- a/libcontextsubscriber/src/provider.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef PROVIDER_H
-#define PROVIDER_H
-
-#include "queuedinvoker.h"
-#include "contextproviderinfo.h"
-#include "timedvalue.h"
-
-#include <QObject>
-#include <QDBusConnection>
-#include <QSet>
-#include <QMutex>
-
-class ContextPropertyInfo;
-
-namespace ContextSubscriber {
-
-class PropertyHandle;
-class SubscriberInterface;
-class DBusNameListener;
-class ManagerInterface;
-class IProviderPlugin;
-
-class Provider : public QueuedInvoker
-{
- Q_OBJECT
-
-public:
- static Provider* instance(const ContextProviderInfo& providerInfo);
- bool subscribe(const QString &key);
- void unsubscribe(const QString &key);
- TimedValue get(const QString &key) const;
-
-signals:
- void subscribeFinished(Provider *provider, QString key);
- void valueChanged(QString key);
-
-private slots:
- void onPluginReady();
- void onPluginFailed(QString error);
- void onPluginSubscribeFinished(QString key);
- void onPluginSubscribeFailed(QString failedKey, QString error);
- void onPluginValueChanged(QString key, QVariant newValue);
-
-private:
- enum PluginState { INITIALIZING, READY, FAILED };
- Provider(const ContextProviderInfo& providerInfo);
- Q_INVOKABLE void handleSubscribes();
- Q_INVOKABLE void constructPlugin();
- void signalSubscribeFinished(QString key);
-
- IProviderPlugin* plugin; ///< Plugin instance communicating with the concrete provider.
- PluginState pluginState;
- ContextProviderInfo providerInfo; ///< Parameters used to initialize the plugin.
-
- QMutex subscribeLock;
- QSet<QString> toSubscribe; ///< Keys pending for subscription
- QSet<QString> toUnsubscribe; ///< Keys pending for unsubscription
-
- // FIXME: rename this to something which contains the word intention in it
- QSet<QString> subscribedKeys; ///< The keys that should be currently subscribed to
-
- QMap<QString, TimedValue> values; ///< A cache of values already received from the plugin
-};
-
-} // end namespace
-
-#endif
diff --git a/libcontextsubscriber/src/queuedinvoker.cpp b/libcontextsubscriber/src/queuedinvoker.cpp
deleted file mode 100644
index ac7373de..00000000
--- a/libcontextsubscriber/src/queuedinvoker.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "queuedinvoker.h"
-
-#include <QMetaObject>
-#include <QThread>
-#include <QDebug>
-#include <QMutexLocker>
-
-namespace ContextSubscriber {
-
-/*! \class QueuedInvoker
- \brief A class that can invoke its own methods in a delayed way.
-
- Via the method QueuedInvoker::queueOnce, the given method is set
- to be invoked when the event loop of the object is entered. Each
- method is queued at most once. QueuedInvoker sends a signal to
- itself, and when the signal is processed, the method is invoked.
-
- QueuedInvoker is normally used by subclassing it.
-
-*/
-
-
-QueuedInvoker::QueuedInvoker()
-{
- connect(this, SIGNAL(queuedCall(const char *)),
- this, SLOT(onQueuedCall(const char *)),
- Qt::QueuedConnection);
-}
-
-//! Slot which is executed when the event loop of this object
-//! runs. Calls all the methods in the queue.
-void QueuedInvoker::onQueuedCall(const char *method)
-{
- QMutexLocker locker(&callQueueLock);
- callQueue.remove(method);
- locker.unlock();
- if (!QMetaObject::invokeMethod(this, method, Qt::DirectConnection)) {
- qFatal(" *****************\n"
- "Erroneous usage of queueOnce(%s)\n"
- " *****************\n", method);
- }
-}
-
-//! Sets the method \a method to be invoked when the event loop of
-//! this object runs next time. If the method was already in the
-//! queue, it won't be inserted again.
-void QueuedInvoker::queueOnce(const char *method)
-{
- QMutexLocker locker(&callQueueLock);
- if (!callQueue.contains(method)) {
- emit queuedCall(method);
- callQueue.insert(method);
- }
-}
-
-} // namespace
diff --git a/libcontextsubscriber/src/queuedinvoker.h b/libcontextsubscriber/src/queuedinvoker.h
deleted file mode 100644
index 6fdcbdfc..00000000
--- a/libcontextsubscriber/src/queuedinvoker.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef QUEUEDINVOKER_H
-#define QUEUEDINVOKER_H
-
-#include <QObject>
-#include <QMutex>
-#include <QSet>
-#include <QString>
-
-namespace ContextSubscriber {
-
-class QueuedInvoker : public QObject
-{
- Q_OBJECT
-
-public:
- QueuedInvoker();
-
-private slots:
- void onQueuedCall(const char *method);
-
-signals:
- void queuedCall(const char *method);
-
-protected:
- void queueOnce(const char *method);
-
-private:
- QMutex callQueueLock; ///< Protects the callQueue
- QSet<QString> callQueue; ///< Methods to be invoked
-};
-
-} // namespace
-#endif
diff --git a/libcontextsubscriber/src/safedbuspendingcallwatcher.h b/libcontextsubscriber/src/safedbuspendingcallwatcher.h
deleted file mode 100644
index bb7be6d3..00000000
--- a/libcontextsubscriber/src/safedbuspendingcallwatcher.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef SAFEDBUSPENDINGCALLWATCHER_H
-#define SAFEDBUSPENDINGCALLWATCHER_H
-
-#include "sconnect.h"
-#include <QDBusPendingCallWatcher>
-
-//! Deletes itself after the <tt>finished()</tt> signal is emitted
-//! (and the mainloop entered).
-class SafeDBusPendingCallWatcher : public QDBusPendingCallWatcher
-{
- Q_OBJECT;
-
-public:
- SafeDBusPendingCallWatcher(const QDBusPendingCall &call, QObject * parent = 0) :
- QDBusPendingCallWatcher(call, parent)
- {
- sconnect(this, SIGNAL(finished(QDBusPendingCallWatcher *)),
- this, SLOT(deleteLater()));
- }
-};
-#endif
diff --git a/libcontextsubscriber/src/subscriberinterface.cpp b/libcontextsubscriber/src/subscriberinterface.cpp
deleted file mode 100644
index 1fbd9ee7..00000000
--- a/libcontextsubscriber/src/subscriberinterface.cpp
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-/*!
- \class SubscriberSignallingInterface
-
- \brief Proxy class for the DBus interface
- org.freedesktop.ContextKit.Subscriber which connects automatically
- to the Changed signal over DBus.
-
- It has to be a separate class because it needs the connection at
- initialization time, and we want to pass only the bus type which
- will be used to create the connection _after_ initialization time.
-*/
-
-/*!
- \class SubscriberInterface
-
- \brief Proxy class for using the DBus interface
- org.freedesktop.ContextKit.Subscriber asynchronously.
-
- Implements methods for constructing the interface objects (given the
- DBus type, session or system, and bus name), calling the functions
- Subscribe and Unsubscribe asynchronously, and listening to the
- Changed signal.
-*/
-
-#include "subscriberinterface.h"
-#include "safedbuspendingcallwatcher.h"
-#include "sconnect.h"
-#include "logging.h"
-#include <QDebug>
-#include <QDBusConnection>
-#include <QDBusPendingReply>
-
-namespace ContextSubscriber {
-
-const char *SubscriberInterface::interfaceName = "org.freedesktop.ContextKit.Subscriber";
-
-/// Constructs the SubscriberInterface. Connects to the DBus object specified
-/// by \a busType (session or system bus), \a busName and \a objectPath.
-SubscriberInterface::SubscriberInterface(const QDBusConnection connection,
- const QString &busName,
- const QString &objectPath,
- QObject *parent)
- : QDBusAbstractInterface(busName, objectPath, interfaceName, connection, parent)
-{
- sconnect(this, SIGNAL(Changed(const QMap<QString, QVariant>&, const QStringList &)),
- this, SLOT(onChanged(const QMap<QString, QVariant>&, const QStringList &)));
-}
-
-/// Calls the Subscribe function over DBus asynchronously.
-void SubscriberInterface::subscribe(QSet<QString> keys)
-{
- contextDebug() << "SubscriberInterface::subscribe";
- // FIXME contextDebug() << "SubscriberInterface::subscribe " << keys;
- if (isValid() == false || keys.size() == 0) {
- contextDebug() << "Subscriber cannot subscribe -> emitting subscribeFinished()";
- emit subscribeFinished(keys.toList());
- return;
- }
-
- // Construct the asynchronous call
- QStringList keyList = keys.toList();
-
- QDBusPendingCall subscribeCall = asyncCall("Subscribe", keyList);
- SafeDBusPendingCallWatcher *watcher = new SafeDBusPendingCallWatcher(subscribeCall, this);
- sconnect(watcher, SIGNAL(finished(QDBusPendingCallWatcher *)),
- this, SLOT(onSubscribeFinished(QDBusPendingCallWatcher *)));
-
- // When the pending call returns, we need to know the keys we
- // tried to subscribe to.
- watcher->setProperty("keysToSubscribe", keyList);
-}
-
-/// Calls the Unsubscribe function over DBus asynchronously.
-void SubscriberInterface::unsubscribe(QSet<QString> keys)
-{
- if (isValid() && keys.size() != 0) {
- // Construct the asynchronous call
- QStringList keyList = keys.toList();
-
- asyncCall("Unsubscribe", keyList);
- // The possible errors are not tracked, because we can't do anything if Unsubscribe fails.
- }
-}
-
-/// Processes the results of the Changed signal which comes over DBus.
-void SubscriberInterface::onChanged(const QMap<QString, QVariant> &values, const QStringList& unknownKeys)
-{
- QMap<QString, QVariant> copy = values;
- emit valuesChanged(mergeNullsWithMap(copy, unknownKeys));
-}
-
-/// A helper function. Sets the values of given keys to a null QVariant in a QMap.
-QMap<QString, QVariant>& SubscriberInterface::mergeNullsWithMap(QMap<QString, QVariant> &map, QStringList nulls) const
-{
- foreach (QString null, nulls) {
- if (map.contains(null))
- contextWarning() << "Provider error, provided unknown and a value for" << null;
- else
- map[null] = QVariant();
- }
- return map;
-}
-
-/// Is called when the asynchronous DBus call to Subscribe has finished. Emits
-/// the signal valuesChanged with the return values of the subscribed keys.
-void SubscriberInterface::onSubscribeFinished(QDBusPendingCallWatcher* watcher)
-{
- QDBusPendingReply<QMap<QString, QVariant>, QStringList> reply = *watcher;
-
- QList<QString> requestedKeys = watcher->property("keysToSubscribe").toStringList();
-
- if (reply.isError()) {
- // Possible causes of the error:
- // The provider is not running
- // The provider didn't implement the needed interface + function
- // The function resulted in an error
- contextWarning() << "Provider error while subscribing:" << reply.error().message();
- emit subscribeFailed(requestedKeys, "Provider error");
- } else {
- QMap<QString, QVariant> subscribeTimeValues = reply.argumentAt<0>();
- QStringList unknowns = reply.argumentAt<1>();
-
- // TODO: the protocol should be better, this is just a workaround
- QMap<QString, QVariant> okMap = mergeNullsWithMap(subscribeTimeValues, unknowns);
- emit subscribeFinished(okMap.keys());
- emit valuesChanged(okMap);
- emit subscribeFailed((requestedKeys.toSet() - okMap.keys().toSet()).toList(), "Not provided");
- }
-}
-
-void SubscriberInterface::connectNotify(const char *signal)
-{
- // only Changed signal should be AddMatch'd on the DBus side
- if (qstrcmp(signal, SIGNAL(Changed(QMap<QString,QVariant>,QStringList))) == 0)
- QDBusAbstractInterface::connectNotify(signal);
- else
- QObject::connectNotify(signal);
-}
-
-void SubscriberInterface::disconnectNotify(const char *signal)
-{
- // only Changed signal should be AddMatch'd on the DBus side
- if (qstrcmp(signal, SIGNAL(Changed(QMap<QString,QVariant>,QStringList))) == 0)
- QDBusAbstractInterface::disconnectNotify(signal);
- else
- QObject::disconnectNotify(signal);
-}
-
-} // end namespace
diff --git a/libcontextsubscriber/src/subscriberinterface.h b/libcontextsubscriber/src/subscriberinterface.h
deleted file mode 100644
index dba17cc1..00000000
--- a/libcontextsubscriber/src/subscriberinterface.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef SUBSCRIBERINTERFACE_H
-#define SUBSCRIBERINTERFACE_H
-
-#include <QObject>
-#include <QMap>
-#include <QString>
-#include <QStringList>
-#include <QDBusAbstractInterface>
-
-class QDBusConnection;
-class QDBusPendingCallWatcher;
-
-namespace ContextSubscriber {
-
-class SubscriberInterface : public QDBusAbstractInterface
-{
- Q_OBJECT
-
-public:
- SubscriberInterface(const QDBusConnection connection, const QString& busName,
- const QString& objectPath, QObject* parent = 0);
-
- void subscribe(QSet<QString> keys);
- void unsubscribe(QSet<QString> keys);
-
-signals:
- void valuesChanged(QMap<QString, QVariant> values);
- void subscribeFinished(QList<QString> keys);
- void subscribeFailed(QList<QString> keys, QString error);
- void Changed(const QMap<QString, QVariant> &values, const QStringList &unknownKeys);
-
-private slots:
- void onSubscribeFinished(QDBusPendingCallWatcher* watcher);
- void onChanged(const QMap<QString, QVariant> &values, const QStringList &unknownKeys);
-
-private:
- SubscriberInterface(const SubscriberInterface& other);
- SubscriberInterface& operator=(const SubscriberInterface& other);
- QMap<QString, QVariant>& mergeNullsWithMap(QMap<QString, QVariant> &map, QStringList nulls) const;
-
-protected:
- void connectNotify(const char *signal);
- void disconnectNotify(const char *signal);
-
- static const char* interfaceName;
-};
-} // end namespace
-#endif
diff --git a/libcontextsubscriber/src/timedvalue.h b/libcontextsubscriber/src/timedvalue.h
deleted file mode 100644
index ad5e71f0..00000000
--- a/libcontextsubscriber/src/timedvalue.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef TIMEDVALUE_H
-#define TIMEDVALUE_H
-
-#include <time.h>
-#include <QVariant>
-
-namespace ContextSubscriber {
-
-struct TimedValue
-{
- struct timespec time;
- QVariant value;
-
- TimedValue(const QVariant &value) : value(value)
- {
- clock_gettime(CLOCK_MONOTONIC, &time);
- }
- bool operator<(const TimedValue &other)
- {
- return ((time.tv_sec < other.time.tv_sec) ||
- (time.tv_sec == other.time.tv_sec &&
- time.tv_nsec < other.time.tv_nsec));
- }
-};
-
-}
-
-#endif
diff --git a/libcontextsubscriber/unit-tests/Makefile.am b/libcontextsubscriber/unit-tests/Makefile.am
deleted file mode 100644
index 76927d24..00000000
--- a/libcontextsubscriber/unit-tests/Makefile.am
+++ /dev/null
@@ -1,39 +0,0 @@
-SUBDIRSTESTS = \
- provider \
- propertyhandle \
- handlesignalrouter \
- cdb \
- infoxmlbackend \
- infocdbbackend \
- contextregistryinfo \
- contextpropertyinfo \
- infobackend \
- nanoxml
-
-SUBDIRS = $(SUBDIRSTESTS) util
-
-check-sum: all
- @list='$(SUBDIRSTESTS)'; for subdir in $$list; do \
- (cd $$subdir && tput bold && echo $$subdir:\ && tput sgr0 && ( $(MAKE) $(AM_MAKEFLAGS) check 2>/dev/null | grep '^Total' | grep -v '^make' ) ) \
- done
-
-coverage: covoptioncheck
- @list='$(SUBDIRSTESTS)'; for subdir in $$list; do \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) coverage) \
- done
- mkdir -p coverage
- lcov $(patsubst %, -a %/coverage/selected.cov, $(SUBDIRSTESTS)) -o coverage/selecteds.cov
- @echo "real sources: `cd $(abs_top_srcdir) && pwd`"
- @echo "build: $(abs_top_builddir)"
- cat coverage/selecteds.cov | \
- sed "s,`cd $(abs_top_builddir) && pwd`,`cd $(abs_top_srcdir) && pwd`," | \
- sed 's,unit-tests/.*mock_,src/,' | \
- sed 's,unit-tests/.*src_,src/,' >coverage/sedded.cov
- genhtml --prefix `cd $(abs_top_srcdir) && pwd` -o coverage/ coverage/sedded.cov
-
-clean-local:
- rm -rf coverage
-
-.PHONY: coverage check-sum
-
-include $(top_srcdir)/am/covoptioncheck.am
diff --git a/libcontextsubscriber/unit-tests/cdb/.gitignore b/libcontextsubscriber/unit-tests/cdb/.gitignore
deleted file mode 100644
index bda91efe..00000000
--- a/libcontextsubscriber/unit-tests/cdb/.gitignore
+++ /dev/null
@@ -1,7 +0,0 @@
-cdbreader.cpp
-cdbreader.h
-cdbwriter.cpp
-cdbwriter.h
-logging.cpp
-logging.h
-loggingfeatures.h
diff --git a/libcontextsubscriber/unit-tests/cdb/Makefile.am b/libcontextsubscriber/unit-tests/cdb/Makefile.am
deleted file mode 100644
index bccb776c..00000000
--- a/libcontextsubscriber/unit-tests/cdb/Makefile.am
+++ /dev/null
@@ -1,22 +0,0 @@
-check_PROGRAMS = cdbunittest
-
-# test's sources
-cdbunittest_SOURCES = cdbunittest.cpp
-
-COVERAGE_FILES = cdbwriter.cpp cdbreader.cpp
-
-# do the testing, coverage, etc. stuff
-# tests.am is using +=, so we have to set a value here for these four always
-AM_CXXFLAGS = '-I$(srcdir)/../util/'
-AM_LDFLAGS = $(CDB_LIBS)
-FROM_SOURCE = cdbreader.h cdbreader.cpp cdbwriter.cpp cdbwriter.h loggingfeatures.h # copy these files from the real source
-FROM_SOURCE_DIR = $(srcdir)/../../src
-LDADD =
-include $(top_srcdir)/am/tests.am
-
-nodist_cdbunittest_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(cdbunittest_SOURCES) $(FROM_SOURCE))
-include $(top_srcdir)/am/qt.am
-
-# when MOCing from .cpp file, you also has to help the dependency tracker
-cdbunittest.o: cdbunittest.moc
diff --git a/libcontextsubscriber/unit-tests/cdb/cdbunittest.cpp b/libcontextsubscriber/unit-tests/cdb/cdbunittest.cpp
deleted file mode 100644
index d201fd7e..00000000
--- a/libcontextsubscriber/unit-tests/cdb/cdbunittest.cpp
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <QtTest/QtTest>
-#include <QtCore>
-#include <fcntl.h>
-#include "cdbwriter.h"
-#include "cdbreader.h"
-#include "fileutils.h"
-
-class CDBUnitTest : public QObject
-{
- Q_OBJECT
-
-private slots:
- void creation();
- void cleanupTestCase();
- void writingToBad();
- void createWithFileDescriptor();
- void createWithBadFileDescriptor();
- void reading();
- void readingFromBad();
-};
-
-void CDBUnitTest::creation()
-{
- CDBWriter writer("test.cdb");
- QCOMPARE(writer.isWritable(), true);
- QVERIFY(writer.fileDescriptor() > 0);
-
- writer.add("KEYS", "KEYSValue1");
- writer.add("KEYS", "KEYSValue2");
- writer.add("KEYS", "KEYSValue3");
- writer.insert("KEYS", "doesn't get into");
-
- writer.add("KEY1", "KEY1Value wrong");
- writer.replace("KEY1", "KEY1Value");
-
- QVariantList complex;
- QMap<QString, QVariant> map;
- map["fortytwo"] = 42;
- map["fortytwo two times"] = 4242;
- QList<QVariant> list;
- list << 24.24;
- list << 42.42;
- complex << QVariant("test") << QVariant(map) << QVariant(list);
-
- writer.add("COMPLEX", complex);
- writer.close();
-}
-
-void CDBUnitTest::writingToBad()
-{
- CDBWriter writer("/proc/test.cdb");
- QCOMPARE(writer.isWritable(), false);
- QVERIFY(writer.fileDescriptor() <= 0);
-
- writer.add("KEYS", "VAL");
- writer.close();
-}
-
-void CDBUnitTest::createWithFileDescriptor()
-{
- int fd = open("test-fdo.cdb", O_RDWR | O_CREAT, 0644);
- CDBWriter writer(fd);
-
- QCOMPARE(writer.isWritable(), true);
-}
-
-void CDBUnitTest::createWithBadFileDescriptor()
-{
- int fd = open("/usr/test/something/database.cdb", O_RDWR | O_CREAT, 0644);
- CDBWriter writer(fd);
-
- QCOMPARE(writer.isWritable(), false);
-}
-
-void CDBUnitTest::readingFromBad()
-{
- CDBReader reader("/proc/test.cdb");
- QCOMPARE(reader.isReadable(), false);
- QVERIFY(reader.fileDescriptor() <= 0);
- QVariant v = reader.valueForKey("SOMETHING");
- QCOMPARE(v, QVariant());
-}
-
-void CDBUnitTest::reading()
-{
- CDBReader reader("test.cdb");
- QCOMPARE(reader.isReadable(), true);
- QVERIFY(reader.fileDescriptor() > 0);
-
- QCOMPARE(reader.valueForKey("KEY1"), QVariant("KEY1Value"));
-
- QVariantList reslist = reader.valuesForKey("KEYS");
- QCOMPARE(reslist.size(), 3);
-
- QCOMPARE(reslist.at(0), QVariant("KEYSValue1"));
- QCOMPARE(reslist.at(1), QVariant("KEYSValue2"));
- QCOMPARE(reslist.at(2), QVariant("KEYSValue3"));
-
- QCOMPARE(QVariantList() << "KEY1Value", reader.valuesForKey("KEY1"));
-
- QVariantList complex;
- QMap<QString, QVariant> map;
- map["fortytwo"] = 42;
- map["fortytwo two times"] = 4242;
- QList<QVariant> list;
- list << 24.24;
- list << 42.42;
- complex << QVariant("test") << QVariant(map) << QVariant(list);
-
- QCOMPARE(QVariant(complex), reader.valuesForKey("COMPLEX")[0]);
- QCOMPARE(42, reader.valueForKey("COMPLEX").toList().at(1).toMap().value("fortytwo").toInt());
-}
-
-void CDBUnitTest::cleanupTestCase()
-{
- QFile::remove("test.cdb");
- QFile::remove("test-fdo.cdb");
-}
-
-#include "cdbunittest.moc"
-QTEST_MAIN(CDBUnitTest);
diff --git a/libcontextsubscriber/unit-tests/contextpropertyinfo/.gitignore b/libcontextsubscriber/unit-tests/contextpropertyinfo/.gitignore
deleted file mode 100644
index 8697cc1e..00000000
--- a/libcontextsubscriber/unit-tests/contextpropertyinfo/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-contextpropertyinfo.cpp
-contextpropertyinfo.h
-contextpropertyinfounittest
-loggingfeatures.h
-contextproviderinfo.h
diff --git a/libcontextsubscriber/unit-tests/contextpropertyinfo/Makefile.am b/libcontextsubscriber/unit-tests/contextpropertyinfo/Makefile.am
deleted file mode 100644
index 1f5e710e..00000000
--- a/libcontextsubscriber/unit-tests/contextpropertyinfo/Makefile.am
+++ /dev/null
@@ -1,28 +0,0 @@
-check_PROGRAMS = contextpropertyinfounittest
-
-# your test's sources
-contextpropertyinfounittest_SOURCES = contextpropertyinfounittest.cpp infobackend.h
-
-COVERAGE_FILES = contextpropertyinfo.cpp
-EXTRA_DIST =
-
-# do the testing, coverage, etc. stuff
-# tests.am is using +=, so we have to set a value here for these four always
-AM_CXXFLAGS = $(QtDBus_CFLAGS) -I$(srcdir)/../util/ \
- '-DDEFAULT_CONTEXT_PROVIDERS="@datadir@/contextkit/providers/"' \
- '-DDEFAULT_CONTEXT_CORE_DECLARATIONS="@datadir@/contextkit/core.context"'
-AM_LDFLAGS = $(CDB_LIBS) $(QtXml_LIBS)
-FROM_SOURCE = contextpropertyinfo.cpp \
- contextpropertyinfo.h \
- loggingfeatures.h \
- contextproviderinfo.h
-
-FROM_SOURCE_DIR = $(srcdir)/../../src
-LDADD =
-include $(top_srcdir)/am/tests.am
-
-nodist_contextpropertyinfounittest_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(contextpropertyinfounittest_SOURCES) $(FROM_SOURCE))
-include $(top_srcdir)/am/qt.am
-
-contextpropertyinfounittest.o: contextpropertyinfounittest.moc
diff --git a/libcontextsubscriber/unit-tests/contextpropertyinfo/contextpropertyinfounittest.cpp b/libcontextsubscriber/unit-tests/contextpropertyinfo/contextpropertyinfounittest.cpp
deleted file mode 100644
index f9b4fad1..00000000
--- a/libcontextsubscriber/unit-tests/contextpropertyinfo/contextpropertyinfounittest.cpp
+++ /dev/null
@@ -1,368 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <QtTest/QtTest>
-#include <QtCore>
-#include "contextpropertyinfo.h"
-#include "infobackend.h"
-
-QMap <QString, ContextProviderInfo> providerMap;
-QMap <QString, QString> typeMap;
-QMap <QString, QString> docMap;
-
-/* Mocked infobackend */
-
-InfoBackend* currentBackend = NULL;
-
-InfoBackend* InfoBackend::instance(const QString &backendName)
-{
- if (currentBackend)
- return currentBackend;
- else {
- currentBackend = new InfoBackend();
- return currentBackend;
- }
-}
-
-QString InfoBackend::typeForKey(QString key) const
-{
- if (typeMap.contains(key))
- return typeMap.value(key);
- else
- return QString();
-}
-
-QString InfoBackend::docForKey(QString key) const
-{
- if (docMap.contains(key))
- return docMap.value(key);
- else
- return QString();
-}
-
-bool InfoBackend::keyDeclared(QString key) const
-{
- if (typeMap.contains(key))
- return true;
- else
- return false;
-}
-
-const QList<ContextProviderInfo> InfoBackend::providersForKey(QString key)
-{
- QList<ContextProviderInfo> lst;
- if (providerMap.contains(key))
- lst << providerMap.value(key, ContextProviderInfo("", ""));
-
- return lst;
-}
-
-void InfoBackend::connectNotify(const char *signal)
-{
-}
-
-void InfoBackend::disconnectNotify(const char *signal)
-{
-}
-
-void InfoBackend::fireKeysChanged(const QStringList& keys)
-{
- emit keysChanged(keys);
-}
-
-void InfoBackend::fireKeysAdded(const QStringList& keys)
-{
- emit keysAdded(keys);
-}
-
-void InfoBackend::fireKeysRemoved(const QStringList& keys)
-{
- emit keysRemoved(keys);
-}
-
-void InfoBackend::fireKeyChanged(const QString& key)
-{
- emit keyChanged(key);
-}
-
-/* ContextRegistryInfoUnitTest */
-
-class ContextPropertyInfoUnitTest : public QObject
-{
- Q_OBJECT
-
-private slots:
- void initTestCase();
- void key();
- void doc();
- void type();
- void exists();
- void declared();
- void provided();
- void providers();
- void resolutionStrategy();
- void providerDBusName();
- void providerDBusType();
- void plugin();
- void constructionString();
- void typeChanged();
- void providerChanged();
- void providedChanged();
- void pluginChanged();
- void dbusTypeChanged();
-};
-
-void ContextPropertyInfoUnitTest::initTestCase()
-{
- providerMap.clear();
-
- ContextProviderInfo info1("contextkit-dbus", "system:org.freedesktop.ContextKit.contextd");
- providerMap.insert("Battery.Charging", info1);
-
- ContextProviderInfo info2("contextkit-dbus", "session:com.nokia.musicplayer");
- providerMap.insert("Media.NowPlaying", info2);
-
- typeMap.clear();
- typeMap.insert("Battery.Charging", "TRUTH");
- typeMap.insert("Media.NowPlaying", "STRING");
-
- docMap.clear();
- docMap.insert("Battery.Charging", "Battery.Charging doc");
- docMap.insert("Media.NowPlaying", "Media.NowPlaying doc");
-}
-
-void ContextPropertyInfoUnitTest::key()
-{
- ContextPropertyInfo p("Battery.Charging");
- QCOMPARE(p.key(), QString("Battery.Charging"));
-}
-
-void ContextPropertyInfoUnitTest::doc()
-{
- ContextPropertyInfo p1("Battery.Charging");
- ContextPropertyInfo p2("Media.NowPlaying");
- ContextPropertyInfo p3("Does.Not.Exist");
- QCOMPARE(p1.doc(), QString("Battery.Charging doc"));
- QCOMPARE(p2.doc(), QString("Media.NowPlaying doc"));
- QCOMPARE(p3.doc(), QString());
-}
-
-void ContextPropertyInfoUnitTest::type()
-{
- ContextPropertyInfo p1("Battery.Charging");
- ContextPropertyInfo p2("Media.NowPlaying");
- ContextPropertyInfo p3("Does.Not.Exist");
- QCOMPARE(p1.type(), QString("TRUTH"));
- QCOMPARE(p2.type(), QString("STRING"));
- QCOMPARE(p3.type(), QString());
-}
-
-void ContextPropertyInfoUnitTest::exists()
-{
- ContextPropertyInfo p1("Battery.Charging");
- ContextPropertyInfo p2("Media.NowPlaying");
- ContextPropertyInfo p3("Does.Not.Exist");
- QCOMPARE(p1.exists(), true);
- QCOMPARE(p2.exists(), true);
- QCOMPARE(p3.exists(), false);
-}
-
-void ContextPropertyInfoUnitTest::declared()
-{
- ContextPropertyInfo p1("Battery.Charging");
- ContextPropertyInfo p2("Media.NowPlaying");
- ContextPropertyInfo p3("Does.Not.Exist");
- QCOMPARE(p1.declared(), true);
- QCOMPARE(p2.declared(), true);
- QCOMPARE(p3.declared(), false);
-}
-
-void ContextPropertyInfoUnitTest::provided()
-{
- ContextPropertyInfo p1("Battery.Charging");
- ContextPropertyInfo p2("Media.NowPlaying");
- ContextPropertyInfo p3("Does.Not.Exist");
- QCOMPARE(p1.provided(), true);
- QCOMPARE(p2.provided(), true);
- QCOMPARE(p3.provided(), false);
-}
-
-void ContextPropertyInfoUnitTest::providerDBusName()
-{
- ContextPropertyInfo p1("Battery.Charging");
- ContextPropertyInfo p2("Media.NowPlaying");
- ContextPropertyInfo p3("Does.Not.Exist");
- QCOMPARE(p1.providerDBusName(), QString("org.freedesktop.ContextKit.contextd"));
- QCOMPARE(p2.providerDBusName(), QString("com.nokia.musicplayer"));
- QCOMPARE(p3.providerDBusName(), QString());
-}
-
-void ContextPropertyInfoUnitTest::providers()
-{
- ContextPropertyInfo p("Battery.Charging");
- QList<ContextProviderInfo> providers = p.providers();
- QCOMPARE(providers.size(), 1);
- QCOMPARE(providers.at(0).plugin, QString("contextkit-dbus"));
- QCOMPARE(providers.at(0).constructionString, QString("system:org.freedesktop.ContextKit.contextd"));
-}
-
-void ContextPropertyInfoUnitTest::resolutionStrategy()
-{
- ContextPropertyInfo p("Battery.Charging");
- QCOMPARE(p.resolutionStrategy(), ContextPropertyInfo::LastValue);
-}
-
-void ContextPropertyInfoUnitTest::providerDBusType()
-{
- ContextPropertyInfo p1("Battery.Charging");
- ContextPropertyInfo p2("Media.NowPlaying");
- ContextPropertyInfo p3("Does.Not.Exist");
- QCOMPARE(p1.providerDBusType(), QDBusConnection::SystemBus);
- QCOMPARE(p2.providerDBusType(), QDBusConnection::SessionBus);
- QCOMPARE(p3.providerDBusType(), QDBusConnection::SessionBus);
-}
-
-void ContextPropertyInfoUnitTest::plugin()
-{
- ContextPropertyInfo p1("Battery.Charging");
- ContextPropertyInfo p2("Media.NowPlaying");
- ContextPropertyInfo p3("Does.Not.Exist");
- QCOMPARE(p1.plugin(), QString("contextkit-dbus"));
- QCOMPARE(p2.plugin(), QString("contextkit-dbus"));
- QCOMPARE(p3.plugin(), QString());
-}
-
-void ContextPropertyInfoUnitTest::constructionString()
-{
- ContextPropertyInfo p1("Battery.Charging");
- ContextPropertyInfo p2("Media.NowPlaying");
- ContextPropertyInfo p3("Does.Not.Exist");
- QCOMPARE(p1.constructionString(), QString("system:org.freedesktop.ContextKit.contextd"));
- QCOMPARE(p2.constructionString(), QString("session:com.nokia.musicplayer"));
- QCOMPARE(p3.constructionString(), QString());
-}
-
-void ContextPropertyInfoUnitTest::typeChanged()
-{
- ContextPropertyInfo p("Battery.Charging");
- QSignalSpy spy(&p, SIGNAL(typeChanged(QString)));
- p.connectNotify("typeChanged(QString)");
-
- currentBackend->fireKeyChanged(QString("Battery.Charging"));
-
- QCOMPARE(spy.count(), 1);
- spy.takeFirst();
-
- typeMap.insert("Battery.Charging", "INT");
- currentBackend->fireKeyChanged(QString("Battery.Charging"));
-
- QCOMPARE(spy.count(), 1);
- QList<QVariant> args = spy.takeFirst();
- QCOMPARE(args.at(0).toString(), QString("INT"));
-}
-
-void ContextPropertyInfoUnitTest::providerChanged()
-{
- ContextPropertyInfo p("Battery.Charging");
- QSignalSpy spy(&p, SIGNAL(providerChanged(QString)));
- p.connectNotify("providerChanged(QString)");
-
- currentBackend->fireKeyChanged(QString("Battery.Charging"));
-
- QCOMPARE(spy.count(), 1);
- spy.takeFirst();
-
- ContextProviderInfo info("contextkit-dbus", "system:org.freedesktop.ContextKit.robot");
- providerMap.insert("Battery.Charging", info);
- currentBackend->fireKeyChanged(QString("Battery.Charging"));
-
- QCOMPARE(spy.count(), 1);
- QList<QVariant> args = spy.takeFirst();
- QCOMPARE(args.at(0).toString(), QString("org.freedesktop.ContextKit.robot"));
-}
-
-void ContextPropertyInfoUnitTest::providedChanged()
-{
- ContextPropertyInfo p("Battery.Charging");
- QSignalSpy spy(&p, SIGNAL(providedChanged(bool)));
- p.connectNotify("providedChanged(bool)");
-
- currentBackend->fireKeyChanged(QString("Battery.Charging"));
-
- QCOMPARE(spy.count(), 1);
- spy.takeFirst();
-
- providerMap.remove("Battery.Charging");
- currentBackend->fireKeyChanged(QString("Battery.Charging"));
-
- QCOMPARE(spy.count(), 1);
- QList<QVariant> args = spy.takeFirst();
- QCOMPARE(args.at(0).toBool(), false);
-}
-
-void ContextPropertyInfoUnitTest::pluginChanged()
-{
- ContextPropertyInfo p("Battery.Charging");
- QSignalSpy spy1(&p, SIGNAL(pluginChanged(QString, QString)));
- QSignalSpy spy2(&p, SIGNAL(providerChanged(QString)));
- p.connectNotify("providerChanged(QString)");
- p.connectNotify("pluginChanged(QString)");
-
- currentBackend->fireKeyChanged(QString("Battery.Charging"));
-
- QCOMPARE(spy1.count(), 1);
- spy1.takeFirst();
- QCOMPARE(spy2.count(), 1);
- spy2.takeFirst();
-
- ContextProviderInfo info("test.so", "secret:something");
- providerMap.insert("Battery.Charging", info);
- currentBackend->fireKeyChanged(QString("Battery.Charging"));
-
- QCOMPARE(spy1.count(), 1);
- QList<QVariant> args1 = spy1.takeFirst();
- QCOMPARE(args1.at(0).toString(), QString("test.so"));
- QCOMPARE(args1.at(1).toString(), QString("secret:something"));
-
- QCOMPARE(spy2.count(), 1);
- QList<QVariant> args2 = spy2.takeFirst();
- QCOMPARE(args2.at(0).toString(), QString(""));
-}
-
-void ContextPropertyInfoUnitTest::dbusTypeChanged()
-{
- ContextPropertyInfo p("Battery.Charging");
- QSignalSpy spy(&p, SIGNAL(providerDBusTypeChanged(QDBusConnection::BusType)));
- p.connectNotify("providerDBusTypeChanged(QDBusConnection::BusType)");
-
- currentBackend->fireKeyChanged(QString("Battery.Charging"));
- QCOMPARE(spy.count(), 1);
- spy.takeFirst();
-
- ContextProviderInfo info("contextkit-dbus", "session:org.freedesktop.ContextKit.contextd");
- providerMap.insert("Battery.Charging", info);
- currentBackend->fireKeyChanged(QString("Battery.Charging"));
-
- QCOMPARE(spy.count(), 1);
-}
-
-#include "contextpropertyinfounittest.moc"
-QTEST_MAIN(ContextPropertyInfoUnitTest);
diff --git a/libcontextsubscriber/unit-tests/contextpropertyinfo/infobackend.h b/libcontextsubscriber/unit-tests/contextpropertyinfo/infobackend.h
deleted file mode 100644
index e8dd6715..00000000
--- a/libcontextsubscriber/unit-tests/contextpropertyinfo/infobackend.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef INFOBACKEND_H
-#define INFOBACKEND_H
-
-#include <QVariant>
-#include <QStringList>
-#include <QObject>
-#include "contextproviderinfo.h"
-
-class InfoBackend : public QObject
-{
- Q_OBJECT
-
-public:
-
- static InfoBackend* instance(const QString &backendName = "");
- QString typeForKey(QString key) const;
- QString docForKey(QString key) const;
- bool keyDeclared(QString key) const;
- const QList<ContextProviderInfo> providersForKey(QString key);
-
- void connectNotify(const char *signal);
- void disconnectNotify(const char *signal);
-
- void fireKeysChanged(const QStringList& keys);
- void fireKeysAdded(const QStringList& keys);
- void fireKeysRemoved(const QStringList& keys);
- void fireKeyChanged(const QString& key);
-
-signals:
- void keysChanged(const QStringList& currentKeys);
- void keysAdded(const QStringList& newKeys);
- void keysRemoved(const QStringList& removedKeys);
- void keyChanged(const QString& key);
-
-};
-
-#endif // INFOBACKEND_H
diff --git a/libcontextsubscriber/unit-tests/contextregistryinfo/.gitignore b/libcontextsubscriber/unit-tests/contextregistryinfo/.gitignore
deleted file mode 100644
index db50bd4d..00000000
--- a/libcontextsubscriber/unit-tests/contextregistryinfo/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-contextregistryinfo.cpp
-contextregistryinfo.h
-contextregistryinfounittest
-loggingfeatures.h
-contextproviderinfo.h
diff --git a/libcontextsubscriber/unit-tests/contextregistryinfo/Makefile.am b/libcontextsubscriber/unit-tests/contextregistryinfo/Makefile.am
deleted file mode 100644
index cf93937f..00000000
--- a/libcontextsubscriber/unit-tests/contextregistryinfo/Makefile.am
+++ /dev/null
@@ -1,28 +0,0 @@
-check_PROGRAMS = contextregistryinfounittest
-
-# your test's sources
-contextregistryinfounittest_SOURCES = contextregistryinfounittest.cpp infobackend.h
-
-COVERAGE_FILES = contextregistryinfo.cpp
-EXTRA_DIST =
-
-# do the testing, coverage, etc. stuff
-# tests.am is using +=, so we have to set a value here for these four always
-AM_CXXFLAGS = $(QtDBus_CFLAGS) -I$(srcdir)/../util/ \
- '-DDEFAULT_CONTEXT_PROVIDERS="@datadir@/contextkit/providers/"' \
- '-DDEFAULT_CONTEXT_CORE_DECLARATIONS="@datadir@/contextkit/core.context"'
-AM_LDFLAGS = $(CDB_LIBS) $(QtXml_LIBS)
-FROM_SOURCE = contextregistryinfo.cpp \
- contextregistryinfo.h \
- loggingfeatures.h \
- contextproviderinfo.h
-
-FROM_SOURCE_DIR = $(srcdir)/../../src
-LDADD =
-include $(top_srcdir)/am/tests.am
-
-nodist_contextregistryinfounittest_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(contextregistryinfounittest_SOURCES) $(FROM_SOURCE))
-include $(top_srcdir)/am/qt.am
-
-contextregistryinfounittest.o: contextregistryinfounittest.moc
diff --git a/libcontextsubscriber/unit-tests/contextregistryinfo/contextregistryinfounittest.cpp b/libcontextsubscriber/unit-tests/contextregistryinfo/contextregistryinfounittest.cpp
deleted file mode 100644
index 0c725401..00000000
--- a/libcontextsubscriber/unit-tests/contextregistryinfo/contextregistryinfounittest.cpp
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <QtTest/QtTest>
-#include <QtCore>
-#include "contextregistryinfo.h"
-#include "fileutils.h"
-#include "infobackend.h"
-
-/* Mocked infobackend */
-
-InfoBackend* currentBackend = NULL;
-
-InfoBackend* InfoBackend::instance(const QString &backendName)
-{
- if (currentBackend)
- return currentBackend;
- else {
- currentBackend = new InfoBackend();
- return currentBackend;
- }
-}
-
-QString InfoBackend::name() const
-{
- return "test";
-}
-
-QStringList InfoBackend::listKeys() const
-{
- QStringList l;
- l << QString("Battery.Charging");
- l << QString("Media.NowPlaying");
- return l;
-}
-
-const QList<ContextProviderInfo> InfoBackend::providersForKey(QString key)
-{
- QList<ContextProviderInfo> lst;
- ContextProviderInfo info("contextkit-dbus", "");
-
- if (key == "Battery.Charging") {
- info.constructionString = "system:org.freedesktop.ContextKit.contextd";
- lst << info;
- } else if (key == "Media.NowPlaying") {
- info.constructionString = "system:com.nokia.musicplayer";
- lst << info;
- }
-
- return lst;
-}
-
-void InfoBackend::fireKeysChanged(const QStringList& keys)
-{
- emit keysChanged(keys);
-}
-
-void InfoBackend::fireKeysAdded(const QStringList& keys)
-{
- emit keysAdded(keys);
-}
-
-void InfoBackend::fireKeysRemoved(const QStringList& keys)
-{
- emit keysRemoved(keys);
-}
-
-void InfoBackend::fireListChanged()
-{
- emit listChanged();
-}
-
-/* ContextRegistryInfoUnitTest */
-
-class ContextRegistryInfoUnitTest : public QObject
-{
- Q_OBJECT
-
-private:
- ContextRegistryInfo *registry;
-
-private slots:
- void initTestCase();
- void listKeys();
- void listKeysForPlugin();
- void listProviders();
- void listPlugins();
- void backendName();
- void signalling();
-};
-
-void ContextRegistryInfoUnitTest::initTestCase()
-{
- registry = ContextRegistryInfo::instance();
-}
-
-void ContextRegistryInfoUnitTest::listKeys()
-{
- QStringList keys1 = registry->listKeys();
- QCOMPARE(keys1.count(), 2);
- QVERIFY(keys1.contains("Battery.Charging"));
- QVERIFY(keys1.contains("Media.NowPlaying"));
-
- QStringList keys2 = registry->listKeys("org.freedesktop.ContextKit.contextd");
- QCOMPARE(keys2.count(), 1);
- QVERIFY(keys2.contains("Battery.Charging"));
-
- QStringList keys3 = registry->listKeys("com.nokia.musicplayer");
- QCOMPARE(keys3.count(), 1);
- QVERIFY(keys3.contains("Media.NowPlaying"));
-
- QStringList keys4 = registry->listKeys("com.something");
- QCOMPARE(keys4.count(), 0);
-}
-
-void ContextRegistryInfoUnitTest::listKeysForPlugin()
-{
- QStringList keys1 = registry->listKeysForPlugin("contextkit-dbus");
- QCOMPARE(keys1.count(), 2);
- QVERIFY(keys1.contains("Battery.Charging"));
- QVERIFY(keys1.contains("Media.NowPlaying"));
-
- QStringList keys2 = registry->listKeysForPlugin("does-not-exist");
- QCOMPARE(keys2.count(), 0);
-}
-
-void ContextRegistryInfoUnitTest::listProviders()
-{
- QStringList providers = registry->listProviders();
- QCOMPARE(providers.count(), 2);
- QVERIFY(providers.contains("com.nokia.musicplayer"));
- QVERIFY(providers.contains("org.freedesktop.ContextKit.contextd"));
-}
-
-void ContextRegistryInfoUnitTest::listPlugins()
-{
- QStringList plugins = registry->listPlugins();
- QCOMPARE(plugins.count(), 1);
- QVERIFY(plugins.contains("contextkit-dbus"));
-}
-
-void ContextRegistryInfoUnitTest::backendName()
-{
- QCOMPARE(registry->backendName(), QString("test"));
-}
-
-void ContextRegistryInfoUnitTest::signalling()
-{
- QSignalSpy spy1(registry, SIGNAL(keysChanged(QStringList)));
- QSignalSpy spy2(registry, SIGNAL(keysAdded(QStringList)));
- QSignalSpy spy3(registry, SIGNAL(keysRemoved(QStringList)));
- QSignalSpy spy4(registry, SIGNAL(changed()));
-
- registry->connectNotify("keysChanged(QStringList)");
- registry->connectNotify("keysAdded(QStringList)");
- registry->connectNotify("keysRemoved(QStringList)");
- registry->connectNotify("changed()");
-
- QStringList keys;
- keys << QString("Battery.Charging");
- keys << QString("Media.NowPlaying");
-
- currentBackend->fireKeysChanged(keys);
- QCOMPARE(spy1.count(), 1);
- QList<QVariant> args1 = spy1.takeFirst();
- QCOMPARE(args1.at(0).toStringList(), keys);
-
- currentBackend->fireKeysAdded(keys);
- QCOMPARE(spy2.count(), 1);
- QList<QVariant> args2 = spy2.takeFirst();
- QCOMPARE(args2.at(0).toStringList(), keys);
-
- currentBackend->fireKeysRemoved(keys);
- QCOMPARE(spy3.count(), 1);
- QList<QVariant> args3 = spy3.takeFirst();
- QCOMPARE(args3.at(0).toStringList(), keys);
-
- currentBackend->fireListChanged();
- QCOMPARE(spy4.count(), 1);
-}
-
-#include "contextregistryinfounittest.moc"
-QTEST_MAIN(ContextRegistryInfoUnitTest);
diff --git a/libcontextsubscriber/unit-tests/contextregistryinfo/infobackend.h b/libcontextsubscriber/unit-tests/contextregistryinfo/infobackend.h
deleted file mode 100644
index 41fce0a7..00000000
--- a/libcontextsubscriber/unit-tests/contextregistryinfo/infobackend.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef INFOBACKEND_H
-#define INFOBACKEND_H
-
-#include <QVariant>
-#include <QStringList>
-#include <QObject>
-#include "contextproviderinfo.h"
-
-class InfoBackend : public QObject
-{
- Q_OBJECT
-
-public:
- static InfoBackend* instance(const QString &backendName = "");
-
- QString name() const;
- QStringList listKeys() const;
- const QList<ContextProviderInfo> providersForKey(QString key);
-
- void fireKeysChanged(const QStringList& keys);
- void fireKeysAdded(const QStringList& keys);
- void fireKeysRemoved(const QStringList& keys);
- void fireListChanged();
-
-signals:
- void keysChanged(const QStringList& currentKeys);
- void keysAdded(const QStringList& newKeys);
- void keysRemoved(const QStringList& removedKeys);
- void listChanged();
-};
-
-#endif // INFOBACKEND_H
diff --git a/libcontextsubscriber/unit-tests/handlesignalrouter/.gitignore b/libcontextsubscriber/unit-tests/handlesignalrouter/.gitignore
deleted file mode 100644
index 8b3ad9a2..00000000
--- a/libcontextsubscriber/unit-tests/handlesignalrouter/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-handlesignalrouter.cpp
-handlesignalrouter.h
-logging.cpp
-logging.h
-loggingfeatures.h
diff --git a/libcontextsubscriber/unit-tests/handlesignalrouter/Makefile.am b/libcontextsubscriber/unit-tests/handlesignalrouter/Makefile.am
deleted file mode 100644
index 4a6549cb..00000000
--- a/libcontextsubscriber/unit-tests/handlesignalrouter/Makefile.am
+++ /dev/null
@@ -1,21 +0,0 @@
-check_PROGRAMS = handlesignalrouter-unit-tests
-
-# your test's sources
-handlesignalrouter_unit_tests_SOURCES = testhandlesignalrouter.cpp \
- propertyhandle.h testhandlesignalrouter.h
-
-# only include these files in the coverage
-COVERAGE_FILES = handlesignalrouter.cpp
-
-# do the testing, coverage, etc. stuff
-# tests.am is using +=, so we have to set a value here for these four always
-AM_CXXFLAGS = $(QtDBus_CFLAGS) '-DDEFAULT_CONTEXT_PROVIDERS="@datadir@/contextkit/providers/"'
-AM_LDFLAGS =
-FROM_SOURCE = handlesignalrouter.cpp handlesignalrouter.h loggingfeatures.h # copy these files from the real source
-FROM_SOURCE_DIR = $(srcdir)/../../src
-LDADD =
-include $(top_srcdir)/am/tests.am
-
-nodist_handlesignalrouter_unit_tests_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(handlesignalrouter_unit_tests_SOURCES) $(FROM_SOURCE))
-include $(top_srcdir)/am/qt.am
diff --git a/libcontextsubscriber/unit-tests/handlesignalrouter/propertyhandle.h b/libcontextsubscriber/unit-tests/handlesignalrouter/propertyhandle.h
deleted file mode 100644
index 24e243e2..00000000
--- a/libcontextsubscriber/unit-tests/handlesignalrouter/propertyhandle.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-// This is a mock implementation
-
-#ifndef PROPERTYHANDLE_H
-#define PROPERTYHANDLE_H
-
-#include <QObject>
-#include <QVariant>
-#include <QString>
-#include <QSet>
-
-namespace ContextSubscriber {
-
-class Provider;
-
-class PropertyHandle : public QObject
-{
- Q_OBJECT
-
-public:
- static PropertyHandle* instance(const QString& key);
- void onValueChanged();
- void setSubscribeFinished(Provider *);
-
-signals:
- // For tests
- void onValueChangedCalled(QString);
- void setSubscribeFinishedCalled(Provider *,QString);
-
-public:
- PropertyHandle(const QString& key);
- QString myKey;
-};
-
-} // end namespace
-
-#endif
diff --git a/libcontextsubscriber/unit-tests/handlesignalrouter/testhandlesignalrouter.cpp b/libcontextsubscriber/unit-tests/handlesignalrouter/testhandlesignalrouter.cpp
deleted file mode 100644
index 3f674634..00000000
--- a/libcontextsubscriber/unit-tests/handlesignalrouter/testhandlesignalrouter.cpp
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-// Header file of the tests
-#include "testhandlesignalrouter.h"
-
-// Mock header files
-#include "propertyhandle.h"
-
-// Header file of the class to be tested
-#include "handlesignalrouter.h"
-
-#include <QtTest/QtTest>
-#include <QDebug>
-#include <QDBusConnection>
-
-// Help the QSignalSpy handle QVariant
-Q_DECLARE_METATYPE(QVariant);
-
-namespace ContextSubscriber {
-
-#define MYLOGLEVEL 2
-void myMessageOutput(QtMsgType type, const char *msg)
-{
- switch (type) {
- case QtDebugMsg:
- if (MYLOGLEVEL <= 0)
- fprintf(stderr, "Debug: %s\n", msg);
- break;
- case QtWarningMsg:
- if (MYLOGLEVEL <= 1)
- fprintf(stderr, "Warning: %s\n", msg);
- break;
- case QtCriticalMsg:
- if (MYLOGLEVEL <= 2)
- fprintf(stderr, "Critical: %s\n", msg);
- break;
- case QtFatalMsg:
- if (MYLOGLEVEL <= 3)
- fprintf(stderr, "Fatal: %s\n", msg);
- abort();
- }
-}
-
-// Mock instances
-// These will be created by the test program
-PropertyHandle* mockHandleOne;
-PropertyHandle* mockHandleTwo;
-PropertyHandle* mockHandleThree;
-
-// Mock implementation of the PropertyHandle
-
-PropertyHandle::PropertyHandle(const QString& key)
- : myKey(key)
-{
-}
-
-void PropertyHandle::onValueChanged()
-{
- emit onValueChangedCalled(myKey);
-}
-
-void PropertyHandle::setSubscribeFinished(Provider *prov)
-{
- emit setSubscribeFinishedCalled(prov, myKey);
-}
-
-PropertyHandle* PropertyHandle::instance(const QString& key)
-{
- if (key == "Property.One") {
- return mockHandleOne;
- }
- if (key == "Property.Two") {
- return mockHandleTwo;
- }
- if (key == "Property.Three") {
- return mockHandleThree;
- }
- return 0;
-}
-
-
-//
-// Definition of testcases
-//
-
-// Before all tests
-void HandleSignalRouterUnitTests::initTestCase()
-{
- qInstallMsgHandler(myMessageOutput);
- // Help the QSignalSpy handle QVariant
- qRegisterMetaType<QVariant>("QVariant");
-}
-
-// After all tests
-void HandleSignalRouterUnitTests::cleanupTestCase()
-{
-}
-
-// Before each test
-void HandleSignalRouterUnitTests::init()
-{
- // Create the mock instances
- mockHandleOne = new PropertyHandle("Property.One");
- mockHandleTwo = new PropertyHandle("Property.Two");
- mockHandleThree = new PropertyHandle("Property.Three");
-}
-
-// After each test
-void HandleSignalRouterUnitTests::cleanup()
-{
- // Delete the mock objects
- delete mockHandleOne;
- mockHandleOne = 0;
- delete mockHandleTwo;
- mockHandleTwo = 0;
- delete mockHandleThree;
- mockHandleThree = 0;
-}
-
-void HandleSignalRouterUnitTests::routingSignals()
-{
- // Setup:
- // Get the object to be tested
- handleSignalRouter = HandleSignalRouter::instance();
- // Start spying the mock handles
- QSignalSpy spy1(mockHandleOne, SIGNAL(onValueChangedCalled(QString)));
- QSignalSpy spy2(mockHandleTwo, SIGNAL(onValueChangedCalled(QString)));
- QSignalSpy spy3(mockHandleThree, SIGNAL(onValueChangedCalled(QString)));
- QSignalSpy sspy1(mockHandleOne, SIGNAL(setSubscribeFinishedCalled(Provider *, QString)));
- QSignalSpy sspy2(mockHandleTwo, SIGNAL(setSubscribeFinishedCalled(Provider *, QString)));
- QSignalSpy sspy3(mockHandleThree, SIGNAL(setSubscribeFinishedCalled(Provider *, QString)));
-
- // Test:
- // Send a signal to the HandleSignalRouter
- handleSignalRouter->onValueChanged("Property.One");
- handleSignalRouter->onSubscribeFinished(0, "Property.One");
-
- // Expected results:
- // The mockHandleOne.setValue was called
- QCOMPARE(spy1.count(), 1);
- QList<QVariant> parameters = spy1.takeFirst();
- QCOMPARE(parameters.size(), 1);
- QCOMPARE(parameters.at(0), QVariant("Property.One"));
-
- QCOMPARE(sspy1.count(), 1);
- parameters = sspy1.takeFirst();
- QCOMPARE(parameters.size(), 2);
- QCOMPARE(parameters.at(1), QVariant("Property.One"));
-
- // The setValue of other mock handles were not called
- QCOMPARE(spy2.count(), 0);
- QCOMPARE(spy3.count(), 0);
- QCOMPARE(sspy2.count(), 0);
- QCOMPARE(sspy3.count(), 0);
-
- // Test:
- // Send a signal to the HandleSignalRouter
- handleSignalRouter->onValueChanged("Property.Two");
- handleSignalRouter->onSubscribeFinished(0, "Property.Two");
-
- // Expected results:
- // The mockHandleTwo.setValue was called
- QCOMPARE(spy2.count(), 1);
- QCOMPARE(sspy2.count(), 1);
- parameters = spy2.takeFirst();
- QCOMPARE(parameters.size(), 1);
- QCOMPARE(parameters.at(0), QVariant("Property.Two"));
- parameters = sspy2.takeFirst();
- QCOMPARE(parameters.size(), 2);
- QCOMPARE(parameters.at(1), QVariant("Property.Two"));
- // The setValue of other mock handles were not called
- QCOMPARE(spy1.count(), 0);
- QCOMPARE(spy3.count(), 0);
- QCOMPARE(sspy1.count(), 0);
- QCOMPARE(sspy3.count(), 0);
-
-}
-
-} // end namespace
-
-QTEST_MAIN(ContextSubscriber::HandleSignalRouterUnitTests);
diff --git a/libcontextsubscriber/unit-tests/handlesignalrouter/testhandlesignalrouter.h b/libcontextsubscriber/unit-tests/handlesignalrouter/testhandlesignalrouter.h
deleted file mode 100644
index 2a0f33dd..00000000
--- a/libcontextsubscriber/unit-tests/handlesignalrouter/testhandlesignalrouter.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <QObject>
-#include <QSet>
-#include <QString>
-
-namespace ContextSubscriber {
-
-class HandleSignalRouter;
-
-class HandleSignalRouterUnitTests : public QObject
-{
- Q_OBJECT
-
-private:
- HandleSignalRouter *handleSignalRouter;
-
- // Tests
-private slots:
- // Init and cleanup helper functions
- void initTestCase();
- void cleanupTestCase();
- void init();
- void cleanup();
-
- // Test cases
- void routingSignals();
-};
-
-} // end namespace
diff --git a/libcontextsubscriber/unit-tests/infobackend/.gitignore b/libcontextsubscriber/unit-tests/infobackend/.gitignore
deleted file mode 100644
index 90acf3ed..00000000
--- a/libcontextsubscriber/unit-tests/infobackend/.gitignore
+++ /dev/null
@@ -1,19 +0,0 @@
-cdbreader.cpp
-cdbreader.h
-infobackend.cpp
-infobackend.h
-infocdbbackend.cpp
-infocdbbackend.h
-infokeydata.h
-infoxmlbackend.cpp
-infoxmlbackend.h
-infobackendunittest
-infoxmlkeysfinder.cpp
-infoxmlkeysfinder.h
-sconnect.h
-logging.cpp
-logging.h
-loggingfeatures.h
-nanoxml.cpp
-nanoxml.h
-contextproviderinfo.h
diff --git a/libcontextsubscriber/unit-tests/infobackend/Makefile.am b/libcontextsubscriber/unit-tests/infobackend/Makefile.am
deleted file mode 100644
index 06c58681..00000000
--- a/libcontextsubscriber/unit-tests/infobackend/Makefile.am
+++ /dev/null
@@ -1,36 +0,0 @@
-check_PROGRAMS = infobackendunittest
-
-# your test's sources
-infobackendunittest_SOURCES = infobackendunittest.cpp
-
-COVERAGE_FILES = infobackend.cpp
-EXTRA_DIST =
-
-# do the testing, coverage, etc. stuff
-# tests.am is using +=, so we have to set a value here for these four always
-AM_CXXFLAGS = $(QtDBus_CFLAGS) -I$(srcdir)/../util/ \
- '-DDEFAULT_CONTEXT_PROVIDERS="@datadir@/contextkit/providers/"' \
- '-DDEFAULT_CONTEXT_CORE_DECLARATIONS="@datadir@/contextkit/core.context"'
-AM_LDFLAGS = $(CDB_LIBS) $(QtXml_LIBS)
-FROM_SOURCE = \
- infobackend.cpp infoxmlbackend.cpp \
- cdbreader.h cdbreader.cpp \
- infobackend.h \
- infoxmlbackend.h \
- infocdbbackend.h \
- infocdbbackend.cpp \
- infokeydata.h \
- loggingfeatures.h \
- nanoxml.cpp \
- nanoxml.h \
- contextproviderinfo.h
-
-FROM_SOURCE_DIR = $(srcdir)/../../src
-LDADD =
-include $(top_srcdir)/am/tests.am
-
-nodist_infobackendunittest_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(infobackendunittest_SOURCES) $(FROM_SOURCE))
-include $(top_srcdir)/am/qt.am
-
-infobackendunittest.o: infobackendunittest.moc
diff --git a/libcontextsubscriber/unit-tests/infobackend/infobackendunittest.cpp b/libcontextsubscriber/unit-tests/infobackend/infobackendunittest.cpp
deleted file mode 100644
index 573a866c..00000000
--- a/libcontextsubscriber/unit-tests/infobackend/infobackendunittest.cpp
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <QtTest/QtTest>
-#include <QtCore>
-#include "infobackend.h"
-
-class InfoTestBackend : public InfoBackend
-{
-public:
-
- QString name() const
- {
- return "test";
- }
-
- QStringList listKeys() const
- {
- return QStringList();
- }
-
- QStringList listKeysForPlugin(QString plugin) const
- {
- return QStringList();
- }
-
- QStringList listPlugins() const
- {
- return QStringList();
- }
-
- QString typeForKey(QString key) const
- {
- return QString();
- }
-
- QString docForKey(QString key) const
- {
- return QString();
- }
-
- bool keyDeclared(QString key) const
- {
- return false;
- }
-
- const QList<ContextProviderInfo> providersForKey(QString key) const
- {
- return QList<ContextProviderInfo> ();
- }
-};
-
-class InfoBackendUnitTest : public QObject
-{
- Q_OBJECT
-
- InfoBackend *backend;
-
-private slots:
- void initTestCase();
- void checkAndEmitKeysAdded();
- void checkAndEmitKeysRemoved();
- void checkAndEmitKeyChanged();
- void connectNotify();
- void instance();
- void cleanupTestCase();
-};
-
-void InfoBackendUnitTest::initTestCase()
-{
- backend = new InfoTestBackend();
- InfoBackend::backendInstance = backend;
-}
-
-void InfoBackendUnitTest::checkAndEmitKeysAdded()
-{
- QSignalSpy spy(backend, SIGNAL(keysAdded(QStringList)));
-
- QStringList currentKeys;
- QStringList oldKeys;
-
- currentKeys << "Key.One";
- currentKeys << "Key.Two";
- oldKeys << "Key.One";
-
- backend->checkAndEmitKeysAdded(currentKeys, oldKeys);
-
- QCOMPARE(spy.count(), 1);
- QList<QVariant> args = spy.takeFirst();
- QCOMPARE(args.at(0).toList().size(), 1);
- QCOMPARE(args.at(0).toStringList().at(0), QString("Key.Two"));
-}
-
-void InfoBackendUnitTest::checkAndEmitKeysRemoved()
-{
- QSignalSpy spy(backend, SIGNAL(keysRemoved(QStringList)));
-
- QStringList currentKeys;
- QStringList oldKeys;
-
- currentKeys << "Key.One";
- oldKeys << "Key.Two";
- oldKeys << "Key.One";
-
- backend->checkAndEmitKeysRemoved(currentKeys, oldKeys);
-
- QCOMPARE(spy.count(), 1);
- QList<QVariant> args = spy.takeFirst();
- QCOMPARE(args.at(0).toList().size(), 1);
- QCOMPARE(args.at(0).toStringList().at(0), QString("Key.Two"));
-}
-
-void InfoBackendUnitTest::checkAndEmitKeyChanged()
-{
- QSignalSpy spy(backend, SIGNAL(keyChanged(QString)));
-
- QStringList currentKeys;
- QStringList oldKeys;
-
- currentKeys << "Key.One";
- currentKeys << "Key.Three";
- oldKeys << "Key.Two";
- oldKeys << "Key.One";
-
- backend->checkAndEmitKeyChanged(currentKeys, oldKeys);
-
- QCOMPARE(spy.count(), 3);
-}
-
-void InfoBackendUnitTest::connectNotify()
-{
- QCOMPARE(backend->connectCount, 0);
- backend->connectNotify("-");
- QCOMPARE(backend->connectCount, 1);
- backend->disconnectNotify("-");
- QCOMPARE(backend->connectCount, 0);
-}
-
-void InfoBackendUnitTest::instance()
-{
- InfoBackend::destroyInstance();
- backend = NULL;
-
- InfoBackend *instance;
-
- InfoBackend::backendInstance = NULL;
- instance = InfoBackend::instance("xml");
- QCOMPARE(instance, InfoBackend::backendInstance);
- QCOMPARE(instance->name(), QString("xml"));
- InfoBackend::destroyInstance();
- QVERIFY(InfoBackend::backendInstance == NULL);
-
- InfoBackend::backendInstance = NULL;
- instance = InfoBackend::instance("cdb");
- QCOMPARE(instance, InfoBackend::backendInstance);
- QCOMPARE(instance->name(), QString("cdb"));
- InfoBackend::destroyInstance();
- QVERIFY(InfoBackend::backendInstance == NULL);
-
- InfoBackend::backendInstance = new InfoTestBackend();
- InfoBackend::destroyInstance();
- QVERIFY(InfoBackend::backendInstance == NULL);
-}
-
-void InfoBackendUnitTest::cleanupTestCase()
-{
- QVERIFY(InfoBackend::backendInstance == NULL);
- InfoBackend::destroyInstance();
-}
-
-#include "infobackendunittest.moc"
-QTEST_MAIN(InfoBackendUnitTest);
diff --git a/libcontextsubscriber/unit-tests/infocdbbackend/.gitignore b/libcontextsubscriber/unit-tests/infocdbbackend/.gitignore
deleted file mode 100644
index 175be724..00000000
--- a/libcontextsubscriber/unit-tests/infocdbbackend/.gitignore
+++ /dev/null
@@ -1,22 +0,0 @@
-cache.cdb
-cdbreader.cpp
-cdbreader.h
-cdbwriter.cpp
-cdbwriter.h
-infobackend.cpp
-infobackend.h
-infocdbbackend.cpp
-infocdbbackend.h
-infocdbbackendunittest
-infokeydata.h
-infoxmlbackend.cpp
-infoxmlbackend.h
-infoxmlkeysfinder.cpp
-infoxmlkeysfinder.h
-sconnect.h
-logging.cpp
-logging.h
-loggingfeatures.h
-nanoxml.h
-nanoxml.cpp
-contextproviderinfo.h
diff --git a/libcontextsubscriber/unit-tests/infocdbbackend/Makefile.am b/libcontextsubscriber/unit-tests/infocdbbackend/Makefile.am
deleted file mode 100644
index 9203a7d2..00000000
--- a/libcontextsubscriber/unit-tests/infocdbbackend/Makefile.am
+++ /dev/null
@@ -1,37 +0,0 @@
-check_PROGRAMS = infocdbbackendunittest
-
-# your test's sources
-infocdbbackendunittest_SOURCES = infocdbbackendunittest.cpp
-
-COVERAGE_FILES = infocdbbackend.cpp
-EXTRA_DIST =
-
-# do the testing, coverage, etc. stuff
-# tests.am is using +=, so we have to set a value here for these four always
-AM_CXXFLAGS = $(QtDBus_CFLAGS) -I$(srcdir)/../util/ \
- '-DDEFAULT_CONTEXT_PROVIDERS="@datadir@/contextkit/providers/"' \
- '-DDEFAULT_CONTEXT_CORE_DECLARATIONS="@datadir@/contextkit/core.context"'
-AM_LDFLAGS = $(CDB_LIBS) $(QtXml_LIBS)
-FROM_SOURCE = \
- infobackend.cpp infoxmlbackend.cpp \
- cdbreader.h cdbreader.cpp \
- cdbwriter.h cdbwriter.cpp \
- infobackend.h \
- infoxmlbackend.h \
- infocdbbackend.h \
- infocdbbackend.cpp \
- infokeydata.h \
- loggingfeatures.h \
- nanoxml.h \
- nanoxml.cpp \
- contextproviderinfo.h
-
-FROM_SOURCE_DIR = $(srcdir)/../../src
-LDADD =
-include $(top_srcdir)/am/tests.am
-
-nodist_infocdbbackendunittest_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(infocdbbackendunittest_SOURCES) $(FROM_SOURCE))
-include $(top_srcdir)/am/qt.am
-
-infocdbbackendunittest.o: infocdbbackendunittest.moc
diff --git a/libcontextsubscriber/unit-tests/infocdbbackend/infocdbbackendunittest.cpp b/libcontextsubscriber/unit-tests/infocdbbackend/infocdbbackendunittest.cpp
deleted file mode 100644
index af60c0fc..00000000
--- a/libcontextsubscriber/unit-tests/infocdbbackend/infocdbbackendunittest.cpp
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <QtTest/QtTest>
-#include <QtCore>
-#include "fileutils.h"
-#include "infocdbbackend.h"
-#include "cdbwriter.h"
-
-class InfoCdbBackendUnitTest : public QObject
-{
- Q_OBJECT
- InfoCdbBackend *backend;
-
-private:
- void createBaseDatabase(QString path);
- void createAlternateDatabase(QString path);
- void createIncompatibleDatabase(QString path);
-
-private slots:
- void initTestCase();
- void name();
- void databaseExists();
- void databaseDirectory();
- void listKeys();
- void typeForKey();
- void docForKey();
- void keyDeclared();
- void providersForKey();
- void dynamics();
- void removed();
- void incompatibleDatabase();
- void cleanupTestCase();
-};
-
-void InfoCdbBackendUnitTest::createBaseDatabase(QString path)
-{
- CDBWriter writer(path);
-
- if (! writer.isWritable())
- qFatal("Failed to open %s for reading!", path.toLocal8Bit().data());
-
- writer.add("KEYS", "Battery.Charging");
- writer.add("KEYS", "Internet.BytesOut");
- writer.add("Battery.Charging:KEYTYPE", "TRUTH");
- writer.add("Internet.BytesOut:KEYTYPE", "INTEGER");
- writer.add("Battery.Charging:KEYDOC", "doc1");
-
- QVariantList providers1;
- QHash <QString, QVariant> provider1;
- provider1.insert("plugin", "contextkit-dbus");
- provider1.insert("constructionString", "system:org.freedesktop.ContextKit.contextd1");
- providers1 << QVariant(provider1);
- writer.add("Battery.Charging:PROVIDERS", QVariant(providers1));
-
- QVariantList providers2;
- QHash <QString, QVariant> provider2;
- provider2.insert("plugin", "contextkit-dbus");
- provider2.insert("constructionString", "session:org.freedesktop.ContextKit.contextd2");
- providers2 << QVariant(provider2);
- writer.add("Internet.BytesOut:PROVIDERS", QVariant(providers2));
-
- writer.close();
-}
-
-void InfoCdbBackendUnitTest::createAlternateDatabase(QString path)
-{
- CDBWriter writer(path);
-
- if (! writer.isWritable())
- qFatal("Failed to open %s for reading!", path.toLocal8Bit().data());
-
- writer.add("KEYS", "Battery.Charging");
- writer.add("KEYS", "Battery.Capacity");
- writer.add("Battery.Charging:KEYTYPE", "INTEGER");
- writer.add("Battery.Charging:KEYDOC", "doc1");
- writer.add("Battery.Capacity:KEYTYPE", "INTEGER");
- writer.add("Battery.Capacity:KEYDOC", "doc3");
-
- QVariantList providers1;
- QHash <QString, QVariant> provider1;
- provider1.insert("plugin", "contextkit-dbus");
- provider1.insert("constructionString", "system:org.freedesktop.ContextKit.contextd1");
- providers1 << QVariant(provider1);
- writer.add("Battery.Charging:PROVIDERS", QVariant(providers1));
-
- QVariantList providers2;
- QHash <QString, QVariant> provider2;
- QHash <QString, QVariant> provider3;
- provider2.insert("plugin", "contextkit-dbus");
- provider2.insert("constructionString", "system:org.freedesktop.ContextKit.contextd1");
- provider3.insert("plugin", "contextkit-dbus");
- provider3.insert("constructionString", "system:org.freedesktop.ContextKit.contextdX");
- providers2 << QVariant(provider2);
- providers2 << QVariant(provider3);
- writer.add("Battery.Capacity:PROVIDERS", providers2);
-
- writer.close();
-}
-
-void InfoCdbBackendUnitTest::createIncompatibleDatabase(QString path)
-{
- CDBWriter writer(path);
-
- if (! writer.isWritable())
- qFatal("Failed to open %s for reading!", path.toLocal8Bit().data());
-
- writer.add("KEYS", "Battery.Charging");
- writer.add("Battery.Charging:KEYTYPE", "INTEGER");
- writer.add("Battery.Charging:KEYDOC", "doc1");
-
- QVariantList providers;
- QHash <QString, QVariant> provider1;
- provider1.insert("plugin", "contextkit-dbus");
- provider1.insert("constructionString", "system:org.freedesktop.ContextKit.contextd1");
- providers << QVariant(provider1);
- writer.add("Battery.Charging:PROVIDERS", QVariant(providers));
- writer.add("VERSION", "bull");
-
- writer.close();
-}
-
-void InfoCdbBackendUnitTest::initTestCase()
-{
- createBaseDatabase("cache.cdb");
-
- utilSetEnv("CONTEXT_PROVIDERS", "./");
- utilSetEnv("CONTEXT_CORE_DECLARATIONS", "/dev/null");
- backend = new InfoCdbBackend();
-}
-
-void InfoCdbBackendUnitTest::name()
-{
- QCOMPARE(backend->name(), QString("cdb"));
-}
-
-void InfoCdbBackendUnitTest::databaseDirectory()
-{
- QVERIFY(backend->databaseDirectory() == QString("./") ||
- backend->databaseDirectory() == QString("."));
-}
-
-void InfoCdbBackendUnitTest::databaseExists()
-{
- QCOMPARE(backend->databaseExists(), true);
-}
-
-void InfoCdbBackendUnitTest::listKeys()
-{
- QStringList keys = backend->listKeys();
- QCOMPARE(keys.count(), 2);
- QVERIFY(keys.contains("Battery.Charging"));
- QVERIFY(keys.contains("Internet.BytesOut"));
-}
-
-void InfoCdbBackendUnitTest::typeForKey()
-{
- QCOMPARE(backend->typeForKey("Internet.BytesOut"), QString("INTEGER"));
- QCOMPARE(backend->typeForKey("Battery.Charging"), QString("TRUTH"));
- QCOMPARE(backend->typeForKey("Does.Not.Exist"), QString());
-}
-
-void InfoCdbBackendUnitTest::docForKey()
-{
- QCOMPARE(backend->docForKey("Internet.BytesOut"), QString());
- QCOMPARE(backend->docForKey("Battery.Charging"), QString("doc1"));
- QCOMPARE(backend->docForKey("Does.Not.Exist"), QString());
-}
-
-void InfoCdbBackendUnitTest::keyDeclared()
-{
- foreach (QString key, backend->listKeys())
- QCOMPARE(backend->keyDeclared(key), true);
-
- QCOMPARE(backend->keyDeclared("Does.Not.Exist"), false);
- QCOMPARE(backend->keyDeclared("Battery.Charging"), true);
-}
-
-void InfoCdbBackendUnitTest::providersForKey()
-{
- QList <ContextProviderInfo> list1 = backend->providersForKey("Battery.Charging");
- QCOMPARE(list1.count(), 1);
- QCOMPARE(list1.at(0).plugin, QString("contextkit-dbus"));
- QCOMPARE(list1.at(0).constructionString, QString("system:org.freedesktop.ContextKit.contextd1"));
-
- QList <ContextProviderInfo> list2 = backend->providersForKey("Does.Not.Exist");
- QCOMPARE(list2.count(), 0);
-}
-
-void InfoCdbBackendUnitTest::dynamics()
-{
- backend->connectNotify("-"); // Fake it. Spy does something fishy here.
-
- // Setup the spy observers
- QSignalSpy spy1(backend, SIGNAL(keysRemoved(QStringList)));
- QSignalSpy spy2(backend, SIGNAL(keysChanged(QStringList)));
- QSignalSpy spy3(backend, SIGNAL(keyChanged(QString)));
- QSignalSpy spy4(backend, SIGNAL(keysAdded(QStringList)));
-
- createAlternateDatabase("cache-next.cdb");
- QFile::remove("cache.cdb");
- QFile::copy("cache-next.cdb", "cache.cdb");
- QTest::qWait(DEFAULT_WAIT_PERIOD);
-
- // Test the new values
- QCOMPARE(backend->databaseExists(), true);
- QCOMPARE(backend->listKeys().count(), 2);
- QVERIFY(backend->listKeys().contains("Battery.Charging"));
- QVERIFY(backend->listKeys().contains("Battery.Capacity"));
- QCOMPARE(backend->typeForKey("Battery.Charging"), QString("INTEGER"));
- QCOMPARE(backend->docForKey("Battery.Charging"), QString("doc1"));
-
- // Check providers
- QList <ContextProviderInfo> list1 = backend->providersForKey("Battery.Charging");
- QCOMPARE(list1.count(), 1);
- QCOMPARE(list1.at(0).plugin, QString("contextkit-dbus"));
- QCOMPARE(list1.at(0).constructionString, QString("system:org.freedesktop.ContextKit.contextd1"));
- QList <ContextProviderInfo> list2 = backend->providersForKey("Battery.Capacity");
- QCOMPARE(list2.count(), 2);
- QCOMPARE(list2.at(0).plugin, QString("contextkit-dbus"));
- QCOMPARE(list2.at(0).constructionString, QString("system:org.freedesktop.ContextKit.contextd1"));
- QCOMPARE(list2.at(1).plugin, QString("contextkit-dbus"));
- QCOMPARE(list2.at(1).constructionString, QString("system:org.freedesktop.ContextKit.contextdX"));
-
- // Test emissions
- QCOMPARE(spy1.count(), 1);
- QList<QVariant> args1 = spy1.takeFirst();
- QCOMPARE(args1.at(0).toList().size(), 1);
- QCOMPARE(args1.at(0).toStringList().at(0), QString("Internet.BytesOut"));
-
- QCOMPARE(spy2.count(), 1);
- QList<QVariant> args2 = spy2.takeFirst();
- QCOMPARE(args2.at(0).toList().size(), 2);
- QCOMPARE(args2.at(0).toStringList().at(0), QString("Battery.Charging"));
- QCOMPARE(args2.at(0).toStringList().at(1), QString("Battery.Capacity"));
-
- QCOMPARE(spy3.count(), 3);
-
- QCOMPARE(spy4.count(), 1);
- QList<QVariant> args4 = spy4.takeFirst();
- QCOMPARE(args4.at(0).toList().size(), 1);
- QCOMPARE(args4.at(0).toStringList().at(0), QString("Battery.Capacity"));
-
- backend->disconnectNotify("-"); // Fake it. Spy does something fishy here.
-}
-
-void InfoCdbBackendUnitTest::removed()
-{
- backend->connectNotify("-"); // Fake it. Spy does something fishy here.
- QSignalSpy spy(backend, SIGNAL(keysRemoved(QStringList)));
-
- QFile::remove("cache.cdb");
-
- QTest::qWait(DEFAULT_WAIT_PERIOD);
-
- QCOMPARE(spy.count(), 1);
- QList<QVariant> args = spy.takeFirst();
- QCOMPARE(args.at(0).toList().size(), 2);
-
- backend->disconnectNotify("-"); // Fake it. Spy does something fishy here.
-}
-
-void InfoCdbBackendUnitTest::incompatibleDatabase()
-{
- QFile::remove("cache.cdb");
- QTest::qWait(DEFAULT_WAIT_PERIOD);
- createIncompatibleDatabase("cache.cdb");
- QTest::qWait(DEFAULT_WAIT_PERIOD);
-
- QCOMPARE(backend->databaseExists(), true);
- QCOMPARE(backend->listKeys().count(), 0);
- QCOMPARE(backend->typeForKey("Battery.Charging"), QString());
- QCOMPARE(backend->docForKey("Battery.Charging"), QString());
- QCOMPARE(backend->providersForKey("Battery.Charging").size(), 0);
- QCOMPARE(backend->keyDeclared("Battery.Charging"), false);
-}
-
-void InfoCdbBackendUnitTest::cleanupTestCase()
-{
- QFile::remove("cache.cdb");
- QFile::remove("cache-next.cdb");
-}
-
-#include "infocdbbackendunittest.moc"
-QTEST_MAIN(InfoCdbBackendUnitTest);
diff --git a/libcontextsubscriber/unit-tests/infoxmlbackend/.gitignore b/libcontextsubscriber/unit-tests/infoxmlbackend/.gitignore
deleted file mode 100644
index a1022995..00000000
--- a/libcontextsubscriber/unit-tests/infoxmlbackend/.gitignore
+++ /dev/null
@@ -1,19 +0,0 @@
-cdbreader.cpp
-cdbreader.h
-infobackend.cpp
-infobackend.h
-infocdbbackend.cpp
-infocdbbackend.h
-infokeydata.h
-infoxmlbackend.cpp
-infoxmlbackend.h
-infoxmlbackendunittest
-infoxmlkeysfinder.cpp
-infoxmlkeysfinder.h
-sconnect.h
-logging.cpp
-logging.h
-loggingfeatures.h
-nanoxml.cpp
-nanoxml.h
-contextproviderinfo.h
diff --git a/libcontextsubscriber/unit-tests/infoxmlbackend/Makefile.am b/libcontextsubscriber/unit-tests/infoxmlbackend/Makefile.am
deleted file mode 100644
index 0b759734..00000000
--- a/libcontextsubscriber/unit-tests/infoxmlbackend/Makefile.am
+++ /dev/null
@@ -1,36 +0,0 @@
-check_PROGRAMS = infoxmlbackendunittest
-
-# your test's sources
-infoxmlbackendunittest_SOURCES = infoxmlbackendunittest.cpp
-
-COVERAGE_FILES = infoxmlbackend.cpp
-EXTRA_DIST = providers1.src providers2v1.src providers2v2.src providers3.src providers4.src providers5.src providers6.src
-
-# do the testing, coverage, etc. stuff
-# tests.am is using +=, so we have to set a value here for these four always
-AM_CXXFLAGS = $(QtDBus_CFLAGS) -I$(srcdir)/../util/ \
- '-DDEFAULT_CONTEXT_PROVIDERS="@datadir@/contextkit/providers/"' \
- '-DDEFAULT_CONTEXT_CORE_DECLARATIONS="@datadir@/contextkit/core.context"'
-AM_LDFLAGS = $(CDB_LIBS) $(QtXml_LIBS)
-FROM_SOURCE = \
- infobackend.cpp infoxmlbackend.cpp \
- cdbreader.h cdbreader.cpp \
- infobackend.h \
- infoxmlbackend.h \
- infocdbbackend.h \
- infocdbbackend.cpp \
- infokeydata.h \
- loggingfeatures.h \
- nanoxml.cpp \
- nanoxml.h \
- contextproviderinfo.h
-
-FROM_SOURCE_DIR = $(srcdir)/../../src
-LDADD =
-include $(top_srcdir)/am/tests.am
-
-nodist_infoxmlbackendunittest_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(infoxmlbackendunittest_SOURCES) $(FROM_SOURCE))
-include $(top_srcdir)/am/qt.am
-
-infoxmlbackendunittest.o: infoxmlbackendunittest.moc
diff --git a/libcontextsubscriber/unit-tests/infoxmlbackend/infoxmlbackendunittest.cpp b/libcontextsubscriber/unit-tests/infoxmlbackend/infoxmlbackendunittest.cpp
deleted file mode 100644
index 5a4af82b..00000000
--- a/libcontextsubscriber/unit-tests/infoxmlbackend/infoxmlbackendunittest.cpp
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <QtTest/QtTest>
-#include <QtCore>
-#include "fileutils.h"
-#include "infoxmlbackend.h"
-
-class InfoXmlBackendUnitTest : public QObject
-{
- Q_OBJECT
- InfoXmlBackend *backend;
-
-private:
- bool inSpyHasOneInList(QSignalSpy &spy, const QString &v);
-
-private slots:
- void initTestCase();
- void paths();
- void name();
- void listKeys();
- void typeForKey();
- void docForKey();
- void keyDeclared();
- void providersForKey();
- void dynamics();
- void cleanupTestCase();
-};
-
-bool InfoXmlBackendUnitTest::inSpyHasOneInList(QSignalSpy &spy, const QString &v)
-{
- if (spy.count() == 0)
- return false;
-
- while (spy.count() > 0) {
- QList<QVariant> args = spy.takeFirst();
- foreach (QString s, args.at(0).toStringList()) {
- if (s == v)
- return true;
- }
- }
-
- return false;
-}
-
-void InfoXmlBackendUnitTest::initTestCase()
-{
- utilCopyLocalAtomically("providers1.src", "providers1.context");
- utilCopyLocalWithRemove("providers2v1.src", "providers2.context");
- utilCopyLocalWithRemove("providers6.src", "providers6.context");
- utilSetEnv("CONTEXT_PROVIDERS", "./");
- utilSetEnv("CONTEXT_CORE_DECLARATIONS", "/dev/null");
- backend = new InfoXmlBackend();
-}
-
-void InfoXmlBackendUnitTest::listKeys()
-{
- QStringList keys = backend->listKeys();
-
- QVERIFY(! keys.contains("System.ProcessingData"));
-
- QCOMPARE(keys.count(), 10);
- QVERIFY(keys.contains("Battery.ChargePercentage"));
- QVERIFY(keys.contains("Battery.LowBattery"));
- QVERIFY(keys.contains("Key.With.Attribute"));
- QVERIFY(keys.contains("Key.With.bool"));
- QVERIFY(keys.contains("Key.With.int32"));
- QVERIFY(keys.contains("Key.With.string"));
- QVERIFY(keys.contains("Key.With.double"));
- QVERIFY(keys.contains("Key.With.complex"));
- QVERIFY(keys.contains("Battery.Charging"));
- QVERIFY(keys.contains("Battery.Voltage"));
-}
-
-void InfoXmlBackendUnitTest::name()
-{
- QCOMPARE(backend->name(), QString("xml"));
-}
-
-void InfoXmlBackendUnitTest::typeForKey()
-{
- QCOMPARE(backend->typeForKey("Battery.ChargePercentage"), QString());
- QCOMPARE(backend->typeForKey("Key.With.Attribute"), QString("TRUTH"));
- QCOMPARE(backend->typeForKey("Battery.LowBattery"), QString("TRUTH"));
- QCOMPARE(backend->typeForKey("Key.With.bool"), QString("TRUTH"));
- QCOMPARE(backend->typeForKey("Key.With.int32"), QString("INT"));
- QCOMPARE(backend->typeForKey("Key.With.string"), QString("STRING"));
- QCOMPARE(backend->typeForKey("Key.With.double"), QString("DOUBLE"));
- QCOMPARE(backend->typeForKey("Key.With.complex"), QString());
- QCOMPARE(backend->typeForKey("Battery.Charging"), QString("TRUTH"));
- QCOMPARE(backend->typeForKey("Battery.Voltage"), QString("INTEGER"));
- QCOMPARE(backend->typeForKey("Does.Not.Exist"), QString());
-}
-
-void InfoXmlBackendUnitTest::docForKey()
-{
- QCOMPARE(backend->docForKey("Battery.ChargePercentage"), QString());
- QCOMPARE(backend->docForKey("Battery.LowBattery"), QString("This is true when battery is low"));
- QCOMPARE(backend->docForKey("Key.With.bool"), QString());
- QCOMPARE(backend->docForKey("Key.With.int32"), QString());
- QCOMPARE(backend->docForKey("Key.With.string"), QString());
- QCOMPARE(backend->docForKey("Key.With.double"), QString());
- QCOMPARE(backend->docForKey("Key.With.complex"), QString());
- QCOMPARE(backend->docForKey("Battery.Charging"), QString("This is true when battery is charging"));
- QCOMPARE(backend->docForKey("Does.Not.Exist"), QString());
-}
-
-void InfoXmlBackendUnitTest::keyDeclared()
-{
- foreach (QString key, backend->listKeys())
- QCOMPARE(backend->keyDeclared(key), true);
-
- QCOMPARE(backend->keyDeclared("Does.Not.Exist"), false);
- QCOMPARE(backend->keyDeclared("Battery.Charging"), true);
-}
-
-void InfoXmlBackendUnitTest::paths()
-{
- QVERIFY(InfoXmlBackend::registryPath() == QString("./") ||
- InfoXmlBackend::registryPath() == QString("."));
- QCOMPARE(InfoXmlBackend::coreDeclPath(), QString("/dev/null"));
-}
-
-void InfoXmlBackendUnitTest::providersForKey()
-{
- QList <ContextProviderInfo> list1 = backend->providersForKey("Battery.Charging");
- QCOMPARE(list1.count(), 1);
- QCOMPARE(list1.at(0).plugin, QString("contextkit-dbus"));
- QCOMPARE(list1.at(0).constructionString, QString("system:org.freedesktop.ContextKit.contextd2"));
-
- QList <ContextProviderInfo> list2 = backend->providersForKey("Does.Not.Exist");
- QCOMPARE(list2.count(), 0);
-}
-
-void InfoXmlBackendUnitTest::dynamics()
-{
- // Sanity check
- QStringList keys = backend->listKeys();
- QCOMPARE(keys.count(), 10);
- QVERIFY(keys.contains("Battery.Charging"));
- QCOMPARE(backend->keyDeclared("System.Active"), false);
-
- // Setup the spy observers
- QSignalSpy spy1(backend, SIGNAL(keysRemoved(QStringList)));
- QSignalSpy spy2(backend, SIGNAL(keysChanged(QStringList)));
- QSignalSpy spy3(backend, SIGNAL(keyChanged(QString)));
- QSignalSpy spy4(backend, SIGNAL(keysAdded(QStringList)));
-
- utilCopyLocalWithRemove("providers2v2.src", "providers2.context");
- utilCopyLocalWithRemove("providers3.src", "providers3.context");
- utilCopyLocalWithRemove("providers4.src", "providers4.context");
- utilCopyLocalWithRemove("providers5.src", "providers5.context");
-
- // Again, some basic check
- QCOMPARE(backend->keyDeclared("System.Active"), true);
- QCOMPARE(backend->typeForKey("Battery.Charging"), QString("INTEGER"));
- QCOMPARE(backend->typeForKey("System.Active"), QString("TRUTH"));
- QCOMPARE(backend->docForKey("System.Active"), QString("This is true when system is active"));
-
- // Test emissions
- QVERIFY(inSpyHasOneInList(spy1, "Battery.Voltage"));
- QVERIFY(inSpyHasOneInList(spy2, "Battery.Charging"));
- QVERIFY(inSpyHasOneInList(spy3, "Battery.Charging"));
- QVERIFY(inSpyHasOneInList(spy4, "System.Active"));
-
- // Check providers
- QList <ContextProviderInfo> list1 = backend->providersForKey("Battery.Charging");
-
- QCOMPARE(list1.count(), 1);
- QCOMPARE(list1.at(0).plugin, QString("contextkit-dbus"));
- QCOMPARE(list1.at(0).constructionString, QString("system:org.freedesktop.ContextKit.contextd2"));
-
- QList <ContextProviderInfo> list2 = backend->providersForKey("System.Active");
- QCOMPARE(list2.count(), 3);
- QCOMPARE(list2.at(0).plugin, QString("contextkit-dbus"));
- QCOMPARE(list2.at(0).constructionString, QString("system:com.nokia.daemon"));
- QCOMPARE(list2.at(1).plugin, QString("test.so"));
- QCOMPARE(list2.at(1).constructionString, QString("some-string"));
- QCOMPARE(list2.at(2).plugin, QString("another.so"));
- QCOMPARE(list2.at(2).constructionString, QString("some-other-string"));
-
- QList <ContextProviderInfo> list3 = backend->providersForKey("Battery.Voltage");
- QCOMPARE(list3.count(), 0);
-}
-
-void InfoXmlBackendUnitTest::cleanupTestCase()
-{
- QFile::remove("providers1.context");
- QFile::remove("providers2.context");
- QFile::remove("providers3.context");
- QFile::remove("providers4.context");
- QFile::remove("providers5.context");
- QFile::remove("providers6.context");
-}
-
-#include "infoxmlbackendunittest.moc"
-QTEST_MAIN(InfoXmlBackendUnitTest);
diff --git a/libcontextsubscriber/unit-tests/infoxmlbackend/providers1.src b/libcontextsubscriber/unit-tests/infoxmlbackend/providers1.src
deleted file mode 100644
index 762de89d..00000000
--- a/libcontextsubscriber/unit-tests/infoxmlbackend/providers1.src
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0"?>
-<provider bus="session" service="org.freedesktop.ContextKit.contextd1">
- <key name="Battery.ChargePercentage"></key>
- <key name="Battery.LowBattery">
- <type>TRUTH</type>
- <doc>
- This is true when battery is low
- </doc>
- </key>
- <key name="Key.With.Attribute" type="TRUTH"/>
- <key name="Key.With.bool" type="bool"/>
- <key name="Key.With.int32" type="int32"/>
- <key name="Key.With.string" type="string"/>
- <key name="Key.With.double" type="double"/>
- <key name="Key.With.complex">
- <type><sub>SUB</sub></type>
- </key>
-</provider>
diff --git a/libcontextsubscriber/unit-tests/infoxmlbackend/providers2v1.src b/libcontextsubscriber/unit-tests/infoxmlbackend/providers2v1.src
deleted file mode 100644
index f76af580..00000000
--- a/libcontextsubscriber/unit-tests/infoxmlbackend/providers2v1.src
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0"?>
-<xml>
- <provider bus="system" service="org.freedesktop.ContextKit.contextd2">
- <key name="Battery.Charging">
- <type>TRUTH</type>
- <doc>
- This is true when battery is charging
- </doc>
- </key>
- <key name="Battery.Voltage" type="INTEGER"/>
- </provider>
- <provider bus="system" service="org.freedesktop.ContextKit.contextd1">
- <key name="Battery.ChargePercentage">
- <type>INT</type>
- <doc>This is a charge percentage of the battery</doc>
- </key>
- </provider>
-</xml>
diff --git a/libcontextsubscriber/unit-tests/infoxmlbackend/providers2v2.src b/libcontextsubscriber/unit-tests/infoxmlbackend/providers2v2.src
deleted file mode 100644
index d74779d0..00000000
--- a/libcontextsubscriber/unit-tests/infoxmlbackend/providers2v2.src
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0"?>
-<xml>
- <provider bus="system" service="org.freedesktop.ContextKit.contextd2">
- <key name="Battery.Charging" type="INTEGER" />
- </provider>
-</xml>
diff --git a/libcontextsubscriber/unit-tests/infoxmlbackend/providers3.src b/libcontextsubscriber/unit-tests/infoxmlbackend/providers3.src
deleted file mode 100644
index 2577188a..00000000
--- a/libcontextsubscriber/unit-tests/infoxmlbackend/providers3.src
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0"?>
-<xml>
- <provider bus="system" service="com.nokia.daemon">
- <key name="System.Active">
- <type>TRUTH</type>
- <doc>This is true when system is active</doc>
- </key>
- </provider>
-</xml>
diff --git a/libcontextsubscriber/unit-tests/infoxmlbackend/providers4.src b/libcontextsubscriber/unit-tests/infoxmlbackend/providers4.src
deleted file mode 100644
index 8ff4898e..00000000
--- a/libcontextsubscriber/unit-tests/infoxmlbackend/providers4.src
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0"?>
-<xml>
- <provider plugin="test.so" constructionString="some-string">
- <key name="System.Active" />
- </provider>
-</xml>
diff --git a/libcontextsubscriber/unit-tests/infoxmlbackend/providers5.src b/libcontextsubscriber/unit-tests/infoxmlbackend/providers5.src
deleted file mode 100644
index 9442e701..00000000
--- a/libcontextsubscriber/unit-tests/infoxmlbackend/providers5.src
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0"?>
-<xml>
- <provider plugin="another.so" constructionString="some-other-string" xmlns="http://contextkit.freedesktop.org/Provider">
- <key name="System.Active" type="INTEGER" doc="should not work"/>
- </provider>
-</xml>
diff --git a/libcontextsubscriber/unit-tests/infoxmlbackend/providers6.src b/libcontextsubscriber/unit-tests/infoxmlbackend/providers6.src
deleted file mode 100644
index fd3821fa..00000000
--- a/libcontextsubscriber/unit-tests/infoxmlbackend/providers6.src
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0"?>
-<xml>
- <provider bus="system" service="com.nokia.worker">
- <key name="System.ProcessingData" xmlns="http://www.nokia.com/bull">
- <type>TRUTH</type>
- <doc>This true when the system is processing some data.</doc>
- </key>
- </provider>
-</xml>
diff --git a/libcontextsubscriber/unit-tests/nanoxml/.gitignore b/libcontextsubscriber/unit-tests/nanoxml/.gitignore
deleted file mode 100644
index 3f9b05da..00000000
--- a/libcontextsubscriber/unit-tests/nanoxml/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-loggingfeatures.h
-nanoxml.cpp
-nanoxml.h
-nanoxmlunittest
diff --git a/libcontextsubscriber/unit-tests/nanoxml/Makefile.am b/libcontextsubscriber/unit-tests/nanoxml/Makefile.am
deleted file mode 100644
index 88730ac9..00000000
--- a/libcontextsubscriber/unit-tests/nanoxml/Makefile.am
+++ /dev/null
@@ -1,23 +0,0 @@
-check_PROGRAMS = nanoxmlunittest
-
-# test's sources
-nanoxmlunittest_SOURCES = nanoxmlunittest.cpp
-
-COVERAGE_FILES = nanoxml.cpp
-EXTRA_DIST = test1.xml broken.xml test2.xml test3.xml test4.xml
-
-# do the testing, coverage, etc. stuff
-# tests.am is using +=, so we have to set a value here for these four always
-AM_CXXFLAGS = $(QtXml_CFLAGS) -I$(srcdir)/../util/
-AM_LDFLAGS = $(QtXml_LIBS)
-FROM_SOURCE = nanoxml.cpp nanoxml.h loggingfeatures.h # copy these files from the real source
-FROM_SOURCE_DIR = $(srcdir)/../../src
-LDADD =
-include $(top_srcdir)/am/tests.am
-
-nodist_nanoxmlunittest_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(nanoxmlunittest_SOURCES) $(FROM_SOURCE))
-include $(top_srcdir)/am/qt.am
-
-# when MOCing from .cpp file, you also has to help the dependency tracker
-nanoxmlunittest.o: nanoxmlunittest.moc
diff --git a/libcontextsubscriber/unit-tests/nanoxml/broken.xml b/libcontextsubscriber/unit-tests/nanoxml/broken.xml
deleted file mode 100644
index 7074ad5e..00000000
--- a/libcontextsubscriber/unit-tests/nanoxml/broken.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<key name="Example.Random"
- type="string">
- A random property.
- </doc
-</key>
diff --git a/libcontextsubscriber/unit-tests/nanoxml/nanoxmlunittest.cpp b/libcontextsubscriber/unit-tests/nanoxml/nanoxmlunittest.cpp
deleted file mode 100644
index 1eac7ecf..00000000
--- a/libcontextsubscriber/unit-tests/nanoxml/nanoxmlunittest.cpp
+++ /dev/null
@@ -1,261 +0,0 @@
-/*
- * Copyright (C) 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <QtTest/QtTest>
-#include <QtCore>
-#include "nanoxml.h"
-#include "fileutils.h"
-
-class NanoXmlUnitTest : public QObject
-{
- Q_OBJECT
-
-private slots:
- void broken();
- void doesNotExist();
- void test1();
- void test2();
- void test3();
- void test4Comments();
- void firstLevelAccessor();
- void secondLevelAccessor();
- void thirdLevelAccessor();
- void keyValues();
- void treeDump();
-};
-
-void NanoXmlUnitTest::test1()
-{
- NanoXml nano(LOCAL_FILE("test1.xml"));
- QCOMPARE(nano.didFail(), false);
- QVERIFY(nano.root().type() == QVariant::List);
- QCOMPARE(nano.root().toList().count(), 4);
- QVERIFY(nano.root().toList().at(0).type() == QVariant::String);
- QCOMPARE(nano.root().toList().at(0).toString(), QString("key"));
-
- QVERIFY(nano.root().toList().at(1).type() == QVariant::List);
- QCOMPARE(nano.root().toList().at(1).toList().count(), 2);
- QVERIFY(nano.root().toList().at(1).toList().at(0).type() == QVariant::String);
- QCOMPARE(nano.root().toList().at(1).toList().at(0).toString(), QString("name"));
- QVERIFY(nano.root().toList().at(1).toList().at(1).type() == QVariant::String);
- QCOMPARE(nano.root().toList().at(1).toList().at(1).toString(), QString("Example.Random"));
-
- QVERIFY(nano.root().toList().at(2).type() == QVariant::List);
- QCOMPARE(nano.root().toList().at(2).toList().count(), 2);
- QVERIFY(nano.root().toList().at(2).toList().at(0).type() == QVariant::String);
- QCOMPARE(nano.root().toList().at(2).toList().at(0).toString(), QString("type"));
- QVERIFY(nano.root().toList().at(2).toList().at(1).type() == QVariant::String);
- QCOMPARE(nano.root().toList().at(2).toList().at(1).toString(), QString("string"));
-
- QVERIFY(nano.root().toList().at(3).type() == QVariant::List);
- QCOMPARE(nano.root().toList().at(3).toList().count(), 2);
- QVERIFY(nano.root().toList().at(3).toList().at(0).type() == QVariant::String);
- QCOMPARE(nano.root().toList().at(3).toList().at(0).toString(), QString("doc"));
- QVERIFY(nano.root().toList().at(3).toList().at(1).type() == QVariant::String);
- QCOMPARE(nano.root().toList().at(3).toList().at(1).toString(), QString("A random property."));
-
- /* Accessor testing */
- QCOMPARE(nano.keyValue("name"), QVariant("Example.Random"));
- QCOMPARE(nano.keyValue("type"), QVariant("string"));
- QCOMPARE(nano.keyValue("doc"), QVariant("A random property."));
- QCOMPARE(nano.keyValue("wrong"), QVariant());
-}
-
-void NanoXmlUnitTest::test2()
-{
- NanoXml nano(LOCAL_FILE("test2.xml"));
- QCOMPARE(nano.didFail(), false);
- QVERIFY(nano.root().type() == QVariant::List);
- QCOMPARE(nano.root().toList().count(), 3);
- QVERIFY(nano.root().toList().at(0).type() == QVariant::String);
- QCOMPARE(nano.root().toList().at(0).toString(), QString("key"));
-
- QVERIFY(nano.root().toList().at(1).type() == QVariant::List);
- QCOMPARE(nano.root().toList().at(1).toList().count(), 2);
- QVERIFY(nano.root().toList().at(1).toList().at(0).type() == QVariant::String);
- QCOMPARE(nano.root().toList().at(1).toList().at(0).toString(), QString("name"));
- QVERIFY(nano.root().toList().at(1).toList().at(1).type() == QVariant::String);
- QCOMPARE(nano.root().toList().at(1).toList().at(1).toString(), QString("Example.Random"));
-
- QVERIFY(nano.root().toList().at(2).type() == QVariant::List);
- QCOMPARE(nano.root().toList().at(2).toList().count(), 2);
- QVERIFY(nano.root().toList().at(2).toList().at(0).type() == QVariant::String);
- QCOMPARE(nano.root().toList().at(2).toList().at(0).toString(), QString("type"));
- QVERIFY(nano.root().toList().at(2).toList().at(1).type() == QVariant::List);
- QCOMPARE(nano.root().toList().at(2).toList().at(1).toList().count(), 2);
- QCOMPARE(nano.root().toList().at(2).toList().at(1).toList().at(0).type(), QVariant::String);
- QCOMPARE(nano.root().toList().at(2).toList().at(1).toList().at(0).toString(), QString("uniform-list"));
- QCOMPARE(nano.root().toList().at(2).toList().at(1).toList().at(1).type(), QVariant::List);
- QCOMPARE(nano.root().toList().at(2).toList().at(1).toList().at(1).toList().count(), 2);
- QCOMPARE(nano.root().toList().at(2).toList().at(1).toList().at(1).toList().at(0).type(), QVariant::String);
- QCOMPARE(nano.root().toList().at(2).toList().at(1).toList().at(1).toList().at(0).toString(), QString("type"));
- QCOMPARE(nano.root().toList().at(2).toList().at(1).toList().at(1).toList().at(1).type(), QVariant::String);
- QCOMPARE(nano.root().toList().at(2).toList().at(1).toList().at(1).toList().at(1).toString(), QString("number"));
-
- /* Accessor testing */
- QCOMPARE(nano.keyValue("name"), QVariant("Example.Random"));
- QCOMPARE(nano.keyValue(QString("type"), QString("uniform-list"), QString("type")), QVariant("number"));
-}
-
-void NanoXmlUnitTest::test4Comments()
-{
- NanoXml nano(LOCAL_FILE("test4.xml"));
- QCOMPARE(nano.didFail(), false);
-
- QCOMPARE(nano.didFail(), false);
- QVERIFY(nano.root().type() == QVariant::List);
- QCOMPARE(nano.root().toList().count(), 4);
- QVERIFY(nano.root().toList().at(0).type() == QVariant::String);
- QCOMPARE(nano.root().toList().at(0).toString(), QString("key"));
-
- QVERIFY(nano.root().toList().at(1).type() == QVariant::List);
- QCOMPARE(nano.root().toList().at(1).toList().count(), 2);
- QVERIFY(nano.root().toList().at(1).toList().at(0).type() == QVariant::String);
- QCOMPARE(nano.root().toList().at(1).toList().at(0).toString(), QString("name"));
- QVERIFY(nano.root().toList().at(1).toList().at(1).type() == QVariant::String);
- QCOMPARE(nano.root().toList().at(1).toList().at(1).toString(), QString("Example.Key"));
-
- QVERIFY(nano.root().toList().at(2).type() == QVariant::List);
- QCOMPARE(nano.root().toList().at(2).toList().count(), 2);
- QVERIFY(nano.root().toList().at(2).toList().at(0).type() == QVariant::String);
- QCOMPARE(nano.root().toList().at(2).toList().at(0).toString(), QString("type"));
- QVERIFY(nano.root().toList().at(2).toList().at(1).type() == QVariant::String);
- QCOMPARE(nano.root().toList().at(2).toList().at(1).toString(), QString("string"));
-
- QVERIFY(nano.root().toList().at(3).type() == QVariant::List);
- QCOMPARE(nano.root().toList().at(3).toList().count(), 2);
- QVERIFY(nano.root().toList().at(3).toList().at(0).type() == QVariant::String);
- QCOMPARE(nano.root().toList().at(3).toList().at(0).toString(), QString("doc"));
- QVERIFY(nano.root().toList().at(3).toList().at(1).type() == QVariant::String);
- QCOMPARE(nano.root().toList().at(3).toList().at(1).toString(), QString("A random property."));
-}
-
-void NanoXmlUnitTest::test3()
-{
- NanoXml nano(LOCAL_FILE("test3.xml"));
- QCOMPARE(nano.didFail(), false);
- QCOMPARE(nano.namespaceUri(), QString("http://www.test.org/document"));
-}
-
-void NanoXmlUnitTest::firstLevelAccessor()
-{
- QVariantList list1;
- QVariantList list2;
-
- list2.append(QVariant("key"));
- list2.append(QVariant("value"));
- list1.append(QVariant(list2));
- QVariant root(list1);
-
- QCOMPARE(NanoXml::keyValue("key", root), QVariant("value"));
-}
-
-void NanoXmlUnitTest::secondLevelAccessor()
-{
- QVariantList list1;
- QVariantList list2;
- QVariantList list3;
-
- list3.append(QVariant("key"));
- list3.append(QVariant("value"));
- list2.append(QVariant("object"));
- list2.append(QVariant(list3));
- list1.append(QVariant(list2));
- QVariant root(list1);
-
- QCOMPARE(NanoXml::keyValue("object", "key", root), QVariant("value"));
-}
-
-void NanoXmlUnitTest::thirdLevelAccessor()
-{
- QVariantList list1;
- QVariantList list2;
- QVariantList list3;
- QVariantList list4;
-
- list4.append(QVariant("key"));
- list4.append(QVariant("value"));
- list3.append(QVariant("object"));
- list3.append(QVariant(list4));
- list2.append(QVariant("collection"));
- list2.append(QVariant(list3));
- list1.append(QVariant(list2));
- QVariant root(list1);
-
- QVERIFY(NanoXml::keyValue("collection", "object", root) != QVariant());
- QCOMPARE(NanoXml::keyValue("collection", "object", "key", root), QVariant("value"));
-}
-
-void NanoXmlUnitTest::broken()
-{
- NanoXml nano(LOCAL_FILE("broken.xml"));
- QCOMPARE(nano.didFail(), true);
- QCOMPARE(nano.root(), QVariant());
-}
-
-void NanoXmlUnitTest::doesNotExist()
-{
- NanoXml nano("does-not-exist.xml");
- QCOMPARE(nano.didFail(), true);
- QCOMPARE(nano.root(), QVariant());
-}
-
-void NanoXmlUnitTest::keyValues()
-{
- QVariantList list1;
- QVariantList list2;
- QVariantList list3;
- QVariantList list4;
-
- list2 << "provider";
- list2 << "value1";
- list3 << "provider";
- list3 << "value2";
- list4 << "other";
- list4 << "value3";
-
- list1 << QVariant(list2);
- list1 << QVariant(list3);
- list1 << QVariant(list4);
-
- QVariantList result = NanoXml::keyValues("provider", QVariant(list1));
- QCOMPARE(result.size(), 2);
- QCOMPARE(result.at(0).toList().at(0).toString(), QString("provider"));
- QCOMPARE(result.at(0).toList().at(1).toString(), QString("value1"));
- QCOMPARE(result.at(1).toList().at(0).toString(), QString("provider"));
- QCOMPARE(result.at(1).toList().at(1).toString(), QString("value2"));
-}
-
-void NanoXmlUnitTest::treeDump()
-{
- QVariantList list1;
- QVariantList list2;
-
- list2.append(QVariant("key"));
- list2.append(QVariant("value"));
- list1.append(QVariant(list2));
- QVariant root(list1);
-
- QCOMPARE(NanoXml::dumpTree(root, 0), QString("[\n [\n key\n value\n ]\n]\n"));
-}
-
-#include "nanoxmlunittest.moc"
-QTEST_MAIN(NanoXmlUnitTest);
diff --git a/libcontextsubscriber/unit-tests/nanoxml/test1.xml b/libcontextsubscriber/unit-tests/nanoxml/test1.xml
deleted file mode 100644
index d5d473df..00000000
--- a/libcontextsubscriber/unit-tests/nanoxml/test1.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<key name="Example.Random"
- type="string">
- <doc>
- A random property.
- </doc>
-</key>
diff --git a/libcontextsubscriber/unit-tests/nanoxml/test2.xml b/libcontextsubscriber/unit-tests/nanoxml/test2.xml
deleted file mode 100644
index c821ad4f..00000000
--- a/libcontextsubscriber/unit-tests/nanoxml/test2.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<key name="Example.Random">
- <type>
- <uniform-list type="number"/>
- </type>
-</key>
diff --git a/libcontextsubscriber/unit-tests/nanoxml/test3.xml b/libcontextsubscriber/unit-tests/nanoxml/test3.xml
deleted file mode 100644
index 12138b86..00000000
--- a/libcontextsubscriber/unit-tests/nanoxml/test3.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0"?>
-<provider xmlns:svg="http://www.test.org/document" bus="session" service="org.maemo.contextd">
- <key name="Battery.ChargePercentage" type="INT" />
-</provider>
diff --git a/libcontextsubscriber/unit-tests/nanoxml/test4.xml b/libcontextsubscriber/unit-tests/nanoxml/test4.xml
deleted file mode 100644
index cd854680..00000000
--- a/libcontextsubscriber/unit-tests/nanoxml/test4.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<key name="Example.Key"
- type="string">
-<!-- This is a comment -->
- <doc>
- A random property.
- </doc>
-<!-- Another comment -->
-</key>
diff --git a/libcontextsubscriber/unit-tests/propertyhandle/.gitignore b/libcontextsubscriber/unit-tests/propertyhandle/.gitignore
deleted file mode 100644
index e59a3396..00000000
--- a/libcontextsubscriber/unit-tests/propertyhandle/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-propertyhandle.cpp
-propertyhandle.h
-sconnect.h
-logging.cpp
-logging.h
-loggingfeatures.h
-contextproviderinfo.h
-timedvalue.h
-
diff --git a/libcontextsubscriber/unit-tests/propertyhandle/Makefile.am b/libcontextsubscriber/unit-tests/propertyhandle/Makefile.am
deleted file mode 100644
index 5fbc5acd..00000000
--- a/libcontextsubscriber/unit-tests/propertyhandle/Makefile.am
+++ /dev/null
@@ -1,24 +0,0 @@
-check_PROGRAMS = propertyhandle-unit-tests
-
-# your test's sources
-propertyhandle_unit_tests_SOURCES = testpropertyhandle.cpp \
- testpropertyhandle.h provider.h dbusnamelistener.h \
- contextpropertyinfo.h contextregistryinfo.h
-
-# only include these files in the coverage
-COVERAGE_FILES = propertyhandle.cpp
-
-# do the testing, coverage, etc. stuff
-# tests.am is using +=, so we have to set a value here for these four always
-AM_CXXFLAGS = $(QtDBus_CFLAGS) '-DDEFAULT_CONTEXT_PROVIDERS="@datadir@/contextkit/providers/"'
-AM_LDFLAGS = $(QtDBus_LIBS)
-# copy these files from the real source
-FROM_SOURCE = propertyhandle.cpp propertyhandle.h loggingfeatures.h \
- contextproviderinfo.h timedvalue.h
-FROM_SOURCE_DIR = $(srcdir)/../../src
-LDADD =
-include $(top_srcdir)/am/tests.am
-
-nodist_propertyhandle_unit_tests_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(propertyhandle_unit_tests_SOURCES) $(FROM_SOURCE))
-include $(top_srcdir)/am/qt.am
diff --git a/libcontextsubscriber/unit-tests/propertyhandle/contextpropertyinfo.h b/libcontextsubscriber/unit-tests/propertyhandle/contextpropertyinfo.h
deleted file mode 100644
index 6fa30ccb..00000000
--- a/libcontextsubscriber/unit-tests/propertyhandle/contextpropertyinfo.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-// This is a mock implementation.
-
-#ifndef CONTEXTPROPERTYINFO_H
-#define CONTEXTPROPERTYINFO_H
-
-#include <QVariant>
-#include <QStringList>
-#include <QObject>
-#include <QDBusConnection>
-#include "contextproviderinfo.h"
-
-class ContextPropertyInfo : public QObject
-{
- Q_OBJECT
-
-public:
- explicit ContextPropertyInfo(const QString &key, QObject *parent = 0);
-
- QString type() const;
-
- bool provided() const;
- bool declared() const;
- QList<ContextProviderInfo> providers() const;
-
-signals:
- void changed(QString);
-
-public:
- // For the test program
- QString myType;
-};
-
-#endif // CONTEXTPROPERTYINFO_H
diff --git a/libcontextsubscriber/unit-tests/propertyhandle/contextregistryinfo.h b/libcontextsubscriber/unit-tests/propertyhandle/contextregistryinfo.h
deleted file mode 100644
index b76404ba..00000000
--- a/libcontextsubscriber/unit-tests/propertyhandle/contextregistryinfo.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-// This is a mock implementation
-
-#ifndef CONTEXTREGISTRYINFO_H
-#define CONTEXTREGISTRYINFO_H
-
-#include <QStringList>
-#include <QString>
-#include <QObject>
-
-class ContextRegistryInfo : public QObject
-{
- Q_OBJECT
-
-public:
- static ContextRegistryInfo* instance(const QString &backendName = "");
-
-signals:
- void keysChanged(QStringList currentKeys);
- void keysAdded(QStringList newKeys);
- void keysRemoved(QStringList removedKeys);
-};
-
-#endif
diff --git a/libcontextsubscriber/unit-tests/propertyhandle/dbusnamelistener.h b/libcontextsubscriber/unit-tests/propertyhandle/dbusnamelistener.h
deleted file mode 100644
index 29362202..00000000
--- a/libcontextsubscriber/unit-tests/propertyhandle/dbusnamelistener.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-// This is a mock implementation.
-
-#ifndef DBUSNAMELISTENER_H
-#define DBUSNAMELISTENER_H
-
-#include <QObject>
-#include <QDBusConnection>
-#include <QString>
-
-template<typename P1, typename P2> class QPair;
-template<typename K, typename V> class QMap;
-
-namespace ContextSubscriber {
-
-class DBusNameListener : public QObject
-{
- Q_OBJECT
-public:
- enum ServicePresence {NotPresent = 0, Present, Unknown};
-
- explicit DBusNameListener(QDBusConnection::BusType busType, const QString &busName, QObject* parent = 0);
- virtual ~DBusNameListener();
-
- ServicePresence isServicePresent() const;
- void startListening(bool nameHasOwnerCheck);
-
-signals:
- void nameAppeared();
- void nameDisappeared();
-
-public:
- // For the test program
- ServicePresence servicePresent;
-
- friend class PropertyHandleUnitTests;
-
-};
-
-} // end namespace
-
-#endif
diff --git a/libcontextsubscriber/unit-tests/propertyhandle/provider.h b/libcontextsubscriber/unit-tests/propertyhandle/provider.h
deleted file mode 100644
index 076893e7..00000000
--- a/libcontextsubscriber/unit-tests/propertyhandle/provider.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-// This is a mock implementation
-
-#ifndef PROVIDER_H
-#define PROVIDER_H
-
-#include "contextproviderinfo.h"
-#include "timedvalue.h"
-
-#include <QObject>
-#include <QDBusConnection>
-#include <QSet>
-#include <QString>
-
-namespace ContextSubscriber {
-
-class Provider : public QObject
-{
- Q_OBJECT
-
-public:
- static Provider* instance(const ContextProviderInfo& providerInfo);
- bool subscribe(const QString &key);
- void unsubscribe(const QString &key);
- TimedValue get(const QString &key) const;
-
-signals:
- void subscribeFinished(QString key);
- void valueChanged(QString key);
-
-public:
- // Logging
- static int instanceCount;
- static QStringList instancePluginNames;
- static QStringList instancePluginConstructionStrings;
- // Log the subscribe calls
- static int subscribeCount; // count
- static QStringList subscribeKeys; // parameters
- static QStringList subscribeProviderNames; // provider name of the object
- // on which it was called
- // Log the unsubscribe calls
- static int unsubscribeCount;
- static QStringList unsubscribeKeys;
- static QStringList unsubscribeProviderNames; // provider name of the object
- // on which it was called
- static TimedValue cachedValue; // setValue sets, get gets
-
- // For tests
- Provider(QString name); // public only in tests
- static void setValue(const QString &key, const QVariant &value);
- static void resetLogs();
- QString myName;
-
- friend class PropertyHandleUnitTests;
-};
-
-} // end namespace
-
-#endif
diff --git a/libcontextsubscriber/unit-tests/propertyhandle/testpropertyhandle.cpp b/libcontextsubscriber/unit-tests/propertyhandle/testpropertyhandle.cpp
deleted file mode 100644
index 3a9c885d..00000000
--- a/libcontextsubscriber/unit-tests/propertyhandle/testpropertyhandle.cpp
+++ /dev/null
@@ -1,891 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-// Header file of the tests
-#include "testpropertyhandle.h"
-
-// Mock header files
-#include "provider.h"
-#include "dbusnamelistener.h"
-#include "contextpropertyinfo.h"
-#include "contextregistryinfo.h"
-
-// Header file of the class to be tested
-#include "propertyhandle.h"
-
-#include <QtTest/QtTest>
-#include <QDebug>
-#include <QDBusConnection>
-
-ContextRegistryInfo* mockContextRegistryInfo;
-ContextPropertyInfo* mockContextPropertyInfo;
-
-// Mock implementation of ContextPropertyInfo
-
-ContextPropertyInfo::ContextPropertyInfo(const QString &key, QObject *parent)
- : myType("faketype")
-{
- // Store the object created by the class to be tested
- mockContextPropertyInfo = this;
-}
-
-QString ContextPropertyInfo::type() const
-{
- return myType;
-}
-
-bool ContextPropertyInfo::provided() const
-{
- return true;
-}
-
-QList<ContextProviderInfo> ContextPropertyInfo::providers() const
-{
- return QList<ContextProviderInfo>() << ContextProviderInfo("fakeplugin", "fakeconstructionstring");
-}
-
-// Mock implementation of the ContextRegistryInfo
-
-ContextRegistryInfo* ContextRegistryInfo::instance(const QString& backendName)
-{
- return mockContextRegistryInfo;
-}
-
-namespace ContextSubscriber {
-
-#define MYLOGLEVEL 3
-void myMessageOutput(QtMsgType type, const char *msg)
-{
- switch (type) {
- case QtDebugMsg:
- if (MYLOGLEVEL <= 0)
- fprintf(stderr, "Debug: %s\n", msg);
- break;
- case QtWarningMsg:
- if (MYLOGLEVEL <= 1)
- fprintf(stderr, "Warning: %s\n", msg);
- break;
- case QtCriticalMsg:
- if (MYLOGLEVEL <= 2)
- fprintf(stderr, "Critical: %s\n", msg);
- break;
- case QtFatalMsg:
- if (MYLOGLEVEL <= 3)
- fprintf(stderr, "Fatal: %s\n", msg);
- abort();
- }
-}
-
-// Mock instances
-// These will be created by the test program
-Provider* mockProvider;
-Provider* mockCommanderProvider;
-DBusNameListener* mockDBusNameListener;
-
-// Mock implementation of the Provider
-int Provider::instanceCount = 0;
-QStringList Provider::instancePluginNames;
-QStringList Provider::instancePluginConstructionStrings;
-int Provider::subscribeCount = 0;
-QStringList Provider::subscribeKeys;
-QStringList Provider::subscribeProviderNames;
-
-int Provider::unsubscribeCount = 0;
-QStringList Provider::unsubscribeKeys;
-QStringList Provider::unsubscribeProviderNames;
-
-TimedValue Provider::cachedValue = TimedValue(QVariant());
-
-Provider* Provider::instance(const ContextProviderInfo& providerInfo)
-{
- ++ instanceCount;
- instancePluginNames << providerInfo.plugin;
- instancePluginConstructionStrings << providerInfo.constructionString;
- if (providerInfo.constructionString.contains("Commander")) {
- return mockCommanderProvider;
- }
- return mockProvider;
-}
-
-Provider::Provider(QString name)
- : myName(name)
-{
-}
-
-bool Provider::subscribe(const QString& key)
-{
- qDebug() << "subscribe" << key << myName;
- ++subscribeCount;
- subscribeKeys << key;
- subscribeProviderNames << myName;
- return true;
-}
-
-void Provider::unsubscribe(const QString& key)
-{
- qDebug() << "unsubscribe" << key << myName;
- ++unsubscribeCount;
- unsubscribeKeys << key;
- unsubscribeProviderNames << myName;
-}
-
-void Provider::setValue(const QString &key, const QVariant &value)
-{
- cachedValue = TimedValue(value);
- PropertyHandle::instance(key)->onValueChanged();
-}
-
-TimedValue Provider::get(const QString &key) const
-{
- return cachedValue;
-}
-
-void Provider::resetLogs()
-{
- instanceCount = 0;
- instancePluginConstructionStrings.clear();
- instancePluginNames.clear();
- subscribeCount = 0;
- subscribeKeys.clear();
- subscribeProviderNames.clear();
- unsubscribeCount = 0;
- unsubscribeKeys.clear();
- unsubscribeProviderNames.clear();
-}
-
-// Mock implementation of the DBusNameListener
-
-DBusNameListener::DBusNameListener(QDBusConnection::BusType busType,
- const QString &busName, QObject* parent)
- : servicePresent(NotPresent)
-{
- // Store the object created by the class to be tested
- mockDBusNameListener = this;
-}
-
-DBusNameListener::~DBusNameListener()
-{
-}
-
-DBusNameListener::ServicePresence DBusNameListener::isServicePresent() const
-{
- return servicePresent;
-}
-
-void DBusNameListener::startListening(bool nameHasOwnerCheck)
-{
-}
-
-//
-// Definition of testcases
-//
-
-
-// Before all tests
-void PropertyHandleUnitTests::initTestCase()
-{
- qInstallMsgHandler(myMessageOutput);
-}
-
-// After all tests
-void PropertyHandleUnitTests::cleanupTestCase()
-{
-}
-
-// Before each test
-void PropertyHandleUnitTests::init()
-{
- // Create the mock instances
- mockProvider = new Provider("NormalProvider");
- mockCommanderProvider = new Provider("Commander");
- mockContextRegistryInfo = new ContextRegistryInfo();
- // Reset the logs
- Provider::resetLogs();
- // Reset the DBusNameListener (it is created only once, by the class to be tested)
- mockDBusNameListener->servicePresent = DBusNameListener::NotPresent;
-}
-
-// After each test
-void PropertyHandleUnitTests::cleanup()
-{
- delete mockProvider;
- mockProvider = 0;
- delete mockCommanderProvider;
- mockCommanderProvider = 0;
- delete mockContextRegistryInfo;
- mockContextRegistryInfo = 0;
-
- // Disconnect all signals from the DBusNameListener.
- // Even if all the PropertyHandle objects (created in the tests) will live,
- // they won't receive any signals.
- QObject::disconnect(mockDBusNameListener, SIGNAL(nameAppeared()), 0, 0);
- QObject::disconnect(mockDBusNameListener, SIGNAL(nameDisappeared()), 0, 0);
-}
-
-void PropertyHandleUnitTests::initializing()
-{
- // Test:
- // Create the object to be tested
- // Note: For each test, we need to create a separate instance.
- // Otherwise the tests are dependent on each other.
- QString key = "Property." + QString(__FUNCTION__);
- propertyHandle = PropertyHandle::instance(key);
-
- // Expected results:
- // The Provider with the correct DBusName and DBusType was created.
- QCOMPARE(Provider::instanceCount, 1);
- QCOMPARE(Provider::instancePluginNames.at(0), QString("fakeplugin"));
- QCOMPARE(Provider::instancePluginConstructionStrings.at(0), QString("fakeconstructionstring"));
-}
-
-void PropertyHandleUnitTests::key()
-{
- // Setup:
- // Create the object to be tested
- // Note: For each test, we need to create a separate instance.
- // Otherwise the tests are dependent on each other.
- QString key = "Property." + QString(__FUNCTION__);
- propertyHandle = PropertyHandle::instance(key);
-
- // Test and expected results:
- // The key() function returns the correct key
- QCOMPARE(propertyHandle->key(), key);
-}
-
-void PropertyHandleUnitTests::info()
-{
- // Setup:
- // Create the object to be tested
- // Note: For each test, we need to create a separate instance.
- // Otherwise the tests are dependent on each other.
- QString key = "Property." + QString(__FUNCTION__);
- propertyHandle = PropertyHandle::instance(key);
-
- // Test and expected results:
- // The info() function returns the correct ContextPropertyInfo
- QCOMPARE(propertyHandle->info(), mockContextPropertyInfo);
-}
-
-void PropertyHandleUnitTests::subscribe()
-{
- // Setup:
- // Create the object to be tested
- // Note: For each test, we need to create a separate instance.
- // Otherwise the tests are dependent on each other.
- QString key = "Property." + QString(__FUNCTION__);
- propertyHandle = PropertyHandle::instance(key);
-
- // Test:
- // Command the PropertyHandle to subscribe
- propertyHandle->subscribe();
-
- // Expected results:
- // The PropertyHandle calls the Provider::subscribe
- QCOMPARE(Provider::subscribeCount, 1);
- QCOMPARE(Provider::subscribeKeys.at(0), key);
- QCOMPARE(Provider::unsubscribeCount, 0);
-}
-
-void PropertyHandleUnitTests::subscribeAndUnsubscribe()
-{
- // Setup:
- // Create the object to be tested
- // Note: For each test, we need to create a separate instance.
- // Otherwise the tests are dependent on each other.
- QString key = "Property." + QString(__FUNCTION__);
- propertyHandle = PropertyHandle::instance(key);
-
- // Test:
- // Command the PropertyHandle to subscribe
- propertyHandle->subscribe();
- // Command the PropertyHandle to unsubscribe
- propertyHandle->unsubscribe();
-
- // Expected results:
- // The PropertyHandle calls the Provider::unsubscribe
- QCOMPARE(Provider::subscribeCount, 1);
- QCOMPARE(Provider::subscribeKeys.at(0), key);
- QCOMPARE(Provider::unsubscribeCount, 1);
- QCOMPARE(Provider::unsubscribeKeys.at(0), key);
-}
-
-void PropertyHandleUnitTests::subscribeTwice()
-{
- // Setup:
- // Create the object to be tested
- // Note: For each test, we need to create a separate instance.
- // Otherwise the tests are dependent on each other.
- QString key = "Property." + QString(__FUNCTION__);
- propertyHandle = PropertyHandle::instance(key);
-
- // Test:
- // Command the PropertyHandle to subscribe
- propertyHandle->subscribe();
- // and subscribe again
- propertyHandle->subscribe();
-
- // Expected results:
- // The PropertyHandle calls the Provider::subscribe
- // but only once.
- QCOMPARE(Provider::subscribeCount, 1);
- QCOMPARE(Provider::subscribeKeys.at(0), key);
- QCOMPARE(Provider::unsubscribeCount, 0);
-}
-
-void PropertyHandleUnitTests::subscriptionPendingAndFinished()
-{
- // Setup:
- // Create the object to be tested
- // Note: For each test, we need to create a separate instance.
- // Otherwise the tests are dependent on each other.
- QString key = "Property." + QString(__FUNCTION__);
- propertyHandle = PropertyHandle::instance(key);
-
- // Test:
- // Command the PropertyHandle to subscribe
- propertyHandle->subscribe();
-
- // Expected results:
- // The subscription is marked as pending
- QVERIFY(propertyHandle->isSubscribePending());
-
- // finished
- propertyHandle->setSubscribeFinished(mockProvider);
-
- // Expected results:
- // The subscription is no longer marked as pending
- QCOMPARE(propertyHandle->isSubscribePending(), false);
-}
-
-void PropertyHandleUnitTests::subscribeTwiceAndUnsubscribe()
-{
- // Setup:
- // Create the object to be tested
- // Note: For each test, we need to create a separate instance.
- // Otherwise the tests are dependent on each other.
- QString key = "Property." + QString(__FUNCTION__);
- propertyHandle = PropertyHandle::instance(key);
-
- // Test:
- // Command the PropertyHandle to subscribe
- propertyHandle->subscribe();
- // and subscribe again
- propertyHandle->subscribe();
- // and then unsubscribe.
- propertyHandle->unsubscribe();
-
- // Expected results:
- // The PropertyHandle calls the Provider::subscribe
- // but only once. The unsubscribe is not called, since one of the
- // subscriptions is still valid.
- QCOMPARE(Provider::subscribeCount, 1);
- QCOMPARE(Provider::subscribeKeys.at(0), key);
- QCOMPARE(Provider::unsubscribeCount, 0);
-}
-
-void PropertyHandleUnitTests::subscribeTwiceAndUnsubscribeTwice()
-{
- // Setup:
- // Create the object to be tested
- // Note: For each test, we need to create a separate instance.
- // Otherwise the tests are dependent on each other.
- QString key = "Property." + QString(__FUNCTION__);
- propertyHandle = PropertyHandle::instance(key);
-
- // Test:
- // Command the PropertyHandle to subscribe
- propertyHandle->subscribe();
- // and subscribe again
- propertyHandle->subscribe();
- // and then unsubscribe
- propertyHandle->unsubscribe();
- // and unsubscribe again
- propertyHandle->unsubscribe();
-
- // Expected results:
- // The PropertyHandle calls the Provider::subscribe
- // but only once. Also the unsubscription is called once.
- QCOMPARE(Provider::subscribeCount, 1);
- QCOMPARE(Provider::subscribeKeys.at(0), key);
- QCOMPARE(Provider::unsubscribeCount, 1);
- QCOMPARE(Provider::unsubscribeKeys.at(0), key);
-}
-
-void PropertyHandleUnitTests::onValueChangedWithoutTypeCheck()
-{
- // Setup:
- // Create the object to be tested
- // Note: For each test, we need to create a separate instance.
- // Otherwise the tests are dependent on each other.
- QString key = "Property." + QString(__FUNCTION__);
- propertyHandle = PropertyHandle::instance(key);
-
- // Start listening to the valueChanged signal
- QSignalSpy spy(propertyHandle, SIGNAL(valueChanged()));
-
- // Test:
- spy.clear();
- // Command the PropertyHandle to change its value
- // The new value is a double
- Provider::setValue(key, QVariant(1.4));
-
- // Expected results:
- // The valueChanged signal was emitted
- QCOMPARE(spy.count(), 1);
- // The new value is now accessible
- QCOMPARE(propertyHandle->value(), QVariant(1.4));
-
- // Test:
- spy.clear();
- // Command the PropertyHandle to set its value to the same value it already has
- Provider::setValue(key, QVariant(1.4));
-
- // Expected results:
- // The valueChanged signal is not emitted
- QCOMPARE(spy.count(), 0);
-
- // Test:
- spy.clear();
- // Command the PropertyHandle to change its value
- // The new value is an integer
- Provider::setValue(key, QVariant(-8));
-
- // Expected results:
- // The valueChanged signal was emitted
- QCOMPARE(spy.count(), 1);
- // The new value is now accessible
- QCOMPARE(propertyHandle->value(), QVariant(-8));
- QCOMPARE(propertyHandle->value().isNull(), false);
-
- // Test:
- spy.clear();
- // Command the PropertyHandle to set its value to the same value it already has
- Provider::setValue(key, QVariant(-8));
-
- // Expected results:
- // The valueChanged signal is not emitted
- QCOMPARE(spy.count(), 0);
-
- // Test:
- spy.clear();
- // Command the PropertyHandle to change its value
- // The new value is a string
- Provider::setValue(key, QVariant("myValue"));
-
- // Expected results:
- // The valueChanged signal was emitted
- QCOMPARE(spy.count(), 1);
- // The new value is now accessible
- QCOMPARE(propertyHandle->value(), QVariant("myValue"));
- QCOMPARE(propertyHandle->value().isNull(), false);
-
- // Test:
- spy.clear();
- // Command the PropertyHandle to set its value to the same value it already has
- Provider::setValue(key, QVariant("myValue"));
-
- // Expected results:
- // The valueChanged signal is not emitted
- QCOMPARE(spy.count(), 0);
-
- // Test:
- spy.clear();
- // Command the PropertyHandle to change its value
- // The new value is a boolean
- Provider::setValue(key, QVariant(true));
-
- // Expected results:
- // The valueChanged signal was emitted
- QCOMPARE(spy.count(), 1);
- // The new value is now accessible
- QCOMPARE(propertyHandle->value(), QVariant(true));
- QCOMPARE(propertyHandle->value().isNull(), false);
-
- // Test:
- spy.clear();
- // Command the PropertyHandle to set its value to the same value it already has
- Provider::setValue(key, QVariant(true));
-
- // Expected results:
- // The valueChanged signal is not emitted
- QCOMPARE(spy.count(), 0);
-
- // Test:
- spy.clear();
- // Command the PropertyHandle to change its value
- // The new value is a null
- Provider::setValue(key, QVariant());
-
- // Expected results:
- // The valueChanged signal was emitted
- QCOMPARE(spy.count(), 1);
- // The new value is now accessible
- QCOMPARE(propertyHandle->value(), QVariant());
- QCOMPARE(propertyHandle->value().isNull(), true);
-
- // Test:
- spy.clear();
- // Command the PropertyHandle to set its value to the same value it already has
- Provider::setValue(key, QVariant());
-
- // Expected results:
- // The valueChanged signal is not emitted
- QCOMPARE(spy.count(), 0);
-
-}
-
-void PropertyHandleUnitTests::onValueChangedWithTypeCheckAndCorrectTypes()
-{
- // Setup:
- // Create the object to be tested
- // Note: For each test, we need to create a separate instance.
- // Otherwise the tests are dependent on each other.
- QString key = "Property." + QString(__FUNCTION__);
- propertyHandle = PropertyHandle::instance(key);
-
- // Enable the type checks
- PropertyHandle::setTypeCheck(true);
-
- // Start listening to the valueChanged signal
- QSignalSpy spy(propertyHandle, SIGNAL(valueChanged()));
-
- // Setup:
- spy.clear();
- // Set the type to DOUBLE
- mockContextPropertyInfo->myType = "DOUBLE";
-
- // Test:
- // Command the PropertyHandle to change its value
- // The new value is a double
- Provider::setValue(key, QVariant(1.4));
-
- // Expected results:
- // The valueChanged signal was emitted
- QCOMPARE(spy.count(), 1);
- // The new value is now accessible
- QCOMPARE(propertyHandle->value(), QVariant(1.4));
-
- // Test:
- spy.clear();
- // Command the PropertyHandle to change its value
- // The new value is a null
- Provider::setValue(key, QVariant());
-
- // Expected results:
- // The NULL value is always accepcted (not depending on the type)
- // The valueChanged signal was emitted
- QCOMPARE(spy.count(), 1);
- // The new value is now accessible
- QCOMPARE(propertyHandle->value(), QVariant());
- QCOMPARE(propertyHandle->value().isNull(), true);
-
- // Setup:
- spy.clear();
- // Set the type to INT
- mockContextPropertyInfo->myType = "INT";
-
- // Test:
- // Command the PropertyHandle to change its value
- // The new value is an integer
- Provider::setValue(key, QVariant(-8));
-
- // Expected results:
- // The valueChanged signal was emitted
- QCOMPARE(spy.count(), 1);
- // The new value is now accessible
- QCOMPARE(propertyHandle->value(), QVariant(-8));
- QCOMPARE(propertyHandle->value().isNull(), false);
-
- // Test:
- spy.clear();
- // Command the PropertyHandle to change its value
- // The new value is a null
- Provider::setValue(key, QVariant());
-
- // Expected results:
- // The NULL value is always accepcted (not depending on the type)
- // The valueChanged signal was emitted
- QCOMPARE(spy.count(), 1);
- // The new value is now accessible
- QCOMPARE(propertyHandle->value(), QVariant());
- QCOMPARE(propertyHandle->value().isNull(), true);
-
- // Setup:
- spy.clear();
- // Set the type to STRING
- mockContextPropertyInfo->myType = "STRING";
-
- // Test:
- // Command the PropertyHandle to change its value
- // The new value is a string
- Provider::setValue(key, QVariant("myValue"));
-
- // Expected results:
- // The valueChanged signal was emitted
- QCOMPARE(spy.count(), 1);
- // The new value is now accessible
- QCOMPARE(propertyHandle->value(), QVariant("myValue"));
- QCOMPARE(propertyHandle->value().isNull(), false);
-
- // Test:
- spy.clear();
- // Command the PropertyHandle to change its value
- // The new value is a null
- Provider::setValue(key, QVariant());
-
- // Expected results:
- // The NULL value is always accepcted (not depending on the type)
- // The valueChanged signal was emitted
- QCOMPARE(spy.count(), 1);
- // The new value is now accessible
- QCOMPARE(propertyHandle->value(), QVariant());
- QCOMPARE(propertyHandle->value().isNull(), true);
-
- // Setup:
- spy.clear();
- // Set the type to TRUTH
- mockContextPropertyInfo->myType = "TRUTH";
-
- // Test:
- // Command the PropertyHandle to change its value
- // The new value is a boolean
- Provider::setValue(key, QVariant(true));
-
- // Expected results:
- // The valueChanged signal was emitted
- QCOMPARE(spy.count(), 1);
- // The new value is now accessible
- QCOMPARE(propertyHandle->value(), QVariant(true));
- QCOMPARE(propertyHandle->value().isNull(), false);
-
- // Test:
- spy.clear();
- // Command the PropertyHandle to change its value
- // The new value is a null
- Provider::setValue(key, QVariant());
-
- // Expected results:
- // The NULL value is always accepcted (not depending on the type)
- // The valueChanged signal was emitted
- QCOMPARE(spy.count(), 1);
- // The new value is now accessible
- QCOMPARE(propertyHandle->value(), QVariant());
- QCOMPARE(propertyHandle->value().isNull(), true);
-
-}
-
-void PropertyHandleUnitTests::onValueChangedWithTypeCheckAndIncorrectTypes()
-{
- // Setup:
- // Create the object to be tested
- // Note: For each test, we need to create a separate instance.
- // Otherwise the tests are dependent on each other.
- QString key = "Property." + QString(__FUNCTION__);
- propertyHandle = PropertyHandle::instance(key);
-
- // Enable the type checks
- PropertyHandle::setTypeCheck(true);
-
- // Start listening to the valueChanged signal
- QSignalSpy spy(propertyHandle, SIGNAL(valueChanged()));
-
- // Setup:
- // Set the type to DOUBLE
- mockContextPropertyInfo->myType = "DOUBLE";
- // Set an initial value
- Provider::setValue(key, QVariant(4.2));
- spy.clear();
-
- // Test:
- // Command the PropertyHandle to change its value multiple times but with
- // incorrect types.
- Provider::setValue(key, QVariant(5));
- Provider::setValue(key, QVariant("string"));
- Provider::setValue(key, QVariant(false));
-
- // Expected results:
- // The valueChanged signal was not emitted
- QCOMPARE(spy.count(), 0);
- // The value is still the old value
- QCOMPARE(propertyHandle->value(), QVariant(4.2));
-
- // Setup:
- // Set the type to INT
- mockContextPropertyInfo->myType = "INT";
- // Set an initial value
- Provider::setValue(key, QVariant(22));
- spy.clear();
-
- // Test:
- // Command the PropertyHandle to change its value multiple times but with
- // incorrect types.
- Provider::setValue(key, QVariant(5.6));
- Provider::setValue(key, QVariant("string"));
- Provider::setValue(key, QVariant(false));
-
- // Expected results:
- // The valueChanged signal was not emitted
- QCOMPARE(spy.count(), 0);
- // The value is still the old value
- QCOMPARE(propertyHandle->value(), QVariant(22));
-
- // Setup:
- // Set the type to STRING
- mockContextPropertyInfo->myType = "STRING";
- // Set an initial value
- Provider::setValue(key, QVariant("myString"));
- spy.clear();
-
- // Test:
- // Command the PropertyHandle to change its value multiple times but with
- // incorrect types.
- Provider::setValue(key, QVariant(5.4));
- Provider::setValue(key, QVariant(-8));
- Provider::setValue(key, QVariant(false));
-
- // Expected results:
- // The valueChanged signal was not emitted
- QCOMPARE(spy.count(), 0);
- // The value is still the old value
- QCOMPARE(propertyHandle->value(), QVariant("myString"));
-
- // Setup:
- // Set the type to TRUTH
- mockContextPropertyInfo->myType = "TRUTH";
- // Set an initial value
- Provider::setValue(key, QVariant(false));
- spy.clear();
-
- // Test:
- // Command the PropertyHandle to change its value multiple times but with
- // incorrect types.
- Provider::setValue(key, QVariant(5.4));
- Provider::setValue(key, QVariant(-8));
- Provider::setValue(key, QVariant("string"));
-
- // Expected results:
- // The valueChanged signal was not emitted
- QCOMPARE(spy.count(), 0);
- // The value is still the old value
- QCOMPARE(propertyHandle->value(), QVariant(false));
-}
-
-void PropertyHandleUnitTests::commanderAppearsAndDisappears()
-{
- // Setup:
- // Create the object to be tested
- // Note: For each test, we need to create a separate instance.
- // Otherwise the tests are dependent on each other.
- QString key = "Property." + QString(__FUNCTION__);
- propertyHandle = PropertyHandle::instance(key);
-
- // Subscribe to the PropertyHandle
- propertyHandle->subscribe();
-
- // Clear the logs from the subscription
- Provider::resetLogs();
-
- // Test:
- // Command the DBusNameListener to tell that the Commander has appeared
- mockDBusNameListener->servicePresent = DBusNameListener::Present;
- emit mockDBusNameListener->nameAppeared();
-
- // Expected results:
- // The handle unsubscribes from the real provider
- QCOMPARE(Provider::unsubscribeCount, 1);
- QCOMPARE(Provider::unsubscribeKeys.at(0), key);
- QCOMPARE(Provider::unsubscribeProviderNames.at(0), QString("NormalProvider"));
- // And subscribes to Commander
- QCOMPARE(Provider::subscribeCount, 1);
- QCOMPARE(Provider::subscribeKeys.at(0), key);
- QCOMPARE(Provider::subscribeProviderNames.at(0), QString("Commander"));
-
- // Setup:
- // Clear the logs from the subscription
- Provider::resetLogs();
-
- // Test:
- // Command the DBusNameListener to tell that the Commander has disappeared
- mockDBusNameListener->servicePresent = DBusNameListener::NotPresent;
- emit mockDBusNameListener->nameDisappeared();
-
- // Expected results:
- // The PropertyHandle unsubscribes from the commander
- QCOMPARE(Provider::unsubscribeCount, 1);
- QCOMPARE(Provider::unsubscribeKeys.at(0), key);
- QCOMPARE(Provider::unsubscribeProviderNames.at(0), QString("Commander"));
- // And subscribes to the real provider
- QCOMPARE(Provider::subscribeCount, 1);
- QCOMPARE(Provider::subscribeKeys.at(0), key);
- QCOMPARE(Provider::subscribeProviderNames.at(0), QString("NormalProvider"));
-}
-
-void PropertyHandleUnitTests::commandingDisabled()
-{
- // Setup:
- // Create the object to be tested
- // Note: For each test, we need to create a separate instance.
- // Otherwise the tests are dependent on each other.
- QString key = "Property." + QString(__FUNCTION__);
- propertyHandle = PropertyHandle::instance(key);
-
- // Subscribe to the handle
- propertyHandle->subscribe();
-
- // Clear the logs from the subscription
- Provider::resetLogs();
-
- // Test:
- // Disable commanding
- propertyHandle->ignoreCommander();
-
- // Command the DBusNameListener to tell that the Commander has appeared
- mockDBusNameListener->servicePresent = DBusNameListener::Present;
- emit mockDBusNameListener->nameAppeared();
-
- // Expected results:
- // The PropertyHandle unsubscribes from and resubscribes to the same key,
- // practically ignoring commander appearance.
- QCOMPARE(Provider::unsubscribeCount, 1);
- QCOMPARE(Provider::subscribeCount, 1);
- QVERIFY(Provider::subscribeKeys == Provider::unsubscribeKeys);
- QVERIFY(Provider::subscribeProviderNames == Provider::unsubscribeProviderNames);
-
- // Setup:
- // Clear the logs from the subscription
- Provider::resetLogs();
-
- // Test:
- // Command the DBusNameListener to tell that the Commander has disappeared
- mockDBusNameListener->servicePresent = DBusNameListener::NotPresent;
- emit mockDBusNameListener->nameDisappeared();
-
- // Expected results:
- // Same thing as above.
- QCOMPARE(Provider::unsubscribeCount, 1);
- QCOMPARE(Provider::subscribeCount, 1);
- QVERIFY(Provider::subscribeKeys == Provider::unsubscribeKeys);
- QVERIFY(Provider::subscribeProviderNames == Provider::unsubscribeProviderNames);
-}
-
-} // end namespace
-
-QTEST_MAIN(ContextSubscriber::PropertyHandleUnitTests);
diff --git a/libcontextsubscriber/unit-tests/propertyhandle/testpropertyhandle.h b/libcontextsubscriber/unit-tests/propertyhandle/testpropertyhandle.h
deleted file mode 100644
index f7ef3557..00000000
--- a/libcontextsubscriber/unit-tests/propertyhandle/testpropertyhandle.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <QObject>
-#include <QSet>
-#include <QString>
-
-namespace ContextSubscriber {
-
-class PropertyHandle;
-
-class PropertyHandleUnitTests : public QObject
-{
- Q_OBJECT
-
-private:
- PropertyHandle *propertyHandle;
-
- // Tests
-private slots:
- // Init and cleanup helper functions
- void initTestCase();
- void cleanupTestCase();
- void init();
- void cleanup();
-
- // Test cases
- void initializing();
- void key();
- void info();
-
- void subscribe();
- void subscribeAndUnsubscribe();
- void subscribeTwice();
- void subscribeTwiceAndUnsubscribe();
- void subscribeTwiceAndUnsubscribeTwice();
-
- void subscriptionPendingAndFinished();
-
- void onValueChangedWithoutTypeCheck();
- void onValueChangedWithTypeCheckAndCorrectTypes();
- void onValueChangedWithTypeCheckAndIncorrectTypes();
-
- void commanderAppearsAndDisappears();
- void commandingDisabled();
-};
-
-} // end namespace
diff --git a/libcontextsubscriber/unit-tests/provider/.gitignore b/libcontextsubscriber/unit-tests/provider/.gitignore
deleted file mode 100644
index b9ab0625..00000000
--- a/libcontextsubscriber/unit-tests/provider/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-contextproviderinfo.h
-iproviderplugin.h
-provider.cpp
-provider.h
-sconnect.h
-logging.cpp
-logging.h
-loggingfeatures.h
-timedvalue.h
diff --git a/libcontextsubscriber/unit-tests/provider/Makefile.am b/libcontextsubscriber/unit-tests/provider/Makefile.am
deleted file mode 100644
index 11f664ec..00000000
--- a/libcontextsubscriber/unit-tests/provider/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-check_PROGRAMS = provider-unit-tests
-
-# your test's sources
-provider_unit_tests_SOURCES = testprovider.cpp testprovider.h \
- queuedinvoker.h contextkitplugin.h handlesignalrouter.h
-
-# only include these files in the coverage
-COVERAGE_FILES = provider.cpp
-
-# do the testing, coverage, etc. stuff
-# tests.am is using +=, so we have to set a value here for these four always
-AM_CXXFLAGS = $(QtDBus_CFLAGS) \
- '-DDEFAULT_CONTEXT_SUBSCRIBER_PLUGINS="@libdir@/contextkit/subscriber-plugins"'
-
-AM_LDFLAGS = $(QtDBus_LIBS)
-# copy these files from the real source
-FROM_SOURCE = provider.cpp provider.h iproviderplugin.h \
- loggingfeatures.h contextproviderinfo.h timedvalue.h
-FROM_SOURCE_DIR = $(srcdir)/../../src
-LDADD =
-include $(top_srcdir)/am/tests.am
-
-nodist_provider_unit_tests_SOURCES = mocs.cpp
-QT_TOMOC = $(filter %.h, $(provider_unit_tests_SOURCES) $(FROM_SOURCE))
-include $(top_srcdir)/am/qt.am
diff --git a/libcontextsubscriber/unit-tests/provider/contextkitplugin.h b/libcontextsubscriber/unit-tests/provider/contextkitplugin.h
deleted file mode 100644
index 39159c35..00000000
--- a/libcontextsubscriber/unit-tests/provider/contextkitplugin.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-// mock implementation
-
-#ifndef CONTEXTKITPLUGIN_H
-#define CONTEXTKITPLUGIN_H
-
-#include <QString>
-#include <QDBusConnection>
-#include <QSet>
-#include <QVariant>
-#include "iproviderplugin.h"
-
-extern "C" {
- ContextSubscriber::IProviderPlugin* contextKitPluginFactory(QString constructionString);
-}
-
-namespace ContextSubscriber {
-class ContextKitPlugin : public IProviderPlugin
-{
- Q_OBJECT
-
-public:
- void subscribe(QSet<QString> keys);
- void unsubscribe(QSet<QString> keys);
-
-signals:
- void ready();
- void failed(QString error);
- void subscribeFinished(QString key);
- void subscribeFailed(QString failedKey, QString error);
- void valueChanged(QString key, QVariant value);
-
-private:
- QSet<QString> subscribeRequested;
- QSet<QString> unsubscribeRequested;
-
- friend class ProviderUnitTests;
-};
-
-
-}
-
-#endif
diff --git a/libcontextsubscriber/unit-tests/provider/handlesignalrouter.h b/libcontextsubscriber/unit-tests/provider/handlesignalrouter.h
deleted file mode 100644
index 75ae2628..00000000
--- a/libcontextsubscriber/unit-tests/provider/handlesignalrouter.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-// This is a mock implementation
-
-#ifndef HANDLESIGNALROUTER_H
-#define HANDLESIGNALROUTER_H
-
-#include <QObject>
-#include <QString>
-#include <QVariant>
-
-namespace ContextSubscriber {
-
-class HandleSignalRouter : public QObject
-{
- Q_OBJECT
-public:
- static HandleSignalRouter* instance();
-
-public slots:
- void onValueChanged(QString key);
- void onSubscribeFinished(Provider *provider, QString key);
-};
-
-} // end namespace
-
-#endif
diff --git a/libcontextsubscriber/unit-tests/provider/queuedinvoker.h b/libcontextsubscriber/unit-tests/provider/queuedinvoker.h
deleted file mode 100644
index dc238956..00000000
--- a/libcontextsubscriber/unit-tests/provider/queuedinvoker.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef QUEUEDINVOKER_H
-#define QUEUEDINVOKER_H
-
-// This is a mock implementation
-
-#include <QObject>
-#include <QString>
-#include <QStringList>
-
-namespace ContextSubscriber {
-
-class QueuedInvoker : public QObject
-{
- Q_OBJECT
-
-public:
- QueuedInvoker();
-
- // For tests
- void callAllMethodsInQueue();
-
-protected:
- void queueOnce(const char *method);
-
-private:
- QStringList methodsToCall;
-};
-
-} // namespace
-#endif
diff --git a/libcontextsubscriber/unit-tests/provider/testprovider.cpp b/libcontextsubscriber/unit-tests/provider/testprovider.cpp
deleted file mode 100644
index c39d45cc..00000000
--- a/libcontextsubscriber/unit-tests/provider/testprovider.cpp
+++ /dev/null
@@ -1,329 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-// Header file of the tests
-#include "testprovider.h"
-
-// Mock header files
-#include "handlesignalrouter.h"
-#include "contextkitplugin.h"
-
-// Header file of the class to be tested
-#include "provider.h"
-
-#include <QtTest/QtTest>
-#include <QDebug>
-
-Q_DECLARE_METATYPE(QVariant);
-Q_DECLARE_METATYPE(QSet<QString>);
-
-namespace ContextSubscriber {
-
-#define MYLOGLEVEL 2
-void myMessageOutput(QtMsgType type, const char *msg)
-{
- switch (type) {
- case QtDebugMsg:
- if (MYLOGLEVEL <= 0)
- fprintf(stderr, "Debug: %s\n", msg);
- break;
- case QtWarningMsg:
- if (MYLOGLEVEL <= 1)
- fprintf(stderr, "Warning: %s\n", msg);
- break;
- case QtCriticalMsg:
- if (MYLOGLEVEL <= 2)
- fprintf(stderr, "Critical: %s\n", msg);
- break;
- case QtFatalMsg:
- if (MYLOGLEVEL <= 3)
- fprintf(stderr, "Fatal: %s\n", msg);
- abort();
- }
-}
-
-// Mock implementation of HandleSignalRouter
-
-// singleton instance
-HandleSignalRouter* mockHandleSignalRouter = new HandleSignalRouter();
-
-HandleSignalRouter* HandleSignalRouter::instance()
-{
- return mockHandleSignalRouter;
-}
-
-void HandleSignalRouter::onValueChanged(QString key)
-{
-}
-
-void HandleSignalRouter::onSubscribeFinished(Provider *provider, QString key)
-{
-}
-
-// Mock implementation of QueuedInvoker
-
-
-// Mock implementation of QueuedInvoker
-
-QueuedInvoker::QueuedInvoker()
-{
-}
-
-void QueuedInvoker::queueOnce(const char *method)
-{
- qDebug() << "queueonce" << QString(method);
- if (!methodsToCall.contains(QString(method))) {
- methodsToCall.push_back(method);
- }
-}
-
-void QueuedInvoker::callAllMethodsInQueue()
-{
- while (!methodsToCall.empty()) {
- QString method = methodsToCall.front();
- methodsToCall.pop_front();
- if (!QMetaObject::invokeMethod(this, method.toStdString().c_str(), Qt::DirectConnection)) {
- qFatal(" *****************\n"
- "Erroneous usage of queueOnce\n"
- " *****************\n");
- }
- }
-}
-
-// Mock implementation of ContextKitPlugin
-}
-
-QMap<QString, ContextSubscriber::ContextKitPlugin*> pluginInstances;
-
-// contextKitPluginFactory should be outside any namespace
-ContextSubscriber::IProviderPlugin* contextKitPluginFactory(QString constructionString)
-{
- if (!pluginInstances.contains(constructionString))
- pluginInstances[constructionString] = new ContextSubscriber::ContextKitPlugin();
- return pluginInstances[constructionString];
-}
-
-namespace ContextSubscriber {
-
-void ContextKitPlugin::subscribe(QSet<QString> keys)
-{
- subscribeRequested += keys;
-}
-
-void ContextKitPlugin::unsubscribe(QSet<QString> keys)
-{
- unsubscribeRequested += keys;
-}
-
-//
-// Definition of testcases
-//
-
-
-// Before all tests
-void ProviderUnitTests::initTestCase()
-{
- qRegisterMetaType<QVariant>("QVariant");
- qRegisterMetaType<QSet<QString> >("QSet<QString>");
-
- qInstallMsgHandler(myMessageOutput);
-}
-
-// After all tests
-void ProviderUnitTests::cleanupTestCase()
-{
-}
-
-// Before each test
-void ProviderUnitTests::init()
-{
- pluginInstances.clear();
-}
-
-// After each test
-void ProviderUnitTests::cleanup()
-{
-}
-
-void ProviderUnitTests::initializing()
-{
- // Test:
- // Create the object to be tested
- // Note: For each test, we need to create a separate instance.
- // Otherwise the tests are dependent on each other.
- QString conStr = "session:Fake.Bus.Name." + QString(__FUNCTION__);
- Provider *provider = Provider::instance(ContextProviderInfo("contextkit-dbus", conStr));
-
- // Let the provider process the deferred events
- provider->callAllMethodsInQueue();
-
- // The Provider is created (as part of initTestCase)
- // Expected results:
- // Provider constructed the ManagerInterface with correct parameters
- QCOMPARE(pluginInstances.size(), 1);
- QCOMPARE(pluginInstances.keys()[0], conStr);
-}
-
-void ProviderUnitTests::pluginReadyHandled()
-{
- // Test:
- // We create a new Provider with some pending subscriptions, then
- // we signal ready from the plugin. The pending subscriptions
- // should be forwarded to the plugin then.
- QString conStr = "session:Fake.Bus.Name." + QString(__FUNCTION__);
- Provider *provider = Provider::instance(ContextProviderInfo("contextkit-dbus", conStr));
- provider->callAllMethodsInQueue();
-
- provider->subscribe("test.key1");
- provider->subscribe("test.key2");
- provider->subscribe("test.key3");
- provider->unsubscribe("test.key2");
- provider->callAllMethodsInQueue();
- QCOMPARE(pluginInstances[conStr]->subscribeRequested, QSet<QString>()); // nothing yet
-
- // but after ready, the pending subscriptions are requested from the plugin
- emit pluginInstances[conStr]->ready();
- provider->callAllMethodsInQueue();
- QCOMPARE(pluginInstances[conStr]->subscribeRequested, QSet<QString>() << "test.key1" << "test.key3");
-}
-
-void ProviderUnitTests::pluginFailedHandled()
-{
- // same as in the ready case, but we emit failed, so the
- // subscriptions shouldn't be requested
- QString conStr = "session:Fake.Bus.Name." + QString(__FUNCTION__);
- Provider *provider = Provider::instance(ContextProviderInfo("contextkit-dbus", conStr));
- provider->callAllMethodsInQueue();
-
- provider->subscribe("test.key1");
- provider->subscribe("test.key2");
- provider->subscribe("test.key3");
- provider->unsubscribe("test.key2");
- provider->callAllMethodsInQueue();
- QCOMPARE(pluginInstances[conStr]->subscribeRequested, QSet<QString>()); // nothing yet
-
- // but after ready, the pending subscriptions are requested from the plugin
- emit pluginInstances[conStr]->failed("error");
- provider->callAllMethodsInQueue();
- QCOMPARE(pluginInstances[conStr]->subscribeRequested, QSet<QString>()); // we failed, no requests
-}
-
-void ProviderUnitTests::badPluginName()
-{
- // Test:
- // If we pass a bad plugin name, no crashes
- QString conStr = "session:Fake.Bus.Name." + QString(__FUNCTION__);
- Provider *provider = Provider::instance(ContextProviderInfo("non-existent-plugin", conStr));
- provider->callAllMethodsInQueue();
-
- QCOMPARE(pluginInstances.size(), 0);
-}
-
-void ProviderUnitTests::unsubscribe()
-{
- // Test:
- // If a key subscribed, then we unsubscribe, an unsubscribed
- // request is sent to the plugin.
- QString conStr = "session:Fake.Bus.Name." + QString(__FUNCTION__);
- Provider *provider = Provider::instance(ContextProviderInfo("contextkit-dbus", conStr));
- provider->callAllMethodsInQueue();
- emit pluginInstances[conStr]->ready(); // set the plugin to ready
- provider->callAllMethodsInQueue();
-
- provider->subscribe("test.key1");
- provider->callAllMethodsInQueue();
- provider->unsubscribe("test.key1");
- provider->callAllMethodsInQueue();
- QCOMPARE(pluginInstances[conStr]->subscribeRequested, QSet<QString>() << "test.key1");
- QCOMPARE(pluginInstances[conStr]->unsubscribeRequested, QSet<QString>() << "test.key1");
-
- pluginInstances[conStr]->subscribeRequested.clear();
- pluginInstances[conStr]->unsubscribeRequested.clear();
-
- // Test: we subscribe, then unsubscribe-subscribe without a main
- // loop between, the expected result is that we don't get
- // unsubscribed.
-
- provider->subscribe("test.key2");
- provider->callAllMethodsInQueue();
- provider->unsubscribe("test.key2");
- provider->subscribe("test.key2");
- provider->callAllMethodsInQueue();
- QCOMPARE(pluginInstances[conStr]->subscribeRequested, QSet<QString>() << "test.key2");
- QCOMPARE(pluginInstances[conStr]->unsubscribeRequested, QSet<QString>());
-}
-
-void ProviderUnitTests::pluginSubscriptionFinishes()
-{
- // Test:
- // We subscribe to a property. Doesn't matter if the subscription
- // succeeds or fails, the SubscribeFinished(keyname) should be emitted.
-
- QString conStr = "session:Fake.Bus.Name." + QString(__FUNCTION__);
- Provider *provider = Provider::instance(ContextProviderInfo("contextkit-dbus", conStr));
- provider->callAllMethodsInQueue();
- emit pluginInstances[conStr]->ready(); // set the plugin to ready
- provider->callAllMethodsInQueue();
-
- QSignalSpy spy(provider, SIGNAL(subscribeFinished(Provider *, QString)));
- provider->subscribe("test.key1");
- provider->subscribe("test.key2");
- provider->callAllMethodsInQueue();
- emit pluginInstances[conStr]->subscribeFinished("test.key1");
- emit pluginInstances[conStr]->subscribeFailed("test.key2", "error");
- QCoreApplication::processEvents(QEventLoop::WaitForMoreEvents); // signal delivery is queued
- QCOMPARE(spy.size(), 2);
- QCOMPARE(spy[0].size(), 2);
- QCOMPARE(spy[1].size(), 2);
- QCOMPARE(spy[0][1], QVariant("test.key1"));
- QCOMPARE(spy[1][1], QVariant("test.key2"));
-}
-
-void ProviderUnitTests::pluginValueChanges()
-{
- // Test:
-
- // We subscribe to a property. After that if a value change is
- // signaled it has to be forwarded iff the property was subscribed
- // to.
-
- QString conStr = "session:Fake.Bus.Name." + QString(__FUNCTION__);
- Provider *provider = Provider::instance(ContextProviderInfo("contextkit-dbus", conStr));
- provider->callAllMethodsInQueue();
- emit pluginInstances[conStr]->ready(); // set the plugin to ready
- provider->callAllMethodsInQueue();
-
- provider->subscribe("test.key1");
- provider->callAllMethodsInQueue();
- emit pluginInstances[conStr]->subscribeFinished("test.key1");
- QCoreApplication::processEvents(QEventLoop::WaitForMoreEvents); // signal delivery is queued
-
- QSignalSpy spy(provider, SIGNAL(valueChanged(QString)));
- emit pluginInstances[conStr]->valueChanged("test.key1", QVariant(42));
- emit pluginInstances[conStr]->valueChanged("test.key2", QVariant(4242));
-
- QCOMPARE(spy.size(), 1);
- QCOMPARE(spy.at(0).size(), 1);
- QCOMPARE(spy.at(0).at(0).value<QString>(), QString("test.key1"));
- QCOMPARE(provider->get("test.key1").value, QVariant(42));
-}
-} // end namespace
-QTEST_MAIN(ContextSubscriber::ProviderUnitTests);
diff --git a/libcontextsubscriber/unit-tests/provider/testprovider.h b/libcontextsubscriber/unit-tests/provider/testprovider.h
deleted file mode 100644
index 591d1113..00000000
--- a/libcontextsubscriber/unit-tests/provider/testprovider.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <QObject>
-#include <QSet>
-#include <QString>
-
-namespace ContextSubscriber {
-
-class Provider;
-
-class ProviderUnitTests : public QObject
-{
- Q_OBJECT
-
-private:
- // Tests
-private slots:
- // Init and cleanup helper functions
- void initTestCase();
- void cleanupTestCase();
- void init();
- void cleanup();
-
- // Test cases
- void initializing();
- void pluginReadyHandled();
- void pluginFailedHandled();
- void badPluginName();
- void unsubscribe();
- void pluginSubscriptionFinishes();
- void pluginValueChanges();
-};
-
-} // end namespace
diff --git a/libcontextsubscriber/unit-tests/util/Makefile.am b/libcontextsubscriber/unit-tests/util/Makefile.am
deleted file mode 100644
index d0b4be76..00000000
--- a/libcontextsubscriber/unit-tests/util/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-EXTRA_DIST = fileutils.h
diff --git a/libcontextsubscriber/unit-tests/util/fileutils.h b/libcontextsubscriber/unit-tests/util/fileutils.h
deleted file mode 100644
index 48483804..00000000
--- a/libcontextsubscriber/unit-tests/util/fileutils.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <QDir>
-#include <QFile>
-#include <QTest>
-#include <QDebug>
-#include <stdlib.h>
-
-#define LOCAL_DIR (utilPathForLocalDir())
-#define LOCAL_FILE(f) (utilPathForLocalFile(f))
-#define DEFAULT_WAIT_PERIOD 100
-
-QString utilPathForLocalFile(QString fname)
-{
- const char *srcdir = getenv("srcdir");
- if (srcdir) {
- return QString(srcdir) + QDir::separator() + fname;
- } else {
- return QString("./") + QString(fname);
- }
-}
-
-QString utilPathForLocalDir()
-{
- const char *srcdir = getenv("srcdir");
- if (srcdir) {
- QDir dir = QDir(srcdir);
- return dir.absolutePath() + "/";
- } else {
- return QString("./");
- }
-}
-
-void utilSetEnv(QString env, QString val)
-{
- setenv(env.toUtf8().constData(), val.toUtf8().constData(), 0);
-}
-
-void utilCopyLocalWithRemove(QString src, QString dest, int waitPeriod = DEFAULT_WAIT_PERIOD)
-{
- src = LOCAL_FILE(src);
-
- QFile::remove(dest);
- if (! QFile::copy(src, dest))
- qFatal("Failed to copy %s to %s!", src.toLocal8Bit().data(), dest.toLocal8Bit().data());
-
- if (waitPeriod > 0)
- QTest::qWait(waitPeriod);
-}
-
-void utilCopyLocalAtomically(QString src, QString dest, int waitPeriod = DEFAULT_WAIT_PERIOD)
-{
- src = LOCAL_FILE(src);
- QString temp = "temp.file";
-
- QFile::remove(temp);
-
- if (! QFile::copy(src, temp))
- qFatal("Failed to copy %s to %s!", src.toLocal8Bit().data(), temp.toLocal8Bit().data());
-
- if (rename(temp.toUtf8().constData(), dest.toUtf8().constData()) != 0)
- qFatal("Failed to rename %s to %s!", temp.toLocal8Bit().data(), dest.toLocal8Bit().data());
-
- if (waitPeriod > 0)
- QTest::qWait(waitPeriod);
-}
diff --git a/libcontextsubscriber/update-contextkit-providers/Makefile.am b/libcontextsubscriber/update-contextkit-providers/Makefile.am
deleted file mode 100644
index b0524b7e..00000000
--- a/libcontextsubscriber/update-contextkit-providers/Makefile.am
+++ /dev/null
@@ -1,21 +0,0 @@
-bin_PROGRAMS = update-contextkit-providers
-
-update_contextkit_providers_SOURCES = update-contextkit-providers.cpp
-
-AM_CXXFLAGS = -I$(srcdir)/../src $(QtXml_CFLAGS) $(QtCore_CFLAGS) $(QtDBus_CFLAGS) \
- '-DDEFAULT_CONTEXT_PROVIDERS="@datadir@/contextkit/providers/"' \
- '-DCONTEXT_LOG_MODULE_NAME="update-contextkit-providers"'
-
-AM_LDFLAGS = $(QtXml_LIBS) $(QtCore_LIBS)
-
-# library dependency hack for seamless make in update-contextkit-providers/
-update_contextkit_providers_LDADD = ../src/libcontextsubscriber.la
-../src/libcontextsubscriber.la:
- $(MAKE) -C ../src libcontextsubscriber.la
-.PHONY: ../src/libcontextsubscriber.la
-
-# moccing
-# Note: enable these 2 lines when there is something to mock
-#nodist_update_contextkit_providers_SOURCES = mocs.cpp
-#QT_TOMOC = $(filter %.h, $(update_contextkit_providers_SOURCES))
-#include $(top_srcdir)/am/qt.am
diff --git a/libcontextsubscriber/update-contextkit-providers/cache.cdb b/libcontextsubscriber/update-contextkit-providers/cache.cdb
deleted file mode 100644
index 47474a26..00000000
--- a/libcontextsubscriber/update-contextkit-providers/cache.cdb
+++ /dev/null
Binary files differ
diff --git a/libcontextsubscriber/update-contextkit-providers/update-contextkit-providers.cpp b/libcontextsubscriber/update-contextkit-providers/update-contextkit-providers.cpp
deleted file mode 100644
index 0ecf47b0..00000000
--- a/libcontextsubscriber/update-contextkit-providers/update-contextkit-providers.cpp
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Nokia Corporation.
- *
- * Contact: Marius Vollmer <marius.vollmer@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <QCoreApplication>
-#include <QDir>
-#include <stdlib.h>
-#include "contextregistryinfo.h"
-#include "contextpropertyinfo.h"
-#include "contextproviderinfo.h"
-#include "cdbwriter.h"
-#include "fcntl.h"
-#include "infobackend.h"
-
-/*!
- \page UpdatingContextProviders
-
- \brief The update tool (\c update-contextkit-providers) is used to regenerate the registry cache database.
-
- \section Overview
-
- Information about keys and providers is normally stored in a system directory in
- \b xml format. The xml (being xml) is slow to parse and not efficient as a storage format for
- data that is mostly static.
-
- It makes sense to store a cached version of the xml registry in a constant-database
- fast-access format and regenerate it when the xml data changes.
-
- Update tool does exactly that - it reads the xml registry and (re)generates a
- constant \b tiny-cdb database containing the cached version of the data in the registry.
-
- \section Usage
-
- The \c update-contextkit-providers binary, when launched without parameters, will by default regenerate
- the database in the default installation prefix. Most likely: \c "/usr/share/contextkit/providers" .
- Obviously, for this to be successful, it needs to be launched with proper privileges.
-
- It's possible to override the registry directory with first parameter:
-
- \code
- $> update-contextkit-providers /some/path/to/registry
- \endcode
-
- In this case the xml will be read from \c "/some/path/to/registry" and the resulting
- database will be written to \c "/some/path/to/registry/cache.cdb" .
-
- Lastly, the \c "CONTEXT_PROVIDERS" environment variable can be used to specify
- a directory containing the registry.
-
- \section Implementation
-
- To ensure the registry consistency the regeneration is done atomically: the
- new database is first written to a temp-named file and then moved over the old one.
-*/
-
-/* Make sure the given directory exists, is readable etc.
- If not, bail out with proper error. */
-void checkDirectory(const QDir &dir)
-{
- QByteArray utf8Data = dir.absolutePath().toUtf8();
- const char *path = utf8Data.constData();
-
- if (! dir.exists()) {
- printf ("ERROR: Directory '%s' does not exist!\n", path);
- exit (128);
- }
-
- if (! dir.isReadable()) {
- printf ("ERROR: Directory '%s' is not readable!\n", path);
- exit (128);
- }
-}
-
-int main(int argc, char **argv)
-{
- QCoreApplication app(argc, argv);
- QStringList args = app.arguments();
-
- // Check args etc
- QString path;
-
- // We first try to use first argument if present, then CONTEXT_PROVIDERS env,
- // lastly -- the compiled-in default path.
- if (args.size() > 1) {
- path = args.at(1);
- setenv("CONTEXT_PROVIDERS", path.toUtf8().constData(), 1);
- } else if (getenv("CONTEXT_PROVIDERS"))
- path = QString(getenv("CONTEXT_PROVIDERS"));
- else
- path = QString(DEFAULT_CONTEXT_PROVIDERS);
-
- printf("Updating from: '%s'\n", path.toUtf8().constData());
-
- // Force the xml backend
- ContextRegistryInfo *context = ContextRegistryInfo::instance("xml");
-
- QDir dir(path);
- checkDirectory(dir);
- QString tmpDbPath = dir.absoluteFilePath("cache-XXXXXX");
- QString finalDbPath = dir.absoluteFilePath("cache.cdb");
- QByteArray templ = tmpDbPath.toUtf8();
-
- char *tempPath = templ.data();
- CDBWriter writer(mkstemp(tempPath));
- chmod(tempPath, 0644);
- if (writer.isWritable() == false) {
- printf("ERROR: %s is not writable. No permissions?\n", templ.constData());
- exit(128);
- }
-
- // Write the compatibility string
- writer.add("VERSION", BACKEND_COMPATIBILITY_NAMESPACE);
-
- foreach(const QString& key, context->listKeys()) {
- ContextPropertyInfo keyInfo(key);
-
- // Write value to list key
- writer.add("KEYS", key);
-
- // Write type
- writer.replace(key + ":KEYTYPE", keyInfo.type());
-
- // Write doc
- writer.replace(key + ":KEYDOC", keyInfo.doc());
-
- // Write the providers
- QVariantList providers;
- foreach(const ContextProviderInfo info, keyInfo.providers()) {
- QHash <QString, QVariant> provider;
- provider.insert("plugin", info.plugin);
- provider.insert("constructionString", info.constructionString);
- providers << QVariant(provider);
-
- }
-
- writer.add(key + ":PROVIDERS", QVariant(providers));
- }
-
- if (fsync(writer.fileDescriptor()) != 0) {
- printf("ERROR: failed to fsync data on writer to %s.\n", templ.constData());
- exit(64);
- }
-
- writer.close();
-
- // Atomically rename
- if (rename(templ.constData(), finalDbPath.toUtf8().constData()) != 0) {
- printf("ERROR: failed to rename %s to %s.\n", templ.constData(), finalDbPath.toUtf8().constData());
- exit(64);
- }
-
- // All ok
- printf("Generated: '%s'\n", finalDbPath.toUtf8().constData());
- return 0;
-}
-
diff --git a/tools/loadmem/Makefile.am b/loadmem/Makefile.am
index a33dcdc3..a33dcdc3 100644
--- a/tools/loadmem/Makefile.am
+++ b/loadmem/Makefile.am
diff --git a/loadmem/Makefile.in b/loadmem/Makefile.in
new file mode 100644
index 00000000..f37892ea
--- /dev/null
+++ b/loadmem/Makefile.in
@@ -0,0 +1,503 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = loadmem$(EXEEXT)
+subdir = tools/loadmem
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
+ $(top_srcdir)/m4/ax_version_tools.m4 \
+ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_loadmem_OBJECTS = loadmem.$(OBJEXT)
+loadmem_OBJECTS = $(am_loadmem_OBJECTS)
+loadmem_LDADD = $(LDADD)
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(loadmem_SOURCES)
+DIST_SOURCES = $(loadmem_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+ASCIIDOC = @ASCIIDOC@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CDB_LIBS = @CDB_LIBS@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DBUS_CFLAGS = @DBUS_CFLAGS@
+DBUS_LIBS = @DBUS_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOT = @DOT@
+DOXYGEN = @DOXYGEN@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GCOV = @GCOV@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
+GREP = @GREP@
+HTML_DIR = @HTML_DIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LCOV = @LCOV@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MOC = @MOC@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+QtCore_CFLAGS = @QtCore_CFLAGS@
+QtCore_LIBS = @QtCore_LIBS@
+QtDBus_CFLAGS = @QtDBus_CFLAGS@
+QtDBus_LIBS = @QtDBus_LIBS@
+QtTest_CFLAGS = @QtTest_CFLAGS@
+QtTest_LIBS = @QtTest_LIBS@
+QtXml_CFLAGS = @QtXml_CFLAGS@
+QtXml_LIBS = @QtXml_LIBS@
+RANLIB = @RANLIB@
+RCC = @RCC@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SOURCE_HIGHLIGHT = @SOURCE_HIGHLIGHT@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XMLLINT = @XMLLINT@
+XSLTPROC = @XSLTPROC@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+loadmem_SOURCES = loadmem.c
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/loadmem/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign tools/loadmem/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ || test -f $$p1 \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+ else :; fi; \
+ done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
+ done
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+loadmem$(EXEEXT): $(loadmem_OBJECTS) $(loadmem_DEPENDENCIES)
+ @rm -f loadmem$(EXEEXT)
+ $(LINK) $(loadmem_OBJECTS) $(loadmem_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loadmem.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+ clean-generic clean-libtool ctags distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-binPROGRAMS install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/tools/loadmem/loadmem.c b/loadmem/loadmem.c
index b7a6f21a..b7a6f21a 100644
--- a/tools/loadmem/loadmem.c
+++ b/loadmem/loadmem.c
diff --git a/ltmain.sh.as-needed.patch b/ltmain.sh.as-needed.patch
deleted file mode 100644
index c9c12b4f..00000000
--- a/ltmain.sh.as-needed.patch
+++ /dev/null
@@ -1,31 +0,0 @@
---- ltmain.sh 2009-09-11 11:29:46.000000000 +0300
-+++ ltmain.sh-good 2009-09-11 11:28:46.000000000 +0300
-@@ -4716,6 +4716,11 @@
- arg=$func_stripname_result
- ;;
-
-+ -Wl,--as-needed)
-+ deplibs="$deplibs $arg"
-+ continue
-+ ;;
-+
- -Wl,*)
- func_stripname '-Wl,' '' "$arg"
- args=$func_stripname_result
-@@ -5070,6 +5075,16 @@
- lib=
- found=no
- case $deplib in
-+ -Wl,--as-needed)
-+ if test "$linkmode,$pass" = "prog,link"; then
-+ compile_deplibs="$deplib $compile_deplibs"
-+ finalize_deplibs="$deplib $finalize_deplibs"
-+ else
-+ deplibs="$deplib $deplibs"
-+ fi
-+ continue
-+ ;;
-+
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
- if test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$deplib $compile_deplibs"
diff --git a/m4/.gitignore b/m4/.gitignore
deleted file mode 100644
index 8bab51c2..00000000
--- a/m4/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-libtool.m4
-ltoptions.m4
-ltsugar.m4
-ltversion.m4
-lt~obsolete.m4
-
diff --git a/m4/ax_compare_version.m4 b/m4/ax_compare_version.m4
deleted file mode 100644
index 3f33ad1b..00000000
--- a/m4/ax_compare_version.m4
+++ /dev/null
@@ -1,174 +0,0 @@
-# ===========================================================================
-# http://www.nongnu.org/autoconf-archive/ax_compare_version.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
-#
-# DESCRIPTION
-#
-# This macro compares two version strings. Due to the various number of
-# minor-version numbers that can exist, and the fact that string
-# comparisons are not compatible with numeric comparisons, this is not
-# necessarily trivial to do in a autoconf script. This macro makes doing
-# these comparisons easy.
-#
-# The six basic comparisons are available, as well as checking equality
-# limited to a certain number of minor-version levels.
-#
-# The operator OP determines what type of comparison to do, and can be one
-# of:
-#
-# eq - equal (test A == B)
-# ne - not equal (test A != B)
-# le - less than or equal (test A <= B)
-# ge - greater than or equal (test A >= B)
-# lt - less than (test A < B)
-# gt - greater than (test A > B)
-#
-# Additionally, the eq and ne operator can have a number after it to limit
-# the test to that number of minor versions.
-#
-# eq0 - equal up to the length of the shorter version
-# ne0 - not equal up to the length of the shorter version
-# eqN - equal up to N sub-version levels
-# neN - not equal up to N sub-version levels
-#
-# When the condition is true, shell commands ACTION-IF-TRUE are run,
-# otherwise shell commands ACTION-IF-FALSE are run. The environment
-# variable 'ax_compare_version' is always set to either 'true' or 'false'
-# as well.
-#
-# Examples:
-#
-# AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8])
-# AX_COMPARE_VERSION([3.15],[lt],[3.15.8])
-#
-# would both be true.
-#
-# AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8])
-# AX_COMPARE_VERSION([3.15],[gt],[3.15.8])
-#
-# would both be false.
-#
-# AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8])
-#
-# would be true because it is only comparing two minor versions.
-#
-# AX_COMPARE_VERSION([3.15.7],[eq0],[3.15])
-#
-# would be true because it is only comparing the lesser number of minor
-# versions of the two values.
-#
-# Note: The characters that separate the version numbers do not matter. An
-# empty string is the same as version 0. OP is evaluated by autoconf, not
-# configure, so must be a string, not a variable.
-#
-# The author would like to acknowledge Guido Draheim whose advice about
-# the m4_case and m4_ifvaln functions make this macro only include the
-# portions necessary to perform the specific comparison specified by the
-# OP argument in the final configure script.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Tim Toolan <toolan@ele.uri.edu>
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved.
-
-dnl #########################################################################
-AC_DEFUN([AX_COMPARE_VERSION], [
- AC_REQUIRE([AC_PROG_AWK])
-
- # Used to indicate true or false condition
- ax_compare_version=false
-
- # Convert the two version strings to be compared into a format that
- # allows a simple string comparison. The end result is that a version
- # string of the form 1.12.5-r617 will be converted to the form
- # 0001001200050617. In other words, each number is zero padded to four
- # digits, and non digits are removed.
- AS_VAR_PUSHDEF([A],[ax_compare_version_A])
- A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
- -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
- -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
- -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
- -e 's/[[^0-9]]//g'`
-
- AS_VAR_PUSHDEF([B],[ax_compare_version_B])
- B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
- -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
- -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
- -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
- -e 's/[[^0-9]]//g'`
-
- dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary
- dnl # then the first line is used to determine if the condition is true.
- dnl # The sed right after the echo is to remove any indented white space.
- m4_case(m4_tolower($2),
- [lt],[
- ax_compare_version=`echo "x$A
-x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"`
- ],
- [gt],[
- ax_compare_version=`echo "x$A
-x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"`
- ],
- [le],[
- ax_compare_version=`echo "x$A
-x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"`
- ],
- [ge],[
- ax_compare_version=`echo "x$A
-x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"`
- ],[
- dnl Split the operator from the subversion count if present.
- m4_bmatch(m4_substr($2,2),
- [0],[
- # A count of zero means use the length of the shorter version.
- # Determine the number of characters in A and B.
- ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'`
- ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'`
-
- # Set A to no more than B's length and B to no more than A's length.
- A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"`
- B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"`
- ],
- [[0-9]+],[
- # A count greater than zero means use only that many subversions
- A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
- B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
- ],
- [.+],[
- AC_WARNING(
- [illegal OP numeric parameter: $2])
- ],[])
-
- # Pad zeros at end of numbers to make same length.
- ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`"
- B="$B`echo $A | sed 's/./0/g'`"
- A="$ax_compare_version_tmp_A"
-
- # Check for equality or inequality as necessary.
- m4_case(m4_tolower(m4_substr($2,0,2)),
- [eq],[
- test "x$A" = "x$B" && ax_compare_version=true
- ],
- [ne],[
- test "x$A" != "x$B" && ax_compare_version=true
- ],[
- AC_WARNING([illegal OP parameter: $2])
- ])
- ])
-
- AS_VAR_POPDEF([A])dnl
- AS_VAR_POPDEF([B])dnl
-
- dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE.
- if test "$ax_compare_version" = "true" ; then
- m4_ifvaln([$4],[$4],[:])dnl
- m4_ifvaln([$5],[else $5])dnl
- fi
-]) dnl AX_COMPARE_VERSION
diff --git a/m4/ax_version_tools.m4 b/m4/ax_version_tools.m4
deleted file mode 100644
index 17a2cb8a..00000000
--- a/m4/ax_version_tools.m4
+++ /dev/null
@@ -1,61 +0,0 @@
-dnl Call executable --version, and try to figure out the version
-dnl number from the output.
-dnl
-dnl Usage; AX_PROGRAM_VERSION([executable])
-AC_DEFUN([AX_PROGRAM_VERSION], [dnl
-`$$1 --version </dev/null 2>/dev/null | head -n1 | grep -o '[[0-9.]]*'`dnl
-])
-
-dnl Creates a command line parameter --disable-OPTIONNAME, which if
-dnl specified by the user adds a fake dependency to
-dnl missing_deps_CONDITIONALFEATURE.
-dnl
-dnl Usage: AX_FEATURE_DISABLEABLE([$1=option name], [$2=conditional feature], [$3=description])
-AC_DEFUN([AX_FEATURE_DISABLEABLE], [
-AC_ARG_ENABLE([$1],
- AS_HELP_STRING([--disable-$1],
- [$3 [[default=no]]]),,
- [enable_$1=undef])
-if test x$enable_$1 = xno
-then
- missing_deps_$2=", disabled by user"
-fi
-])
-
-dnl Check the existence (and optionally version) of a program and
-dnl record information about this missing dependency on failure to
-dnl the variable named missing_deps_CONDITIONALFEATURE.
-dnl
-dnl Usage: AX_DISABLE_FEATURE_ON_PROG([$1=description], [$2=conditional feature],
-dnl [$3=subst var], [$4=lookup list],
-dnl [$5=needed version (optional)])
-AC_DEFUN([AX_DISABLE_FEATURE_ON_PROG], [
-AC_ARG_VAR([$3], [$1])
-AC_CHECK_PROGS([$3], [$4], [:])
-if test $$3 = :
-then
- missing_deps_$2="$missing_deps_$2, $1"
-else
- if test x$5 != x
- then
- disable_feature_on_prog_ver=AX_PROGRAM_VERSION([$3])
- AX_COMPARE_VERSION([$disable_feature_on_prog_ver], [ge], [$5], [],
- [AC_MSG_WARN([$1 version mismatch; wanted $5, has: $disable_feature_on_prog_ver])
- missing_deps_$2="$missing_deps_$2, $1 >= $5"])
- fi
-fi
-])
-
-dnl Reports the current state of missing_deps_CONDITIONALFEATURE
-dnl variable to the user in an easy to read fashion.
-dnl
-dnl Usage: AX_FEATURE_SUMMARIZE([$1=conditional feature], [$2=enabled msg], [$3=disabled msg])
-AC_DEFUN([AX_FEATURE_SUMMARIZE], [
-if test "$missing_deps_$1" = ""
-then
- AC_MSG_NOTICE([$2])
-else
- missing_deps_$1=`echo $missing_deps_$1 | cut -c3-`
- AC_MSG_WARN([$3, missing dependencies: $missing_deps_$1])
-fi
-])
diff --git a/m4/qt.m4 b/m4/qt.m4
deleted file mode 100644
index 348352e4..00000000
--- a/m4/qt.m4
+++ /dev/null
@@ -1,23 +0,0 @@
-dnl Usage: PKG_CHECK_MODULES_SUBST([name], [package to check for])
-AC_DEFUN([PKG_CHECK_MODULES_SUBST], [
-PKG_CHECK_MODULES([$1], [$2])
-AC_SUBST([$1_CFLAGS])
-AC_SUBST([$1_LIBS])])
-
-AC_DEFUN([AC_PROG_QT_MOC], [
-MOC=`pkg-config QtCore --variable=moc_location`
-AC_CHECK_FILE([$MOC], [],
- AC_MSG_ERROR([Can't find moc compiler: $MOC]))
-AC_SUBST([MOC])])
-
-AC_DEFUN([AC_PROG_QT_UIC], [
-UIC=`pkg-config QtCore --variable=uic_location`
-AC_CHECK_FILE([$UIC], [],
- AC_MSG_ERROR([Can't find uic compiler: $UIC]))
-AC_SUBST([UIC])])
-
-AC_DEFUN([AC_PROG_QT_RCC], [
-RCC=`pkg-config QtCore --variable=exec_prefix`/bin/rcc
-AC_CHECK_FILE([$RCC], [],
- AC_MSG_ERROR([Can't find rcc compiler: $RCC]))
-AC_SUBST([RCC])])
diff --git a/makedeb b/makedeb
deleted file mode 100755
index 8d4b1992..00000000
--- a/makedeb
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/bash
-
-set -e
-
-if [ -z $1 ]; then
- echo "Please give a repository with the packaging in."
- exit 1
-fi
-
-repo=$1
-VERSION=$(make version)
-srcdir=$PWD
-pkgbuilddir=$srcdir/_package
-upstream_name=ContextKit
-deb_source_name=contextkit
-
-deb_orig_name=$deb_source_name'_'$VERSION.orig.tar.gz
-
-cd $srcdir && make dist distdir=$deb_source_name-$VERSION
-
-rm -rf $pkgbuilddir
-
-mkdir $pkgbuilddir
-mv $srcdir/$deb_source_name-$VERSION.tar.gz $pkgbuilddir/$deb_orig_name
-tar -C $pkgbuilddir -xzf $pkgbuilddir/$deb_orig_name
-
-git clone $repo $pkgbuilddir/$upstream_name-packaging
-
-cp -r $pkgbuilddir/$upstream_name-packaging/debian $pkgbuilddir/$deb_source_name-$VERSION/
-
-if cd $pkgbuilddir/$deb_source_name-$VERSION && dch -d -D harmattan; then
- read -p "Push this version to packaging? [y] "
- if [ "x$REPLY" = "x" -o "x$REPLY" = "xy" ]; then
- cp $pkgbuilddir/$deb_source_name-$VERSION/debian/changelog $pkgbuilddir/$upstream_name-packaging/debian/changelog
- cd $pkgbuilddir/$upstream_name-packaging
- git commit debian/changelog -m "New version"
- git push
- fi
- cd $pkgbuilddir/$deb_source_name-$VERSION/ && debuild -S -sa -d -us -uc
-fi
-
diff --git a/myfilter.conf b/myfilter.conf
deleted file mode 100644
index 38ef3870..00000000
--- a/myfilter.conf
+++ /dev/null
@@ -1,18 +0,0 @@
-# AsciiDoc filter for graphviz
-
-[svg-template]
-<div class="svg">
-<div class="title">{title}</div>
-<object type="image/svg+xml" data="{file}"></object>
-</div>
-
-[blockdef-filter]
-ifdef::backend-xhtml11[]
-dotty-style=template="svg-template",subs=(),posattrs=("style","file"),filter="dot -Tsvg -o{outdir}/{file}; echo"
-endif::backend-xhtml11[]
-
-[macros]
-(?su)[\\]?(?P<name>api):(?P<target>\S*?)(\[(?P<attrlist>.*?)\])=
-
-[api-inlinemacro]
-<a href="../{target}/index.html">{0=<tt>{target}</tt>}</a>
diff --git a/python/ContextKit/CTypesHelpers.py b/python/ContextKit/CTypesHelpers.py
deleted file mode 100644
index bada4e0d..00000000
--- a/python/ContextKit/CTypesHelpers.py
+++ /dev/null
@@ -1,65 +0,0 @@
-# From http://wwwx.cs.unc.edu/~gb/wp/blog/2007/02/11/ctypes-tricks/
-
-from ctypes import *
-
-def cfunc(name, dll, result, *args):
- '''build and apply a ctypes prototype complete with parameter flags'''
- atypes = []
- aflags = []
- for arg in args:
- atypes.append(arg[1])
- aflags.append((arg[2], arg[0]) + arg[3:])
- return CFUNCTYPE(result, *atypes)((name, dll), tuple(aflags))
-
-class ListPOINTER(object):
- '''Just like a POINTER but accept a list of ctype as an argument'''
- def __init__(self, etype):
- self.etype = etype
-
- def from_param(self, param):
- if isinstance(param, (list,tuple)):
- return (self.etype * len(param))(*param)
-
-class ListPOINTER2(object):
- '''Just like POINTER(POINTER(ctype)) but accept a list of lists of ctype'''
- def __init__(self, etype):
- self.etype = etype
-
- def from_param(self, param):
- if isinstance(param, (list,tuple)):
- val = (POINTER(self.etype) * len(param))()
- for i,v in enumerate(param):
- if isinstance(v, (list,tuple)):
- val[i] = (self.etype * len(v))(*v)
- else:
- raise TypeError, 'nested list or tuple required at %d' % i
- return val
- else:
- raise TypeError, 'list or tuple required'
-
-
-class ByRefArg(object):
- '''Just like a POINTER but accept an argument and pass it byref'''
- def __init__(self, atype):
- self.atype = atype
-
- def from_param(self, param):
- return byref(self.atype(param))
-
-# hack the ctypes.Structure class to include printing the fields
-class _Structure(Structure):
- def __repr__(self):
- '''Print the fields'''
- res = []
- for field in self._fields_:
- res.append('%s=%s' % (field[0], repr(getattr(self, field[0]))))
- return self.__class__.__name__ + '(' + ','.join(res) + ')'
- @classmethod
- def from_param(cls, obj):
- '''Magically construct from a tuple'''
- if isinstance(obj, cls):
- return obj
- if isinstance(obj, tuple):
- return cls(*obj)
- raise TypeError
-
diff --git a/python/ContextKit/ContextProvider.py b/python/ContextKit/ContextProvider.py
deleted file mode 100644
index 596fdbbb..00000000
--- a/python/ContextKit/ContextProvider.py
+++ /dev/null
@@ -1,60 +0,0 @@
-from ctypes import *
-from CTypesHelpers import *
-import sys
-
-_dll = CDLL("libcontextprovider.so.0")
-
-class ContextProvider:
- SUBSCRIPTION_CHANGED_CALLBACK = CFUNCTYPE(None, c_int, c_void_p)
-
- init = cfunc('context_provider_init', _dll, c_int,
- ('bus_type', c_int, 1),
- ('bus_name', c_char_p, 1))
- install_group = cfunc('context_provider_install_group', _dll, None,
- ('key_group', ListPOINTER (c_char_p), 1),
- ('clear_values_on_subscribe', c_int, 1),
- ('subscription_changed_cb', SUBSCRIPTION_CHANGED_CALLBACK, 1),
- ('last_cb_target', c_void_p, 1))
- install_key = cfunc('context_provider_install_key', _dll, None,
- ('key', c_char_p, 1),
- ('clear_values_on_subscribe', c_int, 1),
- ('subscription_changed_cb', SUBSCRIPTION_CHANGED_CALLBACK, 1),
- ('last_cb_target', c_void_p, 1))
-
- set_integer = cfunc('context_provider_set_integer', _dll, None,
- ('key', c_char_p, 1),
- ('val', c_int, 1))
- set_double = cfunc('context_provider_set_double', _dll, None,
- ('key', c_char_p, 1),
- ('val', c_double, 1))
- set_boolean = cfunc('context_provider_set_boolean', _dll, None,
- ('key', c_char_p, 1),
- ('val', c_int, 1))
- set_string = cfunc('context_provider_set_string', _dll, None,
- ('key', c_char_p, 1),
- ('val', c_char_p, 1))
- set_null = cfunc('context_provider_set_null', _dll, None,
- ('key', c_char_p, 1))
-
-if __name__ == "__main__":
- import gobject
- import dbus
- import dbus.service
- from dbus.mainloop.glib import DBusGMainLoop
- DBusGMainLoop(set_as_default=True)
- loop = gobject.MainLoop()
-
- def py_subscription_changed_cb (subscribe, d):
- if subscribe:
- print "group subscribed"
- else:
- print "group unsubscribed"
-
-
- ContextProvider.init(0, "org.freedesktop.ContextKit.Testing.Provider")
- subscription_changed_cb = ContextProvider.SUBSCRIPTION_CHANGED_CALLBACK(py_subscription_changed_cb)
- p = ContextProvider.install_group(["foo.bar", "foo.baz"], 1,
- subscription_changed_cb, None)
- ContextProvider.set_integer("foo.bar", 1)
- ContextProvider.set_null("foo.baz")
- loop.run()
diff --git a/python/ContextKit/__init__.py b/python/ContextKit/__init__.py
deleted file mode 100644
index e69de29b..00000000
--- a/python/ContextKit/__init__.py
+++ /dev/null
diff --git a/python/ContextKit/cltool.py b/python/ContextKit/cltool.py
deleted file mode 100644
index 0535b88c..00000000
--- a/python/ContextKit/cltool.py
+++ /dev/null
@@ -1,142 +0,0 @@
-#!/usr/bin/env python
-##
-## Copyright (C) 2008, 2009 Nokia. All rights reserved.
-##
-## Contact: Marius Vollmer <marius.vollmer@nokia.com>
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public License
-## version 2.1 as published by the Free Software Foundation.
-##
-## This library is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-## 02110-1301 USA
-
-import re
-import time
-from pprint import pprint
-from subprocess import Popen, PIPE
-from fcntl import fcntl, F_GETFL, F_SETFL
-import os
-import signal
-
-class CLTool:
- STDOUT = 1
- STDERR = 2
- def __init__(self, *cline):
- self.__process = Popen(cline, stdin=PIPE, stdout=PIPE, stderr=PIPE)
- self.__io = []
- self.last_output = ''
-
- def send(self, string):
- self.__io.append((0, string))
- print >>self.__process.stdin, string
- self.__process.stdin.flush()
-
- def expect(self, fileno, exp_str, timeout, wantdump = True):
- return self.expectAll(fileno, [exp_str], timeout, wantdump)
-
- # fileno: can be either CLTool.STDOUT or CLTool.STDERR
- # _exp_l: is a list of regexes and all of them has to match
- # timeout: the match has to be occur in this many seconds
- # wantdump: in case of error should we print a dump or not
- def expectAll(self, fileno, _exp_l, timeout, wantdump = True):
- exp_l = list(_exp_l)
- stream = 0
- if fileno == self.STDOUT: stream = self.__process.stdout
- if fileno == self.STDERR: stream = self.__process.stderr
- if stream == 0: return False
-
- # set the stream to nonblocking
- fd = stream.fileno()
- flags = fcntl(fd, F_GETFL)
- fcntl(fd, F_SETFL, flags | os.O_NONBLOCK)
-
- self.last_output = ""
- start_time = time.time()
- while True:
- try:
- line = stream.readline()
- if not line: # eof
- self.__io.append((fileno, "--------- STREAM UNEXPECTEDLY CLOSED -----------"))
- if wantdump:
- self.printio()
- print "Expected:"
- pprint(exp_l)
- self.__io.append((fileno, "--------- EXPECT ERR -----------"))
- return False
- line = line.rstrip()
- self.last_output += line + "\n"
- self.__io.append((fileno, line))
- except:
- time.sleep(0.1) # no data were available
- # enumerate all of the patterns and remove the matching ones
- i = 0
- while i < len(exp_l):
- # this is a hack, so you can have expressions like "\nwhole line\n"
- # and they will match even for the first line
- if re.search(exp_l[i], "\n" + self.last_output):
- del(exp_l[i])
- i -= 1
- i += 1
- if exp_l:
- if time.time() - start_time > timeout: # timeout
- if wantdump:
- self.printio()
- print "Expected:"
- pprint(exp_l)
- self.__io.append((fileno, "--------- EXPECT ERR -----------"))
- return False
- else:
- # if no more patterns to match, then we are done
- self.__io.append((fileno, "--------- EXPECT OK -----------"))
- return True
-
- def comment(self, st):
- self.__io.append((-1, st))
-
- def suspend(self):
- os.kill(self.__process.pid, signal.SIGSTOP)
-
- def resume(self):
- os.kill(self.__process.pid, signal.SIGCONT)
-
- def kill(self):
- os.system('../common/rec-kill.sh %d' % self.__process.pid)
- # can be changed to this, when python 2.6 is everywhere on maemo:
- #self.__process.kill()
-
- def close(self):
- # close the stdin of the process
- self.__process.stdin.close()
-
- def wait(self):
- return self.__process.wait()
-
- def printio(self):
- print
- print '----------------------------------------------------'
- for line in self.__io:
- if line[0] == 0:
- print "[IN] <<<", line[1]
- if line[0] == 1:
- print "[OU] >>>", line[1]
- if line[0] == 2:
- print "[ER] >>>", line[1]
- if line[0] == -1:
- print "[CM] ===", line[1]
- print '----------------------------------------------------'
-
- def wanted(name, type, value):
- return "\n%s = %s:%s\n" % (name, type, value)
- wanted = staticmethod(wanted)
-
- def wantedUnknown(name):
- return "\n%s is Unknown\n" % (name)
- wantedUnknown = staticmethod(wantedUnknown)
diff --git a/python/ContextKit/flexiprovider.py b/python/ContextKit/flexiprovider.py
deleted file mode 100644
index f5aee6db..00000000
--- a/python/ContextKit/flexiprovider.py
+++ /dev/null
@@ -1,179 +0,0 @@
-#!/usr/bin/python
-import os
-import sys
-import tempfile
-import subprocess
-import gobject
-import dbus, dbus.service, dbus.mainloop.glib
-import ContextProvider as CP
-
-class _property(object):
- """Kind-of a template for property types."""
- def __init__(self, datatype, default):
- self.datatype = datatype
- self.default = default
- self.name = None
- def __call__(self, name, initial_value=None):
- """Clones self, setting its name and initial value."""
- if initial_value is None:
- initial_value = self.default
- prop = _property(self.datatype, initial_value)
- prop.name = name
- return prop
-
-# Pre-defined types and their defaults.
-INT = _property('INT', 0)
-STRING = _property('STRING', '')
-DOUBLE = _property('DOUBLE', 0.0)
-TRUTH = _property('TRUTH', False)
-
-def xmlfor(busname='ctx.flexiprovider', bus='session', *props):
- """Generates a provider .xml document for the given properties
- (which are instances of _property)."""
- xml = ['<?xml version="1.0"?>\n'
- '<provider bus="%s" service="%s">' % (bus, busname)]
- for p in props:
- xml.append(' <key name="%s">\n'
- ' <type>%s</type>\n'
- ' <doc>A phony but very flexible property.</doc>\n'
- ' </key>' % (p.name, p.datatype))
- xml.append('</provider>\n')
- return '\n'.join(xml)
-
-def update_context_providers(xml, dir='.'):
- """Dumps the xml into $dir/context-provide.context."""
- if "CONTEXT_PROVIDE_REGISTRY_FILE" in os.environ:
- outfilename = os.environ["CONTEXT_PROVIDE_REGISTRY_FILE"]
- else:
- outfilename = dir + '/context-provide.context'
- if outfilename.find('/') != -1:
- tmpdir = outfilename[:outfilename.rindex('/')]
- else:
- tmpdir = '.'
- tmpfd, tmpfn = tempfile.mkstemp('.contexttemp', 'context-provide-', tmpdir)
- os.write(tmpfd, xml)
- os.close(tmpfd)
- os.rename(tmpfn, outfilename)
-
-class Flexiprovider(object):
- def stdin_ready(self, fd, cond):
- if cond & gobject.IO_ERR:
- self.loop.quit()
- return False
- # We assume that stdin is line-buffered (ie. readline() doesn't
- # block (too much)). It's true if it's a tty. If piping from
- # another program, do an entire line.
- # TODO maybe we should rather fix ourselves and accept arbitrary
- # amount of input (and accumulate lines ourselves).
- l = sys.stdin.readline()
- # If l is emtpy, we got EOF.
- if l == '':
- self.loop.quit()
- return False
- # Nevertheless, ignore emtpy lines.
- l = l.strip()
- if l == '':
- return True
- try:
- code = compile(l, '<input from stdin>', 'single')
- eval(code, {}, dict(INT=INT,
- STRING=STRING,
- TRUTH=TRUTH,
- DOUBLE=DOUBLE,
- set=self.set,
- get=self.get,
- reset=self.reset,
- quit=self.loop.quit,
- add=self.add_and_update,
- info=self.info))
- except:
- # We are ignoring errors.
- import traceback
- traceback.print_exc()
- return True
-
- def __init__(self, properties, name='ctx.flexiprovider', bus='session'):
- self.busname = name
- self.bus = bus
- self.loop = gobject.MainLoop()
- self.props = {}
- self.values = {}
- # Hook into libcontextprovider.
- self.setters = dict(INT=CP.ContextProvider.set_integer,
- STRING=CP.ContextProvider.set_string,
- DOUBLE=CP.ContextProvider.set_double,
- TRUTH=CP.ContextProvider.set_boolean)
- self.subscribed_cb = CP.ContextProvider.SUBSCRIPTION_CHANGED_CALLBACK(lambda x, y: None)
- retval = CP.ContextProvider.init(dict(session=0, system=1)[self.bus], self.busname)
- if retval == 0:
- raise Exception("libcontextprovider.init returned false")
- # Add properties and set the initial values.
- for p in properties:
- self.addproperty(p)
- self.update_providers()
- dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
-
- def get(self, prop):
- return self.values.get(prop, None)
-
- def set(self, prop, val):
- if prop not in self.props:
- return
- self.values[prop] = val
- if val is None:
- CP.ContextProvider.set_null(prop)
- else:
- self.setters[self.props[prop].datatype](prop, val)
-
- def reset(self, prop):
- if prop not in self.props:
- return
- self.set(prop, self.props[prop].default)
-
- def addproperty(self, prop):
- self.props[prop.name] = prop
- self.values[prop.name] = prop.default
- CP.ContextProvider.install_key(prop.name, 0, self.subscribed_cb, None)
- self.reset(prop.name)
-
- def add_and_update(self, prop):
- self.addproperty(prop)
- self.update_providers()
-
- def update_providers(self):
- # Don't update the registry if we are being run as a commander.
- if self.busname == 'org.freedesktop.ContextKit.Commander':
- return
- update_context_providers(xmlfor(self.busname, self.bus, *self.props.values()))
-
- def info(self):
- """Dumps information about currently provided properties."""
- for p in self.props.values():
- print p.datatype.ljust(8), p.name.ljust(20), \
- self.values[p.name], '(', p.default, ')'
-
- def interactive(self):
- """Runs the provider interactively, accepting the following
- commands from the standard input (note that this is Python
- syntax, and it gets eval()ed):
-
- set(property, value): sets the given property
- get(property): prints the value of the property
- reset(property): resets the property
- add(propertydesc): adds a new property
- info(): prints properties and their values
- quit(): stops the whole thing
-
- The provider will stop also if stdin is closed.
- """
- # Reopen stdout to be line-buffered.
- sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 1)
- gobject.io_add_watch(sys.stdin.fileno(),
- gobject.IO_IN | gobject.IO_HUP | gobject.IO_ERR,
- self.stdin_ready)
- self.loop.run()
-
- def run(self):
- self.loop.run()
-
-__all__ = ('INT', 'STRING', 'DOUBLE', 'TRUTH', 'Flexiprovider')
diff --git a/python/Makefile.am b/python/Makefile.am
deleted file mode 100644
index 7bb32d4c..00000000
--- a/python/Makefile.am
+++ /dev/null
@@ -1,10 +0,0 @@
-dist_man_MANS = context-provide.1
-
-dist_bin_SCRIPTS = context-provide context-rlwrap
-
-pkgpython_PYTHON = ContextKit/flexiprovider.py \
- ContextKit/ContextProvider.py \
- ContextKit/CTypesHelpers.py ContextKit/__init__.py \
- ContextKit/cltool.py
-
-EXTRA_DIST = README simple.py complex.py
diff --git a/python/README b/python/README
deleted file mode 100644
index b3eac15a..00000000
--- a/python/README
+++ /dev/null
@@ -1,18 +0,0 @@
-These directories contain a simple Python binding for the
-libcontextprovider library and a test provider tool. To use them, you
-need to ensure that pkg-config works wrt this library. One way is to
-install everything into the appropriate locations, or alternatively, set
-PKG_CONFIG_PATH to contain the directories with the .pc files. The
-latter is preferred during development.
-
-Flexiprovider is a Python module/tool for testing Context Framework
-clients. It allows to define properties and provides means to change
-their values during runtime.
-
-There are two examples: `simple.py' and `complex.py', which you may use
-to get a clue how to write your own provider. The `context-provide'
-script allows you to start up a provider from the command line, without
-writing any Python code.
-
-Command line usage of the 'context-provide' tool is documented in
-the manpage context-provide.1
diff --git a/python/complex.py b/python/complex.py
deleted file mode 100755
index c44b1b25..00000000
--- a/python/complex.py
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/python
-"""A more complex provider with a horroristic theme."""
-
-from ContextKit.flexiprovider import *
-import gobject
-
-count = 0
-def there_are_more():
- global count
- count += 1
- fp.set('Zombie.Count', count)
- if count == 2:
- fp.add_and_update(STRING('You.Shout'))
- fp.set('You.Shout', 'omg zombies!')
- if count == 5:
- fp.set('Life.isInDanger', True)
- return True
-
-gobject.timeout_add_seconds(2, there_are_more)
-fp = Flexiprovider([INT('Zombie.Count'), TRUTH('Life.isInDanger')],
- 'omg.zombies', 'session')
-fp.run()
diff --git a/python/context-provide b/python/context-provide
deleted file mode 100755
index 8b47467f..00000000
--- a/python/context-provide
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/usr/bin/python
-"""context-provide -- start up a provider from the command line
-
-Usage: context-provide [BUSTYPE:]PROVIDERNAME [TYPE NAME INITVALUE ...]
-
-Starts up a Flexiprovider with the given PROVIDERNAME, serving
-properties specified in the arguments. TYPE is one of 'int', 'string',
-'double', 'truth'. BUSTYPE is either 'system', 'session' (or void,
-defaulting to the latter).
-"""
-
-import sys
-import os
-from ContextKit.flexiprovider import *
-
-# A custom conversion function since bool('False') == True.
-def str2bool(str):
- if not str in ['True', 'False']:
- raise ValueError("Invalid literal for bool conversion: '%s'" % str)
- return bool(eval(str))
-
-types = dict(int=(INT, int),
- truth=(TRUTH, str2bool),
- string=(STRING, str),
- double=(DOUBLE, float))
-properties = []
-
-if len(sys.argv) < 2:
- print >>sys.stderr, 'This tool is deprecated, and will be removed really soon!'
- print >>sys.stderr, 'Please start using the --v2 option and read context-provide-v2(1)!'
- print >>sys.stderr
- print __doc__
- sys.exit(1)
-sys.argv.pop(0)
-
-# Support for new context-provide
-if sys.argv[0] == "--v2":
- os.execvp("context-provide-internal", [ "context-provide" ] + sys.argv)
-
-print >>sys.stderr, 'This tool is deprecated, and will be removed really soon!'
-print >>sys.stderr, 'Please start using the --v2 option and read context-provide-v2(1)!'
-
-busaddress = sys.argv.pop(0).split(':')
-if len(busaddress) == 1:
- busaddress.insert(0, 'session')
-if busaddress[0] not in ('session', 'system'):
- raise Exception("Invalid bus type '%s', use session or system" % busaddress[0])
-if len(sys.argv) % 3 != 0:
- raise Exception('Number of command line parameters must be 1 + 3 * number of properties')
-
-while len(sys.argv) >= 3:
- datatype, name, initvalue = sys.argv[:3]
- datatype = datatype.lower()
- del sys.argv[:3]
- if datatype not in types:
- raise Exception('Type %s not recognized' % datatype)
- cookiecutter, conversion = types[datatype]
- properties.append(cookiecutter(name, conversion(initvalue)))
-
-try:
- provider = Flexiprovider(properties, busaddress[1], busaddress[0])
-except ImportError:
- raise IOError("Could not instantiate Flexiprovider")
- sys.exit(1)
-provider.interactive()
-
diff --git a/python/context-provide.1 b/python/context-provide.1
deleted file mode 100644
index 312c5814..00000000
--- a/python/context-provide.1
+++ /dev/null
@@ -1,84 +0,0 @@
-.TH context-provide 1 May-28-2009
-
-.SH NAME
-context-provide
-- a simple provider to provide context properties for testing/debugging
-
-.SH SYNOPSIS
-.B context-provide\fR [\fIBUSTYPE\fR:]\fIPROVIDERNAME\fR [\fITYPE\fR \fINAME\fR \fIINITVALUE\fR]...
-
-.SH THIS IS DEPRECATED
-The old synopsis of context-provide is deprecated and shouldn't be
-used in new projects. In a later version of ContextKit, it won't be
-provided at all. Please use the new synopsis, which is available by
-using --v2 as the first parameter. The new synopsis is documented in
-context-provide-v2(1).
-
-.SH DESCRIPTION
-context-provide is a tool for testing/debugging ContextKit clients.
-It allows you to define properties and change their values during
-runtime.
-
-.SH PARAMETERS
-.TP 8
-BUSTYPE
-can be session (the default) or system, depending on which bus you
-want to run the provider on.
-.TP 8
-PROVIDERNAME
-service name of the provider on DBus.
-.TP 8
-TYPE NAME INITVALUE
-with these triplets you can define initial properties. Type can be one of int, string,
-double, truth.
-
-.SH ENVIRONMENT VARIABLES
-.TP 8
-CONTEXT_PROVIDE_REGISTRY_FILE
-path to output the definitions of the added properties (either via
-commands or arguments). If not defined, the definitions will go
-to ./context-provide.context.
-
-.SH COMMAND LINE INTERFACE
-The interactive mode stops on closing stdin, and supports the following
-commands (note that this is Python syntax, and it gets eval()-ed):
-
- set(property, value): sets the given property, if value
- is None, it will be sent as Unknown
- get(property): prints the value of the property
- reset(property): resets the property
- add(TYPE(property[, initvalue])):
- adds a new property, where TYPE has to be capitalized
- info(): prints properties and their values
- quit(): stops the whole thing
-
-Please note that this is Python shell, so you have to quote strings,
-use parantheses after function names, etc.
-
-If you want readline support, please have a look at the package rlwrap.
-
-.SH EXAMPLES
-Starts up a provider, initially having a single integer property named
-an.example with the default value of 42.
-
- ./context-provide my.provider.name int an.example 42
-
-Starts up the provider on the system bus without any properties, then
-add some through the command line interface:
-
- ./context-provide system:org.bottomdrawer.kit2000
- add(INT('example.int', 33))
- add(STRING('example.string'))
- set('example.string', 'value1')
- set('example.string', 'value2')
- set('example.int', None)
-
-.SH RUNNING IN SCRATCHBOX
-Inside scratchbox the default python version currently is 2.3, but
-context-provide needs 2.5, so you have to run it like this:
- python2.5 /usr/bin/context-provide
-
-You can check the current python version with python -V
-
-.SH SEE ALSO
-context-listen(1), context-provide-v2(1)
diff --git a/python/context-rlwrap b/python/context-rlwrap
deleted file mode 100755
index b490f4c9..00000000
--- a/python/context-rlwrap
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/python
-"""context-rlwrap -- a simple readline wrapper
-
-Usage: context-rlwrap [some other program and args]
-
-Wraps the plain stdin-based input mechanism of the given program into a
-convenient readline-based one.
-"""
-
-import os
-import sys
-import signal
-import readline
-
-if len(sys.argv) < 2:
- sys.exit(__doc__)
-rfd, wfd = os.pipe()
-pid = os.fork()
-if pid == 0:
- os.close(wfd)
- os.dup2(rfd, 0)
- sys.argv.pop(0)
- os.execvp(sys.argv[0], sys.argv)
-else:
- def childied(n, f):
- p, ec = os.waitpid(pid, 0)
- sys.exit(ec)
- signal.signal(signal.SIGCHLD, childied)
- os.close(rfd)
- try:
- while True:
- l = raw_input()
- os.write(wfd, l + '\n')
- except (KeyboardInterrupt, SystemExit): raise
- except: pass
diff --git a/python/simple.py b/python/simple.py
deleted file mode 100755
index a74cecdf..00000000
--- a/python/simple.py
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/python
-"""
-A very simple example of the Flexiprovider. Exports three properties
-initially.
-"""
-
-from ContextKit.flexiprovider import *
-
-Flexiprovider([INT('location.altitude'),
- STRING('my.name', 'flexi'),
- TRUTH('is.out.there')],
- 'ctx.flexi.provider', 'session').interactive()
diff --git a/spec/.gitignore b/spec/.gitignore
deleted file mode 100644
index ac5b0381..00000000
--- a/spec/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-context.valid.stamp
-introspect/
-context-provider-schema.html
-context-properties.html
-contextkit.html
-
diff --git a/spec/Context.owl b/spec/Context.owl
deleted file mode 100644
index 83b4f70e..00000000
--- a/spec/Context.owl
+++ /dev/null
@@ -1,7828 +0,0 @@
-<?xml version="1.0"?>
-
-
-<!DOCTYPE rdf:RDF [
- <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
- <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
- <!ENTITY owl2xml "http://www.w3.org/2006/12/owl2-xml#" >
- <!ENTITY ical "http://www.w3.org/2002/12/cal/ical#" >
- <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
- <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
- <!ENTITY Context "http://www.semanticweb.org/ontologies/2009/2/Context.owl#" >
- <!ENTITY DeliveryContext "http://www.w3.org/2007/uwa/ontologies/DeliveryContext.owl#" >
- <!ENTITY Spatio "http://www.semanticweb.org/ontologies/2009/2/Context.owl#Spatio&#8722;" >
-]>
-
-
-<rdf:RDF xmlns="http://www.semanticweb.org/ontologies/2009/2/Context.owl#"
- xml:base="http://www.semanticweb.org/ontologies/2009/2/Context.owl"
- xmlns:owl2xml="http://www.w3.org/2006/12/owl2-xml#"
- xmlns:Context="http://www.semanticweb.org/ontologies/2009/2/Context.owl#"
- xmlns:DeliveryContext="http://www.w3.org/2007/uwa/ontologies/DeliveryContext.owl#"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
- xmlns:Spatio="&Context;Spatio&#8722;"
- xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:owl="http://www.w3.org/2002/07/owl#"
- xmlns:ical="http://www.w3.org/2002/12/cal/ical#">
- <owl:Ontology rdf:about="">
- <owl:imports rdf:resource=""/>
- <owl:imports rdf:resource="http://www.w3.org/2007/uwa/ontologies/DeliveryContext.owl"/>
- </owl:Ontology>
-
-
-
- <!--
- ///////////////////////////////////////////////////////////////////////////////////////
- //
- // Object Properties
- //
- ///////////////////////////////////////////////////////////////////////////////////////
- -->
-
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#GPSModuleAttached -->
-
- <owl:ObjectProperty rdf:about="#GPSModuleAttached"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#IMStatusAvailable -->
-
- <owl:ObjectProperty rdf:about="#IMStatusAvailable">
- <rdfs:comment
- >User&#39;s IM Status is available.</rdfs:comment>
- <rdfs:range rdf:resource="#Messaging"/>
- <rdfs:domain rdf:resource="#Person"/>
- </owl:ObjectProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#chargesuggestion -->
-
- <owl:ObjectProperty rdf:about="#chargesuggestion">
- <rdfs:range rdf:resource="#ChargeLocation"/>
- <rdfs:domain rdf:resource="#ChargingSuggested"/>
- </owl:ObjectProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#currentSituation -->
-
- <owl:ObjectProperty rdf:about="#currentSituation">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#UserCurrentSituation"/>
- <rdfs:range>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#SituationStatus"/>
- <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
- </owl:Restriction>
- </rdfs:range>
- </owl:ObjectProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#currentWeather -->
-
- <owl:ObjectProperty rdf:about="#currentWeather">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Application"/>
- <rdfs:range rdf:resource="#Weather"/>
- </owl:ObjectProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasAlarmSetasOn -->
-
- <owl:ObjectProperty rdf:about="#hasAlarmSetasOn">
- <rdfs:comment
- >User has set Alarm.</rdfs:comment>
- <rdfs:range rdf:resource="#Alarm"/>
- <rdfs:domain rdf:resource="#Person"/>
- </owl:ObjectProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasAssistedHighAccuracy -->
-
- <owl:ObjectProperty rdf:about="#hasAssistedHighAccuracy">
- <rdfs:range rdf:resource="#GPSModule"/>
- <rdfs:subPropertyOf rdf:resource="#GPSModuleAttached"/>
- <rdfs:domain rdf:resource="#Location"/>
- <owl:equivalentProperty rdf:resource="#hasAssistedLowerAccuracy"/>
- <owl:equivalentProperty rdf:resource="#hasHighAccuracy"/>
- <owl:equivalentProperty rdf:resource="#hasLowerAccuracy"/>
- </owl:ObjectProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasAssistedLowerAccuracy -->
-
- <owl:ObjectProperty rdf:about="#hasAssistedLowerAccuracy">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:range rdf:resource="#GPSModule"/>
- <rdfs:subPropertyOf rdf:resource="#GPSModuleAttached"/>
- <rdfs:domain rdf:resource="#Location"/>
- <owl:equivalentProperty rdf:resource="#hasHighAccuracy"/>
- <owl:equivalentProperty rdf:resource="#hasLowerAccuracy"/>
- </owl:ObjectProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasConnectivity -->
-
- <owl:ObjectProperty rdf:about="#hasConnectivity">
- <rdfs:range rdf:resource="#Bearers"/>
- <rdfs:range>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasConnectivity"/>
- <owl:someValuesFrom rdf:resource="#Bearers"/>
- </owl:Restriction>
- </rdfs:range>
- </owl:ObjectProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasHighAccuracy -->
-
- <owl:ObjectProperty rdf:about="#hasHighAccuracy">
- <rdfs:range rdf:resource="#GPSModule"/>
- <rdfs:subPropertyOf rdf:resource="#GPSModuleAttached"/>
- <rdfs:domain rdf:resource="#Location"/>
- <owl:equivalentProperty rdf:resource="#hasLowerAccuracy"/>
- </owl:ObjectProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasLowerAccuracy -->
-
- <owl:ObjectProperty rdf:about="#hasLowerAccuracy">
- <rdfs:range rdf:resource="#GPSModule"/>
- <rdfs:subPropertyOf rdf:resource="#GPSModuleAttached"/>
- <rdfs:domain rdf:resource="#Location"/>
- </owl:ObjectProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasMorningSituation -->
-
- <owl:ObjectProperty rdf:about="#hasMorningSituation">
- <rdfs:comment
- >Morning situation (see Context_Aware_Situation_Manager.ppt, slide 4).</rdfs:comment>
- <rdfs:range rdf:resource="#MorningSituation"/>
- <rdfs:domain rdf:resource="#Person"/>
- </owl:ObjectProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasNearByContacts -->
-
- <owl:ObjectProperty rdf:about="#hasNearByContacts">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:comment
- >Contacts information about nearby persons.</rdfs:comment>
- <rdfs:domain rdf:resource="#NearbyPeople"/>
- <rdfs:range rdf:resource="#vCard"/>
- </owl:ObjectProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasNearbyDevices -->
-
- <owl:ObjectProperty rdf:about="#hasNearbyDevices">
- <rdfs:domain rdf:resource="#ComputingContext"/>
- <rdfs:range rdf:resource="#NearbyDevices"/>
- </owl:ObjectProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasNearbyPeripherals -->
-
- <owl:ObjectProperty rdf:about="#hasNearbyPeripherals">
- <rdfs:domain rdf:resource="#ComputingContext"/>
- <rdfs:range rdf:resource="#Peripherals"/>
- </owl:ObjectProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasNoConnectivity -->
-
- <owl:ObjectProperty rdf:about="#hasNoConnectivity">
- <rdfs:range rdf:resource="#Bearers"/>
- <rdfs:range>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasNoConnectivity"/>
- <owl:onClass rdf:resource="#Bearers"/>
- <owl:maxCardinality rdf:datatype="&xsd;nonNegativeInteger">0</owl:maxCardinality>
- </owl:Restriction>
- </rdfs:range>
- <rdfs:range>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasNoConnectivity"/>
- <owl:onClass rdf:resource="#Bearers"/>
- <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">0</owl:minCardinality>
- </owl:Restriction>
- </rdfs:range>
- </owl:ObjectProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasNotSubscribed -->
-
- <owl:ObjectProperty rdf:about="#hasNotSubscribed">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdf:type rdf:resource="&owl;InverseFunctionalProperty"/>
- <rdfs:range rdf:resource="#Application"/>
- <rdfs:domain rdf:resource="#UnSubscribedApplications"/>
- </owl:ObjectProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasSubscribed -->
-
- <owl:ObjectProperty rdf:about="#hasSubscribed">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdf:type rdf:resource="&owl;InverseFunctionalProperty"/>
- <rdfs:range rdf:resource="#Application"/>
- <rdfs:domain rdf:resource="#SubscribedApplications"/>
- </owl:ObjectProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasSubscribedJamNotification -->
-
- <owl:ObjectProperty rdf:about="#hasSubscribedJamNotification">
- <rdfs:range rdf:resource="#JamNotification"/>
- <rdfs:domain rdf:resource="#Person"/>
- </owl:ObjectProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasUserId -->
-
- <owl:ObjectProperty rdf:about="#hasUserId">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdf:type rdf:resource="&owl;InverseFunctionalProperty"/>
- <rdfs:comment
- >Each Person should have userID.</rdfs:comment>
- <rdfs:domain rdf:resource="#Person"/>
- </owl:ObjectProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasUsualRoute -->
-
- <owl:ObjectProperty rdf:about="#hasUsualRoute">
- <rdfs:domain rdf:resource="#Person"/>
- <rdfs:range rdf:resource="#UsualRoute"/>
- </owl:ObjectProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasWeatherForecast -->
-
- <owl:ObjectProperty rdf:about="#hasWeatherForecast">
- <rdfs:domain rdf:resource="#Application"/>
- <rdfs:domain rdf:resource="#Situations"/>
- <rdfs:range rdf:resource="#WeatherForecast"/>
- </owl:ObjectProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#userContext -->
-
- <owl:ObjectProperty rdf:about="#userContext">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:comment
- >User context, such as the user&#8217;s profile, location, people nearby and current social situation. Naturally also additional properties can be added here.</rdfs:comment>
- <rdfs:domain rdf:resource="#Person"/>
- <rdfs:range rdf:resource="#UsersContext"/>
- </owl:ObjectProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#userSituation -->
-
- <owl:ObjectProperty rdf:about="#userSituation">
- <rdfs:comment
- >Current user Situation.</rdfs:comment>
- <rdfs:domain rdf:resource="#Person"/>
- <rdfs:range rdf:resource="#Situations"/>
- </owl:ObjectProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#usersCurrentLocation -->
-
- <owl:ObjectProperty rdf:about="#usersCurrentLocation">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#CurrentLocation"/>
- <rdfs:range rdf:resource="&DeliveryContext;Location"/>
- </owl:ObjectProperty>
-
-
-
- <!--
- ///////////////////////////////////////////////////////////////////////////////////////
- //
- // Data properties
- //
- ///////////////////////////////////////////////////////////////////////////////////////
- -->
-
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ADR -->
-
- <owl:DatatypeProperty rdf:about="#ADR">
- <rdfs:comment
- >To specify the components of the delivery address for the vCard object. A single structured text value, separated by the SEMI-COLON character. The structured type value consists of a sequence of address components. The component values MUST be specified in their corresponding position. The structured type value corresponds, in sequence, to the post office box; the extended address; the street address; the locality (e.g., city); the region (e.g., state or province); the postal code; the country name. When a component value is missing, the associated component separator MUST still be specified.</rdfs:comment>
- <rdfs:domain rdf:resource="#vCard"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#AGENT -->
-
- <owl:DatatypeProperty rdf:about="#AGENT">
- <rdfs:comment
- >To specify information about another person who will act on behalf of the individual or resource associated with the vCard.</rdfs:comment>
- <rdfs:domain rdf:resource="#vCard"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#AccessoryStatus -->
-
- <owl:DatatypeProperty rdf:about="#AccessoryStatus">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Accessories"/>
- <rdfs:range rdf:resource="&rdfs;Literal"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Altitude -->
-
- <owl:DatatypeProperty rdf:about="#Altitude">
- <rdfs:comment
- >Altitude component of this coordinate.Represents height in meters relative to the current datum(WGS-84).</rdfs:comment>
- <rdfs:domain rdf:resource="#Position"/>
- <rdfs:subPropertyOf rdf:resource="#PositionVariables"/>
- <rdfs:range rdf:resource="&xsd;double"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#AssistantName -->
-
- <owl:DatatypeProperty rdf:about="#AssistantName">
- <rdfs:domain rdf:resource="#Assistant"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#AssistantTelephone -->
-
- <owl:DatatypeProperty rdf:about="#AssistantTelephone">
- <rdfs:domain rdf:resource="#Assistant"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Autumn -->
-
- <owl:DatatypeProperty rdf:about="#Autumn">
- <owl:equivalentProperty rdf:resource="#Spring"/>
- <owl:equivalentProperty rdf:resource="#Summer"/>
- <rdfs:domain rdf:resource="#Time"/>
- <owl:equivalentProperty rdf:resource="#Winter"/>
- <rdfs:subPropertyOf rdf:resource="#timeOfYear"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#BDAY -->
-
- <owl:DatatypeProperty rdf:about="#BDAY">
- <rdfs:comment
- >To specify the birth date of the object the vCard represents.</rdfs:comment>
- <rdfs:domain rdf:resource="#vCard"/>
- <rdfs:range rdf:resource="&xsd;date"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#BatteryStatus -->
-
- <owl:DatatypeProperty rdf:about="#BatteryStatus">
- <rdfs:comment
- >http://saescr005.ext.nokia.com/scrumworks/webreport/5MTMxMT</rdfs:comment>
- <rdfs:domain rdf:resource="#BatteryLevel"/>
- <rdfs:range rdf:resource="&xsd;integer"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#BrowserUsageCount -->
-
- <owl:DatatypeProperty rdf:about="#BrowserUsageCount">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#BrowserUsageFrequency"/>
- <rdfs:range rdf:resource="&xsd;long"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#CATEGORIES -->
-
- <owl:DatatypeProperty rdf:about="#CATEGORIES">
- <rdfs:comment
- >To specify application category information about the vCard.</rdfs:comment>
- <rdfs:domain rdf:resource="#vCard"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#CID -->
-
- <owl:DatatypeProperty rdf:about="#CID">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:range rdf:resource="&xsd;unsignedLong"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#CLASS -->
-
- <owl:DatatypeProperty rdf:about="#CLASS">
- <rdfs:comment
- >To specify the access classification for a vCard object.</rdfs:comment>
- <rdfs:domain rdf:resource="#vCard"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#CPULoadStatus -->
-
- <owl:DatatypeProperty rdf:about="#CPULoadStatus">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#CPULoad"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#CalendarUID -->
-
- <owl:DatatypeProperty rdf:about="#CalendarUID">
- <rdfs:comment
- >Unique identifier for a calendar event.</rdfs:comment>
- <rdfs:domain rdf:resource="#iCalendar"/>
- <rdfs:range rdf:resource="&xsd;int"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#CalendarUsageCount -->
-
- <owl:DatatypeProperty rdf:about="#CalendarUsageCount">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#CalendarUsageFrequency"/>
- <rdfs:range rdf:resource="&xsd;long"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Call -->
-
- <owl:DatatypeProperty rdf:about="#Call">
- <rdfs:domain rdf:resource="#Event"/>
- <rdfs:subPropertyOf rdf:resource="#EventTypes"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Cohabitating -->
-
- <owl:DatatypeProperty rdf:about="#Cohabitating">
- <rdfs:domain rdf:resource="#MaritalStatus"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Connected -->
-
- <owl:DatatypeProperty rdf:about="#Connected">
- <rdfs:comment
- >Connected using some bearer (can be asked if needed, but note that some applications might have some restrictions concerning bearers like VoIP is not feasible in GSM network and so on).
-
-Relates to use case &#39;Visualizing the situation&#39; in ContextUseCaseCandidatesOP20090303.xls</rdfs:comment>
- <rdfs:domain rdf:resource="#ConnectivityStatus"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ContactsUsageCount -->
-
- <owl:DatatypeProperty rdf:about="#ContactsUsageCount">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:comment
- >Counter for Contacts application usage.</rdfs:comment>
- <rdfs:domain rdf:resource="#ContactsUsageFrequency"/>
- <rdfs:range rdf:resource="&xsd;long"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Country -->
-
- <owl:DatatypeProperty rdf:about="#Country">
- <rdfs:comment
- >Country (can short or long name).</rdfs:comment>
- <rdfs:domain rdf:resource="#Addresses"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Current -->
-
- <owl:DatatypeProperty rdf:about="#Current">
- <rdfs:domain rdf:resource="#Event"/>
- <rdfs:subPropertyOf rdf:resource="#EventTypes"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Department -->
-
- <owl:DatatypeProperty rdf:about="#Department">
- <rdfs:comment
- >Department of the Organization where person works.</rdfs:comment>
- <rdfs:domain rdf:resource="#Organizations"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Disconnected -->
-
- <owl:DatatypeProperty rdf:about="#Disconnected">
- <rdfs:domain rdf:resource="#ConnectivityStatus"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#EMAIL -->
-
- <owl:DatatypeProperty rdf:about="#EMAIL">
- <rdfs:comment
- >To specify the electronic mail address for communication with the object the vCard represents.</rdfs:comment>
- <rdfs:domain rdf:resource="#vCard"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#EmailPrimary -->
-
- <owl:DatatypeProperty rdf:about="#EmailPrimary">
- <rdfs:comment
- >Boolean value indicating whether this email address is the primary or preferred email address for this person. Supported values: &#8220;true&#8221;, &#8220;false&#8221;.</rdfs:comment>
- <rdfs:domain rdf:resource="#Emails"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#EmailType -->
-
- <owl:DatatypeProperty rdf:about="#EmailType">
- <rdfs:comment
- >Type of email address. Enumeration. Supported values: &#8220;home&#8221;, &#8220;work&#8221;.</rdfs:comment>
- <rdfs:domain rdf:resource="#Emails"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#EmailUsageCount -->
-
- <owl:DatatypeProperty rdf:about="#EmailUsageCount">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#EmailUsageFrequency"/>
- <rdfs:range rdf:resource="&xsd;long"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#EmailValue -->
-
- <owl:DatatypeProperty rdf:about="#EmailValue">
- <rdfs:comment
- >Value of email address. Singular property.</rdfs:comment>
- <rdfs:domain rdf:resource="#Emails"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Engaged -->
-
- <owl:DatatypeProperty rdf:about="#Engaged">
- <rdfs:domain rdf:resource="#MaritalStatus"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#EventEndTime -->
-
- <owl:DatatypeProperty rdf:about="#EventEndTime">
- <rdfs:domain rdf:resource="#EventStructure"/>
- <rdfs:range rdf:resource="&xsd;int"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#EventStartTime -->
-
- <owl:DatatypeProperty rdf:about="#EventStartTime">
- <rdfs:domain rdf:resource="#EventStructure"/>
- <rdfs:range rdf:resource="&xsd;int"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#EventTitle -->
-
- <owl:DatatypeProperty rdf:about="#EventTitle">
- <rdfs:domain rdf:resource="#EventStructure"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#EventType -->
-
- <owl:DatatypeProperty rdf:about="#EventType">
- <rdfs:domain rdf:resource="#EventStructure"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#EventTypes -->
-
- <owl:DatatypeProperty rdf:about="#EventTypes">
- <rdfs:domain rdf:resource="#Event"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#EventURI -->
-
- <owl:DatatypeProperty rdf:about="#EventURI">
- <rdfs:domain rdf:resource="#EventStructure"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#FN -->
-
- <owl:DatatypeProperty rdf:about="#FN">
- <rdfs:comment
- >To specify the formatted text corresponding to the name of the object the vCard represents. This type is based on the semantics of the X.520
-Common Name attribute. The property MUST be present in the vCard object.</rdfs:comment>
- <rdfs:domain rdf:resource="#vCard"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#FamilyName -->
-
- <owl:DatatypeProperty rdf:about="#FamilyName">
- <rdfs:domain rdf:resource="#PersonName"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Female -->
-
- <owl:DatatypeProperty rdf:about="#Female">
- <rdfs:domain rdf:resource="#Gender"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#From -->
-
- <owl:DatatypeProperty rdf:about="#From">
- <rdfs:comment
- >UID of Ovi user who triggered the notification. Value is maintained by the system and cannot be modified by user. Singular property.</rdfs:comment>
- <rdfs:domain rdf:resource="#Notifications"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#GEO -->
-
- <owl:DatatypeProperty rdf:about="#GEO">
- <rdfs:comment
- >To specify information related to the global positioning of the object the vCard represents.</rdfs:comment>
- <rdfs:domain rdf:resource="#vCard"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#GPSModuleAvailable -->
-
- <owl:DatatypeProperty rdf:about="#GPSModuleAvailable"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#GivenName -->
-
- <owl:DatatypeProperty rdf:about="#GivenName">
- <rdfs:domain rdf:resource="#PersonName"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#GroupETag -->
-
- <owl:DatatypeProperty rdf:about="#GroupETag">
- <rdfs:comment
- >Opaque string that changes whenever contents of resource changes. Value can be used in conditional operations. Read-only (value managed by the system).</rdfs:comment>
- <rdfs:domain rdf:resource="#Groups"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#GroupID -->
-
- <owl:DatatypeProperty rdf:about="#GroupID">
- <rdfs:domain rdf:resource="#Groups"/>
- <rdfs:range rdf:resource="&xsd;int"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#GroupName -->
-
- <owl:DatatypeProperty rdf:about="#GroupName">
- <rdfs:domain rdf:resource="#Groups"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Heading -->
-
- <owl:DatatypeProperty rdf:about="#Heading">
- <rdfs:comment
- >Angle of heading in degrees counting clockwise relative to true north.</rdfs:comment>
- <rdfs:domain rdf:resource="#PositionFix"/>
- <rdfs:range rdf:resource="&xsd;double"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#HeadingAccuracy -->
-
- <owl:DatatypeProperty rdf:about="#HeadingAccuracy">
- <rdfs:comment
- >An estimate of the accuracy of the current heading in degrees.</rdfs:comment>
- <rdfs:domain rdf:resource="#PositionFix"/>
- <rdfs:range rdf:resource="&xsd;double"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Home -->
-
- <owl:DatatypeProperty rdf:about="#Home">
- <rdfs:domain rdf:resource="#Places"/>
- <rdfs:domain rdf:resource="#Situations"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#HonoricPrefix -->
-
- <owl:DatatypeProperty rdf:about="#HonoricPrefix">
- <rdfs:domain rdf:resource="#PersonName"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#HonoricSuffix -->
-
- <owl:DatatypeProperty rdf:about="#HonoricSuffix">
- <rdfs:domain rdf:resource="#PersonName"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#HorizontalAccuracy -->
-
- <owl:DatatypeProperty rdf:about="#HorizontalAccuracy">
- <rdfs:comment
- >Represents accuracy estimate in meters of the horizontal portion of the underlying coordinate.</rdfs:comment>
- <rdfs:domain rdf:resource="#Position"/>
- <rdfs:subPropertyOf rdf:resource="#PositionVariables"/>
- <rdfs:range rdf:resource="&xsd;double"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#IMSPrimary -->
-
- <owl:DatatypeProperty rdf:about="#IMSPrimary">
- <rdfs:comment
- >Boolean value indicating whether this address is the primary or preferred address for this person. Supported values: &#8220;true&#8221;, &#8220;false&#8221;.</rdfs:comment>
- <rdfs:domain rdf:resource="#Ims"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#IMSType -->
-
- <owl:DatatypeProperty rdf:about="#IMSType">
- <rdfs:comment
- >Boolean value indicating whether this address is the primary or preferred address for this person. Supported values: &#8220;true&#8221;, &#8220;false&#8221;.</rdfs:comment>
- <rdfs:domain rdf:resource="#Ims"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#IMSValue -->
-
- <owl:DatatypeProperty rdf:about="#IMSValue">
- <rdfs:comment
- >Value of IMPP address. Singular property.</rdfs:comment>
- <rdfs:domain rdf:resource="#Ims"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#IMStatus -->
-
- <owl:DatatypeProperty rdf:about="#IMStatus">
- <rdfs:domain rdf:resource="#Messaging"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Individual -->
-
- <owl:DatatypeProperty rdf:about="#Individual">
- <rdfs:domain rdf:resource="#MaritalStatus"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#JOBTITLE -->
-
- <owl:DatatypeProperty rdf:about="#JOBTITLE">
- <rdfs:comment
- >To specify the job title, functional position or function of the object the vCard represents.</rdfs:comment>
- <rdfs:domain rdf:resource="#vCard"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#KEY -->
-
- <owl:DatatypeProperty rdf:about="#KEY">
- <rdfs:comment
- >To specify a public key or authentication certificate associated with the object that the vCard represents</rdfs:comment>
- <rdfs:domain rdf:resource="#vCard"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#LABEL -->
-
- <owl:DatatypeProperty rdf:about="#LABEL">
- <rdfs:comment
- >To specify the formatted text corresponding to delivery address of the object the vCard represents.</rdfs:comment>
- <rdfs:domain rdf:resource="#vCard"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#LOGO -->
-
- <owl:DatatypeProperty rdf:about="#LOGO">
- <rdfs:comment
- >To specify a graphic image of a logo associated with the object the vCard represents.</rdfs:comment>
- <rdfs:domain rdf:resource="#vCard"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Latitude -->
-
- <owl:DatatypeProperty rdf:about="#Latitude">
- <rdfs:comment
- >Latitude component of the location coordinate.Specifies latitude in WGS-84 decimal degrees notation. Out of range values are normalized to range. Positive values indicate position above the Conventional Terrestrial Pole(CTP) equator.</rdfs:comment>
- <rdfs:domain rdf:resource="#Position"/>
- <rdfs:subPropertyOf rdf:resource="#PositionVariables"/>
- <rdfs:range rdf:resource="&xsd;double"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#LocalTimeStamp -->
-
- <owl:DatatypeProperty rdf:about="#LocalTimeStamp">
- <rdfs:comment
- >LocalTimeStamp is timestamped (local phone time) when position is received in SAPI (or high level layer). Local time stamp is gaurantied in every location fix retrieval.</rdfs:comment>
- <rdfs:domain rdf:resource="#PositionFix"/>
- <rdfs:range rdf:resource="&xsd;dateTime"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Locality -->
-
- <owl:DatatypeProperty rdf:about="#Locality">
- <rdfs:domain rdf:resource="#Addresses"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Longitude -->
-
- <owl:DatatypeProperty rdf:about="#Longitude">
- <rdfs:comment
- >Longitude component of the location coordinate.Specifies latitude in WGS-84 decimal degrees notation. Out of range values are normalized to range. The reference meridian is the zero meridian defined by Bureau International de l&#39;Heure(BIH).</rdfs:comment>
- <rdfs:subPropertyOf rdf:resource="#PositionVariables"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#MAILER -->
-
- <owl:DatatypeProperty rdf:about="#MAILER">
- <rdfs:comment
- >To specify the type of electronic mail software that is used by the individual associated with the vCard.</rdfs:comment>
- <rdfs:domain rdf:resource="#vCard"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#MagneticCource -->
-
- <owl:DatatypeProperty rdf:about="#MagneticCource">
- <rdfs:comment
- >The current direction in degrees to the magnetic north.</rdfs:comment>
- <rdfs:domain rdf:resource="#PositionFix"/>
- <rdfs:range rdf:resource="&xsd;double"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#MagneticVariation -->
-
- <owl:DatatypeProperty rdf:about="#MagneticVariation">
- <rdfs:comment
- >The magnetic course error in degrees.</rdfs:comment>
- <rdfs:domain rdf:resource="#PositionFix"/>
- <rdfs:range rdf:resource="&xsd;double"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Male -->
-
- <owl:DatatypeProperty rdf:about="#Male">
- <rdfs:domain rdf:resource="#Gender"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Married -->
-
- <owl:DatatypeProperty rdf:about="#Married">
- <rdfs:domain rdf:resource="#MaritalStatus"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#MemberCount -->
-
- <owl:DatatypeProperty rdf:about="#MemberCount">
- <rdfs:comment
- >Count of members that belong to the group. Value is maintained by the system and cannot be modified by user. Singular property.</rdfs:comment>
- <rdfs:domain rdf:resource="#Groups"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#MemoryStatus -->
-
- <owl:DatatypeProperty rdf:about="#MemoryStatus">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:comment
- >Status of the memory: used, free etc.</rdfs:comment>
- <rdfs:domain rdf:resource="#Memory"/>
- <rdfs:range rdf:resource="&rdfs;Literal"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#MiddleName -->
-
- <owl:DatatypeProperty rdf:about="#MiddleName">
- <rdfs:domain rdf:resource="#PersonName"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Morning -->
-
- <owl:DatatypeProperty rdf:about="#Morning">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#MorningSituation"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#N -->
-
- <owl:DatatypeProperty rdf:about="#N">
- <rdfs:comment
- >To specify the components of the name of the object the vCard represents. The structured type value corresponds, in sequence, to the Family Name, Given Name, Additional Names, Honorific Prefixes, and Honorific Suffixes. The text components are separated by the SEMI-COLON character (ASCII decimal 59). Individual text components can include multiple text values (e.g., multiple Additional Names) separated by the COMMA character (ASCII decimal 44). This type is based on the semantics of the X.520 individual name attributes. The property MUST be present in the vCard object.</rdfs:comment>
- <rdfs:domain rdf:resource="#vCard"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#NAuth -->
-
- <owl:DatatypeProperty rdf:about="#NAuth">
- <rdfs:comment
- >Authentication of the consumer user (the end-user who has Nokia Account credentials) and the consumer application (the SW that uses the People API) is done using OAuth-based delegated authentication.</rdfs:comment>
- <rdfs:domain rdf:resource="#AuthorizationChallenge"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#NICKNAME -->
-
- <owl:DatatypeProperty rdf:about="#NICKNAME">
- <rdfs:comment
- >To specify the text corresponding to the nickname of the object the vCard represents. The nickname is the descriptive name given instead of or in addition to the one belonging to a person, place, or thing. It can also be used to specify a familiar form of a proper name specified by the FN or N types.</rdfs:comment>
- <rdfs:domain rdf:resource="#vCard"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#NOTE -->
-
- <owl:DatatypeProperty rdf:about="#NOTE">
- <rdfs:comment
- >To specify supplemental information or a comment that is associated with the vCard.</rdfs:comment>
- <rdfs:domain rdf:resource="#vCard"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#NameOfOrganization -->
-
- <owl:DatatypeProperty rdf:about="#NameOfOrganization">
- <rdfs:domain rdf:resource="#Organizations"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Next -->
-
- <owl:DatatypeProperty rdf:about="#Next">
- <rdfs:domain rdf:resource="#Event"/>
- <rdfs:subPropertyOf rdf:resource="#EventTypes"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Night -->
-
- <owl:DatatypeProperty rdf:about="#Night">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Places"/>
- <rdfs:domain rdf:resource="#Situations"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#NotificationID -->
-
- <owl:DatatypeProperty rdf:about="#NotificationID">
- <rdfs:domain rdf:resource="#Notifications"/>
- <rdfs:range rdf:resource="&xsd;int"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#OAuth -->
-
- <owl:DatatypeProperty rdf:about="#OAuth">
- <rdfs:domain rdf:resource="#AuthorizationResponse"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#OAuthConsumerKey -->
-
- <owl:DatatypeProperty rdf:about="#OAuthConsumerKey">
- <rdfs:domain rdf:resource="#AuthorizationResponse"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#OAuthNonce -->
-
- <owl:DatatypeProperty rdf:about="#OAuthNonce">
- <rdfs:domain rdf:resource="#AuthorizationResponse"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#OAuthSignature -->
-
- <owl:DatatypeProperty rdf:about="#OAuthSignature">
- <rdfs:domain rdf:resource="#AuthorizationResponse"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#OAuthSignatureMethod -->
-
- <owl:DatatypeProperty rdf:about="#OAuthSignatureMethod">
- <rdfs:domain rdf:resource="#AuthorizationResponse"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#OAuthTimestamp -->
-
- <owl:DatatypeProperty rdf:about="#OAuthTimestamp">
- <rdfs:domain rdf:resource="#AuthorizationResponse"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#OAuthToken -->
-
- <owl:DatatypeProperty rdf:about="#OAuthToken">
- <rdfs:domain rdf:resource="#AuthorizationResponse"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#OAuthVersion -->
-
- <owl:DatatypeProperty rdf:about="#OAuthVersion">
- <rdfs:domain rdf:resource="#AuthorizationResponse"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ORG -->
-
- <owl:DatatypeProperty rdf:about="#ORG">
- <rdfs:comment
- >To specify the organizational name and units associated with the vCard.</rdfs:comment>
- <rdfs:domain rdf:resource="#vCard"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PHOTO -->
-
- <owl:DatatypeProperty rdf:about="#PHOTO">
- <rdfs:comment
- >To specify an image or photograph information that annotates some aspect of the object the vCard represents.</rdfs:comment>
- <rdfs:domain rdf:resource="#vCard"/>
- <rdfs:range rdf:resource="&xsd;anyType"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PID -->
-
- <owl:DatatypeProperty rdf:about="#PID">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Application"/>
- <rdfs:subPropertyOf rdf:resource="#currentApplication"/>
- <rdfs:range rdf:resource="&xsd;integer"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PR -->
-
- <owl:DatatypeProperty rdf:about="#PR">
- <rdfs:domain rdf:resource="#Application"/>
- <rdfs:subPropertyOf rdf:resource="#currentApplication"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PROID -->
-
- <owl:DatatypeProperty rdf:about="#PROID">
- <rdfs:comment
- >To specify the identifier for the product that created the vCard object.</rdfs:comment>
- <rdfs:domain rdf:resource="#vCard"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PersonID -->
-
- <owl:DatatypeProperty rdf:about="#PersonID">
- <rdfs:comment
- >UID of a Person object. Singular property. Read-only (value managed by the system).</rdfs:comment>
- <rdfs:domain rdf:resource="#Person"/>
- <rdfs:range rdf:resource="&xsd;int"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PhoneNumberType_Work -->
-
- <owl:DatatypeProperty rdf:about="#PhoneNumberType_Work">
- <rdfs:domain rdf:resource="#PhoneNumbers"/>
- <rdfs:subPropertyOf rdf:resource="#PhonenumberType"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PhoneNumberValue -->
-
- <owl:DatatypeProperty rdf:about="#PhoneNumberValue">
- <rdfs:domain rdf:resource="#PhoneNumbers"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PhonenumberType -->
-
- <owl:DatatypeProperty rdf:about="#PhonenumberType">
- <rdfs:comment
- >Type of telephone number. Enumeration. Supported values: &#8220;home&#8221;, &#8220;work&#8221;. &#8220;mobile&#8221;, &#8220;fax&#8221;, &#8220;pager&#8221;.</rdfs:comment>
- <rdfs:domain rdf:resource="#PhoneNumbers"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PhonenumberType_Fax -->
-
- <owl:DatatypeProperty rdf:about="#PhonenumberType_Fax">
- <rdfs:domain rdf:resource="#PhoneNumbers"/>
- <rdfs:subPropertyOf rdf:resource="#PhonenumberType"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PhonenumberType_Home -->
-
- <owl:DatatypeProperty rdf:about="#PhonenumberType_Home">
- <rdfs:domain rdf:resource="#PhoneNumbers"/>
- <rdfs:subPropertyOf rdf:resource="#PhonenumberType"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PhonenumberType_Mobile -->
-
- <owl:DatatypeProperty rdf:about="#PhonenumberType_Mobile">
- <rdfs:domain rdf:resource="#PhoneNumbers"/>
- <rdfs:subPropertyOf rdf:resource="#PhonenumberType"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PhotoHuge -->
-
- <owl:DatatypeProperty rdf:about="#PhotoHuge">
- <rdfs:comment
- >Huge photo of person (composite attribute; see components below). Resolution: 150x150.</rdfs:comment>
- <rdfs:domain rdf:resource="#PhotoSize"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PhotoHugeData -->
-
- <owl:DatatypeProperty rdf:about="#PhotoHugeData">
- <rdfs:comment
- >Base64 encoded representation of a photo. Format: JPEG. Singular property.</rdfs:comment>
- <rdfs:subPropertyOf rdf:resource="#PhotoHuge"/>
- <rdfs:domain rdf:resource="#PhotoSize"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PhotoLarge -->
-
- <owl:DatatypeProperty rdf:about="#PhotoLarge">
- <rdfs:comment
- >Large photo of person (composite attribute; see components below). Resolution: 64x64.</rdfs:comment>
- <rdfs:domain rdf:resource="#PhotoSize"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PhotoLargeData -->
-
- <owl:DatatypeProperty rdf:about="#PhotoLargeData">
- <rdfs:comment
- >Base64 encoded representation of a photo. Format: JPEG. Singular property.</rdfs:comment>
- <rdfs:subPropertyOf rdf:resource="#PhotoLarge"/>
- <rdfs:domain rdf:resource="#PhotoSize"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PointingDirection -->
-
- <owl:DatatypeProperty rdf:about="#PointingDirection">
- <rdfs:domain rdf:resource="#Magnetometer"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PositionVariables -->
-
- <owl:DatatypeProperty rdf:about="#PositionVariables">
- <rdfs:domain rdf:resource="#Position"/>
- <rdfs:range rdf:resource="&xsd;double"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PostalCode -->
-
- <owl:DatatypeProperty rdf:about="#PostalCode">
- <rdfs:domain rdf:resource="#Addresses"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Primary -->
-
- <owl:DatatypeProperty rdf:about="#Primary">
- <rdfs:comment
- >Boolean value indicating whether this instance of URL is the primary or preferred URL for this person. Supported values: &#8220;true&#8221;, &#8220;false&#8221;.</rdfs:comment>
- <rdfs:domain rdf:resource="#Urls"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PrimaryPhonenumber -->
-
- <owl:DatatypeProperty rdf:about="#PrimaryPhonenumber">
- <rdfs:comment
- >Boolean value indicating whether this phone number is the primary or preferred number for this person. Supported values: &#8220;true&#8221;, &#8220;false&#8221;.</rdfs:comment>
- <rdfs:domain rdf:resource="#PhoneNumbers"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PrinterName -->
-
- <owl:DatatypeProperty rdf:about="#PrinterName">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:comment
- >Printer name or some other identifier of the printer.</rdfs:comment>
- <rdfs:domain rdf:resource="#Peripherals"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Profiles -->
-
- <owl:DatatypeProperty rdf:about="#Profiles"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#REV -->
-
- <owl:DatatypeProperty rdf:about="#REV">
- <rdfs:comment
- >To specify revision information about the current vCard.</rdfs:comment>
- <rdfs:domain rdf:resource="#vCard"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ROLE -->
-
- <owl:DatatypeProperty rdf:about="#ROLE">
- <rdfs:comment
- >To specify information concerning the role, occupation, or business category of the object the vCard represents.</rdfs:comment>
- <rdfs:domain rdf:resource="#vCard"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Received -->
-
- <owl:DatatypeProperty rdf:about="#Received">
- <rdfs:comment
- >Date&amp;time when the notification was received. Value is maintained by the system and cannot be modified by user. Singular property.</rdfs:comment>
- <rdfs:domain rdf:resource="#Notifications"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Region -->
-
- <owl:DatatypeProperty rdf:about="#Region">
- <rdfs:domain rdf:resource="#Addresses"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#SMSUsageCount -->
-
- <owl:DatatypeProperty rdf:about="#SMSUsageCount">
- <rdfs:domain rdf:resource="#SMSUsageFrequency"/>
- <rdfs:range rdf:resource="&xsd;long"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#SORT_STRING -->
-
- <owl:DatatypeProperty rdf:about="#SORT_STRING">
- <rdfs:comment
- >To specify the family name or given name text to be used for national-language-specific sorting of the FN and N types.</rdfs:comment>
- <rdfs:domain rdf:resource="#vCard"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#SOUND -->
-
- <owl:DatatypeProperty rdf:about="#SOUND">
- <rdfs:comment
- >To specify a digital sound content information that annotates some aspect of the vCard. By default this type is used to specify the proper pronunciation of the name type value of the vCard.</rdfs:comment>
- <rdfs:domain rdf:resource="#vCard"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#SatelliteNumView -->
-
- <owl:DatatypeProperty rdf:about="#SatelliteNumView">
- <rdfs:comment
- >The number of satellites on which the positioning modules has information.</rdfs:comment>
- <rdfs:domain rdf:resource="#PositionFix"/>
- <rdfs:range rdf:resource="&xsd;double"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#SatelliteNumViewUsed -->
-
- <owl:DatatypeProperty rdf:about="#SatelliteNumViewUsed">
- <rdfs:comment
- >Number of satellites being used to obtain a position fix.</rdfs:comment>
- <rdfs:domain rdf:resource="#PositionFix"/>
- <rdfs:range rdf:resource="&xsd;double"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Separated -->
-
- <owl:DatatypeProperty rdf:about="#Separated">
- <rdfs:domain rdf:resource="#MaritalStatus"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Shopping -->
-
- <owl:DatatypeProperty rdf:about="#Shopping">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Places"/>
- <rdfs:domain rdf:resource="#Situations"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Single -->
-
- <owl:DatatypeProperty rdf:about="#Single">
- <rdfs:domain rdf:resource="#MaritalStatus"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#SituationStatus -->
-
- <owl:DatatypeProperty rdf:about="#SituationStatus"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#SoundLevel -->
-
- <owl:DatatypeProperty rdf:about="#SoundLevel">
- <rdfs:domain rdf:resource="#Alarm"/>
- <rdfs:range rdf:resource="&xsd;int"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Speed -->
-
- <owl:DatatypeProperty rdf:about="#Speed">
- <rdfs:comment
- >Current speed in meters per second.</rdfs:comment>
- <rdfs:domain rdf:resource="#PositionFix"/>
- <rdfs:range rdf:resource="&xsd;double"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#SpeedAccuracy -->
-
- <owl:DatatypeProperty rdf:about="#SpeedAccuracy">
- <rdfs:domain rdf:resource="#PositionFix"/>
- <rdfs:range rdf:resource="&xsd;double"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#SportsFitness -->
-
- <owl:DatatypeProperty rdf:about="#SportsFitness">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Places"/>
- <rdfs:domain rdf:resource="#Situations"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Spring -->
-
- <owl:DatatypeProperty rdf:about="#Spring">
- <owl:equivalentProperty rdf:resource="#Summer"/>
- <rdfs:domain rdf:resource="#Time"/>
- <owl:equivalentProperty rdf:resource="#Winter"/>
- <rdfs:subPropertyOf rdf:resource="#timeOfYear"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#StreetAddress -->
-
- <owl:DatatypeProperty rdf:about="#StreetAddress">
- <rdfs:domain rdf:resource="#Addresses"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Summer -->
-
- <owl:DatatypeProperty rdf:about="#Summer">
- <rdfs:domain rdf:resource="#Time"/>
- <owl:equivalentProperty rdf:resource="#Winter"/>
- <rdfs:subPropertyOf rdf:resource="#timeOfYear"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#TEL -->
-
- <owl:DatatypeProperty rdf:about="#TEL">
- <rdfs:comment
- >To specify the telephone number for telephony communication with the object the vCard represents.</rdfs:comment>
- <rdfs:domain rdf:resource="#vCard"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#TZ -->
-
- <owl:DatatypeProperty rdf:about="#TZ">
- <rdfs:comment
- >To specify information related to the time zone of the object the vCard represents.</rdfs:comment>
- <rdfs:domain rdf:resource="#vCard"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#TelephoneUsageCount -->
-
- <owl:DatatypeProperty rdf:about="#TelephoneUsageCount">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#TelephoneUsageFrequency"/>
- <rdfs:range rdf:resource="&xsd;long"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Title -->
-
- <owl:DatatypeProperty rdf:about="#Title">
- <rdfs:domain rdf:resource="#Organizations"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#To -->
-
- <owl:DatatypeProperty rdf:about="#To">
- <rdfs:comment
- >UID of Ovi user who is the receiver of the notification. Value is maintained by the system and cannot be modified by user. Singular property.</rdfs:comment>
- <rdfs:domain rdf:resource="#Notifications"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Traveling -->
-
- <owl:DatatypeProperty rdf:about="#Traveling">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Places"/>
- <rdfs:domain rdf:resource="#Situations"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#TypeOfAddress -->
-
- <owl:DatatypeProperty rdf:about="#TypeOfAddress">
- <rdfs:domain rdf:resource="#Addresses"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#UID -->
-
- <owl:DatatypeProperty rdf:about="#UID">
- <rdfs:comment
- >To specify a value that represents a globally unique identifier corresponding to the individual or resource associated with the vCard.</rdfs:comment>
- <rdfs:domain rdf:resource="#vCard"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#URI -->
-
- <owl:DatatypeProperty rdf:about="#URI">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#LastMusic"/>
- <rdfs:range rdf:resource="&xsd;anyURI"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#URL -->
-
- <owl:DatatypeProperty rdf:about="#URL">
- <rdfs:comment
- >To specify a uniform resource locator associated with the object that the vCard refers to.</rdfs:comment>
- <rdfs:domain rdf:resource="#vCard"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#URLType -->
-
- <owl:DatatypeProperty rdf:about="#URLType">
- <rdfs:comment
- >Type of URL. Enumeration. Supported values: &#8220;home&#8221;, &#8220;work&#8221;.</rdfs:comment>
- <rdfs:domain rdf:resource="#Urls"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#URLType_Home -->
-
- <owl:DatatypeProperty rdf:about="#URLType_Home">
- <rdfs:subPropertyOf rdf:resource="#URLType"/>
- <rdfs:domain rdf:resource="#Urls"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#URLType_Work -->
-
- <owl:DatatypeProperty rdf:about="#URLType_Work">
- <rdfs:subPropertyOf rdf:resource="#URLType"/>
- <rdfs:domain rdf:resource="#Urls"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#UTCTimeStamp -->
-
- <owl:DatatypeProperty rdf:about="#UTCTimeStamp">
- <rdfs:comment
- >UTCTimeStamp is exact time from the position technology used. UTC timestamp could optionally present in location fix, as some of underlying technologies might not be capable to retrieve this data.</rdfs:comment>
- <rdfs:domain rdf:resource="#PositionFix"/>
- <rdfs:range rdf:resource="&xsd;dateTime"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#UserID -->
-
- <owl:DatatypeProperty rdf:about="#UserID">
- <rdfs:domain rdf:resource="#Application"/>
- <rdfs:domain rdf:resource="#Users"/>
- <rdfs:range rdf:resource="&xsd;int"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#VERSION -->
-
- <owl:DatatypeProperty rdf:about="#VERSION">
- <rdfs:comment
- >To specify the version of the vCard specification used to format this vCard.</rdfs:comment>
- <rdfs:domain rdf:resource="#vCard"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Value -->
-
- <owl:DatatypeProperty rdf:about="#Value">
- <rdfs:comment
- >Value/address of URL. Singular property.</rdfs:comment>
- <rdfs:domain rdf:resource="#Urls"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#VerticalAccuracy -->
-
- <owl:DatatypeProperty rdf:about="#VerticalAccuracy">
- <rdfs:comment
- >Represents accuracy estimate in meters of the vertical portion of the underlying coordinate.</rdfs:comment>
- <rdfs:domain rdf:resource="#Position"/>
- <rdfs:subPropertyOf rdf:resource="#PositionVariables"/>
- <rdfs:range rdf:resource="&xsd;double"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Widowed -->
-
- <owl:DatatypeProperty rdf:about="#Widowed">
- <rdfs:domain rdf:resource="#MaritalStatus"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Winter -->
-
- <owl:DatatypeProperty rdf:about="#Winter">
- <rdfs:domain rdf:resource="#Time"/>
- <rdfs:subPropertyOf rdf:resource="#timeOfYear"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Working -->
-
- <owl:DatatypeProperty rdf:about="#Working">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Places"/>
- <rdfs:domain rdf:resource="#Situations"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#activeContentItem -->
-
- <owl:DatatypeProperty rdf:about="#activeContentItem">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Application"/>
- <rdfs:subPropertyOf rdf:resource="#currentApplication"/>
- <rdfs:range rdf:resource="&xsd;anyURI"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#afternoon -->
-
- <owl:DatatypeProperty rdf:about="#afternoon">
- <rdfs:domain rdf:resource="#Time"/>
- <owl:equivalentProperty rdf:resource="#evening"/>
- <owl:equivalentProperty rdf:resource="#eveningNight"/>
- <owl:equivalentProperty rdf:resource="#midnight"/>
- <owl:equivalentProperty rdf:resource="#morning"/>
- <owl:equivalentProperty rdf:resource="#morningNight"/>
- <rdfs:subPropertyOf rdf:resource="#timeOfDay"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#alarmSet -->
-
- <owl:DatatypeProperty rdf:about="#alarmSet">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Alarm"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#albumArtURI -->
-
- <owl:DatatypeProperty rdf:about="#albumArtURI">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#LastMusic"/>
- <rdfs:range rdf:resource="&xsd;anyURI"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#applicationName -->
-
- <owl:DatatypeProperty rdf:about="#applicationName">
- <rdfs:domain rdf:resource="#Application"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#applicationUser -->
-
- <owl:DatatypeProperty rdf:about="#applicationUser">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Application"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#atHome -->
-
- <owl:DatatypeProperty rdf:about="#atHome">
- <rdfs:subPropertyOf rdf:resource="#SituationStatus"/>
- <rdfs:domain rdf:resource="#Status"/>
- <owl:equivalentProperty rdf:resource="#atOffice"/>
- <owl:equivalentProperty rdf:resource="#atWork"/>
- <owl:equivalentProperty rdf:resource="#inMeeting"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#atOffice -->
-
- <owl:DatatypeProperty rdf:about="#atOffice">
- <rdfs:subPropertyOf rdf:resource="#SituationStatus"/>
- <rdfs:domain rdf:resource="#Status"/>
- <owl:equivalentProperty rdf:resource="#atWork"/>
- <owl:equivalentProperty rdf:resource="#inMeeting"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#atWork -->
-
- <owl:DatatypeProperty rdf:about="#atWork">
- <rdfs:subPropertyOf rdf:resource="#SituationStatus"/>
- <rdfs:domain rdf:resource="#Status"/>
- <owl:equivalentProperty rdf:resource="#inMeeting"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#available -->
-
- <owl:DatatypeProperty rdf:about="#available">
- <rdfs:subPropertyOf rdf:resource="#IMStatus"/>
- <rdfs:domain rdf:resource="#Messaging"/>
- <owl:equivalentProperty rdf:resource="#busy"/>
- <owl:equivalentProperty rdf:resource="#notAvailable"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#busy -->
-
- <owl:DatatypeProperty rdf:about="#busy">
- <rdfs:subPropertyOf rdf:resource="#IMStatus"/>
- <rdfs:domain rdf:resource="#Messaging"/>
- <owl:equivalentProperty rdf:resource="#notAvailable"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#callNumber -->
-
- <owl:DatatypeProperty rdf:about="#callNumber">
- <rdfs:domain rdf:resource="#PhoneNumbers"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#callStartTime -->
-
- <owl:DatatypeProperty rdf:about="#callStartTime">
- <rdfs:range rdf:resource="&xsd;time"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#capacity -->
-
- <owl:DatatypeProperty rdf:about="#capacity">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Battery"/>
- <rdfs:range rdf:resource="&xsd;integer"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#command -->
-
- <owl:DatatypeProperty rdf:about="#command">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Application"/>
- <rdfs:subPropertyOf rdf:resource="#currentApplication"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#condition -->
-
- <owl:DatatypeProperty rdf:about="#condition">
- <rdfs:domain rdf:resource="#Weather"/>
- <rdfs:domain rdf:resource="#WeatherForecast"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#currentApplication -->
-
- <owl:DatatypeProperty rdf:about="#currentApplication">
- <rdfs:domain rdf:resource="#Application"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#currentProfile -->
-
- <owl:DatatypeProperty rdf:about="#currentProfile">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#ProfileName"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#deviceUpTime -->
-
- <owl:DatatypeProperty rdf:about="#deviceUpTime">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Usage"/>
- <rdfs:range rdf:resource="&xsd;integer"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#displayFacingDown -->
-
- <owl:DatatypeProperty rdf:about="#displayFacingDown">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Orientation"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#displayFacingUp -->
-
- <owl:DatatypeProperty rdf:about="#displayFacingUp">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Orientation"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#endTime -->
-
- <owl:DatatypeProperty rdf:about="#endTime">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#LastMusic"/>
- <rdfs:range rdf:resource="&xsd;time"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#evening -->
-
- <owl:DatatypeProperty rdf:about="#evening">
- <rdfs:domain rdf:resource="#Time"/>
- <owl:equivalentProperty rdf:resource="#eveningNight"/>
- <owl:equivalentProperty rdf:resource="#midnight"/>
- <owl:equivalentProperty rdf:resource="#morning"/>
- <owl:equivalentProperty rdf:resource="#morningNight"/>
- <rdfs:subPropertyOf rdf:resource="#timeOfDay"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#eveningNight -->
-
- <owl:DatatypeProperty rdf:about="#eveningNight">
- <rdfs:domain rdf:resource="#Time"/>
- <owl:equivalentProperty rdf:resource="#midnight"/>
- <owl:equivalentProperty rdf:resource="#morning"/>
- <owl:equivalentProperty rdf:resource="#morningNight"/>
- <rdfs:subPropertyOf rdf:resource="#timeOfDay"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#externalTotal -->
-
- <owl:DatatypeProperty rdf:about="#externalTotal">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Memory"/>
- <rdfs:subPropertyOf rdf:resource="#MemoryStatus"/>
- <rdfs:range rdf:resource="&xsd;integer"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#externalUsed -->
-
- <owl:DatatypeProperty rdf:about="#externalUsed">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Memory"/>
- <rdfs:subPropertyOf rdf:resource="#MemoryStatus"/>
- <rdfs:range rdf:resource="&xsd;integer"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#extrnalFree -->
-
- <owl:DatatypeProperty rdf:about="#extrnalFree">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Memory"/>
- <rdfs:subPropertyOf rdf:resource="#MemoryStatus"/>
- <rdfs:range rdf:resource="&xsd;integer"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#general -->
-
- <owl:DatatypeProperty rdf:about="#general">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#ProfileName"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasBTHeadset -->
-
- <owl:DatatypeProperty rdf:about="#hasBTHeadset">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:subPropertyOf rdf:resource="#AccessoryStatus"/>
- <rdfs:domain rdf:resource="#BTHeadset"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasBTStereoHeadset -->
-
- <owl:DatatypeProperty rdf:about="#hasBTStereoHeadset">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:subPropertyOf rdf:resource="#AccessoryStatus"/>
- <rdfs:domain rdf:resource="#BTStereoHeadset"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasCamera -->
-
- <owl:DatatypeProperty rdf:about="#hasCamera">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:subPropertyOf rdf:resource="#AccessoryStatus"/>
- <rdfs:domain rdf:resource="#Camera"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasCarDock -->
-
- <owl:DatatypeProperty rdf:about="#hasCarDock">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:comment
- >Device is connected to the car docking station.</rdfs:comment>
- <rdfs:subPropertyOf rdf:resource="#AccessoryStatus"/>
- <rdfs:domain rdf:resource="#CarDock"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasConferenceCamera -->
-
- <owl:DatatypeProperty rdf:about="#hasConferenceCamera">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:subPropertyOf rdf:resource="#AccessoryStatus"/>
- <rdfs:domain rdf:resource="#ConferenceCamera"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasEventTitle -->
-
- <owl:DatatypeProperty rdf:about="#hasEventTitle"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasExternalCard -->
-
- <owl:DatatypeProperty rdf:about="#hasExternalCard">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:subPropertyOf rdf:resource="#AccessoryStatus"/>
- <rdfs:domain rdf:resource="#ExternalCard"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasFMReceiver -->
-
- <owl:DatatypeProperty rdf:about="#hasFMReceiver">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:subPropertyOf rdf:resource="#AccessoryStatus"/>
- <rdfs:domain rdf:resource="#FMReceiver"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasFMTransmitter -->
-
- <owl:DatatypeProperty rdf:about="#hasFMTransmitter">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:subPropertyOf rdf:resource="#AccessoryStatus"/>
- <rdfs:domain rdf:resource="#FMTransmitter"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasHeadset -->
-
- <owl:DatatypeProperty rdf:about="#hasHeadset">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:subPropertyOf rdf:resource="#AccessoryStatus"/>
- <rdfs:domain rdf:resource="#Headset"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasKeyboard -->
-
- <owl:DatatypeProperty rdf:about="#hasKeyboard">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:subPropertyOf rdf:resource="#AccessoryStatus"/>
- <rdfs:domain rdf:resource="#Keyboard"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasMagnetometer -->
-
- <owl:DatatypeProperty rdf:about="#hasMagnetometer">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:subPropertyOf rdf:resource="#AccessoryStatus"/>
- <rdfs:domain rdf:resource="#Magnetometer"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasMicrophone -->
-
- <owl:DatatypeProperty rdf:about="#hasMicrophone">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:subPropertyOf rdf:resource="#AccessoryStatus"/>
- <rdfs:domain rdf:resource="#Microphone"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasMouse -->
-
- <owl:DatatypeProperty rdf:about="#hasMouse">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:subPropertyOf rdf:resource="#AccessoryStatus"/>
- <rdfs:domain rdf:resource="#Mouse"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasMultiTouchScreen -->
-
- <owl:DatatypeProperty rdf:about="#hasMultiTouchScreen">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:subPropertyOf rdf:resource="#AccessoryStatus"/>
- <rdfs:domain rdf:resource="#MultiTouchScreen"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#hasProximitySensor -->
-
- <owl:DatatypeProperty rdf:about="#hasProximitySensor">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:subPropertyOf rdf:resource="#AccessoryStatus"/>
- <rdfs:domain rdf:resource="#ProximitySensor"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#humidity -->
-
- <owl:DatatypeProperty rdf:about="#humidity">
- <rdfs:comment
- >Humidity in percent.</rdfs:comment>
- <rdfs:domain rdf:resource="#Weather"/>
- <rdfs:domain rdf:resource="#WeatherForecast"/>
- <rdfs:range rdf:resource="&xsd;int"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#icCreatingContent -->
-
- <owl:DatatypeProperty rdf:about="#icCreatingContent">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#CurrentActivity"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#inActiveUse -->
-
- <owl:DatatypeProperty rdf:about="#inActiveUse">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Usage"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#inCar -->
-
- <owl:DatatypeProperty rdf:about="#inCar">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Situations"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#inLandscape -->
-
- <owl:DatatypeProperty rdf:about="#inLandscape">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Orientation"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#inMeeting -->
-
- <owl:DatatypeProperty rdf:about="#inMeeting">
- <rdfs:subPropertyOf rdf:resource="#SituationStatus"/>
- <rdfs:domain rdf:resource="#Status"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#inPortrait -->
-
- <owl:DatatypeProperty rdf:about="#inPortrait">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#DirectUI"/>
- <rdfs:domain rdf:resource="#Orientation"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#inUserHand -->
-
- <owl:DatatypeProperty rdf:about="#inUserHand">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Orientation"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#internalFree -->
-
- <owl:DatatypeProperty rdf:about="#internalFree">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Memory"/>
- <rdfs:subPropertyOf rdf:resource="#MemoryStatus"/>
- <rdfs:range rdf:resource="&xsd;integer"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#internalTotal -->
-
- <owl:DatatypeProperty rdf:about="#internalTotal">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Memory"/>
- <rdfs:subPropertyOf rdf:resource="#MemoryStatus"/>
- <rdfs:range rdf:resource="&xsd;integer"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#internalUsed -->
-
- <owl:DatatypeProperty rdf:about="#internalUsed">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Memory"/>
- <rdfs:subPropertyOf rdf:resource="#MemoryStatus"/>
- <rdfs:range rdf:resource="&xsd;integer"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isAssistedHighAccuracy -->
-
- <owl:DatatypeProperty rdf:about="#isAssistedHighAccuracy">
- <rdfs:domain rdf:resource="#GPSModule"/>
- <rdfs:subPropertyOf rdf:resource="#GPSModuleAvailable"/>
- <owl:equivalentProperty rdf:resource="#isAssistedLowerAccuracy"/>
- <owl:equivalentProperty rdf:resource="#isHighAccuracy"/>
- <owl:equivalentProperty rdf:resource="#isLowerAccuracy"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isAssistedLowerAccuracy -->
-
- <owl:DatatypeProperty rdf:about="#isAssistedLowerAccuracy">
- <rdfs:domain rdf:resource="#GPSModule"/>
- <rdfs:subPropertyOf rdf:resource="#GPSModuleAvailable"/>
- <owl:equivalentProperty rdf:resource="#isHighAccuracy"/>
- <owl:equivalentProperty rdf:resource="#isLowerAccuracy"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isAvailable -->
-
- <owl:DatatypeProperty rdf:about="#isAvailable">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#PresenceStatus"/>
- <rdfs:domain rdf:resource="#Status"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isAway -->
-
- <owl:DatatypeProperty rdf:about="#isAway">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Status"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isBrowsing -->
-
- <owl:DatatypeProperty rdf:about="#isBrowsing">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#CurrentActivity"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isBusy -->
-
- <owl:DatatypeProperty rdf:about="#isBusy">
- <rdfs:domain rdf:resource="#Status"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isBusyText -->
-
- <owl:DatatypeProperty rdf:about="#isBusyText">
- <rdfs:domain rdf:resource="#Social"/>
- <owl:equivalentProperty rdf:resource="#isGoingToHome"/>
- <owl:equivalentProperty rdf:resource="#isGoingToWork"/>
- <owl:equivalentProperty rdf:resource="#isWithColleagues"/>
- <owl:equivalentProperty rdf:resource="#isWithFriends"/>
- <rdfs:subPropertyOf rdf:resource="#socialContext"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isCalling -->
-
- <owl:DatatypeProperty rdf:about="#isCalling">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#CurrentActivity"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isCharging -->
-
- <owl:DatatypeProperty rdf:about="#isCharging">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Battery"/>
- <rdfs:range rdf:resource="&xsd;integer"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isChatting -->
-
- <owl:DatatypeProperty rdf:about="#isChatting">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#CurrentActivity"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isCreatingContent -->
-
- <owl:DatatypeProperty rdf:about="#isCreatingContent">
- <rdfs:domain rdf:resource="#Activity"/>
- <rdfs:domain rdf:resource="#CurrentActivity"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isDockedinCar -->
-
- <owl:DatatypeProperty rdf:about="#isDockedinCar">
- <rdfs:domain rdf:resource="#CarDock"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isExternalCardCorrupted -->
-
- <owl:DatatypeProperty rdf:about="#isExternalCardCorrupted">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Memory"/>
- <rdfs:subPropertyOf rdf:resource="#MemoryStatus"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isExternalMMCCoverOpen -->
-
- <owl:DatatypeProperty rdf:about="#isExternalMMCCoverOpen">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:subPropertyOf rdf:resource="#AccessoryStatus"/>
- <rdfs:domain rdf:resource="#Usage"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isGaming -->
-
- <owl:DatatypeProperty rdf:about="#isGaming">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#CurrentActivity"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isGoingToHome -->
-
- <owl:DatatypeProperty rdf:about="#isGoingToHome">
- <rdfs:domain rdf:resource="#Social"/>
- <owl:equivalentProperty rdf:resource="#isGoingToWork"/>
- <owl:equivalentProperty rdf:resource="#isWithColleagues"/>
- <owl:equivalentProperty rdf:resource="#isWithFriends"/>
- <rdfs:subPropertyOf rdf:resource="#socialContext"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isGoingToWork -->
-
- <owl:DatatypeProperty rdf:about="#isGoingToWork">
- <rdfs:domain rdf:resource="#Social"/>
- <owl:equivalentProperty rdf:resource="#isWithColleagues"/>
- <owl:equivalentProperty rdf:resource="#isWithFriends"/>
- <rdfs:subPropertyOf rdf:resource="#socialContext"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isHeavyCPULoad -->
-
- <owl:DatatypeProperty rdf:about="#isHeavyCPULoad">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Usage"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isHighAccuracy -->
-
- <owl:DatatypeProperty rdf:about="#isHighAccuracy">
- <rdfs:domain rdf:resource="#GPSModule"/>
- <rdfs:subPropertyOf rdf:resource="#GPSModuleAvailable"/>
- <owl:equivalentProperty rdf:resource="#isLowerAccuracy"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isInternalCardCorrupted -->
-
- <owl:DatatypeProperty rdf:about="#isInternalCardCorrupted">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Memory"/>
- <rdfs:subPropertyOf rdf:resource="#MemoryStatus"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isKeyboardOpen -->
-
- <owl:DatatypeProperty rdf:about="#isKeyboardOpen">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:subPropertyOf rdf:resource="#AccessoryStatus"/>
- <rdfs:domain rdf:resource="#KeyboardOpen"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isLightCPULoad -->
-
- <owl:DatatypeProperty rdf:about="#isLightCPULoad">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Usage"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isListening -->
-
- <owl:DatatypeProperty rdf:about="#isListening">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#CurrentActivity"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isLowerAccuracy -->
-
- <owl:DatatypeProperty rdf:about="#isLowerAccuracy">
- <rdfs:domain rdf:resource="#GPSModule"/>
- <rdfs:subPropertyOf rdf:resource="#GPSModuleAvailable"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isMAXCPULoad -->
-
- <owl:DatatypeProperty rdf:about="#isMAXCPULoad">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Usage"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isMoving -->
-
- <owl:DatatypeProperty rdf:about="#isMoving">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Application"/>
- <rdfs:domain rdf:resource="#DeviceStatus"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isNearSomething -->
-
- <owl:DatatypeProperty rdf:about="#isNearSomething">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Orientation"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isOnVacation -->
-
- <owl:DatatypeProperty rdf:about="#isOnVacation">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#EventStructure"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isSilent -->
-
- <owl:DatatypeProperty rdf:about="#isSilent">
- <rdfs:domain rdf:resource="#Alarm"/>
- <rdfs:domain rdf:resource="#Profile"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isUSBCapleAttached -->
-
- <owl:DatatypeProperty rdf:about="#isUSBCapleAttached">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:subPropertyOf rdf:resource="#AccessoryStatus"/>
- <rdfs:domain rdf:resource="#Usage"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isWatching -->
-
- <owl:DatatypeProperty rdf:about="#isWatching">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#CurrentActivity"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isWithColleagues -->
-
- <owl:DatatypeProperty rdf:about="#isWithColleagues">
- <rdfs:domain rdf:resource="#Social"/>
- <owl:equivalentProperty rdf:resource="#isWithFriends"/>
- <rdfs:subPropertyOf rdf:resource="#socialContext"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#isWithFriends -->
-
- <owl:DatatypeProperty rdf:about="#isWithFriends">
- <rdfs:domain rdf:resource="#Social"/>
- <rdfs:subPropertyOf rdf:resource="#socialContext"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#lastTouch -->
-
- <owl:DatatypeProperty rdf:about="#lastTouch">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Application"/>
- <rdfs:range rdf:resource="&xsd;time"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ledEnabled -->
-
- <owl:DatatypeProperty rdf:about="#ledEnabled">
- <rdfs:domain rdf:resource="#Alarm"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#midnight -->
-
- <owl:DatatypeProperty rdf:about="#midnight">
- <rdfs:domain rdf:resource="#Time"/>
- <owl:equivalentProperty rdf:resource="#morning"/>
- <owl:equivalentProperty rdf:resource="#morningNight"/>
- <rdfs:subPropertyOf rdf:resource="#timeOfDay"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#morning -->
-
- <owl:DatatypeProperty rdf:about="#morning">
- <rdfs:domain rdf:resource="#Time"/>
- <owl:equivalentProperty rdf:resource="#morningNight"/>
- <rdfs:subPropertyOf rdf:resource="#timeOfDay"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#morningNight -->
-
- <owl:DatatypeProperty rdf:about="#morningNight">
- <rdfs:domain rdf:resource="#Time"/>
- <rdfs:subPropertyOf rdf:resource="#timeOfDay"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#name -->
-
- <owl:DatatypeProperty rdf:about="#name">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Application"/>
- <rdfs:subPropertyOf rdf:resource="#currentApplication"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#notAvailable -->
-
- <owl:DatatypeProperty rdf:about="#notAvailable">
- <rdfs:subPropertyOf rdf:resource="#IMStatus"/>
- <rdfs:domain rdf:resource="#Messaging"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#offline -->
-
- <owl:DatatypeProperty rdf:about="#offline">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#ProfileName"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#perVolumeFree -->
-
- <owl:DatatypeProperty rdf:about="#perVolumeFree">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Memory"/>
- <rdfs:subPropertyOf rdf:resource="#MemoryStatus"/>
- <rdfs:range rdf:resource="&xsd;int"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#percentRemaining -->
-
- <owl:DatatypeProperty rdf:about="#percentRemaining">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Battery"/>
- <rdfs:range rdf:resource="&xsd;integer"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#profiles -->
-
- <owl:DatatypeProperty rdf:about="#profiles">
- <rdfs:domain rdf:resource="#ProfileName"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ramFree -->
-
- <owl:DatatypeProperty rdf:about="#ramFree">
- <rdfs:domain rdf:resource="#Memory"/>
- <rdfs:subPropertyOf rdf:resource="#MemoryStatus"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ramTotal -->
-
- <owl:DatatypeProperty rdf:about="#ramTotal">
- <rdfs:domain rdf:resource="#Memory"/>
- <rdfs:subPropertyOf rdf:resource="#MemoryStatus"/>
- <rdfs:range rdf:resource="&xsd;int"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ramUsed -->
-
- <owl:DatatypeProperty rdf:about="#ramUsed">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Memory"/>
- <rdfs:range rdf:resource="&xsd;integer"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#receivedCall -->
-
- <owl:DatatypeProperty rdf:about="#receivedCall">
- <rdfs:subPropertyOf rdf:resource="#Call"/>
- <rdfs:domain rdf:resource="#Event"/>
- <owl:equivalentProperty rdf:resource="#ringing"/>
- <owl:equivalentProperty rdf:resource="#startedCall"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#remainderOff -->
-
- <owl:DatatypeProperty rdf:about="#remainderOff">
- <rdfs:domain rdf:resource="#Reminder"/>
- <owl:equivalentProperty rdf:resource="#remainderOn"/>
- <rdfs:subPropertyOf rdf:resource="#remainderStatus"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#remainderOn -->
-
- <owl:DatatypeProperty rdf:about="#remainderOn">
- <rdfs:domain rdf:resource="#Reminder"/>
- <rdfs:subPropertyOf rdf:resource="#remainderStatus"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#remainderStatus -->
-
- <owl:DatatypeProperty rdf:about="#remainderStatus">
- <rdfs:comment
- >User can set remainders on/off. There might be several remainders where user can select what are on/off. This is the generic swicth for reminders.</rdfs:comment>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#reserved -->
-
- <owl:DatatypeProperty rdf:about="#reserved">
- <rdfs:domain rdf:resource="#Application"/>
- <rdfs:subPropertyOf rdf:resource="#currentApplication"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ringing -->
-
- <owl:DatatypeProperty rdf:about="#ringing">
- <rdfs:subPropertyOf rdf:resource="#Call"/>
- <rdfs:domain rdf:resource="#Event"/>
- <owl:equivalentProperty rdf:resource="#startedCall"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#running -->
-
- <owl:DatatypeProperty rdf:about="#running">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Situations"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#socialContext -->
-
- <owl:DatatypeProperty rdf:about="#socialContext">
- <rdfs:domain rdf:resource="#Social"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#songAlbum -->
-
- <owl:DatatypeProperty rdf:about="#songAlbum">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#LastMusic"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#songArtist -->
-
- <owl:DatatypeProperty rdf:about="#songArtist">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#LastMusic"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#songTitle -->
-
- <owl:DatatypeProperty rdf:about="#songTitle">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#LastMusic"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#startTime -->
-
- <owl:DatatypeProperty rdf:about="#startTime">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#LastMusic"/>
- <rdfs:range rdf:resource="&xsd;time"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#startedCall -->
-
- <owl:DatatypeProperty rdf:about="#startedCall">
- <rdfs:subPropertyOf rdf:resource="#Call"/>
- <rdfs:domain rdf:resource="#Event"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#swapFree -->
-
- <owl:DatatypeProperty rdf:about="#swapFree">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Memory"/>
- <rdfs:subPropertyOf rdf:resource="#MemoryStatus"/>
- <rdfs:range rdf:resource="&xsd;int"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#swapTotal -->
-
- <owl:DatatypeProperty rdf:about="#swapTotal">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Memory"/>
- <rdfs:subPropertyOf rdf:resource="#MemoryStatus"/>
- <rdfs:range rdf:resource="&xsd;integer"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#swapUsed -->
-
- <owl:DatatypeProperty rdf:about="#swapUsed">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Memory"/>
- <rdfs:subPropertyOf rdf:resource="#MemoryStatus"/>
- <rdfs:range rdf:resource="&xsd;integer"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#tempC -->
-
- <owl:DatatypeProperty rdf:about="#tempC">
- <rdfs:domain rdf:resource="#Weather"/>
- <rdfs:domain rdf:resource="#WeatherForecast"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#tempF -->
-
- <owl:DatatypeProperty rdf:about="#tempF">
- <rdfs:domain rdf:resource="#Weather"/>
- <rdfs:domain rdf:resource="#WeatherForecast"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#timeLeftOnBattery -->
-
- <owl:DatatypeProperty rdf:about="#timeLeftOnBattery">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Battery"/>
- <rdfs:range rdf:resource="&xsd;integer"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#timeOfDay -->
-
- <owl:DatatypeProperty rdf:about="#timeOfDay">
- <rdfs:domain rdf:resource="#Time"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#timeOfYear -->
-
- <owl:DatatypeProperty rdf:about="#timeOfYear">
- <rdfs:domain rdf:resource="#Time"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#timeOnBattery -->
-
- <owl:DatatypeProperty rdf:about="#timeOnBattery">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Battery"/>
- <rdfs:range rdf:resource="&xsd;integer"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#timeToCompleteCharge -->
-
- <owl:DatatypeProperty rdf:about="#timeToCompleteCharge">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Battery"/>
- <rdfs:range rdf:resource="&xsd;integer"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#totalSize -->
-
- <owl:DatatypeProperty rdf:about="#totalSize">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Memory"/>
- <rdfs:subPropertyOf rdf:resource="#MemoryStatus"/>
- <rdfs:range rdf:resource="&xsd;integer"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#totalTimeOpen -->
-
- <owl:DatatypeProperty rdf:about="#totalTimeOpen">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Application"/>
- <rdfs:domain rdf:resource="#VisibleApplication"/>
- <rdfs:range rdf:resource="&xsd;int"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#totalTimeOpenSession -->
-
- <owl:DatatypeProperty rdf:about="#totalTimeOpenSession">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Application"/>
- <rdfs:subPropertyOf rdf:resource="#currentApplication"/>
- <rdfs:range rdf:resource="&xsd;int"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#totalTimesOpened -->
-
- <owl:DatatypeProperty rdf:about="#totalTimesOpened">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Application"/>
- <rdfs:subPropertyOf rdf:resource="#currentApplication"/>
- <rdfs:range rdf:resource="&xsd;integer"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#upTimeInformation -->
-
- <owl:DatatypeProperty rdf:about="#upTimeInformation">
- <rdfs:domain rdf:resource="#Uptime"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#used -->
-
- <owl:DatatypeProperty rdf:about="#used">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Memory"/>
- <rdfs:subPropertyOf rdf:resource="#MemoryStatus"/>
- <rdfs:range rdf:resource="&xsd;int"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#userDefined -->
-
- <owl:DatatypeProperty rdf:about="#userDefined">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#ProfileName"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#userofApplication -->
-
- <owl:DatatypeProperty rdf:about="#userofApplication">
- <rdfs:domain rdf:resource="#Application"/>
- <rdfs:subPropertyOf rdf:resource="#currentApplication"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#vibraEnabled -->
-
- <owl:DatatypeProperty rdf:about="#vibraEnabled">
- <rdfs:domain rdf:resource="#Alarm"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#virtual -->
-
- <owl:DatatypeProperty rdf:about="#virtual">
- <rdfs:domain rdf:resource="#Application"/>
- <rdfs:subPropertyOf rdf:resource="#currentApplication"/>
- <rdfs:range rdf:resource="&xsd;string"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#walking -->
-
- <owl:DatatypeProperty rdf:about="#walking">
- <rdf:type rdf:resource="&owl;FunctionalProperty"/>
- <rdfs:domain rdf:resource="#Situations"/>
- <rdfs:range rdf:resource="&xsd;boolean"/>
- </owl:DatatypeProperty>
-
-
-
- <!-- http://www.w3.org/2007/uwa/ontologies/DeliveryContext.owl#deviceIdentifier -->
-
- <owl:DatatypeProperty rdf:about="&DeliveryContext;deviceIdentifier"/>
-
-
-
- <!--
- ///////////////////////////////////////////////////////////////////////////////////////
- //
- // Classes
- //
- ///////////////////////////////////////////////////////////////////////////////////////
- -->
-
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Accelerometer -->
-
- <owl:Class rdf:about="#Accelerometer">
- <rdfs:subClassOf rdf:resource="#Sensors"/>
- <owl:disjointWith rdf:resource="#AccelerometerContext"/>
- <owl:backwardCompatibleWith
- >http://saescr005.ext.nokia.com/scrumworks/webreport/5MTMxMT
-
-Visualizing the situation (ContextUseCaseCandidatesOP20090303.xls).</owl:backwardCompatibleWith>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#AccelerometerContext -->
-
- <owl:Class rdf:about="#AccelerometerContext">
- <rdfs:subClassOf rdf:resource="#Physicalcontext"/>
- <owl:backwardCompatibleWith
- >http://saescr005.ext.nokia.com/scrumworks/webreport/5MTMxMT</owl:backwardCompatibleWith>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#AccessControlPolicy -->
-
- <owl:Class rdf:about="#AccessControlPolicy">
- <rdfs:subClassOf rdf:resource="#Users"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Accessories -->
-
- <owl:Class rdf:about="#Accessories">
- <rdfs:subClassOf rdf:resource="#Device"/>
- <owl:disjointWith rdf:resource="#AccessoryContext"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#AccessoryContext -->
-
- <owl:Class rdf:about="#AccessoryContext">
- <rdfs:subClassOf rdf:resource="#Physicalcontext"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#AccessoryStatus"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <owl:backwardCompatibleWith
- >http://saescr005.ext.nokia.com/scrumworks/webreport/5MTMxMT</owl:backwardCompatibleWith>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Action -->
-
- <owl:Class rdf:about="#Action">
- <rdfs:subClassOf rdf:resource="#Device"/>
- <rdfs:comment rdf:datatype="&xsd;string"
- >Represents a set of all actions</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Activity -->
-
- <owl:Class rdf:about="#Activity">
- <rdfs:subClassOf rdf:resource="#Users"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Addresses -->
-
- <owl:Class rdf:about="#Addresses">
- <rdfs:subClassOf rdf:resource="#Person"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Locality"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#TypeOfAddress"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#StreetAddress"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Country"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#PostalCode"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:comment
- >Structured address of person. PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Advertising -->
-
- <owl:Class rdf:about="#Advertising">
- <rdfs:subClassOf rdf:resource="#Application"/>
- <owl:disjointWith rdf:resource="#ContextualAdvertising"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Alarm -->
-
- <owl:Class rdf:about="#Alarm">
- <rdfs:subClassOf rdf:resource="#AlarmClock"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#SoundLevel"/>
- <owl:someValuesFrom rdf:resource="&xsd;int"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#isSilent"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#ledEnabled"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#vibraEnabled"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <owl:disjointWith rdf:resource="#AlarmContext"/>
- <owl:disjointWith rdf:resource="#Application-levelRoamingandOnlineContentUpdate"/>
- <owl:disjointWith rdf:resource="#SituationBasedChanges"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#AlarmClock -->
-
- <owl:Class rdf:about="#AlarmClock">
- <rdfs:subClassOf rdf:resource="#Application"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#AlarmContext -->
-
- <owl:Class rdf:about="#AlarmContext">
- <rdfs:subClassOf rdf:resource="#Physicalcontext"/>
- <rdfs:comment
- >http://saescr005.ext.nokia.com/scrumworks/webreport/5MTMxMT</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#AmbientLightContext -->
-
- <owl:Class rdf:about="#AmbientLightContext">
- <rdfs:subClassOf rdf:resource="#Physicalcontext"/>
- <owl:disjointWith rdf:resource="#Ambient_light"/>
- <owl:backwardCompatibleWith
- >http://saescr005.ext.nokia.com/scrumworks/webreport/5MTMxMT</owl:backwardCompatibleWith>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Ambient_light -->
-
- <owl:Class rdf:about="#Ambient_light">
- <rdfs:subClassOf rdf:resource="#Light"/>
- <owl:backwardCompatibleWith
- >http://saescr005.ext.nokia.com/scrumworks/webreport/5MTMxMT</owl:backwardCompatibleWith>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Anniversasy -->
-
- <owl:Class rdf:about="#Anniversasy">
- <rdfs:subClassOf rdf:resource="#Person"/>
- <rdfs:comment>PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Application -->
-
- <owl:Class rdf:about="#Application">
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#lastTouch"/>
- <owl:someValuesFrom rdf:resource="&xsd;time"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#atWork"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <rdfs:subClassOf rdf:resource="#Device"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#applicationUser"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#command"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#PR"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#totalTimeOpen"/>
- <owl:someValuesFrom rdf:resource="&xsd;int"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#reserved"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#activeContentItem"/>
- <owl:someValuesFrom rdf:resource="&xsd;anyURI"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#totalTimeOpenSession"/>
- <owl:someValuesFrom rdf:resource="&xsd;int"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#PID"/>
- <owl:someValuesFrom rdf:resource="&xsd;int"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasNearByContacts"/>
- <owl:someValuesFrom rdf:resource="#vCard"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#virtual"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#totalTimesOpened"/>
- <owl:someValuesFrom rdf:resource="&xsd;int"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#applicationName"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <owl:disjointWith rdf:resource="#BackLightLevel"/>
- <owl:disjointWith rdf:resource="#CurrentApplicationContext"/>
- <owl:disjointWith rdf:resource="#CurrentBackLightLevel"/>
- <owl:disjointWith rdf:resource="#MostUsedApplications"/>
- <owl:disjointWith rdf:resource="#SubscribedApplications"/>
- <owl:disjointWith rdf:resource="#UnSubscribedApplications"/>
- <owl:disjointWith rdf:resource="#UnusedApplications"/>
- <owl:disjointWith rdf:resource="#Weather"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Application-levelRoamingandOnlineContentUpdate -->
-
- <owl:Class rdf:about="#Application-levelRoamingandOnlineContentUpdate">
- <rdfs:subClassOf rdf:resource="#Action"/>
- <owl:disjointWith rdf:resource="#Browser"/>
- <owl:disjointWith rdf:resource="#Calendar"/>
- <owl:disjointWith rdf:resource="#ConnectivityStatus"/>
- <owl:disjointWith rdf:resource="#Download"/>
- <owl:disjointWith rdf:resource="#DownloadedContent"/>
- <owl:disjointWith rdf:resource="#Feeds"/>
- <owl:disjointWith rdf:resource="#Learning"/>
- <owl:disjointWith rdf:resource="#MusicPlayer"/>
- <owl:disjointWith rdf:resource="#Share"/>
- <owl:disjointWith rdf:resource="#UserPreferences"/>
- <owl:disjointWith rdf:resource="#Widgets"/>
- <rdfs:comment
- >Application-level roaming &amp; online content update. ContextUseCaseCandidatesOP20090303.xls</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ApplicationSubscriptionStatus -->
-
- <owl:Class rdf:about="#ApplicationSubscriptionStatus">
- <rdfs:subClassOf rdf:resource="#Device"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ApplicationUsageFrequencies -->
-
- <owl:Class rdf:about="#ApplicationUsageFrequencies">
- <rdfs:subClassOf rdf:resource="#UsageFrequencies"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Assistant -->
-
- <owl:Class rdf:about="#Assistant">
- <rdfs:subClassOf rdf:resource="#Person"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#AssistantTelephone"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#AssistantName"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:comment>PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Authentication -->
-
- <owl:Class rdf:about="#Authentication">
- <rdfs:subClassOf rdf:resource="#People"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#AuthorizationChallenge -->
-
- <owl:Class rdf:about="#AuthorizationChallenge">
- <rdfs:subClassOf rdf:resource="#Authentication"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#NAuth"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#AuthorizationResponse -->
-
- <owl:Class rdf:about="#AuthorizationResponse">
- <rdfs:subClassOf rdf:resource="#Authentication"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#OAuthTimestamp"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#OAuthSignatureMethod"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#OAuth"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#OAuthSignature"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#OAuthNonce"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#OAuthToken"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#OAuthConsumerKey"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#AutomaticPresenceChanges -->
-
- <owl:Class rdf:about="#AutomaticPresenceChanges">
- <rdfs:subClassOf rdf:resource="#Action"/>
- <owl:disjointWith rdf:resource="#Calendar"/>
- <owl:disjointWith rdf:resource="#ConnectivityStatus"/>
- <owl:disjointWith rdf:resource="#Contacts"/>
- <owl:disjointWith rdf:resource="#PresenceStatus"/>
- <owl:disjointWith rdf:resource="#Time"/>
- <rdfs:comment
- >Automatic presence changes. ContextUseCaseCandidatesOP20090303.xls</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#AutomaticRedial -->
-
- <owl:Class rdf:about="#AutomaticRedial">
- <rdfs:subClassOf rdf:resource="#Setting"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#BTHeadset -->
-
- <owl:Class rdf:about="#BTHeadset">
- <rdfs:subClassOf rdf:resource="#Accessories"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasBTHeadset"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#BTStereoHeadset -->
-
- <owl:Class rdf:about="#BTStereoHeadset">
- <rdfs:subClassOf rdf:resource="#Accessories"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasBTStereoHeadset"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#BackGroundImageFileName -->
-
- <owl:Class rdf:about="#BackGroundImageFileName">
- <rdfs:subClassOf rdf:resource="#Setting"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#BackLightLevel -->
-
- <owl:Class rdf:about="#BackLightLevel">
- <rdfs:subClassOf rdf:resource="#Ambient_light"/>
- <owl:disjointWith rdf:resource="#CurrentBackLightLevel"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#BackgroundNoise -->
-
- <owl:Class rdf:about="#BackgroundNoise">
- <rdfs:subClassOf rdf:resource="#Sensors"/>
- <owl:disjointWith rdf:resource="#VolumeIncreaseinNoisyEnvironment"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Backlight -->
-
- <owl:Class rdf:about="#Backlight">
- <rdfs:subClassOf rdf:resource="#Display"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#BackupRestore -->
-
- <owl:Class rdf:about="#BackupRestore">
- <rdfs:subClassOf rdf:resource="#Application"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#BasicInfoVisibility -->
-
- <owl:Class rdf:about="#BasicInfoVisibility">
- <rdfs:subClassOf rdf:resource="#AccessControlPolicy"/>
- <rdfs:subClassOf rdf:resource="#Users"/>
- <rdfs:comment
- >Rule controlling the visibility of basic profile information towards other users. Enumeration. Supported values: &#8220;everybody&#8221;, &#8220;friends&#8221;. Note that this rule also (implicitly) controls the policy owner&#39;s visibility in user searches. Singular property.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Battery -->
-
- <owl:Class rdf:about="#Battery">
- <rdfs:subClassOf rdf:resource="#Device"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#BatteryLevel -->
-
- <owl:Class rdf:about="#BatteryLevel">
- <rdfs:subClassOf rdf:resource="#Battery"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#BatteryStatus"/>
- <owl:someValuesFrom rdf:resource="&xsd;int"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#BatteryStatusContext -->
-
- <owl:Class rdf:about="#BatteryStatusContext">
- <rdfs:subClassOf rdf:resource="#Physicalcontext"/>
- <owl:backwardCompatibleWith
- >http://saescr005.ext.nokia.com/scrumworks/webreport/5MTMxMT</owl:backwardCompatibleWith>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Bearers -->
-
- <owl:Class rdf:about="#Bearers">
- <rdfs:subClassOf rdf:resource="#Connectivity"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Birthday -->
-
- <owl:Class rdf:about="#Birthday">
- <rdfs:subClassOf rdf:resource="#Person"/>
- <rdfs:comment>PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Books -->
-
- <owl:Class rdf:about="#Books">
- <rdfs:subClassOf rdf:resource="#Person"/>
- <owl:disjointWith rdf:resource="#UserPreferences"/>
- <rdfs:comment
- >Favorite books of person. List of words or phrases. Plural property. PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Browser -->
-
- <owl:Class rdf:about="#Browser">
- <rdfs:subClassOf rdf:resource="#Application"/>
- <owl:disjointWith rdf:resource="#ContextualRemindersActions"/>
- <owl:disjointWith rdf:resource="#SituationBasedChanges"/>
- <owl:disjointWith rdf:resource="#VisualizingSituation"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#BrowserUsageFrequency -->
-
- <owl:Class rdf:about="#BrowserUsageFrequency">
- <rdfs:subClassOf rdf:resource="#ApplicationUsageFrequencies"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#CPULoad -->
-
- <owl:Class rdf:about="#CPULoad">
- <rdfs:subClassOf rdf:resource="&DeliveryContext;CPU"/>
- <owl:disjointWith rdf:resource="#currentCPULoad"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#CPULoadContext -->
-
- <owl:Class rdf:about="#CPULoadContext">
- <rdfs:subClassOf rdf:resource="#Physicalcontext"/>
- <owl:disjointWith rdf:resource="#currentCPULoad"/>
- <owl:backwardCompatibleWith
- >http://saescr005.ext.nokia.com/scrumworks/webreport/5MTMxMT</owl:backwardCompatibleWith>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Calendar -->
-
- <owl:Class rdf:about="#Calendar">
- <rdfs:subClassOf rdf:resource="#Application"/>
- <owl:disjointWith rdf:resource="#ContextualAdvertising"/>
- <owl:disjointWith rdf:resource="#ContextualRemindersActions"/>
- <owl:disjointWith rdf:resource="#ContextualTagging"/>
- <owl:disjointWith rdf:resource="#InMeeting"/>
- <owl:disjointWith rdf:resource="#Location"/>
- <owl:disjointWith rdf:resource="#ProvidersforOnlineContext"/>
- <owl:disjointWith rdf:resource="#SituationBasedChanges"/>
- <owl:disjointWith rdf:resource="#TimezoneAwareness"/>
- <owl:disjointWith rdf:resource="#ViewandNavigatetoMeetingLocation"/>
- <owl:disjointWith rdf:resource="#VisualizingSituation"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#CalendarUsageFrequency -->
-
- <owl:Class rdf:about="#CalendarUsageFrequency">
- <rdfs:subClassOf rdf:resource="#ApplicationUsageFrequencies"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#CallContext -->
-
- <owl:Class rdf:about="#CallContext">
- <rdfs:subClassOf rdf:resource="#Physicalcontext"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Call"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <owl:disjointWith rdf:resource="#Telephone"/>
- <rdfs:comment
- >http://saescr005.ext.nokia.com/scrumworks/webreport/5MTMxMT</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Camera -->
-
- <owl:Class rdf:about="#Camera">
- <rdfs:subClassOf rdf:resource="#Accessories"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasCamera"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#CarContext -->
-
- <owl:Class rdf:about="#CarContext">
- <rdfs:subClassOf rdf:resource="#Physicalcontext"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasCarDock"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <owl:disjointWith rdf:resource="#CarDock"/>
- <rdfs:comment
- >http://saescr005.ext.nokia.com/scrumworks/webreport/5MTMxMT</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#CarDock -->
-
- <owl:Class rdf:about="#CarDock">
- <rdfs:subClassOf rdf:resource="#Accessories"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasCarDock"/>
- <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#isDockedinCar"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#CarUI -->
-
- <owl:Class rdf:about="#CarUI">
- <rdfs:subClassOf rdf:resource="#Application"/>
- <owl:disjointWith rdf:resource="#Evening"/>
- <owl:disjointWith rdf:resource="#SituationBasedChanges"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ChargeLocation -->
-
- <owl:Class rdf:about="#ChargeLocation">
- <rdfs:subClassOf rdf:resource="#Location"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Charger -->
-
- <owl:Class rdf:about="#Charger">
- <rdfs:subClassOf rdf:resource="#Accessories"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#isCharging"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ChargingSuggested -->
-
- <owl:Class rdf:about="#ChargingSuggested">
- <rdfs:subClassOf rdf:resource="#Charger"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#chargesuggestion"/>
- <owl:someValuesFrom rdf:resource="#ChargeLocation"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <owl:disjointWith rdf:resource="#Location"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Children -->
-
- <owl:Class rdf:about="#Children">
- <rdfs:subClassOf rdf:resource="#Person"/>
- <rdfs:comment>PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Clock -->
-
- <owl:Class rdf:about="#Clock">
- <rdfs:subClassOf rdf:resource="#Application"/>
- <owl:disjointWith rdf:resource="#ContextualRemindersActions"/>
- <owl:disjointWith rdf:resource="#ContextualTagging"/>
- <owl:disjointWith rdf:resource="#ProvidersforOnlineContext"/>
- <owl:disjointWith rdf:resource="#SituationBasedChanges"/>
- <owl:disjointWith rdf:resource="#TimezoneAwareness"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Colleagues -->
-
- <owl:Class rdf:about="#Colleagues">
- <rdfs:subClassOf rdf:resource="#Members"/>
- <rdfs:subClassOf rdf:resource="#Person"/>
- <rdfs:comment>PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ComputingContext -->
-
- <owl:Class rdf:about="#ComputingContext">
- <rdfs:subClassOf rdf:resource="#Context"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasNearbyPeripherals"/>
- <owl:someValuesFrom rdf:resource="#Peripherals"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasNearbyDevices"/>
- <owl:someValuesFrom rdf:resource="#NearbyDevices"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasConnectivity"/>
- <owl:someValuesFrom rdf:resource="#ConnectivityStatus"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <owl:disjointWith rdf:resource="#People"/>
- <owl:disjointWith rdf:resource="#Places"/>
- <owl:disjointWith rdf:resource="#Things"/>
- <rdfs:comment
- >Means e.g. network connectivity, communication costs, and
-communication bandwidth, and nearby devices and peripherals.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ConferenceCamera -->
-
- <owl:Class rdf:about="#ConferenceCamera">
- <rdfs:subClassOf rdf:resource="#Accessories"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasConferenceCamera"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Connectivity -->
-
- <owl:Class rdf:about="#Connectivity">
- <rdfs:subClassOf rdf:resource="#Device"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ConnectivityStatus -->
-
- <owl:Class rdf:about="#ConnectivityStatus">
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Connected"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Disconnected"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <rdfs:subClassOf rdf:resource="#Connectivity"/>
- <owl:disjointWith rdf:resource="#ContextualRemindersActions"/>
- <owl:disjointWith rdf:resource="#DelayedBackupandSynchronization"/>
- <owl:disjointWith rdf:resource="#DelayedUploadShareofContent"/>
- <owl:disjointWith rdf:resource="#Location-basedWLANSearch"/>
- <owl:disjointWith rdf:resource="#ProvidersforOnlineContext"/>
- <owl:disjointWith rdf:resource="#TimezoneAwareness"/>
- <rdfs:comment
- >Visualizing the situation (ContextUseCaseCandidatesOP20090303.xls).</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Contacts -->
-
- <owl:Class rdf:about="#Contacts">
- <rdfs:subClassOf rdf:resource="#Application"/>
- <owl:disjointWith rdf:resource="#ContextualAdvertising"/>
- <owl:disjointWith rdf:resource="#ContextualRemindersActions"/>
- <owl:disjointWith rdf:resource="#SituationBasedChanges"/>
- <owl:disjointWith rdf:resource="#TimezoneAwareness"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ContactsUsageFrequency -->
-
- <owl:Class rdf:about="#ContactsUsageFrequency">
- <rdfs:subClassOf rdf:resource="#ApplicationUsageFrequencies"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Context -->
-
- <owl:Class rdf:about="#Context">
- <owl:disjointWith rdf:resource="#People"/>
- <owl:disjointWith rdf:resource="#Places"/>
- <owl:disjointWith rdf:resource="#Things"/>
- <owl:disjointWith rdf:resource="&DeliveryContext;DeliveryContext_EnvironmentEntity"/>
- <owl:disjointWith rdf:resource="&DeliveryContext;DeliveryContext_HardwareEntity"/>
- <owl:disjointWith rdf:resource="&DeliveryContext;DeliveryContext_NetworkEntity"/>
- <owl:disjointWith rdf:resource="&DeliveryContext;DeliveryContext_SoftwareEntity"/>
- <owl:backwardCompatibleWith
- >The Nokia Context Ontology provides a formal model of the characteristics of the environment in which devices interact with the Web, applications inside device and services in network. The context ontology includes the characteristics of the device, the software used to access the service and the network providing the connection, personal and group information etc.
-
-The context ontology is an important source of information that can be used to adapt materials to make them useable on a wide range of different devices, applications and services with different capabilities.
-
-The ontology is formally specified in the Web Ontology Language [OWL]. This document describes the ontology and gives details of each property that it contains.
-
-The ontology conforms to the OWL-DL expressivity. This allows it to be used within appropriately written reasoning systems.
-
-The Context class represents the set of characteristics that describes the context in which materials are exchanged between the applications, Web, services and a device.</owl:backwardCompatibleWith>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ContextualAdvertising -->
-
- <owl:Class rdf:about="#ContextualAdvertising">
- <rdfs:subClassOf rdf:resource="#Action"/>
- <owl:disjointWith rdf:resource="#DirectUI"/>
- <owl:disjointWith rdf:resource="#Location"/>
- <owl:disjointWith rdf:resource="#Maps"/>
- <owl:disjointWith rdf:resource="#People"/>
- <owl:disjointWith rdf:resource="#Reminder"/>
- <owl:disjointWith rdf:resource="#Situations"/>
- <owl:disjointWith rdf:resource="#Time"/>
- <owl:disjointWith rdf:resource="#UserPreferences"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ContextualMediaPlayers -->
-
- <owl:Class rdf:about="#ContextualMediaPlayers">
- <rdfs:subClassOf rdf:resource="#Action"/>
- <owl:disjointWith rdf:resource="#CurrentActivity"/>
- <owl:disjointWith rdf:resource="#MusicPlayer"/>
- <owl:disjointWith rdf:resource="#Sensors"/>
- <owl:disjointWith rdf:resource="#Situations"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ContextualRemindersActions -->
-
- <owl:Class rdf:about="#ContextualRemindersActions">
- <rdfs:subClassOf rdf:resource="#Action"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#remainderStatus"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <owl:disjointWith rdf:resource="#DirectUI"/>
- <owl:disjointWith rdf:resource="#Location"/>
- <owl:disjointWith rdf:resource="#Maps"/>
- <owl:disjointWith rdf:resource="#Multimedia"/>
- <owl:disjointWith rdf:resource="#PresenceStatus"/>
- <owl:disjointWith rdf:resource="#Reminder"/>
- <owl:disjointWith rdf:resource="#Share"/>
- <owl:disjointWith rdf:resource="#Situations"/>
- <owl:disjointWith rdf:resource="#Time"/>
- <rdfs:comment
- >Contextual reminders/actions. ContextUseCaseCandidatesOP20090303.xls</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ContextualTagging -->
-
- <owl:Class rdf:about="#ContextualTagging">
- <rdfs:subClassOf rdf:resource="#ComputingContext"/>
- <owl:disjointWith rdf:resource="#Location"/>
- <owl:disjointWith rdf:resource="#TaggingWidget"/>
- <owl:disjointWith rdf:resource="#UserCurrentSituation"/>
- <owl:disjointWith rdf:resource="#Weather"/>
- <owl:disjointWith rdf:resource="#WeatherForecast"/>
- <rdfs:comment
- >Contextual tagging. ContextUseCaseCandidatesOP20090303.xls.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ContextualWidgetsandServices -->
-
- <owl:Class rdf:about="#ContextualWidgetsandServices">
- <rdfs:subClassOf rdf:resource="#Action"/>
- <owl:disjointWith rdf:resource="#Display"/>
- <owl:disjointWith rdf:resource="#DownloadedContent"/>
- <owl:disjointWith rdf:resource="#Events"/>
- <owl:disjointWith rdf:resource="#JamNotification"/>
- <owl:disjointWith rdf:resource="#Learning"/>
- <owl:disjointWith rdf:resource="#Maps"/>
- <owl:disjointWith rdf:resource="#PresenceStatus"/>
- <owl:disjointWith rdf:resource="#Sensors"/>
- <owl:disjointWith rdf:resource="#Situations"/>
- <owl:disjointWith rdf:resource="#Social"/>
- <owl:disjointWith rdf:resource="#Time"/>
- <owl:disjointWith rdf:resource="#Weather"/>
- <owl:disjointWith rdf:resource="#WeatherForecast"/>
- <owl:disjointWith rdf:resource="#Widgets"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#CurrentActivity -->
-
- <owl:Class rdf:about="#CurrentActivity">
- <rdfs:subClassOf rdf:resource="#Activity"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#isWatching"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#isCalling"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#isListening"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#isBrowsing"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#isChatting"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#isCreatingContent"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <owl:disjointWith rdf:resource="#CurrentActivityContext"/>
- <owl:disjointWith rdf:resource="#Person"/>
- <owl:disjointWith rdf:resource="#SituationBasedChanges"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#CurrentActivityContext -->
-
- <owl:Class rdf:about="#CurrentActivityContext">
- <rdfs:subClassOf rdf:resource="#Physicalcontext"/>
- <rdfs:comment
- >http://saescr005.ext.nokia.com/scrumworks/webreport/5MTMxMT</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#CurrentApplicationContext -->
-
- <owl:Class rdf:about="#CurrentApplicationContext">
- <rdfs:subClassOf rdf:resource="#Physicalcontext"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#currentApplication"/>
- <owl:someValuesFrom rdf:resource="&rdfs;Literal"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:comment
- >http://saescr005.ext.nokia.com/scrumworks/webreport/5MTMxMT</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#CurrentBackLightLevel -->
-
- <owl:Class rdf:about="#CurrentBackLightLevel">
- <rdfs:subClassOf rdf:resource="#Ambient_light"/>
- <owl:disjointWith rdf:resource="#Physicalcontext"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#CurrentEvent -->
-
- <owl:Class rdf:about="#CurrentEvent">
- <rdfs:subClassOf rdf:resource="#EventStructure"/>
- <rdfs:subClassOf rdf:resource="#Events"/>
- <owl:disjointWith rdf:resource="#DeviceOrientationforUI"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#CurrentEventContext -->
-
- <owl:Class rdf:about="#CurrentEventContext">
- <rdfs:subClassOf rdf:resource="#Physicalcontext"/>
- <owl:disjointWith rdf:resource="#EventStructure"/>
- <rdfs:comment
- >http://saescr005.ext.nokia.com/scrumworks/webreport/5MTMxMT</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#CurrentLocation -->
-
- <owl:Class rdf:about="#CurrentLocation">
- <rdfs:subClassOf rdf:resource="#Location"/>
- <rdfs:subClassOf rdf:resource="#Position"/>
- <owl:disjointWith rdf:resource="#Person"/>
- <owl:disjointWith rdf:resource="#Reminder"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#CurrentOrientation -->
-
- <owl:Class rdf:about="#CurrentOrientation">
- <rdfs:subClassOf rdf:resource="#Accelerometer"/>
- <rdfs:subClassOf rdf:resource="#Orientation"/>
- <owl:disjointWith rdf:resource="#DeviceOrientationforUI"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#CurrentStatus -->
-
- <owl:Class rdf:about="#CurrentStatus">
- <rdfs:subClassOf rdf:resource="#Accelerometer"/>
- <rdfs:subClassOf rdf:resource="#DeviceStatus"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#CurrentTimeZone -->
-
- <owl:Class rdf:about="#CurrentTimeZone">
- <rdfs:subClassOf rdf:resource="#Time"/>
- <rdfs:subClassOf rdf:resource="#TimeZones"/>
- <owl:disjointWith rdf:resource="#TimeZoneContext"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#DelayedBackupandSynchronization -->
-
- <owl:Class rdf:about="#DelayedBackupandSynchronization">
- <rdfs:subClassOf rdf:resource="#Action"/>
- <owl:disjointWith rdf:resource="#MusicPlayer"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#DelayedUploadShareofContent -->
-
- <owl:Class rdf:about="#DelayedUploadShareofContent">
- <rdfs:subClassOf rdf:resource="#Action"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasSubscribed"/>
- <owl:someValuesFrom rdf:resource="#SubscribedApplications"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <owl:disjointWith rdf:resource="#Multimedia"/>
- <owl:disjointWith rdf:resource="#NearbyDevices"/>
- <owl:disjointWith rdf:resource="#Share"/>
- <owl:disjointWith rdf:resource="#Sharemedia"/>
- <rdfs:comment
- >Delayed upload/share of content. ContextUseCaseCandidatesOP20090303.xls.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Device -->
-
- <owl:Class rdf:about="#Device">
- <rdfs:subClassOf rdf:resource="#Things"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#DeviceOrientationforUI -->
-
- <owl:Class rdf:about="#DeviceOrientationforUI">
- <rdfs:subClassOf rdf:resource="#Action"/>
- <owl:disjointWith rdf:resource="#DirectUI"/>
- <owl:disjointWith rdf:resource="#SetUIforCorrectPosition"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#DeviceStatus -->
-
- <owl:Class rdf:about="#DeviceStatus">
- <rdfs:subClassOf rdf:resource="#Accelerometer"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#DirectUI -->
-
- <owl:Class rdf:about="#DirectUI">
- <rdfs:subClassOf rdf:resource="#Application"/>
- <owl:disjointWith rdf:resource="#SituationBasedChanges"/>
- <owl:disjointWith rdf:resource="#VisualizingSituation"/>
- <rdfs:comment
- >Visualizing the situation (ContextUseCaseCandidatesOP20090303.xls).</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Display -->
-
- <owl:Class rdf:about="#Display">
- <rdfs:subClassOf rdf:resource="#Device"/>
- <owl:disjointWith rdf:resource="#SituationBasedChanges"/>
- <owl:disjointWith rdf:resource="#TouchEventContext"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Download -->
-
- <owl:Class rdf:about="#Download">
- <rdfs:subClassOf rdf:resource="#Application"/>
- <owl:disjointWith rdf:resource="#ProvidersforOnlineContext"/>
- <owl:disjointWith rdf:resource="#SituationBasedChanges"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#DownloadedContent -->
-
- <owl:Class rdf:about="#DownloadedContent">
- <rdfs:subClassOf rdf:resource="#ProvidersforOnlineContext"/>
- <rdfs:comment
- >Downloaded content that can be viewed at any time.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#DuringDay -->
-
- <owl:Class rdf:about="#DuringDay">
- <rdfs:subClassOf rdf:resource="#Situations"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#available"/>
- <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#atWork"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#remainderStatus"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <owl:disjointWith rdf:resource="#MostUsedApplications"/>
- <owl:disjointWith rdf:resource="#Person"/>
- <owl:disjointWith rdf:resource="#WeatherForecast"/>
- <owl:disjointWith rdf:resource="#WorkLocation"/>
- <rdfs:comment
- >During day with Mary. Context_Aware_Situation_Manager.ppt, slide 5.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ETag -->
-
- <owl:Class rdf:about="#ETag">
- <rdfs:subClassOf rdf:resource="#Person"/>
- <rdfs:comment
- >Opaque string that changes whenever contents of resource changes. Value can be used in conditional operations. Read-only (value managed by the system).
-
-PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#EasyAccess -->
-
- <owl:Class rdf:about="#EasyAccess">
- <rdfs:subClassOf rdf:resource="#Application"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#EmailUsageFrequency -->
-
- <owl:Class rdf:about="#EmailUsageFrequency">
- <rdfs:subClassOf rdf:resource="#ApplicationUsageFrequencies"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Emails -->
-
- <owl:Class rdf:about="#Emails">
- <rdfs:subClassOf rdf:resource="#Person"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#EmailPrimary"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#EmailValue"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#EmailType"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:comment>PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#EnvironmentalContext -->
-
- <owl:Class rdf:about="#EnvironmentalContext">
- <rdfs:subClassOf rdf:resource="#UsersContext"/>
- <owl:disjointWith rdf:resource="#UsersContext"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Evening -->
-
- <owl:Class rdf:about="#Evening">
- <rdfs:subClassOf rdf:resource="#Situations"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#isDockedinCar"/>
- <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
- </owl:Restriction>
- </rdfs:subClassOf>
- <owl:disjointWith rdf:resource="#WeatherForecast"/>
- <rdfs:comment
- >In the evening with Mary. Context_Aware_Situation_Manager.ppt, slide 6.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Event -->
-
- <owl:Class rdf:about="#Event">
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#ringing"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#receivedCall"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#startedCall"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <rdfs:subClassOf rdf:resource="#Activity"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Next"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Current"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#EventStructure -->
-
- <owl:Class rdf:about="#EventStructure">
- <rdfs:subClassOf rdf:resource="#Events"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#EventStartTime"/>
- <owl:someValuesFrom rdf:resource="&xsd;int"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#EventType"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#EventEndTime"/>
- <owl:someValuesFrom rdf:resource="&xsd;int"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#EventURI"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#EventTitle"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#isOnVacation"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Events -->
-
- <owl:Class rdf:about="#Events">
- <rdfs:subClassOf rdf:resource="#Device"/>
- <owl:disjointWith rdf:resource="#SituationBasedChanges"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Everybody -->
-
- <owl:Class rdf:about="#Everybody">
- <rdfs:subClassOf rdf:resource="#BasicInfoVisibility"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Everyone -->
-
- <owl:Class rdf:about="#Everyone">
- <rdfs:subClassOf rdf:resource="#Members"/>
- <rdfs:subClassOf rdf:resource="#Person"/>
- <rdfs:comment>PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ExternalCard -->
-
- <owl:Class rdf:about="#ExternalCard">
- <rdfs:subClassOf rdf:resource="#Accessories"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasExternalCard"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ExternalMmcCoverOpen -->
-
- <owl:Class rdf:about="#ExternalMmcCoverOpen">
- <rdfs:subClassOf rdf:resource="#Accessories"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#isExternalMMCCoverOpen"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#FMReceiver -->
-
- <owl:Class rdf:about="#FMReceiver">
- <rdfs:subClassOf rdf:resource="#Accessories"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasFMReceiver"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#FMTransmitter -->
-
- <owl:Class rdf:about="#FMTransmitter">
- <rdfs:subClassOf rdf:resource="#Accessories"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasFMTransmitter"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Family -->
-
- <owl:Class rdf:about="#Family">
- <rdfs:subClassOf rdf:resource="#Members"/>
- <rdfs:subClassOf rdf:resource="#Person"/>
- <rdfs:comment>PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Feedback -->
-
- <owl:Class rdf:about="#Feedback">
- <rdfs:subClassOf rdf:resource="#Learning"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Feeds -->
-
- <owl:Class rdf:about="#Feeds">
- <rdfs:subClassOf rdf:resource="#Application"/>
- <owl:disjointWith rdf:resource="#ProvidersforOnlineContext"/>
- <owl:disjointWith rdf:resource="#SituationBasedChanges"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Food -->
-
- <owl:Class rdf:about="#Food">
- <rdfs:subClassOf rdf:resource="#Person"/>
- <owl:disjointWith rdf:resource="#UserPreferences"/>
- <rdfs:comment
- >Favorite food of person. List of words or phrases. Plural property. PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#FrequencyCheckThresholdValue -->
-
- <owl:Class rdf:about="#FrequencyCheckThresholdValue">
- <rdfs:subClassOf rdf:resource="#ApplicationUsageFrequencies"/>
- <rdfs:comment
- >Time in hours when new frequency check is allowed. E.g. once in week ==&gt; Then the value of this 168. Naturally the value is updateable at any time.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Friends -->
-
- <owl:Class rdf:about="#Friends">
- <rdfs:subClassOf rdf:resource="#Members"/>
- <rdfs:subClassOf rdf:resource="#Person"/>
- <owl:disjointWith rdf:resource="#VisibilityforFriends"/>
- <rdfs:comment>PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#GPSModule -->
-
- <owl:Class rdf:about="#GPSModule">
- <rdfs:subClassOf rdf:resource="#Accessories"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Games -->
-
- <owl:Class rdf:about="#Games">
- <rdfs:subClassOf rdf:resource="#Person"/>
- <owl:disjointWith rdf:resource="#UserPreferences"/>
- <rdfs:comment
- >Favorite games of person. List of words or phrases. Plural property. PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Gender -->
-
- <owl:Class rdf:about="#Gender">
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Female"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Male"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <rdfs:subClassOf rdf:resource="#Person"/>
- <rdfs:comment
- >Gender of person (male|female). Singular property. PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Groups -->
-
- <owl:Class rdf:about="#Groups">
- <rdfs:subClassOf rdf:resource="#People"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#GroupETag"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#GroupID"/>
- <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#GroupName"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <owl:disjointWith rdf:resource="#MemberOf"/>
- <owl:disjointWith rdf:resource="#Person"/>
- <owl:disjointWith rdf:resource="#Users"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Headset -->
-
- <owl:Class rdf:about="#Headset">
- <rdfs:subClassOf rdf:resource="#Accessories"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasHeadset"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Hobbies -->
-
- <owl:Class rdf:about="#Hobbies">
- <rdfs:subClassOf rdf:resource="#Person"/>
- <owl:disjointWith rdf:resource="#UserPreferences"/>
- <rdfs:comment
- >Hobbies of person. List of words or phrases. Plural property. PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#HomeLocation -->
-
- <owl:Class rdf:about="#HomeLocation">
- <rdfs:subClassOf rdf:resource="#Location"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#PositionVariables"/>
- <owl:someValuesFrom rdf:resource="&xsd;double"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <owl:disjointWith rdf:resource="#MorningSituation"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Ims -->
-
- <owl:Class rdf:about="#Ims">
- <rdfs:subClassOf rdf:resource="#Person"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#IMSType"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#IMSPrimary"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#IMSValue"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:comment
- >Address for Instant Messaging and Presence Protocol applications (see e.g. RFC4770). PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#InMeeting -->
-
- <owl:Class rdf:about="#InMeeting">
- <rdfs:subClassOf rdf:resource="#Situations"/>
- <owl:disjointWith rdf:resource="#Location"/>
- <owl:disjointWith rdf:resource="#Messaging"/>
- <owl:disjointWith rdf:resource="#People"/>
- <owl:disjointWith rdf:resource="#PresenceStatus"/>
- <owl:disjointWith rdf:resource="#WeatherForecast"/>
- <owl:backwardCompatibleWith
- >During the day with Mary. Context_Aware_Situation_Manager.ppt, slide 5.</owl:backwardCompatibleWith>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Interests -->
-
- <owl:Class rdf:about="#Interests">
- <rdfs:subClassOf rdf:resource="#Person"/>
- <owl:disjointWith rdf:resource="#UserPreferences"/>
- <rdfs:comment
- >Interests of person. List of words or phrases. Plural property. PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#JamNotification -->
-
- <owl:Class rdf:about="#JamNotification">
- <rdfs:subClassOf rdf:resource="#ProvidersforOnlineContext"/>
- <owl:disjointWith rdf:resource="#Person"/>
- <owl:disjointWith rdf:resource="#Physicalcontext"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Keyboard -->
-
- <owl:Class rdf:about="#Keyboard">
- <rdfs:subClassOf rdf:resource="#Accessories"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasKeyboard"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#KeyboardOpen -->
-
- <owl:Class rdf:about="#KeyboardOpen">
- <rdfs:subClassOf rdf:resource="#Accessories"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#isKeyboardOpen"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Landmarks -->
-
- <owl:Class rdf:about="#Landmarks">
- <rdfs:subClassOf rdf:resource="#Places"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#LastMusic -->
-
- <owl:Class rdf:about="#LastMusic">
- <rdfs:subClassOf rdf:resource="#Activity"/>
- <owl:disjointWith rdf:resource="#Music"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#LatetsFrequencyCheckMade -->
-
- <owl:Class rdf:about="#LatetsFrequencyCheckMade">
- <rdfs:subClassOf rdf:resource="#ApplicationUsageFrequencies"/>
- <rdfs:comment
- >Tells when the latest frequency check is made This prevents &#39;ping-pong&#39; effects that migh make updates constantly.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Learning -->
-
- <owl:Class rdf:about="#Learning">
- <rdfs:subClassOf rdf:resource="#Device"/>
- <owl:disjointWith rdf:resource="#MostUsedApplications"/>
- <rdfs:comment
- >Most used applications (ContextUseCaseCandidatesOP20090303.xls).</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#LearningAlgorithms -->
-
- <owl:Class rdf:about="#LearningAlgorithms">
- <rdfs:subClassOf rdf:resource="#Learning"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Light -->
-
- <owl:Class rdf:about="#Light">
- <rdfs:subClassOf rdf:resource="#Sensors"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Location -->
-
- <owl:Class rdf:about="#Location">
- <rdfs:subClassOf rdf:resource="#Places"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#GPSModuleAttached"/>
- <owl:someValuesFrom rdf:resource="#GPSModule"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <owl:disjointWith rdf:resource="#Location-basedWLANSearch"/>
- <owl:disjointWith rdf:resource="#Situations"/>
- <owl:disjointWith rdf:resource="#TimezoneAwareness"/>
- <owl:disjointWith rdf:resource="#ViewandNavigatetoMeetingLocation"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Location-basedWLANSearch -->
-
- <owl:Class rdf:about="#Location-basedWLANSearch">
- <rdfs:subClassOf rdf:resource="#Action"/>
- <rdfs:comment
- >Location-based WLAN search. ContextUseCaseCandidatesOP20090303.xls.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Magnetometer -->
-
- <owl:Class rdf:about="#Magnetometer">
- <rdfs:subClassOf rdf:resource="#Sensors"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasMagnetometer"/>
- <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#PointingDirection"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <owl:disjointWith rdf:resource="#MagnetometerContext"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#MagnetometerContext -->
-
- <owl:Class rdf:about="#MagnetometerContext">
- <rdfs:subClassOf rdf:resource="#Physicalcontext"/>
- <rdfs:comment
- >http://saescr005.ext.nokia.com/scrumworks/webreport/5MTMxMT</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#MapView -->
-
- <owl:Class rdf:about="#MapView">
- <rdfs:subClassOf rdf:resource="#Location"/>
- <owl:disjointWith rdf:resource="#UsualRoute"/>
- <rdfs:comment
- >Showing map, showing landmarks on map.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Maps -->
-
- <owl:Class rdf:about="#Maps">
- <rdfs:subClassOf rdf:resource="#Application"/>
- <owl:disjointWith rdf:resource="#SituationBasedChanges"/>
- <owl:disjointWith rdf:resource="#TimezoneAwareness"/>
- <owl:disjointWith rdf:resource="#ViewandNavigatetoMeetingLocation"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#MaritalStatus -->
-
- <owl:Class rdf:about="#MaritalStatus">
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Widowed"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Married"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Individual"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Cohabitating"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Engaged"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Separated"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Single"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <rdfs:subClassOf rdf:resource="#Person"/>
- <rdfs:comment
- >Marital status of person (single|married|separated|divorced|widowed|engaged|cohabitating). PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#MemberOf -->
-
- <owl:Class rdf:about="#MemberOf">
- <rdfs:subClassOf rdf:resource="#Person"/>
- <rdfs:comment
- >List of groups that person belongs to. Value is maintained by the system and cannot be modified by user. PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Members -->
-
- <owl:Class rdf:about="#Members">
- <rdfs:subClassOf rdf:resource="#Groups"/>
- <owl:disjointWith rdf:resource="#VisibilityforFriends"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Memory -->
-
- <owl:Class rdf:about="#Memory">
- <rdfs:subClassOf rdf:resource="#Device"/>
- <owl:disjointWith rdf:resource="#MemoryContext"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#MemoryContext -->
-
- <owl:Class rdf:about="#MemoryContext">
- <rdfs:subClassOf rdf:resource="#Physicalcontext"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#MemoryStatus"/>
- <owl:someValuesFrom rdf:resource="&rdfs;Literal"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <owl:backwardCompatibleWith
- >http://saescr005.ext.nokia.com/scrumworks/webreport/5MTMxMT</owl:backwardCompatibleWith>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#MentalContext -->
-
- <owl:Class rdf:about="#MentalContext">
- <rdfs:subClassOf rdf:resource="#PersonalContext"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Menu -->
-
- <owl:Class rdf:about="#Menu">
- <rdfs:subClassOf rdf:resource="#Application"/>
- <owl:disjointWith rdf:resource="#SituationBasedChanges"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Messaging -->
-
- <owl:Class rdf:about="#Messaging">
- <rdfs:subClassOf rdf:resource="#Application"/>
- <owl:disjointWith rdf:resource="#SituationBasedChanges"/>
- <owl:disjointWith rdf:resource="#VisualizingSituation"/>
- <rdfs:comment
- >Visualizing the situation (ContextUseCaseCandidatesOP20090303.xls).</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Microphone -->
-
- <owl:Class rdf:about="#Microphone">
- <rdfs:subClassOf rdf:resource="#Accessories"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasMicrophone"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#MorningSituation -->
-
- <owl:Class rdf:about="#MorningSituation">
- <rdfs:subClassOf rdf:resource="#Situations"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#morning"/>
- <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasUsualRoute"/>
- <owl:someValuesFrom rdf:resource="#UsualRoute"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#alarmSet"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#currentWeather"/>
- <owl:someValuesFrom rdf:resource="#MorningSituation"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasSubscribedJamNotification"/>
- <owl:someValuesFrom rdf:resource="#MorningSituation"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#available"/>
- <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
- </owl:Restriction>
- </rdfs:subClassOf>
- <owl:disjointWith rdf:resource="#MostUsedApplications"/>
- <owl:disjointWith rdf:resource="#WeatherForecast"/>
- <rdfs:comment
- >&quot;In the morning with Mary&quot; (Context_Aware_Situation_Manager.ppt)</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#MostUsedApplications -->
-
- <owl:Class rdf:about="#MostUsedApplications">
- <rdfs:subClassOf rdf:resource="#ComputingContext"/>
- <owl:disjointWith rdf:resource="#UnusedApplications"/>
- <owl:disjointWith rdf:resource="#VisualizingSituation"/>
- <owl:disjointWith rdf:resource="#Weather"/>
- <owl:disjointWith rdf:resource="#WeatherForecast"/>
- <owl:disjointWith rdf:resource="#WorkRelatedApplications"/>
- <rdfs:comment
- >You can create e.g. a formula where you calculate and average value of the applications usage frequencies and those values that are above the average values are considered as MostUsedApplications.
-
-Most used application (ContextUseCaseCandidatesOP20090303.xls).</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Mouse -->
-
- <owl:Class rdf:about="#Mouse">
- <rdfs:subClassOf rdf:resource="#Accessories"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasMouse"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Movies -->
-
- <owl:Class rdf:about="#Movies">
- <rdfs:subClassOf rdf:resource="#Person"/>
- <owl:disjointWith rdf:resource="#UserPreferences"/>
- <rdfs:comment
- >Favorite movies of person. List of words or phrases. Plural property. PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#MultiTouchScreen -->
-
- <owl:Class rdf:about="#MultiTouchScreen">
- <rdfs:subClassOf rdf:resource="#Accessories"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasMultiTouchScreen"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Multimedia -->
-
- <owl:Class rdf:about="#Multimedia">
- <rdfs:subClassOf rdf:resource="#Application"/>
- <owl:disjointWith rdf:resource="#ProvidersforOnlineContext"/>
- <rdfs:comment
- >All kinds of media like audio, video, images etc.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Music -->
-
- <owl:Class rdf:about="#Music">
- <rdfs:subClassOf rdf:resource="#Person"/>
- <owl:disjointWith rdf:resource="#UserPreferences"/>
- <rdfs:comment
- >Favorite music of person. List of words or phrases. Plural property. PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#MusicPlayer -->
-
- <owl:Class rdf:about="#MusicPlayer">
- <rdfs:subClassOf rdf:resource="#Application"/>
- <owl:disjointWith rdf:resource="#VolumeIncreaseinNoisyEnvironment"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Navigator -->
-
- <owl:Class rdf:about="#Navigator">
- <rdfs:subClassOf rdf:resource="#Location"/>
- <owl:disjointWith rdf:resource="#UsualRoute"/>
- <rdfs:comment
- >Selecting a location from map, engaging navigation.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#NearbyContacsContext -->
-
- <owl:Class rdf:about="#NearbyContacsContext">
- <rdfs:subClassOf rdf:resource="#Physicalcontext"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasNearByContacts"/>
- <owl:someValuesFrom rdf:resource="#NearbyPeople"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <owl:disjointWith rdf:resource="#NearbyPeople"/>
- <rdfs:comment
- >http://saescr005.ext.nokia.com/scrumworks/webreport/5MTMxMT</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#NearbyDevices -->
-
- <owl:Class rdf:about="#NearbyDevices">
- <rdfs:subClassOf rdf:resource="#Connectivity"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="&DeliveryContext;deviceIdentifier"/>
- <owl:someValuesFrom rdf:resource="&rdfs;Literal"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#NearbyPeople -->
-
- <owl:Class rdf:about="#NearbyPeople">
- <rdfs:subClassOf rdf:resource="#Users"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#usersCurrentLocation"/>
- <owl:someValuesFrom rdf:resource="#CurrentLocation"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasNearByContacts"/>
- <owl:someValuesFrom rdf:resource="#Person"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Nickname -->
-
- <owl:Class rdf:about="#Nickname">
- <rdfs:subClassOf rdf:resource="#Person"/>
- <rdfs:comment>PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Note -->
-
- <owl:Class rdf:about="#Note">
- <rdfs:subClassOf rdf:resource="#Person"/>
- <rdfs:comment
- >Supplemental information (e.g. a comment) that is associated with person. PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#NotificationType -->
-
- <owl:Class rdf:about="#NotificationType">
- <rdfs:subClassOf rdf:resource="#Notifications"/>
- <rdfs:comment
- >Type of the notification. Enumeration. Supported values: &quot;invitationSent&quot;, &quot;invitationReceived&quot;,
-&#8220;invitationRejected&#8221;,
-&#8220;invitationCancelled&#8221;,
-&quot;relationCreated&quot;, &quot;relationRemoved&quot;,</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Notifications -->
-
- <owl:Class rdf:about="#Notifications">
- <rdfs:subClassOf rdf:resource="#Users"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#From"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Received"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#NotificationID"/>
- <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#To"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <owl:disjointWith rdf:resource="#SituationBasedChanges"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Organizations -->
-
- <owl:Class rdf:about="#Organizations">
- <rdfs:subClassOf rdf:resource="#Person"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#NameOfOrganization"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Title"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Department"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:comment
- >Organizational title, name and department associated with person. PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Orientation -->
-
- <owl:Class rdf:about="#Orientation">
- <rdfs:subClassOf rdf:resource="#Accelerometer"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#OviProfile -->
-
- <owl:Class rdf:about="#OviProfile">
- <rdfs:subClassOf rdf:resource="#Users"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#People -->
-
- <owl:Class rdf:about="#People">
- <rdfs:subClassOf rdf:resource="#Context"/>
- <owl:disjointWith rdf:resource="#UsersContext"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Peripherals -->
-
- <owl:Class rdf:about="#Peripherals">
- <rdfs:subClassOf rdf:resource="#Device"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#PrinterName"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Person -->
-
- <owl:Class rdf:about="#Person">
- <rdfs:subClassOf rdf:resource="#Social"/>
- <rdfs:subClassOf rdf:resource="#iCalendar"/>
- <rdfs:subClassOf rdf:resource="#vCard"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#UserID"/>
- <owl:someValuesFrom rdf:resource="&xsd;unsignedLong"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasSubscribedJamNotification"/>
- <owl:someValuesFrom rdf:resource="#JamNotification"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasMorningSituation"/>
- <owl:someValuesFrom rdf:resource="#MorningSituation"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#remainderStatus"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#PersonID"/>
- <owl:someValuesFrom rdf:resource="&xsd;int"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#IMStatus"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <owl:disjointWith rdf:resource="#Users"/>
- <owl:disjointWith rdf:resource="#UsualRoute"/>
- <rdfs:comment
- >Person object represents either another Ovi user or a contact record (person.type property indicates which one).
-
-It might be good to know, what is the current activity (value of CurrentActivity class) and current location (CurrentLocation class) of friends etc.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PersonName -->
-
- <owl:Class rdf:about="#PersonName">
- <rdfs:subClassOf rdf:resource="#Person"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#FamilyName"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#HonoricSuffix"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#MiddleName"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#GivenName"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#HonoricPrefix"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:comment>PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PersonalContext -->
-
- <owl:Class rdf:about="#PersonalContext">
- <rdfs:subClassOf rdf:resource="#UsersContext"/>
- <owl:disjointWith rdf:resource="#UsersContext"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PhoneNumbers -->
-
- <owl:Class rdf:about="#PhoneNumbers">
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#PhoneNumberType_Work"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#PhonenumberType_Home"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#PhonenumberType_Mobile"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#PhonenumberType_Fax"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#PhonenumberType"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <rdfs:subClassOf rdf:resource="#Person"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#PhoneNumberValue"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:comment>PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PhotoSize -->
-
- <owl:Class rdf:about="#PhotoSize">
- <rdfs:subClassOf rdf:resource="#Person"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#PhotoHuge"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#PhotoHugeData"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#PhotoLarge"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#PhotoLargeData"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:comment>PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Physicalcontext -->
-
- <owl:Class rdf:about="#Physicalcontext">
- <rdfs:subClassOf rdf:resource="#Context"/>
- <owl:disjointWith rdf:resource="#Places"/>
- <owl:disjointWith rdf:resource="#Things"/>
- <owl:disjointWith rdf:resource="#WeatherForecast"/>
- <owl:disjointWith rdf:resource="&DeliveryContext;DeliveryContext_EnvironmentEntity"/>
- <owl:disjointWith rdf:resource="&DeliveryContext;DeliveryContext_HardwareEntity"/>
- <owl:disjointWith rdf:resource="&DeliveryContext;DeliveryContext_MeasureEntity"/>
- <owl:disjointWith rdf:resource="&DeliveryContext;Environment"/>
- <rdfs:comment
- >Such as lighting, noise levels, traffic conditions, and temperature.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PhysiologicalContext -->
-
- <owl:Class rdf:about="#PhysiologicalContext">
- <rdfs:subClassOf rdf:resource="#PersonalContext"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Places -->
-
- <owl:Class rdf:about="#Places">
- <rdfs:subClassOf rdf:resource="#Context"/>
- <owl:disjointWith rdf:resource="#Users"/>
- <owl:disjointWith rdf:resource="#UsersContext"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PlacesVisited -->
-
- <owl:Class rdf:about="#PlacesVisited">
- <rdfs:subClassOf rdf:resource="#Person"/>
- <owl:disjointWith rdf:resource="#UserPreferences"/>
- <rdfs:comment
- >Places visited by person. List of words or phrases. Plural property. PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Policy -->
-
- <owl:Class rdf:about="#Policy">
- <rdfs:subClassOf rdf:resource="#Device"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Position -->
-
- <owl:Class rdf:about="#Position">
- <rdfs:subClassOf rdf:resource="#Location"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#PositionVariables"/>
- <owl:someValuesFrom rdf:resource="&xsd;double"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <owl:disjointWith rdf:resource="#UsualRoute"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PositionFix -->
-
- <owl:Class rdf:about="#PositionFix">
- <rdfs:subClassOf rdf:resource="#Location"/>
- <rdfs:subClassOf rdf:resource="#Position"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Speed"/>
- <owl:someValuesFrom rdf:resource="&xsd;double"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#SatelliteNumViewUsed"/>
- <owl:someValuesFrom rdf:resource="&xsd;double"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#MagneticCource"/>
- <owl:someValuesFrom rdf:resource="&xsd;double"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Heading"/>
- <owl:someValuesFrom rdf:resource="&xsd;double"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#SpeedAccuracy"/>
- <owl:someValuesFrom rdf:resource="&xsd;double"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#MagneticVariation"/>
- <owl:someValuesFrom rdf:resource="&xsd;double"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#LocalTimeStamp"/>
- <owl:someValuesFrom rdf:resource="&xsd;dateTime"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#UTCTimeStamp"/>
- <owl:someValuesFrom rdf:resource="&xsd;dateTime"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#SatelliteNumView"/>
- <owl:someValuesFrom rdf:resource="&xsd;double"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#HeadingAccuracy"/>
- <owl:someValuesFrom rdf:resource="&xsd;double"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <owl:disjointWith rdf:resource="#UsualRoute"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Presence -->
-
- <owl:Class rdf:about="#Presence">
- <rdfs:subClassOf rdf:resource="#Device"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PresenceContext -->
-
- <owl:Class rdf:about="#PresenceContext">
- <rdfs:subClassOf rdf:resource="#Physicalcontext"/>
- <owl:disjointWith rdf:resource="#PresenceStatus"/>
- <rdfs:comment
- >http://saescr005.ext.nokia.com/scrumworks/webreport/5MTMxMT</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PresenceStatus -->
-
- <owl:Class rdf:about="#PresenceStatus">
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#isBusy"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#isAvailable"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#isAway"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <rdfs:subClassOf rdf:resource="#Presence"/>
- <owl:disjointWith rdf:resource="#ViewandNavigatetoMeetingLocation"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#PresenceUpdate -->
-
- <owl:Class rdf:about="#PresenceUpdate">
- <rdfs:subClassOf rdf:resource="#Action"/>
- <rdfs:comment
- >Update global presence status according to events scheduled in Calendar. ContextUseCaseCandidatesOP20090303.xls</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Profile -->
-
- <owl:Class rdf:about="#Profile">
- <rdfs:subClassOf rdf:resource="#Setting"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ProfileName -->
-
- <owl:Class rdf:about="#ProfileName">
- <rdfs:subClassOf rdf:resource="#Profile"/>
- <owl:disjointWith rdf:resource="#SituationBasedChanges"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ProfileURL -->
-
- <owl:Class rdf:about="#ProfileURL">
- <rdfs:subClassOf rdf:resource="#Person"/>
- <rdfs:comment
- >URL to a profile page of person in Ovi. PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ProvidersforOnlineContentContext -->
-
- <owl:Class rdf:about="#ProvidersforOnlineContentContext">
- <rdfs:subClassOf rdf:resource="#Physicalcontext"/>
- <owl:disjointWith rdf:resource="#ProvidersforOnlineContext"/>
- <rdfs:comment
- >http://saescr005.ext.nokia.com/scrumworks/webreport/5MTMxMT</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ProvidersforOnlineContext -->
-
- <owl:Class rdf:about="#ProvidersforOnlineContext">
- <rdfs:subClassOf rdf:resource="#Device"/>
- <owl:disjointWith rdf:resource="#Share"/>
- <owl:disjointWith rdf:resource="#Time"/>
- <owl:disjointWith rdf:resource="#Widgets"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ProximitySensor -->
-
- <owl:Class rdf:about="#ProximitySensor">
- <rdfs:subClassOf rdf:resource="#Sensors"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#isNearSomething"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasProximitySensor"/>
- <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ProximitySensorContext -->
-
- <owl:Class rdf:about="#ProximitySensorContext">
- <rdfs:subClassOf rdf:resource="#Physicalcontext"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#isNearSomething"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:comment
- >http://saescr005.ext.nokia.com/scrumworks/webreport/5MTMxMT</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#RefersTo -->
-
- <owl:Class rdf:about="#RefersTo">
- <rdfs:subClassOf rdf:resource="#Person"/>
- <rdfs:comment
- >In case person object represents a contact record (i.e. it has a person.type property with value &#8220;contact card&#8221;) the refersTo attribute may connect the contact record to an Ovi user profile within the system (all contact records do not have this attribute). Value is an id of a person object that represents the Ovi profile of this particular contact. Value is maintained by the system and cannot be modified by user. Singular property.
-
-PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Reminder -->
-
- <owl:Class rdf:about="#Reminder">
- <rdfs:subClassOf rdf:resource="#ProvidersforOnlineContext"/>
- <owl:disjointWith rdf:resource="#UserPreferences"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#SMSUsageFrequency -->
-
- <owl:Class rdf:about="#SMSUsageFrequency">
- <rdfs:subClassOf rdf:resource="#ApplicationUsageFrequencies"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Sensors -->
-
- <owl:Class rdf:about="#Sensors">
- <rdfs:subClassOf rdf:resource="#Device"/>
- <owl:disjointWith rdf:resource="#SituationBasedChanges"/>
- <owl:disjointWith rdf:resource="#Situations"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#SetUIforCorrectPosition -->
-
- <owl:Class rdf:about="#SetUIforCorrectPosition">
- <rdfs:subClassOf rdf:resource="#Action"/>
- <rdfs:comment
- >Device orientation for UI. ContextUseCaseCandidatesOP20090303.xls.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Setting -->
-
- <owl:Class rdf:about="#Setting">
- <rdfs:subClassOf rdf:resource="#Device"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Share -->
-
- <owl:Class rdf:about="#Share">
- <rdfs:subClassOf rdf:resource="#Application"/>
- <rdfs:comment
- >Sharing medias like images, videos.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Sharemedia -->
-
- <owl:Class rdf:about="#Sharemedia">
- <rdfs:subClassOf rdf:resource="#Action"/>
- <rdfs:comment
- >Delayed upload/share of content. ContextUseCaseCandidatesOP20090303.xls</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#SignatureforAV -->
-
- <owl:Class rdf:about="#SignatureforAV">
- <rdfs:subClassOf rdf:resource="#Accessories"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#SituationBasedChanges -->
-
- <owl:Class rdf:about="#SituationBasedChanges">
- <rdfs:subClassOf rdf:resource="#Action"/>
- <rdfs:subClassOf rdf:resource="#Alarm"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#IMStatus"/>
- <owl:someValuesFrom rdf:resource="&rdfs;Literal"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#AccessoryStatus"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#SituationStatus"/>
- <owl:someValuesFrom rdf:resource="&rdfs;Literal"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#SoundLevel"/>
- <owl:someValuesFrom rdf:resource="&xsd;int"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Speed"/>
- <owl:someValuesFrom rdf:resource="&xsd;int"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#BatteryStatus"/>
- <owl:someValuesFrom rdf:resource="&xsd;int"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <owl:disjointWith rdf:resource="#Situations"/>
- <owl:disjointWith rdf:resource="#Time"/>
- <owl:disjointWith rdf:resource="#UserPreferences"/>
- <owl:disjointWith rdf:resource="#Weather"/>
- <owl:disjointWith rdf:resource="#WeatherForecast"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Situations -->
-
- <owl:Class rdf:about="#Situations">
- <rdfs:subClassOf rdf:resource="#Social"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#running"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#walking"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <owl:disjointWith rdf:resource="#VisualizingSituation"/>
- <owl:disjointWith rdf:resource="#WeatherForecast"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Social -->
-
- <owl:Class rdf:about="#Social">
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#atWork"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <rdfs:subClassOf rdf:resource="#People"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#socialContext"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#isBusyText"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#isGoingToWork"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#isWithColleagues"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#isGoingToHome"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#isWithFriends"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#SocialContext -->
-
- <owl:Class rdf:about="#SocialContext">
- <rdfs:subClassOf rdf:resource="#UsersContext"/>
- <owl:disjointWith rdf:resource="#UsersContext"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Spatio&#8722;TemporalContext -->
-
- <owl:Class rdf:about="#Spatio&#8722;TemporalContext">
- <rdfs:subClassOf rdf:resource="#UsersContext"/>
- <owl:disjointWith rdf:resource="#UsersContext"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Spouse -->
-
- <owl:Class rdf:about="#Spouse">
- <rdfs:subClassOf rdf:resource="#Person"/>
- <rdfs:comment>PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Status -->
-
- <owl:Class rdf:about="#Status">
- <rdfs:subClassOf rdf:resource="#Situations"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#SubscribedApplications -->
-
- <owl:Class rdf:about="#SubscribedApplications">
- <rdfs:subClassOf rdf:resource="#ApplicationSubscriptionStatus"/>
- <owl:disjointWith rdf:resource="#UnSubscribedApplications"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Synchronization -->
-
- <owl:Class rdf:about="#Synchronization">
- <rdfs:subClassOf rdf:resource="#Application"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#TaggingWidget -->
-
- <owl:Class rdf:about="#TaggingWidget">
- <rdfs:subClassOf rdf:resource="#Widgets"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#TaskContext -->
-
- <owl:Class rdf:about="#TaskContext">
- <rdfs:subClassOf rdf:resource="#UsersContext"/>
- <owl:disjointWith rdf:resource="#UsersContext"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Telephone -->
-
- <owl:Class rdf:about="#Telephone">
- <rdfs:subClassOf rdf:resource="#Application"/>
- <owl:disjointWith rdf:resource="#VolumeIncreaseinNoisyEnvironment"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#TelephoneUsageFrequency -->
-
- <owl:Class rdf:about="#TelephoneUsageFrequency">
- <rdfs:subClassOf rdf:resource="#ApplicationUsageFrequencies"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Things -->
-
- <owl:Class rdf:about="#Things">
- <rdfs:subClassOf rdf:resource="#Context"/>
- <owl:disjointWith rdf:resource="#Users"/>
- <owl:disjointWith rdf:resource="#UsersContext"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Time -->
-
- <owl:Class rdf:about="#Time">
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#afternoon"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#timeOfYear"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#morningNight"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#morning"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#midnight"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#evening"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#timeOfDay"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Autumn"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#eveningNight"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Spring"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Summer"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Winter"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <rdfs:subClassOf rdf:resource="#Device"/>
- <owl:disjointWith rdf:resource="#TimeContext"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#TimeContext -->
-
- <owl:Class rdf:about="#TimeContext">
- <rdfs:subClassOf rdf:resource="#Physicalcontext"/>
- <rdfs:comment
- >http://saescr005.ext.nokia.com/scrumworks/webreport/5MTMxMT</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#TimeZoneContext -->
-
- <owl:Class rdf:about="#TimeZoneContext">
- <rdfs:subClassOf rdf:resource="#Physicalcontext"/>
- <rdfs:comment
- >http://saescr005.ext.nokia.com/scrumworks/webreport/5MTMxMT</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#TimeZones -->
-
- <owl:Class rdf:about="#TimeZones">
- <rdfs:subClassOf rdf:resource="#Time"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#LOGO"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <owl:disjointWith rdf:resource="#TimezoneAwareness"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#TimezoneAwareness -->
-
- <owl:Class rdf:about="#TimezoneAwareness">
- <rdfs:subClassOf rdf:resource="#Action"/>
- <rdfs:comment
- >Timezone awareness. ContextUseCaseCandidatesOP20090303.xls.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#TouchEventContext -->
-
- <owl:Class rdf:about="#TouchEventContext">
- <rdfs:subClassOf rdf:resource="#Physicalcontext"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#lastTouch"/>
- <owl:someValuesFrom rdf:resource="&xsd;time"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:comment
- >http://saescr005.ext.nokia.com/scrumworks/webreport/5MTMxMT</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Type -->
-
- <owl:Class rdf:about="#Type">
- <rdfs:subClassOf rdf:resource="#Person"/>
- <rdfs:comment
- >Type of a Person object. Singular property. Enumeration. Supported values: &#8220;profile&#8221;, &#8220;contactCard&#8221;. Read-only (value managed by the system).
-
-PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#USBCableAttached -->
-
- <owl:Class rdf:about="#USBCableAttached">
- <rdfs:subClassOf rdf:resource="#Accessories"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#isUSBCapleAttached"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#UnSubscribedApplications -->
-
- <owl:Class rdf:about="#UnSubscribedApplications">
- <rdfs:subClassOf rdf:resource="#ApplicationSubscriptionStatus"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#UnusedApplications -->
-
- <owl:Class rdf:about="#UnusedApplications">
- <rdfs:subClassOf rdf:resource="#Learning"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Updated -->
-
- <owl:Class rdf:about="#Updated">
- <rdfs:subClassOf rdf:resource="#Person"/>
- <rdfs:comment
- >Date&amp;time when resource was last modified. Singular property. Read-only (value managed by the system). PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Uptime -->
-
- <owl:Class rdf:about="#Uptime">
- <rdfs:subClassOf rdf:resource="#Device"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#upTimeInformation"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <owl:disjointWith rdf:resource="#UptimeContext"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#UptimeContext -->
-
- <owl:Class rdf:about="#UptimeContext">
- <rdfs:subClassOf rdf:resource="#Physicalcontext"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#upTimeInformation"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:comment
- >http://saescr005.ext.nokia.com/scrumworks/webreport/5MTMxMT</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Urls -->
-
- <owl:Class rdf:about="#Urls">
- <rdfs:subClassOf rdf:resource="#Person"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#URLType_Home"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#URLType"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#URLType_Work"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Primary"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:comment
- >URL meaningful to person. PEOPLE API.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Usage -->
-
- <owl:Class rdf:about="#Usage">
- <rdfs:subClassOf rdf:resource="#Device"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#UsageFrequencies -->
-
- <owl:Class rdf:about="#UsageFrequencies">
- <rdfs:subClassOf rdf:resource="#Learning"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#UserCurrentLocation -->
-
- <owl:Class rdf:about="#UserCurrentLocation">
- <rdfs:subClassOf rdf:resource="#Users"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#usersCurrentLocation"/>
- <owl:onClass rdf:resource="&DeliveryContext;Location"/>
- <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#UserCurrentSituation -->
-
- <owl:Class rdf:about="#UserCurrentSituation">
- <rdfs:subClassOf rdf:resource="#Situations"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#currentSituation"/>
- <owl:onClass rdf:resource="#Situations"/>
- <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:comment
- >http://saescr005.ext.nokia.com/scrumworks/webreport/5MTMxMT</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#UserPreferences -->
-
- <owl:Class rdf:about="#UserPreferences">
- <rdfs:subClassOf rdf:resource="#Device"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Users -->
-
- <owl:Class rdf:about="#Users">
- <rdfs:subClassOf rdf:resource="#People"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#UserID"/>
- <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:comment
- >List / search other Ovi users</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#UsersContext -->
-
- <owl:Class rdf:about="#UsersContext">
- <rdfs:subClassOf rdf:resource="#Context"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#currentSituation"/>
- <owl:onClass rdf:resource="#UserCurrentSituation"/>
- <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#usersCurrentLocation"/>
- <owl:onClass rdf:resource="&DeliveryContext;Location"/>
- <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#isBusy"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#currentProfile"/>
- <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:comment
- >This class is a collection of properties that form the user context.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#UsualRoute -->
-
- <owl:Class rdf:about="#UsualRoute">
- <rdfs:subClassOf rdf:resource="#Places"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#SatelliteNumView"/>
- <owl:someValuesFrom rdf:resource="&xsd;double"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Speed"/>
- <owl:someValuesFrom rdf:resource="&xsd;double"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#SatelliteNumViewUsed"/>
- <owl:someValuesFrom rdf:resource="&xsd;double"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#SpeedAccuracy"/>
- <owl:someValuesFrom rdf:resource="&xsd;double"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#MagneticVariation"/>
- <owl:someValuesFrom rdf:resource="&xsd;double"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#Heading"/>
- <owl:someValuesFrom rdf:resource="&xsd;double"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#GPSModuleAttached"/>
- <owl:someValuesFrom rdf:resource="#GPSModule"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#LocalTimeStamp"/>
- <owl:someValuesFrom rdf:resource="&xsd;dateTime"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#UTCTimeStamp"/>
- <owl:someValuesFrom rdf:resource="&xsd;dateTime"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#MagneticCource"/>
- <owl:someValuesFrom rdf:resource="&xsd;double"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#HeadingAccuracy"/>
- <owl:someValuesFrom rdf:resource="&xsd;double"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ViewandNavigatetoMeetingLocation -->
-
- <owl:Class rdf:about="#ViewandNavigatetoMeetingLocation">
- <rdfs:subClassOf rdf:resource="#Action"/>
- <rdfs:comment
- >View and navigate to meeting location. ContextUseCaseCandidatesOP20090303.xls.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#VisibilityforFriends -->
-
- <owl:Class rdf:about="#VisibilityforFriends">
- <rdfs:subClassOf rdf:resource="#Everybody"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#VisibleApplication -->
-
- <owl:Class rdf:about="#VisibleApplication">
- <rdfs:subClassOf rdf:resource="#Activity"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#VisualizingSituation -->
-
- <owl:Class rdf:about="#VisualizingSituation">
- <owl:equivalentClass>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasConnectivity"/>
- <owl:someValuesFrom rdf:resource="#ConnectivityStatus"/>
- </owl:Restriction>
- </owl:equivalentClass>
- <rdfs:subClassOf rdf:resource="#UsersContext"/>
- <owl:disjointWith rdf:resource="#VisualizingtheSituation"/>
- <rdfs:comment
- >Visualizing the situation (ContextUseCaseCandidatesOP20090303.xls).</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#VisualizingtheSituation -->
-
- <owl:Class rdf:about="#VisualizingtheSituation">
- <rdfs:subClassOf rdf:resource="#Action"/>
- <rdfs:comment
- >Visualizing the situation. ContextUseCaseCandidatesOP20090303.xls</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#VolumeIncreaseinNoisyEnvironment -->
-
- <owl:Class rdf:about="#VolumeIncreaseinNoisyEnvironment">
- <rdfs:subClassOf rdf:resource="#Action"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#hasSubscribed"/>
- <owl:someValuesFrom rdf:resource="#BackgroundNoise"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:comment
- >Volume increase in noisy environment. ContextUseCaseCandidatesOP20090303.xls.</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Weather -->
-
- <owl:Class rdf:about="#Weather">
- <rdfs:subClassOf rdf:resource="#ProvidersforOnlineContext"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#tempF"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#humidity"/>
- <owl:someValuesFrom rdf:resource="&xsd;int"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#condition"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#tempC"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <owl:disjointWith rdf:resource="#WeatherContext"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#WeatherContext -->
-
- <owl:Class rdf:about="#WeatherContext">
- <rdfs:subClassOf rdf:resource="#Physicalcontext"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#currentWeather"/>
- <owl:someValuesFrom rdf:resource="#WeatherForecast"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:comment
- >http://saescr005.ext.nokia.com/scrumworks/webreport/5MTMxMT</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#WeatherForecast -->
-
- <owl:Class rdf:about="#WeatherForecast">
- <rdfs:subClassOf rdf:resource="#ProvidersforOnlineContext"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#humidity"/>
- <owl:someValuesFrom rdf:resource="&xsd;int"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#tempF"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#tempC"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#condition"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Widgets -->
-
- <owl:Class rdf:about="#Widgets">
- <rdfs:subClassOf rdf:resource="#Application"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#WorkLocation -->
-
- <owl:Class rdf:about="#WorkLocation">
- <rdfs:subClassOf rdf:resource="#Location"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#PositionVariables"/>
- <owl:someValuesFrom rdf:resource="&xsd;double"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#WorkRelatedApplications -->
-
- <owl:Class rdf:about="#WorkRelatedApplications">
- <rdfs:subClassOf rdf:resource="#Application"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#atWork"/>
- <owl:someValuesFrom rdf:resource="&xsd;boolean"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#currentCPULoad -->
-
- <owl:Class rdf:about="#currentCPULoad">
- <rdfs:subClassOf rdf:resource="&DeliveryContext;CPU"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#CPULoadStatus"/>
- <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
- </owl:Restriction>
- </rdfs:subClassOf>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#iCalendar -->
-
- <owl:Class rdf:about="#iCalendar">
- <rdfs:subClassOf rdf:resource="#Calendar"/>
- </owl:Class>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#vCard -->
-
- <owl:Class rdf:about="#vCard">
- <rdfs:subClassOf rdf:resource="#Contacts"/>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#PROID"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#VERSION"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#ROLE"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#GEO"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#TZ"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#NOTE"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#UID"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#KEY"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#CATEGORIES"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#MAILER"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#JOBTITLE"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#ORG"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#FN"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#LABEL"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#URL"/>
- <owl:someValuesFrom rdf:resource="&xsd;anyURI"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#SOUND"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#ADR"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#N"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#SORT_STRING"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#CLASS"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#REV"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#NICKNAME"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#URL"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#EMAIL"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#TEL"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#AGENT"/>
- <owl:someValuesFrom rdf:resource="&xsd;string"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#BDAY"/>
- <owl:someValuesFrom rdf:resource="&xsd;date"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:subClassOf>
- <owl:Restriction>
- <owl:onProperty rdf:resource="#PHOTO"/>
- <owl:someValuesFrom rdf:resource="&xsd;anyType"/>
- </owl:Restriction>
- </rdfs:subClassOf>
- <rdfs:comment
- >Prior vCard RFC 2426</rdfs:comment>
- </owl:Class>
-
-
-
- <!-- http://www.w3.org/2002/12/cal/ical#DomainOf_rrule -->
-
- <owl:Class rdf:about="&ical;DomainOf_rrule">
- <rdfs:subClassOf rdf:resource="#iCalendar"/>
- </owl:Class>
-
-
-
- <!-- http://www.w3.org/2002/12/cal/ical#List_of_Float -->
-
- <owl:Class rdf:about="&ical;List_of_Float">
- <rdfs:subClassOf rdf:resource="#iCalendar"/>
- </owl:Class>
-
-
-
- <!-- http://www.w3.org/2002/12/cal/ical#Valarm -->
-
- <owl:Class rdf:about="&ical;Valarm">
- <rdfs:subClassOf rdf:resource="#iCalendar"/>
- </owl:Class>
-
-
-
- <!-- http://www.w3.org/2002/12/cal/ical#Value_CAL-ADDRESS -->
-
- <owl:Class rdf:about="&ical;Value_CAL-ADDRESS">
- <rdfs:subClassOf rdf:resource="#iCalendar"/>
- </owl:Class>
-
-
-
- <!-- http://www.w3.org/2002/12/cal/ical#Value_DATE -->
-
- <owl:Class rdf:about="&ical;Value_DATE">
- <rdfs:subClassOf rdf:resource="#iCalendar"/>
- </owl:Class>
-
-
-
- <!-- http://www.w3.org/2002/12/cal/ical#Value_DATE-TIME -->
-
- <owl:Class rdf:about="&ical;Value_DATE-TIME">
- <rdfs:subClassOf rdf:resource="#iCalendar"/>
- </owl:Class>
-
-
-
- <!-- http://www.w3.org/2002/12/cal/ical#Value_DURATION -->
-
- <owl:Class rdf:about="&ical;Value_DURATION">
- <rdfs:subClassOf rdf:resource="#iCalendar"/>
- </owl:Class>
-
-
-
- <!-- http://www.w3.org/2002/12/cal/ical#Value_PERIOD -->
-
- <owl:Class rdf:about="&ical;Value_PERIOD">
- <rdfs:subClassOf rdf:resource="#iCalendar"/>
- </owl:Class>
-
-
-
- <!-- http://www.w3.org/2002/12/cal/ical#Value_RECUR -->
-
- <owl:Class rdf:about="&ical;Value_RECUR">
- <rdfs:subClassOf rdf:resource="#iCalendar"/>
- </owl:Class>
-
-
-
- <!-- http://www.w3.org/2002/12/cal/ical#Vevent -->
-
- <owl:Class rdf:about="&ical;Vevent">
- <rdfs:subClassOf rdf:resource="#iCalendar"/>
- </owl:Class>
-
-
-
- <!-- http://www.w3.org/2002/12/cal/ical#Vfreebusy -->
-
- <owl:Class rdf:about="&ical;Vfreebusy">
- <rdfs:subClassOf rdf:resource="#iCalendar"/>
- </owl:Class>
-
-
-
- <!-- http://www.w3.org/2002/12/cal/ical#Vjournal -->
-
- <owl:Class rdf:about="&ical;Vjournal">
- <rdfs:subClassOf rdf:resource="#iCalendar"/>
- </owl:Class>
-
-
-
- <!-- http://www.w3.org/2002/12/cal/ical#Vtimezone -->
-
- <owl:Class rdf:about="&ical;Vtimezone">
- <rdfs:subClassOf rdf:resource="#iCalendar"/>
- </owl:Class>
-
-
-
- <!-- http://www.w3.org/2002/12/cal/ical#Vtodo -->
-
- <owl:Class rdf:about="&ical;Vtodo">
- <rdfs:subClassOf rdf:resource="#iCalendar"/>
- </owl:Class>
-
-
-
- <!-- http://www.w3.org/2007/uwa/ontologies/DeliveryContext.owl#CPU -->
-
- <owl:Class rdf:about="&DeliveryContext;CPU"/>
-
-
-
- <!-- http://www.w3.org/2007/uwa/ontologies/DeliveryContext.owl#DeliveryContext_EnvironmentEntity -->
-
- <owl:Class rdf:about="&DeliveryContext;DeliveryContext_EnvironmentEntity"/>
-
-
-
- <!-- http://www.w3.org/2007/uwa/ontologies/DeliveryContext.owl#DeliveryContext_HardwareEntity -->
-
- <owl:Class rdf:about="&DeliveryContext;DeliveryContext_HardwareEntity"/>
-
-
-
- <!-- http://www.w3.org/2007/uwa/ontologies/DeliveryContext.owl#DeliveryContext_MeasureEntity -->
-
- <owl:Class rdf:about="&DeliveryContext;DeliveryContext_MeasureEntity"/>
-
-
-
- <!-- http://www.w3.org/2007/uwa/ontologies/DeliveryContext.owl#DeliveryContext_NetworkEntity -->
-
- <owl:Class rdf:about="&DeliveryContext;DeliveryContext_NetworkEntity"/>
-
-
-
- <!-- http://www.w3.org/2007/uwa/ontologies/DeliveryContext.owl#DeliveryContext_SoftwareEntity -->
-
- <owl:Class rdf:about="&DeliveryContext;DeliveryContext_SoftwareEntity"/>
-
-
-
- <!-- http://www.w3.org/2007/uwa/ontologies/DeliveryContext.owl#Environment -->
-
- <owl:Class rdf:about="&DeliveryContext;Environment"/>
-
-
-
- <!-- http://www.w3.org/2007/uwa/ontologies/DeliveryContext.owl#Location -->
-
- <owl:Class rdf:about="&DeliveryContext;Location"/>
-
-
-
- <!--
- ///////////////////////////////////////////////////////////////////////////////////////
- //
- // Individuals
- //
- ///////////////////////////////////////////////////////////////////////////////////////
- -->
-
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ActionInstrument -->
-
- <Action rdf:about="#ActionInstrument">
- <rdfs:comment rdf:datatype="&xsd;string"
- >Thing that the actor uses to perform the action</rdfs:comment>
- </Action>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ActionLocation -->
-
- <Action rdf:about="#ActionLocation">
- <rdfs:comment rdf:datatype="&xsd;string"
- >Where the action is performed</rdfs:comment>
- </Action>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#ActionTime -->
-
- <Action rdf:about="#ActionTime">
- <rdfs:comment rdf:datatype="&xsd;string"
- >Time at which the action is performed</rdfs:comment>
- </Action>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Actor -->
-
- <Action rdf:about="#Actor">
- <rdfs:comment rdf:datatype="&xsd;string"
- >Entity that performs the action</rdfs:comment>
- </Action>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#AssistedHighAccuracy -->
-
- <GPSModule rdf:about="#AssistedHighAccuracy">
- <rdfs:comment
- >This method uses various assisted satellite positioning systems. [Cost Possible, High Accuracy, Higher Power].</rdfs:comment>
- </GPSModule>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#AssistedLowerAccuracy -->
-
- <GPSModule rdf:about="#AssistedLowerAccuracy">
- <rdfs:comment
- >This method mainly uses various assisted radio cell positioning technologies. [Cost Possible, Lower Accuracy, Lower Power].</rdfs:comment>
- </GPSModule>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#BT -->
-
- <Bearers rdf:about="#BT"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Beeper -->
-
- <ProfileName rdf:about="#Beeper"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#BrightLight -->
-
- <BackLightLevel rdf:about="#BrightLight"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#CDMA -->
-
- <Bearers rdf:about="#CDMA"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Dark -->
-
- <BackLightLevel rdf:about="#Dark"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#EDGE -->
-
- <Bearers rdf:about="#EDGE"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Email -->
-
- <Messaging rdf:about="#Email"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Ethernet -->
-
- <Bearers rdf:about="#Ethernet"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#GSM -->
-
- <Bearers rdf:about="#GSM"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#General -->
-
- <ProfileName rdf:about="#General"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#HeavyCPULoad -->
-
- <CPULoad rdf:about="#HeavyCPULoad"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#HighAccuracy -->
-
- <GPSModule rdf:about="#HighAccuracy">
- <rdfs:comment
- >This method mainly uses various standalone satellite positioning systems. [No Cost, High Accuracy, Higher Power].</rdfs:comment>
- </GPSModule>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#IM -->
-
- <Messaging rdf:about="#IM">
- <IMStatus></IMStatus>
- <IMStatusAvailable rdf:resource="#IM"/>
- </Messaging>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#InvitationReceived -->
-
- <NotificationType rdf:about="#InvitationReceived"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#InvitationRejected -->
-
- <NotificationType rdf:about="#InvitationRejected"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#InvitationSent -->
-
- <NotificationType rdf:about="#InvitationSent"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#IrDA -->
-
- <Bearers rdf:about="#IrDA"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Landscape -->
-
- <Orientation rdf:about="#Landscape"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#LightCPULoad -->
-
- <CPULoad rdf:about="#LightCPULoad"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#LowLight -->
-
- <BackLightLevel rdf:about="#LowLight"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#LowerAccuracy -->
-
- <GPSModule rdf:about="#LowerAccuracy">
- <rdfs:comment
- >This method mainly uses various radio cell positioning technologies. [No Cost, Lower Accuracy, Lower Power].</rdfs:comment>
- </GPSModule>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#MMS -->
-
- <Messaging rdf:about="#MMS"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#MaxCPULoad -->
-
- <CPULoad rdf:about="#MaxCPULoad"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Meeting -->
-
- <ProfileName rdf:about="#Meeting"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Moving -->
-
- <DeviceStatus rdf:about="#Moving"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#NotificationCanceled -->
-
- <NotificationType rdf:about="#NotificationCanceled"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Offline -->
-
- <ProfileName rdf:about="#Offline"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Outdoors -->
-
- <ProfileName rdf:about="#Outdoors"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Portrait -->
-
- <Orientation rdf:about="#Portrait"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Printer -->
-
- <Peripherals rdf:about="#Printer"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Recipient -->
-
- <Action rdf:about="#Recipient">
- <rdfs:comment rdf:datatype="&xsd;string"
- >Entity that receives the effect after the action is performed</rdfs:comment>
- </Action>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#RelationCreated -->
-
- <NotificationType rdf:about="#RelationCreated"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#RelationUpdated -->
-
- <NotificationType rdf:about="#RelationUpdated"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#SMS -->
-
- <Messaging rdf:about="#SMS"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Silent -->
-
- <ProfileName rdf:about="#Silent"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#Target -->
-
- <Action rdf:about="#Target">
- <rdfs:comment rdf:datatype="&xsd;string"
- >Object that the action applies to</rdfs:comment>
- </Action>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#WCDMA -->
-
- <Bearers rdf:about="#WCDMA"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#WLAN -->
-
- <Bearers rdf:about="#WLAN"/>
-
-
-
- <!-- http://www.semanticweb.org/ontologies/2009/2/Context.owl#WiMAX -->
-
- <Bearers rdf:about="#WiMAX"/>
-</rdf:RDF>
-
-
-
-<!-- Generated by the OWL API (version 2.2.1.974) http://owlapi.sourceforge.net -->
-
diff --git a/spec/Makefile.am b/spec/Makefile.am
deleted file mode 100644
index e22b2413..00000000
--- a/spec/Makefile.am
+++ /dev/null
@@ -1,72 +0,0 @@
-dist_noinst_DATA = context.valid.stamp $(INTROSPECT)
-
-htmldir = $(datadir)/doc/contextkit/html/
-dist_html_DATA = context-properties.html contextkit.html context-provider-schema.html
-
-contextdir = $(datadir)/contextkit/
-dist_context_DATA = core.context
-
-XSLTPROC = xsltproc --xinclude --nonet
-DROP_NAMESPACE = perl -pe '$$hash = chr(35); s{xmlns:tp="http://telepathy\.freedesktop\.org/wiki/DbusSpec$${hash}extensions-v0"}{}g'
-RST2HTML = rst2html
-XMLLINT = xmllint --noout --schema
-
-SPEC_TOOLS = spec-to-introspect.xsl \
- context2asciidoc.pl \
- doc-generator.xsl
-
-INTERFACES = \
- Manager.xml \
- Subscriber.xml
-
-SPEC_FILES = \
- $(INTERFACES) \
- generic-types.xml
-
-INTROSPECT = $(INTERFACES:%.xml=introspect/%.xml)
-
-tools_dir = $(top_srcdir)/tools
-
-# Generating introspection files
-
-$(INTROSPECT): introspect/%.xml: %.xml spec-to-introspect.xsl
- install -d introspect
- $(XSLTPROC) $(srcdir)/spec-to-introspect.xsl $< | $(DROP_NAMESPACE) > $@
-
-# Validating our core property list
-
-context.valid.stamp: context.xsd core.context
- $(XMLLINT) $^
- touch $@
-
-# Creating docs from a property declaration file
-
-context-properties.html: core.context context2asciidoc.pl
- $(srcdir)/context2asciidoc.pl < $< | asciidoc -f $(srcdir)/myfilter.conf -o $@ -
-
-# Creating docs from a DbusSpec
-
-contextkit.html: all.xml $(SPEC_FILES) doc-generator.xsl
- $(XSLTPROC) $(srcdir)/doc-generator.xsl $< > $@.tmp && mv $@.tmp $@
-
-# Creating docs from a XML schema
-
-context-provider-schema.html: context.xsd
- xsltproc --nonet --output $@ xs3p/xs3p.xsl $<
-
-EXTRA_DIST = \
- $(SPEC_FILES) \
- all.xml \
- context.xsd \
- $(SPEC_TOOLS) \
- myfilter.conf
-
-MAINTAINERCLEANFILES = \
- $(INTROSPECT) \
- context.valid.stamp \
- context-properties.html \
- contextkit.html \
- context-provider-schema.html
-
-maintainer-clean-local:
- rmdir introspect
diff --git a/spec/Manager.xml b/spec/Manager.xml
deleted file mode 100644
index b1c983cd..00000000
--- a/spec/Manager.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-
-<node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
- <interface name="org.freedesktop.ContextKit.Manager">
- <method name="Get">
- <tp:docstring>
- Get the values of a set of context keys.
- </tp:docstring>
- <arg name="keys" type="as" direction="in">
- <tp:docstring>
- An array of the keys to get.
- </tp:docstring>
- </arg>
- <arg name="values" type="a{sv}" tp:type="Value_Set" direction="out">
- <tp:docstring>
- A Value_Set mapping the requested keys to their values.
- </tp:docstring>
- </arg>
- <arg name="undeterminable_keys" type="as" direction="out">
- <tp:docstring>
- An array of keys which we couldn't determine the values for.
- </tp:docstring>
- </arg>
- </method>
-
- <method name="GetSubscriber">
- <tp:docstring>
- Get the Subscriber object for making subscriptions.
- </tp:docstring>
- <arg name="subscription_object" type="o" direction="out">
- <tp:docstring>
- The object on which to subscribe, unsubscribe keys and listen to key value changes.
- </tp:docstring>
- </arg>
- </method>
- </interface>
-</node>
-
diff --git a/spec/Subscriber.xml b/spec/Subscriber.xml
deleted file mode 100644
index 904be2ae..00000000
--- a/spec/Subscriber.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-
-<node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
- <interface name="org.freedesktop.ContextKit.Subscriber" >
- <method name="Subscribe">
- <tp:docstring>
- Subscribe to a one or more keys
- </tp:docstring>
-
- <arg name="keys" type="as" direction="in">
- <tp:docstring>
- An array of the keys to subscribe to.
- </tp:docstring>
- </arg>
-
- <arg name="values" type="a{sv}" tp:type="Value_Set" direction="out">
- <tp:docstring>
- A Value_Set mapping the requested keys to their current values.
- </tp:docstring>
- </arg>
- <arg name="undeterminable_keys" type="as" direction="out">
- <tp:docstring>
- An array of keys which we couldn't determine the values for.
- </tp:docstring>
- </arg>
-
- </method>
-
- <signal name="Changed" >
- <arg name="values" type="a{sv}" tp:type="Value_Set" >
- <tp:docstring >
- A Value_Set mapping the changed keys to their values.
- </tp:docstring>
- </arg>
- <arg name="undeterminable_keys" type="as" >
- <tp:docstring>
- An array of keys which we can no longer determine the values for.
- </tp:docstring>
- </arg>
- </signal>
-
- <method name="Unsubscribe" >
- <tp:docstring >
- A Value_Set mapping the requested keys to their values.
- </tp:docstring>
-
- <arg name="keys" type="as" direction="in">
- <tp:docstring>
- An array of the keys to unsubscribe from.
- </tp:docstring>
- </arg>
- </method>
-
- </interface>
-</node>
diff --git a/spec/all.xml b/spec/all.xml
deleted file mode 100644
index a73b1dcb..00000000
--- a/spec/all.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<tp:spec
- xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"
- xmlns:xi="http://www.w3.org/2001/XInclude">
-
-<tp:title>ContextKit D-Bus interface specification</tp:title>
-<tp:version>0.0.1</tp:version>
-
-<tp:copyright>Copyright (C) 2008 Nokia Corporation</tp:copyright>
-
-<tp:license xmlns="http://www.w3.org/1999/xhtml">
-<p>This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.</p>
-
-<p>This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.</p>
-
-<p>You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.</p>
-</tp:license>
-
-<xi:include href="Manager.xml"/>
-<xi:include href="Subscriber.xml"/>
-<xi:include href="generic-types.xml"/>
-</tp:spec>
diff --git a/spec/context.xsd b/spec/context.xsd
deleted file mode 100644
index e334ee27..00000000
--- a/spec/context.xsd
+++ /dev/null
@@ -1,162 +0,0 @@
-<schema targetNamespace="http://contextkit.freedesktop.org/Provider"
- xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:provider="http://contextkit.freedesktop.org/Provider">
- <annotation>
- <documentation>
- Documentation for ContextKit Provider schema.
- Copyright 2009 Nokia Corporation.
- </documentation>
- </annotation>
-
- <annotation>
- <documentation>
- This schema is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public License
- as published by the Free Software Foundation; either version 2.1 of
- the License, or (at your option) any later version.
- </documentation>
- </annotation>
-
- <annotation>
- <documentation>
- This schema is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
- </documentation>
- </annotation>
-
- <annotation>
- <documentation>
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA
- </documentation>
- </annotation>
-
- <simpleType name="dbusBusType">
- <annotation><documentation>
- Represents a standard D-Bus bus type.
- </documentation></annotation>
- <restriction base="string">
- <enumeration value="system"/>
- <enumeration value="session"/>
- </restriction>
- </simpleType>
-
- <group name="propertyElement">
- <choice>
- <element ref="provider:doc"/>
- <element ref="provider:key"/>
- </choice>
- </group>
-
- <complexType name="propertyList">
- <sequence>
- <group minOccurs="0" maxOccurs="unbounded" ref="provider:propertyElement"/>
- </sequence>
- </complexType>
-
- <complexType name="providerDefn">
- <complexContent>
- <extension base="provider:propertyList">
- <attribute name="plugin" type="string">
- <annotation><documentation>
- Which libcontextsubscriber plugin can communicate with the provider. For the ContextKit D-Bus protocol, use contextkit-dbus.
- </documentation></annotation>
- </attribute>
- <attribute name="constructionString" type="string">
- <annotation><documentation>
- The parameter given to the plugin communicating with the provider. For the ContextKit D-Bus protocol, use dbustype:dbusservicename.
- </documentation></annotation>
- </attribute>
- <attribute name="bus" type="provider:dbusBusType">
- <annotation><documentation>
- Which standard D-Bus bus this service can be activated on (To be deprecated: use the plugin and constructionString attributes instead.)
- </documentation></annotation>
- </attribute>
- <attribute name="service" type="NCName">
- <annotation><documentation>
- The bus name of the service that will provide these keys.
- This service must be activatable on the bus specified in "bus". (To be deprecated: use the plugin and constructionString attributes instead.)
- </documentation></annotation>
- </attribute>
- </extension>
- </complexContent>
- </complexType>
-
- <element name="provider" type="provider:providerDefn">
- <annotation>
- <documentation>
- A top-level declaration of a context-providing service using the
- ContextKit framework.
- </documentation>
- </annotation>
- </element>
-
- <element name="properties" type="provider:propertyList">
- <annotation>
- <documentation>
- A top-level definition of property names and meaning, divorced from a
- specific context providing service.
- </documentation>
- </annotation>
- </element>
-
- <element name="doc" type="normalizedString">
- <annotation><documentation>
- Documentation about a key or node.
- </documentation></annotation>
- </element>
-
- <element name="key">
- <complexType>
- <all>
- <element minOccurs="0" ref="provider:doc"/>
- <element minOccurs="0" ref="provider:type"/>
- <element minOccurs="0" ref="provider:typedoc"/>
- </all>
- <attribute name="name" use="required" type="token">
- <annotation><documentation>
- The name of this key.
- </documentation></annotation>
- </attribute>
- <attribute name="type" use="optional" type="token">
- <annotation><documentation>
- The type of this key, if it is a simple string.
- </documentation></annotation>
- </attribute>
- <attribute name="typedoc" use="optional" type="token">
- <annotation><documentation>
- The type of this key, if it is a simple string.
- </documentation></annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="type">
- <annotation><documentation>
- The type of this key.
- </documentation></annotation>
- <!-- XXX - not very strict -->
- <complexType mixed="true">
- <sequence>
- <any minOccurs="0" processContents="lax"/>
- </sequence>
- </complexType>
- </element>
-
- <element name="typedoc">
- <annotation><documentation>
- The type of this key.
- </documentation></annotation>
- <!-- XXX - not very strict -->
- <complexType mixed="true">
- <sequence>
- <any minOccurs="0" processContents="lax"/>
- </sequence>
- </complexType>
- </element>
-
-</schema>
diff --git a/spec/context2asciidoc.pl b/spec/context2asciidoc.pl
deleted file mode 100755
index c9d7c23a..00000000
--- a/spec/context2asciidoc.pl
+++ /dev/null
@@ -1,197 +0,0 @@
-#!/usr/bin/perl
-#
-# Make a asciidoc document from spec/context.xml
-#
-
-use XML::DOM;
-
-sub unindent {
- # XXX - this should 'unindent' the text by removing the same
- # amount of leading whitespace from each line so that the first
- # line starts at the left margin.
- my $string = shift;
- $string =~ s/^\s+//;
- $string =~ s/\s+$//;
- return $string;
-}
-
-sub to_nano_dom {
- my $node = shift;
-
- my @children = $node->getChildNodes();
-
- if ($#children == 0 && $children[0]->getNodeType() == 3) {
- return [ unindent ($node->getFirstChild()->getNodeValue()) ];
- } else {
- my $result = [];
-
- foreach ($node->getAttributes()->getValues()) {
- push (@{$result}, [$_->getNodeName(), $_->getNodeValue()]);
- }
-
- foreach (@children) {
- if ($_->getNodeType() == 1) {
- my @elt = ($_->getNodeName(), @{to_nano_dom ($_)});
- push (@{$result}, \@elt);
- }
- }
-
- return $result;
- }
-}
-
-sub car {
- my ($nano) = @_;
- return @{$nano}[0];
-}
-
-sub cdr {
- my ($nano) = @_;
- # XXX - one free beer if you can express this array slices.
- my $res = [];
- for ($i = 1; $i < @{$nano}; $i++) {
- push (@{$res}, $nano->[$i]);
- }
- return $res;
-}
-
-sub nano_assoc {
- my ($nano, $key) = @_;
-
- if (ref $nano) {
- foreach (@{$nano}) {
- if (ref $_ && car ($_) eq $key) {
- return cdr ($_);
- }
- }
- }
-
- return nil;
-}
-
-sub nano_ref {
- my ($nano, $key) = @_;
-
- return car (nano_assoc($nano, $key));
-}
-
-sub pk1 {
- my ($v) = @_;
-
- if (ref $v) {
- print STDERR "[ ";
- foreach (@{$v}) {
- pk1 ($_);
- print STDERR ", ";
- }
- print STDERR "]";
- } else {
- print STDERR $v;
- }
-}
-
-sub pk {
- my ($l,$v) = @_;
- print STDERR "$l: ";
- pk1 ($v);
- print STDERR "\n";
-}
-
-sub output_doc {
- my $doc = shift;
- print $doc->getFirstChild()->getNodeValue() . "\n";
-}
-
-sub type_name {
- my $type = shift;
-
- if (ref $type) {
- return car ($type);
- } else {
- return $type;
- }
-}
-
-sub type_parms {
- my $type = shift;
-
- if (ref $type) {
- return cdr ($type);
- } else {
- return [];
- }
-}
-
-sub type_short_desc {
- my $type = shift;
-
- my $name = type_name ($type);
- my $parms = type_parms ($type);
-
- if ($name eq "uniform-list") {
- return "List of __" . nano_ref ($parms, 'type') . "__s";
- } elsif ($name eq "string-enum") {
- return "Enumeration of __string__s" . nano_ref ($parms, 'type');
- } elsif ($name eq "map") {
- return "Map";
- } else {
- return "_" . $name . "_";
- }
-}
-
-sub print_type_long_desc {
- my $type = shift;
-
- my $name = type_name ($type);
- my $parms = type_parms ($type);
-
- if ($name eq "uniform-list"
- || !@{$parms}) {
- # do nothing
- } elsif ($name eq "string-enum") {
- print "+\n--\nPossible enumeration values: \n[horizontal]\n";
- foreach (@{$parms}) {
- print car ($_) . ":: " . nano_ref (cdr ($_), 'doc') . "\n";
- }
- print "--\n";
- } elsif ($name eq "map") {
- print "+\n--\nPossible map keys: \n[horizontal]\n";
- my $keys = nano_assoc ($parms, 'allowed-keys');
- foreach (@{$keys}) {
- print car ($_) . ":: " . nano_ref (cdr ($_), 'doc') . "\n";
- }
- print "--\n";
- } else {
- print "+\n--\nType: " . type_name ($type) . "\n[horizontal]\n";
- foreach (@{$parms}) {
- print car ($_) . " :: " . cdr ($_) . "\n";
- }
- print "--\n";
- }
-}
-
-sub output_key {
- my $key = to_nano_dom (shift);
-
- my $type = nano_ref ($key, 'typedoc');
- if (!$type)
- {
- $type = nano_ref ($key, 'type');
- }
-
- print "\n";
- print "*" . nano_ref ($key, 'name') . "* (" . type_short_desc ($type) . ")::\n";
- print nano_ref ($key, 'doc') . "\n";
- print_type_long_desc ($type);
-}
-
-my $document = XML::DOM::Parser->new()->parse(STDIN);
-
-foreach ($document->getDocumentElement()->getChildNodes()) {
- my $node = $_;
- if ($node->getNodeName() eq "doc") {
- output_doc ($node);
- } elsif ($node->getNodeName() eq "key") {
- output_key ($node);
- }
-}
diff --git a/spec/core.context b/spec/core.context
deleted file mode 100644
index 66cdcab6..00000000
--- a/spec/core.context
+++ /dev/null
@@ -1,816 +0,0 @@
-<?xml version="1.0"?>
-<properties xmlns="http://contextkit.freedesktop.org/Provider">
- <doc>
-Core Context Properties
-=======================
-
-This is the list of the core contextual properties of the Maemo
-platform.
-
-This document is maintained as part of the +contextkit+ package.
-Please report change requests as bugs against the +contextkit+
-package.
-
-*NOTE:* Most of these properties are unstable and their definition will
-change for some time still. Only the ones explicitly marked as stable
-should be used for now.
-
-Display screens
----------------
-
-These properties talk about the display screens of the device.
- </doc>
- <key name="Screen.TopEdge"
- type="string">
- <typedoc>
- <string-enum>
- <top/>
- <bottom/>
- <left/>
- <right/>
- </string-enum>
- </typedoc>
- <doc>
-The edge of the main display screen where the user expects
-the top-most UI elements to be. Possible values are the
-strings "top", "bottom", "left", and "right", which refer to
-the edges of the screen in its normal orientation as defined
-by the graphics hardware. _(stable)_
- </doc>
- </key>
- <key name="Screen.IsCovered"
- type="bool">
- <doc>
-Whether or not the main display screen is covered and can thus not be
-seen by the user. This might mean that the device is laying face down
-on a table, or that its lid is closed if it has one. _(stable)_
- </doc>
- </key>
- <doc>
-Location
---------
-
-Best effort location information. If any of the keys are not
-appliciable to the current location, they will be unavailable.
- </doc>
- <key name="Location.Coordinates">
- <typedoc>
- <uniform-list type="double"/>
- </typedoc>
- <doc>
-The coordinates of the current position as a list of two or three
-doubles. The first two elemets are latitude and longitude,
-respectivly, in degrees. The third element, when present, is the
-altitude in meter.
- </doc>
- </key>
- <key name="Location.Street"
- type="string">
- <doc>The street nearest the location of the device, as a localized string.</doc>
- </key>
- <key name="Location.PostalCode"
- type="string">
- <doc>The postcode of the location of the device, as a localized string.</doc>
- </key>
- <key name="Location.Area"
- type="string">
- <doc>
-The name of the local area where the device is, for example a
-neighborhood or campus, as a localized string.
- </doc>
- </key>
- <key name="Location.Locality"
- type="string">
- <doc>The name of the village, town or city where the device is, as a localized string.</doc>
- </key>
- <key name="Location.Region"
- type="string">
- <doc>The administrative region which contains the location of the device, as a localized string.</doc>
- </key>
- <key name="Location.Country"
- type="string">
- <doc>The country which contains the location of the device, as a localized string.</doc>
- </key>
- <key name="Location.CountryCode"
- type="string">
- <doc>The ISO 3166 two letter country code of the country which contains the location of the device.</doc>
- </key>
- <key name="Location.Timezone"
- type="string">
- <doc>TBD</doc>
- </key>
- <key name="Location.TimezoneOffset"
- type="int32"
- typedoc="duration">
- <doc>TBD</doc>
- </key>
- <key name="Location.Continent"
- type="string">
- <doc>The name of the current continent, as a localized string.</doc>
- </key>
- <key name="Location.Planet"
- type="string">
- <doc>The name of the current planet (or dwarf planet), as a localized string.</doc>
- </key>
- <key name="Location.PointOfInterest"
- type="string">
- <doc>
-The URI of the current point of interest, if any. (The URI points to
-a Nepomuk object inside the Content Framework.)
- </doc>
- </key>
- <key name="Location.NearbyContacts">
- <typedoc>
- <uniform-list type="nepomuk-uri"/>
- </typedoc>
- <doc>
-A list of URIs for contacts that are physically nearby.
- </doc>
- </key>
- <doc>
-Battery
--------
-
-Information about the batteries of the device.
- </doc>
- <key name="Battery.ChargePercentage"
- type="int32"
- typedoc="percentage">
- <doc>
-The average charge level of the currently connected batteries.
-Expressed as percentage of the maximum charge level.
- </doc>
- </key>
- <key name="Battery.OnBattery"
- type="bool">
- <doc>
-Whether or not the device is currently running on battery power,
-i.e., whether at least one of its batteries is currently discharging.
- </doc>
- </key>
- <key name="Battery.LowBattery"
- type="bool">
- <doc>
-Whether or not the device is currently running on low battery power.
-True if OnBattery is true and the charge levels of all
-batteries are below 10%.
- </doc>
- </key>
- <key name="Battery.IsCharging"
- type="bool">
- <doc>
-Whether or not the device is currently charging at least one of its batteries.
- </doc>
- </key>
- <key name="Battery.TimeUntilLow"
- type="int32"
- typedoc="duration">
- <doc>
-Estimates the time that the device can run on battery before the property
-OnLowBattery becomes true. In seconds.
- </doc>
- </key>
- <key name="Battery.TimeUntilFull"
- type="int32"
- typedoc="duration">
- <doc>
-Estimates the needed charging time of the device. In seconds.
- </doc>
- </key>
- <doc>
-System
-------
-
-Information about the current state of the device.
- </doc>
- <key name="System.MemoryPressure"
- type="int32">
- <typedoc>
- <int-enum>
- <normal value="0"/>
- <high value="1"/>
- <critical value="2"/>
- </int-enum>
- </typedoc>
- <doc>
-Current memory load. Possible values: 0 (normal), 1 (high; low watermark exceeded), 2 (critical; high watermark exceeded).
- </doc>
- </key>
- <doc>
-Internet connectivity
----------------------
-
-Information about the connection of the devide to the Internet.
- </doc>
- <key name="Internet.NetworkType"
- type="string">
- <typedoc>
- <string-enum>
- <wifi/>
- <wimax/>
- <cellular/>
- <bluetooth/>
- <ethernet/>
- </string-enum>
- </typedoc>
- <doc>
-The type of the current connection to the Internet. This is one of
-the strings "wifi", "wimax", "cellular", "bluetooth", "ethernet", or
-"usb". (From ConnMan. New types might be defined in the future, of
-course.)
- </doc>
- </key>
-
- <key name="Internet.NetworkName"
- type="string">
- <doc>
- The name of the current network.
- </doc>
- </key>
-
- <key name="Internet.NetworkState"
- type="string">
- <typedoc>
- <string-enum>
- <disconnected/>
- <connecting/>
- <connected/>
- </string-enum>
- </typedoc>
- <doc>
- The state of the Internet connection, as one of "connected",
- "disconnected", and "connecting".
- </doc>
- </key>
-
- <key name="Internet.SignalStrength"
- type="int32"
- typedoc="percentage">
- <doc>
-The signal strength of the current connection to the Internet. For
-example, when Internet.NetworkType is "cellular", this is the signal
-strength at the cellular radio, when it is "wifi", it is the signal
-strength at the WLAN radio.
- </doc>
- </key>
-
- <key name="Internet.TrafficOut"
- type="int32"
- typedoc="percentage">
- <doc>
-A rough indication of the current traffic rate to the Internet, in
-percent of the maximum possible rate.
- </doc>
- </key>
- <key name="Internet.TrafficIn"
- type="int32"
- typedoc="percentage">
- <doc>
-A rough indication of the current traffic rate from the Internet, in
-percent of the maximum possible rate.
- </doc>
- </key>
- <doc>
-Bluetooth
----------
-
-Information about Bluetooth related things.
- </doc>
- <key name="Bluetooth.Enabled"
- type="bool">
- <doc>
-A boolean indicating whether or not the Bluetooth radio is enabled.
- </doc>
- </key>
- <key name="Bluetooth.Visible"
- type="bool">
- <doc>
-A boolean indicating whether or not the device is visible to other
-Bluetooth devices when they search for others.
- </doc>
- </key>
- <doc>
-Cellular
---------
-
-Information about the cellular radio.
- </doc>
- <key name="Cellular.NetworkName"
- type="string">
- <doc>
-The name of the cellular network.
- </doc>
- </key>
- <key name="Cellular.SignalStrength"
- type="int32"
- typedoc="percentage">
- <doc>
-The signal strength at the cellular radio, in percent of the maximum.
- </doc>
- </key>
- <key name="Cellular.Technology"
- type="string">
- <typedoc>
- <string-enum>
- <gsm/>
- <umts/>
- </string-enum>
- </typedoc>
- <doc>
-The currently used Radio Access Technology.
- </doc>
- </key>
- <key name="Cellular.DataTechnology"
- type="string">
- <typedoc>
- <string-enum>
- <gprs/>
- <egprs/>
- <umts/>
- <hspa/>
- </string-enum>
- </typedoc>
- <doc>
-The currently used Radio Access Technology for data transfer.
- </doc>
- </key>
- <key name="Cellular.RegistrationStatus"
- type="string">
- <typedoc>
- <string-enum>
- <home doc="Registered with the home network"/>
- <roam doc="Roaming"/>
- <no-sim doc="No SIM card is present"/>
- <offline doc="Cellular radio is powered off"/>
- <forbidden doc="Cellular access is denied, e.g., because of invalid SIM"/>
- </string-enum>
- </typedoc>
- <doc>
-The current cellular network registration status.
- </doc>
- </key>
- <doc>
-User alarms
------------
-
-Information about the alams set by the user. We assume, that the user
-can disable or enable all the alarms. In addition, the user can enable
-or disable each alarm individually.
- </doc>
- <key name="UserAlarm.Present"
- type="bool">
- <doc>
-Indicates whether there is an upcoming alarm set by the user. Can be
-true even if alarms are disabled.
- </doc>
- </key>
- <key name="UserAlarm.Enabled"
- type="bool">
- <doc>
-Indicates whether the alarms are enabled or disabled by the user. If
-there are no alarms, UserAlarm.Enabled is true.
- </doc>
- </key>
- <key name="UserAlarm.NextTime"
- type="int32"
- typedoc="time">
- <doc>
-The time of the next (enabled) alarm, in Unix time (the number of
-seconds since January 1.1.1970 00:00 UTC). If no alarms are present,
-the value is Unknown.
- </doc>
- </key>
- <key name="UserAlarm.NextDescription"
- type="string">
- <doc>
-The description of the next (enabled) alarm. If no alarms are present,
-the value is Unknown.
- </doc>
- </key>
- <key name="UserAlarm.NextCookie"
- type="int32">
- <doc>
-The cookie of the next (enabled) alarm. The cookie can be used for
-referring to the alarm when communicating with timed.
- </doc>
- </key>
- <doc>
-Environment
------------
-
-Information about the environment the device is in.
- </doc>
- <key name="Environment.SunRise"
- type="int32"
- typedoc="time">
- <doc>
-The time of sun rise.
- </doc>
- </key>
- <key name="Environment.SunSet"
- type="int32"
- typedoc="time">
- <doc>
-The time of sun set.
- </doc>
- </key>
- <key name="Environment.Weather">
- <typedoc>
- <map>
- <allowed-keys>
- <Condition>
- <type>string</type>
- <doc>
-The current weather condition, as a localized, human readable string.
-Examples are "Cloudy", "Raining", etc.
- </doc>
- </Condition>
- <ConditionCode>
- <type>
- <string-enum>
- <cloudy/>
- <sunny/>
- </string-enum>
- </type>
- <doc>
-The current weather condition, as a symbolic string. The set of
-symbols is to be defined, but it will be fixed and quite small so that
-you can provide an icon for each of them, etc.
- </doc>
- </ConditionCode>
- <Humidity>
- <doc>
-The relative humidity in percent.
- </doc>
- </Humidity>
- <Temperature>
- <doc>
-The temperature as a localized string. This string represents the
-temperature in the way preferred by the user. Most often this means
-either degrees Celsius or degrees Fahrenheit, but it could be some
-other unit entirely.
- </doc>
- </Temperature>
- <TemperatureK>
- <doc>
-The temperature in Kelvin.
- </doc>
- </TemperatureK>
- <ApparentTemperature>
- <doc>
-The felt temperature as a localized string, analogous to Temperature.
- </doc>
- </ApparentTemperature>
- <ApparentTemperatureK>
- <doc>
-The felt temperature in Kelvin.
- </doc>
- </ApparentTemperatureK>
- <DewPoint>
- <doc>
-The dew point as a localized string, analogous to Temperature.
- </doc>
- </DewPoint>
- <DewPointK>
- <doc>
-The dew point in Kelvin.
- </doc>
- </DewPointK>
- <Pressure>
- <doc>
-The atmospheric pressure in milli bar.
- </doc>
- </Pressure>
- <Precipitation>
- <doc>
-The rain or snow fall in millimeter per square meter per hour (or some
-other more common unit).
- </doc>
- </Precipitation>
- <Visibility>
- <doc>
-The visibility in meter.
- </doc>
- </Visibility>
- <WindSpeed>
- <doc>
-The wind speed in meters per second.
- </doc>
- </WindSpeed>
- <WindDirection>
- <doc>
-The wind direction as a localized string. The direction is given in
-compass terms: North, South-West, etc.
- </doc>
- </WindDirection>
- <WindDirectionD>
- <doc>
-The wind direction in degrees. North is 0, east is 90, etc.
- </doc>
- </WindDirectionD>
- </allowed-keys>
- </map>
- </typedoc>
- <doc>
-The current weather. See http://www.ominous-valve.com/wx_codes.txt for
-more information about codifying weather conditions. We should lift
-something from there, if just for extra geek points.
- </doc>
- </key>
- <key name="Environment.IsDark">
- <type>bool</type>
- <doc>Whether or not it is especially dark.</doc>
- </key>
- <key name="Environment.IsBright">
- <type>bool</type>
- <doc>Whether or not it is especially bright.</doc>
- </key>
- <key name="Environment.IsLoud">
- <type>bool</type>
- <doc>Whether or not it is especially loud.</doc>
- </key>
- <doc>
-Use
----
-
-Information about the current usage context of the device.
-
-Situations are a UI concept similar to Profiles that allows the user
-to have different customizations for his/her device and
-automatically/explcicitly switch between them. Typical Situations are
-"AtHome", "AtWork", "InMeeting" etc. Some of them are probably
-pre-defined, others can be defined by the user. Situations might form
-a hierarchy: InMeeting includes AtWork.
-
-Not much is known about all this right now.
- </doc>
- <key name="Use.Situations"
- typedoc="string-list">
- <doc>
-The symbolic names of the currently active Situations. Note that more
-than one situation might be active at the same time.
- </doc>
- </key>
- <key name="Use.Mode">
- <doc>
-The current main usage mode of the device.
- </doc>
- <typedoc>
- <string-enum>
- <editing>
- <doc>
-The user is interacting closely with the device and is creating new
-content, such as when composing a email message or creating any other
-kind of document.
- </doc>
- </editing>
- <recording>
- <doc>
-The user is taking pictures, or recording video or audio.
- </doc>
- </recording>
- <browsing>
- <doc>
-The user is interacting closely with the device without
-creating new content, such as when browsing search results, or
-browsing through his/her music collection.
- </doc>
- </browsing>
- <watching>
- <doc>
-The user is watching a video, without closely interacting with the
-device.
- </doc>
- </watching>
- <listening>
- <doc>
-The user is listening to audio, without closely interacting with the
-device.
- </doc>
- </listening>
- <reading>
- <doc>
-The user is reading a document, such as when reading a article on the
-web or a e-book.
- </doc>
- </reading>
- <chatting>
- <doc>
-The user is involved in a real-time, text-based dialog with external
-parties.
- </doc>
- </chatting>
- <gaming>
- <doc>
-The user is interacting closely with the device, for entertainment.
- </doc>
- </gaming>
- <calling>
- <doc>
-The user is involved in a real-time, audio- or video-based dialog with
-external parties.
- </doc>
- </calling>
- <active>
- <doc>
-The user interacting closely with the device, for an activity that
-doesn't fit into any of the above categories.
- </doc>
- </active>
- <idle>
- <doc>
-The device is not being used.
- </doc>
- </idle>
- <maintenance>
- <doc>
-The user is doing system-wide maintenance work such as restoring a
-backup or upgrading the OS software.
- </doc>
- </maintenance>
- </string-enum>
- </typedoc>
- </key>
- <key name="Use.ConnectedContacts">
- <typedoc>
- <uniform-list type="nepomuk-uri"/>
- </typedoc>
- <doc>
-A list of URIs for contacts that the user is currently engaged in
-conversations with. (The URIs point to Nepomuk objects.)
- </doc>
- </key>
- <key name="Use.RecentDocuments">
- <typedoc>
- <uniform-list type="nepomuk-uri"/>
- </typedoc>
- <doc>
-A list of URIs for recently used documents, at most ten elements long.
-(The URIs point to Nepomuk objects.)
- </doc>
- </key>
- <key name="Use.Keyboarding"
- type="bool">
- <doc>
-Whether or not the user is ready to use the keyboard. This property
-is true when a slideout keyboard has been slided out, for example, or
-when a transformer laptop with a tablet mode is in "laptop mode".
- </doc>
- </key>
- <key name="Use.Phoning"
- type="bool">
- <doc>
-Whether or not the user is using the device as a telephone handset,
-holding it next to ear and mouth.
- </doc>
- </key>
- <doc>
-Events
-------
-
-Information about current and upcoming calendar entries.
- </doc>
- <key name="Event.Current">
- <typedoc>
- <uniform-list type="nepomuk-uri"/>
- </typedoc>
- <doc>
-The currently active events, as a list of Nepomuk URIs. The list
-contains all events whose start time is earlier than or equal to the
-current time, and whose end time is later.
- </doc>
- </key>
- <key name="Event.CurrentStart"
- type="int32"
- typedoc="time">
- <doc>
-The earliest start time of the events in Events.Current.
- </doc>
- </key>
- <key name="Event.CurrentEnd"
- type="int32"
- typedoc="time">
- <doc>
-The latest end time of the events in Events.Current.
- </doc>
- </key>
- <key name="Event.Next">
- <typedoc>
- <uniform-list type="nepomuk-uri"/>
- </typedoc>
- <doc>
-The upcoming events, as a list of Nepomuk URIs. The list contains
-those events whose start time is later than the current time and
-closest to now. If there are multiple events in the list, they all
-start at exactly the same time.
- </doc>
- </key>
- <key name="Event.NextStart"
- type="int32"
- typedoc="time">
- <doc>
-The earliest start time of the events in Events.Next.
- </doc>
- </key>
- <key name="Event.NextEnd"
- type="int32"
- typedoc="time">
- <doc>
-The latest end time of the events in Events.Next.
- </doc>
- </key>
- <doc>
-Profiles
---------
-
-Information about the expected behavior of the device.
- </doc>
- <key name="Profile.Name"
- type="string">
- <doc>
-The name of the currently active profile as a localized string. You
-should not try to interpret this string, it is only meant to be
-displayed as a reminder to the user.
- </doc>
- </key>
- <doc>
-Session
--------
-
-Information about the current user session. If there is no current
-session, all values are null.
- </doc>
- <key name="Session.State">
- <typedoc>
- <string-enum>
- <starting/>
- <running/>
- <suspended/>
- <eclipsed/>
- <terminating/>
- </string-enum>
- </typedoc>
- <doc>
-The state of the current session, as string valued enumeration. When
-a session is started, it remains in the "starting" state until it is
-fully ready and the system is idle again. It then changes between
-"running", "suspended", and "eclipsed" as explained below until it
-shuts down and is in the "terminating" state.
-
-The session is in the "running" state when the normal desktop UI
-components such as the panel, desktop icons, taskbars, notification
-areas and status menus are available to the user.
-
-The session goes to the "suspended" state when the user stops
-interacting with it. The screen is typically blanked when the session
-is suspended. In general, there is no point in trying to interact
-with the user when the session is suspended.
-
-The session is in the "eclipsed" state when the complete screen has
-been given to some other application, such as full-screen video
-playback. In that state, the notification areas and status menus, etc
-of the desktop aren't visible to the user, of course, and
-notifications should be unintrusive and important.
-
-Applications should be prepared to see all states in any kind of order
-without getting confused.
- </doc>
- </key>
- <doc>
-Media
------
-
-Information about media related activity.
- </doc>
- <key name="Media.NowPlaying">
- <typedoc>
- <map>
- <allowed-keys>
- <resource type="nepomuk-uri"/>
- <title type="string"/>
- <artist type="string"/>
- <genre type="string"/>
- <album type="string"/>
- <duration type="duration"/>
- <start-time type="time"/>
- <state type="string-enum"/>
- </allowed-keys>
- </map>
- </typedoc>
- <doc>
-The currently playing media, such as a video or audio track. The
-value is a dictionary with the listed entries. If "resource" is
-included, then "title", "artist", "genre", and "album" are consistent
-with what Tracker has stored.
-
-The current position in the media is always "current-time -
-start-time". If the user seeks then that is expressed by changing
-"start-time". In other words, "start-time" is not the point in time
-when the user has clicked the play button, it is the point in time
-when the media would have had to start to play uninterrupted to reach
-its current position now. This slight complication is done in favor
-of transmitting the position directly to avoid telling you once every
-second that it is now one second later.
- </doc>
- </key>
-</properties>
diff --git a/spec/doc-generator.xsl b/spec/doc-generator.xsl
deleted file mode 100644
index 76fc9696..00000000
--- a/spec/doc-generator.xsl
+++ /dev/null
@@ -1,1199 +0,0 @@
-<!-- Generate HTML documentation from the Telepathy specification.
-The master copy of this stylesheet is in the Telepathy spec repository -
-please make any changes there.
-
-Copyright (C) 2006-2008 Collabora Limited
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--->
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"
- xmlns:html="http://www.w3.org/1999/xhtml"
- exclude-result-prefixes="tp html">
- <!--Don't move the declaration of the HTML namespace up here — XMLNSs
- don't work ideally in the presence of two things that want to use the
- absence of a prefix, sadly. -->
-
- <xsl:param name="allow-undefined-interfaces" select="false()"/>
-
- <xsl:template match="html:* | @*" mode="html">
- <xsl:copy>
- <xsl:apply-templates mode="html"/>
- </xsl:copy>
- </xsl:template>
-
- <xsl:template match="tp:type" mode="html">
- <xsl:call-template name="tp-type">
- <xsl:with-param name="tp-type" select="string(.)"/>
- </xsl:call-template>
- </xsl:template>
-
- <!-- tp:dbus-ref: reference a D-Bus interface, signal, method or property -->
- <xsl:template match="tp:dbus-ref" mode="html">
- <xsl:variable name="name">
- <xsl:choose>
- <xsl:when test="@namespace">
- <xsl:value-of select="@namespace"/>
- <xsl:text>.</xsl:text>
- </xsl:when>
- </xsl:choose>
- <xsl:value-of select="string(.)"/>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="//interface[@name=$name]
- or //interface/method[concat(../@name, '.', @name)=$name]
- or //interface/signal[concat(../@name, '.', @name)=$name]
- or //interface/property[concat(../@name, '.', @name)=$name]
- or //interface[@name=concat($name, '.DRAFT')]
- or //interface/method[
- concat(../@name, '.', @name)=concat($name, '.DRAFT')]
- or //interface/signal[
- concat(../@name, '.', @name)=concat($name, '.DRAFT')]
- or //interface/property[
- concat(../@name, '.', @name)=concat($name, '.DRAFT')]
- ">
- <a xmlns="http://www.w3.org/1999/xhtml" href="#{$name}">
- <xsl:value-of select="string(.)"/>
- </a>
- </xsl:when>
-
- <xsl:when test="$allow-undefined-interfaces">
- <span xmlns="http://www.w3.org/1999/xhtml" title="defined elsewhere">
- <xsl:value-of select="string(.)"/>
- </span>
- </xsl:when>
-
- <xsl:otherwise>
- <xsl:message terminate="yes">
- <xsl:text>ERR: cannot find D-Bus interface, method, </xsl:text>
- <xsl:text>signal or property called '</xsl:text>
- <xsl:value-of select="$name"/>
- <xsl:text>'&#10;</xsl:text>
- </xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- tp:member-ref: reference a property of the current interface -->
- <xsl:template match="tp:member-ref" mode="html">
- <xsl:variable name="prefix" select="concat(ancestor::interface/@name,
- '.')"/>
- <xsl:variable name="name" select="string(.)"/>
-
- <xsl:if test="not(ancestor::interface)">
- <xsl:message terminate="yes">
- <xsl:text>ERR: Cannot use tp:member-ref when not in an</xsl:text>
- <xsl:text> &lt;interface&gt;&#10;</xsl:text>
- </xsl:message>
- </xsl:if>
-
- <xsl:choose>
- <xsl:when test="ancestor::interface/signal[@name=$name]"/>
- <xsl:when test="ancestor::interface/method[@name=$name]"/>
- <xsl:when test="ancestor::interface/property[@name=$name]"/>
- <xsl:otherwise>
- <xsl:message terminate="yes">
- <xsl:text>ERR: interface </xsl:text>
- <xsl:value-of select="ancestor::interface/@name"/>
- <xsl:text> has no signal/method/property called </xsl:text>
- <xsl:value-of select="$name"/>
- <xsl:text>&#10;</xsl:text>
- </xsl:message>
- </xsl:otherwise>
- </xsl:choose>
-
- <a xmlns="http://www.w3.org/1999/xhtml" href="#{$prefix}{$name}">
- <xsl:value-of select="$name"/>
- </a>
- </xsl:template>
-
- <xsl:template match="*" mode="identity">
- <xsl:copy>
- <xsl:apply-templates mode="identity"/>
- </xsl:copy>
- </xsl:template>
-
- <xsl:template match="tp:docstring">
- <xsl:apply-templates mode="html"/>
- </xsl:template>
-
- <xsl:template match="tp:added">
- <p class="added" xmlns="http://www.w3.org/1999/xhtml">Added in
- version <xsl:value-of select="@version"/>.
- <xsl:apply-templates select="node()" mode="html"/></p>
- </xsl:template>
-
- <xsl:template match="tp:changed">
- <xsl:choose>
- <xsl:when test="node()">
- <p class="changed" xmlns="http://www.w3.org/1999/xhtml">Changed in
- version <xsl:value-of select="@version"/>:
- <xsl:apply-templates select="node()" mode="html"/></p>
- </xsl:when>
- <xsl:otherwise>
- <p class="changed">Changed in version
- <xsl:value-of select="@version"/></p>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="tp:deprecated">
- <p class="deprecated" xmlns="http://www.w3.org/1999/xhtml">Deprecated
- since version <xsl:value-of select="@version"/>.
- <xsl:apply-templates select="node()" mode="html"/></p>
- </xsl:template>
-
- <xsl:template match="tp:rationale" mode="html">
- <div xmlns="http://www.w3.org/1999/xhtml" class="rationale">
- <xsl:apply-templates select="node()" mode="html"/>
- </div>
- </xsl:template>
-
- <xsl:template match="tp:errors">
- <h1 xmlns="http://www.w3.org/1999/xhtml">Errors</h1>
- <xsl:apply-templates/>
- </xsl:template>
-
- <xsl:template match="tp:generic-types">
- <h1 xmlns="http://www.w3.org/1999/xhtml">Generic types</h1>
- <xsl:call-template name="do-types"/>
- </xsl:template>
-
- <xsl:template name="do-types">
- <xsl:if test="tp:simple-type">
- <h2 xmlns="http://www.w3.org/1999/xhtml">Simple types</h2>
- <xsl:apply-templates select="tp:simple-type"/>
- </xsl:if>
-
- <xsl:if test="tp:enum">
- <h2 xmlns="http://www.w3.org/1999/xhtml">Enumerated types:</h2>
- <xsl:apply-templates select="tp:enum"/>
- </xsl:if>
-
- <xsl:if test="tp:flags">
- <h2 xmlns="http://www.w3.org/1999/xhtml">Sets of flags:</h2>
- <xsl:apply-templates select="tp:flags"/>
- </xsl:if>
-
- <xsl:if test="tp:struct">
- <h2 xmlns="http://www.w3.org/1999/xhtml">Structure types</h2>
- <xsl:apply-templates select="tp:struct"/>
- </xsl:if>
-
- <xsl:if test="tp:mapping">
- <h2 xmlns="http://www.w3.org/1999/xhtml">Mapping types</h2>
- <xsl:apply-templates select="tp:mapping"/>
- </xsl:if>
-
- <xsl:if test="tp:external-type">
- <h2 xmlns="http://www.w3.org/1999/xhtml">Types defined elsewhere</h2>
- <dl><xsl:apply-templates select="tp:external-type"/></dl>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="tp:error">
- <h2 xmlns="http://www.w3.org/1999/xhtml"><a name="{concat(../@namespace, '.', translate(@name, ' ', ''))}"></a><xsl:value-of select="concat(../@namespace, '.', translate(@name, ' ', ''))"/></h2>
- <xsl:apply-templates select="tp:docstring"/>
- <xsl:apply-templates select="tp:added"/>
- <xsl:apply-templates select="tp:changed"/>
- <xsl:apply-templates select="tp:deprecated"/>
- </xsl:template>
-
- <xsl:template match="/tp:spec/tp:copyright">
- <div xmlns="http://www.w3.org/1999/xhtml">
- <xsl:apply-templates mode="text"/>
- </div>
- </xsl:template>
- <xsl:template match="/tp:spec/tp:license">
- <div xmlns="http://www.w3.org/1999/xhtml" class="license">
- <xsl:apply-templates mode="html"/>
- </div>
- </xsl:template>
-
- <xsl:template match="tp:copyright"/>
- <xsl:template match="tp:license"/>
-
- <xsl:template match="interface">
- <h1 xmlns="http://www.w3.org/1999/xhtml"><a name="{@name}"></a><xsl:value-of select="@name"/></h1>
-
- <xsl:if test="@tp:causes-havoc">
- <p xmlns="http://www.w3.org/1999/xhtml" class="causes-havoc">
- This interface is <xsl:value-of select="@tp:causes-havoc"/>
- and is likely to cause havoc to your API/ABI if bindings are generated.
- Don't include it in libraries that care about compatibility.
- </p>
- </xsl:if>
-
- <xsl:if test="tp:requires">
- <p>Implementations of this interface must also implement:</p>
- <ul xmlns="http://www.w3.org/1999/xhtml">
- <xsl:for-each select="tp:requires">
- <li><code><a href="#{@interface}"><xsl:value-of select="@interface"/></a></code></li>
- </xsl:for-each>
- </ul>
- </xsl:if>
-
- <xsl:apply-templates select="tp:docstring" />
- <xsl:apply-templates select="tp:added"/>
- <xsl:apply-templates select="tp:changed"/>
- <xsl:apply-templates select="tp:deprecated"/>
-
- <xsl:choose>
- <xsl:when test="method">
- <h2 xmlns="http://www.w3.org/1999/xhtml">Methods:</h2>
- <xsl:apply-templates select="method"/>
- </xsl:when>
- <xsl:otherwise>
- <p xmlns="http://www.w3.org/1999/xhtml">Interface has no methods.</p>
- </xsl:otherwise>
- </xsl:choose>
-
- <xsl:choose>
- <xsl:when test="signal">
- <h2 xmlns="http://www.w3.org/1999/xhtml">Signals:</h2>
- <xsl:apply-templates select="signal"/>
- </xsl:when>
- <xsl:otherwise>
- <p xmlns="http://www.w3.org/1999/xhtml">Interface has no signals.</p>
- </xsl:otherwise>
- </xsl:choose>
-
- <xsl:choose>
- <xsl:when test="tp:property">
- <h2 xmlns="http://www.w3.org/1999/xhtml">Telepathy Properties:</h2>
- <p xmlns="http://www.w3.org/1999/xhtml">Accessed using the
- <a href="#org.freedesktop.Telepathy.Properties">Telepathy
- Properties</a> interface.</p>
- <dl xmlns="http://www.w3.org/1999/xhtml">
- <xsl:apply-templates select="tp:property"/>
- </dl>
- </xsl:when>
- <xsl:otherwise>
- <p xmlns="http://www.w3.org/1999/xhtml">Interface has no Telepathy
- properties.</p>
- </xsl:otherwise>
- </xsl:choose>
-
- <xsl:choose>
- <xsl:when test="property">
- <h2 xmlns="http://www.w3.org/1999/xhtml">D-Bus core Properties:</h2>
- <p xmlns="http://www.w3.org/1999/xhtml">Accessed using the
- org.freedesktop.DBus.Properties interface.</p>
- <dl xmlns="http://www.w3.org/1999/xhtml">
- <xsl:apply-templates select="property"/>
- </dl>
- </xsl:when>
- <xsl:otherwise>
- <p xmlns="http://www.w3.org/1999/xhtml">Interface has no D-Bus core
- properties.</p>
- </xsl:otherwise>
- </xsl:choose>
-
- <xsl:call-template name="do-types"/>
-
- </xsl:template>
-
- <xsl:template match="tp:flags">
-
- <xsl:if test="not(@name) or @name = ''">
- <xsl:message terminate="yes">
- <xsl:text>ERR: missing @name on a tp:flags type&#10;</xsl:text>
- </xsl:message>
- </xsl:if>
-
- <xsl:if test="not(@type) or @type = ''">
- <xsl:message terminate="yes">
- <xsl:text>ERR: missing @type on tp:flags type</xsl:text>
- <xsl:value-of select="@name"/>
- <xsl:text>&#10;</xsl:text>
- </xsl:message>
- </xsl:if>
-
- <h3>
- <a name="type-{@name}">
- <xsl:value-of select="@name"/>
- </a>
- </h3>
- <xsl:apply-templates select="tp:docstring" />
- <xsl:apply-templates select="tp:added"/>
- <xsl:apply-templates select="tp:changed"/>
- <xsl:apply-templates select="tp:deprecated"/>
- <dl xmlns="http://www.w3.org/1999/xhtml">
- <xsl:variable name="value-prefix">
- <xsl:choose>
- <xsl:when test="@value-prefix">
- <xsl:value-of select="@value-prefix"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@name"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:for-each select="tp:flag">
- <dt xmlns="http://www.w3.org/1999/xhtml"><code><xsl:value-of select="concat($value-prefix, '_', @suffix)"/> = <xsl:value-of select="@value"/></code></dt>
- <xsl:choose>
- <xsl:when test="tp:docstring">
- <dd xmlns="http://www.w3.org/1999/xhtml">
- <xsl:apply-templates select="tp:docstring" />
- <xsl:apply-templates select="tp:added"/>
- <xsl:apply-templates select="tp:changed"/>
- <xsl:apply-templates select="tp:deprecated"/>
- </dd>
- </xsl:when>
- <xsl:otherwise>
- <dd xmlns="http://www.w3.org/1999/xhtml">(Undocumented)</dd>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </dl>
- </xsl:template>
-
- <xsl:template match="tp:enum">
-
- <xsl:if test="not(@name) or @name = ''">
- <xsl:message terminate="yes">
- <xsl:text>ERR: missing @name on a tp:enum type&#10;</xsl:text>
- </xsl:message>
- </xsl:if>
-
- <xsl:if test="not(@type) or @type = ''">
- <xsl:message terminate="yes">
- <xsl:text>ERR: missing @type on tp:enum type</xsl:text>
- <xsl:value-of select="@name"/>
- <xsl:text>&#10;</xsl:text>
- </xsl:message>
- </xsl:if>
-
- <h3 xmlns="http://www.w3.org/1999/xhtml">
- <a name="type-{@name}">
- <xsl:value-of select="@name"/>
- </a>
- </h3>
- <xsl:apply-templates select="tp:docstring" />
- <xsl:apply-templates select="tp:added"/>
- <xsl:apply-templates select="tp:changed"/>
- <xsl:apply-templates select="tp:deprecated"/>
- <dl xmlns="http://www.w3.org/1999/xhtml">
- <xsl:variable name="value-prefix">
- <xsl:choose>
- <xsl:when test="@value-prefix">
- <xsl:value-of select="@value-prefix"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@name"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:for-each select="tp:enumvalue">
- <dt xmlns="http://www.w3.org/1999/xhtml"><code><xsl:value-of select="concat($value-prefix, '_', @suffix)"/> = <xsl:value-of select="@value"/></code></dt>
- <xsl:choose>
- <xsl:when test="tp:docstring">
- <dd xmlns="http://www.w3.org/1999/xhtml">
- <xsl:apply-templates select="tp:docstring" />
- <xsl:apply-templates select="tp:added"/>
- <xsl:apply-templates select="tp:changed"/>
- <xsl:apply-templates select="tp:deprecated"/>
- </dd>
- </xsl:when>
- <xsl:otherwise>
- <dd xmlns="http://www.w3.org/1999/xhtml">(Undocumented)</dd>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </dl>
- </xsl:template>
-
- <xsl:template match="property">
-
- <xsl:if test="not(parent::interface)">
- <xsl:message terminate="yes">
- <xsl:text>ERR: property </xsl:text>
- <xsl:value-of select="@name"/>
- <xsl:text> does not have an interface as parent&#10;</xsl:text>
- </xsl:message>
- </xsl:if>
-
- <xsl:if test="not(@name) or @name = ''">
- <xsl:message terminate="yes">
- <xsl:text>ERR: missing @name on a property of </xsl:text>
- <xsl:value-of select="../@name"/>
- <xsl:text>&#10;</xsl:text>
- </xsl:message>
- </xsl:if>
-
- <xsl:if test="not(@type) or @type = ''">
- <xsl:message terminate="yes">
- <xsl:text>ERR: missing @type on property </xsl:text>
- <xsl:value-of select="concat(../@name, '.', @name)"/>
- <xsl:text>: '</xsl:text>
- <xsl:value-of select="@access"/>
- <xsl:text>'&#10;</xsl:text>
- </xsl:message>
- </xsl:if>
-
- <dt xmlns="http://www.w3.org/1999/xhtml">
- <a name="{concat(../@name, '.', @name)}">
- <code><xsl:value-of select="@name"/></code>
- </a>
- <xsl:text> − </xsl:text>
- <code><xsl:value-of select="@type"/></code>
- <xsl:call-template name="parenthesized-tp-type"/>
- <xsl:text>, </xsl:text>
- <xsl:choose>
- <xsl:when test="@access = 'read'">
- <xsl:text>read-only</xsl:text>
- </xsl:when>
- <xsl:when test="@access = 'write'">
- <xsl:text>write-only</xsl:text>
- </xsl:when>
- <xsl:when test="@access = 'readwrite'">
- <xsl:text>read/write</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">
- <xsl:text>ERR: unknown or missing value for </xsl:text>
- <xsl:text>@access on property </xsl:text>
- <xsl:value-of select="concat(../@name, '.', @name)"/>
- <xsl:text>: '</xsl:text>
- <xsl:value-of select="@access"/>
- <xsl:text>'&#10;</xsl:text>
- </xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </dt>
- <dd xmlns="http://www.w3.org/1999/xhtml">
- <xsl:apply-templates select="tp:docstring"/>
- <xsl:apply-templates select="tp:added"/>
- <xsl:apply-templates select="tp:changed"/>
- <xsl:apply-templates select="tp:deprecated"/>
- </dd>
- </xsl:template>
-
- <xsl:template match="tp:property">
- <dt xmlns="http://www.w3.org/1999/xhtml">
- <xsl:if test="@name">
- <code><xsl:value-of select="@name"/></code> −
- </xsl:if>
- <code><xsl:value-of select="@type"/></code>
- </dt>
- <dd xmlns="http://www.w3.org/1999/xhtml">
- <xsl:apply-templates select="tp:docstring"/>
- <xsl:apply-templates select="tp:added"/>
- <xsl:apply-templates select="tp:changed"/>
- <xsl:apply-templates select="tp:deprecated"/>
- </dd>
- </xsl:template>
-
- <xsl:template match="tp:mapping">
- <div xmlns="http://www.w3.org/1999/xhtml" class="struct">
- <h3>
- <a name="type-{@name}">
- <xsl:value-of select="@name"/>
- </a> − a{
- <xsl:for-each select="tp:member">
- <xsl:value-of select="@type"/>
- <xsl:text>: </xsl:text>
- <xsl:value-of select="@name"/>
- <xsl:if test="position() != last()"> &#x2192; </xsl:if>
- </xsl:for-each>
- }
- </h3>
- <div class="docstring">
- <xsl:apply-templates select="tp:docstring"/>
- <xsl:if test="string(@array-name) != ''">
- <p>In bindings that need a separate name, arrays of
- <xsl:value-of select="@name"/> should be called
- <xsl:value-of select="@array-name"/>.</p>
- </xsl:if>
- </div>
- <div>
- <h4>Members</h4>
- <dl>
- <xsl:apply-templates select="tp:member" mode="members-in-docstring"/>
- </dl>
- </div>
- </div>
- </xsl:template>
-
- <xsl:template match="tp:docstring" mode="in-index"/>
-
- <xsl:template match="tp:simple-type | tp:enum | tp:flags | tp:external-type"
- mode="in-index">
- − <xsl:value-of select="@type"/>
- </xsl:template>
-
- <xsl:template match="tp:simple-type">
-
- <xsl:if test="not(@name) or @name = ''">
- <xsl:message terminate="yes">
- <xsl:text>ERR: missing @name on a tp:simple-type&#10;</xsl:text>
- </xsl:message>
- </xsl:if>
-
- <xsl:if test="not(@type) or @type = ''">
- <xsl:message terminate="yes">
- <xsl:text>ERR: missing @type on tp:simple-type</xsl:text>
- <xsl:value-of select="@name"/>
- <xsl:text>&#10;</xsl:text>
- </xsl:message>
- </xsl:if>
-
- <div xmlns="http://www.w3.org/1999/xhtml" class="simple-type">
- <h3>
- <a name="type-{@name}">
- <xsl:value-of select="@name"/>
- </a> − <xsl:value-of select="@type"/>
- </h3>
- <div class="docstring">
- <xsl:apply-templates select="tp:docstring"/>
- <xsl:apply-templates select="tp:added"/>
- <xsl:apply-templates select="tp:changed"/>
- <xsl:apply-templates select="tp:deprecated"/>
- </div>
- </div>
- </xsl:template>
-
- <xsl:template match="tp:external-type">
-
- <xsl:if test="not(@name) or @name = ''">
- <xsl:message terminate="yes">
- <xsl:text>ERR: missing @name on a tp:external-type&#10;</xsl:text>
- </xsl:message>
- </xsl:if>
-
- <xsl:if test="not(@type) or @type = ''">
- <xsl:message terminate="yes">
- <xsl:text>ERR: missing @type on tp:external-type</xsl:text>
- <xsl:value-of select="@name"/>
- <xsl:text>&#10;</xsl:text>
- </xsl:message>
- </xsl:if>
-
- <div xmlns="http://www.w3.org/1999/xhtml" class="external-type">
- <dt>
- <a name="type-{@name}">
- <xsl:value-of select="@name"/>
- </a> − <xsl:value-of select="@type"/>
- </dt>
- <dd>Defined by: <xsl:value-of select="@from"/></dd>
- </div>
- </xsl:template>
-
- <xsl:template match="tp:struct" mode="in-index">
- − ( <xsl:for-each select="tp:member">
- <xsl:value-of select="@type"/>
- <xsl:if test="position() != last()">, </xsl:if>
- </xsl:for-each> )
- </xsl:template>
-
- <xsl:template match="tp:mapping" mode="in-index">
- − a{ <xsl:for-each select="tp:member">
- <xsl:value-of select="@type"/>
- <xsl:if test="position() != last()"> &#x2192; </xsl:if>
- </xsl:for-each> }
- </xsl:template>
-
- <xsl:template match="tp:struct">
- <div xmlns="http://www.w3.org/1999/xhtml" class="struct">
- <h3>
- <a name="type-{@name}">
- <xsl:value-of select="@name"/>
- </a> − (
- <xsl:for-each select="tp:member">
- <xsl:value-of select="@type"/>
- <xsl:text>: </xsl:text>
- <xsl:value-of select="@name"/>
- <xsl:if test="position() != last()">, </xsl:if>
- </xsl:for-each>
- )
- </h3>
- <div class="docstring">
- <xsl:apply-templates select="tp:docstring"/>
- <xsl:apply-templates select="tp:added"/>
- <xsl:apply-templates select="tp:changed"/>
- <xsl:apply-templates select="tp:deprecated"/>
- </div>
- <xsl:choose>
- <xsl:when test="string(@array-name) != ''">
- <p>In bindings that need a separate name, arrays of
- <xsl:value-of select="@name"/> should be called
- <xsl:value-of select="@array-name"/>.</p>
- </xsl:when>
- <xsl:otherwise>
- <p>Arrays of <xsl:value-of select="@name"/> don't generally
- make sense.</p>
- </xsl:otherwise>
- </xsl:choose>
- <div>
- <h4>Members</h4>
- <dl>
- <xsl:apply-templates select="tp:member" mode="members-in-docstring"/>
- </dl>
- </div>
- </div>
- </xsl:template>
-
- <xsl:template match="method">
-
- <xsl:if test="not(parent::interface)">
- <xsl:message terminate="yes">
- <xsl:text>ERR: method </xsl:text>
- <xsl:value-of select="@name"/>
- <xsl:text> does not have an interface as parent&#10;</xsl:text>
- </xsl:message>
- </xsl:if>
-
- <xsl:if test="not(@name) or @name = ''">
- <xsl:message terminate="yes">
- <xsl:text>ERR: missing @name on a method of </xsl:text>
- <xsl:value-of select="../@name"/>
- <xsl:text>&#10;</xsl:text>
- </xsl:message>
- </xsl:if>
-
- <xsl:for-each select="arg">
- <xsl:if test="not(@type) or @type = ''">
- <xsl:message terminate="yes">
- <xsl:text>ERR: an arg of method </xsl:text>
- <xsl:value-of select="concat(../../@name, '.', ../@name)"/>
- <xsl:text> has no type</xsl:text>
- </xsl:message>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="@direction='in'">
- <xsl:if test="not(@name) or @name = ''">
- <xsl:message terminate="yes">
- <xsl:text>ERR: an 'in' arg of method </xsl:text>
- <xsl:value-of select="concat(../../@name, '.', ../@name)"/>
- <xsl:text> has no name</xsl:text>
- </xsl:message>
- </xsl:if>
- </xsl:when>
- <xsl:when test="@direction='out'">
- <!-- FIXME: This is commented out until someone with a lot of time
- on their hands goes through the spec adding names to all the "out"
- arguments
-
- <xsl:if test="not(@name) or @name = ''">
- <xsl:message terminate="no">
- <xsl:text>INFO: an 'out' arg of method </xsl:text>
- <xsl:value-of select="concat(../../@name, '.', ../@name)"/>
- <xsl:text> has no name</xsl:text>
- </xsl:message>
- </xsl:if>-->
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">
- <xsl:text>ERR: an arg of method </xsl:text>
- <xsl:value-of select="concat(../../@name, '.', ../@name)"/>
- <xsl:text> has direction neither 'in' nor 'out'</xsl:text>
- </xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
-
- <div xmlns="http://www.w3.org/1999/xhtml" class="method">
- <h3 xmlns="http://www.w3.org/1999/xhtml">
- <a name="{concat(../@name, concat('.', @name))}">
- <xsl:value-of select="@name"/>
- </a> (
- <xsl:for-each xmlns="" select="arg[@direction='in']">
- <xsl:value-of select="@type"/>: <xsl:value-of select="@name"/>
- <xsl:if test="position() != last()">, </xsl:if>
- </xsl:for-each>
- ) &#x2192;
- <xsl:choose>
- <xsl:when test="arg[@direction='out']">
- <xsl:for-each xmlns="" select="arg[@direction='out']">
- <xsl:value-of select="@type"/>
- <xsl:if test="position() != last()">, </xsl:if>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>nothing</xsl:otherwise>
- </xsl:choose>
- </h3>
- <div xmlns="http://www.w3.org/1999/xhtml" class="docstring">
- <xsl:apply-templates select="tp:docstring" />
- <xsl:apply-templates select="tp:added"/>
- <xsl:apply-templates select="tp:changed"/>
- <xsl:apply-templates select="tp:deprecated"/>
- </div>
-
- <xsl:if test="arg[@direction='in']">
- <div xmlns="http://www.w3.org/1999/xhtml">
- <h4>Parameters</h4>
- <dl xmlns="http://www.w3.org/1999/xhtml">
- <xsl:apply-templates select="arg[@direction='in']"
- mode="parameters-in-docstring"/>
- </dl>
- </div>
- </xsl:if>
-
- <xsl:if test="arg[@direction='out']">
- <div xmlns="http://www.w3.org/1999/xhtml">
- <h4>Returns</h4>
- <dl xmlns="http://www.w3.org/1999/xhtml">
- <xsl:apply-templates select="arg[@direction='out']"
- mode="returns-in-docstring"/>
- </dl>
- </div>
- </xsl:if>
-
- <xsl:if test="tp:possible-errors">
- <div xmlns="http://www.w3.org/1999/xhtml">
- <h4>Possible errors</h4>
- <dl xmlns="http://www.w3.org/1999/xhtml">
- <xsl:apply-templates select="tp:possible-errors/tp:error"/>
- </dl>
- </div>
- </xsl:if>
-
- </div>
- </xsl:template>
-
- <xsl:template name="tp-type">
- <xsl:param name="tp-type"/>
- <xsl:param name="type"/>
-
- <xsl:variable name="single-type">
- <xsl:choose>
- <xsl:when test="contains($tp-type, '[]')">
- <xsl:value-of select="substring-before($tp-type, '[]')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$tp-type"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="type-of-tp-type">
- <xsl:if test="contains($tp-type, '[]')">
- <!-- one 'a', plus one for each [ after the [], and delete all ] -->
- <xsl:value-of select="concat('a',
- translate(substring-after($tp-type, '[]'), '[]', 'a'))"/>
- </xsl:if>
-
- <xsl:choose>
- <xsl:when test="//tp:simple-type[@name=$single-type]">
- <xsl:value-of select="string(//tp:simple-type[@name=$single-type]/@type)"/>
- </xsl:when>
- <xsl:when test="//tp:struct[@name=$single-type]">
- <xsl:text>(</xsl:text>
- <xsl:for-each select="//tp:struct[@name=$single-type]/tp:member">
- <xsl:value-of select="@type"/>
- </xsl:for-each>
- <xsl:text>)</xsl:text>
- </xsl:when>
- <xsl:when test="//tp:enum[@name=$single-type]">
- <xsl:value-of select="string(//tp:enum[@name=$single-type]/@type)"/>
- </xsl:when>
- <xsl:when test="//tp:flags[@name=$single-type]">
- <xsl:value-of select="string(//tp:flags[@name=$single-type]/@type)"/>
- </xsl:when>
- <xsl:when test="//tp:mapping[@name=$single-type]">
- <xsl:text>a{</xsl:text>
- <xsl:for-each select="//tp:mapping[@name=$single-type]/tp:member">
- <xsl:value-of select="@type"/>
- </xsl:for-each>
- <xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:when test="//tp:external-type[@name=$single-type]">
- <xsl:value-of select="string(//tp:external-type[@name=$single-type]/@type)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">
- <xsl:text>ERR: Unable to find type '</xsl:text>
- <xsl:value-of select="$tp-type"/>
- <xsl:text>'&#10;</xsl:text>
- </xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:if test="string($type) != '' and
- string($type-of-tp-type) != string($type)">
- <xsl:message terminate="yes">
- <xsl:text>ERR: tp:type '</xsl:text>
- <xsl:value-of select="$tp-type"/>
- <xsl:text>' has D-Bus type '</xsl:text>
- <xsl:value-of select="$type-of-tp-type"/>
- <xsl:text>' but has been used with type='</xsl:text>
- <xsl:value-of select="$type"/>
- <xsl:text>'&#10;</xsl:text>
- </xsl:message>
- </xsl:if>
-
- <a href="#type-{$single-type}"><xsl:value-of select="$tp-type"/></a>
-
- </xsl:template>
-
- <xsl:template name="parenthesized-tp-type">
- <xsl:if test="@tp:type">
- <xsl:text> (</xsl:text>
- <xsl:call-template name="tp-type">
- <xsl:with-param name="tp-type" select="@tp:type"/>
- <xsl:with-param name="type" select="@type"/>
- </xsl:call-template>
- <xsl:text>)</xsl:text>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="tp:member" mode="members-in-docstring">
- <dt xmlns="http://www.w3.org/1999/xhtml">
- <code><xsl:value-of select="@name"/></code> −
- <code><xsl:value-of select="@type"/></code>
- <xsl:call-template name="parenthesized-tp-type"/>
- </dt>
- <dd xmlns="http://www.w3.org/1999/xhtml">
- <xsl:choose>
- <xsl:when test="tp:docstring">
- <xsl:apply-templates select="tp:docstring" />
- </xsl:when>
- <xsl:otherwise>
- <em>(undocumented)</em>
- </xsl:otherwise>
- </xsl:choose>
- </dd>
- </xsl:template>
-
- <xsl:template match="arg" mode="parameters-in-docstring">
- <dt xmlns="http://www.w3.org/1999/xhtml">
- <code><xsl:value-of select="@name"/></code> −
- <code><xsl:value-of select="@type"/></code>
- <xsl:call-template name="parenthesized-tp-type"/>
- </dt>
- <dd xmlns="http://www.w3.org/1999/xhtml">
- <xsl:apply-templates select="tp:docstring" />
- </dd>
- </xsl:template>
-
- <xsl:template match="arg" mode="returns-in-docstring">
- <dt xmlns="http://www.w3.org/1999/xhtml">
- <xsl:if test="@name">
- <code><xsl:value-of select="@name"/></code> −
- </xsl:if>
- <code><xsl:value-of select="@type"/></code>
- <xsl:call-template name="parenthesized-tp-type"/>
- </dt>
- <dd xmlns="http://www.w3.org/1999/xhtml">
- <xsl:apply-templates select="tp:docstring"/>
- </dd>
- </xsl:template>
-
- <xsl:template match="tp:possible-errors/tp:error">
- <dt xmlns="http://www.w3.org/1999/xhtml">
- <code><xsl:value-of select="@name"/></code>
- </dt>
- <dd xmlns="http://www.w3.org/1999/xhtml">
- <xsl:variable name="name" select="@name"/>
- <xsl:choose>
- <xsl:when test="tp:docstring">
- <xsl:apply-templates select="tp:docstring"/>
- </xsl:when>
- <xsl:when test="//tp:errors/tp:error[concat(../@namespace, '.', translate(@name, ' ', ''))=$name]/tp:docstring">
- <xsl:apply-templates select="//tp:errors/tp:error[concat(../@namespace, '.', translate(@name, ' ', ''))=$name]/tp:docstring"/> <em xmlns="http://www.w3.org/1999/xhtml">(generic description)</em>
- </xsl:when>
- <xsl:otherwise>
- (Undocumented.)
- </xsl:otherwise>
- </xsl:choose>
- </dd>
- </xsl:template>
-
- <xsl:template match="signal">
-
- <xsl:if test="not(parent::interface)">
- <xsl:message terminate="yes">
- <xsl:text>ERR: signal </xsl:text>
- <xsl:value-of select="@name"/>
- <xsl:text> does not have an interface as parent&#10;</xsl:text>
- </xsl:message>
- </xsl:if>
-
- <xsl:if test="not(@name) or @name = ''">
- <xsl:message terminate="yes">
- <xsl:text>ERR: missing @name on a signal of </xsl:text>
- <xsl:value-of select="../@name"/>
- <xsl:text>&#10;</xsl:text>
- </xsl:message>
- </xsl:if>
-
- <xsl:for-each select="arg">
- <xsl:if test="not(@type) or @type = ''">
- <xsl:message terminate="yes">
- <xsl:text>ERR: an arg of signal </xsl:text>
- <xsl:value-of select="concat(../../@name, '.', ../@name)"/>
- <xsl:text> has no type</xsl:text>
- </xsl:message>
- </xsl:if>
- <xsl:if test="not(@name) or @name = ''">
- <xsl:message terminate="yes">
- <xsl:text>ERR: an arg of signal </xsl:text>
- <xsl:value-of select="concat(../../@name, '.', ../@name)"/>
- <xsl:text> has no name</xsl:text>
- </xsl:message>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="not(@direction)"/>
- <xsl:when test="@direction='in'">
- <xsl:message terminate="no">
- <xsl:text>INFO: an arg of signal </xsl:text>
- <xsl:value-of select="concat(../../@name, '.', ../@name)"/>
- <xsl:text> has unnecessary direction 'in'</xsl:text>
- </xsl:message>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">
- <xsl:text>ERR: an arg of signal </xsl:text>
- <xsl:value-of select="concat(../../@name, '.', ../@name)"/>
- <xsl:text> has direction other than 'in'</xsl:text>
- </xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
-
- <div xmlns="http://www.w3.org/1999/xhtml" class="signal">
- <h3 xmlns="http://www.w3.org/1999/xhtml">
- <a name="{concat(../@name, concat('.', @name))}">
- <xsl:value-of select="@name"/>
- </a> (
- <xsl:for-each xmlns="" select="arg">
- <xsl:value-of select="@type"/>: <xsl:value-of select="@name"/>
- <xsl:if test="position() != last()">, </xsl:if>
- </xsl:for-each>
- )</h3>
-
- <div xmlns="http://www.w3.org/1999/xhtml" class="docstring">
- <xsl:apply-templates select="tp:docstring"/>
- <xsl:apply-templates select="tp:added"/>
- <xsl:apply-templates select="tp:changed"/>
- <xsl:apply-templates select="tp:deprecated"/>
- </div>
-
- <xsl:if test="arg">
- <div xmlns="http://www.w3.org/1999/xhtml">
- <h4>Parameters</h4>
- <dl xmlns="http://www.w3.org/1999/xhtml">
- <xsl:apply-templates select="arg" mode="parameters-in-docstring"/>
- </dl>
- </div>
- </xsl:if>
- </div>
- </xsl:template>
-
- <xsl:output method="xml" indent="no" encoding="ascii"
- omit-xml-declaration="yes"
- doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
- doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" />
-
- <xsl:template match="/tp:spec">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>
- <xsl:value-of select="tp:title"/>
- <xsl:if test="tp:version">
- <xsl:text> version </xsl:text>
- <xsl:value-of select="tp:version"/>
- </xsl:if>
- </title>
- <style type="text/css">
-
- body {
- font-family: sans-serif;
- margin: 2em;
- height: 100%;
- font-size: 1.2em;
- }
- h1 {
- padding-top: 5px;
- padding-bottom: 5px;
- font-size: 1.6em;
- background: #dadae2;
- }
- h2 {
- font-size: 1.3em;
- }
- h3 {
- font-size: 1.2em;
- }
- a:link, a:visited, a:link:hover, a:visited:hover {
- font-weight: bold;
- }
- .topbox {
- padding-top: 10px;
- padding-left: 10px;
- border-bottom: black solid 1px;
- padding-bottom: 10px;
- background: #dadae2;
- font-size: 2em;
- font-weight: bold;
- color: #5c5c5c;
- }
- .topnavbox {
- padding-left: 10px;
- padding-top: 5px;
- padding-bottom: 5px;
- background: #abacba;
- border-bottom: black solid 1px;
- font-size: 1.2em;
- }
- .topnavbox a{
- color: black;
- font-weight: normal;
- }
- .sidebar {
- float: left;
- /* width:9em;
- border-right:#abacba solid 1px;
- border-left: #abacba solid 1px;
- height:100%; */
- border: #abacba solid 1px;
- padding-left: 10px;
- margin-left: 10px;
- padding-right: 10px;
- margin-right: 10px;
- color: #5d5d5d;
- background: #dadae2;
- }
- .sidebar a {
- text-decoration: none;
- border-bottom: #e29625 dotted 1px;
- color: #e29625;
- font-weight: normal;
- }
- .sidebar h1 {
- font-size: 1.2em;
- color: black;
- }
- .sidebar ul {
- padding-left: 25px;
- padding-bottom: 10px;
- border-bottom: #abacba solid 1px;
- }
- .sidebar li {
- padding-top: 2px;
- padding-bottom: 2px;
- }
- .sidebar h2 {
- font-style:italic;
- font-size: 0.81em;
- padding-left: 5px;
- padding-right: 5px;
- font-weight: normal;
- }
- .date {
- font-size: 0.6em;
- float: right;
- font-style: italic;
- }
- .method, .signal, .property {
- margin-left: 1em;
- margin-right: 4em;
- }
- .rationale {
- font-style: italic;
- border-left: 0.25em solid #808080;
- padding-left: 0.5em;
- }
-
- .added {
- color: #006600;
- background: #ffffff;
- }
- .deprecated {
- color: #ff0000;
- background: #ffffff;
- }
- table, tr, td, th {
- border: 1px solid #666;
- }
-
- </style>
- </head>
- <body>
- <h1 class="topbox">
- <xsl:value-of select="tp:title" />
- </h1>
- <xsl:if test="tp:version">
- <h2>Version <xsl:value-of select="string(tp:version)"/></h2>
- </xsl:if>
- <xsl:apply-templates select="tp:copyright"/>
- <xsl:apply-templates select="tp:license"/>
- <xsl:apply-templates select="tp:docstring"/>
-
- <h2>Interfaces</h2>
- <ul>
- <xsl:for-each select="//node/interface">
- <li><code><a href="#{@name}"><xsl:value-of select="@name"/></a></code></li>
- </xsl:for-each>
- </ul>
-
- <xsl:apply-templates select="//node"/>
- <xsl:apply-templates select="tp:generic-types"/>
- <xsl:apply-templates select="tp:errors"/>
-
- <h1>Index</h1>
- <h2>Index of interfaces</h2>
- <ul>
- <xsl:for-each select="//node/interface">
- <li><code><a href="#{@name}"><xsl:value-of select="@name"/></a></code></li>
- </xsl:for-each>
- </ul>
- <h2>Index of types</h2>
- <ul>
- <xsl:for-each select="//tp:simple-type | //tp:enum | //tp:flags | //tp:mapping | //tp:struct | //tp:external-type">
- <xsl:sort select="@name"/>
- <li>
- <code>
- <a href="#type-{@name}">
- <xsl:value-of select="@name"/>
- </a>
- </code>
- <xsl:apply-templates mode="in-index" select="."/>
- </li>
- </xsl:for-each>
- </ul>
- </body>
- </html>
- </xsl:template>
-
- <xsl:template match="node">
- <xsl:apply-templates />
- </xsl:template>
-
- <xsl:template match="text()">
- <xsl:if test="normalize-space(.) != ''">
- <xsl:message terminate="yes">
- <xsl:text>Stray text: {{{</xsl:text>
- <xsl:value-of select="." />
- <xsl:text>}}}&#10;</xsl:text>
- </xsl:message>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="*">
- <xsl:message terminate="yes">
- <xsl:text>Unrecognised element: {</xsl:text>
- <xsl:value-of select="namespace-uri(.)" />
- <xsl:text>}</xsl:text>
- <xsl:value-of select="local-name(.)" />
- <xsl:text>&#10;</xsl:text>
- </xsl:message>
- </xsl:template>
-</xsl:stylesheet>
-
-<!-- vim:set sw=2 sts=2 et: -->
diff --git a/spec/generic-types.xml b/spec/generic-types.xml
deleted file mode 100644
index f2bd4940..00000000
--- a/spec/generic-types.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<tp:generic-types
- xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
-
- <tp:mapping name="Value_Set">
- <tp:docstring>A mapping from key names to a variant</tp:docstring>
- <tp:member type="s" name="Key"/>
- <tp:member type="v" name="Value"/>
- </tp:mapping>
-
-</tp:generic-types>
-
-
diff --git a/spec/myfilter.conf b/spec/myfilter.conf
deleted file mode 100644
index 38ef3870..00000000
--- a/spec/myfilter.conf
+++ /dev/null
@@ -1,18 +0,0 @@
-# AsciiDoc filter for graphviz
-
-[svg-template]
-<div class="svg">
-<div class="title">{title}</div>
-<object type="image/svg+xml" data="{file}"></object>
-</div>
-
-[blockdef-filter]
-ifdef::backend-xhtml11[]
-dotty-style=template="svg-template",subs=(),posattrs=("style","file"),filter="dot -Tsvg -o{outdir}/{file}; echo"
-endif::backend-xhtml11[]
-
-[macros]
-(?su)[\\]?(?P<name>api):(?P<target>\S*?)(\[(?P<attrlist>.*?)\])=
-
-[api-inlinemacro]
-<a href="../{target}/index.html">{0=<tt>{target}</tt>}</a>
diff --git a/spec/spec-to-introspect.xsl b/spec/spec-to-introspect.xsl
deleted file mode 100644
index 980604ac..00000000
--- a/spec/spec-to-introspect.xsl
+++ /dev/null
@@ -1,51 +0,0 @@
-<!-- Remove Telepathy extensions from a D-Bus interface, trying to leave only
-DTD-compliant introspection XML. The output still needs to be subjected to the
-following sed filter:
-sed -e 's@xmlns:tp="http://telepathy\.freedesktop\.org/wiki/DbusSpec.extensions-v0"@@g'
-
-The master copy of this stylesheet is in the Telepathy spec repository -
-please make any changes there.
-
-Copyright (C) 2006, 2007 Collabora Limited
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--->
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"
- exclude-result-prefixes="tp">
-
- <xsl:template match="*">
- <xsl:copy>
- <xsl:for-each select="@*">
- <xsl:if test="not(starts-with(name(), 'tp:'))">
- <xsl:copy/>
- </xsl:if>
- </xsl:for-each>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
-
- <xsl:template match="tp:*"/>
- <xsl:template match="text()"/>
-
- <xsl:output method="xml" indent="yes" encoding="UTF-8"
- omit-xml-declaration="no"
- doctype-system="http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"
- doctype-public="-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" />
-
-</xsl:stylesheet>
-
-<!-- vim:set sw=2 sts=2 et: -->
diff --git a/spec/xs3p/CHANGES b/spec/xs3p/CHANGES
deleted file mode 100644
index 6a67241c..00000000
--- a/spec/xs3p/CHANGES
+++ /dev/null
@@ -1,9 +0,0 @@
-xs3p was originally developed by DSTC and was availabe
-through their website at http://titanium.dstc.edu.au/xml/xs3p/
-
-Since the demise of this organization, we at FiForms Solutions
-have decided to host xs3p, since we have been using it in
-documenting the XML used in FiForms. The stylesheet has been
-modified to point to the new xs3p home here at FiForms, while
-still retaining the old (dead) link to the dstc website. The
-xs3p home is http://xml.fiforms.org/xs3p/ \ No newline at end of file
diff --git a/spec/xs3p/LICENSE.html b/spec/xs3p/LICENSE.html
deleted file mode 100644
index 263e6356..00000000
--- a/spec/xs3p/LICENSE.html
+++ /dev/null
@@ -1,519 +0,0 @@
-<html>
-
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
- <title>DSTC Public License</title>
-</head>
-
-<body>
-<h1>DSTC Public License (DPL)</h1>
-<p>Version 1.1</p>
-
-<h2>1. Definitions.</h2>
-
-<p><b>1.0.1. "Commercial Use" </b>means distribution or otherwise making
-the Covered Code available to a third party.</p>
-
-<p><b>1.1. "Contributor"</b> means each entity that creates or
-contributes to the creation of Modifications.</p>
-
-<p><b>1.2. "Contributor Version"</b> means the combination of the
-Original Code, prior Modifications used by a Contributor, and the
-Modifications made by that particular Contributor.</p>
-
-<p><b>1.3. "Covered Code"</b> means the Original Code or
-Modifications or the combination of the Original Code and Modifications,
-in each case including portions thereof<b>.</b></p>
-
-<p><b>1.4. "Electronic Distribution Mechanism"</b> means a mechanism
-generally accepted in the software development community for the
-electronic transfer of data.</p>
-
-<p><b>1.5. "Executable"</b> means Covered Code in any form other than
-Source Code.</p>
-
-<p><b>1.6. "Initial Developer"</b> means the individual or entity
-identified as the Initial Developer in the Source Code notice required
-by <b>Exhibit A</b>.</p>
-
-<p><b>1.7. "Larger Work"</b> means a work which combines Covered Code
-or portions thereof with code not governed by the terms of this
-License.</p>
-
-<p><b>1.8. "License"</b> means this document.</p>
-
-<p><b>1.8.1. "Licensable"</b> means having the right to grant, to the
-maximum extent possible, whether at the time of the initial grant or
-subsequently acquired, any and all of the rights conveyed herein.</p>
-
-<p><b>1.9. "Modifications"</b> means any addition to or deletion from
-the substance or structure of either the Original Code or any previous
-Modifications. When Covered Code is released as a series of files, a
-Modification is:</p>
-
-<ul>
-<li><b>A.</b> Any addition to or
-deletion from the contents of a file containing Original Code or previous
-Modifications.</li>
-
-<li><b>B.</b> Any new file that contains any part of the Original Code
-or previous Modifications.</li>
-</ul>
-
-
-<p><b>1.10. "Original Code"</b>
-means Source Code of computer software code which is described in the Source
-Code notice required by <b>Exhibit A</b> as Original Code, and which, at the
-time of its release under this License is not already Covered Code governed by
-this License.</p>
-
-<p><b>1.10.1. "Patent Claims"</b> means any patent claim(s), now owned
-or hereafter acquired, including without limitation, method, process,
-and apparatus claims, in any patent Licensable by grantor.</p>
-
-<p><b>1.11. "Source Code"</b> means the preferred form of the Covered
-Code for making modifications to it, including all modules it contains,
-plus any associated interface definition files, scripts used to control
-compilation and installation of an Executable, or source code
-differential comparisons against either the Original Code or another
-well known, available Covered Code of the Contributor's choice. The
-Source Code can be in a compressed or archival form, provided the
-appropriate decompression or de-archiving software is widely available
-for no charge.</p>
-
-<p><b>1.12. "You" (or "Your")</b> means an individual or a legal
-entity exercising rights under, and complying with all of the terms of,
-this License or a future version of this License issued under Section
-6.1. For legal entities, "You" includes any entity which controls, is
-controlled by, or is under common control with You. For purposes of this
-definition, "control" means (a) the power, direct or indirect, to cause
-the direction or management of such entity, whether by contract or
-otherwise, or (b) ownership of more than fifty percent (50%) of the
-outstanding shares or beneficial ownership of such
-entity.</p>
-
-
-<h2>2. Source Code License.</h2>
-
-<h3>2.1. The Initial Developer Grant.</h3>
-
-<p>The Initial Developer hereby grants You a world-wide, royalty-free,
-non-exclusive license, subject to third party intellectual property
-claims:</p>
-
-<p><b>(a)</b> under intellectual property rights (other than patent or
-trademark) Licensable by Initial Developer to use, reproduce, modify,
-display, perform, sublicense and distribute the Original Code (or
-portions thereof) with or without Modifications, and/or as part of a
-Larger Work; and</p>
-
-<p><b>(b)</b> under Patents Claims infringed by the making, using or
-selling of Original Code, to make, have made, use, practice, sell, and
-offer for sale, and/or otherwise dispose of the Original Code (or
-portions thereof).</p>
-
-<p><b>(c) </b>the licenses granted in this Section 2.1(a) and (b) are
-effective on the date Initial Developer first distributes Original Code
-under the terms of this License.</p>
-
-<p><b>(d) </b>Notwithstanding Section 2.1(b) above, no patent license is
-granted: 1) for code that You delete from the Original Code; 2) separate
-from the Original Code; or 3) for infringements caused by: i) the
-modification of the Original Code or ii) the combination of the Original
-Code with other software or devices.</p>
-
-<h3>2.2. Contributor Grant.</h3>
-
-<p>Subject to third party intellectual property claims, each Contributor
-hereby grants You a world-wide, royalty-free, non-exclusive license</p>
-
-<p><b>(a)</b> under intellectual property rights (other than patent or
-trademark) Licensable by Contributor, to use, reproduce, modify,
-display, perform, sublicense and distribute the Modifications created by
-such Contributor (or portions thereof) either on an unmodified basis,
-with other Modifications, as Covered Code and/or as part of a Larger
-Work; and</p>
-
-<p><b>(b)</b> under Patent Claims infringed by the making, using, or
-selling of Modifications made by that Contributor either alone and/or in
-combination with its Contributor Version (or portions of such
-combination), to make, use, sell, offer for sale, have made, and/or
-otherwise dispose of: 1) Modifications made by that Contributor (or
-portions thereof); and 2) the combination of Modifications made by that
-Contributor with its Contributor Version (or portions of such
-combination).</p>
-
-<p><b>(c) </b>the licenses granted in Sections 2.2(a) and 2.2(b) are
-effective on the date Contributor first makes Commercial Use of the
-Covered Code.</p>
-
-<p><b>(d)</b> Notwithstanding Section 2.2(b) above, no patent
-license is granted: 1) for any code that Contributor has deleted from
-the Contributor Version; 2) separate from the Contributor Version; 3)
-for infringements caused by: i) third party modifications of Contributor
-Version or ii) the combination of Modifications made by that Contributor
-with other software (except as part of the Contributor Version) or other
-devices; or 4) under Patent Claims infringed by Covered Code in the
-absence of Modifications made by that Contributor.</p>
-
-
-<h2>3. Distribution Obligations</h2>
-
-<h3>3.1. Application of License.</h3>
-
-<p>The Modifications which You create or to which You contribute are
-governed by the terms of this License, including without limitation
-Section <b>2.2</b>. The Source Code version of Covered Code may be
-distributed only under the terms of this License or a future version of
-this License released under Section <b>6.1</b>, and You must include a
-copy of this License with every copy of the Source Code You
-distribute. You may not offer or impose any terms on any Source Code
-version that alters or restricts the applicable version of this License
-or the recipients' rights hereunder. However, You may include an
-additional document offering the additional rights described in Section
-<b>3.5</b>.</p>
-
-<h3>3.2. Availability of Source Code.</h3>
-
-<p>Any Modification which You create or to which You contribute must be
-made available in Source Code form under the terms of this License
-either on the same media as an Executable version or via an accepted
-Electronic Distribution Mechanism to anyone to whom you made an
-Executable version available; and if made available via Electronic
-Distribution Mechanism, must remain available for at least twelve (12)
-months after the date it initially became available, or at least six (6)
-months after a subsequent version of that particular Modification has
-been made available to such recipients. You are responsible for ensuring
-that the Source Code version remains available even if the Electronic
-Distribution Mechanism is maintained by a third party.</p>
-
-<h3>3.3. Description of Modifications.</h3>
-
-<p>You must cause all Covered Code to which You contribute to contain a
-file documenting the changes You made to create that Covered Code and
-the date of any change. You must include a prominent statement that the
-Modification is derived, directly or indirectly, from Original Code
-provided by the Initial Developer and including the name of the Initial
-Developer in (a) the Source Code, and (b) in any notice in an Executable
-version or related documentation in which You describe the origin or
-ownership of the Covered Code.</p>
-
-<h3>3.4. Intellectual Property Matters</h3>
-
-<h4>(a) Third Party Claims.</h4>
-
-<p>If Contributor has knowledge that a license under a third party's
-intellectual property rights is required to exercise the rights granted
-by such Contributor under Sections 2.1 or 2.2, Contributor must include
-a text file with the Source Code distribution titled "LEGAL" which
-describes the claim and the party making the claim in sufficient detail
-that a recipient will know whom to contact. If Contributor obtains such
-knowledge after the Modification is made available as described in
-Section 3.2, Contributor shall promptly modify the LEGAL file in all
-copies Contributor makes available thereafter and shall take other steps
-(such as notifying appropriate mailing lists or newsgroups) reasonably
-calculated to inform those who received the Covered Code that new
-knowledge has been obtained.</p>
-
-<h4>(b) Contributor APIs.</h4>
-
-<p>If Contributor's Modifications include an application programming
-interface and Contributor has knowledge of patent licenses which are
-reasonably necessary to implement that API, Contributor must also
-include this information in the LEGAL file.</p>
-
-<h4>(c) Representations.</h4>
-
-<p>Contributor represents that, except
-as disclosed pursuant to Section 3.4(a) above, Contributor believes that
-Contributor's Modifications are Contributor's original creation(s)
-and/or Contributor has sufficient rights to grant the rights conveyed by
-this License.</p>
-
-<h3>3.5. Required Notices.</h3>
-
-<p>You must duplicate the notice in <b>Exhibit A</b> in each file of the
-Source Code. If it is not possible to put such notice in a
-particular Source Code file due to its structure, then You must include
-such notice in a location (such as a relevant directory) where a user
-would be likely to look for such a notice. If You created one or
-more Modification(s) You may add your name as a Contributor to the
-notice described in <b>Exhibit A</b>. You must also duplicate this
-License in any documentation for the Source Code where You describe
-recipients' rights or ownership rights relating to Covered Code.
-You may choose to offer, and to charge a fee for, warranty, support,
-indemnity or liability obligations to one or more recipients of Covered
-Code. However, You may do so only on Your own behalf, and not on behalf
-of the Initial Developer or any Contributor. You must make it absolutely
-clear than any such warranty, support, indemnity or liability obligation
-is offered by You alone, and You hereby agree to indemnify the Initial
-Developer and every Contributor for any liability incurred by the
-Initial Developer or such Contributor as a result of warranty, support,
-indemnity or liability terms You offer.</p>
-
-<h3>3.6. Distribution of Executable Versions.</h3>
-
-<p>You may distribute Covered Code in Executable form only if the
-requirements of Section <b>3.1-3.5</b> have been met for that Covered
-Code, and if You include a notice stating that the Source Code version
-of the Covered Code is available under the terms of this License,
-including a description of how and where You have fulfilled the
-obligations of Section <b>3.2</b>. The notice must be conspicuously
-included in any notice in an Executable version, related documentation
-or collateral in which You describe recipients' rights relating to the
-Covered Code. You may distribute the Executable version of Covered Code
-or ownership rights under a license of Your choice, which may contain
-terms different from this License, provided that You are in compliance
-with the terms of this License and that the license for the Executable
-version does not attempt to limit or alter the recipient's rights in the
-Source Code version from the rights set forth in this License. If You
-distribute the Executable version under a different license You must
-make it absolutely clear that any terms which differ from this License
-are offered by You alone, not by the Initial Developer or any
-Contributor. You hereby agree to indemnify the Initial Developer and
-every Contributor for any liability incurred by the Initial Developer or
-such Contributor as a result of any such terms You offer.</p>
-
-<h3>3.7. Larger Works.</h3>
-
-<p>You may create a Larger Work by combining Covered Code with other code not
-governed by the terms of this License and distribute the Larger Work as a
-single product. In such a case, You must make sure the requirements of this
-License are fulfilled for the Covered Code.</p>
-
-<h2>4. Inability to Comply Due to Statute or Regulation.</h2>
-
-<p>If it is impossible for You to comply with any of the terms of this
-License with respect to some or all of the Covered Code due to statute,
-judicial order, or regulation then You must: (a) comply with the terms
-of this License to the maximum extent possible; and (b) describe the
-limitations and the code they affect. Such description must be included
-in the LEGAL file described in Section <b>3.4</b> and must be included
-with all distributions of the Source Code. Except to the extent
-prohibited by statute or regulation, such description must be
-sufficiently detailed for a recipient of ordinary skill to be able to
-understand it.</p>
-
-
-<h2>5. Application of this License.</h2>
-
-<p>This License applies to code to which the Initial Developer has
-attached the notice in <b>Exhibit A</b> and to related Covered Code.</p>
-
-
-<h2>6. Versions of the License.</h2>
-
-<h3>6.1. New Versions</h3>
-
-<p>The Distributed Systems Technology Centre ("DSTC") may publish
-revised and/or new versions of the License from time to time. Each
-version will be given a distinguishing version number.</p>
-
-<h3>6.2. Effect of New Versions</h3>
-
-<p>Once Covered Code has been published under a particular version of
-the License, You may always continue to use it under the terms of that
-version. You may also choose to use such Covered Code under the terms of
-any subsequent version of the License published by DSTC. No one other
-than DSTC has the right to modify the terms applicable to Covered Code
-created under this License.</p>
-
-<h3>6.3. Derivative Works</h3>
-
-<p>If You create or use a modified version of this License (which you
-may only do in order to apply it to code which is not already Covered
-Code governed by this License), You must (a) rename Your license so that
-the phrases "DSTC", "DPL" or any confusingly similar phrase do not
-appear in your license (except to note that your license differs from
-this License) and (b) otherwise make it clear that Your version of the
-license contains terms which differ from the DSTC Public
-License. (Filling in the name of the Initial Developer, Original Code or
-Contributor in the notice described in <b>Exhibit A</b> shall not of
-themselves be deemed to be modifications of this License.)</p>
-
-<h2>7. Disclaimer of Warranty.</h2>
-
-<p>COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
-WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS,
-MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE
-RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH
-YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT
-THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY
-NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY
-CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED
-CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.</p>
-
-
-<h2>8. Termination.</h2>
-
-<p><b>8.1. </b>This License and the rights granted hereunder will
-terminate automatically if You fail to comply with terms herein and fail
-to cure such breach within 30 days of becoming aware of the breach. All
-sublicenses to the Covered Code which are properly granted shall survive
-any termination of this License. Provisions which, by their nature, must
-remain in effect beyond the termination of this License shall
-survive.</p>
-
-<p><b>8.2.
-</b>If You initiate
-litigation by asserting a patent infringement claim (excluding declatory
-judgment actions) against Initial Developer or a Contributor (the Initial
-Developer or Contributor against whom You file such action is referred to as
-'Participant') alleging that:</p>
-
-<p><b>(a) </b>such Participant's Contributor Version directly or
-indirectly infringes any patent, then any and all rights granted by such
-Participant to You under Sections 2.1 and/or 2.2 of this License shall,
-upon 60 days notice from Participant terminate prospectively, unless if
-within 60 days after receipt of notice You either: (i) agree in writing
-to pay Participant a mutually agreeable reasonable royalty for Your past
-and future use of Modifications made by such Participant, or (ii)
-withdraw Your litigation claim with respect to the Contributor Version
-against such Participant. If within 60 days of notice, a reasonable
-royalty and payment arrangement are not mutually agreed upon in writing
-by the parties or the litigation claim is not withdrawn, the rights
-granted by Participant to You under Sections 2.1 and/or 2.2
-automatically terminate at the expiration of the 60 day notice period
-specified above.</p>
-
-<p><b>(b)</b> any software, hardware, or device, other than such
-Participant's Contributor Version, directly or indirectly infringes any
-patent, then any rights granted to You by such Participant under
-Sections 2.1(b) and 2.2(b) are revoked effective as of the date You
-first made, used, sold, distributed, or had made, Modifications made by
-that Participant.</p>
-
-<p><b>8.3.
-</b>If You assert a patent
-infringement claim against Participant alleging that such Participant's
-Contributor Version directly or indirectly infringes any patent where such
-claim is resolved (such as by license or settlement) prior to the initiation of
-patent infringement litigation, then the reasonable value of the licenses
-granted by such Participant under Sections 2.1 or 2.2 shall be taken into
-account in determining the amount or value of any payment or license.</p>
-
-<p><b>8.4.</b> In the event of termination under
-Sections 8.1 or 8.2 above, all end user license agreements (excluding
-distributors and resellers) which have been validly granted by You or any
-distributor hereunder prior to termination shall survive termination.</p>
-
-<h2>9. Limitation of Liability.</h2>
-
-<p>UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
-(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
-DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR
-ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY
-INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER
-INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK
-STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
-COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
-INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
-LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
-RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
-PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION
-OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION
-AND LIMITATION MAY NOT APPLY TO YOU.</p>
-
-<h2>10. U.S. Government End Users.</h2>
-
-<p>The Covered Code is a "commercial item," as that term is defined in
-48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
-software" and "commercial computer software documentation," as such
-terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
-C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
-all U.S. Government End Users acquire Covered Code with only those
-rights set forth herein.</p>
-
-
-<h2>11. Miscellaneous.</h2>
-
-<p>This License represents the complete agreement concerning subject
-matter hereof. If any provision of this License is held to be
-unenforceable, such provision shall be reformed only to the extent
-necessary to make it enforceable. This License shall be governed by
-Queensland, Australia law provisions (except to the extent applicable
-law, if any, provides otherwise), excluding its conflict-of-law
-provisions. With respect to disputes in which at least one party is a
-citizen of, or an entity chartered or registered to do business in
-Australia, any litigation relating to this License shall be subject to
-the jurisdiction of Australian Courts, with the losing party responsible
-for costs, including without limitation, court costs and reasonable
-attorneys' fees and expenses. The application of the United Nations
-Convention on Contracts for the International Sale of Goods is expressly
-excluded. Any law or regulation which provides that the language of a
-contract shall be construed against the drafter shall not apply to this
-License.</p>
-
-
-<h2>12. Responsibility for Claims.</h2>
-
-<p>As between Initial Developer and the Contributors, each party is
-responsible for claims and damages arising, directly or indirectly, out
-of its utilization of rights under this License and You agree to work
-with Initial Developer and Contributors to distribute such
-responsibility on an equitable basis. Nothing herein is intended or
-shall be deemed to constitute any admission of liability.</p>
-
-
-<h2>13. Multiple-licensed Code.</h2>
-
-<p>Initial Developer may designate portions of the Covered Code as
-"Multiple-Licensed". "Multiple-Licensed" means that the Initial
-Developer permits you to utilize portions of the Covered Code under Your
-choice of the DPL or the alternative licenses, if any, specified by the
-Initial Developer in the file described in Exhibit A.</p>
-
-
-<h2>14. High Risk Activities.</h2>
-
-<p>The Software is not fault-tolerant and is not designed, manufactured
-or intended for use or resale as on-line control equipment in hazardous
-environments requiring fail-safe performance, such as in the operation
-of nuclear facilities, aircraft navigation or communication systems, air
-traffic control, direct life support machines, or weapons systems, in
-which the failure of the Software could lead directly to death, personal
-injury, or severe physical or environmental damage ("High Risk
-Activities").</p>
-
-
-<h2>EXHIBIT A - DSTC Public License.</h2>
-
-<p>The contents of this file are subject to the DSTC Public License
-Version 1.1 (the 'License'); you may not use this file except in
-compliance with the License.</p>
-
-<p>Software distributed under the License is distributed on an 'AS IS'
-basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-License for the specific language governing rights and limitations under
-the License.</p>
-
-<p>The Original Code is ______________________________________.</p>
-
-<p>The Initial Developer of the Original Code is
-________________________. Portions created by ______________________ are
-Copyright &copy; _____________________________. All Rights
-Reserved.</p>
-
-<p>Contributor(s): ______________________________________.</p>
-
-<p>Alternatively, the contents of this file may be used under the terms
-of the _____ license (the "[___] License"), in which case the provisions
-of [______] License are applicable instead of those above. If you wish
-to allow use of your version of this file only under the terms of the
-[____] License and not to allow others to use your version of this file
-under the DPL, indicate your decision by deleting the provisions above
-and replace them with the notice and other provisions required by the
-[___] License. If you do not delete the provisions above, a recipient
-may use your version of this file under either the DPL or the [___]
-License.'</p>
-
-<p>[NOTE: The text of this Exhibit A may differ slightly from the text
-of the notices in the Source Code files of the Original Code. You should
-use the text of this Exhibit A rather than the text found in the
-Original Code Source Code for Your Modifications.]</p>
-
-</body>
-
-</html>
-
diff --git a/spec/xs3p/README.txt b/spec/xs3p/README.txt
deleted file mode 100644
index c9c2df10..00000000
--- a/spec/xs3p/README.txt
+++ /dev/null
@@ -1,224 +0,0 @@
-xs3p - Version 1.0
-==================
-
-Index
------
--Description
--Generating the documentation
--Viewing the documentation
--Configuring the stylesheet
-
-Description
------------
-
-xs3p is a schema documentation generator. It is an XSLT stylesheet
-that will output an XHTML document from an XSD schema. Aside from
-using as much W3C acronyms as possible, the tool makes schemas more
-readable by providing a view of schema components' constraints as a
-sample XML instance, links that allow the user to jump to the
-documentation of schema components that are referenced, and a whole
-host of neat features. However, most important of all, it makes your
-schemas look 'pretty in pink'.
-
-Generating the documentation
-----------------------------
-
-To generate the documentation, you need a command-line XSLT tool that
-supports the W3C XSLT 1.0 recommendation. (NOTE: xs3p does not work
-with <?xml-stylesheet ?> processing instruction because the <A> links
-in the generated XHTML document will not be correct.)
-
-Here are a few examples of XSLT tools:
-
-1. MSXML 4.0 (Windows only)
----------------------------
-
-You can download MSXML 4.0 SP1 at:
-
-http://msdn.microsoft.com/downloads/default.asp?
-url=/downloads/sample.asp?url=/msdn-
-files/027/001/766/msdncompositedoc.xml
-
-(If the URL is incorrect, go to http://msdn.microsoft.com, and search
-for the keywords, "msxml 4.0".)
-
-Microsoft's web page gives you instructions of how to install the
-MSXML 4.0 library. You'll also need to download Msxsl which is a
-wrapper to access the library from the command-line. You can download
-it at:
-
-http://msdn.microsoft.com/downloads/default.asp?
-URL=/downloads/sample.asp?url=/MSDN-
-FILES/027/001/485/msdncompositedoc.xml
-
-(Again, if the URL is incorrect, go to http://msdn.microsoft.com, and
-search for the keyword, "msxsl".)
-
-Click on the "Download the executable file" link. Save the msxsl.exe
-file in a directory specified in the PATH environment variable. In
-most cases, you can dump the file in c:\winnt (or c:\windows
-depending on your OS) directory since it's already in the PATH
-variable.
-
-Type: msxsl -? to learn how to use the tool. The basic usage is:
-
-msxsl [source] [stylesheet] -o [result] {[param-name]=[param-value]...}
-
-2. Xalan (Java-based)
----------------------
-
-You can download Xalan from Apache at:
-
-http://xml.apache.org/xalan-j/getstarted.html
-
-The web page gives you instructions of how to install Xalan. You can
-find out how to use Xalan's command-line tool at:
-
-http://xml.apache.org/xalan-j/commandline.html
-
-The basic usage is:
-
-java org.apache.xalan.xslt.Process -IN [source] -XSL [stylesheet]
--OUT [result] {-PARAM [param-name] [param-value]...}
-
-3. Saxon (Java-based)
----------------------
-
-You can download Saxon from Sourceforge at:
-
-http://sourceforge.net/projects/saxon
-
-If you download the saxon package, it comes with instructions of how
-to install and use the Java jar files.
-
-If you download the instant saxon package, it comes with a .exe file,
-and all you have to do is put the file in a directory in the PATH
-environment variable. It also comes with instant.html file, which
-documents how to use it. The basic usage is:
-
-saxon -o [result] [source] [stylesheet] {[param-name]=[param-value]...}
-
-Viewing the documentation
--------------------------
-
-To view the documentation, you need a browser that supports the W3C
-XHTML 1.0 and CSS 2 recommendations, e.g.
--Internet Explorer 5.5 and above
--Netscape 6 and above
--Opera 5.0 and above
--Mozilla 1.0
-
-Configuring the stylesheet
---------------------------
-
-The xs3p stylesheet can be customised through its global parameters,
-which are listed below.
-
-title :-
- You can specify your own title for the document, rather than
-using the default one.
-
-sortByComponent :-
- If this parameter is set to "true", the schema components are
-presented sorted by type and name. Otherwise, they are presented in
-the order that they appear in the schema. By default, this parameter
-is set to "true."
-
-useJavaScript :-
- The generated XHTML document uses JavaScript to hide some
-details like the underlying schema component XML representation,
-which can be made to appear with a button press. Since some people
-have ideological objections to JavaScript, this feature can be turned
-off. If this parameter is set to "true", JavaScript will be used in
-the generated documentation. Otherwise, it won't. By default, this
-parameter is set to "true."
-
-printAllSuperTypes :-
- The type hierarchy of a global type definition is displayed in
-its section. If this parameter is set to "true", all super-types of
-the current type are shown in the type hierarchy. Otherwise, only the
-immediate parent type is displayed. By default, this parameter is set
-to "true."
-
-printAllSubTypes :-
- This parameter has a similar concept as printAllSuperTypes. If
-it is set to "true", all sub-types of the current type are shown in
-the type hierarchy. Otherwise, only the direct sub-types are
-displayed. By default, this parameter is set to "true."
-
-printLegend :-
- If this parameter is set to "true", the Legend section is
-included. Otherwise, it isn't. By default, this parameter is set to
-"true."
-
-printGlossary :-
- If this parameter is set to "true", the Glossary section is
-included. Otherwise, it isn't. By default, this parameter is set to
-"true."
-
-printNSPrefixes :-
- If this parameter is set to "true", namespace information is
-provided when displaying sample instances and references. This is
-done by providing a prefix in front of tags and references, which
-when clicked, will take the user to the declared namespace. The
-prefix matches the prefix in the namespace declaration in the schema.
-If not set to "true", namespace prefixes are not displayed. By
-default, this parameter is set to "true."
-
-searchIncludedSchemas :-
- If this parameter is set to "true", xs3p will search for
-components in "included" schemas when creating links and generating
-the XML Instance Representation table.
- When this parameter is set to "true", the "linksFile" parameter
-must also be set, which is described below. Otherwise, an error will
-be raised.
- The XSLT processor will also raise an error if it can't find the
-schemas specified in the "schemaLocation" attribute of "include"
-elements. XSLT implementations seem to resolve relative addresses
-relative to the XSLT script, rather than the source file. This is a
-common cause of error since in schemas, the "schemaLocation"
-attribute is specified relative to the current schema. It is probably
-best to write a script (e.g. Ant build file, DOS batch file, or Unix
-shell script), which copies the xs3p stylesheet to the directory
-containing the set of schemas and execute the XSLT script based on
-the local copy.
- The final thing to note is that this search is recursive, so
-schemas "included" in the current schema's "included" schemas will
-also be searched. This is another common source of error, since
-schemas may be searched that might not have been thought about.
- There are some batch files in the examples/ directory to show
-how to use this feature. If you have 'msxsl', run "test_msxsl.bat"
-file. If you use 'xalanj', run "test_xalanj.bat" file. Otherwise,
-edit the files for your specific XSLT processor.
-
-searchImportedSchemas :-
- If this parameter is set to "true", xs3p will search for
-components in "imported" schemas when creating links and generating
-the XML Instance Representation table. The above discussion for the
-"searchIncludedSchemas" parameter also applies to this parameter.
-Also, when this parameter is set to "true", the "linksFile" parameter
-must also be set.
-
-linksFile :-
- Specifies the file which maps from file locations of
-"included" and "imported" schemas to the file locations of their
-xs3p-generated documentation. This file must be provided if either
-"searchIncludedSchemas" or "searchImportedSchemas" is set to true.
- If relative addresses are used to specify the location of
-external xs3p-generated documentation, they must be relative to
-documentation file currently generated. NOTE: The external
-documentation files does not need to exist at the time of generating
-the documentation for the current schema.
- The mapping is specified in XML. The dtd and schema for this
-mapping syntax are "links.dtd" and "links.xsd" respectively.
- A sample links file, "links.xml", is provided in the examples/
-directory.
- NOTE: The "xmlns" namespace attribute with the correct
-namespace must be provided in the mapping file for the xs3p
-stylesheet to work.
-
-
-
-COPYRIGHT AND LICENCE
-
-Copyright (C) 2001, 2002 DSTC Pty Ltd. \ No newline at end of file
diff --git a/spec/xs3p/examples/XMLSchema.xsd b/spec/xs3p/examples/XMLSchema.xsd
deleted file mode 100644
index b8229fd9..00000000
--- a/spec/xs3p/examples/XMLSchema.xsd
+++ /dev/null
@@ -1,2492 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- XML Schema schema for XML Schemas: Part 1: Structures -->
-<!-- Note this schema is NOT the normative structures schema. -->
-<!-- The prose copy in the structures REC is the normative -->
-<!-- version (which shouldn't differ from this one except for -->
-<!-- this comment and entity expansions, but just in case -->
-<!--
-<!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd" [
--->
-
-<!-- provide ID type information even for parsers which only read the
- internal subset -->
-<!--
-<!ATTLIST xs:schema id ID #IMPLIED>
-<!ATTLIST xs:complexType id ID #IMPLIED>
-<!ATTLIST xs:complexContent id ID #IMPLIED>
-<!ATTLIST xs:simpleContent id ID #IMPLIED>
-<!ATTLIST xs:extension id ID #IMPLIED>
-<!ATTLIST xs:element id ID #IMPLIED>
-<!ATTLIST xs:group id ID #IMPLIED>
-<!ATTLIST xs:all id ID #IMPLIED>
-<!ATTLIST xs:choice id ID #IMPLIED>
-<!ATTLIST xs:sequence id ID #IMPLIED>
-<!ATTLIST xs:any id ID #IMPLIED>
-<!ATTLIST xs:anyAttribute id ID #IMPLIED>
-<!ATTLIST xs:attribute id ID #IMPLIED>
-<!ATTLIST xs:attributeGroup id ID #IMPLIED>
-<!ATTLIST xs:unique id ID #IMPLIED>
-<!ATTLIST xs:key id ID #IMPLIED>
-<!ATTLIST xs:keyref id ID #IMPLIED>
-<!ATTLIST xs:selector id ID #IMPLIED>
-<!ATTLIST xs:field id ID #IMPLIED>
-<!ATTLIST xs:include id ID #IMPLIED>
-<!ATTLIST xs:import id ID #IMPLIED>
-<!ATTLIST xs:redefine id ID #IMPLIED>
-<!ATTLIST xs:notation id ID #IMPLIED>
--->
-<!--
- keep this schema XML1.0 DTD valid
- -->
-<!--
- <!ENTITY % schemaAttrs 'xmlns:hfp CDATA #IMPLIED'>
-
- <!ELEMENT hfp:hasFacet EMPTY>
- <!ATTLIST hfp:hasFacet
- name NMTOKEN #REQUIRED>
-
- <!ELEMENT hfp:hasProperty EMPTY>
- <!ATTLIST hfp:hasProperty
- name NMTOKEN #REQUIRED
- value CDATA #REQUIRED>
--->
-<!--
- Make sure that processors that do not read the external
- subset will know about the various IDs we declare
- -->
-<!--
- <!ATTLIST xs:simpleType id ID #IMPLIED>
- <!ATTLIST xs:maxExclusive id ID #IMPLIED>
- <!ATTLIST xs:minExclusive id ID #IMPLIED>
- <!ATTLIST xs:maxInclusive id ID #IMPLIED>
- <!ATTLIST xs:minInclusive id ID #IMPLIED>
- <!ATTLIST xs:totalDigits id ID #IMPLIED>
- <!ATTLIST xs:fractionDigits id ID #IMPLIED>
- <!ATTLIST xs:length id ID #IMPLIED>
- <!ATTLIST xs:minLength id ID #IMPLIED>
- <!ATTLIST xs:maxLength id ID #IMPLIED>
- <!ATTLIST xs:enumeration id ID #IMPLIED>
- <!ATTLIST xs:pattern id ID #IMPLIED>
- <!ATTLIST xs:appinfo id ID #IMPLIED>
- <!ATTLIST xs:documentation id ID #IMPLIED>
- <!ATTLIST xs:list id ID #IMPLIED>
- <!ATTLIST xs:union id ID #IMPLIED>
- ]>
--->
-<xs:schema targetNamespace="http://www.w3.org/2001/XMLSchema" blockDefault="#all" elementFormDefault="qualified" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="EN" xmlns:hfp="http://www.w3.org/2001/XMLSchema-hasFacetAndProperty">
- <xs:annotation>
- <xs:documentation>
- Part 1 version: Id: XMLSchema.xsd,v 1.50 2002/05/22 09:24:24 ht Exp
- Part 2 version: Id: datatypes.xsd,v 1.54 2002/05/27 22:22:50 ht Exp
- </xs:documentation>
- </xs:annotation>
-
-
- <xs:annotation>
- <xs:documentation source="http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/structures.html">
- The schema corresponding to this document is normative,
- with respect to the syntactic constraints it expresses in the
- XML Schema language. The documentation (within &lt;documentation> elements)
- below, is not normative, but rather highlights important aspects of
- the W3C Recommendation of which this is a part</xs:documentation>
- </xs:annotation>
-
- <xs:annotation>
- <xs:documentation>
- The simpleType element and all of its members are defined
- towards the end of this schema document</xs:documentation>
- </xs:annotation>
-
- <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd">
- <xs:annotation>
- <xs:documentation>
- Get access to the xml: attribute groups for xml:lang
- as declared on 'schema' and 'documentation' below
- </xs:documentation>
- </xs:annotation>
- </xs:import>
-
- <xs:complexType name="openAttrs">
- <xs:annotation>
- <xs:documentation>
- This type is extended by almost all schema types
- to allow attributes from other namespaces to be
- added to user schemas.
- </xs:documentation>
- </xs:annotation>
- <xs:complexContent>
- <xs:restriction base="xs:anyType">
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="annotated">
- <xs:annotation>
- <xs:documentation>
- This type is extended by all types which allow annotation
- other than &lt;schema&gt; itself
- </xs:documentation>
- </xs:annotation>
- <xs:complexContent>
- <xs:extension base="xs:openAttrs">
- <xs:sequence>
- <xs:element ref="xs:annotation" minOccurs="0"/>
- </xs:sequence>
- <xs:attribute name="id" type="xs:ID"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:group name="schemaTop">
- <xs:annotation>
- <xs:documentation>
- This group is for the
- elements which occur freely at the top level of schemas.
- All of their types are based on the "annotated" type by extension.</xs:documentation>
- </xs:annotation>
- <xs:choice>
- <xs:group ref="xs:redefinable"/>
- <xs:element ref="xs:element"/>
- <xs:element ref="xs:attribute"/>
- <xs:element ref="xs:notation"/>
- </xs:choice>
- </xs:group>
-
- <xs:group name="redefinable">
- <xs:annotation>
- <xs:documentation>
- This group is for the
- elements which can self-redefine (see &lt;redefine> below).</xs:documentation>
- </xs:annotation>
- <xs:choice>
- <xs:element ref="xs:simpleType"/>
- <xs:element ref="xs:complexType"/>
- <xs:element ref="xs:group"/>
- <xs:element ref="xs:attributeGroup"/>
- </xs:choice>
- </xs:group>
-
- <xs:simpleType name="formChoice">
- <xs:annotation>
- <xs:documentation>
- A utility type, not for public use</xs:documentation>
- </xs:annotation>
- <xs:restriction base="xs:NMTOKEN">
- <xs:enumeration value="qualified"/>
- <xs:enumeration value="unqualified"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="reducedDerivationControl">
- <xs:annotation>
- <xs:documentation>
- A utility type, not for public use</xs:documentation>
- </xs:annotation>
- <xs:restriction base="xs:derivationControl">
- <xs:enumeration value="extension"/>
- <xs:enumeration value="restriction"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="derivationSet">
- <xs:annotation>
- <xs:documentation>
- A utility type, not for public use</xs:documentation>
- <xs:documentation>
- #all or (possibly empty) subset of {extension, restriction}</xs:documentation>
- </xs:annotation>
- <xs:union>
- <xs:simpleType>
- <xs:restriction base="xs:token">
- <xs:enumeration value="#all"/>
- </xs:restriction>
- </xs:simpleType>
- <xs:simpleType>
- <xs:list itemType="xs:reducedDerivationControl"/>
- </xs:simpleType>
- </xs:union>
- </xs:simpleType>
-
- <xs:element name="schema" id="schema">
- <xs:annotation>
- <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-schema"/>
- </xs:annotation>
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="xs:openAttrs">
- <xs:sequence>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element ref="xs:include"/>
- <xs:element ref="xs:import"/>
- <xs:element ref="xs:redefine"/>
- <xs:element ref="xs:annotation"/>
- </xs:choice>
- <xs:sequence minOccurs="0" maxOccurs="unbounded">
- <xs:group ref="xs:schemaTop"/>
- <xs:element ref="xs:annotation" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:sequence>
- <xs:attribute name="targetNamespace" type="xs:anyURI"/>
- <xs:attribute name="version" type="xs:normalizedString"/>
- <xs:attribute name="finalDefault" type="xs:derivationSet" use="optional" default=""/>
- <xs:attribute name="blockDefault" type="xs:blockSet" use="optional" default=""/>
- <xs:attribute name="attributeFormDefault" type="xs:formChoice" use="optional" default="unqualified"/>
- <xs:attribute name="elementFormDefault" type="xs:formChoice" use="optional" default="unqualified"/>
- <xs:attribute name="id" type="xs:ID"/>
- <xs:attribute ref="xml:lang"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:key name="element">
- <xs:selector xpath="xs:element"/>
- <xs:field xpath="@name"/>
- </xs:key>
-
- <xs:key name="attribute">
- <xs:selector xpath="xs:attribute"/>
- <xs:field xpath="@name"/>
- </xs:key>
-
- <xs:key name="type">
- <xs:selector xpath="xs:complexType|xs:simpleType"/>
- <xs:field xpath="@name"/>
- </xs:key>
-
- <xs:key name="group">
- <xs:selector xpath="xs:group"/>
- <xs:field xpath="@name"/>
- </xs:key>
-
- <xs:key name="attributeGroup">
- <xs:selector xpath="xs:attributeGroup"/>
- <xs:field xpath="@name"/>
- </xs:key>
-
- <xs:key name="notation">
- <xs:selector xpath="xs:notation"/>
- <xs:field xpath="@name"/>
- </xs:key>
-
- <xs:key name="identityConstraint">
- <xs:selector xpath=".//xs:key|.//xs:unique|.//xs:keyref"/>
- <xs:field xpath="@name"/>
- </xs:key>
-
- </xs:element>
-
- <xs:simpleType name="allNNI">
- <xs:annotation><xs:documentation>
- for maxOccurs</xs:documentation></xs:annotation>
- <xs:union memberTypes="xs:nonNegativeInteger">
- <xs:simpleType>
- <xs:restriction base="xs:NMTOKEN">
- <xs:enumeration value="unbounded"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:union>
- </xs:simpleType>
-
- <xs:attributeGroup name="occurs">
- <xs:annotation><xs:documentation>
- for all particles</xs:documentation></xs:annotation>
- <xs:attribute name="minOccurs" type="xs:nonNegativeInteger" use="optional" default="1"/>
- <xs:attribute name="maxOccurs" type="xs:allNNI" use="optional" default="1"/>
- </xs:attributeGroup>
-
- <xs:attributeGroup name="defRef">
- <xs:annotation><xs:documentation>
- for element, group and attributeGroup,
- which both define and reference</xs:documentation></xs:annotation>
- <xs:attribute name="name" type="xs:NCName"/>
- <xs:attribute name="ref" type="xs:QName"/>
- </xs:attributeGroup>
-
- <xs:group name="typeDefParticle">
- <xs:annotation>
- <xs:documentation>
- 'complexType' uses this</xs:documentation></xs:annotation>
- <xs:choice>
- <xs:element name="group" type="xs:groupRef"/>
- <xs:element ref="xs:all"/>
- <xs:element ref="xs:choice"/>
- <xs:element ref="xs:sequence"/>
- </xs:choice>
- </xs:group>
-
-
-
- <xs:group name="nestedParticle">
- <xs:choice>
- <xs:element name="element" type="xs:localElement"/>
- <xs:element name="group" type="xs:groupRef"/>
- <xs:element ref="xs:choice"/>
- <xs:element ref="xs:sequence"/>
- <xs:element ref="xs:any"/>
- </xs:choice>
- </xs:group>
-
- <xs:group name="particle">
- <xs:choice>
- <xs:element name="element" type="xs:localElement"/>
- <xs:element name="group" type="xs:groupRef"/>
- <xs:element ref="xs:all"/>
- <xs:element ref="xs:choice"/>
- <xs:element ref="xs:sequence"/>
- <xs:element ref="xs:any"/>
- </xs:choice>
- </xs:group>
-
- <xs:complexType name="attribute">
- <xs:complexContent>
- <xs:extension base="xs:annotated">
- <xs:sequence>
- <xs:element name="simpleType" minOccurs="0" type="xs:localSimpleType"/>
- </xs:sequence>
- <xs:attributeGroup ref="xs:defRef"/>
- <xs:attribute name="type" type="xs:QName"/>
- <xs:attribute name="use" use="optional" default="optional">
- <xs:simpleType>
- <xs:restriction base="xs:NMTOKEN">
- <xs:enumeration value="prohibited"/>
- <xs:enumeration value="optional"/>
- <xs:enumeration value="required"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:attribute name="default" type="xs:string"/>
- <xs:attribute name="fixed" type="xs:string"/>
- <xs:attribute name="form" type="xs:formChoice"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="topLevelAttribute">
- <xs:complexContent>
- <xs:restriction base="xs:attribute">
- <xs:sequence>
- <xs:element ref="xs:annotation" minOccurs="0"/>
- <xs:element name="simpleType" minOccurs="0" type="xs:localSimpleType"/>
- </xs:sequence>
- <xs:attribute name="ref" use="prohibited"/>
- <xs:attribute name="form" use="prohibited"/>
- <xs:attribute name="use" use="prohibited"/>
- <xs:attribute name="name" use="required" type="xs:NCName"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:group name="attrDecls">
- <xs:sequence>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="attribute" type="xs:attribute"/>
- <xs:element name="attributeGroup" type="xs:attributeGroupRef"/>
- </xs:choice>
- <xs:element ref="xs:anyAttribute" minOccurs="0"/>
- </xs:sequence>
- </xs:group>
-
- <xs:element name="anyAttribute" type="xs:wildcard" id="anyAttribute">
- <xs:annotation>
- <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-anyAttribute"/>
- </xs:annotation>
- </xs:element>
-
- <xs:group name="complexTypeModel">
- <xs:choice>
- <xs:element ref="xs:simpleContent"/>
- <xs:element ref="xs:complexContent"/>
- <xs:sequence>
- <xs:annotation>
- <xs:documentation>
- This branch is short for
- &lt;complexContent>
- &lt;restriction base="xs:anyType">
- ...
- &lt;/restriction>
- &lt;/complexContent></xs:documentation>
- </xs:annotation>
- <xs:group ref="xs:typeDefParticle" minOccurs="0"/>
- <xs:group ref="xs:attrDecls"/>
- </xs:sequence>
- </xs:choice>
- </xs:group>
-
- <xs:complexType name="complexType" abstract="true">
- <xs:complexContent>
- <xs:extension base="xs:annotated">
- <xs:group ref="xs:complexTypeModel"/>
- <xs:attribute name="name" type="xs:NCName">
- <xs:annotation>
- <xs:documentation>
- Will be restricted to required or forbidden</xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="mixed" type="xs:boolean" use="optional" default="false">
- <xs:annotation>
- <xs:documentation>
- Not allowed if simpleContent child is chosen.
- May be overriden by setting on complexContent child.</xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="abstract" type="xs:boolean" use="optional" default="false"/>
- <xs:attribute name="final" type="xs:derivationSet"/>
- <xs:attribute name="block" type="xs:derivationSet"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="topLevelComplexType">
- <xs:complexContent>
- <xs:restriction base="xs:complexType">
- <xs:sequence>
- <xs:element ref="xs:annotation" minOccurs="0"/>
- <xs:group ref="xs:complexTypeModel"/>
- </xs:sequence>
- <xs:attribute name="name" type="xs:NCName" use="required"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="localComplexType">
- <xs:complexContent>
- <xs:restriction base="xs:complexType">
- <xs:sequence>
- <xs:element ref="xs:annotation" minOccurs="0"/>
- <xs:group ref="xs:complexTypeModel"/>
- </xs:sequence>
- <xs:attribute name="name" use="prohibited"/>
- <xs:attribute name="abstract" use="prohibited"/>
- <xs:attribute name="final" use="prohibited"/>
- <xs:attribute name="block" use="prohibited"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="restrictionType">
- <xs:complexContent>
- <xs:extension base="xs:annotated">
- <xs:sequence>
- <xs:choice minOccurs="0">
- <xs:group ref="xs:typeDefParticle"/>
- <xs:group ref="xs:simpleRestrictionModel"/>
- </xs:choice>
- <xs:group ref="xs:attrDecls"/>
- </xs:sequence>
- <xs:attribute name="base" type="xs:QName" use="required"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="complexRestrictionType">
- <xs:complexContent>
- <xs:restriction base="xs:restrictionType">
- <xs:sequence>
- <xs:element ref="xs:annotation" minOccurs="0"/>
- <xs:choice minOccurs="0">
- <xs:annotation>
- <xs:documentation>This choice is added simply to
- make this a valid restriction per the REC</xs:documentation>
- </xs:annotation>
- <xs:group ref="xs:typeDefParticle"/>
- </xs:choice>
- <xs:group ref="xs:attrDecls"/>
- </xs:sequence>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="extensionType">
- <xs:complexContent>
- <xs:extension base="xs:annotated">
- <xs:sequence>
- <xs:group ref="xs:typeDefParticle" minOccurs="0"/>
- <xs:group ref="xs:attrDecls"/>
- </xs:sequence>
- <xs:attribute name="base" type="xs:QName" use="required"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:element name="complexContent" id="complexContent">
- <xs:annotation>
- <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-complexContent"/>
- </xs:annotation>
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="xs:annotated">
- <xs:choice>
- <xs:element name="restriction" type="xs:complexRestrictionType"/>
- <xs:element name="extension" type="xs:extensionType"/>
- </xs:choice>
- <xs:attribute name="mixed" type="xs:boolean">
- <xs:annotation>
- <xs:documentation>
- Overrides any setting on complexType parent.</xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
-
- <xs:complexType name="simpleRestrictionType">
- <xs:complexContent>
- <xs:restriction base="xs:restrictionType">
- <xs:sequence>
- <xs:element ref="xs:annotation" minOccurs="0"/>
- <xs:choice minOccurs="0">
- <xs:annotation>
- <xs:documentation>This choice is added simply to
- make this a valid restriction per the REC</xs:documentation>
- </xs:annotation>
- <xs:group ref="xs:simpleRestrictionModel"/>
- </xs:choice>
- <xs:group ref="xs:attrDecls"/>
- </xs:sequence>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="simpleExtensionType">
- <xs:complexContent>
- <xs:restriction base="xs:extensionType">
- <xs:sequence>
- <xs:annotation>
- <xs:documentation>
- No typeDefParticle group reference</xs:documentation>
- </xs:annotation>
- <xs:element ref="xs:annotation" minOccurs="0"/>
- <xs:group ref="xs:attrDecls"/>
- </xs:sequence>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:element name="simpleContent" id="simpleContent">
- <xs:annotation>
- <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-simpleContent"/>
- </xs:annotation>
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="xs:annotated">
- <xs:choice>
- <xs:element name="restriction" type="xs:simpleRestrictionType"/>
- <xs:element name="extension" type="xs:simpleExtensionType"/>
- </xs:choice>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="complexType" type="xs:topLevelComplexType" id="complexType">
- <xs:annotation>
- <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-complexType"/>
- </xs:annotation>
- </xs:element>
-
-
- <xs:simpleType name="blockSet">
- <xs:annotation>
- <xs:documentation>
- A utility type, not for public use</xs:documentation>
- <xs:documentation>
- #all or (possibly empty) subset of {substitution, extension,
- restriction}</xs:documentation>
- </xs:annotation>
- <xs:union>
- <xs:simpleType>
- <xs:restriction base="xs:token">
- <xs:enumeration value="#all"/>
- </xs:restriction>
- </xs:simpleType>
- <xs:simpleType>
- <xs:list>
- <xs:simpleType>
- <xs:restriction base="xs:derivationControl">
- <xs:enumeration value="extension"/>
- <xs:enumeration value="restriction"/>
- <xs:enumeration value="substitution"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:list>
- </xs:simpleType>
- </xs:union>
- </xs:simpleType>
-
- <xs:complexType name="element" abstract="true">
- <xs:annotation>
- <xs:documentation>
- The element element can be used either
- at the top level to define an element-type binding globally,
- or within a content model to either reference a globally-defined
- element or type or declare an element-type binding locally.
- The ref form is not allowed at the top level.</xs:documentation>
- </xs:annotation>
-
- <xs:complexContent>
- <xs:extension base="xs:annotated">
- <xs:sequence>
- <xs:choice minOccurs="0">
- <xs:element name="simpleType" type="xs:localSimpleType"/>
- <xs:element name="complexType" type="xs:localComplexType"/>
- </xs:choice>
- <xs:group ref="xs:identityConstraint" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- <xs:attributeGroup ref="xs:defRef"/>
- <xs:attribute name="type" type="xs:QName"/>
- <xs:attribute name="substitutionGroup" type="xs:QName"/>
- <xs:attributeGroup ref="xs:occurs"/>
- <xs:attribute name="default" type="xs:string"/>
- <xs:attribute name="fixed" type="xs:string"/>
- <xs:attribute name="nillable" type="xs:boolean" use="optional" default="false"/>
- <xs:attribute name="abstract" type="xs:boolean" use="optional" default="false"/>
- <xs:attribute name="final" type="xs:derivationSet"/>
- <xs:attribute name="block" type="xs:blockSet"/>
- <xs:attribute name="form" type="xs:formChoice"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="topLevelElement">
- <xs:complexContent>
- <xs:restriction base="xs:element">
- <xs:sequence>
- <xs:element ref="xs:annotation" minOccurs="0"/>
- <xs:choice minOccurs="0">
- <xs:element name="simpleType" type="xs:localSimpleType"/>
- <xs:element name="complexType" type="xs:localComplexType"/>
- </xs:choice>
- <xs:group ref="xs:identityConstraint" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- <xs:attribute name="ref" use="prohibited"/>
- <xs:attribute name="form" use="prohibited"/>
- <xs:attribute name="minOccurs" use="prohibited"/>
- <xs:attribute name="maxOccurs" use="prohibited"/>
- <xs:attribute name="name" use="required" type="xs:NCName"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="localElement">
- <xs:complexContent>
- <xs:restriction base="xs:element">
- <xs:sequence>
- <xs:element ref="xs:annotation" minOccurs="0"/>
- <xs:choice minOccurs="0">
- <xs:element name="simpleType" type="xs:localSimpleType"/>
- <xs:element name="complexType" type="xs:localComplexType"/>
- </xs:choice>
- <xs:group ref="xs:identityConstraint" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- <xs:attribute name="substitutionGroup" use="prohibited"/>
- <xs:attribute name="final" use="prohibited"/>
- <xs:attribute name="abstract" use="prohibited"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:element name="element" type="xs:topLevelElement" id="element">
- <xs:annotation>
- <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-element"/>
- </xs:annotation>
- </xs:element>
-
- <xs:complexType name="group" abstract="true">
- <xs:annotation>
- <xs:documentation>
- group type for explicit groups, named top-level groups and
- group references</xs:documentation>
- </xs:annotation>
- <xs:complexContent>
- <xs:extension base="xs:annotated">
- <xs:group ref="xs:particle" minOccurs="0" maxOccurs="unbounded"/>
- <xs:attributeGroup ref="xs:defRef"/>
- <xs:attributeGroup ref="xs:occurs"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="realGroup">
- <xs:complexContent>
- <xs:restriction base="xs:group">
- <xs:sequence>
- <xs:element ref="xs:annotation" minOccurs="0"/>
- <xs:choice minOccurs="0" maxOccurs="1">
- <xs:element ref="xs:all"/>
- <xs:element ref="xs:choice"/>
- <xs:element ref="xs:sequence"/>
- </xs:choice>
- </xs:sequence>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="namedGroup">
- <xs:complexContent>
- <xs:restriction base="xs:realGroup">
- <xs:sequence>
- <xs:element ref="xs:annotation" minOccurs="0"/>
- <xs:choice minOccurs="1" maxOccurs="1">
- <xs:element name="all">
- <xs:complexType>
- <xs:complexContent>
- <xs:restriction base="xs:all">
- <xs:group ref="xs:allModel"/>
- <xs:attribute name="minOccurs" use="prohibited"/>
- <xs:attribute name="maxOccurs" use="prohibited"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="choice" type="xs:simpleExplicitGroup"/>
- <xs:element name="sequence" type="xs:simpleExplicitGroup"/>
- </xs:choice>
- </xs:sequence>
- <xs:attribute name="name" use="required" type="xs:NCName"/>
- <xs:attribute name="ref" use="prohibited"/>
- <xs:attribute name="minOccurs" use="prohibited"/>
- <xs:attribute name="maxOccurs" use="prohibited"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="groupRef">
- <xs:complexContent>
- <xs:restriction base="xs:realGroup">
- <xs:sequence>
- <xs:element ref="xs:annotation" minOccurs="0"/>
- </xs:sequence>
- <xs:attribute name="ref" use="required" type="xs:QName"/>
- <xs:attribute name="name" use="prohibited"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="explicitGroup">
- <xs:annotation>
- <xs:documentation>
- group type for the three kinds of group</xs:documentation>
- </xs:annotation>
- <xs:complexContent>
- <xs:restriction base="xs:group">
- <xs:sequence>
- <xs:element ref="xs:annotation" minOccurs="0"/>
- <xs:group ref="xs:nestedParticle" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- <xs:attribute name="name" type="xs:NCName" use="prohibited"/>
- <xs:attribute name="ref" type="xs:QName" use="prohibited"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="simpleExplicitGroup">
- <xs:complexContent>
- <xs:restriction base="xs:explicitGroup">
- <xs:sequence>
- <xs:element ref="xs:annotation" minOccurs="0"/>
- <xs:group ref="xs:nestedParticle" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- <xs:attribute name="minOccurs" use="prohibited"/>
- <xs:attribute name="maxOccurs" use="prohibited"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:group name="allModel">
- <xs:sequence>
- <xs:element ref="xs:annotation" minOccurs="0"/>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:annotation>
- <xs:documentation>This choice with min/max is here to
- avoid a pblm with the Elt:All/Choice/Seq
- Particle derivation constraint</xs:documentation>
- </xs:annotation>
- <xs:element name="element">
- <xs:complexType>
- <xs:annotation>
- <xs:documentation>restricted max/min</xs:documentation>
- </xs:annotation>
- <xs:complexContent>
- <xs:restriction base="xs:localElement">
- <xs:sequence>
- <xs:element ref="xs:annotation" minOccurs="0"/>
- <xs:choice minOccurs="0">
- <xs:element name="simpleType" type="xs:localSimpleType"/>
- <xs:element name="complexType" type="xs:localComplexType"/>
- </xs:choice>
- <xs:group ref="xs:identityConstraint" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- <xs:attribute name="minOccurs" use="optional" default="1">
- <xs:simpleType>
- <xs:restriction base="xs:nonNegativeInteger">
- <xs:enumeration value="0"/>
- <xs:enumeration value="1"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:attribute name="maxOccurs" use="optional" default="1">
- <xs:simpleType>
- <xs:restriction base="xs:allNNI">
- <xs:enumeration value="0"/>
- <xs:enumeration value="1"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- </xs:choice>
- </xs:sequence>
- </xs:group>
-
- <xs:complexType name="all">
- <xs:annotation>
- <xs:documentation>
- Only elements allowed inside</xs:documentation>
- </xs:annotation>
- <xs:complexContent>
- <xs:restriction base="xs:explicitGroup">
- <xs:group ref="xs:allModel"/>
- <xs:attribute name="minOccurs" use="optional" default="1">
- <xs:simpleType>
- <xs:restriction base="xs:nonNegativeInteger">
- <xs:enumeration value="0"/>
- <xs:enumeration value="1"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:attribute name="maxOccurs" use="optional" default="1">
- <xs:simpleType>
- <xs:restriction base="xs:allNNI">
- <xs:enumeration value="1"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:element name="all" id="all" type="xs:all">
- <xs:annotation>
- <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-all"/>
- </xs:annotation>
- </xs:element>
-
- <xs:element name="choice" type="xs:explicitGroup" id="choice">
- <xs:annotation>
- <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-choice"/>
- </xs:annotation>
- </xs:element>
-
- <xs:element name="sequence" type="xs:explicitGroup" id="sequence">
- <xs:annotation>
- <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-sequence"/>
- </xs:annotation>
- </xs:element>
-
- <xs:element name="group" type="xs:namedGroup" id="group">
- <xs:annotation>
- <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-group"/>
- </xs:annotation>
- </xs:element>
-
- <xs:complexType name="wildcard">
- <xs:complexContent>
- <xs:extension base="xs:annotated">
- <xs:attribute name="namespace" type="xs:namespaceList" use="optional" default="##any"/>
- <xs:attribute name="processContents" use="optional" default="strict">
- <xs:simpleType>
- <xs:restriction base="xs:NMTOKEN">
- <xs:enumeration value="skip"/>
- <xs:enumeration value="lax"/>
- <xs:enumeration value="strict"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:element name="any" id="any">
- <xs:annotation>
- <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-any"/>
- </xs:annotation>
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="xs:wildcard">
- <xs:attributeGroup ref="xs:occurs"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
-
- <xs:annotation>
- <xs:documentation>
- simple type for the value of the 'namespace' attr of
- 'any' and 'anyAttribute'</xs:documentation>
- </xs:annotation>
- <xs:annotation>
- <xs:documentation>
- Value is
- ##any - - any non-conflicting WFXML/attribute at all
-
- ##other - - any non-conflicting WFXML/attribute from
- namespace other than targetNS
-
- ##local - - any unqualified non-conflicting WFXML/attribute
-
- one or - - any non-conflicting WFXML/attribute from
- more URI the listed namespaces
- references
- (space separated)
-
- ##targetNamespace or ##local may appear in the above list, to
- refer to the targetNamespace of the enclosing
- schema or an absent targetNamespace respectively</xs:documentation>
- </xs:annotation>
-
- <xs:simpleType name="namespaceList">
- <xs:annotation>
- <xs:documentation>
- A utility type, not for public use</xs:documentation>
- </xs:annotation>
- <xs:union>
- <xs:simpleType>
- <xs:restriction base="xs:token">
- <xs:enumeration value="##any"/>
- <xs:enumeration value="##other"/>
- </xs:restriction>
- </xs:simpleType>
- <xs:simpleType>
- <xs:list>
- <xs:simpleType>
- <xs:union memberTypes="xs:anyURI">
- <xs:simpleType>
- <xs:restriction base="xs:token">
- <xs:enumeration value="##targetNamespace"/>
- <xs:enumeration value="##local"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:union>
- </xs:simpleType>
- </xs:list>
- </xs:simpleType>
- </xs:union>
- </xs:simpleType>
-
- <xs:element name="attribute" type="xs:topLevelAttribute" id="attribute">
- <xs:annotation>
- <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-attribute"/>
- </xs:annotation>
- </xs:element>
-
- <xs:complexType name="attributeGroup" abstract="true">
- <xs:complexContent>
- <xs:extension base="xs:annotated">
- <xs:group ref="xs:attrDecls"/>
- <xs:attributeGroup ref="xs:defRef"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="namedAttributeGroup">
- <xs:complexContent>
- <xs:restriction base="xs:attributeGroup">
- <xs:sequence>
- <xs:element ref="xs:annotation" minOccurs="0"/>
- <xs:group ref="xs:attrDecls"/>
- </xs:sequence>
- <xs:attribute name="name" use="required" type="xs:NCName"/>
- <xs:attribute name="ref" use="prohibited"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="attributeGroupRef">
- <xs:complexContent>
- <xs:restriction base="xs:attributeGroup">
- <xs:sequence>
- <xs:element ref="xs:annotation" minOccurs="0"/>
- </xs:sequence>
- <xs:attribute name="ref" use="required" type="xs:QName"/>
- <xs:attribute name="name" use="prohibited"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:element name="attributeGroup" type="xs:namedAttributeGroup" id="attributeGroup">
- <xs:annotation>
- <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-attributeGroup"/>
- </xs:annotation>
- </xs:element>
-
- <xs:element name="include" id="include">
- <xs:annotation>
- <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-include"/>
- </xs:annotation>
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="xs:annotated">
- <xs:attribute name="schemaLocation" type="xs:anyURI" use="required"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="redefine" id="redefine">
- <xs:annotation>
- <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-redefine"/>
- </xs:annotation>
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="xs:openAttrs">
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element ref="xs:annotation"/>
- <xs:group ref="xs:redefinable"/>
- </xs:choice>
- <xs:attribute name="schemaLocation" type="xs:anyURI" use="required"/>
- <xs:attribute name="id" type="xs:ID"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="import" id="import">
- <xs:annotation>
- <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-import"/>
- </xs:annotation>
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="xs:annotated">
- <xs:attribute name="namespace" type="xs:anyURI"/>
- <xs:attribute name="schemaLocation" type="xs:anyURI"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="selector" id="selector">
- <xs:annotation>
- <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-selector"/>
- </xs:annotation>
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="xs:annotated">
- <xs:attribute name="xpath" use="required">
- <xs:simpleType>
- <xs:annotation>
- <xs:documentation>A subset of XPath expressions for use
-in selectors</xs:documentation>
- <xs:documentation>A utility type, not for public
-use</xs:documentation>
- </xs:annotation>
- <xs:restriction base="xs:token">
- <xs:annotation>
- <xs:documentation>The following pattern is intended to allow XPath
- expressions per the following EBNF:
- Selector ::= Path ( '|' Path )*
- Path ::= ('.//')? Step ( '/' Step )*
- Step ::= '.' | NameTest
- NameTest ::= QName | '*' | NCName ':' '*'
- child:: is also allowed
- </xs:documentation>
- </xs:annotation>
- <xs:pattern value="(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*(\|(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*)*">
- </xs:pattern>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="field" id="field">
- <xs:annotation>
- <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-field"/>
- </xs:annotation>
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="xs:annotated">
- <xs:attribute name="xpath" use="required">
- <xs:simpleType>
- <xs:annotation>
- <xs:documentation>A subset of XPath expressions for use
-in fields</xs:documentation>
- <xs:documentation>A utility type, not for public
-use</xs:documentation>
- </xs:annotation>
- <xs:restriction base="xs:token">
- <xs:annotation>
- <xs:documentation>The following pattern is intended to allow XPath
- expressions per the same EBNF as for selector,
- with the following change:
- Path ::= ('.//')? ( Step '/' )* ( Step | '@' NameTest )
- </xs:documentation>
- </xs:annotation>
- <xs:pattern value="(\.//)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*))))(\|(\.//)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*)))))*">
- </xs:pattern>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
-
- <xs:complexType name="keybase">
- <xs:complexContent>
- <xs:extension base="xs:annotated">
- <xs:sequence>
- <xs:element ref="xs:selector"/>
- <xs:element ref="xs:field" minOccurs="1" maxOccurs="unbounded"/>
- </xs:sequence>
- <xs:attribute name="name" type="xs:NCName" use="required"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:group name="identityConstraint">
- <xs:annotation>
- <xs:documentation>The three kinds of identity constraints, all with
- type of or derived from 'keybase'.
- </xs:documentation>
- </xs:annotation>
- <xs:choice>
- <xs:element ref="xs:unique"/>
- <xs:element ref="xs:key"/>
- <xs:element ref="xs:keyref"/>
- </xs:choice>
- </xs:group>
-
- <xs:element name="unique" type="xs:keybase" id="unique">
- <xs:annotation>
- <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-unique"/>
- </xs:annotation>
- </xs:element>
- <xs:element name="key" type="xs:keybase" id="key">
- <xs:annotation>
- <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-key"/>
- </xs:annotation>
- </xs:element>
- <xs:element name="keyref" id="keyref">
- <xs:annotation>
- <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-keyref"/>
- </xs:annotation>
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="xs:keybase">
- <xs:attribute name="refer" type="xs:QName" use="required"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="notation" id="notation">
- <xs:annotation>
- <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-notation"/>
- </xs:annotation>
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="xs:annotated">
- <xs:attribute name="name" type="xs:NCName" use="required"/>
- <xs:attribute name="public" type="xs:public" use="required"/>
- <xs:attribute name="system" type="xs:anyURI"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
-
- <xs:simpleType name="public">
- <xs:annotation>
- <xs:documentation>
- A utility type, not for public use</xs:documentation>
- <xs:documentation>
- A public identifier, per ISO 8879</xs:documentation>
- </xs:annotation>
- <xs:restriction base="xs:token"/>
- </xs:simpleType>
-
- <xs:element name="appinfo" id="appinfo">
- <xs:annotation>
- <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-appinfo"/>
- </xs:annotation>
- <xs:complexType mixed="true">
- <xs:sequence minOccurs="0" maxOccurs="unbounded">
- <xs:any processContents="lax"/>
- </xs:sequence>
- <xs:attribute name="source" type="xs:anyURI"/>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="documentation" id="documentation">
- <xs:annotation>
- <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-documentation"/>
- </xs:annotation>
- <xs:complexType mixed="true">
- <xs:sequence minOccurs="0" maxOccurs="unbounded">
- <xs:any processContents="lax"/>
- </xs:sequence>
- <xs:attribute name="source" type="xs:anyURI"/>
- <xs:attribute ref="xml:lang"/>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="annotation" id="annotation">
- <xs:annotation>
- <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-annotation"/>
- </xs:annotation>
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="xs:openAttrs">
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element ref="xs:appinfo"/>
- <xs:element ref="xs:documentation"/>
- </xs:choice>
- <xs:attribute name="id" type="xs:ID"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
-
- <xs:annotation>
- <xs:documentation>
- notations for use within XML Schema schemas</xs:documentation>
- </xs:annotation>
-
- <xs:notation name="XMLSchemaStructures" public="structures" system="http://www.w3.org/2000/08/XMLSchema.xsd"/>
- <xs:notation name="XML" public="REC-xml-19980210" system="http://www.w3.org/TR/1998/REC-xml-19980210"/>
-
- <xs:complexType name="anyType" mixed="true">
- <xs:annotation>
- <xs:documentation>
- Not the real urType, but as close an approximation as we can
- get in the XML representation</xs:documentation>
- </xs:annotation>
- <xs:sequence>
- <xs:any minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- <xs:anyAttribute/>
- </xs:complexType>
-
- <xs:annotation>
- <xs:documentation>
- First the built-in primitive datatypes. These definitions are for
- information only, the real built-in definitions are magic. Note in
- particular that there is no type named 'anySimpleType'. The
- primitives should really be derived from no type at all, and
- anySimpleType should be derived as a union of all the primitives.
- </xs:documentation>
-
- <xs:documentation>
- For each built-in datatype in this schema (both primitive and
- derived) can be uniquely addressed via a URI constructed
- as follows:
- 1) the base URI is the URI of the XML Schema namespace
- 2) the fragment identifier is the name of the datatype
-
- For example, to address the int datatype, the URI is:
-
- http://www.w3.org/2001/XMLSchema#int
-
- Additionally, each facet definition element can be uniquely
- addressed via a URI constructed as follows:
- 1) the base URI is the URI of the XML Schema namespace
- 2) the fragment identifier is the name of the facet
-
- For example, to address the maxInclusive facet, the URI is:
-
- http://www.w3.org/2001/XMLSchema#maxInclusive
-
- Additionally, each facet usage in a built-in datatype definition
- can be uniquely addressed via a URI constructed as follows:
- 1) the base URI is the URI of the XML Schema namespace
- 2) the fragment identifier is the name of the datatype, followed
- by a period (".") followed by the name of the facet
-
- For example, to address the usage of the maxInclusive facet in
- the definition of int, the URI is:
-
- http://www.w3.org/2001/XMLSchema#int.maxInclusive
-
- </xs:documentation>
- </xs:annotation>
-
- <xs:simpleType name="string" id="string">
- <xs:annotation>
- <xs:appinfo>
- <hfp:hasFacet name="length"/>
- <hfp:hasFacet name="minLength"/>
- <hfp:hasFacet name="maxLength"/>
- <hfp:hasFacet name="pattern"/>
- <hfp:hasFacet name="enumeration"/>
- <hfp:hasFacet name="whiteSpace"/>
- <hfp:hasProperty name="ordered" value="false"/>
- <hfp:hasProperty name="bounded" value="false"/>
- <hfp:hasProperty name="cardinality" value="countably infinite"/>
- <hfp:hasProperty name="numeric" value="false"/>
- </xs:appinfo>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#string"/>
- </xs:annotation>
- <xs:restriction base="xs:anySimpleType">
- <xs:whiteSpace value="preserve" id="string.preserve"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="boolean" id="boolean">
- <xs:annotation>
- <xs:appinfo>
- <hfp:hasFacet name="pattern"/>
- <hfp:hasFacet name="whiteSpace"/>
- <hfp:hasProperty name="ordered" value="false"/>
- <hfp:hasProperty name="bounded" value="false"/>
- <hfp:hasProperty name="cardinality" value="finite"/>
- <hfp:hasProperty name="numeric" value="false"/>
- </xs:appinfo>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#boolean"/>
- </xs:annotation>
- <xs:restriction base="xs:anySimpleType">
- <xs:whiteSpace value="collapse" fixed="true"
- id="boolean.whiteSpace"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="float" id="float">
- <xs:annotation>
- <xs:appinfo>
- <hfp:hasFacet name="pattern"/>
- <hfp:hasFacet name="enumeration"/>
- <hfp:hasFacet name="whiteSpace"/>
- <hfp:hasFacet name="maxInclusive"/>
- <hfp:hasFacet name="maxExclusive"/>
- <hfp:hasFacet name="minInclusive"/>
- <hfp:hasFacet name="minExclusive"/>
- <hfp:hasProperty name="ordered" value="total"/>
- <hfp:hasProperty name="bounded" value="true"/>
- <hfp:hasProperty name="cardinality" value="finite"/>
- <hfp:hasProperty name="numeric" value="true"/>
- </xs:appinfo>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#float"/>
- </xs:annotation>
- <xs:restriction base="xs:anySimpleType">
- <xs:whiteSpace value="collapse" fixed="true"
- id="float.whiteSpace"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="double" id="double">
- <xs:annotation>
- <xs:appinfo>
- <hfp:hasFacet name="pattern"/>
- <hfp:hasFacet name="enumeration"/>
- <hfp:hasFacet name="whiteSpace"/>
- <hfp:hasFacet name="maxInclusive"/>
- <hfp:hasFacet name="maxExclusive"/>
- <hfp:hasFacet name="minInclusive"/>
- <hfp:hasFacet name="minExclusive"/>
- <hfp:hasProperty name="ordered" value="total"/>
- <hfp:hasProperty name="bounded" value="true"/>
- <hfp:hasProperty name="cardinality" value="finite"/>
- <hfp:hasProperty name="numeric" value="true"/>
- </xs:appinfo>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#double"/>
- </xs:annotation>
- <xs:restriction base="xs:anySimpleType">
- <xs:whiteSpace value="collapse" fixed="true"
- id="double.whiteSpace"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="decimal" id="decimal">
- <xs:annotation>
- <xs:appinfo>
- <hfp:hasFacet name="totalDigits"/>
- <hfp:hasFacet name="fractionDigits"/>
- <hfp:hasFacet name="pattern"/>
- <hfp:hasFacet name="whiteSpace"/>
- <hfp:hasFacet name="enumeration"/>
- <hfp:hasFacet name="maxInclusive"/>
- <hfp:hasFacet name="maxExclusive"/>
- <hfp:hasFacet name="minInclusive"/>
- <hfp:hasFacet name="minExclusive"/>
- <hfp:hasProperty name="ordered" value="total"/>
- <hfp:hasProperty name="bounded" value="false"/>
- <hfp:hasProperty name="cardinality"
- value="countably infinite"/>
- <hfp:hasProperty name="numeric" value="true"/>
- </xs:appinfo>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#decimal"/>
- </xs:annotation>
- <xs:restriction base="xs:anySimpleType">
- <xs:whiteSpace value="collapse" fixed="true"
- id="decimal.whiteSpace"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="duration" id="duration">
- <xs:annotation>
- <xs:appinfo>
- <hfp:hasFacet name="pattern"/>
- <hfp:hasFacet name="enumeration"/>
- <hfp:hasFacet name="whiteSpace"/>
- <hfp:hasFacet name="maxInclusive"/>
- <hfp:hasFacet name="maxExclusive"/>
- <hfp:hasFacet name="minInclusive"/>
- <hfp:hasFacet name="minExclusive"/>
- <hfp:hasProperty name="ordered" value="partial"/>
- <hfp:hasProperty name="bounded" value="false"/>
- <hfp:hasProperty name="cardinality"
- value="countably infinite"/>
- <hfp:hasProperty name="numeric" value="false"/>
- </xs:appinfo>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#duration"/>
- </xs:annotation>
- <xs:restriction base="xs:anySimpleType">
- <xs:whiteSpace value="collapse" fixed="true"
- id="duration.whiteSpace"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="dateTime" id="dateTime">
- <xs:annotation>
- <xs:appinfo>
- <hfp:hasFacet name="pattern"/>
- <hfp:hasFacet name="enumeration"/>
- <hfp:hasFacet name="whiteSpace"/>
- <hfp:hasFacet name="maxInclusive"/>
- <hfp:hasFacet name="maxExclusive"/>
- <hfp:hasFacet name="minInclusive"/>
- <hfp:hasFacet name="minExclusive"/>
- <hfp:hasProperty name="ordered" value="partial"/>
- <hfp:hasProperty name="bounded" value="false"/>
- <hfp:hasProperty name="cardinality"
- value="countably infinite"/>
- <hfp:hasProperty name="numeric" value="false"/>
- </xs:appinfo>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#dateTime"/>
- </xs:annotation>
- <xs:restriction base="xs:anySimpleType">
- <xs:whiteSpace value="collapse" fixed="true"
- id="dateTime.whiteSpace"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="time" id="time">
- <xs:annotation>
- <xs:appinfo>
- <hfp:hasFacet name="pattern"/>
- <hfp:hasFacet name="enumeration"/>
- <hfp:hasFacet name="whiteSpace"/>
- <hfp:hasFacet name="maxInclusive"/>
- <hfp:hasFacet name="maxExclusive"/>
- <hfp:hasFacet name="minInclusive"/>
- <hfp:hasFacet name="minExclusive"/>
- <hfp:hasProperty name="ordered" value="partial"/>
- <hfp:hasProperty name="bounded" value="false"/>
- <hfp:hasProperty name="cardinality"
- value="countably infinite"/>
- <hfp:hasProperty name="numeric" value="false"/>
- </xs:appinfo>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#time"/>
- </xs:annotation>
- <xs:restriction base="xs:anySimpleType">
- <xs:whiteSpace value="collapse" fixed="true"
- id="time.whiteSpace"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="date" id="date">
- <xs:annotation>
- <xs:appinfo>
- <hfp:hasFacet name="pattern"/>
- <hfp:hasFacet name="enumeration"/>
- <hfp:hasFacet name="whiteSpace"/>
- <hfp:hasFacet name="maxInclusive"/>
- <hfp:hasFacet name="maxExclusive"/>
- <hfp:hasFacet name="minInclusive"/>
- <hfp:hasFacet name="minExclusive"/>
- <hfp:hasProperty name="ordered" value="partial"/>
- <hfp:hasProperty name="bounded" value="false"/>
- <hfp:hasProperty name="cardinality"
- value="countably infinite"/>
- <hfp:hasProperty name="numeric" value="false"/>
- </xs:appinfo>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#date"/>
- </xs:annotation>
- <xs:restriction base="xs:anySimpleType">
- <xs:whiteSpace value="collapse" fixed="true"
- id="date.whiteSpace"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="gYearMonth" id="gYearMonth">
- <xs:annotation>
- <xs:appinfo>
- <hfp:hasFacet name="pattern"/>
- <hfp:hasFacet name="enumeration"/>
- <hfp:hasFacet name="whiteSpace"/>
- <hfp:hasFacet name="maxInclusive"/>
- <hfp:hasFacet name="maxExclusive"/>
- <hfp:hasFacet name="minInclusive"/>
- <hfp:hasFacet name="minExclusive"/>
- <hfp:hasProperty name="ordered" value="partial"/>
- <hfp:hasProperty name="bounded" value="false"/>
- <hfp:hasProperty name="cardinality"
- value="countably infinite"/>
- <hfp:hasProperty name="numeric" value="false"/>
- </xs:appinfo>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#gYearMonth"/>
- </xs:annotation>
- <xs:restriction base="xs:anySimpleType">
- <xs:whiteSpace value="collapse" fixed="true"
- id="gYearMonth.whiteSpace"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="gYear" id="gYear">
- <xs:annotation>
- <xs:appinfo>
- <hfp:hasFacet name="pattern"/>
- <hfp:hasFacet name="enumeration"/>
- <hfp:hasFacet name="whiteSpace"/>
- <hfp:hasFacet name="maxInclusive"/>
- <hfp:hasFacet name="maxExclusive"/>
- <hfp:hasFacet name="minInclusive"/>
- <hfp:hasFacet name="minExclusive"/>
- <hfp:hasProperty name="ordered" value="partial"/>
- <hfp:hasProperty name="bounded" value="false"/>
- <hfp:hasProperty name="cardinality"
- value="countably infinite"/>
- <hfp:hasProperty name="numeric" value="false"/>
- </xs:appinfo>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#gYear"/>
- </xs:annotation>
- <xs:restriction base="xs:anySimpleType">
- <xs:whiteSpace value="collapse" fixed="true"
- id="gYear.whiteSpace"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="gMonthDay" id="gMonthDay">
- <xs:annotation>
- <xs:appinfo>
- <hfp:hasFacet name="pattern"/>
- <hfp:hasFacet name="enumeration"/>
- <hfp:hasFacet name="whiteSpace"/>
- <hfp:hasFacet name="maxInclusive"/>
- <hfp:hasFacet name="maxExclusive"/>
- <hfp:hasFacet name="minInclusive"/>
- <hfp:hasFacet name="minExclusive"/>
- <hfp:hasProperty name="ordered" value="partial"/>
- <hfp:hasProperty name="bounded" value="false"/>
- <hfp:hasProperty name="cardinality"
- value="countably infinite"/>
- <hfp:hasProperty name="numeric" value="false"/>
- </xs:appinfo>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#gMonthDay"/>
- </xs:annotation>
- <xs:restriction base="xs:anySimpleType">
- <xs:whiteSpace value="collapse" fixed="true"
- id="gMonthDay.whiteSpace"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="gDay" id="gDay">
- <xs:annotation>
- <xs:appinfo>
- <hfp:hasFacet name="pattern"/>
- <hfp:hasFacet name="enumeration"/>
- <hfp:hasFacet name="whiteSpace"/>
- <hfp:hasFacet name="maxInclusive"/>
- <hfp:hasFacet name="maxExclusive"/>
- <hfp:hasFacet name="minInclusive"/>
- <hfp:hasFacet name="minExclusive"/>
- <hfp:hasProperty name="ordered" value="partial"/>
- <hfp:hasProperty name="bounded" value="false"/>
- <hfp:hasProperty name="cardinality"
- value="countably infinite"/>
- <hfp:hasProperty name="numeric" value="false"/>
- </xs:appinfo>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#gDay"/>
- </xs:annotation>
- <xs:restriction base="xs:anySimpleType">
- <xs:whiteSpace value="collapse" fixed="true"
- id="gDay.whiteSpace"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="gMonth" id="gMonth">
- <xs:annotation>
- <xs:appinfo>
- <hfp:hasFacet name="pattern"/>
- <hfp:hasFacet name="enumeration"/>
- <hfp:hasFacet name="whiteSpace"/>
- <hfp:hasFacet name="maxInclusive"/>
- <hfp:hasFacet name="maxExclusive"/>
- <hfp:hasFacet name="minInclusive"/>
- <hfp:hasFacet name="minExclusive"/>
- <hfp:hasProperty name="ordered" value="partial"/>
- <hfp:hasProperty name="bounded" value="false"/>
- <hfp:hasProperty name="cardinality"
- value="countably infinite"/>
- <hfp:hasProperty name="numeric" value="false"/>
- </xs:appinfo>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#gMonth"/>
- </xs:annotation>
- <xs:restriction base="xs:anySimpleType">
- <xs:whiteSpace value="collapse" fixed="true"
- id="gMonth.whiteSpace"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="hexBinary" id="hexBinary">
- <xs:annotation>
- <xs:appinfo>
- <hfp:hasFacet name="length"/>
- <hfp:hasFacet name="minLength"/>
- <hfp:hasFacet name="maxLength"/>
- <hfp:hasFacet name="pattern"/>
- <hfp:hasFacet name="enumeration"/>
- <hfp:hasFacet name="whiteSpace"/>
- <hfp:hasProperty name="ordered" value="false"/>
- <hfp:hasProperty name="bounded" value="false"/>
- <hfp:hasProperty name="cardinality"
- value="countably infinite"/>
- <hfp:hasProperty name="numeric" value="false"/>
- </xs:appinfo>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#binary"/>
- </xs:annotation>
- <xs:restriction base="xs:anySimpleType">
- <xs:whiteSpace value="collapse" fixed="true"
- id="hexBinary.whiteSpace"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="base64Binary" id="base64Binary">
- <xs:annotation>
- <xs:appinfo>
- <hfp:hasFacet name="length"/>
- <hfp:hasFacet name="minLength"/>
- <hfp:hasFacet name="maxLength"/>
- <hfp:hasFacet name="pattern"/>
- <hfp:hasFacet name="enumeration"/>
- <hfp:hasFacet name="whiteSpace"/>
- <hfp:hasProperty name="ordered" value="false"/>
- <hfp:hasProperty name="bounded" value="false"/>
- <hfp:hasProperty name="cardinality"
- value="countably infinite"/>
- <hfp:hasProperty name="numeric" value="false"/>
- </xs:appinfo>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#base64Binary"/>
- </xs:annotation>
- <xs:restriction base="xs:anySimpleType">
- <xs:whiteSpace value="collapse" fixed="true"
- id="base64Binary.whiteSpace"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="anyURI" id="anyURI">
- <xs:annotation>
- <xs:appinfo>
- <hfp:hasFacet name="length"/>
- <hfp:hasFacet name="minLength"/>
- <hfp:hasFacet name="maxLength"/>
- <hfp:hasFacet name="pattern"/>
- <hfp:hasFacet name="enumeration"/>
- <hfp:hasFacet name="whiteSpace"/>
- <hfp:hasProperty name="ordered" value="false"/>
- <hfp:hasProperty name="bounded" value="false"/>
- <hfp:hasProperty name="cardinality"
- value="countably infinite"/>
- <hfp:hasProperty name="numeric" value="false"/>
- </xs:appinfo>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#anyURI"/>
- </xs:annotation>
- <xs:restriction base="xs:anySimpleType">
- <xs:whiteSpace value="collapse" fixed="true"
- id="anyURI.whiteSpace"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="QName" id="QName">
- <xs:annotation>
- <xs:appinfo>
- <hfp:hasFacet name="length"/>
- <hfp:hasFacet name="minLength"/>
- <hfp:hasFacet name="maxLength"/>
- <hfp:hasFacet name="pattern"/>
- <hfp:hasFacet name="enumeration"/>
- <hfp:hasFacet name="whiteSpace"/>
- <hfp:hasProperty name="ordered" value="false"/>
- <hfp:hasProperty name="bounded" value="false"/>
- <hfp:hasProperty name="cardinality"
- value="countably infinite"/>
- <hfp:hasProperty name="numeric" value="false"/>
- </xs:appinfo>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#QName"/>
- </xs:annotation>
- <xs:restriction base="xs:anySimpleType">
- <xs:whiteSpace value="collapse" fixed="true"
- id="QName.whiteSpace"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="NOTATION" id="NOTATION">
- <xs:annotation>
- <xs:appinfo>
- <hfp:hasFacet name="length"/>
- <hfp:hasFacet name="minLength"/>
- <hfp:hasFacet name="maxLength"/>
- <hfp:hasFacet name="pattern"/>
- <hfp:hasFacet name="enumeration"/>
- <hfp:hasFacet name="whiteSpace"/>
- <hfp:hasProperty name="ordered" value="false"/>
- <hfp:hasProperty name="bounded" value="false"/>
- <hfp:hasProperty name="cardinality"
- value="countably infinite"/>
- <hfp:hasProperty name="numeric" value="false"/>
- </xs:appinfo>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#NOTATION"/>
- <xs:documentation>
- NOTATION cannot be used directly in a schema; rather a type
- must be derived from it by specifying at least one enumeration
- facet whose value is the name of a NOTATION declared in the
- schema.
- </xs:documentation>
- </xs:annotation>
- <xs:restriction base="xs:anySimpleType">
- <xs:whiteSpace value="collapse" fixed="true"
- id="NOTATION.whiteSpace"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:annotation>
- <xs:documentation>
- Now the derived primitive types
- </xs:documentation>
- </xs:annotation>
-
- <xs:simpleType name="normalizedString" id="normalizedString">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#normalizedString"/>
- </xs:annotation>
- <xs:restriction base="xs:string">
- <xs:whiteSpace value="replace"
- id="normalizedString.whiteSpace"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="token" id="token">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#token"/>
- </xs:annotation>
- <xs:restriction base="xs:normalizedString">
- <xs:whiteSpace value="collapse" id="token.whiteSpace"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="language" id="language">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#language"/>
- </xs:annotation>
- <xs:restriction base="xs:token">
- <xs:pattern
- value="([a-zA-Z]{2}|[iI]-[a-zA-Z]+|[xX]-[a-zA-Z]{1,8})(-[a-zA-Z]{1,8})*"
- id="language.pattern">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/REC-xml#NT-LanguageID">
- pattern specifies the content of section 2.12 of XML 1.0e2
- and RFC 1766
- </xs:documentation>
- </xs:annotation>
- </xs:pattern>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="IDREFS" id="IDREFS">
- <xs:annotation>
- <xs:appinfo>
- <hfp:hasFacet name="length"/>
- <hfp:hasFacet name="minLength"/>
- <hfp:hasFacet name="maxLength"/>
- <hfp:hasFacet name="enumeration"/>
- <hfp:hasFacet name="whiteSpace"/>
- <hfp:hasProperty name="ordered" value="false"/>
- <hfp:hasProperty name="bounded" value="false"/>
- <hfp:hasProperty name="cardinality"
- value="countably infinite"/>
- <hfp:hasProperty name="numeric" value="false"/>
- </xs:appinfo>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#IDREFS"/>
- </xs:annotation>
- <xs:restriction>
- <xs:simpleType>
- <xs:list itemType="xs:IDREF"/>
- </xs:simpleType>
- <xs:minLength value="1" id="IDREFS.minLength"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="ENTITIES" id="ENTITIES">
- <xs:annotation>
- <xs:appinfo>
- <hfp:hasFacet name="length"/>
- <hfp:hasFacet name="minLength"/>
- <hfp:hasFacet name="maxLength"/>
- <hfp:hasFacet name="enumeration"/>
- <hfp:hasFacet name="whiteSpace"/>
- <hfp:hasProperty name="ordered" value="false"/>
- <hfp:hasProperty name="bounded" value="false"/>
- <hfp:hasProperty name="cardinality"
- value="countably infinite"/>
- <hfp:hasProperty name="numeric" value="false"/>
- </xs:appinfo>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#ENTITIES"/>
- </xs:annotation>
- <xs:restriction>
- <xs:simpleType>
- <xs:list itemType="xs:ENTITY"/>
- </xs:simpleType>
- <xs:minLength value="1" id="ENTITIES.minLength"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="NMTOKEN" id="NMTOKEN">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#NMTOKEN"/>
- </xs:annotation>
- <xs:restriction base="xs:token">
- <xs:pattern value="\c+" id="NMTOKEN.pattern">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/REC-xml#NT-Nmtoken">
- pattern matches production 7 from the XML spec
- </xs:documentation>
- </xs:annotation>
- </xs:pattern>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="NMTOKENS" id="NMTOKENS">
- <xs:annotation>
- <xs:appinfo>
- <hfp:hasFacet name="length"/>
- <hfp:hasFacet name="minLength"/>
- <hfp:hasFacet name="maxLength"/>
- <hfp:hasFacet name="enumeration"/>
- <hfp:hasFacet name="whiteSpace"/>
- <hfp:hasProperty name="ordered" value="false"/>
- <hfp:hasProperty name="bounded" value="false"/>
- <hfp:hasProperty name="cardinality"
- value="countably infinite"/>
- <hfp:hasProperty name="numeric" value="false"/>
- </xs:appinfo>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#NMTOKENS"/>
- </xs:annotation>
- <xs:restriction>
- <xs:simpleType>
- <xs:list itemType="xs:NMTOKEN"/>
- </xs:simpleType>
- <xs:minLength value="1" id="NMTOKENS.minLength"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="Name" id="Name">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#Name"/>
- </xs:annotation>
- <xs:restriction base="xs:token">
- <xs:pattern value="\i\c*" id="Name.pattern">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/REC-xml#NT-Name">
- pattern matches production 5 from the XML spec
- </xs:documentation>
- </xs:annotation>
- </xs:pattern>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="NCName" id="NCName">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#NCName"/>
- </xs:annotation>
- <xs:restriction base="xs:Name">
- <xs:pattern value="[\i-[:]][\c-[:]]*" id="NCName.pattern">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/REC-xml-names/#NT-NCName">
- pattern matches production 4 from the Namespaces in XML spec
- </xs:documentation>
- </xs:annotation>
- </xs:pattern>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="ID" id="ID">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#ID"/>
- </xs:annotation>
- <xs:restriction base="xs:NCName"/>
- </xs:simpleType>
-
- <xs:simpleType name="IDREF" id="IDREF">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#IDREF"/>
- </xs:annotation>
- <xs:restriction base="xs:NCName"/>
- </xs:simpleType>
-
- <xs:simpleType name="ENTITY" id="ENTITY">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#ENTITY"/>
- </xs:annotation>
- <xs:restriction base="xs:NCName"/>
- </xs:simpleType>
-
- <xs:simpleType name="integer" id="integer">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#integer"/>
- </xs:annotation>
- <xs:restriction base="xs:decimal">
- <xs:fractionDigits value="0" fixed="true" id="integer.fractionDigits"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="nonPositiveInteger" id="nonPositiveInteger">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#nonPositiveInteger"/>
- </xs:annotation>
- <xs:restriction base="xs:integer">
- <xs:maxInclusive value="0" id="nonPositiveInteger.maxInclusive"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="negativeInteger" id="negativeInteger">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#negativeInteger"/>
- </xs:annotation>
- <xs:restriction base="xs:nonPositiveInteger">
- <xs:maxInclusive value="-1" id="negativeInteger.maxInclusive"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="long" id="long">
- <xs:annotation>
- <xs:appinfo>
- <hfp:hasProperty name="bounded" value="true"/>
- <hfp:hasProperty name="cardinality" value="finite"/>
- </xs:appinfo>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#long"/>
- </xs:annotation>
- <xs:restriction base="xs:integer">
- <xs:minInclusive value="-9223372036854775808" id="long.minInclusive"/>
- <xs:maxInclusive value="9223372036854775807" id="long.maxInclusive"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="int" id="int">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#int"/>
- </xs:annotation>
- <xs:restriction base="xs:long">
- <xs:minInclusive value="-2147483648" id="int.minInclusive"/>
- <xs:maxInclusive value="2147483647" id="int.maxInclusive"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="short" id="short">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#short"/>
- </xs:annotation>
- <xs:restriction base="xs:int">
- <xs:minInclusive value="-32768" id="short.minInclusive"/>
- <xs:maxInclusive value="32767" id="short.maxInclusive"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="byte" id="byte">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#byte"/>
- </xs:annotation>
- <xs:restriction base="xs:short">
- <xs:minInclusive value="-128" id="byte.minInclusive"/>
- <xs:maxInclusive value="127" id="byte.maxInclusive"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="nonNegativeInteger" id="nonNegativeInteger">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#nonNegativeInteger"/>
- </xs:annotation>
- <xs:restriction base="xs:integer">
- <xs:minInclusive value="0" id="nonNegativeInteger.minInclusive"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="unsignedLong" id="unsignedLong">
- <xs:annotation>
- <xs:appinfo>
- <hfp:hasProperty name="bounded" value="true"/>
- <hfp:hasProperty name="cardinality" value="finite"/>
- </xs:appinfo>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#unsignedLong"/>
- </xs:annotation>
- <xs:restriction base="xs:nonNegativeInteger">
- <xs:maxInclusive value="18446744073709551615"
- id="unsignedLong.maxInclusive"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="unsignedInt" id="unsignedInt">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#unsignedInt"/>
- </xs:annotation>
- <xs:restriction base="xs:unsignedLong">
- <xs:maxInclusive value="4294967295"
- id="unsignedInt.maxInclusive"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="unsignedShort" id="unsignedShort">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#unsignedShort"/>
- </xs:annotation>
- <xs:restriction base="xs:unsignedInt">
- <xs:maxInclusive value="65535"
- id="unsignedShort.maxInclusive"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="unsignedByte" id="unsignedByte">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#unsignedByte"/>
- </xs:annotation>
- <xs:restriction base="xs:unsignedShort">
- <xs:maxInclusive value="255" id="unsignedByte.maxInclusive"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="positiveInteger" id="positiveInteger">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#positiveInteger"/>
- </xs:annotation>
- <xs:restriction base="xs:nonNegativeInteger">
- <xs:minInclusive value="1" id="positiveInteger.minInclusive"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="derivationControl">
- <xs:annotation>
- <xs:documentation>
- A utility type, not for public use</xs:documentation>
- </xs:annotation>
- <xs:restriction base="xs:NMTOKEN">
- <xs:enumeration value="substitution"/>
- <xs:enumeration value="extension"/>
- <xs:enumeration value="restriction"/>
- <xs:enumeration value="list"/>
- <xs:enumeration value="union"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:group name="simpleDerivation">
- <xs:choice>
- <xs:element ref="xs:restriction"/>
- <xs:element ref="xs:list"/>
- <xs:element ref="xs:union"/>
- </xs:choice>
- </xs:group>
-
- <xs:simpleType name="simpleDerivationSet">
- <xs:annotation>
- <xs:documentation>
- #all or (possibly empty) subset of {restriction, union, list}
- </xs:documentation>
- <xs:documentation>
- A utility type, not for public use</xs:documentation>
- </xs:annotation>
- <xs:union>
- <xs:simpleType>
- <xs:restriction base="xs:token">
- <xs:enumeration value="#all"/>
- </xs:restriction>
- </xs:simpleType>
- <xs:simpleType>
- <xs:restriction base="xs:derivationControl">
- <xs:enumeration value="list"/>
- <xs:enumeration value="union"/>
- <xs:enumeration value="restriction"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:union>
- </xs:simpleType>
-
- <xs:complexType name="simpleType" abstract="true">
- <xs:complexContent>
- <xs:extension base="xs:annotated">
- <xs:group ref="xs:simpleDerivation"/>
- <xs:attribute name="final" type="xs:simpleDerivationSet"/>
- <xs:attribute name="name" type="xs:NCName">
- <xs:annotation>
- <xs:documentation>
- Can be restricted to required or forbidden
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="topLevelSimpleType">
- <xs:complexContent>
- <xs:restriction base="xs:simpleType">
- <xs:sequence>
- <xs:element ref="xs:annotation" minOccurs="0"/>
- <xs:group ref="xs:simpleDerivation"/>
- </xs:sequence>
- <xs:attribute name="name" use="required"
- type="xs:NCName">
- <xs:annotation>
- <xs:documentation>
- Required at the top level
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="localSimpleType">
- <xs:complexContent>
- <xs:restriction base="xs:simpleType">
- <xs:sequence>
- <xs:element ref="xs:annotation" minOccurs="0"/>
- <xs:group ref="xs:simpleDerivation"/>
- </xs:sequence>
- <xs:attribute name="name" use="prohibited">
- <xs:annotation>
- <xs:documentation>
- Forbidden when nested
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="final" use="prohibited"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:element name="simpleType" type="xs:topLevelSimpleType" id="simpleType">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#element-simpleType"/>
- </xs:annotation>
- </xs:element>
-
- <xs:group name="facets">
- <xs:annotation>
- <xs:documentation>
- We should use a substitution group for facets, but
- that's ruled out because it would allow users to
- add their own, which we're not ready for yet.
- </xs:documentation>
- </xs:annotation>
- <xs:choice>
- <xs:element ref="xs:minExclusive"/>
- <xs:element ref="xs:minInclusive"/>
- <xs:element ref="xs:maxExclusive"/>
- <xs:element ref="xs:maxInclusive"/>
- <xs:element ref="xs:totalDigits"/>
- <xs:element ref="xs:fractionDigits"/>
- <xs:element ref="xs:length"/>
- <xs:element ref="xs:minLength"/>
- <xs:element ref="xs:maxLength"/>
- <xs:element ref="xs:enumeration"/>
- <xs:element ref="xs:whiteSpace"/>
- <xs:element ref="xs:pattern"/>
- </xs:choice>
- </xs:group>
-
- <xs:group name="simpleRestrictionModel">
- <xs:sequence>
- <xs:element name="simpleType" type="xs:localSimpleType" minOccurs="0"/>
- <xs:group ref="xs:facets" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:group>
-
- <xs:element name="restriction" id="restriction">
- <xs:complexType>
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#element-restriction">
- base attribute and simpleType child are mutually
- exclusive, but one or other is required
- </xs:documentation>
- </xs:annotation>
- <xs:complexContent>
- <xs:extension base="xs:annotated">
- <xs:group ref="xs:simpleRestrictionModel"/>
- <xs:attribute name="base" type="xs:QName" use="optional"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="list" id="list">
- <xs:complexType>
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#element-list">
- itemType attribute and simpleType child are mutually
- exclusive, but one or other is required
- </xs:documentation>
- </xs:annotation>
- <xs:complexContent>
- <xs:extension base="xs:annotated">
- <xs:sequence>
- <xs:element name="simpleType" type="xs:localSimpleType"
- minOccurs="0"/>
- </xs:sequence>
- <xs:attribute name="itemType" type="xs:QName" use="optional"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="union" id="union">
- <xs:complexType>
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#element-union">
- memberTypes attribute must be non-empty or there must be
- at least one simpleType child
- </xs:documentation>
- </xs:annotation>
- <xs:complexContent>
- <xs:extension base="xs:annotated">
- <xs:sequence>
- <xs:element name="simpleType" type="xs:localSimpleType"
- minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- <xs:attribute name="memberTypes" use="optional">
- <xs:simpleType>
- <xs:list itemType="xs:QName"/>
- </xs:simpleType>
- </xs:attribute>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
-
- <xs:complexType name="facet">
- <xs:complexContent>
- <xs:extension base="xs:annotated">
- <xs:attribute name="value" use="required"/>
- <xs:attribute name="fixed" type="xs:boolean" use="optional"
- default="false"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="noFixedFacet">
- <xs:complexContent>
- <xs:restriction base="xs:facet">
- <xs:sequence>
- <xs:element ref="xs:annotation" minOccurs="0"/>
- </xs:sequence>
- <xs:attribute name="fixed" use="prohibited"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:element name="minExclusive" id="minExclusive" type="xs:facet">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#element-minExclusive"/>
- </xs:annotation>
- </xs:element>
- <xs:element name="minInclusive" id="minInclusive" type="xs:facet">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#element-minInclusive"/>
- </xs:annotation>
- </xs:element>
-
- <xs:element name="maxExclusive" id="maxExclusive" type="xs:facet">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#element-maxExclusive"/>
- </xs:annotation>
- </xs:element>
- <xs:element name="maxInclusive" id="maxInclusive" type="xs:facet">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#element-maxInclusive"/>
- </xs:annotation>
- </xs:element>
-
- <xs:complexType name="numFacet">
- <xs:complexContent>
- <xs:restriction base="xs:facet">
- <xs:sequence>
- <xs:element ref="xs:annotation" minOccurs="0"/>
- </xs:sequence>
- <xs:attribute name="value" type="xs:nonNegativeInteger" use="required"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:element name="totalDigits" id="totalDigits">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#element-totalDigits"/>
- </xs:annotation>
- <xs:complexType>
- <xs:complexContent>
- <xs:restriction base="xs:numFacet">
- <xs:sequence>
- <xs:element ref="xs:annotation" minOccurs="0"/>
- </xs:sequence>
- <xs:attribute name="value" type="xs:positiveInteger" use="required"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="fractionDigits" id="fractionDigits" type="xs:numFacet">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#element-fractionDigits"/>
- </xs:annotation>
- </xs:element>
-
- <xs:element name="length" id="length" type="xs:numFacet">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#element-length"/>
- </xs:annotation>
- </xs:element>
- <xs:element name="minLength" id="minLength" type="xs:numFacet">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#element-minLength"/>
- </xs:annotation>
- </xs:element>
- <xs:element name="maxLength" id="maxLength" type="xs:numFacet">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#element-maxLength"/>
- </xs:annotation>
- </xs:element>
-
- <xs:element name="enumeration" id="enumeration" type="xs:noFixedFacet">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#element-enumeration"/>
- </xs:annotation>
- </xs:element>
-
- <xs:element name="whiteSpace" id="whiteSpace">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#element-whiteSpace"/>
- </xs:annotation>
- <xs:complexType>
- <xs:complexContent>
- <xs:restriction base="xs:facet">
- <xs:sequence>
- <xs:element ref="xs:annotation" minOccurs="0"/>
- </xs:sequence>
- <xs:attribute name="value" use="required">
- <xs:simpleType>
- <xs:restriction base="xs:NMTOKEN">
- <xs:enumeration value="preserve"/>
- <xs:enumeration value="replace"/>
- <xs:enumeration value="collapse"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="pattern" id="pattern" type="xs:noFixedFacet">
- <xs:annotation>
- <xs:documentation
- source="http://www.w3.org/TR/xmlschema-2/#element-pattern"/>
- </xs:annotation>
- </xs:element>
-
-</xs:schema>
diff --git a/spec/xs3p/examples/address.xsd b/spec/xs3p/examples/address.xsd
deleted file mode 100644
index 61456139..00000000
--- a/spec/xs3p/examples/address.xsd
+++ /dev/null
@@ -1,55 +0,0 @@
-<schema targetNamespace="http://www.example.com/IPO"
- xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:ipo="http://www.example.com/IPO">
-
- <annotation>
- <documentation xml:lang="en">
- Addresses for International Purchase order schema
- Copyright 2000 Example.com. All rights reserved.
- </documentation>
- </annotation>
-
- <complexType name="Address">
- <sequence>
- <element name="name" type="string"/>
- <element name="street" type="string"/>
- <element name="city" type="string"/>
- </sequence>
- </complexType>
-
- <complexType name="USAddress">
- <complexContent>
- <extension base="ipo:Address">
- <sequence>
- <element name="state" type="ipo:USState"/>
- <element name="zip" type="positiveInteger"/>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="UKAddress">
- <complexContent>
- <extension base="ipo:Address">
- <sequence>
- <element name="postcode" type="ipo:UKPostcode"/>
- </sequence>
- <attribute name="exportCode" type="positiveInteger" fixed="1"/>
- </extension>
- </complexContent>
- </complexType>
-
- <!-- other Address derivations for more countries -->
-
- <simpleType name="USState">
- <restriction base="string">
- <enumeration value="AK"/>
- <enumeration value="AL"/>
- <enumeration value="AR"/>
- <!-- and so on ... -->
- </restriction>
- </simpleType>
-
- <!-- simple type definition for UKPostcode -->
-
-</schema> \ No newline at end of file
diff --git a/spec/xs3p/examples/build.xml b/spec/xs3p/examples/build.xml
deleted file mode 100644
index 8b4a4e57..00000000
--- a/spec/xs3p/examples/build.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<project name="TestAnt" default="all" basedir=".">
- <description>Script to generate documentation for example schema files using Ant.</description>
-
- <property name="original-loc" value=".."/>
- <property name="xslt-file" value="xs3p.xsl"/>
- <property name="target-dir" value="ant-results"/>
-
- <target name="all" description="Generates documentation for all *.xsd files.">
- <xslt basedir="." destdir="${target-dir}"
- extension=".html" style="${original-loc}/${xslt-file}">
- <include name="*.xsd"/>
- </xslt>
- </target>
-
- <target name="test-external-links" description="Test linking between schema files.">
- <!-- Copy xslt file to local dir. -->
- <copy file="${original-loc}/${xslt-file}" todir="${basedir}"/>
- <!-- address.xsd -->
- <xslt in="address.xsd" out="${target-dir}/address.xsd.html" style="${xslt-file}">
- <param name="searchImportedSchemas" expression="true"/>
- <param name="searchIncludedSchemas" expression="true"/>
- <param name="linksFile" expression="links.xml"/>
- </xslt>
- <!-- ipo.xsd -->
- <xslt in="ipo.xsd" out="${target-dir}/ipo.xsd.html" style="${xslt-file}">
- <param name="searchImportedSchemas" expression="true"/>
- <param name="searchIncludedSchemas" expression="true"/>
- <param name="linksFile" expression="links.xml"/>
- </xslt>
- <!-- report.xsd -->
- <xslt in="report.xsd" out="${target-dir}/report.xsd.html" style="${xslt-file}">
- <param name="searchImportedSchemas" expression="true"/>
- <param name="searchIncludedSchemas" expression="true"/>
- <param name="linksFile" expression="links.xml"/>
- </xslt>
- <!-- Delete local copy of xslt file. -->
- <delete file="${basedir}/${xslt-file}"/>
- </target>
-
-</project>
diff --git a/spec/xs3p/examples/ipo.xsd b/spec/xs3p/examples/ipo.xsd
deleted file mode 100644
index 419416ea..00000000
--- a/spec/xs3p/examples/ipo.xsd
+++ /dev/null
@@ -1,59 +0,0 @@
-<schema targetNamespace="http://www.example.com/IPO"
- xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:ipo="http://www.example.com/IPO">
-
- <annotation>
- <documentation xml:lang="en">
- International Purchase order schema for Example.com
- Copyright 2000 Example.com. All rights reserved.
- </documentation>
- </annotation>
-
- <!-- include address constructs -->
- <include
- schemaLocation="address.xsd"/>
-
- <element name="purchaseOrder" type="ipo:PurchaseOrderType"/>
-
- <element name="comment" type="string"/>
-
- <complexType name="PurchaseOrderType">
- <sequence>
- <element name="shipTo" type="ipo:Address"/>
- <element name="billTo" type="ipo:Address"/>
- <element ref="ipo:comment" minOccurs="0"/>
- <element name="items" type="ipo:Items"/>
- </sequence>
- <attribute name="orderDate" type="date"/>
- </complexType>
-
- <complexType name="Items">
- <sequence>
- <element name="item" minOccurs="0" maxOccurs="unbounded">
- <complexType>
- <sequence>
- <element name="productName" type="string"/>
- <element name="quantity">
- <simpleType>
- <restriction base="positiveInteger">
- <maxExclusive value="100"/>
- </restriction>
- </simpleType>
- </element>
- <element name="USPrice" type="decimal"/>
- <element ref="ipo:comment" minOccurs="0"/>
- <element name="shipDate" type="date" minOccurs="0"/>
- </sequence>
- <attribute name="partNum" type="ipo:SKU" use="required"/>
- </complexType>
- </element>
- </sequence>
- </complexType>
-
- <simpleType name="SKU">
- <restriction base="string">
- <pattern value="\d{3}-[A-Z]{2}"/>
- </restriction>
- </simpleType>
-
-</schema> \ No newline at end of file
diff --git a/spec/xs3p/examples/links.xml b/spec/xs3p/examples/links.xml
deleted file mode 100644
index 5bea6b8c..00000000
--- a/spec/xs3p/examples/links.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0"?>
-<links xmlns="http://titanium.dstc.edu.au/xml/xs3p">
- <schema file-location="address.xsd" docfile-location="address.xsd.html"/>
- <schema file-location="ipo.xsd" docfile-location="ipo.xsd.html"/>
- <schema file-location="report.xsd" docfile-location="report.xsd.html"/>
-</links> \ No newline at end of file
diff --git a/spec/xs3p/examples/po.xsd b/spec/xs3p/examples/po.xsd
deleted file mode 100644
index 65ed8616..00000000
--- a/spec/xs3p/examples/po.xsd
+++ /dev/null
@@ -1,66 +0,0 @@
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <xsd:annotation>
- <xsd:documentation xml:lang="en">
- Purchase order schema for Example.com.
- Copyright 2000 Example.com. All rights reserved.
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:element name="purchaseOrder" type="PurchaseOrderType"/>
-
- <xsd:element name="comment" type="xsd:string"/>
-
- <xsd:complexType name="PurchaseOrderType">
- <xsd:sequence>
- <xsd:element name="shipTo" type="USAddress"/>
- <xsd:element name="billTo" type="USAddress"/>
- <xsd:element ref="comment" minOccurs="0"/>
- <xsd:element name="items" type="Items"/>
- </xsd:sequence>
- <xsd:attribute name="orderDate" type="xsd:date"/>
- </xsd:complexType>
-
- <xsd:complexType name="USAddress">
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string"/>
- <xsd:element name="street" type="xsd:string"/>
- <xsd:element name="city" type="xsd:string"/>
- <xsd:element name="state" type="xsd:string"/>
- <xsd:element name="zip" type="xsd:decimal"/>
- </xsd:sequence>
- <xsd:attribute name="country" type="xsd:NMTOKEN"
- fixed="US"/>
- </xsd:complexType>
-
- <xsd:complexType name="Items">
- <xsd:sequence>
- <xsd:element name="item" minOccurs="0" maxOccurs="unbounded">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="productName" type="xsd:string"/>
- <xsd:element name="quantity">
- <xsd:simpleType>
- <xsd:restriction base="xsd:positiveInteger">
- <xsd:maxExclusive value="100"/>
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:element>
- <xsd:element name="USPrice" type="xsd:decimal"/>
- <xsd:element ref="comment" minOccurs="0"/>
- <xsd:element name="shipDate" type="xsd:date" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="partNum" type="SKU" use="required"/>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- Stock Keeping Unit, a code for identifying products -->
- <xsd:simpleType name="SKU">
- <xsd:restriction base="xsd:string">
- <xsd:pattern value="\d{3}-[A-Z]{2}"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-</xsd:schema> \ No newline at end of file
diff --git a/spec/xs3p/examples/recursion.xsd b/spec/xs3p/examples/recursion.xsd
deleted file mode 100644
index cbe14b36..00000000
--- a/spec/xs3p/examples/recursion.xsd
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0"?>
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://example.com" targetNamespace="http://example.com">
- <xsd:element name="x">
- <xsd:simpleType>
- <xsd:restriction base="X">
- <xsd:enumeration value="abc"/>
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:element>
- <xsd:simpleType name="X">
- <xsd:restriction base="Z">
- <xsd:enumeration value="abc"/>
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="Y">
- <xsd:restriction base="X">
- <xsd:enumeration value="abc"/>
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="Z">
- <xsd:restriction base="Y">
- <xsd:enumeration value="abc"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:complexType name="A">
- <xsd:complexContent>
- <xsd:extension base="C">
- <xsd:sequence>
- <xsd:element name="a" type="xsd:string" minOccurs="1" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="B">
- <xsd:complexContent>
- <xsd:extension base="A">
- <xsd:sequence>
- <xsd:element name="b" type="xsd:string" minOccurs="1" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="C">
- <xsd:complexContent>
- <xsd:extension base="B">
- <xsd:sequence>
- <xsd:element name="c" type="xsd:string" minOccurs="1" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:group name="A">
- <xsd:sequence>
- <xsd:group ref="C"/>
- <xsd:element name="a" type="xsd:string" minOccurs="1" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:group>
- <xsd:group name="B">
- <xsd:sequence>
- <xsd:group ref="A"/>
- <xsd:element name="b" type="xsd:string" minOccurs="1" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:group>
- <xsd:group name="C">
- <xsd:sequence>
- <xsd:group ref="B"/>
- <xsd:element name="c" type="xsd:string" minOccurs="1" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:group>
-
- <xsd:attributeGroup name="A">
- <xsd:attributeGroup ref="C"/>
- <xsd:attribute name="a" type="xsd:string"/>
- </xsd:attributeGroup>
- <xsd:attributeGroup name="B">
- <xsd:attributeGroup ref="A"/>
- <xsd:attribute name="b" type="xsd:string"/>
- </xsd:attributeGroup>
- <xsd:attributeGroup name="C">
- <xsd:attributeGroup ref="B"/>
- <xsd:attribute name="c" type="xsd:string"/>
- </xsd:attributeGroup>
-</xsd:schema> \ No newline at end of file
diff --git a/spec/xs3p/examples/report.xsd b/spec/xs3p/examples/report.xsd
deleted file mode 100644
index 9cc6cca2..00000000
--- a/spec/xs3p/examples/report.xsd
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0"?>
-<schema targetNamespace="http://www.example.com/Report" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:r="http://www.example.com/Report" xmlns:xipo="http://www.example.com/IPO" elementFormDefault="qualified">
- <!-- for SKU -->
- <import namespace="http://www.example.com/IPO" schemaLocation="ipo.xsd"/>
-
- <annotation>
- <documentation xml:lang="en">Report schema for Example.com
- Copyright 2000 Example.com. All rights reserved.</documentation>
- </annotation>
-
- <element name="purchaseReport">
- <complexType>
- <sequence>
- <element name="regions" type="r:RegionsType">
- <keyref name="dummy2" refer="r:pNumKey">
- <selector xpath="r:zip/r:part"/>
- <field xpath="@number"/>
- </keyref>
- </element>
- <element name="parts" type="r:PartsType"/>
- <element ref="xipo:comment"/>
- </sequence>
- <attribute name="period" type="duration"/>
- <attribute name="periodEnding" type="date"/>
- </complexType>
-
- <unique name="dummy1">
- <selector xpath="r:regions/r:zip"/>
- <field xpath="@code"/>
- </unique>
-
- <key name="pNumKey">
- <selector xpath="r:parts/r:part"/>
- <field xpath="@number"/>
- </key>
- </element>
-
- <complexType name="RegionsType">
- <sequence>
- <element name="zip" maxOccurs="unbounded">
- <complexType>
- <sequence>
- <element name="part" maxOccurs="unbounded">
- <complexType>
- <complexContent>
- <restriction base="anyType">
- <attribute name="number" type="xipo:SKU"/>
- <attribute name="quantity" type="positiveInteger"/>
- </restriction>
- </complexContent>
- </complexType>
- </element>
- </sequence>
- <attribute name="code" type="positiveInteger"/>
- </complexType>
- </element>
- </sequence>
- </complexType>
-
- <complexType name="PartsType">
- <sequence>
- <element name="part" maxOccurs="unbounded">
- <complexType>
- <simpleContent>
- <extension base="string">
- <attribute name="number" type="xipo:SKU"/>
- </extension>
- </simpleContent>
- </complexType>
- </element>
- </sequence>
- </complexType>
-
- <complexType name="ExtendedPurchaseOrderType">
- <complexContent>
- <extension base="xipo:PurchaseOrderType">
- <sequence>
- <element name="shipper" type="xipo:Address"/>
- </sequence>
- <attribute name="shipToDate" type="date"/>
- </extension>
- </complexContent>
- </complexType>
-</schema> \ No newline at end of file
diff --git a/spec/xs3p/examples/test_msxsl.bat b/spec/xs3p/examples/test_msxsl.bat
deleted file mode 100644
index 70f847cc..00000000
--- a/spec/xs3p/examples/test_msxsl.bat
+++ /dev/null
@@ -1,19 +0,0 @@
-set RESULTS_DIR=msxsl-results
-set LINKS_FILE=links.xml
-set XSLT_FILE=xs3p.xsl
-set ORIGINAL_XSLT_FILE=..\%XSLT_FILE%
-rem Copy XSLT file to local directory
-copy %ORIGINAL_XSLT_FILE% .
-rem Create results directory
-if not exist %RESULTS_DIR% mkdir %RESULTS_DIR%
-rem Loop through schema files
-for %%f in (*.xsd) do msxsl %%f %XSLT_FILE% -t -o %RESULTS_DIR%\%%f.html
-rem Test external links
-rem set XSD_FILE=address.xsd
-rem msxsl %XSD_FILE% %XSLT_FILE% -t -o %RESULTS_DIR%\%XSD_FILE%.html searchImportedSchemas=true searchIncludedSchemas=true linksFile=%LINKS_FILE%
-rem set XSD_FILE=ipo.xsd
-rem msxsl %XSD_FILE% %XSLT_FILE% -t -o %RESULTS_DIR%\%XSD_FILE%.html searchImportedSchemas=true searchIncludedSchemas=true linksFile=%LINKS_FILE%
-rem set XSD_FILE=report.xsd
-rem msxsl %XSD_FILE% %XSLT_FILE% -t -o %RESULTS_DIR%\%XSD_FILE%.html searchImportedSchemas=true searchIncludedSchemas=true linksFile=%LINKS_FILE%
-rem Delete local copy of stylesheet
-del %XSLT_FILE%
diff --git a/spec/xs3p/examples/test_xalanj.bat b/spec/xs3p/examples/test_xalanj.bat
deleted file mode 100644
index 3a3f0769..00000000
--- a/spec/xs3p/examples/test_xalanj.bat
+++ /dev/null
@@ -1,19 +0,0 @@
-set RESULTS_DIR=xalanj-results
-set LINKS_FILE=links.xml
-set XSLT_FILE=xs3p.xsl
-set ORIGINAL_XSLT_FILE=..\%XSLT_FILE%
-rem Copy XSLT file to local directory
-copy %ORIGINAL_XSLT_FILE% .
-rem Create results directory
-if not exist %RESULTS_DIR% mkdir %RESULTS_DIR%
-rem Loop through schema files
-for %%f in (*.xsd) do java org.apache.xalan.xslt.Process -IN %%f -XSL %XSLT_FILE% -OUT %RESULTS_DIR%\%%f.html
-rem Test external links
-rem set XSD_FILE=address.xsd
-rem java org.apache.xalan.xslt.Process -IN %XSD_FILE% -XSL %XSLT_FILE% -OUT %RESULTS_DIR%\%XSD_FILE%.html -PARAM searchImportedSchemas true -PARAM searchIncludedSchemas true -PARAM linksFile %LINKS_FILE%
-rem set XSD_FILE=ipo.xsd
-rem java org.apache.xalan.xslt.Process -IN %XSD_FILE% -XSL %XSLT_FILE% -OUT %RESULTS_DIR%\%XSD_FILE%.html -PARAM searchImportedSchemas true -PARAM searchIncludedSchemas true -PARAM linksFile %LINKS_FILE%
-rem set XSD_FILE=report.xsd
-rem java org.apache.xalan.xslt.Process -IN %XSD_FILE% -XSL %XSLT_FILE% -OUT %RESULTS_DIR%\%XSD_FILE%.html -PARAM searchImportedSchemas true -PARAM searchIncludedSchemas true -PARAM linksFile %LINKS_FILE%
-rem Delete local copy of stylesheet
-del %XSLT_FILE%
diff --git a/spec/xs3p/examples/test_xsltproc.sh b/spec/xs3p/examples/test_xsltproc.sh
deleted file mode 100644
index f2e3120a..00000000
--- a/spec/xs3p/examples/test_xsltproc.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!bin/bash
-RESULTS_DIR=xsltproc-results
-LINKS_FILE=links.xml
-XSLT_FILE=xs3p.xsl
-ORIGINAL_XSLT_FILE=../$XSLT_FILE
-# Copy XSLT file to local directory
-cp $ORIGINAL_XSLT_FILE .
-# Create results directory
-if [ ! -d $RESULTS_DIR ] ;
-then
- mkdir $RESULTS_DIR
-fi
-# Loop through schema files
-for f in *.xsd
-do
- echo "Generating documentation for: $f"
- xsltproc --nonet --output $RESULTS_DIR/$f.html $XSLT_FILE $f
-done
-# Test external links
-# XSD_FILE=address.xsd
-# echo "Generating documentation for: $XSD_FILE"
-# xsltproc --nonet --output $RESULTS_DIR/$XSD_FILE.html $XSLT_FILE $XSD_FILE
-# XSD_FILE=ipo.xsd
-# echo "Generating documentation for: $XSD_FILE"
-# xsltproc --param searchIncludedSchemas "'true'" --param linksFile "'links.xml'" --nonet --output $RESULTS_DIR/$XSD_FILE.html $XSLT_FILE $XSD_FILE
-# XSD_FILE=report.xsd
-# echo "Generating documentation for: $XSD_FILE"
-# xsltproc --param searchIncludedSchemas "'true'" --param linksFile "'links.xml'" --nonet --output $RESULTS_DIR/$XSD_FILE.html $XSLT_FILE $XSD_FILE
-# Delete local copy of stylesheet
-rm $XSLT_FILE
diff --git a/spec/xs3p/examples/xml.xsd b/spec/xs3p/examples/xml.xsd
deleted file mode 100644
index 8e4d6665..00000000
--- a/spec/xs3p/examples/xml.xsd
+++ /dev/null
@@ -1,80 +0,0 @@
-<?xml version='1.0'?>
-<xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="en">
-
- <xs:annotation>
- <xs:documentation>
- See http://www.w3.org/XML/1998/namespace.html and
- http://www.w3.org/TR/REC-xml for information about this namespace.
- </xs:documentation>
- </xs:annotation>
-
- <xs:annotation>
- <xs:documentation>This schema defines attributes and an attribute group
- suitable for use by
- schemas wishing to allow xml:base, xml:lang or xml:space attributes
- on elements they define.
-
- To enable this, such a schema must import this schema
- for the XML namespace, e.g. as follows:
- &lt;schema . . .>
- . . .
- &lt;import namespace="http://www.w3.org/XML/1998/namespace"
- schemaLocation="http://www.w3.org/2001/03/xml.xsd"/>
-
- Subsequently, qualified reference to any of the attributes
- or the group defined below will have the desired effect, e.g.
-
- &lt;type . . .>
- . . .
- &lt;attributeGroup ref="xml:specialAttrs"/>
-
- will define a type which will schema-validate an instance
- element with any of those attributes</xs:documentation>
- </xs:annotation>
-
- <xs:annotation>
- <xs:documentation>In keeping with the XML Schema WG's standard versioning
- policy, this schema document will persist at
- http://www.w3.org/2001/03/xml.xsd.
- At the date of issue it can also be found at
- http://www.w3.org/2001/xml.xsd.
- The schema document at that URI may however change in the future,
- in order to remain compatible with the latest version of XML Schema
- itself. In other words, if the XML Schema namespace changes, the version
- of this document at
- http://www.w3.org/2001/xml.xsd will change
- accordingly; the version at
- http://www.w3.org/2001/03/xml.xsd will not change.
- </xs:documentation>
- </xs:annotation>
-
- <xs:attribute name="lang" type="xs:language">
- <xs:annotation>
- <xs:documentation>In due course, we should install the relevant ISO 2- and 3-letter
- codes as the enumerated possible values . . .</xs:documentation>
- </xs:annotation>
- </xs:attribute>
-
- <xs:attribute name="space" default="preserve">
- <xs:simpleType>
- <xs:restriction base="xs:NCName">
- <xs:enumeration value="default"/>
- <xs:enumeration value="preserve"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
-
- <xs:attribute name="base" type="xs:anyURI">
- <xs:annotation>
- <xs:documentation>See http://www.w3.org/TR/xmlbase/ for
- information about this attribute.</xs:documentation>
- </xs:annotation>
- </xs:attribute>
-
- <xs:attributeGroup name="specialAttrs">
- <xs:attribute ref="xml:base"/>
- <xs:attribute ref="xml:lang"/>
- <xs:attribute ref="xml:space"/>
- </xs:attributeGroup>
-
-</xs:schema>
diff --git a/spec/xs3p/links.dtd b/spec/xs3p/links.dtd
deleted file mode 100644
index c9f348ac..00000000
--- a/spec/xs3p/links.dtd
+++ /dev/null
@@ -1,7 +0,0 @@
-<!ELEMENT links (schema)+>
-<!ATTLIST links
- xmlns CDATA #FIXED "http://titanium.dstc.edu.au/xml/xs3p">
-<!ELEMENT schema EMPTY>
-<!ATTLIST schema
- file-location CDATA #REQUIRED
- docfile-location CDATA #REQUIRED> \ No newline at end of file
diff --git a/spec/xs3p/links.xsd b/spec/xs3p/links.xsd
deleted file mode 100644
index 7928bc3e..00000000
--- a/spec/xs3p/links.xsd
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0"?>
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://titanium.dstc.edu.au/xml/xs3p" targetNamespace="http://titanium.dstc.edu.au/xml/xs3p">
- <xsd:element name="links">
- <xsd:annotation>
- <xsd:documentation>
- <html:p>List of mappings from schema file locations (<html:code style="color:blue;">@file-location</html:code>) to their documentation file locations (<html:code style="color:blue;">@docfile-location</html:code>)</html:p>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="schema" minOccurs="1" maxOccurs="unbounded">
- <xsd:complexType>
- <xsd:attribute name="file-location" type="xsd:string" use="required"/>
- <xsd:attribute name="docfile-location" type="xsd:string" use="required"/>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-</xsd:schema> \ No newline at end of file
diff --git a/spec/xs3p/xs3p.xsl b/spec/xs3p/xs3p.xsl
deleted file mode 100644
index b127948b..00000000
--- a/spec/xs3p/xs3p.xsl
+++ /dev/null
@@ -1,8503 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!--
- Copyright (C) DSTC Pty Ltd (ACN 052 372 577) 2002
-
- The software contained on this media is the property of the
- DSTC Pty Ltd. Use of this software is strictly in accordance
- with the license agreement in the accompanying LICENSE file.
- If your distribution of this software does not contain a
- LICENSE file then you have no rights to use this software
- in any manner and should contact DSTC at the address below
- to determine an appropriate licensing arrangement.
-
- DSTC Pty Ltd
- Level 7, General Purpose South
- The University of Queensland
- QLD 4072 Australia
- Tel: +61 7 3365 4310
- Fax: +61 7 3365 4311
- Email: titanium_enquiries@dstc.edu.au
-
- This software is being provided "AS IS" without warranty of
- any kind. In no event shall DSTC Pty Ltd be liable for
- damage of any kind arising out of or in connection with
- the use or performance of this software.
--->
-<!--
- File:
- xs3p.xsl
- Description:
- Stylesheet that generates XHTML documentation, given an XML
- Schema document
- Assumptions:
- -Resulting documentation will only be displayed properly with
- the latest browsers that support XHTML and CSS. Older
- browsers are not supported.
- -Assumed that XSD document conforms to the XSD recommendation.
- No validity checking is done.
- Constraints:
- -Local schema components cannot contain two dashes in
- 'documentation' elements within their 'annotation' element.
- This is because the contents of those 'documentation'
- elements are displayed in a separate window using Javascript.
- This Javascript code is enclosed in comments, which do not
- allow two dashes inside themselves.
- Notes:
- -Javascript code is placed within comments, even though in
- strict XHTML, JavaScript code should be placed within CDATA
- sections. This is because current browsers generate a syntax
- error if the page contains CDATA sections. Placing Javascript
- code within comments means that the code cannot contain two
- dashes.
- (See 'PrintJSCode' named template.)
- Stylesheet Sections:
- -Global Parameters
- Specify parameters that can be set externally to customise
- stylesheet
- -Constants
- Constants used by the stylesheet
- -Main Document
- Templates to generate the overall document and the top-level
- sections within it
- -Hierarchy table
- Templates for displaying type hierarchy for simple and
- complex types, and substitution group hierarchy for elements
- -Properties table
- Templates for displaying the properties of top-level schema
- components
- -XML Instance Representation table
- Templates for displaying how an XML instance conforming to
- the schema component would look like
- -Schema Component Representation table
- Templates for displaying the XML representation of the schema
- component
- -XML Pretty Printer
- Templates for displaying arbitrary XML instances
- -Handling Schema Component References
- Templates for generating internal and external links
- -General Utility Templates
- General templates used by other templates in this stylesheet
- To Do List:
- -It is not clever when printing out element and attribute
- wildcards in the XML Instance Representation tables. It prints
- out all wildcards, rather than working out the actual wildcard
- is from multiple wildcard instances.
- -Same as above for simple type constraints, e.g. it doesn't
- summarise multiple pattern constraints.
--->
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns="http://www.w3.org/1999/xhtml"
- xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:ppp="http://titanium.dstc.edu.au/xml/xs3p"
- version="1.0"
- exclude-result-prefixes="xsd ppp html">
-
- <xsl:output
- method="xml"
- encoding="ISO-8859-1"
- standalone="yes"
- version="1.0"
- doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
- doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
- indent="yes"/>
-
- <xsl:key name="type" match="/xsd:schema/xsd:complexType | /xsd:schema/xsd:simpleType | /xsd:schema/xsd:redefine/xsd:complexType | /xsd:schema/xsd:redefine/xsd:simpleType" use="@name" />
- <xsl:key name="complexType" match="/xsd:schema/xsd:complexType | /xsd:schema/xsd:redefine/xsd:complexType" use="@name" />
- <xsl:key name="simpleType" match="/xsd:schema/xsd:simpleType | /xsd:schema/xsd:redefine/xsd:simpleType" use="@name" />
- <xsl:key name="attributeGroup" match="/xsd:schema/xsd:attributeGroup | /xsd:schema/xsd:redefine/xsd:attributeGroup" use="@name" />
- <xsl:key name="group" match="/xsd:schema/xsd:group | /xsd:schema/xsd:redefine/xsd:group" use="@name" />
- <xsl:key name="attribute" match="/xsd:schema/xsd:attribute" use="@name" />
- <xsl:key name="element" match="/xsd:schema/xsd:element" use="@name" />
-
- <!-- ******** Global Parameters ******** -->
-
- <!-- Title of XHTML document. -->
- <xsl:param name="title"></xsl:param>
-
- <!-- If 'true', sorts the top-level schema components by type,
- then name. Otherwise, displays the components by the order that
- they appear in the schema. -->
- <xsl:param name="sortByComponent">true</xsl:param>
-
- <!-- If 'true', XHTML document uses JavaScript for added
- functionality, such as pop-up windows and information-
- hiding.
- Otherwise, XHTML document does not use JavaScript. -->
- <xsl:param name="useJavaScript">true</xsl:param>
-
- <!-- If 'true', prints all super-types in the
- type hierarchy box.
- Otherwise, prints the parent type only in the
- type hierarchy box. -->
- <xsl:param name="printAllSuperTypes">true</xsl:param>
-
- <!-- If 'true', prints all sub-types in the
- type hierarchy box.
- Otherwise, prints the direct sub-types only in the
- type hierarchy box. -->
- <xsl:param name="printAllSubTypes">true</xsl:param>
-
- <!-- If 'true', prints out the Glossary section. -->
- <xsl:param name="printGlossary">true</xsl:param>
-
- <!-- If 'true', prints out the Legend section. -->
- <xsl:param name="printLegend">true</xsl:param>
-
- <!-- If 'true', prints prefix matching namespace of schema
- components in XML Instance Representation tables. -->
- <xsl:param name="printNSPrefixes">true</xsl:param>
-
- <!-- If 'true', searches 'included' schemas for schema components
- when generating links and XML Instance Representation tables. -->
- <xsl:param name="searchIncludedSchemas">false</xsl:param>
-
- <!-- If 'true', searches 'imported' schemas for schema components
- when generating links and XML Instance Representation tables. -->
- <xsl:param name="searchImportedSchemas">false</xsl:param>
-
- <!-- File containing the mapping from file locations of external
- (e.g. included, imported, refined) schemas to file locations
- of their XHTML documentation. -->
- <xsl:param name="linksFile"></xsl:param>
-
- <!-- Set the base URL for resolving links. -->
- <xsl:param name="baseURL"></xsl:param>
-
- <!-- Uses an external CSS stylesheet rather than using
- internally-declared CSS properties. -->
- <xsl:param name="externalCSSURL"></xsl:param>
-
-
- <!-- ******** Constants ******** -->
-
- <!-- XML Schema Namespace -->
- <xsl:variable name="XSD_NS">http://www.w3.org/2001/XMLSchema</xsl:variable>
-
- <!-- XML Namespace -->
- <xsl:variable name="XML_NS">http://www.w3.org/XML/1998/namespace</xsl:variable>
-
- <!-- Number of 'em' to indent from parent element's start tag to
- child element's start tag -->
- <xsl:variable name="ELEM_INDENT">1.5</xsl:variable>
-
- <!-- Number of 'em' to indent from parent element's start tag to
- attribute's tag -->
- <xsl:variable name="ATTR_INDENT">0.5</xsl:variable>
-
- <!-- Title to use if none provided -->
- <xsl:variable name="DEFAULT_TITLE">XML Schema Documentation</xsl:variable>
-
- <!-- Prefixes used for anchor names -->
- <!-- Type definitions -->
- <xsl:variable name="TYPE_PREFIX">type_</xsl:variable>
- <!-- Attribute declarations -->
- <xsl:variable name="ATTR_PREFIX">attribute_</xsl:variable>
- <!-- Attribute group definitions -->
- <xsl:variable name="ATTR_GRP_PREFIX">attributeGroup_</xsl:variable>
- <!-- Complex type definitions -->
- <xsl:variable name="CTYPE_PREFIX" select="$TYPE_PREFIX"/>
- <!-- Element declarations -->
- <xsl:variable name="ELEM_PREFIX">element_</xsl:variable>
- <!-- Key definitions -->
- <xsl:variable name="KEY_PREFIX">key_</xsl:variable>
- <!-- Group definitions -->
- <xsl:variable name="GRP_PREFIX">group_</xsl:variable>
- <!-- Notations -->
- <xsl:variable name="NOTA_PREFIX">notation_</xsl:variable>
- <!-- Namespace declarations -->
- <xsl:variable name="NS_PREFIX">ns_</xsl:variable>
- <!-- Simple type definitions -->
- <xsl:variable name="STYPE_PREFIX" select="$TYPE_PREFIX"/>
- <!-- Glossary terms -->
- <xsl:variable name="TERM_PREFIX">term_</xsl:variable>
-
- <!-- The original schema needs to be stored because when
- calculating links for references, the links have to be
- relative to the original schema. See 'PrintCompRef'
- template. -->
- <xsl:variable name="ORIGINAL_SCHEMA" select="/xsd:schema"/>
-
- <!-- ******** Main Document ******** -->
-
- <!--
- Main template that starts the process
- -->
- <xsl:template match="/xsd:schema">
- <!-- Check that links file is provided if searching external
- schemas for components. -->
- <xsl:if test="$linksFile='' and (normalize-space(translate($searchIncludedSchemas, 'TRUE', 'true'))='true' or normalize-space(translate($searchImportedSchemas, 'TRUE', 'true'))='true')">
- <xsl:call-template name="HandleError">
- <xsl:with-param name="isTerminating">true</xsl:with-param>
- <xsl:with-param name="errorMsg">
-'linksFile' variable must be provided if either
-'searchIncludedSchemas' or 'searchImportedSchemas' is true.
- </xsl:with-param>
- </xsl:call-template>
- </xsl:if>
-
- <!-- Get title of document -->
- <xsl:variable name="actualTitle">
- <xsl:choose>
- <xsl:when test="$title != ''">
- <xsl:value-of select="$title"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$DEFAULT_TITLE"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <html>
- <head>
- <!-- Set title bar -->
- <title><xsl:value-of select="$actualTitle"/></title>
-
- <!-- Set content type -->
- <meta http-equiv="Content-Type" content="text/xml; charset=iso-8859-1"/>
-
- <!-- Set base URL to use in working out relative paths -->
- <xsl:if test="$baseURL != ''">
- <xsl:element name="base">
- <xsl:attribute name="href"><xsl:value-of select="$baseURL"/></xsl:attribute>
- </xsl:element>
- </xsl:if>
-
- <!-- Set CSS styles -->
- <style type="text/css">
- <xsl:choose>
- <!-- Use external CSS stylesheet -->
- <xsl:when test="$externalCSSURL != ''">
- <xsl:text>
-@import url(</xsl:text><xsl:value-of select="$externalCSSURL"/><xsl:text>);
-</xsl:text>
- </xsl:when>
- <!-- Use internal CSS styles -->
- <xsl:otherwise>
- <xsl:call-template name="DocumentCSSStyles"/>
- </xsl:otherwise>
- </xsl:choose>
- </style>
-
- <!-- Add Javascript code to make the collapseable boxes work -->
- <xsl:if test="normalize-space(translate($useJavaScript,'TRUE','true'))='true'">
- <xsl:call-template name="PrintJSCode">
- <xsl:with-param name="code">
- <xsl:call-template name="DocumentJSCode"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:if>
- </head>
- <body>
- <!-- Title -->
- <h1><a name="top"><xsl:value-of select="$actualTitle"/></a></h1>
-
- <!-- Buttons for displaying printer-friendly version, and
- expanding and collapsing all boxes -->
- <xsl:call-template name="GlobalControlButtons"/>
-
- <!-- Section: Table of Contents -->
- <h2>Table of Contents</h2>
- <xsl:apply-templates select="." mode="toc"/>
- <xsl:call-template name="SectionFooter"/>
-
- <!-- Section: Schema Document Properties -->
- <h2><a name="SchemaProperties">Schema Document Properties</a></h2>
- <!-- Sub-section: Properties table -->
- <xsl:apply-templates select="." mode="properties"/>
- <!-- Sub-section: Namespace Legend -->
- <h3>Declared Namespaces</h3>
- <xsl:apply-templates select="." mode="namespaces"/>
- <!-- Sub-section: Schema Component Representation table -->
- <xsl:call-template name="SchemaComponentTable">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
- <xsl:call-template name="SectionFooter"/>
-
- <!-- Section: Redefined Schema Components -->
- <xsl:if test="xsd:redefine">
- <h2><a name="Redefinitions">Redefined Schema Components</a></h2>
- <xsl:apply-templates select="xsd:redefine/xsd:simpleType | xsd:redefine/xsd:complexType | xsd:redefine/xsd:attributeGroup | xsd:redefine/xsd:group" mode="topSection"/>
- </xsl:if>
-
- <!-- Sections: Top-level Schema Components -->
- <xsl:choose>
- <!-- Sort schema components -->
- <xsl:when test="normalize-space(translate($sortByComponent,'TRUE','true'))='true'">
- <!-- Declarations -->
- <xsl:if test="xsd:attribute or xsd:element">
- <h2><a name="SchemaDeclarations">Global Declarations</a></h2>
- <xsl:apply-templates select="xsd:attribute | xsd:element" mode="topSection">
- <xsl:sort select="local-name(.)" order="ascending"/>
- <xsl:sort select="@name" order="ascending"/>
- </xsl:apply-templates>
- </xsl:if>
- <!-- Definitions -->
- <xsl:if test="xsd:attributeGroup or xsd:complexType or xsd:group or xsd:notation or xsd:simpleType">
- <h2><a name="SchemaDefinitions">Global Definitions</a></h2>
- <xsl:apply-templates select="xsd:attributeGroup | xsd:complexType | xsd:group | xsd:notation | xsd:simpleType" mode="topSection">
- <xsl:sort select="local-name(.)" order="ascending"/>
- <xsl:sort select="@name" order="ascending"/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:when>
- <!-- Display schema components as they occur -->
- <xsl:otherwise>
- <h2><a name="SchemaComponents">Global Schema Components</a></h2>
- <xsl:apply-templates select="xsd:attribute | xsd:attributeGroup | xsd:complexType | xsd:element | xsd:group | xsd:notation | xsd:simpleType" mode="topSection"/>
- </xsl:otherwise>
- </xsl:choose>
-
- <!-- Section: Legend -->
- <xsl:if test="normalize-space(translate($printLegend,'TRUE','true'))='true'">
- <div id="legend">
- <h2><a name="Legend">Legend</a></h2>
- <xsl:call-template name="Legend"/>
- <xsl:call-template name="SectionFooter"/>
- </div>
- </xsl:if>
-
- <!-- Section: Glossary -->
- <xsl:if test="normalize-space(translate($printGlossary,'TRUE','true'))='true'">
- <div id="glossary">
- <h2><a name="Glossary">Glossary</a></h2>
- <xsl:call-template name="Glossary"/>
- <xsl:call-template name="SectionFooter"/>
- </div>
- </xsl:if>
-
- <!-- Document Footer -->
- <p class="footer">
- <xsl:text>Generated by </xsl:text>
- <a href="http://xml.fiforms.org/xs3p/">xs3p</a> (<a href="http://titanium.dstc.edu.au/xml/xs3p">old link</a>)
- <xsl:text>.</xsl:text>
- <xsl:if test="normalize-space(translate($useJavaScript,'TRUE','true'))='true'">
- <xsl:text> Last modified: </xsl:text>
- <xsl:call-template name="PrintJSCode">
- <xsl:with-param name="code">document.write(document.lastModified);</xsl:with-param>
- </xsl:call-template>
- </xsl:if>
- </p>
- </body>
- </html>
- </xsl:template>
-
- <!--
- Prints out the table of Declared Namespaces for the
- current schema.
- -->
- <xsl:template match="xsd:schema" mode="namespaces">
- <table class="namespaces">
- <tr>
- <th>Prefix</th>
- <th>Namespace</th>
- </tr>
- <!-- Default namespace (no prefix) -->
- <xsl:if test="namespace::*[local-name(.)='']">
- <xsl:variable name="ns" select="namespace::*[local-name(.)='']"/>
- <tr>
- <td>
- <a name="{$NS_PREFIX}">Default namespace</a>
- </td>
- <td>
- <xsl:choose>
- <xsl:when test="/xsd:schema/@targetNamespace and $ns=normalize-space(/xsd:schema/@targetNamespace)">
- <span class="targetNS">
- <xsl:value-of select="$ns"/>
- </span>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$ns"/>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- </xsl:if>
- <!-- Namespaces with prefixes -->
- <xsl:for-each select="namespace::*[local-name(.)!='']">
- <xsl:variable name="prefix" select="local-name(.)"/>
- <xsl:variable name="ns" select="."/>
- <tr>
- <td>
- <a name="{concat($NS_PREFIX, $prefix)}">
- <xsl:value-of select="$prefix"/>
- </a>
- </td>
- <td>
- <xsl:choose>
- <xsl:when test="/xsd:schema/@targetNamespace and $ns=normalize-space(/xsd:schema/@targetNamespace)">
- <span class="targetNS">
- <xsl:value-of select="$ns"/>
- </span>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$ns"/>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- </xsl:for-each>
- </table>
- </xsl:template>
-
- <!--
- Prints out the Table of Contents.
- -->
- <xsl:template match="xsd:schema" mode="toc">
- <ul>
- <!-- Section: Schema Document Properties -->
- <li>
- <a href="#SchemaProperties">Schema Document Properties</a>
- </li>
-
- <!-- Section: Redefined Schema Components -->
- <xsl:if test="xsd:redefine">
- <li>
- <a href="#Redefinitions">Redefined Schema Components</a>
- </li>
- </xsl:if>
-
- <!-- Sections: Top-level Schema Components -->
- <xsl:choose>
- <!-- Sort schema components -->
- <xsl:when test="normalize-space(translate($sortByComponent,'TRUE','true'))='true'">
- <!-- Declarations -->
- <xsl:if test="xsd:attribute or xsd:element">
- <li><a href="#SchemaDeclarations">Global Declarations</a>
- <ul>
- <xsl:apply-templates select="xsd:attribute | xsd:element" mode="toc">
- <xsl:sort select="local-name(.)" order="ascending"/>
- <xsl:sort select="@name" order="ascending"/>
- </xsl:apply-templates>
- </ul>
- </li>
- </xsl:if>
- <!-- Definitions -->
- <xsl:if test="xsd:attributeGroup or xsd:complexType or xsd:group or xsd:notation or xsd:simpleType">
- <li><a href="#SchemaDefinitions">Global Definitions</a>
- <ul>
- <xsl:apply-templates select="xsd:attributeGroup | xsd:complexType | xsd:group | xsd:notation | xsd:simpleType" mode="toc">
- <xsl:sort select="local-name(.)" order="ascending"/>
- <xsl:sort select="@name" order="ascending"/>
- </xsl:apply-templates>
- </ul>
- </li>
- </xsl:if>
- </xsl:when>
- <!-- Display schema components in order as they appear in schema -->
- <xsl:otherwise>
- <li><a href="#SchemaComponents">Global Schema Components</a>
- <ul>
- <xsl:apply-templates select="xsd:attribute | xsd:attributeGroup | xsd:complexType | xsd:element | xsd:group | xsd:notation | xsd:simpleType" mode="toc"/>
- </ul>
- </li>
- </xsl:otherwise>
- </xsl:choose>
- </ul>
-
- <!-- Section: Legend -->
- <xsl:if test="normalize-space(translate($printLegend,'TRUE','true'))='true'">
- <ul id="legendTOC" style="margin-top: 0em">
- <li><a href="#Legend">Legend</a></li>
- </ul>
- </xsl:if>
-
- <!-- Section: Glossary -->
- <xsl:if test="normalize-space(translate($printGlossary,'TRUE','true'))='true'">
- <ul id="glossaryTOC" style="margin-top: 0em">
- <li><a href="#Glossary">Glossary</a></li>
- </ul>
- </xsl:if>
- </xsl:template>
-
- <!--
- Prints out a link to a top-level schema component section in the
- Table of Contents.
- -->
- <xsl:template match="xsd:*[@name]" mode="toc">
- <xsl:variable name="componentID">
- <xsl:call-template name="GetComponentID">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
- </xsl:variable>
-
- <li>
- <a href="#{$componentID}">
- <xsl:call-template name="GetComponentDescription">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
- <xsl:text>: </xsl:text>
- <strong><xsl:value-of select="@name"/></strong>
- </a>
- </li>
- </xsl:template>
-
- <!--
- Prints out the section for a top-level schema component.
- -->
- <xsl:template match="xsd:*[@name]" mode="topSection">
- <!-- Header -->
- <xsl:call-template name="ComponentSectionHeader">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
-
- <!-- Hierarchy table (for types and elements) -->
- <xsl:apply-templates select="." mode="hierarchy"/>
-
- <!-- Properties table -->
- <xsl:apply-templates select="." mode="properties"/>
-
- <!-- XML Instance Representation table -->
- <xsl:call-template name="SampleInstanceTable">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
-
- <!-- Schema Component Representation table -->
- <xsl:call-template name="SchemaComponentTable">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
-
- <!-- Footer -->
- <xsl:call-template name="SectionFooter"/>
- </xsl:template>
-
- <!--
- Prints out the buttons that can expand and collapse all boxes in
- this page.
- -->
- <xsl:template name="GlobalControlButtons">
- <xsl:if test="normalize-space(translate($useJavaScript,'TRUE','true'))='true'">
- <div style="float: right;">
- <!-- Printer-friendly Version -->
- <div id="printerControls" style="display:none;">
- <input type="checkbox" onclick="displayMode(this.checked)"/>
- <xsl:text>Printer-friendly Version</xsl:text>
- </div>
- <xsl:call-template name="PrintJSCode">
- <xsl:with-param name="code">
-var pc = getElementObject("printerControls");
-if (pc != null) {
- pc.style.display="block";
-}
- </xsl:with-param>
- </xsl:call-template>
-
- <!-- Expand/Collapse All buttons -->
- <div id="globalControls" style="display:none">
- <strong>XML Instance Representation:</strong><br/>
- <span style="margin-left: 1em; white-space: nowrap">
- <xsl:text>[ </xsl:text>
- <a href="javascript:void(0)" onclick="expandAll(xiBoxes)">Expand All</a>
- <xsl:text> | </xsl:text>
- <a href="javascript:void(0)" onclick="collapseAll(xiBoxes)">Collapse All</a>
- <xsl:text> ]</xsl:text>
- </span><br/><br/>
- <strong>Schema Component Representation:</strong><br/>
- <span style="margin-left: 1em; white-space: nowrap">
- <xsl:text>[ </xsl:text>
- <a href="javascript:void(0)" onclick="expandAll(scBoxes)">Expand All</a>
- <xsl:text> | </xsl:text>
- <a href="javascript:void(0)" onclick="collapseAll(scBoxes)">Collapse All</a>
- <xsl:text> ]</xsl:text>
- </span>
- </div>
- <xsl:call-template name="PrintJSCode">
- <xsl:with-param name="code">
-var gc = getElementObject("globalControls");
-if (gc != null) {
- gc.style.display="block";
-}
- </xsl:with-param>
- </xsl:call-template>
- </div>
- </xsl:if>
- </xsl:template>
-
- <!--
- Prints out the section header of a top-level schema component.
- Param(s):
- component (Node) required
- Top-level schema component
- -->
- <xsl:template name="ComponentSectionHeader">
- <xsl:param name="component"/>
-
- <xsl:variable name="componentID">
- <xsl:call-template name="GetComponentID">
- <xsl:with-param name="component" select="$component"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="componentDescription">
- <xsl:call-template name="GetComponentDescription">
- <xsl:with-param name="component" select="$component"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="componentTermRef">
- <xsl:call-template name="GetComponentTermRef">
- <xsl:with-param name="component" select="$component"/>
- </xsl:call-template>
- </xsl:variable>
-
- <h3>
- <!-- Description -->
- <xsl:choose>
- <xsl:when test="$componentTermRef != ''">
- <xsl:call-template name="PrintGlossaryTermRef">
- <xsl:with-param name="code" select="$componentTermRef"/>
- <xsl:with-param name="term" select="$componentDescription"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$componentDescription"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>: </xsl:text>
- <!-- Name -->
- <a name="{$componentID}" class="name">
- <xsl:value-of select="$component/@name"/>
- </a>
- </h3>
- </xsl:template>
-
- <!--
- Prints out footer for top-level sections.
- -->
- <xsl:template name="SectionFooter">
- <!-- Link to top of page-->
- <div style="text-align: right; clear: both;"><a href="#top">top</a></div>
- <hr/>
- </xsl:template>
-
- <!--
- Java Script code required by the entire HTML document.
- -->
- <xsl:template name="DocumentJSCode">
- <!-- Get all IDs of XML Instance Representation boxes
- and place them in an array. -->
- <xsl:text>/* IDs of XML Instance Representation boxes */
-</xsl:text>
- <xsl:text>var xiBoxes = new Array(</xsl:text>
- <xsl:for-each select="/xsd:schema/xsd:*[@name]">
- <xsl:if test="position()!=1">
- <xsl:text>, </xsl:text>
- </xsl:if>
- <xsl:text>'</xsl:text>
- <xsl:call-template name="GetComponentID">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
- <xsl:text>_xibox'</xsl:text>
- </xsl:for-each>
- <xsl:text>);
-</xsl:text>
- <!-- Get all IDs of Schema Component Representation boxes
- and place them in an array. -->
- <xsl:text>/* IDs of Schema Component Representation boxes */
-</xsl:text>
- <xsl:text>var scBoxes = new Array('schema_scbox'</xsl:text>
- <xsl:for-each select="/xsd:schema/xsd:*[@name]">
- <xsl:text>, '</xsl:text>
- <xsl:call-template name="GetComponentID">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
- <xsl:text>_scbox'</xsl:text>
- </xsl:for-each>
- <xsl:text>);
-</xsl:text>
- <!-- Functions -->
- <xsl:text>
-/**
- * Can get the ID of the button controlling
- * a collapseable box by concatenating
- * this string onto the ID of the box itself.
- */
-var B_SFIX = "_button";
-
-/**
- * Counter of documentation windows
- * Used to give each window a unique name
- */
-var windowCount = 0;
-
-/**
- * Returns an element in the current HTML document.
- *
- * @param elementID Identifier of HTML element
- * @return HTML element object
- */
-function getElementObject(elementID) {
- var elemObj = null;
- if (document.getElementById) {
- elemObj = document.getElementById(elementID);
- }
- return elemObj;
-}
-
-/**
- * Closes a collapseable box.
- *
- * @param boxObj Collapseable box
- * @param buttonObj Button controlling box
- */
-function closeBox(boxObj, buttonObj) {
- if (boxObj == null || buttonObj == null) {
- // Box or button not found
- } else {
- // Change 'display' CSS property of box
- boxObj.style.display="none";
-
- // Change text of button
- if (boxObj.style.display=="none") {
- buttonObj.value=" + ";
- }
- }
-}
-
-/**
- * Opens a collapseable box.
- *
- * @param boxObj Collapseable box
- * @param buttonObj Button controlling box
- */
-function openBox(boxObj, buttonObj) {
- if (boxObj == null || buttonObj == null) {
- // Box or button not found
- } else {
- // Change 'display' CSS property of box
- boxObj.style.display="block";
-
- // Change text of button
- if (boxObj.style.display=="block") {
- buttonObj.value=" - ";
- }
- }
-}
-
-/**
- * Sets the state of a collapseable box.
- *
- * @param boxID Identifier of box
- * @param open If true, box is "opened",
- * Otherwise, box is "closed".
- */
-function setState(boxID, open) {
- var boxObj = getElementObject(boxID);
- var buttonObj = getElementObject(boxID+B_SFIX);
- if (boxObj == null || buttonObj == null) {
- // Box or button not found
- } else if (open) {
- openBox(boxObj, buttonObj);
- // Make button visible
- buttonObj.style.display="inline";
- } else {
- closeBox(boxObj, buttonObj);
- // Make button visible
- buttonObj.style.display="inline";
- }
-}
-
-/**
- * Switches the state of a collapseable box, e.g.
- * if it's opened, it'll be closed, and vice versa.
- *
- * @param boxID Identifier of box
- */
-function switchState(boxID) {
- var boxObj = getElementObject(boxID);
- var buttonObj = getElementObject(boxID+B_SFIX);
- if (boxObj == null || buttonObj == null) {
- // Box or button not found
- } else if (boxObj.style.display=="none") {
- // Box is closed, so open it
- openBox(boxObj, buttonObj);
- } else if (boxObj.style.display=="block") {
- // Box is opened, so close it
- closeBox(boxObj, buttonObj);
- }
-}
-
-/**
- * Closes all boxes in a given list.
- *
- * @param boxList Array of box IDs
- */
-function collapseAll(boxList) {
- var idx;
- for (idx = 0; idx &lt; boxList.length; idx++) {
- var boxObj = getElementObject(boxList[idx]);
- var buttonObj = getElementObject(boxList[idx]+B_SFIX);
- closeBox(boxObj, buttonObj);
- }
-}
-
-/**
- * Open all boxes in a given list.
- *
- * @param boxList Array of box IDs
- */
-function expandAll(boxList) {
- var idx;
- for (idx = 0; idx &lt; boxList.length; idx++) {
- var boxObj = getElementObject(boxList[idx]);
- var buttonObj = getElementObject(boxList[idx]+B_SFIX);
- openBox(boxObj, buttonObj);
- }
-}
-
-/**
- * Makes all the control buttons of boxes appear.
- *
- * @param boxList Array of box IDs
- */
-function viewControlButtons(boxList) {
- var idx;
- for (idx = 0; idx &lt; boxList.length; idx++) {
- buttonObj = getElementObject(boxList[idx]+B_SFIX);
- if (buttonObj != null) {
- buttonObj.style.display = "inline";
- }
- }
-}
-
-/**
- * Makes all the control buttons of boxes disappear.
- *
- * @param boxList Array of box IDs
- */
-function hideControlButtons(boxList) {
- var idx;
- for (idx = 0; idx &lt; boxList.length; idx++) {
- buttonObj = getElementObject(boxList[idx]+B_SFIX);
- if (buttonObj != null) {
- buttonObj.style.display = "none";
- }
- }
-}
-
-/**
- * Sets the page for either printing mode
- * or viewing mode. In printing mode, the page
- * is made to be more readable when printing it out.
- * In viewing mode, the page is more browsable.
- *
- * @param isPrinterVersion If true, display in
- * printing mode; otherwise,
- * in viewing mode
- */
-function displayMode(isPrinterVersion) {
- var obj;
- if (isPrinterVersion) {
- // Hide global control buttons
- obj = getElementObject("globalControls");
- if (obj != null) {
- obj.style.visibility = "hidden";
- }
- // Hide Legend
- obj = getElementObject("legend");
- if (obj != null) {
- obj.style.display = "none";
- }
- obj = getElementObject("legendTOC");
- if (obj != null) {
- obj.style.display = "none";
- }
- // Hide Glossary
- obj = getElementObject("glossary");
- if (obj != null) {
- obj.style.display = "none";
- }
- obj = getElementObject("glossaryTOC");
- if (obj != null) {
- obj.style.display = "none";
- }
-
- // Expand all XML Instance Representation tables
- expandAll(xiBoxes);
- // Expand all Schema Component Representation tables
- expandAll(scBoxes);
-
- // Hide Control buttons
- hideControlButtons(xiBoxes);
- hideControlButtons(scBoxes);
- } else {
- // View global control buttons
- obj = getElementObject("globalControls");
- if (obj != null) {
- obj.style.visibility = "visible";
- }
- // View Legend
- obj = getElementObject("legend");
- if (obj != null) {
- obj.style.display = "block";
- }
- obj = getElementObject("legendTOC");
- if (obj != null) {
- obj.style.display = "block";
- }
- // View Glossary
- obj = getElementObject("glossary");
- if (obj != null) {
- obj.style.display = "block";
- }
- obj = getElementObject("glossaryTOC");
- if (obj != null) {
- obj.style.display = "block";
- }
-
- // Expand all XML Instance Representation tables
- expandAll(xiBoxes);
- // Collapse all Schema Component Representation tables
- collapseAll(scBoxes);
-
- // View Control buttons
- viewControlButtons(xiBoxes);
- viewControlButtons(scBoxes);
- }
-}
-
-/**
- * Opens up a window displaying the documentation
- * of a schema component in the XML Instance
- * Representation table.
- *
- * @param compDesc Description of schema component
- * @param compName Name of schema component
- * @param docTextArray Array containing the paragraphs
- * of the new document
- */
-function viewDocumentation(compDesc, compName, docTextArray) {
- var width = 400;
- var height = 200;
- var locX = 100;
- var locY = 200;
-
- /* Generate content */
- var actualText = "&lt;html>";
- actualText += "&lt;head>&lt;title>";
- actualText += compDesc;
- if (compName != '') {
- actualText += ": " + compName;
- }
- actualText += "&lt;/title>&lt;/head>";
- actualText += "&lt;body bgcolor=\"#FFFFEE\">";
- // Title
- actualText += "&lt;p style=\"font-family: Arial, sans-serif; font-size: 12pt; font-weight: bold; letter-spacing:1px;\">";
- actualText += compDesc;
- if (compName != '') {
- actualText += ": &lt;span style=\"color:#006699\">" + compName + "&lt;/span>";
- }
- actualText += "&lt;/p>";
- // Documentation
- var idx;
- for (idx = 0; idx &lt; docTextArray.length; idx++) {
- actualText += "&lt;p style=\"font-family: Arial, sans-serif; font-size: 10pt;\">" + docTextArray[idx] + "&lt;/p>";
- }
- // Link to close window
- actualText += "&lt;a href=\"javascript:void(0)\" onclick=\"window.close();\" style=\"font-family: Arial, sans-serif; font-size: 8pt;\">Close&lt;/a>";
- actualText += "&lt;/body>&lt;/html>";
-
- /* Display window */
- windowCount++;
- var docWindow = window.open("", "documentation"+windowCount, "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable,alwaysRaised,dependent,titlebar=no,width="+width+",height="+height+",screenX="+locX+",left="+locX+",screenY="+locY+",top="+locY);
- docWindow.document.write(actualText);
-}
-</xsl:text>
- </xsl:template>
-
- <!--
- CSS properties for the entire HTML document.
- -->
- <xsl:template name="DocumentCSSStyles">
- <xsl:text>
-/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-/* More-configurable styles */
-
-/******** General ********/
-
-/* Document body */
-body {
- color: Black;
- background-color: White;
- font-family: Arial, sans-serif;
- font-size: 10pt;
-}
-/* Horizontal rules */
-hr {
- color: black;
-}
-/* Document title */
-h1 {
- font-size: 18pt;
- letter-spacing: 2px;
- border-bottom: 1px #ccc solid;
- padding-top: 5px;
- padding-bottom: 5px;
-}
-/* Main section headers */
-h2 {
- font-size: 14pt;
- letter-spacing: 1px;
-}
-/* Sub-section headers */
-h3, h3 a, h3 span {
- font-size: 12pt;
- font-weight: bold;
- color: black;
-}
-/* Table displaying the properties of the schema components or the
- schema document itself */
-table.properties th, table.properties th a {
- color: black;
- background-color: #F99; /* Pink */
-}
-table.properties td {
- background-color: #eee; /* Gray */
-}
-
-
-/******** Table of Contents Section ********/
-
-/* Controls for switching between printing and viewing modes */
-div#printerControls {
- color: #963; /* Orange-brown */
-}
-/* Controls that can collapse or expand all XML Instance
- Representation and Schema Component Representation boxes */
-div#globalControls {
- border: 2px solid #999;
-}
-
-
-/******** Schema Document Properties Section ********/
-
-/* Table displaying the namespaces declared in the schema */
-table.namespaces th {
- background-color: #ccc;
-}
-table.namespaces td {
- background-color: #eee;
-}
-/* Target namespace of the schema */
-span.targetNS {
- color: #06C;
- font-weight: bold;
-}
-
-
-/******** Schema Components' Sections ********/
-
-/* Name of schema component */
-.name {
- color: #F93; /* Orange */
-}
-
-/* Hierarchy table */
-table.hierarchy {
- border: 2px solid #999; /* Gray */
-}
-
-/* XML Instance Representation table */
-div.sample div.contents {
- border: 2px dashed black;
-}
-
-/* Schema Component Representation table */
-div.schemaComponent div.contents {
- border: 2px black solid;
-}
-
-
-/******** Glossary Section ********/
-
-/* Glossary Terms */
-.glossaryTerm {
- color: #036; /* Blue */
-}
-
-
-/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-/* Printer-version styles */
-
-@media print {
-
-/* Ensures that controls are hidden when printing */
-div#printerControls {
- visibility: hidden;
-}
-div#globalControls {
- visibility: hidden;
-}
-#legend {
- display: none;
-}
-#legendTOC {
- display: none;
-}
-#glossary {
- display: none;
-}
-#glossaryTOC {
- display: none;
-}
-
-}
-
-/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-/* Base styles */
-
-/******** General ********/
-
-/* Unordered lists */
-ul {
- margin-left: 1.5em;
- margin-bottom: 0em;
-}
-/* Tables */
-table {
- margin-top: 10px;
- margin-bottom: 10px;
- margin-left: 2px;
- margin-right: 2px;
-}
-table th, table td {
- font-size: 10pt;
- vertical-align: top;
- padding-top: 3px;
- padding-bottom: 3px;
- padding-left: 10px;
- padding-right: 10px;
-}
-table th {
- font-weight: bold;
- text-align: left;
-}
-/* Table displaying the properties of the schema components or the
- schema document itself */
-table.properties {
- width: 90%;
-}
-table.properties th {
- width: 30%;
-}
-/* Boxes that can make its content appear and disappear*/
-div.box {
- margin: 1em;
-}
- /* Box caption */
-div.box span.caption {
- font-weight: bold;
-}
- /* Button to open and close the box */
-div.box input.control {
- width: 1.4em;
- height: 1.4em;
- text-align: center;
- vertical-align: middle;
- font-size: 11pt;
-}
- /* Box contents */
-div.box div.contents {
- margin-top: 3px;
-}
-
-
-/******** Table of Contents Section ********/
-
-/* Controls for switching between printing and viewing modes */
-div#printerControls {
- white-space: nowrap;
- font-weight: bold;
- padding: 5px;
- margin: 5px;
-}
-/* Controls that can collapse or expand all XML Instance
- Representation and Schema Component Representation boxes */
-div#globalControls {
- padding: 10px;
- margin: 5px;
-}
-
-
-/******** Schema Document Properties Section ********/
-
-/* Table displaying the namespaces declared in the schema */
-table.namespaces th {
-}
-table.namespaces td {
-}
-/* Target namespace of the schema */
-span.targetNS {
-}
-
-
-/******** Schema Components' Sections ********/
-
-/* Name of schema component */
-.name {
-}
-
-/* Hierarchy table */
-table.hierarchy {
- width: 90%;
-}
-table.hierarchy th {
- font-weight: normal;
- font-style: italic;
- width: 20%;
-}
-table.hierarchy th, table.hierarchy td {
- padding: 5px;
-}
-
-/* XML Instance Representation table */
-div.sample {
- width: 90%;
-}
-div.sample div.contents {
- padding: 5px;
- font-family: Courier New, sans-serif;
- font-size: 10pt;
-}
- /* Normal elements and attributes */
-div.sample div.contents, div.sample div.contents a {
- color: black;
-}
- /* Group Headers */
-div.sample div.contents .group, div.sample div.contents .group a {
- color: #999; /* Light gray */
-}
- /* Type Information */
-div.sample div.contents .type, div.sample div.contents .type a {
- color: #999; /* Light gray */
-}
- /* Occurrence Information */
-div.sample div.contents .occurs, div.sample div.contents .occurs a {
- color: #999; /* Light gray */
-}
- /* Fixed values */
-div.sample div.contents .fixed {
- color: #063; /* Green */
- font-weight: bold;
-}
- /* Simple type constraints */
-div.sample div.contents .constraint, div.sample div.contents .constraint a {
- color: #999; /* Light gray */
-}
- /* Elements and attributes inherited from base type */
-div.sample div.contents .inherited, div.sample div.contents .inherited a {
- color: #666; /* Dark gray */
-}
- /* Elements and attributes added to or changed from base type */
-div.sample div.contents .newFields {
- font-weight: bold;
-}
- /* Other type of information */
-div.sample div.contents .other, div.sample div.contents .other a {
- color: #369; /* Blue */
- font-style: italic;
-}
- /* Link to open up window displaying documentation */
-div.sample div.contents a.documentation {
- text-decoration: none;
- padding-left: 3px;
- padding-right: 3px;
- padding-top: 0px;
- padding-bottom: 0px;
- font-weight: bold;
- font-size: 11pt;
- background-color: #FFD;
- color: #069;
-}
- /* Invert colors when hovering over link to open up window
- displaying documentation */
-div.sample div.contents a.documentation:hover {
- color: #FFD;
- background-color: #069;
-}
-
-/* Schema Component Representation table */
-div.schemaComponent {
- width: 90%;
-}
-div.schemaComponent div.contents {
- font-family: Courier New, sans-serif;
- font-size: 10pt;
- padding: 5px;
-}
- /* Syntax characters */
-div.schemaComponent div.contents {
- color: #00f; /* blue */
-}
- /* Element and attribute tags */
-div.schemaComponent div.contents .scTag {
- color: #933; /* maroon */
-}
- /* Element and attribute content */
-div.schemaComponent div.contents .scContent, div.schemaComponent div.contents .scContent a {
- color: black;
- font-weight: bold;
-}
- /* Comments */
-div.schemaComponent div.contents .comment {
- color: #999; /* Light gray */
-}
-
-/******** Legend Section ********/
-
-div#legend table, div#legend div {
- margin-bottom: 3px;
-}
-div#legend div.hint {
- color: #999; /* Light gray */
- width: 90%;
- margin-left: 1em;
- margin-bottom: 2em;
-}
-
-
-/******** Glossary Section ********/
-
-/* Glossary Terms */
-.glossaryTerm {
- font-weight: bold;
-}
-
-
-/******** Footer ********/
-
-.footer {
- font-size: 8pt;
-}
-</xsl:text>
- </xsl:template>
-
- <!--
- Print outs a legend describing the meaning of colors, bold items,
- etc. in the top-level sections.
- -->
- <xsl:template name="Legend">
- <!-- Header -->
- <div style="float: left; width: 15em;">
- <h3 style="margin-bottom: 0px;">Complex Type:</h3>
- <div class="hint" style="margin-left: 0em;">Schema Component Type</div>
- </div>
- <div style="float: left; width: 15em;">
- <h3 style="margin-bottom: 0px;"><span class="name">AusAddress</span></h3>
- <div class="hint" style="margin-left: 0em;">Schema Component Name</div>
- </div>
-
- <!-- Hierarchy Table -->
- <table class="hierarchy" style="clear : both">
- <tr>
- <xsl:choose>
- <xsl:when test="normalize-space(translate($printAllSuperTypes, 'TRUE', 'true'))='true'">
- <th>Super-types:</th>
- <td>
- <span class="type" style="color: #0000FF; text-decoration:underline;">Address</span>
- <xsl:text> &lt; </xsl:text>
- <span class="current">AusAddress</span>
- <xsl:text> (by extension)</xsl:text>
- </td>
- </xsl:when>
- <xsl:otherwise>
- <th>Parent type:</th>
- <td>
- <span class="type" style="color: #0000FF; text-decoration:underline;">Address</span>
- <xsl:text> (derivation method: extension)</xsl:text>
- </td>
- </xsl:otherwise>
- </xsl:choose>
- </tr>
- <tr>
- <xsl:choose>
- <xsl:when test="normalize-space(translate($printAllSubTypes, 'TRUE', 'true'))='true'">
- <th>Sub-types:</th>
- <td>
- <ul>
- <li>
- <span class="type" style="color: #0000FF; text-decoration:underline;">QLDAddress</span>
- <xsl:text> (by restriction)</xsl:text>
- </li>
- </ul>
- </td>
- </xsl:when>
- <xsl:otherwise>
- <th>Direct sub-types:</th>
- <td>
- <ul>
- <li>
- <span class="type" style="color: #0000FF; text-decoration:underline;">QLDAddress</span>
- <xsl:text> (by restriction)</xsl:text>
- </li>
- </ul>
- </td>
- </xsl:otherwise>
- </xsl:choose>
- </tr>
- </table>
- <div class="hint">If this schema component is a type definition, its type hierarchy is shown in a gray-bordered box.</div>
-
- <!-- Properties Table -->
- <table class="properties">
- <tr>
- <th>Name</th>
- <td>AusAddress</td>
- </tr>
- <tr>
- <th>
- <a title="Look up 'Abstract' in glossary" href="#term_Abstract">Abstract</a>
- </th>
- <td>no</td>
- </tr>
- </table>
- <div class="hint">The table above displays the properties of this schema component.</div>
-
- <!-- XML Instance Representation Table -->
- <div class="sample box">
- <div>
- <span class="caption">XML Instance Representation</span>
- </div>
- <div class="contents">
- <span style="margin-left: 0em">&lt;...</span>
- <span class="newFields">
- <span> country="<span class="fixed">Australia</span>"</span>
- </span>
- <xsl:text>&gt; </xsl:text><br/>
- <span style="margin-left: 1.5em" class="inherited">&lt;unitNo&gt; <span class="type">string</span> &lt;/unitNo&gt; <span class="occurs">[0..1]</span></span><br/>
- <span style="margin-left: 1.5em" class="inherited">&lt;houseNo&gt; <span class="type">string</span> &lt;/houseNo&gt; <span class="occurs">[1]</span></span><br/>
- <span style="margin-left: 1.5em" class="inherited">&lt;street&gt; <span class="type">string</span> &lt;/street&gt; <span class="occurs">[1]</span></span><br/>
- <span class="group" style="margin-left: 1.5em">Start <a title="Look up 'Choice' in glossary" href="#term_Choice">Choice</a> <span class="occurs">[1]</span></span><br/>
- <span style="margin-left: 3em" class="inherited">&lt;city&gt; <span class="type">string</span> &lt;/city&gt; <span class="occurs">[1]</span></span><br/>
- <span style="margin-left: 3em" class="inherited">&lt;town&gt; <span class="type">string</span> &lt;/town&gt; <span class="occurs">[1]</span></span><br/>
- <span class="group" style="margin-left: 1.5em">End Choice</span><br/>
- <span class="newFields">
- <span style="margin-left: 1.5em">&lt;state&gt; <span class="type" style="text-decoration:underline;">AusStates</span> &lt;/state&gt; <span class="occurs">[1]</span></span><br/>
- <span style="margin-left: 1.5em">&lt;postcode&gt; <span class="constraint">string &lt;&lt;<em>pattern</em> = [1-9][0-9]{3}>></span> &lt;/postcode&gt; <span class="occurs">[1]</span>
- <xsl:if test="normalize-space(translate($useJavaScript,'TRUE','true'))='true'">
- <a href="javascript:void(0)" title="View Documentation" class="documentation" onclick="docArray = new Array('Post code must be a four-digit number.'); viewDocumentation('Element', 'postcode', docArray);">?</a>
- </xsl:if>
- </span><br/>
- </span>
- <span style="margin-left: 0em">&lt;/...&gt;</span><br/>
- </div>
- </div>
- <div class="hint">
- <p>The XML Instance Representation table above shows the schema component's content as an XML instance.</p>
- <ul>
- <li>The minimum and maximum occurrence of elements and attributes are provided in square brackets, e.g. [0..1].</li>
- <li>Model group information are shown in gray, e.g. Start Choice ... End Choice.</li>
- <li>For type derivations, the elements and attributes that have been added to or changed from the base type's content are shown in <span style="font-weight: bold">bold</span>.</li>
- <li>If an element/attribute has a fixed value, the fixed value is shown in green, e.g. country="Australia".</li>
- <li>Otherwise, the type of the element/attribute is displayed.
- <ul>
- <li>If the element/attribute's type is in the schema, a link is provided to it.</li>
- <!--<li>An <em>E</em> symbol is shown if the element/attribute's type is located in an external schema.</li>-->
- <li>For local simple type definitions, the constraints are displayed in angle brackets, e.g. &lt;&lt;<em>pattern</em> = [1-9][0-9]{3}>>.</li>
- </ul>
- </li>
- <xsl:if test="normalize-space(translate($useJavaScript,'TRUE','true'))='true'">
- <li>If a local element/attribute has documentation, it will be displayed in a window that pops up when the question mark inside the attribute or next to the element is clicked, e.g. &lt;postcode>.</li>
- </xsl:if>
- </ul>
- </div>
-
- <!-- Schema Component Representation Table -->
- <div class="schemaComponent box">
- <div>
- <span class="caption">Schema Component Representation</span>
- </div>
- <div class="contents">
- <span style="margin-left: 0em">&lt;<span class="scTag">complexType</span> <span class="scTag">name</span>="<span class="scContent">AusAddress</span>"&gt;</span><br/>
- <span style="margin-left: 1.5em">&lt;<span class="scTag">complexContent</span>&gt;</span><br/>
- <span style="margin-left: 3em">&lt;<span class="scTag">extension</span> <span class="scTag">base</span>="<span class="scContent"><span class="type" style="text-decoration:underline;">Address</span></span>"&gt;</span><br/>
- <span style="margin-left: 4.5em">&lt;<span class="scTag">sequence</span>&gt;</span><br/>
- <span style="margin-left: 6em">&lt;<span class="scTag">element</span> <span class="scTag">name</span>="<span class="scContent">state</span>" <span class="scTag">type</span>="<span class="scContent"><span class="type" style="text-decoration:underline;">AusStates</span></span>"/&gt;</span><br/>
- <span style="margin-left: 6em">&lt;<span class="scTag">element</span> <span class="scTag">name</span>="<span class="scContent">postcode</span>"&gt;</span><br/>
- <span style="margin-left: 7.5em">&lt;<span class="scTag">simpleType</span>&gt;</span><br/>
- <span style="margin-left: 9em">&lt;<span class="scTag">restriction</span> <span class="scTag">base</span>="<span class="scContent"><span class="type">string</span></span>"&gt;</span><br/>
- <span style="margin-left: 10.5em">&lt;<span class="scTag">pattern</span> <span class="scTag">value</span>="<span class="scContent">[1-9][0-9]{3}</span>"/&gt;</span><br/>
- <span style="margin-left: 9em">&lt;/<span class="scTag">restriction</span>&gt;</span><br/>
- <span style="margin-left: 7.5em">&lt;/<span class="scTag">simpleType</span>&gt;</span><br/>
- <span style="margin-left: 6em">&lt;/<span class="scTag">element</span>&gt;</span><br/>
- <span style="margin-left: 4.5em">&lt;/<span class="scTag">sequence</span>&gt;</span><br/>
- <span style="margin-left: 4.5em">&lt;<span class="scTag">attribute</span> <span class="scTag">name</span>="<span class="scContent">country</span>" <span class="scTag">type</span>="<span class="scContent"><span class="type">string</span></span>" <span class="scTag">fixed</span>="<span class="scContent">Australia</span>"/&gt;</span><br/>
- <span style="margin-left: 3em">&lt;/<span class="scTag">extension</span>&gt;</span><br/>
- <span style="margin-left: 1.5em">&lt;/<span class="scTag">complexContent</span>&gt;</span><br/>
- <span style="margin-left: 0em">&lt;/<span class="scTag">complexType</span>&gt;</span><br/>
- </div>
- </div>
- <div class="hint">The Schema Component Representation table above displays the underlying XML representation of the schema component. (Annotations are not shown.)</div>
- </xsl:template>
-
- <!--
- Print outs all terms for the glossary section.
- -->
- <xsl:template name="Glossary">
- <xsl:call-template name="PrintGlossaryTerm">
- <xsl:with-param name="code">Abstract</xsl:with-param>
- <xsl:with-param name="term">Abstract</xsl:with-param>
- <xsl:with-param name="description">
- <xsl:text>(Applies to complex type definitions and element declarations).</xsl:text>
- <xsl:text> An abstract element or complex type cannot used to validate an element instance.</xsl:text>
- <xsl:text> If there is a reference to an abstract element, only element declarations that can substitute the abstract element can be used to validate the instance.</xsl:text>
- <xsl:text> For references to abstract type definitions, only derived types can be used.</xsl:text>
- </xsl:with-param>
- </xsl:call-template>
-
- <xsl:call-template name="PrintGlossaryTerm">
- <xsl:with-param name="code">All</xsl:with-param>
- <xsl:with-param name="term">All Model Group</xsl:with-param>
- <xsl:with-param name="description">
- <xsl:text>Child elements can be provided </xsl:text>
- <em>
- <xsl:text>in any order</xsl:text>
- </em>
- <xsl:text> in instances.</xsl:text>
- </xsl:with-param>
- <xsl:with-param name="link">http://www.w3.org/TR/xmlschema-1/#element-all</xsl:with-param>
- </xsl:call-template>
-
- <xsl:call-template name="PrintGlossaryTerm">
- <xsl:with-param name="code">Choice</xsl:with-param>
- <xsl:with-param name="term">Choice Model Group</xsl:with-param>
- <xsl:with-param name="description">
- <em>
- <xsl:text>Only one</xsl:text>
- </em>
- <xsl:text> from the list of child elements and model groups can be provided in instances.</xsl:text>
- </xsl:with-param>
- <xsl:with-param name="link">http://www.w3.org/TR/xmlschema-1/#element-choice</xsl:with-param>
- </xsl:call-template>
-
- <xsl:call-template name="PrintGlossaryTerm">
- <xsl:with-param name="code">CollapseWS</xsl:with-param>
- <xsl:with-param name="term">Collapse Whitespace Policy</xsl:with-param>
- <xsl:with-param name="description">Replace tab, line feed, and carriage return characters with space character (Unicode character 32). Then, collapse contiguous sequences of space characters into single space character, and remove leading and trailing space characters.</xsl:with-param>
- </xsl:call-template>
-
- <xsl:call-template name="PrintGlossaryTerm">
- <xsl:with-param name="code">ElemBlock</xsl:with-param>
- <xsl:with-param name="term">Disallowed Substitutions</xsl:with-param>
- <xsl:with-param name="description">
- <xsl:text>(Applies to element declarations).</xsl:text>
- <xsl:text> If </xsl:text>
- <em>substitution</em>
- <xsl:text> is specified, then </xsl:text>
- <xsl:call-template name="PrintGlossaryTermRef">
- <xsl:with-param name="code">SubGroup</xsl:with-param>
- <xsl:with-param name="term">substitution group</xsl:with-param>
- </xsl:call-template>
- <xsl:text> members cannot be used in place of the given element declaration to validate element instances.</xsl:text>
-
- <xsl:text> If </xsl:text>
- <em>derivation methods</em>
- <xsl:text>, e.g. extension, restriction, are specified, then the given element declaration will not validate element instances that have types derived from the element declaration's type using the specified derivation methods.</xsl:text>
- <xsl:text> Normally, element instances can override their declaration's type by specifying an </xsl:text>
- <code>xsi:type</code>
- <xsl:text> attribute.</xsl:text>
- </xsl:with-param>
- </xsl:call-template>
-
- <xsl:call-template name="PrintGlossaryTerm">
- <xsl:with-param name="code">Key</xsl:with-param>
- <xsl:with-param name="term">Key Constraint</xsl:with-param>
- <xsl:with-param name="description">
- <xsl:text>Like </xsl:text>
- <xsl:call-template name="PrintGlossaryTermRef">
- <xsl:with-param name="code">Unique</xsl:with-param>
- <xsl:with-param name="term">Uniqueness Constraint</xsl:with-param>
- </xsl:call-template>
- <xsl:text>, but additionally requires that the specified value(s) must be provided.</xsl:text>
- </xsl:with-param>
- <xsl:with-param name="link">http://www.w3.org/TR/xmlschema-1/#cIdentity-constraint_Definitions</xsl:with-param>
- </xsl:call-template>
-
- <xsl:call-template name="PrintGlossaryTerm">
- <xsl:with-param name="code">KeyRef</xsl:with-param>
- <xsl:with-param name="term">Key Reference Constraint</xsl:with-param>
- <xsl:with-param name="description">
- <xsl:text>Ensures that the specified value(s) must match value(s) from a </xsl:text>
- <xsl:call-template name="PrintGlossaryTermRef">
- <xsl:with-param name="code">Key</xsl:with-param>
- <xsl:with-param name="term">Key Constraint</xsl:with-param>
- </xsl:call-template>
- <xsl:text> or </xsl:text>
- <xsl:call-template name="PrintGlossaryTermRef">
- <xsl:with-param name="code">Unique</xsl:with-param>
- <xsl:with-param name="term">Uniqueness Constraint</xsl:with-param>
- </xsl:call-template>
- <xsl:text>.</xsl:text>
- </xsl:with-param>
- <xsl:with-param name="link">http://www.w3.org/TR/xmlschema-1/#cIdentity-constraint_Definitions</xsl:with-param>
- </xsl:call-template>
-
- <xsl:call-template name="PrintGlossaryTerm">
- <xsl:with-param name="code">ModelGroup</xsl:with-param>
- <xsl:with-param name="term">Model Group</xsl:with-param>
- <xsl:with-param name="description">
- <xsl:text>Groups together element content, specifying the order in which the element content can occur and the number of times the group of element content may be repeated.</xsl:text>
- </xsl:with-param>
- <xsl:with-param name="link">http://www.w3.org/TR/xmlschema-1/#Model_Groups</xsl:with-param>
- </xsl:call-template>
-
- <xsl:call-template name="PrintGlossaryTerm">
- <xsl:with-param name="code">Nillable</xsl:with-param>
- <xsl:with-param name="term">Nillable</xsl:with-param>
- <xsl:with-param name="description">
- <xsl:text>(Applies to element declarations). </xsl:text>
- <xsl:text>If an element declaration is nillable, instances can use the </xsl:text>
- <code>xsi:nil</code>
- <xsl:text> attribute.</xsl:text>
- <xsl:text> The </xsl:text>
- <code>xsi:nil</code>
- <xsl:text> attribute is the boolean attribute, </xsl:text>
- <em>nil</em>
- <xsl:text>, from the </xsl:text>
- <em>http://www.w3.org/2001/XMLSchema-instance</em>
- <xsl:text> namespace.</xsl:text>
- <xsl:text> If an element instance has an </xsl:text>
- <code>xsi:nil</code>
- <xsl:text> attribute set to true, it can be left empty, even though its element declaration may have required content.</xsl:text>
- </xsl:with-param>
- </xsl:call-template>
-
- <xsl:call-template name="PrintGlossaryTerm">
- <xsl:with-param name="code">Notation</xsl:with-param>
- <xsl:with-param name="term">Notation</xsl:with-param>
- <xsl:with-param name="description">A notation is used to identify the format of a piece of data. Values of elements and attributes that are of type, NOTATION, must come from the names of declared notations.</xsl:with-param>
- <xsl:with-param name="link">http://www.w3.org/TR/xmlschema-1/#cNotation_Declarations</xsl:with-param>
- </xsl:call-template>
-
- <xsl:call-template name="PrintGlossaryTerm">
- <xsl:with-param name="code">PreserveWS</xsl:with-param>
- <xsl:with-param name="term">Preserve Whitespace Policy</xsl:with-param>
- <xsl:with-param name="description">Preserve whitespaces exactly as they appear in instances.</xsl:with-param>
- </xsl:call-template>
-
- <xsl:call-template name="PrintGlossaryTerm">
- <xsl:with-param name="code">TypeFinal</xsl:with-param>
- <xsl:with-param name="term">Prohibited Derivations</xsl:with-param>
- <xsl:with-param name="description">
- <xsl:text>(Applies to type definitions). </xsl:text>
- <xsl:text>Derivation methods that cannot be used to create sub-types from a given type definition.</xsl:text>
- </xsl:with-param>
- </xsl:call-template>
-
- <xsl:call-template name="PrintGlossaryTerm">
- <xsl:with-param name="code">TypeBlock</xsl:with-param>
- <xsl:with-param name="term">Prohibited Substitutions</xsl:with-param>
- <xsl:with-param name="description">
- <xsl:text>(Applies to complex type definitions). </xsl:text>
- <xsl:text>Prevents sub-types that have been derived using the specified derivation methods from validating element instances in place of the given type definition.</xsl:text>
- </xsl:with-param>
- </xsl:call-template>
-
- <xsl:call-template name="PrintGlossaryTerm">
- <xsl:with-param name="code">ReplaceWS</xsl:with-param>
- <xsl:with-param name="term">Replace Whitespace Policy</xsl:with-param>
- <xsl:with-param name="description">Replace tab, line feed, and carriage return characters with space character (Unicode character 32).</xsl:with-param>
- </xsl:call-template>
-
- <xsl:call-template name="PrintGlossaryTerm">
- <xsl:with-param name="code">Sequence</xsl:with-param>
- <xsl:with-param name="term">Sequence Model Group</xsl:with-param>
- <xsl:with-param name="description">
- <xsl:text>Child elements and model groups must be provided </xsl:text>
- <em>
- <xsl:text>in the specified order</xsl:text>
- </em>
- <xsl:text> in instances.</xsl:text>
- </xsl:with-param>
- <xsl:with-param name="link">http://www.w3.org/TR/xmlschema-1/#element-sequence</xsl:with-param>
- </xsl:call-template>
-
- <xsl:call-template name="PrintGlossaryTerm">
- <xsl:with-param name="code">SubGroup</xsl:with-param>
- <xsl:with-param name="term">Substitution Group</xsl:with-param>
- <xsl:with-param name="description">
- <xsl:text>Elements that are </xsl:text>
- <em>
- <xsl:text>members</xsl:text>
- </em>
- <xsl:text> of a substitution group can be used wherever the </xsl:text>
- <em>
- <xsl:text>head</xsl:text>
- </em>
- <xsl:text> element of the substitution group is referenced.</xsl:text>
- </xsl:with-param>
- </xsl:call-template>
-
- <xsl:call-template name="PrintGlossaryTerm">
- <xsl:with-param name="code">ElemFinal</xsl:with-param>
- <xsl:with-param name="term">Substitution Group Exclusions</xsl:with-param>
- <xsl:with-param name="description">
- <xsl:text>(Applies to element declarations). </xsl:text>
- <xsl:text>Prohibits element declarations from nominating themselves as being able to substitute a given element declaration, if they have types that are derived from the original element's type using the specified derivation methods.</xsl:text>
- </xsl:with-param>
- </xsl:call-template>
-
- <xsl:call-template name="PrintGlossaryTerm">
- <xsl:with-param name="code">TargetNS</xsl:with-param>
- <xsl:with-param name="term">Target Namespace</xsl:with-param>
- <xsl:with-param name="description">The target namespace identifies the namespace that components in this schema belongs to. If no target namespace is provided, then the schema components do not belong to any namespace.</xsl:with-param>
- </xsl:call-template>
-
- <xsl:call-template name="PrintGlossaryTerm">
- <xsl:with-param name="code">Unique</xsl:with-param>
- <xsl:with-param name="term">Uniqueness Constraint</xsl:with-param>
- <xsl:with-param name="description">Ensures uniqueness of an element/attribute value, or a combination of values, within a specified scope.</xsl:with-param>
- <xsl:with-param name="link">http://www.w3.org/TR/xmlschema-1/#cIdentity-constraint_Definitions</xsl:with-param>
- </xsl:call-template>
- </xsl:template>
-
- <!--
- Prints out a term in the glossary section.
- Param(s):
- code (String) required
- Unique ID of glossary term
- term (String) required
- Glossary term
- description (Result Tree Fragment) required
- Meaning of term; may contain HTML tags and links
- link (String) optional
- URI containing more info about term
- -->
- <xsl:template name="PrintGlossaryTerm">
- <xsl:param name="code"/>
- <xsl:param name="term"/>
- <xsl:param name="description"/>
- <xsl:param name="link"/>
-
- <p>
- <span class="glossaryTerm">
- <a name="{concat($TERM_PREFIX, $code)}"><xsl:value-of select="$term"/></a>
- <xsl:text> </xsl:text>
- </span>
- <xsl:copy-of select="$description"/>
- <xsl:if test="$link != ''">
- <xsl:text> See: </xsl:text>
- <xsl:call-template name="PrintURI">
- <xsl:with-param name="uri" select="$link"/>
- </xsl:call-template>
- <xsl:text>.</xsl:text>
- </xsl:if>
- </p>
- </xsl:template>
-
-
- <!-- ******** Hierarchy table ******** -->
-
- <!--
- Prints out substitution group hierarchy for
- element declarations.
- -->
- <xsl:template match="xsd:element" mode="hierarchy">
- <!--
- Find out members of substitution group that this element
- heads.
- -->
- <xsl:variable name="members">
- <ul>
- <xsl:call-template name="PrintSGroupMembers">
- <xsl:with-param name="element" select="."/>
- </xsl:call-template>
- </ul>
- </xsl:variable>
- <xsl:variable name="hasMembers">
- <xsl:if test="normalize-space($members)!=''">
- <xsl:text>true</xsl:text>
- </xsl:if>
- </xsl:variable>
- <!-- Print hierarchy table -->
- <xsl:if test="@substitutionGroup or normalize-space($hasMembers)='true'">
- <table class="hierarchy">
- <tr>
- <td>
- <ul>
- <!-- Print substitution group that this element belongs to -->
- <xsl:if test="@substitutionGroup">
- <li>
- <em>This element can be used wherever the following element is referenced:</em>
- <ul>
- <li>
- <xsl:call-template name="PrintElementRef">
- <xsl:with-param name="ref" select="@substitutionGroup"/>
- </xsl:call-template>
- </li>
- </ul>
- </li>
- </xsl:if>
- <!-- Print substitution group that this element heads -->
- <xsl:if test="normalize-space($hasMembers)='true'">
- <li>
- <em>The following elements can be used wherever this element is referenced:</em>
- <xsl:copy-of select="$members"/>
- </li>
- </xsl:if>
- </ul>
- </td>
- </tr>
- </table>
- </xsl:if>
- </xsl:template>
-
- <!--
- Prints out Hierarchy table for complex type definitions.
- -->
- <xsl:template match="xsd:complexType" mode="hierarchy">
- <table class="hierarchy">
- <!-- Print super types -->
- <tr>
- <th>
- <xsl:choose>
- <xsl:when test="normalize-space(translate($printAllSuperTypes, 'TRUE', 'true'))='true'">
- <xsl:text>Super-types:</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>Parent type:</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </th>
- <td>
- <xsl:choose>
- <xsl:when test="xsd:simpleContent or xsd:complexContent">
- <xsl:call-template name="PrintSupertypes">
- <xsl:with-param name="type" select="."/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>None</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- <!-- Print sub types -->
- <tr>
- <th>
- <xsl:choose>
- <xsl:when test="normalize-space(translate($printAllSubTypes, 'TRUE', 'true'))='true'">
- <xsl:text>Sub-types:</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>Direct sub-types:</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </th>
- <td>
- <xsl:call-template name="PrintComplexSubtypes">
- <xsl:with-param name="type" select="."/>
- </xsl:call-template>
- </td>
- </tr>
- </table>
- </xsl:template>
-
- <!--
- Prints out Hierarchy table for simple type definitions.
- -->
- <xsl:template match="xsd:simpleType" mode="hierarchy">
- <table class="hierarchy">
- <!-- Print super types -->
- <tr>
- <th>
- <xsl:choose>
- <xsl:when test="normalize-space(translate($printAllSuperTypes, 'TRUE', 'true'))='true'">
- <xsl:text>Super-types:</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>Parent type:</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </th>
- <td>
- <xsl:choose>
- <xsl:when test="xsd:restriction">
- <xsl:call-template name="PrintSupertypes">
- <xsl:with-param name="type" select="."/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>None</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- <!-- Print sub types -->
- <tr>
- <th>
- <xsl:choose>
- <xsl:when test="normalize-space(translate($printAllSubTypes, 'TRUE', 'true'))='true'">
- <xsl:text>Sub-types:</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>Direct sub-types:</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </th>
- <td>
- <xsl:call-template name="PrintSimpleSubtypes">
- <xsl:with-param name="type" select="."/>
- </xsl:call-template>
- </td>
- </tr>
- </table>
- </xsl:template>
-
- <!--
- Unmatched template for 'hierarchy' mode
- -->
- <xsl:template match="*" mode="hierarchy"/>
-
- <!--
- Prints out members, if any, of the substitution group that a
- given element declaration heads.
- Assumes it will be called within XHTML <ul> tags.
- Param(s):
- element (Node) required
- Top-level element declaration
- elementList (String) optional
- List of elements in this call chain. Name of element starts
- with '*', and ends with '+'. (Used to prevent infinite
- recursive loop.)
- -->
- <xsl:template name="PrintSGroupMembers">
- <xsl:param name="element"/>
- <xsl:param name="elementList"/>
-
- <xsl:variable name="elemName" select="normalize-space($element/@name)"/>
- <xsl:choose>
- <xsl:when test="contains($elementList, concat('*', $elemName, '+'))">
- <!-- Circular element substitution group hierarchy -->
- <li>
- <xsl:call-template name="HandleError">
- <xsl:with-param name="isTerminating">false</xsl:with-param>
- <xsl:with-param name="errorMsg">
- <xsl:text>Circular element reference to: </xsl:text>
- <xsl:value-of select="$elemName"/>
- </xsl:with-param>
- </xsl:call-template>
- </li>
- </xsl:when>
- <xsl:otherwise>
- <!-- Get 'block' attribute. -->
- <xsl:variable name="block">
- <xsl:call-template name="PrintBlockSet">
- <xsl:with-param name="EBV">
- <xsl:choose>
- <xsl:when test="$element/@block">
- <xsl:value-of select="$element/@block"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/xsd:schema/@blockDefault"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:for-each select="/xsd:schema/xsd:element[normalize-space(@substitutionGroup)=$elemName or normalize-space(substring-after(@substitutionGroup, ':'))=$elemName]">
- <li>
- <xsl:call-template name="PrintElementRef">
- <xsl:with-param name="name" select="@name"/>
- </xsl:call-template>
- </li>
- <!-- Recursively find members of a substitution group that
- current element in list might head, since substitution
- groups are transitive (unless 'substitution' is
- blocked).
- -->
- <xsl:if test="not(contains($block, 'substitution'))">
- <xsl:call-template name="PrintSGroupMembers">
- <xsl:with-param name="element" select="."/>
- <xsl:with-param name="elementList" select="concat($elementList, '*', $elemName, '+')"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Prints out the super types of a given type definition.
- Param(s):
- type (Node) required
- Type definition
- isCallingType (boolean) optional
- If true, 'type' is the type definition that starts
- this call. Otherwise, this is a recursive call from
- 'PrintSupertypes' itself.
- typeList (String) optional
- List of types in this call chain. Name of type starts
- with '*', and ends with '+'. (Used to prevent infinite
- recursive loop.)
- -->
- <xsl:template name="PrintSupertypes">
- <xsl:param name="type"/>
- <xsl:param name="isCallingType">true</xsl:param>
- <xsl:param name="typeList"/>
-
- <xsl:variable name="typeName" select="$type/@name"/>
- <xsl:choose>
- <!-- Circular type hierarchy -->
- <xsl:when test="contains($typeList, concat('*', $typeName, '+'))">
- <!-- Note: Error message will be written out in the Sample Instance table. -->
- <xsl:value-of select="$typeName"/>
- </xsl:when>
- <xsl:otherwise>
- <!-- Get base type reference -->
- <xsl:variable name="baseTypeRef">
- <xsl:choose>
- <!-- Complex type definition -->
- <xsl:when test="local-name($type)='complexType'">
- <xsl:choose>
- <xsl:when test="$type/xsd:simpleContent/xsd:extension">
- <xsl:value-of select="$type/xsd:simpleContent/xsd:extension/@base"/>
- </xsl:when>
- <xsl:when test="$type/xsd:simpleContent/xsd:restriction">
- <xsl:value-of select="$type/xsd:simpleContent/xsd:restriction/@base"/>
- </xsl:when>
- <xsl:when test="$type/xsd:complexContent/xsd:extension">
- <xsl:value-of select="$type/xsd:complexContent/xsd:extension/@base"/>
- </xsl:when>
- <xsl:when test="$type/xsd:complexContent/xsd:restriction">
- <xsl:value-of select="$type/xsd:complexContent/xsd:restriction/@base"/>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- <!-- Simple type definition -->
- <xsl:when test="local-name($type)='simpleType'">
- <xsl:choose>
- <xsl:when test="$type/xsd:restriction/@base">
- <xsl:value-of select="$type/xsd:restriction/@base"/>
- </xsl:when>
- <xsl:when test="$type/xsd:restriction/xsd:simpleType">
- <xsl:text>Local type definition</xsl:text>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
-
- <!-- Get derivation method -->
- <xsl:variable name="derive">
- <!-- Complex type definition -->
- <xsl:choose>
- <xsl:when test="local-name($type)='complexType'">
- <xsl:choose>
- <xsl:when test="$type/xsd:simpleContent/xsd:extension or $type/xsd:complexContent/xsd:extension">
- <xsl:text>extension</xsl:text>
- </xsl:when>
- <xsl:when test="$type/xsd:simpleContent/xsd:restriction or $type/xsd:complexContent/xsd:restriction">
- <xsl:text>restriction</xsl:text>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- <!-- Simple type definition -->
- <xsl:when test="local-name($type)='simpleType'">
- <xsl:text>restriction</xsl:text>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:choose>
- <!-- Print out entire hierarchy -->
- <xsl:when test="normalize-space(translate($printAllSuperTypes, 'TRUE', 'true'))='true'">
- <xsl:choose>
- <xsl:when test="normalize-space($baseTypeRef)='Local type definition'">
- <xsl:value-of select="$baseTypeRef"/>
- <!-- Symbol to indicate type derivation-->
- <xsl:text> &lt; </xsl:text>
- </xsl:when>
- <xsl:when test="normalize-space($baseTypeRef)!=''">
- <!-- Get base type name from reference -->
- <xsl:variable name="baseTypeName">
- <xsl:call-template name="GetRefName">
- <xsl:with-param name="ref" select="$baseTypeRef"/>
- </xsl:call-template>
- </xsl:variable>
- <!-- Get base type definition from schema -->
- <xsl:variable name="baseType" select="key('type', $baseTypeName)"/>
- <xsl:choose>
- <!-- Base type was found in this schema -->
- <xsl:when test="$baseType">
- <!-- Make recursive call to print out base type and itself -->
- <xsl:call-template name="PrintSupertypes">
- <xsl:with-param name="type" select="$baseType"/>
- <xsl:with-param name="isCallingType">false</xsl:with-param>
- <xsl:with-param name="typeList" select="concat($typeList, '*', $typeName, '+')"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Base type was not found in this schema -->
- <xsl:otherwise>
- <xsl:call-template name="PrintTypeRef">
- <xsl:with-param name="ref" select="$baseTypeRef"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <!-- Symbol to indicate type derivation -->
- <xsl:text> &lt; </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <!-- IGNORE: Base type may not be exist probably because
- current type does not be derived from another type.
- -->
- </xsl:otherwise>
- </xsl:choose>
- <!-- Print out current type's name -->
- <xsl:choose>
- <xsl:when test="$isCallingType='true'">
- <strong><xsl:value-of select="$typeName"/></strong>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="PrintTypeRef">
- <xsl:with-param name="name" select="$typeName"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <!-- Print out derivation method -->
- <xsl:if test="$derive != ''">
- <xsl:text> (by </xsl:text>
- <xsl:value-of select="$derive"/>
- <xsl:text>)</xsl:text>
- </xsl:if>
- </xsl:when>
- <!-- Print out parent type only -->
- <xsl:otherwise>
- <!-- Print out base type reference -->
- <xsl:choose>
- <xsl:when test="normalize-space($baseTypeRef)='Local type definition'">
- <xsl:value-of select="$baseTypeRef"/>
- </xsl:when>
- <xsl:when test="$baseTypeRef!=''">
- <xsl:call-template name="PrintTypeRef">
- <xsl:with-param name="ref" select="$baseTypeRef"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <!-- IGNORE: Base type may not be exist probably because
- current type does not be derived from another type.
- -->
- </xsl:otherwise>
- </xsl:choose>
- <!-- Print out derivation method -->
- <xsl:if test="$derive != ''">
- <xsl:text> (derivation method: </xsl:text>
- <xsl:value-of select="$derive"/>
- <xsl:text>)</xsl:text>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Prints out the sub types of a given complex type definition.
- Param(s):
- type (Node) required
- Complex type definition
- isCallingType (boolean) optional
- If true, 'type' is the type definition that starts this
- call. Otherwise, this is a recursive call from
- 'PrintComplexSubtypes' itself.
- typeList (String) optional
- List of types in this call chain. Name of type starts
- with '*', and ends with '+'. (Used to prevent infinite
- recursive loop.)
- -->
- <xsl:template name="PrintComplexSubtypes">
- <xsl:param name="type"/>
- <xsl:param name="isCallingType">true</xsl:param>
- <xsl:param name="typeList"/>
-
- <xsl:variable name="typeName" select="normalize-space($type/@name)"/>
- <xsl:choose>
- <!-- Circular type hierarchy -->
- <xsl:when test="contains($typeList, concat('*', $typeName, '+'))">
- <!-- Do nothing. Note: Error message will be written out in the Sample Instance table. -->
- </xsl:when>
- <xsl:otherwise>
- <!-- Find sub types -->
- <xsl:variable name="subTypes">
- <ul>
- <xsl:for-each select="/xsd:schema/xsd:complexType/xsd:complexContent/xsd:restriction[normalize-space(@base)=$typeName or normalize-space(substring-after(@base, ':'))=$typeName] | /xsd:schema/xsd:complexType/xsd:complexContent/xsd:extension[normalize-space(@base)=$typeName or normalize-space(substring-after(@base, ':'))=$typeName]">
- <li>
- <xsl:variable name="subType" select="../.."/>
- <!-- Write out type name -->
- <xsl:call-template name="PrintTypeRef">
- <xsl:with-param name="name" select="$subType/@name"/>
- </xsl:call-template>
- <!-- Write derivation method -->
- <xsl:text> (by </xsl:text>
- <xsl:value-of select="local-name(.)"/>
- <xsl:text>)</xsl:text>
- <!-- Make recursive call to write sub-types of this sub-type -->
- <xsl:if test="normalize-space(translate($printAllSubTypes, 'TRUE', 'true'))='true'">
- <xsl:call-template name="PrintComplexSubtypes">
- <xsl:with-param name="type" select="$subType"/>
- <xsl:with-param name="isCallingType">false</xsl:with-param>
- <xsl:with-param name="typeList" select="concat($typeList, '*', $typeName, '+')"/>
- </xsl:call-template>
- </xsl:if>
- </li>
- </xsl:for-each>
- </ul>
- </xsl:variable>
- <!-- Print out sub types -->
- <xsl:choose>
- <xsl:when test="normalize-space($subTypes)!=''">
- <xsl:copy-of select="$subTypes"/>
- </xsl:when>
- <xsl:when test="$isCallingType='true'">
- <xsl:text>None</xsl:text>
- </xsl:when>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Prints out the sub types of a given simple type definition.
- Param(s):
- type (Node) required
- Simple type definition
- isCallingType (boolean) optional
- If true, 'type' is the type definition that starts this
- call. Otherwise, this is a recursive call from
- 'PrintSimpleSubtypes'
- typeList (String) optional
- List of types in this call chain. Name of type starts
- with '*', and ends with '+'. (Used to prevent infinite
- recursive loop.)
- -->
- <xsl:template name="PrintSimpleSubtypes">
- <xsl:param name="type"/>
- <xsl:param name="isCallingType">true</xsl:param>
- <xsl:param name="typeList"/>
-
- <xsl:variable name="typeName" select="normalize-space($type/@name)"/>
- <xsl:choose>
- <!-- Circular type hierarchy -->
- <xsl:when test="contains($typeList, concat('*', $typeName, '+'))">
- <!-- Do nothing. Note: Error message will be written out in the Sample Instance table. -->
- </xsl:when>
- <xsl:otherwise>
- <!-- Find sub-types that are simple type definitions -->
- <xsl:variable name="simpleSubTypes">
- <ul>
- <xsl:for-each select="/xsd:schema/xsd:simpleType/xsd:restriction[normalize-space(@base)=$typeName or normalize-space(substring-after(@base, ':'))=$typeName]">
- <li>
- <xsl:variable name="subType" select=".."/>
- <!-- Write out type name -->
- <xsl:call-template name="PrintTypeRef">
- <xsl:with-param name="name" select="$subType/@name"/>
- </xsl:call-template>
- <!-- Write derivation method -->
- <xsl:text> (by restriction)</xsl:text>
- <!-- Make recursive call to write sub-types of this sub-type -->
- <xsl:if test="normalize-space(translate($printAllSubTypes, 'TRUE', 'true'))='true'">
- <xsl:call-template name="PrintSimpleSubtypes">
- <xsl:with-param name="type" select="$subType"/>
- <xsl:with-param name="isCallingType">false</xsl:with-param>
- <xsl:with-param name="typeList" select="concat($typeList, '*', $typeName, '+')"/>
- </xsl:call-template>
- </xsl:if>
- </li>
- </xsl:for-each>
- </ul>
- </xsl:variable>
- <!-- Find sub-types that are complex type definitions -->
- <xsl:variable name="complexSubTypes">
- <ul>
- <xsl:for-each select="/xsd:schema/xsd:complexType/xsd:simpleContent/xsd:restriction[normalize-space(@base)=$typeName or normalize-space(substring-after(@base, ':'))=$typeName] | /xsd:schema/xsd:complexType/xsd:simpleContent/xsd:extension[normalize-space(@base)=$typeName or normalize-space(substring-after(@base, ':'))=$typeName]">
- <li>
- <xsl:variable name="subType" select="../.."/>
- <!-- Write out type name -->
- <xsl:call-template name="PrintTypeRef">
- <xsl:with-param name="name" select="$subType/@name"/>
- </xsl:call-template>
- <!-- Write derivation method -->
- <xsl:text> (by </xsl:text>
- <xsl:value-of select="local-name(.)"/>
- <xsl:text>)</xsl:text>
- <!-- Make recursive call to write sub-types of this sub-type -->
- <xsl:if test="normalize-space(translate($printAllSubTypes, 'TRUE', 'true'))='true'">
- <xsl:call-template name="PrintComplexSubtypes">
- <xsl:with-param name="type" select="$subType"/>
- <xsl:with-param name="isCallingType">false</xsl:with-param>
- <xsl:with-param name="typeList" select="concat($typeList, '*', $typeName, '+')"/>
- </xsl:call-template>
- </xsl:if>
- </li>
- </xsl:for-each>
- </ul>
- </xsl:variable>
-
- <xsl:variable name="hasSimpleSubTypes">
- <xsl:if test="normalize-space($simpleSubTypes)!=''">
- <xsl:text>true</xsl:text>
- </xsl:if>
- </xsl:variable>
- <xsl:variable name="hasComplexSubTypes">
- <xsl:if test="normalize-space($complexSubTypes)!=''">
- <xsl:text>true</xsl:text>
- </xsl:if>
- </xsl:variable>
- <!-- Print out sub types -->
- <xsl:choose>
- <xsl:when test="$hasSimpleSubTypes='true' or $hasComplexSubTypes='true'">
- <xsl:if test="$hasSimpleSubTypes='true'">
- <xsl:copy-of select="$simpleSubTypes"/>
- </xsl:if>
- <xsl:if test="$hasComplexSubTypes='true'">
- <xsl:copy-of select="$complexSubTypes"/>
- </xsl:if>
- </xsl:when>
- <xsl:when test="$isCallingType='true'">
- <xsl:text>None</xsl:text>
- </xsl:when>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <!-- ******** Properties table ******** -->
-
- <!--
- Prints out the contents of an 'appinfo' or a 'documentation'
- element in the Properties table.
- -->
- <xsl:template match="xsd:appinfo | xsd:documentation" mode="properties">
- <!-- Print out children using XML pretty printer templates -->
- <xsl:choose>
- <xsl:when test="local-name(.)='appinfo'">
- <xsl:apply-templates select="* | text()" mode="xpp"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="* | text()" mode="html"/>
- </xsl:otherwise>
- </xsl:choose>
-
- <!-- Print out URL in the source attribute. -->
- <xsl:if test="@source">
- <xsl:if test="* | text()"><br/></xsl:if>
- <xsl:text> More information at: </xsl:text>
- <xsl:call-template name="PrintURI">
- <xsl:with-param name="uri" select="@source"/>
- </xsl:call-template>
- <xsl:text>.</xsl:text>
- </xsl:if>
- </xsl:template>
-
- <!--
- Prints out the Properties table for a top-level
- attribute declaration.
- -->
- <xsl:template match="xsd:attribute" mode="properties">
- <table class="properties">
- <!-- Name -->
- <tr>
- <th>Name</th>
- <td><xsl:value-of select="@name"/></td>
- </tr>
- <!-- Type -->
- <tr>
- <th>Type</th>
- <td>
- <xsl:choose>
- <xsl:when test="xsd:simpleType">
- <xsl:text>Locally-defined simple type</xsl:text>
- </xsl:when>
- <xsl:when test="@type">
- <xsl:call-template name="PrintTypeRef">
- <xsl:with-param name="ref" select="@type"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>anySimpleType</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- <!-- Default Value -->
- <xsl:if test="@default">
- <tr>
- <th>Default Value</th>
- <td><xsl:value-of select="@default"/></td>
- </tr>
- </xsl:if>
- <!-- Fixed Value -->
- <xsl:if test="@fixed">
- <tr>
- <th>Fixed Value</th>
- <td><xsl:value-of select="@fixed"/></td>
- </tr>
- </xsl:if>
- <!-- Annotation -->
- <xsl:call-template name="PrintAnnotation">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
- </table>
- </xsl:template>
-
- <!--
- Prints out Properties table for a top-level
- attribute group or model group definition.
- -->
- <xsl:template match="xsd:attributeGroup | xsd:group" mode="properties">
- <table class="properties">
- <!-- Name -->
- <tr>
- <th>Name</th>
- <td><xsl:value-of select="@name"/></td>
- </tr>
- <!-- Annotation -->
- <xsl:call-template name="PrintAnnotation">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
- </table>
- </xsl:template>
-
- <!--
- Prints out the Properties table for a top-level
- complex type definition.
- -->
- <xsl:template match="xsd:complexType" mode="properties">
- <table class="properties">
- <!-- Name -->
- <tr>
- <th>Name</th>
- <td><xsl:value-of select="@name"/></td>
- </tr>
- <!-- Abstract -->
- <tr>
- <th>
- <xsl:call-template name="PrintGlossaryTermRef">
- <xsl:with-param name="code">Abstract</xsl:with-param>
- <xsl:with-param name="term">Abstract</xsl:with-param>
- </xsl:call-template>
- </th>
- <td>
- <xsl:call-template name="PrintBoolean">
- <xsl:with-param name="boolean" select="@abstract"/>
- </xsl:call-template>
- </td>
- </tr>
- <!-- Final -->
- <xsl:variable name="final">
- <xsl:call-template name="PrintDerivationSet">
- <xsl:with-param name="EBV">
- <xsl:choose>
- <xsl:when test="@final">
- <xsl:value-of select="@final"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/xsd:schema/@finalDefault"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="normalize-space($final)!=''">
- <tr>
- <th>
- <xsl:call-template name="PrintGlossaryTermRef">
- <xsl:with-param name="code">TypeFinal</xsl:with-param>
- <xsl:with-param name="term">Prohibited Derivations</xsl:with-param>
- </xsl:call-template>
- </th>
- <td><xsl:value-of select="$final"/></td>
- </tr>
- </xsl:if>
- <!-- Block -->
- <xsl:variable name="block">
- <xsl:call-template name="PrintDerivationSet">
- <xsl:with-param name="EBV">
- <xsl:choose>
- <xsl:when test="@block">
- <xsl:value-of select="@block"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/xsd:schema/@blockDefault"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="normalize-space($block)!=''">
- <tr>
- <th>
- <xsl:call-template name="PrintGlossaryTermRef">
- <xsl:with-param name="code">TypeBlock</xsl:with-param>
- <xsl:with-param name="term">Prohibited Substitutions</xsl:with-param>
- </xsl:call-template>
- </th>
- <td><xsl:value-of select="$block"/></td>
- </tr>
- </xsl:if>
- <!-- Annotation -->
- <xsl:call-template name="PrintAnnotation">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
- </table>
- </xsl:template>
-
- <!--
- Prints out the Properties table for a top-level
- element declaration.
- -->
- <xsl:template match="xsd:element" mode="properties">
- <table class="properties">
- <!-- Name -->
- <tr>
- <th>Name</th>
- <td><xsl:value-of select="@name"/></td>
- </tr>
- <!-- Type -->
- <tr>
- <th>Type</th>
- <td>
- <xsl:choose>
- <xsl:when test="xsd:simpleType">
- <xsl:text>Locally-defined simple type</xsl:text>
- </xsl:when>
- <xsl:when test="xsd:complexType">
- <xsl:text>Locally-defined complex type</xsl:text>
- </xsl:when>
- <xsl:when test="@type">
- <xsl:call-template name="PrintTypeRef">
- <xsl:with-param name="ref" select="@type"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>anyType</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- <!-- Nillable -->
- <tr>
- <th>
- <xsl:call-template name="PrintGlossaryTermRef">
- <xsl:with-param name="code">Nillable</xsl:with-param>
- <xsl:with-param name="term">Nillable</xsl:with-param>
- </xsl:call-template>
- </th>
- <td>
- <xsl:call-template name="PrintBoolean">
- <xsl:with-param name="boolean" select="@nillable"/>
- </xsl:call-template>
- </td>
- </tr>
- <!-- Abstract -->
- <tr>
- <th>
- <xsl:call-template name="PrintGlossaryTermRef">
- <xsl:with-param name="code">Abstract</xsl:with-param>
- <xsl:with-param name="term">Abstract</xsl:with-param>
- </xsl:call-template>
- </th>
- <td>
- <xsl:call-template name="PrintBoolean">
- <xsl:with-param name="boolean" select="@abstract"/>
- </xsl:call-template>
- </td>
- </tr>
- <!-- Default Value -->
- <xsl:if test="@default">
- <tr>
- <th>Default Value</th>
- <td><xsl:value-of select="@default"/></td>
- </tr>
- </xsl:if>
- <!-- Fixed Value -->
- <xsl:if test="@fixed">
- <tr>
- <th>Fixed Value</th>
- <td><xsl:value-of select="@fixed"/></td>
- </tr>
- </xsl:if>
- <!-- Final -->
- <xsl:variable name="final">
- <xsl:call-template name="PrintDerivationSet">
- <xsl:with-param name="EBV">
- <xsl:choose>
- <xsl:when test="@final">
- <xsl:value-of select="@final"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/xsd:schema/@finalDefault"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="normalize-space($final)!=''">
- <tr>
- <th>
- <xsl:call-template name="PrintGlossaryTermRef">
- <xsl:with-param name="code">ElemFinal</xsl:with-param>
- <xsl:with-param name="term">Substitution Group Exclusions</xsl:with-param>
- </xsl:call-template>
- </th>
- <td><xsl:value-of select="$final"/></td>
- </tr>
- </xsl:if>
- <!-- Block -->
- <xsl:variable name="block">
- <xsl:call-template name="PrintBlockSet">
- <xsl:with-param name="EBV">
- <xsl:choose>
- <xsl:when test="@block">
- <xsl:value-of select="@block"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/xsd:schema/@blockDefault"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="normalize-space($block)!=''">
- <tr>
- <th>
- <xsl:call-template name="PrintGlossaryTermRef">
- <xsl:with-param name="code">ElemBlock</xsl:with-param>
- <xsl:with-param name="term">Disallowed Substitutions</xsl:with-param>
- </xsl:call-template>
- </th>
- <td><xsl:value-of select="$block"/></td>
- </tr>
- </xsl:if>
- <!-- Annotation -->
- <xsl:call-template name="PrintAnnotation">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
- </table>
- </xsl:template>
-
- <!--
- Prints out the Properties table for a top-level
- notation declaration.
- -->
- <xsl:template match="xsd:notation" mode="properties">
- <table class="properties">
- <!-- Name -->
- <tr>
- <th>Name</th>
- <td><xsl:value-of select="@name"/></td>
- </tr>
- <!-- Public Identifier -->
- <tr>
- <th>Public Identifier</th>
- <td><xsl:value-of select="@public"/></td>
- </tr>
- <!-- System Identifier -->
- <xsl:if test="@system">
- <tr>
- <th>System Identifier</th>
- <td><xsl:value-of select="@system"/></td>
- </tr>
- </xsl:if>
- <!-- Annotation -->
- <xsl:call-template name="PrintAnnotation">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
- </table>
- </xsl:template>
-
- <!--
- Prints out the Properties table for the root
- schema element.
- -->
- <xsl:template match="xsd:schema" mode="properties">
- <table class="properties">
- <!-- Target Namespace -->
- <tr>
- <th>
- <xsl:call-template name="PrintGlossaryTermRef">
- <xsl:with-param name="code">TargetNS</xsl:with-param>
- <xsl:with-param name="term">Target Namespace</xsl:with-param>
- </xsl:call-template>
- </th>
- <td>
- <xsl:choose>
- <xsl:when test="@targetNamespace">
- <span class="targetNS">
- <xsl:value-of select="@targetNamespace"/>
- </span>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>None</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- <!-- Version -->
- <xsl:if test="@version">
- <tr>
- <th>Version</th>
- <td><xsl:value-of select="@version"/></td>
- </tr>
- </xsl:if>
- <!-- Language -->
- <xsl:if test="@xml:lang">
- <tr>
- <th>Language</th>
- <td><xsl:value-of select="@xml:lang"/></td>
- </tr>
- </xsl:if>
- <!-- Element/Attribute Form Defaults -->
- <tr>
- <th>Element and Attribute Namespaces</th>
- <td>
- <ul>
- <li>Global element and attribute declarations belong to this schema's target namespace.</li>
- <li>
- <xsl:choose>
- <xsl:when test="normalize-space(@elementFormDefault)='qualified'">
- <xsl:text>By default, local element declarations belong to this schema's target namespace.</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>By default, local element declarations have no namespace.</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </li>
- <li>
- <xsl:choose>
- <xsl:when test="normalize-space(@attributeFormDefault)='qualified'">
- <xsl:text>By default, local attribute declarations belong to this schema's target namespace.</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>By default, local attribute declarations have no namespace.</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </li>
- </ul>
- </td>
- </tr>
- <!-- Schema Composition, e.g. include, import, redefine -->
- <xsl:if test="xsd:include or xsd:import or xsd:redefine">
- <tr>
- <th>Schema Composition</th>
- <td>
- <ul>
- <!-- Import -->
- <xsl:if test="xsd:import">
- <li>
- <xsl:text>This schema imports schema(s) from the following namespace(s):</xsl:text>
- <ul>
- <xsl:for-each select="xsd:import">
- <li>
- <em><xsl:value-of select="@namespace"/></em>
- <xsl:if test="@schemaLocation">
- <xsl:text> (at </xsl:text>
- <xsl:call-template name="PrintSchemaLink">
- <xsl:with-param name="uri" select="@schemaLocation"/>
- </xsl:call-template>
- <xsl:text>)</xsl:text>
- </xsl:if>
- </li>
- </xsl:for-each>
- </ul>
- </li>
- </xsl:if>
- <!-- Include -->
- <xsl:if test="xsd:include">
- <li>
- <xsl:text>This schema includes components from the following schema document(s):</xsl:text>
- <ul>
- <xsl:for-each select="xsd:include">
- <li>
- <xsl:call-template name="PrintSchemaLink">
- <xsl:with-param name="uri" select="@schemaLocation"/>
- </xsl:call-template>
- </li>
- </xsl:for-each>
- </ul>
- </li>
- </xsl:if>
- <!-- Redefine -->
- <xsl:if test="xsd:redefine">
- <li>
- <xsl:text>This schema includes components from the following schema document(s), where some of the components have been redefined:</xsl:text>
- <ul>
- <xsl:for-each select="xsd:redefine">
- <li>
- <xsl:call-template name="PrintSchemaLink">
- <xsl:with-param name="uri" select="@schemaLocation"/>
- </xsl:call-template>
- </li>
- </xsl:for-each>
- </ul>
- <xsl:text>See </xsl:text><a href="#Redefinitions">Redefined Schema Components</a><xsl:text> section.</xsl:text>
- </li>
- </xsl:if>
- </ul>
- </td>
- </tr>
- </xsl:if>
- <!-- Annotation -->
- <xsl:call-template name="PrintAnnotation">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
- </table>
- </xsl:template>
-
- <!--
- Prints out the Properties table for a top-level
- simple type definition.
- -->
- <xsl:template match="xsd:simpleType" mode="properties">
- <table class="properties">
- <!-- Name -->
- <tr>
- <th>Name</th>
- <td><xsl:value-of select="@name"/></td>
- </tr>
- <!-- Constraints -->
- <tr>
- <th>Content</th>
- <td>
- <xsl:call-template name="PrintSimpleConstraints">
- <xsl:with-param name="simpleContent" select="."/>
- </xsl:call-template>
- </td>
- </tr>
- <!-- Final -->
- <xsl:variable name="final">
- <xsl:call-template name="PrintSimpleDerivationSet">
- <xsl:with-param name="EBV">
- <xsl:choose>
- <xsl:when test="@final">
- <xsl:value-of select="@final"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/xsd:schema/@finalDefault"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="normalize-space($final)!=''">
- <tr>
- <th>
- <xsl:call-template name="PrintGlossaryTermRef">
- <xsl:with-param name="code">TypeFinal</xsl:with-param>
- <xsl:with-param name="term">Prohibited Derivations</xsl:with-param>
- </xsl:call-template>
- </th>
- <td><xsl:value-of select="$final"/></td>
- </tr>
- </xsl:if>
- <!-- Annotation -->
- <xsl:call-template name="PrintAnnotation">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
- </table>
- </xsl:template>
-
- <!--
- Unmatched template for 'properties' mode
- -->
- <xsl:template match="*" mode="properties"/>
-
- <!--
- Prints out the rows to display 'annotation' elements of an
- component in the Properties table. This template assumes it
- will be called within an HTML 'table' element.
- Param(s):
- component (Node) required
- Schema component
- -->
- <xsl:template name="PrintAnnotation">
- <xsl:param name="component"/>
-
- <xsl:if test="$component/xsd:annotation/xsd:documentation">
- <tr>
- <th>Documentation</th>
- <td>
- <xsl:for-each select="$component/xsd:annotation/xsd:documentation">
- <xsl:if test="position()!=1"><br/><br/></xsl:if>
- <xsl:apply-templates select="." mode="properties"/>
- </xsl:for-each>
- </td>
- </tr>
- </xsl:if>
- <xsl:if test="$component/xsd:annotation/xsd:appinfo">
- <tr>
- <th>Application Data</th>
- <td>
- <xsl:for-each select="$component/xsd:annotation/xsd:appinfo">
- <xsl:if test="position()!=1"><br/><br/></xsl:if>
- <xsl:apply-templates select="." mode="properties"/>
- </xsl:for-each>
- </td>
- </tr>
- </xsl:if>
- </xsl:template>
-
- <!--
- Prints out the constraints of simple content
- to be displayed within a Properties table.
- Param(s):
- simpleContent (Node) required
- Node containing the simple content
- typeList (String) optional
- List of types in this call chain. Name of type starts
- with '*', and ends with '+'. (Used to prevent infinite
- recursive loop.)
- -->
- <xsl:template name="PrintSimpleConstraints">
- <xsl:param name="simpleContent"/>
- <xsl:param name="typeList"/>
-
- <xsl:choose>
- <!-- Derivation by restriction -->
- <xsl:when test="$simpleContent/xsd:restriction">
- <xsl:call-template name="PrintSimpleRestriction">
- <xsl:with-param name="restriction" select="$simpleContent/xsd:restriction"/>
- <xsl:with-param name="typeList" select="$typeList"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Derivation by list -->
- <xsl:when test="$simpleContent/xsd:list">
- <ul><li>
- <xsl:text>List of: </xsl:text>
- <xsl:choose>
- <!-- Globally-defined item type -->
- <xsl:when test="$simpleContent/xsd:list/@itemType">
- <xsl:call-template name="PrintTypeRef">
- <xsl:with-param name="ref" select="$simpleContent/xsd:list/@itemType"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Locally-defined item type -->
- <xsl:otherwise>
- <ul>
- <li>
- <xsl:text>Locally defined type:</xsl:text>
- <xsl:call-template name="PrintSimpleConstraints">
- <xsl:with-param name="simpleContent" select="$simpleContent/xsd:list/xsd:simpleType"/>
- <xsl:with-param name="typeList" select="$typeList"/>
- </xsl:call-template>
- </li>
- </ul>
- </xsl:otherwise>
- </xsl:choose>
- </li></ul>
- </xsl:when>
- <!-- Derivation by union -->
- <xsl:when test="$simpleContent/xsd:union">
- <ul><li>
- <xsl:text>Union of following types: </xsl:text>
- <ul>
- <!-- Globally-defined member types -->
- <xsl:if test="$simpleContent/xsd:union/@memberTypes">
- <xsl:call-template name="PrintWhitespaceList">
- <xsl:with-param name="value" select="$simpleContent/xsd:union/@memberTypes"/>
- <xsl:with-param name="compType">type</xsl:with-param>
- <xsl:with-param name="isInList">true</xsl:with-param>
- </xsl:call-template>
- </xsl:if>
- <!-- Locally-defined member types -->
- <xsl:for-each select="$simpleContent/xsd:union/xsd:simpleType">
- <li>
- <xsl:text>Locally defined type:</xsl:text>
- <xsl:call-template name="PrintSimpleConstraints">
- <xsl:with-param name="simpleContent" select="."/>
- <xsl:with-param name="typeList" select="$typeList"/>
- </xsl:call-template>
- </li>
- </xsl:for-each>
- </ul>
- </li></ul>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Prints out the constraints of simple content derived by
- restriction, which is to be displayed in a Properties table.
- Param(s):
- restriction (Node) required
- Node containing the restriction
- typeList (String) optional
- List of types in this call chain. Name of type starts
- with '*', and ends with '+'. (Used to prevent infinite
- recursive loop.)
- -->
- <xsl:template name="PrintSimpleRestriction">
- <xsl:param name="restriction"/>
- <xsl:param name="typeList"/>
-
- <xsl:variable name="typeName" select="$restriction/parent::xsd:simpleType/@name"/>
-
- <!-- Print out base type info -->
- <xsl:choose>
- <!-- Circular type hierarchy -->
- <xsl:when test="$typeName != '' and contains($typeList, concat('*', $typeName, '+'))">
- <li>
- <xsl:call-template name="HandleError">
- <xsl:with-param name="isTerminating">false</xsl:with-param>
- <xsl:with-param name="errorMsg">
- <xsl:text>Circular type reference to '</xsl:text>
- <xsl:value-of select="$typeName"/>
- <xsl:text>' in type hierarchy.</xsl:text>
- </xsl:with-param>
- </xsl:call-template>
- </li>
- </xsl:when>
- <!-- Locally-defined base type -->
- <xsl:when test="$restriction/xsd:simpleType">
- <xsl:call-template name="PrintSimpleConstraints">
- <xsl:with-param name="simpleContent" select="$restriction/xsd:simpleType"/>
- <xsl:with-param name="typeList" select="$typeList"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Base type reference -->
- <xsl:when test="$restriction">
- <xsl:variable name="baseTypeRef" select="$restriction/@base"/>
- <xsl:variable name="baseTypeName">
- <xsl:call-template name="GetRefName">
- <xsl:with-param name="ref" select="$baseTypeRef"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="baseTypeNS">
- <xsl:call-template name="GetRefNS">
- <xsl:with-param name="ref" select="$baseTypeRef"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:choose>
- <!-- Base type is built-in XSD type -->
- <xsl:when test="$baseTypeNS=$XSD_NS">
- <ul><li>
- <xsl:text>Base XSD Type: </xsl:text>
- <xsl:choose>
- <!-- Current schema is the schema for XSDL -->
- <xsl:when test="normalize-space(/xsd:schema/@targetNamespace)=$XSD_NS">
- <xsl:call-template name="PrintTypeRef">
- <xsl:with-param name="ref" select="$baseTypeRef"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Current schema is not XSD namespace -->
- <xsl:otherwise>
- <xsl:value-of select="$baseTypeName"/>
- </xsl:otherwise>
- </xsl:choose>
- </li></ul>
- </xsl:when>
- <!-- Other types -->
- <xsl:otherwise>
- <xsl:variable name="baseType" select="key('simpleType', $baseTypeName)"/>
- <xsl:choose>
- <!-- Base type found -->
- <xsl:when test="$baseType">
- <xsl:call-template name="PrintSimpleConstraints">
- <xsl:with-param name="simpleContent" select="$baseType"/>
- <xsl:with-param name="typeList" select="concat($typeList, '*', $typeName, '+')"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Base type not found -->
- <xsl:otherwise>
- <ul><li><strong>
- <xsl:text>'</xsl:text>
- <xsl:value-of select="$baseTypeName"/>
- <xsl:text>' super type was not found in this schema. </xsl:text>
- <xsl:text>Its facets could not be printed out.</xsl:text>
- </strong></li></ul>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
-
- <!-- Find constraints in current restriction -->
- <xsl:variable name="enumeration">
- <xsl:call-template name="PrintEnumFacets">
- <xsl:with-param name="simpleRestrict" select="$restriction"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="pattern">
- <xsl:call-template name="PrintPatternFacet">
- <xsl:with-param name="simpleRestrict" select="$restriction"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="range">
- <xsl:call-template name="PrintRangeFacets">
- <xsl:with-param name="simpleRestrict" select="$restriction"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="totalDigits">
- <xsl:call-template name="PrintTotalDigitsFacet">
- <xsl:with-param name="simpleRestrict" select="$restriction"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="fractionDigits">
- <xsl:call-template name="PrintFractionDigitsFacet">
- <xsl:with-param name="simpleRestrict" select="$restriction"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="length">
- <xsl:call-template name="PrintLengthFacets">
- <xsl:with-param name="simpleRestrict" select="$restriction"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="whitespace">
- <xsl:call-template name="PrintWhitespaceFacet">
- <xsl:with-param name="simpleRestrict" select="$restriction"/>
- </xsl:call-template>
- </xsl:variable>
-
- <!-- Print out facets -->
- <xsl:if test="$enumeration!='' or $pattern!='' or $range!='' or $totalDigits!='' or $fractionDigits!='' or $length!='' or $whitespace!=''">
- <ul>
- <xsl:if test="$enumeration!=''">
- <li>
- <xsl:copy-of select="$enumeration"/>
- </li>
- </xsl:if>
- <xsl:if test="$pattern!=''">
- <li>
- <xsl:copy-of select="$pattern"/>
- </li>
- </xsl:if>
- <xsl:if test="$range!=''">
- <li>
- <xsl:copy-of select="$range"/>
- </li>
- </xsl:if>
- <xsl:if test="$totalDigits!=''">
- <li>
- <xsl:copy-of select="$totalDigits"/>
- </li>
- </xsl:if>
- <xsl:if test="$fractionDigits!=''">
- <li>
- <xsl:copy-of select="$fractionDigits"/>
- </li>
- </xsl:if>
- <xsl:if test="$length!=''">
- <li>
- <xsl:copy-of select="$length"/>
- </li>
- </xsl:if>
- <xsl:if test="$whitespace!=''">
- <li>
- <xsl:copy-of select="$whitespace"/>
- </li>
- </xsl:if>
- </ul>
- </xsl:if>
- </xsl:template>
-
-
- <!-- ******** XML Instance Representation table ******** -->
-
- <!--
- Prints out the XML Instance Representation table for a top-level
- schema component.
- Param(s):
- component (Node) required
- Top-level schema component
- -->
- <xsl:template name="SampleInstanceTable">
- <xsl:param name="component"/>
-
- <!-- Not applicable for simple type definitions and notation
- declarations -->
- <xsl:if test="local-name($component)!='simpleType' and local-name($component)!='notation'">
- <xsl:variable name="componentID">
- <xsl:call-template name="GetComponentID">
- <xsl:with-param name="component" select="$component"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:call-template name="CollapseableBox">
- <xsl:with-param name="id" select="concat($componentID, '_xibox')"/>
- <xsl:with-param name="styleClass">sample</xsl:with-param>
- <xsl:with-param name="caption">XML Instance Representation</xsl:with-param>
- <xsl:with-param name="contents">
- <xsl:apply-templates select="$component" mode="sample"/>
- </xsl:with-param>
- <xsl:with-param name="isOpened">true</xsl:with-param>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
-
- <!--
- Prints out a sample XML instance representation of an 'all'
- model group.
- Param(s):
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- isInherited (boolean) optional
- If true, display elements using 'inherited' CSS class.
- isNewField (boolean) optional
- If true, display elements using 'newFields' CSS class.
- schemaLoc (String) optional
- Schema file containing this all model group;
- if in current schema, 'schemaLoc' is set to 'this'
- typeList (String) optional
- List of types in this call chain. Name of type starts
- with '*', and ends with '+'. (Used to prevent infinite
- recursive loop.)
- -->
- <xsl:template match="xsd:all" mode="sample">
- <xsl:param name="margin">0</xsl:param>
- <xsl:param name="isInherited">false</xsl:param>
- <xsl:param name="isNewField">false</xsl:param>
- <xsl:param name="schemaLoc">this</xsl:param>
- <xsl:param name="typeList"/>
-
- <xsl:if test="normalize-space(@maxOccurs)!='0'">
- <!-- Header -->
- <span class="group" style="margin-left: {$margin}em">
- <xsl:text>Start </xsl:text>
- <xsl:call-template name="PrintGlossaryTermRef">
- <xsl:with-param name="code">All</xsl:with-param>
- <xsl:with-param name="term">All</xsl:with-param>
- </xsl:call-template>
- <!-- Min/max occurs information-->
- <xsl:text> </xsl:text>
- <xsl:call-template name="PrintOccurs">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
- <!-- Documentation -->
- <xsl:call-template name="PrintSampleDocumentation">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
- </span><br/>
-
- <!-- Content -->
- <xsl:apply-templates select="xsd:*" mode="sample">
- <xsl:with-param name="margin" select="number($margin) + number($ELEM_INDENT)"/>
- <xsl:with-param name="isInherited" select="$isInherited"/>
- <xsl:with-param name="isNewField" select="$isNewField"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- <xsl:with-param name="typeList" select="$typeList"/>
- </xsl:apply-templates>
-
- <!-- Footer -->
- <span class="group" style="margin-left: {$margin}em">
- <xsl:text>End All</xsl:text>
- </span><br/>
- </xsl:if>
- </xsl:template>
-
- <!--
- Prints out a sample XML instance representation of an element
- content wild card.
- Param(s):
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- -->
- <xsl:template match="xsd:any | xsd:anyAttribute" mode="sample">
- <xsl:param name="margin">0</xsl:param>
-
- <div class="other" style="margin-left: {$margin}em">
- <xsl:call-template name="PrintWildcard">
- <xsl:with-param name="componentType">
- <xsl:choose>
- <xsl:when test="local-name(.)='anyAttribute'">attribute</xsl:when>
- <xsl:otherwise>element</xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="namespace" select="@namespace"/>
- <xsl:with-param name="processContents" select="@processContents"/>
- <xsl:with-param name="minOccurs" select="@minOccurs"/>
- <xsl:with-param name="maxOccurs" select="@maxOccurs"/>
- </xsl:call-template>
- </div>
- </xsl:template>
-
- <!--
- Prints out a sample XML instance representation
- of an attribute declaration.
- Param(s):
- subTypeAttrs (String) optional
- List of attributes in sub-types of the type that
- contains this attribute
- isInherited (boolean) optional
- If true, display attribute using 'inherited' CSS
- class.
- isNewField (boolean) optional
- If true, display attribute using 'newFields' CSS
- class.
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- addBR (boolean) optional
- If true, add <br/> before attribute.
- schemaLoc (String) optional
- Schema file containing this attribute declaration;
- if in current schema, 'schemaLoc' is set to 'this'.
- -->
- <xsl:template match="xsd:attribute[@name]" mode="sample">
- <xsl:param name="subTypeAttrs"/>
- <xsl:param name="isInherited">false</xsl:param>
- <xsl:param name="isNewField">false</xsl:param>
- <xsl:param name="margin">0</xsl:param>
- <xsl:param name="addBR">false</xsl:param>
- <xsl:param name="schemaLoc">this</xsl:param>
-
- <!-- Get attribute namespace -->
- <xsl:variable name="attrNS">
- <xsl:call-template name="GetAttributeNS">
- <xsl:with-param name="attribute" select="."/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="contains($subTypeAttrs, concat('*', normalize-space($attrNS), '+', normalize-space(@name), '+'))">
- <!-- IGNORE: Sub type has attribute with same name;
- Sub-type's attribute declaration will override this
- one. -->
- </xsl:when>
- <xsl:when test="@use and normalize-space(@use)='prohibited'">
- <!-- IGNORE: Attribute is prohibited. -->
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$addBR!='false'"><br/></xsl:if>
-
- <span style="margin-left: {$margin}em">
- <xsl:choose>
- <xsl:when test="$isNewField!='false'">
- <xsl:attribute name="class">newFields</xsl:attribute>
- </xsl:when>
- <xsl:when test="$isInherited!='false'">
- <xsl:attribute name="class">inherited</xsl:attribute>
- </xsl:when>
- </xsl:choose>
-
- <xsl:text> </xsl:text>
- <xsl:variable name="prefix">
- <xsl:call-template name="GetAttributePrefix">
- <xsl:with-param name="attribute" select="."/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:call-template name="PrintNSPrefix">
- <xsl:with-param name="prefix" select="$prefix"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- <xsl:value-of select="@name"/>
- <xsl:text>="</xsl:text>
-
- <xsl:choose>
- <!-- Fixed value is provided -->
- <xsl:when test="@fixed">
- <span class="fixed">
- <xsl:value-of select="@fixed"/>
- </span>
- </xsl:when>
- <!-- Type reference is provided -->
- <xsl:when test="@type">
- <xsl:call-template name="PrintTypeRef">
- <xsl:with-param name="ref" select="@type"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Local type definition is provided -->
- <xsl:when test="xsd:simpleType">
- <xsl:apply-templates select="xsd:simpleType" mode="sample">
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <span class="type">anySimpleType</span>
- </xsl:otherwise>
- </xsl:choose>
-
- <!-- Don't print occurrence info and documentation
- for global attributes. -->
- <xsl:if test="local-name(..)!='schema'">
- <!-- Occurrence info-->
- <xsl:text> </xsl:text>
- <xsl:call-template name="PrintOccurs">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
- <!-- Documentation -->
- <xsl:call-template name="PrintSampleDocumentation">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
- </xsl:if>
-
- <xsl:text>"</xsl:text>
- </span>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Prints out a sample XML instance representation
- of an attribute reference.
- Param(s):
- subTypeAttrs (String) optional
- List of attribute in sub-types of the type that
- contains this attribute
- isInherited (boolean) optional
- If true, display attributes using 'inherited' CSS
- class.
- isNewField (boolean) optional
- If true, display attributes using 'newFields' CSS
- class.
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- addBR (boolean) optional
- If true, add <br/> before attribute.
- schemaLoc (String) optional
- Schema file containing this attribute reference;
- if in current schema, 'schemaLoc' is set to 'this'
- -->
- <xsl:template match="xsd:attribute[@ref]" mode="sample">
- <xsl:param name="subTypeAttrs"/>
- <xsl:param name="isInherited">false</xsl:param>
- <xsl:param name="isNewField">false</xsl:param>
- <xsl:param name="margin">0</xsl:param>
- <xsl:param name="addBR">false</xsl:param>
- <xsl:param name="schemaLoc">this</xsl:param>
-
- <!-- Get attribute name -->
- <xsl:variable name="attrName">
- <xsl:call-template name="GetRefName">
- <xsl:with-param name="ref" select="@ref"/>
- </xsl:call-template>
- </xsl:variable>
-
- <!-- Get attribute namespace -->
- <xsl:variable name="attrNS">
- <xsl:call-template name="GetAttributeNS">
- <xsl:with-param name="attribute" select="."/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="contains($subTypeAttrs, concat('*', normalize-space($attrNS), '+', normalize-space($attrName), '+'))">
- <!-- IGNORE: Sub type has attribute with same name;
- Sub-type's attribute declaration will override this
- one. -->
- </xsl:when>
- <xsl:when test="@use and normalize-space(@use)='prohibited'">
- <!-- IGNORE: Attribute is prohibited. -->
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$addBR!='false'"><br/></xsl:if>
-
- <span style="margin-left: {$margin}em">
- <xsl:choose>
- <xsl:when test="$isNewField!='false'">
- <xsl:attribute name="class">newFields</xsl:attribute>
- </xsl:when>
- <xsl:when test="$isInherited!='false'">
- <xsl:attribute name="class">inherited</xsl:attribute>
- </xsl:when>
- </xsl:choose>
-
- <xsl:text> </xsl:text>
- <xsl:call-template name="PrintAttributeRef">
- <xsl:with-param name="ref" select="@ref"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- <xsl:text>="</xsl:text>
- <!-- Fixed value is provided -->
- <xsl:if test="@fixed">
- <span class="fixed">
- <xsl:value-of select="@fixed"/>
- </span>
- <xsl:text> </xsl:text>
- </xsl:if>
- <!-- Print occurs info-->
- <xsl:call-template name="PrintOccurs">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
- <!-- Documentation -->
- <xsl:call-template name="PrintSampleDocumentation">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
-
- <xsl:text>"</xsl:text>
- </span>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Prints out a sample XML instance representation of an attribute
- group definition.
- Param(s):
- schemaLoc (String) optional
- Schema file containing this attribute group
- definition; if in current schema, 'schemaLoc' is
- set to 'this'.
- -->
- <xsl:template match="xsd:attributeGroup[@name]" mode="sample">
- <xsl:param name="schemaLoc">this</xsl:param>
-
- <xsl:for-each select="xsd:attribute | xsd:attributeGroup | xsd:anyAttribute">
- <xsl:variable name="addBR">
- <xsl:choose>
- <xsl:when test="position()!=1">
- <xsl:text>true</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>false</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:apply-templates select="." mode="sample">
- <xsl:with-param name="addBR" select="$addBR"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:template>
-
- <!--
- Prints out a sample XML instance representation of an attribute
- group reference.
- Param(s):
- subTypeAttrs (String) optional
- List of attributes in sub-types of the type that
- contains this attribute group
- isInherited (boolean) optional
- If true, display attributes using 'inherited' CSS
- class.
- isNewField (boolean) optional
- If true, display attributes using 'newFields' CSS
- class.
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- parentGroups (String) optional
- List of parent attribute group definitions that
- contain this attribute group. Used to prevent
- infinite loops when displaying attribute group
- definitions. In such a case, writes out an error
- message and stops processing.
- schemaLoc (String) optional
- Schema file containing this attribute group
- reference if in current schema, 'schemaLoc' is
- set to 'this'.
- -->
- <xsl:template match="xsd:attributeGroup[@ref]" mode="sample">
- <xsl:param name="subTypeAttrs"/>
- <xsl:param name="isInherited">false</xsl:param>
- <xsl:param name="isNewField">false</xsl:param>
- <xsl:param name="margin">0</xsl:param>
- <xsl:param name="parentGroups"/>
- <xsl:param name="schemaLoc">this</xsl:param>
-
- <!-- Get attribute group name -->
- <xsl:variable name="attrGrpName">
- <xsl:call-template name="GetRefName">
- <xsl:with-param name="ref" select="@ref"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="contains($parentGroups, concat('*', normalize-space($attrGrpName), '+'))">
- <!-- Circular attribute group definition -->
- <xsl:call-template name="HandleError">
- <xsl:with-param name="isTerminating">false</xsl:with-param>
- <xsl:with-param name="errorMsg">
- <xsl:text>Circular attribute group reference: </xsl:text>
- <xsl:value-of select="$attrGrpName"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <!-- Look for attribute group definition -->
- <xsl:variable name="defLoc">
- <xsl:call-template name="FindComponent">
- <xsl:with-param name="ref" select="@ref"/>
- <xsl:with-param name="compType">attribute group</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:choose>
- <!-- Not found -->
- <xsl:when test="normalize-space($defLoc)='' or normalize-space($defLoc)='none' or normalize-space($defLoc)='xml' or normalize-space($defLoc)='xsd'">
- <div class="other" style="margin-left: {$margin}em">
- <xsl:text>Attribute group reference (not shown): </xsl:text>
- <xsl:call-template name="PrintAttributeGroupRef">
- <xsl:with-param name="ref" select="@ref"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- <!-- Documentation -->
- <xsl:call-template name="PrintSampleDocumentation">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
- </div>
- </xsl:when>
- <!-- Found in current schema -->
- <xsl:when test="normalize-space($defLoc)='this'">
- <xsl:variable name="attrGrpDef" select="key('attributeGroup', $attrGrpName)"/>
- <xsl:apply-templates select="$attrGrpDef/xsd:attribute | $attrGrpDef/xsd:attributeGroup" mode="sample">
- <xsl:with-param name="subTypeAttrs" select="$subTypeAttrs"/>
- <xsl:with-param name="isInherited" select="$isInherited"/>
- <xsl:with-param name="isNewField" select="$isNewField"/>
- <xsl:with-param name="parentGroups" select="concat($parentGroups, concat('*', normalize-space($attrGrpName), '+'))"/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="addBR">true</xsl:with-param>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:apply-templates>
- </xsl:when>
- <!-- Found in external schema -->
- <xsl:otherwise>
- <xsl:variable name="attrGrpDef" select="document($defLoc)/xsd:schema/xsd:attributeGroup[@name=$attrGrpName]"/>
- <xsl:apply-templates select="$attrGrpDef/xsd:attribute | $attrGrpDef/xsd:attributeGroup" mode="sample">
- <xsl:with-param name="subTypeAttrs" select="$subTypeAttrs"/>
- <xsl:with-param name="isInherited" select="$isInherited"/>
- <xsl:with-param name="isNewField" select="$isNewField"/>
- <xsl:with-param name="parentGroups" select="concat($parentGroups, concat('*', normalize-space($attrGrpName), '+'))"/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="addBR">true</xsl:with-param>
- <xsl:with-param name="schemaLoc" select="$defLoc"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Prints out a sample XML instance representation of a 'choice'
- model group.
- Param(s):
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- isInherited (boolean) optional
- If true, display elements using'inherited' CSS class.
- isNewField (boolean) optional
- If true, display elements using 'newFields' CSS class.
- parentGroups (String) optional
- List of parent model group definitions that contain this
- model group. Used to prevent infinite loops when
- displaying model group definitions.
- schemaLoc (String) optional
- Schema file containing this choice model group;
- if in current schema, 'schemaLoc' is set to 'this'
- typeList (String) optional
- List of types in this call chain. Name of type starts
- with '*', and ends with '+'. (Used to prevent infinite
- recursive loop.)
- -->
- <xsl:template match="xsd:choice" mode="sample">
- <xsl:param name="margin">0</xsl:param>
- <xsl:param name="isInherited">false</xsl:param>
- <xsl:param name="isNewField">false</xsl:param>
- <xsl:param name="parentGroups"/>
- <xsl:param name="schemaLoc">this</xsl:param>
- <xsl:param name="typeList"/>
-
- <xsl:if test="normalize-space(@maxOccurs)!='0'">
- <!-- Header -->
- <span class="group" style="margin-left: {$margin}em">
- <xsl:text>Start </xsl:text>
- <xsl:call-template name="PrintGlossaryTermRef">
- <xsl:with-param name="code">Choice</xsl:with-param>
- <xsl:with-param name="term">Choice</xsl:with-param>
- </xsl:call-template>
- <!-- Min/max occurrence -->
- <xsl:text> </xsl:text>
- <xsl:call-template name="PrintOccurs">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
- <!-- Documentation -->
- <xsl:call-template name="PrintSampleDocumentation">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
- </span><br/>
-
- <!-- Content -->
- <xsl:apply-templates select="xsd:*" mode="sample">
- <xsl:with-param name="margin" select="number($margin)+number($ELEM_INDENT)"/>
- <xsl:with-param name="isInherited" select="$isInherited"/>
- <xsl:with-param name="isNewField" select="$isNewField"/>
- <xsl:with-param name="parentGroups" select="$parentGroups"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- <xsl:with-param name="typeList" select="$typeList"/>
- </xsl:apply-templates>
-
- <!-- Footer -->
- <span class="group" style="margin-left: {$margin}em">
- <xsl:text>End Choice</xsl:text>
- </span><br/>
- </xsl:if>
- </xsl:template>
-
- <!--
- Prints out a sample XML instance from a complex type definition.
- Param(s):
- schemaLoc (String) optional
- Schema file containing this complex type definition;
- if in current schema, 'schemaLoc' is set to 'this'.
- -->
- <xsl:template match="xsd:complexType" mode="sample">
- <xsl:param name="schemaLoc">this</xsl:param>
-
- <xsl:call-template name="PrintSampleComplexElement">
- <xsl:with-param name="type" select="."/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:template>
-
- <!--
- Prints out a sample XML instance from an element declaration.
- Param(s):
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- isInherited (boolean) optional
- If true, display elements using 'inherited' CSS class.
- isNewField (boolean) optional
- If true, display elements using 'newFields' CSS class.
- schemaLoc (String) optional
- Schema file containing this element declaration;
- if in current schema, 'schemaLoc' is set to 'this'.
- typeList (String) optional
- List of types in this call chain. Name of type starts
- with '*', and ends with '+'. (Used to prevent infinite
- recursive loop.)
- -->
- <xsl:template match="xsd:element[@name]" mode="sample">
- <xsl:param name="margin">0</xsl:param>
- <xsl:param name="isInherited">false</xsl:param>
- <xsl:param name="isNewField">false</xsl:param>
- <xsl:param name="schemaLoc">this</xsl:param>
- <xsl:param name="typeList"/>
-
- <xsl:choose>
- <!-- Prohibited element declaration -->
- <xsl:when test="normalize-space(@maxOccurs)='0'">
- <!-- IGNORE if max occurs is zero -->
- </xsl:when>
- <!-- Global element declaration -->
- <xsl:when test="local-name(..)='schema'">
- <xsl:choose>
- <!-- With type reference -->
- <xsl:when test="@type">
- <xsl:variable name="elemTypeName">
- <xsl:call-template name="GetRefName">
- <xsl:with-param name="ref" select="@type"/>
- </xsl:call-template>
- </xsl:variable>
-
- <!-- Look for complex type definition -->
- <xsl:variable name="defLoc">
- <xsl:call-template name="FindComponent">
- <xsl:with-param name="ref" select="@type"/>
- <xsl:with-param name="compType">complex type</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:choose>
- <!-- Complex type was found in current
- schema. -->
- <xsl:when test="normalize-space($defLoc)='this'">
- <xsl:variable name="ctype" select="key('complexType', $elemTypeName)"/>
- <xsl:call-template name="PrintSampleComplexElement">
- <xsl:with-param name="element" select="."/>
- <xsl:with-param name="type" select="$ctype"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Complex type was not found. -->
- <xsl:when test="normalize-space($defLoc)='' or normalize-space($defLoc)='none' or normalize-space($defLoc)='xml' or normalize-space($defLoc)='xsd'">
- <xsl:call-template name="PrintSampleSimpleElement">
- <xsl:with-param name="element" select="."/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Complex type was found in external
- schema. -->
- <xsl:otherwise>
- <xsl:variable name="ctype" select="document($defLoc)/xsd:schema/xsd:complexType[@name=$elemTypeName]"/>
- <xsl:call-template name="PrintSampleComplexElement">
- <xsl:with-param name="element" select="."/>
- <xsl:with-param name="type" select="$ctype"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- With local complex type definition -->
- <xsl:when test="xsd:complexType">
- <xsl:call-template name="PrintSampleComplexElement">
- <xsl:with-param name="element" select="."/>
- <xsl:with-param name="type" select="xsd:complexType"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="PrintSampleSimpleElement">
- <xsl:with-param name="element" select="."/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- Local element declaration -->
- <xsl:otherwise>
- <xsl:choose>
- <!-- With local complex type definition -->
- <xsl:when test="xsd:complexType">
- <xsl:call-template name="PrintSampleComplexElement">
- <xsl:with-param name="element" select="."/>
- <xsl:with-param name="type" select="xsd:complexType"/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="isInherited" select="$isInherited"/>
- <xsl:with-param name="isNewField" select="$isNewField"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- <xsl:with-param name="typeList" select="$typeList"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="PrintSampleSimpleElement">
- <xsl:with-param name="element" select="."/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="isInherited" select="$isInherited"/>
- <xsl:with-param name="isNewField" select="$isNewField"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- <xsl:with-param name="typeList" select="$typeList"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Prints out a sample XML instance from an element
- reference.
- Param(s):
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- isInherited (boolean) optional
- If true, display elements using 'inherited' CSS class.
- isNewField (boolean) optional
- If true, display elements using 'newFields' CSS class.
- schemaLoc (String) optional
- Schema file containing this element reference;
- if in current schema, 'schemaLoc' is set to 'this'.
- -->
- <xsl:template match="xsd:element[@ref]" mode="sample">
- <xsl:param name="margin">0</xsl:param>
- <xsl:param name="isInherited">false</xsl:param>
- <xsl:param name="isNewField">false</xsl:param>
- <xsl:param name="schemaLoc">this</xsl:param>
-
- <xsl:if test="normalize-space(@maxOccurs)!='0'">
- <xsl:call-template name="PrintSampleSimpleElement">
- <xsl:with-param name="element" select="."/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="isInherited" select="$isInherited"/>
- <xsl:with-param name="isNewField" select="$isNewField"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
-
- <!--
- Prints out a sample XML instance from a group definition.
- Param(s):
- schemaLoc (String) optional
- Schema file containing this model group definition;
- if in current schema, 'schemaLoc' is set to 'this'
- typeList (String) optional
- List of types in this call chain. Name of type starts
- with '*', and ends with '+'. (Used to prevent infinite
- recursive loop.)
- -->
- <xsl:template match="xsd:group[@name]" mode="sample">
- <xsl:param name="schemaLoc">this</xsl:param>
- <xsl:param name="typeList"/>
-
- <xsl:apply-templates select="xsd:*" mode="sample">
- <xsl:with-param name="parentGroups" select="concat('*', normalize-space(@name), '+')"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- <xsl:with-param name="typeList" select="$typeList"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!--
- Prints out a sample XML instance from a group reference.
- Param(s):
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- isInherited (boolean) optional
- If true, display elements using 'inherited' CSS
- class.
- isNewField (boolean) optional
- If true, display elements using 'newFields' CSS
- class.
- parentGroups (String) optional
- List of parent model group definitions that contain
- this model group. Used to prevent infinite loops
- when displaying model group definitions.
- schemaLoc (String) optional
- Schema file containing this model group reference;
- if in current schema, 'schemaLoc' is set to 'this'
- typeList (String) optional
- List of types in this call chain. Name of type starts
- with '*', and ends with '+'. (Used to prevent infinite
- recursive loop.)
- -->
- <xsl:template match="xsd:group[@ref]" mode="sample">
- <xsl:param name="margin">0</xsl:param>
- <xsl:param name="isInherited">false</xsl:param>
- <xsl:param name="isNewField">false</xsl:param>
- <xsl:param name="parentGroups"/>
- <xsl:param name="schemaLoc">this</xsl:param>
- <xsl:param name="typeList"/>
-
- <!-- Get group name -->
- <xsl:variable name="grpName">
- <xsl:call-template name="GetRefName">
- <xsl:with-param name="ref" select="@ref"/>
- </xsl:call-template>
- </xsl:variable>
-
- <!-- Create link to the group definition -->
- <xsl:variable name="grpLink">
- <xsl:call-template name="PrintGroupRef">
- <xsl:with-param name="ref" select="@ref"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:variable>
-
- <!-- Get occurrence info -->
- <xsl:variable name="occursInfo">
- <xsl:call-template name="PrintOccurs">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:choose>
- <!-- Circular group definition -->
- <xsl:when test="contains($parentGroups, concat('*', normalize-space($grpName), '+'))">
- <!-- Don't show contents -->
- <div class="other" style="margin-left: {$margin}em">
- <xsl:text>Circular model group reference: </xsl:text>
- <xsl:copy-of select="$grpLink"/>
- <!-- Occurrence info -->
- <xsl:text> </xsl:text>
- <xsl:copy-of select="$occursInfo"/>
- <!-- Documentation -->
- <xsl:call-template name="PrintSampleDocumentation">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
- </div>
- </xsl:when>
- <xsl:otherwise>
- <!-- Look for group definition -->
- <xsl:variable name="grpDefLoc">
- <xsl:call-template name="FindComponent">
- <xsl:with-param name="ref" select="@ref"/>
- <xsl:with-param name="compType">group</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:choose>
- <!-- Not found -->
- <xsl:when test="normalize-space($grpDefLoc)='' or normalize-space($grpDefLoc)='none' or normalize-space($grpDefLoc)='xml' or normalize-space($grpDefLoc)='xsd'">
- <div class="other" style="margin-left: {$margin}em">
- <xsl:text>Model group reference (not shown): </xsl:text>
- <xsl:copy-of select="$grpLink"/>
- <!-- Occurrence info -->
- <xsl:text> </xsl:text>
- <xsl:copy-of select="$occursInfo"/>
- <!-- Documentation -->
- <xsl:call-template name="PrintSampleDocumentation">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
- </div>
- </xsl:when>
- <!-- Found in current schema -->
- <xsl:when test="normalize-space($grpDefLoc)='this'">
- <xsl:variable name="grpDef" select="key('group', $grpName)"/>
- <xsl:call-template name="PrintSampleGroup">
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="isInherited" select="$isInherited"/>
- <xsl:with-param name="isNewField" select="$isNewField"/>
- <xsl:with-param name="parentGroups" select="concat($parentGroups, concat('*', normalize-space($grpName), '+'))"/>
- <xsl:with-param name="occursInfo" select="$occursInfo"/>
- <xsl:with-param name="grpLink" select="$grpLink"/>
- <xsl:with-param name="grpRef" select="."/>
- <xsl:with-param name="grpDef" select="$grpDef"/>
- <xsl:with-param name="grpDefLoc" select="$grpDefLoc"/>
- <xsl:with-param name="typeList" select="$typeList"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Found in external schema -->
- <xsl:otherwise>
- <xsl:variable name="grpDef" select="document($grpDefLoc)/xsd:schema/xsd:group[@name=$grpName]"/>
- <xsl:call-template name="PrintSampleGroup">
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="isInherited" select="$isInherited"/>
- <xsl:with-param name="isNewField" select="$isNewField"/>
- <xsl:with-param name="parentGroups" select="concat($parentGroups, concat('*', normalize-space($grpName), '+'))"/>
- <xsl:with-param name="occursInfo" select="$occursInfo"/>
- <xsl:with-param name="grpLink" select="$grpLink"/>
- <xsl:with-param name="grpRef" select="."/>
- <xsl:with-param name="grpDef" select="$grpDef"/>
- <xsl:with-param name="grpDefLoc" select="$grpDefLoc"/>
- <xsl:with-param name="typeList" select="$typeList"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Prints out a sample XML instance from a 'sequence' model group.
- Param(s):
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- isInherited (boolean) optional
- If true, display elements using 'inherited' CSS class.
- isNewField (boolean) optional
- If true, display elements using 'newFields' CSS class.
- parentGroups (String) optional
- List of parent model group definitions that contain
- this model group. Used to prevent infinite loops when
- displaying model group definitions.
- schemaLoc (String) optional
- Schema file containing this sequence model group;
- if in current schema, 'schemaLoc' is set to 'this'
- typeList (String) optional
- List of types in this call chain. Name of type starts
- with '*', and ends with '+'. (Used to prevent infinite
- recursive loop.)
- -->
- <xsl:template match="xsd:sequence" mode="sample">
- <xsl:param name="margin">0</xsl:param>
- <xsl:param name="isInherited">false</xsl:param>
- <xsl:param name="isNewField">false</xsl:param>
- <xsl:param name="parentGroups"/>
- <xsl:param name="schemaLoc">this</xsl:param>
- <xsl:param name="typeList"/>
-
- <xsl:if test="normalize-space(@maxOccurs)!='0'">
- <!-- Get occurrence info -->
- <xsl:variable name="occursInfo">
- <xsl:call-template name="PrintOccurs">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
- </xsl:variable>
-
- <!-- Header -->
- <xsl:if test="normalize-space($occursInfo)!='[1]'">
- <!-- Don't display header if min/max occurs is one. -->
- <span class="group" style="margin-left: {$margin}em">
- <xsl:text>Start </xsl:text>
- <xsl:call-template name="PrintGlossaryTermRef">
- <xsl:with-param name="code">Sequence</xsl:with-param>
- <xsl:with-param name="term">Sequence</xsl:with-param>
- </xsl:call-template>
-
- <xsl:text> </xsl:text>
- <xsl:copy-of select="$occursInfo"/>
- <!-- Documentation -->
- <xsl:call-template name="PrintSampleDocumentation">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
- </span><br/>
- </xsl:if>
-
- <xsl:apply-templates select="xsd:*" mode="sample">
- <xsl:with-param name="margin">
- <xsl:choose>
- <xsl:when test="normalize-space($occursInfo)='[1]'">
- <xsl:value-of select="$margin"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="number($margin)+number($ELEM_INDENT)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="isInherited" select="$isInherited"/>
- <xsl:with-param name="isNewField" select="$isNewField"/>
- <xsl:with-param name="parentGroups" select="$parentGroups"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- <xsl:with-param name="typeList" select="$typeList"/>
- </xsl:apply-templates>
-
- <!-- Footer -->
- <xsl:if test="normalize-space($occursInfo)!='[1]'">
- <!-- Don't display footer if min/max occurs is one. -->
- <span class="group" style="margin-left: {$margin}em">
- <xsl:text>End Sequence</xsl:text>
- </span><br/>
- </xsl:if>
- </xsl:if>
- </xsl:template>
-
- <!--
- Prints out the constraints of a complex type with simple content
- to be displayed within a sample XML instance.
- Param(s):
- schemaLoc (String) optional
- Schema file containing this simple content
- restriction; if in current schema, 'schemaLoc' is
- set to 'this'
- -->
- <xsl:template match="xsd:simpleContent[xsd:restriction]" mode="sample">
- <xsl:param name="schemaLoc">this</xsl:param>
-
- <span class="constraint">
- <xsl:call-template name="PrintSampleSimpleRestriction">
- <xsl:with-param name="restriction" select="./xsd:restriction"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </span>
- </xsl:template>
-
- <!--
- Prints out the constraints of a simple type definition to be
- displayed within a sample XML instance.
- Param(s):
- schemaLoc (String) optional
- Schema file containing this simple type definition;
- if in current schema, 'schemaLoc' is set to 'this'
- -->
- <xsl:template match="xsd:simpleType" mode="sample">
- <xsl:param name="schemaLoc">this</xsl:param>
-
- <span class="constraint">
- <xsl:call-template name="PrintSampleSimpleConstraints">
- <xsl:with-param name="simpleContent" select="."/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </span>
- </xsl:template>
-
- <!--
- Prints out the identity constraints of an element to be displayed
- within a sample XML instance.
- Param(s):
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- schemaLoc (String) optional
- Schema file containing this simple type definition;
- if in current schema, 'schemaLoc' is set to 'this'
- -->
- <xsl:template match="xsd:unique | xsd:key | xsd:keyref" mode="sample">
- <xsl:param name="margin">0</xsl:param>
- <xsl:param name="schemaLoc">this</xsl:param>
-
- <div class="other" style="margin-left: {$margin}em">
- <xsl:text>&lt;!-- </xsl:text><br/>
-
- <xsl:choose>
- <xsl:when test="local-name(.)='unique'">
- <xsl:call-template name="PrintGlossaryTermRef">
- <xsl:with-param name="code">Unique</xsl:with-param>
- <xsl:with-param name="term">Uniqueness</xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="local-name(.)='key'">
- <xsl:call-template name="PrintGlossaryTermRef">
- <xsl:with-param name="code">Key</xsl:with-param>
- <xsl:with-param name="term">Key</xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="PrintGlossaryTermRef">
- <xsl:with-param name="code">KeyRef</xsl:with-param>
- <xsl:with-param name="term">Key Reference</xsl:with-param>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text> Constraint - </xsl:text>
- <strong>
- <xsl:choose>
- <xsl:when test="local-name(.)='keyref'">
- <xsl:value-of select="@name"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="componentID">
- <xsl:call-template name="GetComponentID">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
- </xsl:variable>
- <a name="{$componentID}"><xsl:value-of select="@name"/></a>
- </xsl:otherwise>
- </xsl:choose>
- </strong><br/>
-
- <xsl:text>Selector - </xsl:text>
- <strong>
- <xsl:value-of select="xsd:selector/@xpath"/>
- </strong><br/>
-
- <xsl:text>Field(s) - </xsl:text>
- <xsl:for-each select="xsd:field">
- <xsl:if test="position()!=1">
- <xsl:text>, </xsl:text>
- </xsl:if>
- <strong>
- <xsl:value-of select="@xpath"/>
- </strong>
- </xsl:for-each>
- <br/>
-
- <xsl:if test="local-name(.)='keyref'">
- <xsl:text>Refers to - </xsl:text>
- <xsl:call-template name="PrintKeyRef">
- <xsl:with-param name="ref" select="@refer"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- <br/>
- </xsl:if>
-
- <xsl:text>--></xsl:text>
- </div>
- </xsl:template>
-
- <!--
- Unmatched template for 'sample' mode
- -->
- <xsl:template match="*" mode="sample"/>
-
- <!--
- Prints out a link which will open up a window, displaying a
- schema component's documentation.
- Param(s):
- component (Node) required
- Schema component
- -->
- <xsl:template name="PrintSampleDocumentation">
- <xsl:param name="component"/>
-
- <xsl:if test="normalize-space(translate($useJavaScript,'TRUE','true'))='true' and $component and $component/xsd:annotation/xsd:documentation">
- <xsl:variable name="documentation">
- <xsl:for-each select="$component/xsd:annotation/xsd:documentation">
- <!-- Check for two dashes, which will break the JavaScript
- code -->
- <xsl:if test="contains(., '--') or contains(@source, '--')">
- <xsl:call-template name="HandleError">
- <xsl:with-param name="isTerminating">true</xsl:with-param>
- <xsl:with-param name="errorMsg">
-A local schema component contains two dashes in
-'documentation' elements within its 'annotation' element.
- </xsl:with-param>
- </xsl:call-template>
- </xsl:if>
-
- <xsl:if test="position()!=1">
- <xsl:text>,</xsl:text>
- </xsl:if>
- <xsl:text>'</xsl:text>
- <xsl:choose>
- <xsl:when test="@source">
- <xsl:text>More information at: </xsl:text>
- <xsl:call-template name="EscapeQuotes">
- <xsl:with-param name="value" select="@source"/>
- </xsl:call-template>
- <xsl:text>.</xsl:text>
- </xsl:when>
- <xsl:when test="normalize-space(.)!=''">
- <xsl:call-template name="EscapeQuotes">
- <xsl:with-param name="value" select="normalize-space(.)"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- <xsl:text>'</xsl:text>
- </xsl:for-each>
- </xsl:variable>
-
- <xsl:text> </xsl:text>
- <a href="javascript:void(0)" title="View Documentation" class="documentation">
- <!-- onclick attribute -->
- <xsl:attribute name="onclick">
- <xsl:text>docArray = new Array(</xsl:text>
- <xsl:value-of select="$documentation"/>
- <xsl:text>); viewDocumentation('</xsl:text>
- <xsl:call-template name="GetComponentDescription">
- <xsl:with-param name="component" select="$component"/>
- </xsl:call-template>
- <xsl:text>', '</xsl:text>
- <xsl:choose>
- <xsl:when test="$component/@name">
- <xsl:value-of select="$component/@name"/>
- </xsl:when>
- <xsl:when test="$component/@ref">
- <xsl:call-template name="GetRefName">
- <xsl:with-param name="ref" select="$component/@ref"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- <xsl:text>', docArray);</xsl:text>
- </xsl:attribute>
- <xsl:text>?</xsl:text>
- </a>
- </xsl:if>
- </xsl:template>
-
- <!--
- Translates occurrences of single and double quotes
- in a piece of text with single and double quote
- escape characters.
- Param(s):
- value (String) required
- Text to translate
- -->
- <xsl:template name="EscapeQuotes">
- <xsl:param name="value"/>
-
- <xsl:variable name="noSingleQuotes">
- <xsl:call-template name="TranslateStr">
- <xsl:with-param name="value" select="$value"/>
- <xsl:with-param name="strToReplace">'</xsl:with-param>
- <xsl:with-param name="replacementStr">\'</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="noDoubleQuotes">
- <xsl:call-template name="TranslateStr">
- <xsl:with-param name="value" select="$noSingleQuotes"/>
- <xsl:with-param name="strToReplace">"</xsl:with-param>
- <xsl:with-param name="replacementStr">\"</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="$noDoubleQuotes"/>
- </xsl:template>
-
- <!--
- Helper template for template, match="xsd:group[@ref]"
- mode="sample". Basically prints out a group reference, for
- which we are able to look up the group definition that it
- is referring to. This template is a work-around because XSLT
- doesn't have variables (in the traditional sense of
- programming languages) and it doesn't allow you to query
- result tree fragments.
- Param(s):
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- isInherited (boolean) optional
- If true, display elements using 'inherited' CSS class.
- isNewField (boolean) optional
- If true, display elements using 'newFields' CSS class.
- parentGroups (String) optional
- List of parent model group definitions that contain this
- model group. Used to prevent infinite loops when
- displaying model group definitions.
- occursInfo (Result tree fragment) required
- Pre-formatted occurrence info of group reference
- grpLink (Result tree fragment) required
- Pre-formatted <a> link representing group reference
- grpRef (Node) required
- Group reference
- grpDef (Node) required
- Group definition that the reference is pointing to
- grpDefLoc (String) optional
- Schema file containing 'grpDef' group definition;
- if current schema, 'schemaLoc' is set to 'this'
- typeList (String) optional
- List of types in this call chain. Name of type starts
- with '*', and ends with '+'. (Used to prevent infinite
- recursive loop.)
- -->
- <xsl:template name="PrintSampleGroup">
- <xsl:param name="margin">0</xsl:param>
- <xsl:param name="isInherited">false</xsl:param>
- <xsl:param name="isNewField">false</xsl:param>
- <xsl:param name="parentGroups"/>
- <xsl:param name="occursInfo"/>
- <xsl:param name="grpLink"/>
- <xsl:param name="grpRef"/>
- <xsl:param name="grpDef"/>
- <xsl:param name="grpDefLoc">this</xsl:param>
- <xsl:param name="typeList"/>
-
- <!-- Header -->
- <xsl:if test="normalize-space($occursInfo)!='[1]'">
- <!-- Don't print out header if min/max occurs is one. -->
- <span class="group" style="margin-left: {$margin}em">
- <xsl:text>Start Group: </xsl:text>
- <xsl:copy-of select="$grpLink"/>
- <!-- Occurrence info -->
- <xsl:text> </xsl:text>
- <xsl:copy-of select="$occursInfo"/>
- <!-- Documentation -->
- <xsl:call-template name="PrintSampleDocumentation">
- <xsl:with-param name="component" select="$grpRef"/>
- </xsl:call-template>
- </span><br/>
- </xsl:if>
-
- <!-- Content -->
- <xsl:apply-templates select="$grpDef/xsd:*" mode="sample">
- <xsl:with-param name="margin">
- <xsl:choose>
- <xsl:when test="normalize-space($occursInfo)!='[1]'">
- <xsl:value-of select="number($margin)+number($ELEM_INDENT)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$margin"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="isInherited" select="$isInherited"/>
- <xsl:with-param name="isNewField" select="$isNewField"/>
- <xsl:with-param name="parentGroups" select="$parentGroups"/>
- <xsl:with-param name="schemaLoc" select="$grpDefLoc"/>
- <xsl:with-param name="typeList" select="$typeList"/>
- </xsl:apply-templates>
-
- <!-- Footer -->
- <xsl:if test="normalize-space($occursInfo)!='[1]'">
- <!-- Don't print out footer if min/max occurs is one. -->
- <span class="group" style="margin-left: {$margin}em">
- <xsl:text>End Group: </xsl:text>
- <xsl:copy-of select="$grpLink"/>
- </span><br/>
- </xsl:if>
- </xsl:template>
-
- <!--
- Prints out a sample element instance in one line.
- Param(s):
- element (Node) required
- Element declaration or reference
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- isInherited (boolean) optional
- If true, display element using 'inherited' CSS class.
- isNewField (boolean) optional
- If true, display element using 'newFields' CSS class.
- schemaLoc (String) optional
- Schema file containing this element declaration
- or reference; if in current schema, 'schemaLoc' is
- set to 'this'.
- -->
- <xsl:template name="PrintSampleSimpleElement">
- <xsl:param name="element"/>
- <xsl:param name="margin">0</xsl:param>
- <xsl:param name="isInherited">false</xsl:param>
- <xsl:param name="isNewField">false</xsl:param>
- <xsl:param name="schemaLoc">this</xsl:param>
-
- <!-- Element Tag -->
- <xsl:variable name="elemTag">
- <!-- Local Name -->
- <xsl:choose>
- <!-- Element reference -->
- <xsl:when test="$element/@ref">
- <!-- Note: Prefix will be automatically written out
- in call to 'PrintElementRef'. -->
- <xsl:call-template name="PrintElementRef">
- <xsl:with-param name="ref" select="@ref"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Element declaration -->
- <xsl:otherwise>
- <!-- Prefix -->
- <xsl:variable name="prefix">
- <xsl:call-template name="GetElementPrefix">
- <xsl:with-param name="element" select="$element"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:call-template name="PrintNSPrefix">
- <xsl:with-param name="prefix" select="$prefix"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- <xsl:value-of select="$element/@name"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <div style="margin-left: {$margin}em">
- <xsl:choose>
- <xsl:when test="$isNewField!='false'">
- <xsl:attribute name="class">newFields</xsl:attribute>
- </xsl:when>
- <xsl:when test="$isInherited!='false'">
- <xsl:attribute name="class">inherited</xsl:attribute>
- </xsl:when>
- </xsl:choose>
-
- <!-- Start Tag -->
- <xsl:text>&lt;</xsl:text>
- <xsl:copy-of select="$elemTag"/>
- <xsl:text>></xsl:text>
-
- <!-- Contents -->
- <xsl:text> </xsl:text>
- <xsl:choose>
- <!-- Fixed value is provided -->
- <xsl:when test="$element/@fixed">
- <span class="fixed">
- <xsl:value-of select="$element/@fixed"/>
- </span>
- </xsl:when>
- <!-- Type reference is provided -->
- <xsl:when test="$element/@name and $element/@type">
- <xsl:call-template name="PrintTypeRef">
- <xsl:with-param name="ref" select="$element/@type"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Local simple type definition is provided -->
- <xsl:when test="$element/@name and $element/xsd:simpleType">
- <xsl:apply-templates select="$element/xsd:simpleType" mode="sample">
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>...</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text> </xsl:text>
-
- <!-- Identity Constraints -->
- <xsl:if test="$element/xsd:unique or $element/xsd:key or $element/xsd:keyref">
- <xsl:apply-templates select="$element/xsd:unique | $element/xsd:key | $element/xsd:keyref" mode="sample">
- <xsl:with-param name="margin" select="$ELEM_INDENT"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:apply-templates>
- </xsl:if>
-
- <!-- End Tag -->
- <xsl:text>&lt;/</xsl:text>
- <xsl:copy-of select="$elemTag"/>
- <xsl:text>></xsl:text>
-
- <xsl:if test="local-name($element/..)!='schema'">
- <!-- Min/max occurs information -->
- <xsl:text> </xsl:text>
- <xsl:call-template name="PrintOccurs">
- <xsl:with-param name="component" select="$element"/>
- </xsl:call-template>
- <!-- Documentation -->
- <xsl:call-template name="PrintSampleDocumentation">
- <xsl:with-param name="component" select="$element"/>
- </xsl:call-template>
- </xsl:if>
- </div>
- </xsl:template>
-
- <!--
- Prints out a sample element instance that has complex content.
- Param(s):
- type (Node) required
- Complex type definition
- element (Node) optional
- Element declaration
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- isInherited (boolean) optional
- If true, display element using 'inherited' CSS class.
- isNewField (boolean) optional
- If true, display element using 'newFields' CSS class.
- schemaLoc (String) optional
- Schema file containing this element declaration
- or type definition; if in current schema, 'schemaLoc'
- is set to 'this'.
- typeList (String) optional
- List of types in this call chain. Name of type starts
- with '*', and ends with '+'. (Used to prevent infinite
- recursive loop.)
- -->
- <xsl:template name="PrintSampleComplexElement">
- <xsl:param name="type"/>
- <xsl:param name="element"/>
- <xsl:param name="margin">0</xsl:param>
- <xsl:param name="isInherited">false</xsl:param>
- <xsl:param name="isNewField">false</xsl:param>
- <xsl:param name="schemaLoc">this</xsl:param>
- <xsl:param name="typeList"/>
-
- <xsl:choose>
- <!-- Circular type hierarchy -->
- <xsl:when test="$type/@name and contains($typeList, concat('*', $type/@name, '+'))"/>
- <xsl:otherwise>
- <xsl:variable name="tag">
- <xsl:choose>
- <xsl:when test="$element">
- <!-- Prefix -->
- <xsl:variable name="prefix">
- <xsl:call-template name="GetElementPrefix">
- <xsl:with-param name="element" select="$element"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:call-template name="PrintNSPrefix">
- <xsl:with-param name="prefix" select="$prefix"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- <xsl:value-of select="$element/@name"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>...</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="fromTopCType">
- <xsl:choose>
- <xsl:when test="not($element) and local-name($type/..)='schema'">
- <xsl:text>true</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>false</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <div style="margin-left: {$margin}em">
- <xsl:choose>
- <xsl:when test="$isNewField!='false'">
- <xsl:attribute name="class">newFields</xsl:attribute>
- </xsl:when>
- <xsl:when test="$isInherited!='false'">
- <xsl:attribute name="class">inherited</xsl:attribute>
- </xsl:when>
- </xsl:choose>
-
- <!-- Start Tag -->
- <xsl:text>&lt;</xsl:text>
- <xsl:copy-of select="$tag"/>
-
- <!-- Print attributes -->
- <xsl:call-template name="PrintSampleTypeAttrs">
- <xsl:with-param name="type" select="$type"/>
- <xsl:with-param name="isInherited" select="$isInherited"/>
- <xsl:with-param name="isNewField" select="$isNewField"/>
- <xsl:with-param name="margin" select="$ATTR_INDENT"/>
- <xsl:with-param name="fromTopCType" select="$fromTopCType"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- <xsl:with-param name="typeList" select="$typeList"/>
- </xsl:call-template>
-
- <!-- Get content -->
- <xsl:variable name="content">
- <xsl:call-template name="PrintSampleTypeContent">
- <xsl:with-param name="type" select="$type"/>
- <xsl:with-param name="margin" select="$ELEM_INDENT"/>
- <xsl:with-param name="isInherited" select="$isInherited"/>
- <xsl:with-param name="isNewField" select="$isNewField"/>
- <xsl:with-param name="fromTopCType" select="$fromTopCType"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- <xsl:with-param name="typeList" select="$typeList"/>
- </xsl:call-template>
- </xsl:variable>
-
- <!-- Find out if content type is mixed -->
- <xsl:variable name="mixed">
- <xsl:choose>
- <xsl:when test="normalize-space(translate($type/xsd:complexContent/@mixed, 'TRUE', 'true'))='true' or normalize-space($type/xsd:complexContent/@mixed)='1'">
- <xsl:text>true</xsl:text>
- </xsl:when>
- <xsl:when test="normalize-space(translate($type/@mixed, 'TRUE', 'true'))='true' or normalize-space($type/@mixed)='1'">
- <xsl:text>true</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>false</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <!-- Find out if there are identity constraints -->
- <xsl:variable name="hasIdConstraints">
- <xsl:if test="$element and ($element/xsd:unique or $element/xsd:key or $element/xsd:keyref)">
- <xsl:text>true</xsl:text>
- </xsl:if>
- </xsl:variable>
-
- <!-- Print content -->
- <xsl:choose>
- <!-- Empty content -->
- <xsl:when test="$hasIdConstraints!='true' and normalize-space($content)=''">
- <!-- Close start tag -->
- <xsl:text>/> </xsl:text>
-
- <xsl:if test="$element and local-name($element/..)!='schema'">
- <!-- Occurrence info -->
- <xsl:text> </xsl:text>
- <xsl:call-template name="PrintOccurs">
- <xsl:with-param name="component" select="$element"/>
- </xsl:call-template>
-
- <!-- Documentation -->
- <xsl:call-template name="PrintSampleDocumentation">
- <xsl:with-param name="component" select="$element"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <!-- Close start tag -->
- <xsl:text>> </xsl:text>
-
- <xsl:if test="$element and local-name($element/..)!='schema'">
- <!-- Occurrence info -->
- <xsl:text> </xsl:text>
- <xsl:call-template name="PrintOccurs">
- <xsl:with-param name="component" select="$element"/>
- </xsl:call-template>
-
- <!-- Documentation -->
- <xsl:text> </xsl:text>
- <xsl:call-template name="PrintSampleDocumentation">
- <xsl:with-param name="component" select="$element"/>
- </xsl:call-template>
- </xsl:if>
-
- <!-- Identity Constraints -->
- <xsl:if test="$element">
- <xsl:apply-templates select="$element/xsd:unique | $element/xsd:key | $element/xsd:keyref" mode="sample">
- <xsl:with-param name="margin" select="$ELEM_INDENT"/>
- </xsl:apply-templates>
- </xsl:if>
-
- <!-- Print out restriction/extension information -->
- <xsl:choose>
- <xsl:when test="false()">
- <!--<xsl:when test="$type/xsd:complexContent/xsd:restriction/@base">-->
- <br/><span class="other" style="margin-left: {$ELEM_INDENT}em">
- <xsl:text>&lt;!-- Restricts : </xsl:text>
- <xsl:call-template name="PrintTypeRef">
- <xsl:with-param name="ref" select="$type/xsd:complexContent/xsd:restriction/@base"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- <xsl:text> --></xsl:text>
- </span>
- </xsl:when>
- <xsl:when test="false()">
- <!--<xsl:when test="$type/xsd:complexContent/xsd:extension/@base">-->
- <br/><span class="other" style="margin-left: {$ELEM_INDENT}em">
- <xsl:text>&lt;!-- Extends : </xsl:text>
- <xsl:call-template name="PrintTypeRef">
- <xsl:with-param name="ref" select="$type/xsd:complexContent/xsd:extension/@base"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- <xsl:text> --></xsl:text>
- </span>
- </xsl:when>
- </xsl:choose>
-
- <!-- Print out message if has mixed content -->
- <xsl:if test="$mixed='true'">
- <br/><span class="other" style="margin-left: {$ELEM_INDENT}em">
- <xsl:text>&lt;!-- Mixed content --></xsl:text>
- </span>
- </xsl:if>
-
- <!-- Element Content -->
- <xsl:copy-of select="$content"/>
-
- <!-- End Tag -->
- <xsl:text>&lt;/</xsl:text>
- <xsl:copy-of select="$tag"/>
- <xsl:text>></xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </div>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Prints out attributes of a complex type definition, including
- those inherited from a base type.
- Param(s):
- type (Node) required
- Complex type definition
- subTypeAttrs (String) optional
- List of attributes in sub-types of this current type
- definition
- isInherited (boolean) optional
- If true, display attributes using 'inherited' CSS class.
- isNewField (boolean) optional
- If true, display attributes using 'newFields' CSS class.
- fromTopCType (boolean) optional
- Set to true if this is being displayed in the XML
- Instance Representation table of a top-level complex
- type definition, in which case, 'inherited' attributes
- and elements are distinguished.
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- schemaLoc (String) optional
- Schema file containing this complex type definition;
- if in current schema, 'schemaLoc' is set to 'this'.
- typeList (String) optional
- List of types in this call chain. Name of type starts
- with '*', and ends with '+'. (Used to prevent infinite
- recursive loop.)
- -->
- <xsl:template name="PrintSampleTypeAttrs">
- <xsl:param name="type"/>
- <xsl:param name="subTypeAttrs"/>
- <xsl:param name="isInherited">false</xsl:param>
- <xsl:param name="isNewField">false</xsl:param>
- <xsl:param name="fromTopCType">false</xsl:param>
- <xsl:param name="margin">0</xsl:param>
- <xsl:param name="schemaLoc">this</xsl:param>
- <xsl:param name="typeList"/>
-
- <xsl:choose>
- <!-- Circular type hierarchy -->
- <xsl:when test="$type/@name and contains($typeList, concat('*', $type/@name, '+'))">
- <!-- Do nothing.
- Error message will be written out by 'PrintSampleTypeContent' template.
- -->
- </xsl:when>
- <!-- Derivation -->
- <xsl:when test="$type/xsd:complexContent or $type/xsd:simpleContent">
- <xsl:choose>
- <xsl:when test="$type/xsd:complexContent/xsd:restriction">
- <xsl:call-template name="PrintSampleDerivedTypeAttrs">
- <xsl:with-param name="derivationElem" select="$type/xsd:complexContent/xsd:restriction"/>
- <xsl:with-param name="subTypeAttrs" select="$subTypeAttrs"/>
- <xsl:with-param name="isInherited" select="$isInherited"/>
- <xsl:with-param name="isNewField" select="$isNewField"/>
- <xsl:with-param name="fromTopCType" select="$fromTopCType"/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- <xsl:with-param name="typeList" select="concat($typeList, '*', $type/@name, '+')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$type/xsd:simpleContent/xsd:restriction">
- <xsl:call-template name="PrintSampleDerivedTypeAttrs">
- <xsl:with-param name="derivationElem" select="$type/xsd:simpleContent/xsd:restriction"/>
- <xsl:with-param name="subTypeAttrs" select="$subTypeAttrs"/>
- <xsl:with-param name="isInherited" select="$isInherited"/>
- <xsl:with-param name="isNewField" select="$isNewField"/>
- <xsl:with-param name="fromTopCType" select="$fromTopCType"/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- <xsl:with-param name="typeList" select="concat($typeList, '*', $type/@name, '+')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$type/xsd:complexContent/xsd:extension">
- <xsl:call-template name="PrintSampleDerivedTypeAttrs">
- <xsl:with-param name="derivationElem" select="$type/xsd:complexContent/xsd:extension"/>
- <xsl:with-param name="subTypeAttrs" select="$subTypeAttrs"/>
- <xsl:with-param name="isInherited" select="$isInherited"/>
- <xsl:with-param name="isNewField" select="$isNewField"/>
- <xsl:with-param name="fromTopCType" select="$fromTopCType"/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- <xsl:with-param name="typeList" select="concat($typeList, '*', $type/@name, '+')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$type/xsd:simpleContent/xsd:extension">
- <xsl:call-template name="PrintSampleDerivedTypeAttrs">
- <xsl:with-param name="derivationElem" select="$type/xsd:simpleContent/xsd:extension"/>
- <xsl:with-param name="subTypeAttrs" select="$subTypeAttrs"/>
- <xsl:with-param name="isInherited" select="$isInherited"/>
- <xsl:with-param name="isNewField" select="$isNewField"/>
- <xsl:with-param name="fromTopCType" select="$fromTopCType"/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- <xsl:with-param name="typeList" select="concat($typeList, '*', $type/@name, '+')"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- <!-- No derivation -->
- <xsl:when test="local-name($type)='complexType'">
- <xsl:call-template name="PrintSampleAttrList">
- <xsl:with-param name="list" select="$type"/>
- <xsl:with-param name="subTypeAttrs" select="$subTypeAttrs"/>
- <xsl:with-param name="isInherited" select="$isInherited"/>
- <xsl:with-param name="isNewField" select="$isNewField"/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- <xsl:with-param name="typeList" select="concat($typeList, '*', $type/@name, '+')"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Ignore base types that are simple types -->
- </xsl:choose>
- </xsl:template>
-
- <!--
- Helper function 'PrintSampleTypeAttrs' template to
- handle case of derived types.
- Param(s):
- derivationElem (Node) required
- 'restriction' or 'extension' element
- subTypeAttrs (String) optional
- List of attributes in sub-types of
- this current type definition
- isInherited (boolean) optional
- If true, display attributes using 'inherited' CSS class.
- isNewField (boolean) optional
- If true, display attributes using 'newFields' CSS class.
- fromTopCType (boolean) optional
- Set to true if this is being displayed
- in the XML Instance Representation table
- of a top-level complex type definition, in
- which case, 'inherited' attributes and
- elements are distinguished.
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- schemaLoc (String) optional
- Schema file containing this derivation element;
- if in current schema, 'schemaLoc' is set to 'this'.
- typeList (String) optional
- List of types in this call chain. Name of type starts
- with '*', and ends with '+'. (Used to prevent infinite
- recursive loop.)
- -->
- <xsl:template name="PrintSampleDerivedTypeAttrs">
- <xsl:param name="derivationElem"/>
- <xsl:param name="subTypeAttrs"/>
- <xsl:param name="isInherited">false</xsl:param>
- <xsl:param name="isNewField">false</xsl:param>
- <xsl:param name="fromTopCType">false</xsl:param>
- <xsl:param name="margin">0</xsl:param>
- <xsl:param name="schemaLoc">this</xsl:param>
- <xsl:param name="typeList"/>
-
- <!-- Get attributes from this type to add to
- 'subTypeAttrs' list for recursive call on base type -->
- <xsl:variable name="thisAttrs">
- <xsl:call-template name="GetAttrList">
- <xsl:with-param name="list" select="$derivationElem"/>
- </xsl:call-template>
- </xsl:variable>
-
- <!-- Look for base type -->
- <xsl:variable name="baseTypeName">
- <xsl:call-template name="GetRefName">
- <xsl:with-param name="ref" select="$derivationElem/@base"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="defLoc">
- <xsl:call-template name="FindComponent">
- <xsl:with-param name="ref" select="$derivationElem/@base"/>
- <xsl:with-param name="compType">complex type</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <!-- Complex type was found in current schema. -->
- <xsl:when test="normalize-space($defLoc)='this'">
- <xsl:variable name="ctype" select="key('complexType', $baseTypeName)"/>
- <xsl:call-template name="PrintSampleTypeAttrs">
- <xsl:with-param name="type" select="$ctype"/>
- <xsl:with-param name="subTypeAttrs" select="concat($subTypeAttrs, $thisAttrs)"/>
- <xsl:with-param name="isInherited">
- <xsl:choose>
- <xsl:when test="$fromTopCType!='false'">
- <xsl:text>true</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>false</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="isNewField" select="$isNewField"/>
- <xsl:with-param name="fromTopCType" select="$fromTopCType"/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- <xsl:with-param name="typeList" select="$typeList"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Complex type was not found. -->
- <xsl:when test="normalize-space($defLoc)='' or normalize-space($defLoc)='none' or normalize-space($defLoc)='xml' or normalize-space($defLoc)='xsd'">
- <!-- IGNORE: Error message will be printed out be
- 'PrintSampleTypeContent' template. -->
- </xsl:when>
- <!-- Complex type was found in external schema. -->
- <xsl:otherwise>
- <xsl:variable name="ctype" select="document($defLoc)/xsd:schema/xsd:complexType[@name=$baseTypeName]"/>
- <xsl:call-template name="PrintSampleTypeAttrs">
- <xsl:with-param name="type" select="$ctype"/>
- <xsl:with-param name="subTypeAttrs" select="concat($subTypeAttrs, $thisAttrs)"/>
- <xsl:with-param name="isInherited">
- <xsl:choose>
- <xsl:when test="$fromTopCType!='false'">
- <xsl:text>true</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>false</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="isNewField" select="$isNewField"/>
- <xsl:with-param name="fromTopCType" select="$fromTopCType"/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="schemaLoc" select="$defLoc"/>
- <xsl:with-param name="typeList" select="$typeList"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
-
- <!-- Print out attributes in this type -->
- <xsl:call-template name="PrintSampleAttrList">
- <xsl:with-param name="list" select="$derivationElem"/>
- <xsl:with-param name="subTypeAttrs" select="$subTypeAttrs"/>
- <xsl:with-param name="isInherited" select="$isInherited"/>
- <xsl:with-param name="isNewField">
- <xsl:choose>
- <xsl:when test="$fromTopCType!='false' and $isInherited='false'">
- <xsl:text>true</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>false</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:template>
-
- <!--
- Returns the names and namespaces of attributes
- in a list of attributes and attribute groups.
- Param(s):
- list (Node) required
- Node containing list of attributes and attribute groups
- -->
- <xsl:template name="GetAttrList">
- <xsl:param name="list"/>
-
- <xsl:if test="$list">
- <xsl:for-each select="$list/xsd:attribute | $list/xsd:attributeGroup | $list/xsd:anyAttribute">
- <xsl:choose>
- <!-- Attribute declaration -->
- <xsl:when test="local-name(.)='attribute' and @name">
- <!-- Get attribute name -->
- <xsl:variable name="attrName" select="@name"/>
- <!-- Get attribute namespace -->
- <xsl:variable name="attrNS">
- <xsl:call-template name="GetAttributeNS">
- <xsl:with-param name="attribute" select="."/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:value-of select="concat('*', normalize-space($attrNS), '+', normalize-space($attrName), '+')"/>
- </xsl:when>
- <!-- Attribute reference -->
- <xsl:when test="local-name(.)='attribute' and @ref">
- <!-- Get attribute name -->
- <xsl:variable name="attrName">
- <xsl:call-template name="GetRefName">
- <xsl:with-param name="ref" select="@ref"/>
- </xsl:call-template>
- </xsl:variable>
- <!-- Get attribute namespace -->
- <xsl:variable name="attrNS">
- <xsl:call-template name="GetAttributeNS">
- <xsl:with-param name="attribute" select="."/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:value-of select="concat('*', normalize-space($attrNS), '+', normalize-space($attrName), '+')"/>
- </xsl:when>
- <!-- Attribute Group reference -->
- <xsl:when test="local-name(.)='attributeGroup' and @ref">
- <xsl:variable name="attrGrpName">
- <xsl:call-template name="GetRefName">
- <xsl:with-param name="ref" select="@ref"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:call-template name="GetAttrList">
- <xsl:with-param name="list" select="key('attributeGroup', $attrGrpName)"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Attribute wildcard -->
- <xsl:when test="local-name(.)='anyAttribute'">
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </xsl:if>
- </xsl:template>
-
- <!--
- Prints out sample XML instances from a list of attributes and
- attribute groups.
- Param(s):
- list (Node) required
- Node containing list of attributes and attribute groups
- subTypeAttrs (String) optional
- List of attributes in sub-types of
- the type definition containing this list
- isInherited (boolean) optional
- If true, display attributes using 'inherited' CSS class.
- isNewField (boolean) optional
- If true, display attributes using 'newFields' CSS class.
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- schemaLoc (String) optional
- Schema file containing this attribute list;
- if in current schema, 'schemaLoc' is set to 'this'.
- -->
- <xsl:template name="PrintSampleAttrList">
- <xsl:param name="list"/>
- <xsl:param name="subTypeAttrs"/>
- <xsl:param name="isInherited">false</xsl:param>
- <xsl:param name="isNewField">false</xsl:param>
- <xsl:param name="margin">0</xsl:param>
- <xsl:param name="schemaLoc">this</xsl:param>
-
- <xsl:apply-templates select="$list/xsd:attribute | $list/xsd:attributeGroup | $list/xsd:anyAttribute" mode="sample">
- <xsl:with-param name="subTypeAttrs" select="$subTypeAttrs"/>
- <xsl:with-param name="isInherited" select="$isInherited"/>
- <xsl:with-param name="isNewField" select="$isNewField"/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="addBR">true</xsl:with-param>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!--
- Prints out the element content of a complex type definition,
- including those inherited from a base type.
- Param(s):
- type (Node) required
- Complex type definition
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- isInherited (boolean) optional
- If true, display elements using 'inherited' CSS class.
- isNewField (boolean) optional
- If true, display elements using 'newFields' CSS class.
- fromTopCType (boolean) optional
- Set to true if this is being displayed in the XML
- Instance Representation table of a top-level complex
- type definition, in which case, 'inherited' attributes
- and elements are distinguished.
- addBR (boolean) optional
- If true, can add <br/> before element content.
- Applicable only if displaying complex content.
- schemaLoc (String) optional
- Schema file containing this type definition;
- if in current schema, 'schemaLoc' is set to 'this'.
- typeList (String) optional
- List of types in this call chain. Name of type starts
- with '*', and ends with '+'. (Used to prevent infinite
- recursive loop.)
- -->
- <xsl:template name="PrintSampleTypeContent">
- <xsl:param name="type"/>
- <xsl:param name="margin">0</xsl:param>
- <xsl:param name="isInherited">false</xsl:param>
- <xsl:param name="isNewField">false</xsl:param>
- <xsl:param name="fromTopCType">false</xsl:param>
- <xsl:param name="addBR">true</xsl:param>
- <xsl:param name="schemaLoc">this</xsl:param>
- <xsl:param name="typeList"/>
-
- <xsl:if test="$addBR='true'"><br/></xsl:if>
-
- <xsl:choose>
- <!-- Circular type hierarchy -->
- <xsl:when test="$type/@name and contains($typeList, concat('*', $type/@name, '+'))"/>
- <!-- Derivation by restriction on complex content -->
- <xsl:when test="$type/xsd:complexContent/xsd:restriction">
- <xsl:variable name="restriction" select="$type/xsd:complexContent/xsd:restriction"/>
-
- <!-- Test if base type is in schema to print out warning comment-->
- <xsl:variable name="baseTypeName">
- <xsl:call-template name="GetRefName">
- <xsl:with-param name="ref" select="$restriction/@base"/>
- </xsl:call-template>
- </xsl:variable>
- <!-- Look for base type -->
- <xsl:variable name="defLoc">
- <xsl:call-template name="FindComponent">
- <xsl:with-param name="ref" select="$restriction/@base"/>
- <xsl:with-param name="compType">complex type</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:choose>
- <!-- Complex type was not found. -->
- <xsl:when test="normalize-space($defLoc)='' or normalize-space($defLoc)='none' or normalize-space($defLoc)='xml' or normalize-space($defLoc)='xsd'">
- <div class="other" style="margin-left: {$margin}em;">
- <xsl:text>&lt;!-- '</xsl:text>
- <xsl:call-template name="PrintTypeRef">
- <xsl:with-param name="ref" select="$restriction/@base"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- <xsl:text>' super type was not found in this schema. Some elements and attributes may be missing. --></xsl:text>
- </div>
- </xsl:when>
- <!-- Complex type was found. -->
- <xsl:otherwise>
- <!-- IGNORE element content of base type if by restriction,
- since current content will override restricted
- base type's content. -->
- </xsl:otherwise>
- </xsl:choose>
-
- <!-- Print out content from this type -->
- <xsl:if test="$restriction/xsd:*[local-name(.)!='annotation']">
- <xsl:call-template name="PrintSampleParticleList">
- <xsl:with-param name="list" select="$restriction"/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="isInherited" select="$isInherited"/>
- <xsl:with-param name="isNewField">
- <xsl:choose>
- <xsl:when test="$fromTopCType!='false' and $isInherited='false'">
- <xsl:text>true</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>false</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- <xsl:with-param name="typeList" select="concat($typeList, '*', $type/@name, '+')"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:when>
- <!-- Derivation by extension on complex content -->
- <xsl:when test="$type/xsd:complexContent/xsd:extension">
- <xsl:variable name="extension" select="$type/xsd:complexContent/xsd:extension"/>
-
- <xsl:variable name="baseTypeName">
- <xsl:call-template name="GetRefName">
- <xsl:with-param name="ref" select="$extension/@base"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="contains($typeList, concat('*', $baseTypeName, '+'))">
- <div class="other" style="margin-left: {$margin}em">
- <xsl:text>&lt;-- Extends: </xsl:text>
- <xsl:call-template name="PrintTypeRef">
- <xsl:with-param name="ref" select="$extension/@base"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- <xsl:text> (Circular type hierarchy) --&gt;</xsl:text>
- </div>
- </xsl:when>
- <xsl:otherwise>
- <!-- Look for base type -->
- <xsl:variable name="defLoc">
- <xsl:call-template name="FindComponent">
- <xsl:with-param name="ref" select="$extension/@base"/>
- <xsl:with-param name="compType">complex type</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:choose>
- <!-- Complex type was found in current schema. -->
- <xsl:when test="normalize-space($defLoc)='this'">
- <xsl:variable name="ctype" select="key('complexType', $baseTypeName)"/>
- <xsl:call-template name="PrintSampleTypeContent">
- <xsl:with-param name="type" select="$ctype"/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="isInherited">
- <xsl:choose>
- <xsl:when test="$fromTopCType!='false'">
- <xsl:text>true</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>false</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="isNewField" select="$isNewField"/>
- <xsl:with-param name="fromTopCType" select="$fromTopCType"/>
- <xsl:with-param name="addBR">false</xsl:with-param>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- <xsl:with-param name="typeList" select="concat($typeList, '*', $type/@name, '+')"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Complex type was not found. -->
- <xsl:when test="normalize-space($defLoc)='' or normalize-space($defLoc)='none' or normalize-space($defLoc)='xml' or normalize-space($defLoc)='xsd'">
- <div class="other" style="margin-left: {$margin}em;">
- <xsl:text>&lt;!-- '</xsl:text>
- <xsl:call-template name="PrintTypeRef">
- <xsl:with-param name="ref" select="$extension/@base"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- <xsl:text>' super type was not found in this schema. Some elements and attributes may be missing. --></xsl:text>
- </div>
- </xsl:when>
- <!-- Complex type was found in external schema. -->
- <xsl:otherwise>
- <xsl:variable name="ctype" select="document($defLoc)/xsd:schema/xsd:complexType[@name=$baseTypeName]"/>
- <xsl:call-template name="PrintSampleTypeContent">
- <xsl:with-param name="type" select="$ctype"/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="isInherited">
- <xsl:choose>
- <xsl:when test="$fromTopCType!='false'">
- <xsl:text>true</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>false</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="isNewField" select="$isNewField"/>
- <xsl:with-param name="fromTopCType" select="$fromTopCType"/>
- <xsl:with-param name="addBR">false</xsl:with-param>
- <xsl:with-param name="schemaLoc" select="$defLoc"/>
- <xsl:with-param name="typeList" select="concat($typeList, '*', $type/@name, '+')"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
-
- <!-- Print out content from this type -->
- <xsl:if test="$extension/xsd:*[local-name(.)!='annotation']">
- <xsl:call-template name="PrintSampleParticleList">
- <xsl:with-param name="list" select="$extension"/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="isInherited" select="$isInherited"/>
- <xsl:with-param name="isNewField">
- <xsl:choose>
- <xsl:when test="$fromTopCType!='false' and $isInherited='false'">
- <xsl:text>true</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>false</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- <xsl:with-param name="typeList" select="concat($typeList, '*', $type/@name, '+')"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- Derivation by restriction on simple content -->
- <xsl:when test="$type/xsd:simpleContent/xsd:restriction">
- <!-- Print out simple type constraints-->
- <span style="margin-left: {$margin}em">
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="$type/xsd:simpleContent" mode="sample">
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:apply-templates>
- <xsl:text> </xsl:text>
- </span><br/>
- </xsl:when>
- <!-- Derivation by extension on simple content -->
- <xsl:when test="$type/xsd:simpleContent/xsd:extension">
- <!-- Print out base type name -->
- <span style="margin-left: {$margin}em">
- <xsl:text> </xsl:text>
- <xsl:call-template name="PrintTypeRef">
- <xsl:with-param name="ref" select="$type/xsd:simpleContent/xsd:extension/@base"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- <xsl:text> </xsl:text>
- </span><br/>
- </xsl:when>
- <!-- No derivation: complex type definition -->
- <xsl:when test="local-name($type)='complexType'">
- <!-- Print out content from this type -->
- <xsl:call-template name="PrintSampleParticleList">
- <xsl:with-param name="list" select="$type"/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="isInherited" select="$isInherited"/>
- <xsl:with-param name="isNewField" select="$isNewField"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- <xsl:with-param name="typeList" select="concat($typeList, '*', $type/@name, '+')"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Prints out sample XML instances from a list of
- element particle.
- Param(s):
- list (Node) required
- Node containing list of element particles
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- isInherited (boolean) optional
- If true, display elements using 'inherited' CSS class.
- isNewField (boolean) optional
- If true, display elements using 'newFields' CSS class.
- schemaLoc (String) optional
- Schema file containing this particle list;
- if in current schema, 'schemaLoc' is set to 'this'.
- typeList (String) optional
- List of types in this call chain. Name of type starts
- with '*', and ends with '+'. (Used to prevent infinite
- recursive loop.)
- -->
- <xsl:template name="PrintSampleParticleList">
- <xsl:param name="list"/>
- <xsl:param name="margin">0</xsl:param>
- <xsl:param name="isInherited">false</xsl:param>
- <xsl:param name="isNewField">false</xsl:param>
- <xsl:param name="schemaLoc">this</xsl:param>
- <xsl:param name="typeList"/>
-
- <xsl:if test="$list">
- <xsl:apply-templates select="$list/xsd:group | $list/xsd:sequence | $list/xsd:choice | $list/xsd:all | $list/xsd:element" mode="sample">
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="isInherited" select="$isInherited"/>
- <xsl:with-param name="isNewField" select="$isNewField"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- <xsl:with-param name="typeList" select="$typeList"/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:template>
-
- <!--
- Prints out the constraints of simple content
- to be displayed within a sample XML instance.
- Param(s):
- simpleContent (Node) required
- Node containing with the simple content
- schemaLoc (String) optional
- Schema file containing these simple constraints;
- if in current schema, 'schemaLoc' is set to 'this'.
- -->
- <xsl:template name="PrintSampleSimpleConstraints">
- <xsl:param name="simpleContent"/>
- <xsl:param name="schemaLoc">this</xsl:param>
- <xsl:param name="typeList"/>
-
- <xsl:choose>
- <!-- Derivation by restriction -->
- <xsl:when test="$simpleContent/xsd:restriction">
- <xsl:call-template name="PrintSampleSimpleRestriction">
- <xsl:with-param name="restriction" select="$simpleContent/xsd:restriction"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- <xsl:with-param name="typeList" select="$typeList"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Derivation by list -->
- <xsl:when test="$simpleContent/xsd:list">
- <xsl:choose>
- <xsl:when test="$simpleContent/xsd:list/@itemType">
- <xsl:text>list of: </xsl:text>
- <xsl:call-template name="PrintTypeRef">
- <xsl:with-param name="ref" select="$simpleContent/xsd:list/@itemType"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>list of: [ </xsl:text>
- <xsl:call-template name="PrintSampleSimpleConstraints">
- <xsl:with-param name="simpleContent" select="$simpleContent/xsd:list/xsd:simpleType"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- <xsl:text> ]</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- Derivation by union -->
- <xsl:when test="$simpleContent/xsd:union">
- <xsl:text>union of: [ </xsl:text>
-
- <xsl:variable name="hasMemberTypes">
- <xsl:if test="normalize-space($simpleContent/xsd:union/@memberTypes)!=''">
- <xsl:text>true</xsl:text>
- </xsl:if>
- </xsl:variable>
- <xsl:if test="$hasMemberTypes='true'">
- <xsl:call-template name="PrintWhitespaceList">
- <xsl:with-param name="value" select="$simpleContent/xsd:union/@memberTypes"/>
- <xsl:with-param name="compType">type</xsl:with-param>
- <xsl:with-param name="separator">,</xsl:with-param>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:for-each select="$simpleContent/xsd:union/xsd:simpleType">
- <xsl:if test="position()!=1 or $hasMemberTypes='true'">
- <xsl:text>, </xsl:text>
- </xsl:if>
- <xsl:text>[ </xsl:text>
- <xsl:call-template name="PrintSampleSimpleConstraints">
- <xsl:with-param name="simpleContent" select="."/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- <xsl:text> ]</xsl:text>
- </xsl:for-each>
-
- <xsl:text> ]</xsl:text>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Prints out the constraints of simple content
- derived by restriction, which is to be displayed
- within a sample XML instance.
- Param(s):
- restriction (Node) required
- Node containing with the restriction
- schemaLoc (String) optional
- Schema file containing this restriction element;
- if in current schema, 'schemaLoc' is set to 'this'.
- -->
- <xsl:template name="PrintSampleSimpleRestriction">
- <xsl:param name="restriction"/>
- <xsl:param name="schemaLoc">this</xsl:param>
- <xsl:param name="typeList"/>
-
- <xsl:variable name="typeName" select="$restriction/parent::xsd:simpleType/@name"/>
-
- <!-- Print out base type info -->
- <xsl:choose>
- <!-- Circular type hierarchy -->
- <xsl:when test="$typeName != '' and contains($typeList, concat('*', $typeName, '+'))">
- <xsl:call-template name="HandleError">
- <xsl:with-param name="isTerminating">false</xsl:with-param>
- <xsl:with-param name="errorMsg">
- <xsl:text>Circular type reference to '</xsl:text>
- <xsl:value-of select="$typeName"/>
- <xsl:text>' in type hierarchy.</xsl:text>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <!-- Locally-defined base type -->
- <xsl:when test="$restriction/xsd:simpleType">
- <xsl:call-template name="PrintSampleSimpleConstraints">
- <xsl:with-param name="simpleContent" select="$restriction/xsd:simpleType"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- <xsl:with-param name="typeList" select="$typeList"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Base type reference -->
- <xsl:when test="$restriction">
- <xsl:variable name="baseTypeRef" select="$restriction/@base"/>
- <xsl:variable name="baseTypeName">
- <xsl:call-template name="GetRefName">
- <xsl:with-param name="ref" select="$baseTypeRef"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="baseTypeNS">
- <xsl:call-template name="GetRefNS">
- <xsl:with-param name="ref" select="$baseTypeRef"/>
- </xsl:call-template>
- </xsl:variable>
- <!-- Write out reference to base type -->
- <xsl:call-template name="PrintTypeRef">
- <xsl:with-param name="ref" select="$baseTypeRef"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
-
- <!-- Regular Expression Pattern -->
- <xsl:variable name="pattern">
- <xsl:call-template name="PrintPatternFacet">
- <xsl:with-param name="simpleRestrict" select="$restriction"/>
- </xsl:call-template>
- </xsl:variable>
- <!-- Range -->
- <xsl:variable name="range">
- <xsl:call-template name="PrintRangeFacets">
- <xsl:with-param name="simpleRestrict" select="$restriction"/>
- </xsl:call-template>
- </xsl:variable>
- <!-- Length -->
- <xsl:variable name="length">
- <xsl:call-template name="PrintLengthFacets">
- <xsl:with-param name="simpleRestrict" select="$restriction"/>
- </xsl:call-template>
- </xsl:variable>
-
- <!-- Print out facets -->
- <xsl:if test="$restriction/xsd:enumeration">
- <xsl:text> (</xsl:text>
- <xsl:call-template name="PrintEnumFacets">
- <xsl:with-param name="simpleRestrict" select="$restriction"/>
- </xsl:call-template>
- <xsl:text>)</xsl:text>
- </xsl:if>
- <xsl:if test="$pattern !=''">
- <xsl:text> (</xsl:text>
- <xsl:copy-of select="$pattern"/>
- <xsl:text>)</xsl:text>
- </xsl:if>
- <xsl:if test="$range !=''">
- <xsl:text> (</xsl:text>
- <xsl:copy-of select="$range"/>
- <xsl:text>)</xsl:text>
- </xsl:if>
- <xsl:if test="$restriction/xsd:totalDigits">
- <xsl:text> (</xsl:text>
- <xsl:call-template name="PrintTotalDigitsFacet">
- <xsl:with-param name="simpleRestrict" select="$restriction"/>
- </xsl:call-template>
- <xsl:text>)</xsl:text>
- </xsl:if>
- <xsl:if test="$restriction/xsd:fractionDigits">
- <xsl:text> (</xsl:text>
- <xsl:call-template name="PrintFractionDigitsFacet">
- <xsl:with-param name="simpleRestrict" select="$restriction"/>
- </xsl:call-template>
- <xsl:text>)</xsl:text>
- </xsl:if>
- <xsl:if test="$length !=''">
- <xsl:text> (</xsl:text>
- <xsl:copy-of select="$length"/>
- <xsl:text>)</xsl:text>
- </xsl:if>
- <xsl:if test="$restriction/xsd:whiteSpace">
- <xsl:text> (</xsl:text>
- <xsl:call-template name="PrintWhitespaceFacet">
- <xsl:with-param name="simpleRestrict" select="$restriction"/>
- </xsl:call-template>
- <xsl:text>)</xsl:text>
- </xsl:if>
- </xsl:template>
-
- <!-- ******** Schema Component Representation table ******** -->
-
- <!--
- Prints out the Schema Component Representation table
- for a top-level schema component.
- Param(s):
- component (Node) required
- Top-level schema component
- -->
- <xsl:template name="SchemaComponentTable">
- <xsl:param name="component"/>
-
- <xsl:variable name="componentID">
- <xsl:call-template name="GetComponentID">
- <xsl:with-param name="component" select="$component"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:call-template name="CollapseableBox">
- <xsl:with-param name="id" select="concat($componentID, '_scbox')"/>
- <xsl:with-param name="styleClass">schemaComponent</xsl:with-param>
- <xsl:with-param name="caption">Schema Component Representation</xsl:with-param>
- <xsl:with-param name="contents">
- <xsl:apply-templates select="$component" mode="schemaComponent"/>
- </xsl:with-param>
- <xsl:with-param name="isOpened">false</xsl:with-param>
- </xsl:call-template>
- </xsl:template>
-
- <!--
- Prints out schema component representation of
- declarations.
- Param(s):
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- -->
- <xsl:template match="xsd:attribute[@name] | xsd:element[@name]" mode="schemaComponent">
- <xsl:param name="margin">0</xsl:param>
-
- <xsl:call-template name="DisplaySchemaComponent">
- <xsl:with-param name="component" select="."/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="attributes">
- <!-- Attribute: name -->
- <xsl:call-template name="DisplayAttr">
- <xsl:with-param name="attrName">name</xsl:with-param>
- <xsl:with-param name="attrValue" select="normalize-space(@name)"/>
- </xsl:call-template>
- <!-- Attribute: type -->
- <xsl:if test="@type">
- <xsl:call-template name="DisplayAttr">
- <xsl:with-param name="attrName">type</xsl:with-param>
- <xsl:with-param name="attrValue">
- <xsl:call-template name="PrintTypeRef">
- <xsl:with-param name="ref" select="normalize-space(@type)"/>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:if>
- <!-- Other attributes -->
- <xsl:call-template name="DisplayOtherAttributes">
- <xsl:with-param name="component" select="."/>
- <xsl:with-param name="attrsNotToDisplay">*name+*type+</xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- <xsl:with-param name="excludeFilter">*annotation+</xsl:with-param>
- </xsl:call-template>
- </xsl:template>
-
- <!--
- Prints out schema component representation of
- definitions and key/uniqueness constraints.
- Param(s):
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- -->
- <xsl:template match="xsd:attributeGroup[@name] | xsd:complexType[@name] | xsd:simpleType[@name] | xsd:group[@name] | xsd:key | xsd:unique" mode="schemaComponent">
- <xsl:param name="margin">0</xsl:param>
-
- <xsl:call-template name="DisplaySchemaComponent">
- <xsl:with-param name="component" select="."/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="attributes">
- <!-- Attribute: name -->
- <xsl:call-template name="DisplayAttr">
- <xsl:with-param name="attrName">name</xsl:with-param>
- <xsl:with-param name="attrValue" select="normalize-space(@name)"/>
- </xsl:call-template>
- <!-- Other attributes -->
- <xsl:call-template name="DisplayOtherAttributes">
- <xsl:with-param name="component" select="."/>
- <xsl:with-param name="attrsNotToDisplay">*name+</xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- <xsl:with-param name="excludeFilter">*annotation+</xsl:with-param>
- </xsl:call-template>
- </xsl:template>
-
- <!--
- Prints out schema component representation of attribute
- references.
- Param(s):
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- -->
- <xsl:template match="xsd:attribute[@ref]" mode="schemaComponent">
- <xsl:param name="margin">0</xsl:param>
-
- <xsl:call-template name="DisplaySchemaComponent">
- <xsl:with-param name="component" select="."/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="attributes">
- <!-- Attribute: ref -->
- <xsl:call-template name="DisplayAttr">
- <xsl:with-param name="attrName">ref</xsl:with-param>
- <xsl:with-param name="attrValue">
- <xsl:call-template name="PrintAttributeRef">
- <xsl:with-param name="ref" select="normalize-space(@ref)"/>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- <!-- Other attributes -->
- <xsl:call-template name="DisplayOtherAttributes">
- <xsl:with-param name="component" select="."/>
- <xsl:with-param name="attrsNotToDisplay">*ref+</xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- <xsl:with-param name="excludeFilter">*annotation+</xsl:with-param>
- </xsl:call-template>
- </xsl:template>
-
- <!--
- Prints out schema component representation of attribute group
- references.
- Param(s):
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- -->
- <xsl:template match="xsd:attributeGroup[@ref]" mode="schemaComponent">
- <xsl:param name="margin">0</xsl:param>
-
- <xsl:call-template name="DisplaySchemaComponent">
- <xsl:with-param name="component" select="."/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="attributes">
- <!-- Attribute: ref -->
- <xsl:call-template name="DisplayAttr">
- <xsl:with-param name="attrName">ref</xsl:with-param>
- <xsl:with-param name="attrValue">
- <xsl:call-template name="PrintAttributeGroupRef">
- <xsl:with-param name="ref" select="normalize-space(@ref)"/>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- <!-- Other attributes -->
- <xsl:call-template name="DisplayOtherAttributes">
- <xsl:with-param name="component" select="."/>
- <xsl:with-param name="attrsNotToDisplay">*ref+</xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- <xsl:with-param name="excludeFilter">*annotation+</xsl:with-param>
- </xsl:call-template>
- </xsl:template>
-
- <!--
- Prints out schema component representation of element
- references.
- Param(s):
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- -->
- <xsl:template match="xsd:element[@ref]" mode="schemaComponent">
- <xsl:param name="margin">0</xsl:param>
-
- <xsl:call-template name="DisplaySchemaComponent">
- <xsl:with-param name="component" select="."/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="attributes">
- <!-- Attribute: ref -->
- <xsl:call-template name="DisplayAttr">
- <xsl:with-param name="attrName">ref</xsl:with-param>
- <xsl:with-param name="attrValue">
- <xsl:call-template name="PrintElementRef">
- <xsl:with-param name="ref" select="normalize-space(@ref)"/>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- <!-- Other attributes -->
- <xsl:call-template name="DisplayOtherAttributes">
- <xsl:with-param name="component" select="."/>
- <xsl:with-param name="attrsNotToDisplay">*ref+</xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- <xsl:with-param name="excludeFilter">*annotation+</xsl:with-param>
- </xsl:call-template>
- </xsl:template>
-
- <!--
- Prints out schema component representation of model group
- references.
- Param(s):
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- -->
- <xsl:template match="xsd:group[@ref]" mode="schemaComponent">
- <xsl:param name="margin">0</xsl:param>
-
- <xsl:call-template name="DisplaySchemaComponent">
- <xsl:with-param name="component" select="."/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="attributes">
- <!-- Attribute: ref -->
- <xsl:call-template name="DisplayAttr">
- <xsl:with-param name="attrName">ref</xsl:with-param>
- <xsl:with-param name="attrValue">
- <xsl:call-template name="PrintGroupRef">
- <xsl:with-param name="ref" select="normalize-space(@ref)"/>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- <!-- Other attributes -->
- <xsl:call-template name="DisplayOtherAttributes">
- <xsl:with-param name="component" select="."/>
- <xsl:with-param name="attrsNotToDisplay">*ref+</xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- <xsl:with-param name="excludeFilter">*annotation+</xsl:with-param>
- </xsl:call-template>
- </xsl:template>
-
- <!--
- Prints out schema component representation of
- 'appinfo' and 'documentation' elements.
- Param(s):
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- -->
- <xsl:template match="xsd:appinfo | xsd:documentation" mode="schemaComponent">
- <xsl:param name="margin">0</xsl:param>
-
- <xsl:call-template name="DisplaySchemaComponent">
- <xsl:with-param name="component" select="."/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="attributes">
- <!-- Attribute: source -->
- <xsl:if test="@source">
- <xsl:call-template name="DisplayAttr">
- <xsl:with-param name="attrName">source</xsl:with-param>
- <xsl:with-param name="attrValue">
- <xsl:call-template name="PrintURI">
- <xsl:with-param name="uri" select="normalize-space(@source)"/>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:if>
- <!-- Other attributes -->
- <xsl:call-template name="DisplayOtherAttributes">
- <xsl:with-param name="component" select="."/>
- <xsl:with-param name="attrsNotToDisplay">*source+</xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- <xsl:with-param name="hasAnyContent">true</xsl:with-param>
- </xsl:call-template>
- </xsl:template>
-
- <!--
- Prints out schema component representation of
- key reference constraints.
- Param(s):
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- -->
- <xsl:template match="xsd:keyref" mode="schemaComponent">
- <xsl:param name="margin">0</xsl:param>
-
- <xsl:call-template name="DisplaySchemaComponent">
- <xsl:with-param name="component" select="."/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="attributes">
- <!-- Attribute: name -->
- <xsl:call-template name="DisplayAttr">
- <xsl:with-param name="attrName">name</xsl:with-param>
- <xsl:with-param name="attrValue" select="normalize-space(@name)"/>
- </xsl:call-template>
- <!-- Attribute: refers -->
- <xsl:call-template name="DisplayAttr">
- <xsl:with-param name="attrName">refer</xsl:with-param>
- <xsl:with-param name="attrValue">
- <xsl:call-template name="PrintKeyRef">
- <xsl:with-param name="ref">
- <xsl:value-of select="normalize-space(@refer)"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- <!-- Other attributes -->
- <xsl:call-template name="DisplayOtherAttributes">
- <xsl:with-param name="component" select="."/>
- <xsl:with-param name="attrsNotToDisplay">*name+*refer+</xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- <xsl:with-param name="excludeFilter">*annotation+</xsl:with-param>
- </xsl:call-template>
- </xsl:template>
-
- <!--
- Prints out schema component representation of
- derivations by extension and restrictions.
- Param(s):
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- -->
- <xsl:template match="xsd:extension | xsd:restriction" mode="schemaComponent">
- <xsl:param name="margin">0</xsl:param>
-
- <xsl:call-template name="DisplaySchemaComponent">
- <xsl:with-param name="component" select="."/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="attributes">
- <!-- Attribute: base -->
- <xsl:if test="@base">
- <xsl:call-template name="DisplayAttr">
- <xsl:with-param name="attrName">base</xsl:with-param>
- <xsl:with-param name="attrValue">
- <xsl:call-template name="PrintTypeRef">
- <xsl:with-param name="ref" select="normalize-space(@base)"/>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:if>
- <!-- Other attributes -->
- <xsl:call-template name="DisplayOtherAttributes">
- <xsl:with-param name="component" select="."/>
- <xsl:with-param name="attrsNotToDisplay">*base+</xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- <xsl:with-param name="excludeFilter">*annotation+</xsl:with-param>
- </xsl:call-template>
- </xsl:template>
-
- <!--
- Prints out schema component representation of
- derivations by list.
- Param(s):
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- -->
- <xsl:template match="xsd:list" mode="schemaComponent">
- <xsl:param name="margin">0</xsl:param>
-
- <xsl:call-template name="DisplaySchemaComponent">
- <xsl:with-param name="component" select="."/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="attributes">
- <!-- Attribute: itemType-->
- <xsl:if test="@itemType">
- <xsl:call-template name="DisplayAttr">
- <xsl:with-param name="attrName">itemType</xsl:with-param>
- <xsl:with-param name="attrValue">
- <xsl:call-template name="PrintTypeRef">
- <xsl:with-param name="ref" select="normalize-space(@itemType)"/>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:if>
- <!-- Other attributes -->
- <xsl:call-template name="DisplayOtherAttributes">
- <xsl:with-param name="component" select="."/>
- <xsl:with-param name="attrsNotToDisplay">*itemType+</xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- <xsl:with-param name="excludeFilter">*annotation+</xsl:with-param>
- </xsl:call-template>
- </xsl:template>
-
- <!--
- Prints out schema component representation of
- derivations by union.
- Param(s):
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- -->
- <xsl:template match="xsd:union" mode="schemaComponent">
- <xsl:param name="margin">0</xsl:param>
-
- <xsl:call-template name="DisplaySchemaComponent">
- <xsl:with-param name="component" select="."/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="attributes">
- <!-- Attribute: memberTypes-->
- <xsl:if test="@memberTypes">
- <xsl:call-template name="DisplayAttr">
- <xsl:with-param name="attrName">memberTypes</xsl:with-param>
- <xsl:with-param name="attrValue">
- <xsl:call-template name="PrintWhitespaceList">
- <xsl:with-param name="value" select="normalize-space(@memberTypes)"/>
- <xsl:with-param name="compType">type</xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:if>
- <!-- Other attributes -->
- <xsl:call-template name="DisplayOtherAttributes">
- <xsl:with-param name="component" select="."/>
- <xsl:with-param name="attrsNotToDisplay">*memberTypes+</xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- <xsl:with-param name="excludeFilter">*annotation+</xsl:with-param>
- </xsl:call-template>
- </xsl:template>
-
- <!--
- Prints out schema component representation of
- the root schema element.
- Param(s):
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- -->
- <xsl:template match="xsd:schema" mode="schemaComponent">
- <xsl:param name="margin">0</xsl:param>
-
- <xsl:call-template name="DisplaySchemaComponent">
- <xsl:with-param name="component" select="."/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="attributes">
- <!-- Attribute: source -->
- <xsl:if test="@xml:lang">
- <xsl:call-template name="DisplayAttr">
- <xsl:with-param name="attrName">xml:lang</xsl:with-param>
- <xsl:with-param name="attrValue" select="normalize-space(@xml:lang)"/>
- </xsl:call-template>
- </xsl:if>
- <!-- Other attributes -->
- <xsl:call-template name="DisplayOtherAttributes">
- <xsl:with-param name="component" select="."/>
- <xsl:with-param name="attrsNotToDisplay">*lang+</xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- <xsl:with-param name="includeFilter">*include+*import+*redefine+</xsl:with-param>
- </xsl:call-template>
- </xsl:template>
-
- <!--
- Default way to print out schema component representation.
- Param(s):
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- -->
- <xsl:template match="*" mode="schemaComponent">
- <xsl:param name="margin">0</xsl:param>
-
- <xsl:call-template name="DisplaySchemaComponent">
- <xsl:with-param name="component" select="."/>
- <xsl:with-param name="margin" select="$margin"/>
- <xsl:with-param name="attributes">
- <xsl:call-template name="DisplayOtherAttributes">
- <xsl:with-param name="component" select="."/>
- </xsl:call-template>
- </xsl:with-param>
- <xsl:with-param name="excludeFilter">*annotation+</xsl:with-param>
- </xsl:call-template>
- </xsl:template>
-
- <!--
- Prints out comments in schema component representation.
- Param(s):
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- -->
- <xsl:template match="comment()" mode="schemaComponent">
- <xsl:param name="margin">0</xsl:param>
-
- <div class="comment" style="margin-left: {$margin}em">
- <xsl:text>&lt;--</xsl:text>
- <xsl:value-of select="."/>
- <xsl:text>--&gt;</xsl:text>
- </div>
- </xsl:template>
-
- <!--
- Displays a schema element in the correct format
- for the Schema Component Representation table, e.g.
- tags are one color, and content are another.
- Param(s):
- component (Node) required
- Schema element to be displayed
- attributes (Result Tree Fragment) optional
- Pre-formatted attributes of schema element
- margin (nonNegativeInteger) optional
- Number of 'em' to indent from left
- hasAnyContent (boolean) optional
- Set to true if schema element can accept
- child elements from namespaces other than
- the schema namespace, e.g. 'documentation'
- and 'appinfo'
- includeFilter (String) optional
- List of element names, sandwiched between the
- characters, '*' and '+'. If specified, only the
- child elements of the component with tags in
- the list will be displayed.
- excludeFilter (String) optional
- List of element names, sandwiched between the
- characters, '*' and '+'. If specified, display
- all child elements of the component, except
- those with tags in the list.
- -->
- <xsl:template name="DisplaySchemaComponent">
- <xsl:param name="component"/>
- <xsl:param name="attributes"/>
- <xsl:param name="margin">0</xsl:param>
- <xsl:param name="hasAnyContent">false</xsl:param>
- <xsl:param name="includeFilter"/>
- <xsl:param name="excludeFilter"/>
-
- <xsl:variable name="tag">
- <xsl:call-template name="PrintNSPrefix">
- <xsl:with-param name="prefix">
- <xsl:call-template name="GetXSDPrefix"/>
- </xsl:with-param>
- <xsl:with-param name="nolink">true</xsl:with-param>
- </xsl:call-template>
- <xsl:value-of select="local-name($component)"/>
- </xsl:variable>
-
- <div style="margin-left: {$margin}em">
- <!-- Start Tag -->
- <xsl:text>&lt;</xsl:text>
- <span class="scTag">
- <xsl:copy-of select="$tag"/>
- </span>
- <!-- Attributes -->
- <xsl:copy-of select="$attributes"/>
- <!-- Content -->
- <xsl:variable name="content">
- <xsl:choose>
- <!-- Include filter is on -->
- <xsl:when test="$includeFilter!=''">
- <xsl:apply-templates select="$component/xsd:*[contains($includeFilter, concat('*', local-name(.), '+'))]" mode="schemaComponent">
- <xsl:with-param name="margin" select="$ELEM_INDENT"/>
- </xsl:apply-templates>
- <div class="scContent" style="margin-left: {$ELEM_INDENT}em">...</div>
- </xsl:when>
- <!-- Exclude filter is on -->
- <xsl:when test="$excludeFilter!=''">
- <xsl:apply-templates select="comment() | $component/xsd:*[not(contains($excludeFilter, concat('*', local-name(.), '+')))]" mode="schemaComponent">
- <xsl:with-param name="margin" select="$ELEM_INDENT"/>
- </xsl:apply-templates>
- </xsl:when>
- <!-- Permits any content -->
- <xsl:when test="$hasAnyContent='true'">
- <div class="scContent" style="margin-left: {$ELEM_INDENT}em">
- <xsl:apply-templates select="comment() | $component/* | $component/text()" mode="xpp"/>
- </div>
- </xsl:when>
- <!-- Contains schema elements -->
- <xsl:otherwise>
- <xsl:apply-templates select="comment() | $component/xsd:*" mode="schemaComponent">
- <xsl:with-param name="margin" select="$ELEM_INDENT"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:choose>
- <!-- Has content -->
- <xsl:when test="normalize-space($content)!=''">
- <!-- End of start tag -->
- <xsl:text>></xsl:text>
-
- <!-- Content -->
- <xsl:copy-of select="$content"/>
-
- <!-- End Tag -->
- <xsl:text>&lt;/</xsl:text>
- <span class="scTag">
- <xsl:copy-of select="$tag"/>
- </span>
- <xsl:text>></xsl:text>
- </xsl:when>
- <!-- Empty content -->
- <xsl:otherwise>
- <!-- End of start tag -->
- <xsl:text>/></xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </div>
- </xsl:template>
-
- <!--
- Displays a schema attribute in the correct format
- for the Schema Component Representation table, e.g.
- tags are one color, and content are another.
- Param(s):
- attrName (String) required
- Name of attribute
- attrValue (Result Tree Fragment) required
- Value of attribute, which may be links
- -->
- <xsl:template name="DisplayAttr">
- <xsl:param name="attrName"/>
- <xsl:param name="attrValue"/>
-
- <xsl:text> </xsl:text>
- <span class="scTag">
- <xsl:value-of select="$attrName"/>
- </span>
- <xsl:text>="</xsl:text>
- <xsl:if test="normalize-space($attrValue)!=''">
- <span class="scContent">
- <xsl:copy-of select="$attrValue"/>
- </span>
- </xsl:if>
- <xsl:text>"</xsl:text>
- </xsl:template>
-
- <!--
- Displays attributes from a schema element, unless
- otherwise specified, in the correct format
- for the Schema Component Representation table, e.g.
- tags are one color, and content are another.
- Param(s):
- component (Node) required
- Schema element whose attributes are to be displayed
- attrsNotToDisplay (String) required
- List of attributes not to be displayed
- Each attribute name should prepended with '*'
- and appended with '+'
- -->
- <xsl:template name="DisplayOtherAttributes">
- <xsl:param name="component"/>
- <xsl:param name="attrsNotToDisplay"/>
-
- <xsl:for-each select="$component/attribute::*">
- <xsl:variable name="attrName" select="local-name(.)"/>
- <xsl:if test="not(contains($attrsNotToDisplay, concat('*', $attrName, '+')))">
- <xsl:call-template name="DisplayAttr">
- <xsl:with-param name="attrName" select="normalize-space($attrName)"/>
- <xsl:with-param name="attrValue" select="normalize-space(.)"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:for-each>
- </xsl:template>
-
-
- <!-- ******** XML Pretty Printer ******** -->
-
- <!--
- Puts XHTML elements into the result.
- -->
- <xsl:template match="html:*" mode="html">
- <xsl:element name="{local-name(.)}">
- <xsl:for-each select="@*">
- <xsl:copy-of select="."/>
- </xsl:for-each>
- <xsl:apply-templates select="* | text()" mode="html"/>
- </xsl:element>
- </xsl:template>
-
- <!--
- Displays non-XHTML elements found within XHTML elements.
- -->
- <xsl:template match="*" mode="html">
- <xsl:call-template name="WriteElement">
- <xsl:with-param name="element" select="."/>
- <xsl:with-param name="mode">html</xsl:with-param>
- </xsl:call-template>
- </xsl:template>
-
- <!--
- Displays text node.
- -->
- <xsl:template match="text()" mode="html">
- <xsl:value-of select="."/>
- </xsl:template>
-
- <!--
- Displays an arbitrary XML element.
- -->
- <xsl:template match="*" mode="xpp">
- <code>
- <xsl:call-template name="WriteElement">
- <xsl:with-param name="element" select="."/>
- <xsl:with-param name="mode">xpp</xsl:with-param>
- </xsl:call-template>
- </code>
- </xsl:template>
-
- <!--
- Displays an arbitrary XML text node.
- -->
- <xsl:template match="text()" mode="xpp">
- <xsl:value-of select="."/>
- </xsl:template>
-
- <!--
- Displays an XML comment.
- -->
- <xsl:template match="comment()" mode="xpp">
- <div class="comment">
- <xsl:text>&lt;--</xsl:text>
- <xsl:value-of select="."/>
- <xsl:text>--&gt;</xsl:text>
- </div>
- </xsl:template>
-
- <!--
- Displays an XML element in the documentation, e.g.
- tags are escaped.
- Param(s):
- element (Node) required
- XML element to display
- mode (xpp|html) required
- Which mode to invoke for child elements
- -->
- <xsl:template name="WriteElement">
- <xsl:param name="element"/>
- <xsl:param name="mode">xpp</xsl:param>
-
- <!-- Start Tag -->
- <xsl:text>&lt;</xsl:text>
- <xsl:call-template name="PrintNSPrefix">
- <xsl:with-param name="prefix">
- <xsl:call-template name="GetRefPrefix">
- <xsl:with-param name="ref" select="name($element)"/>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- <xsl:value-of select="local-name($element)"/>
- <!-- Attributes -->
- <xsl:for-each select="$element/@*">
- <xsl:text> </xsl:text>
- <xsl:value-of select="name(.)"/>
- <xsl:text>="</xsl:text>
- <xsl:value-of select="."/>
- <xsl:text>"</xsl:text>
- </xsl:for-each>
-
- <xsl:choose>
- <xsl:when test="$element/* | $element/text()">
- <!-- Close Start Tag -->
- <xsl:text>> </xsl:text>
- <!-- Content -->
- <xsl:choose>
- <xsl:when test="$mode!='xpp'">
- <xsl:apply-templates select="$element/* | $element/text()" mode="html"/>
- </xsl:when>
- <xsl:otherwise>
- <div style="margin-left: {$ELEM_INDENT}em">
- <xsl:apply-templates select="$element/* | $element/text()" mode="xpp"/>
- </div>
- </xsl:otherwise>
- </xsl:choose>
- <!-- End Tag -->
- <xsl:text>&lt;/</xsl:text>
- <xsl:call-template name="PrintNSPrefix">
- <xsl:with-param name="prefix">
- <xsl:call-template name="GetRefPrefix">
- <xsl:with-param name="ref" select="name($element)"/>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- <xsl:value-of select="local-name($element)"/>
- <xsl:text>></xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <!-- Close Start Tag -->
- <xsl:text>/></xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <!-- ******** Templates for Handling References ******** -->
-
- <!--
- Prints out a reference to a term in the glossary section.
- Param(s):
- code (String) required
- Unique ID of glossary term
- term (String) optional
- Glossary term
- -->
- <xsl:template name="PrintGlossaryTermRef">
- <xsl:param name="code"/>
- <xsl:param name="term"/>
-
- <xsl:choose>
- <xsl:when test="$code !='' and normalize-space(translate($printGlossary,'TRUE','true'))='true'">
- <a title="Look up '{$term}' in glossary" href="#{concat($TERM_PREFIX, $code)}">
- <xsl:choose>
- <xsl:when test="$term!=''">
- <xsl:value-of select="$term"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>[term]</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$term"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Prints out a reference to a namespace in the schema.
- Param(s):
- prefix (String) required
- Namespace prefix referenced
- schemaLoc (String) optional
- Schema file containing this namespace prefix;
- if in current schema, 'schemaLoc' is set to 'this'
- -->
- <xsl:template name="PrintNamespaceRef">
- <xsl:param name="prefix"/>
- <xsl:param name="schemaLoc">this</xsl:param>
-
- <xsl:if test="$prefix!=''">
- <xsl:choose>
- <xsl:when test="/xsd:schema/namespace::*[local-name(.)=normalize-space($prefix)]">
- <xsl:variable name="link">
- <xsl:if test="normalize-space($schemaLoc)!='this'">
- <xsl:call-template name="GetSchemaDocLocation">
- <xsl:with-param name="uri" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:value-of select="concat('#', $NS_PREFIX, $prefix)"/>
- </xsl:variable>
- <a href="{$link}" title="Find out namespace of '{$prefix}' prefix">
- <xsl:value-of select="$prefix"/>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="title">
- <xsl:text>Unknown namespace prefix, </xsl:text>
- <xsl:value-of select="$prefix"/>
- <xsl:text>.</xsl:text>
- </xsl:variable>
- <a href="javascript:void(0)" onclick="alert('{$title}')" title="{$title}">
- <xsl:value-of select="$prefix"/>
- </a>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
-
- <!--
- Generates a link to an attribute.
- Param(s):
- name (String) optional
- Name of attribute
- ref (String) optional
- Reference to attribute
- (One of 'name' and 'ref' must be provided.)
- schemaLoc (String) optional
- Schema file containing this attribute reference
- if in current schema, 'schemaLoc' is set to 'this'
- -->
- <xsl:template name="PrintAttributeRef">
- <xsl:param name="name"/>
- <xsl:param name="ref"/>
- <xsl:param name="schemaLoc">this</xsl:param>
-
- <xsl:choose>
- <xsl:when test="$name!=''">
- <xsl:call-template name="PrintCompName">
- <xsl:with-param name="name" select="$name"/>
- <xsl:with-param name="compType">attribute</xsl:with-param>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$ref!=''">
- <xsl:call-template name="PrintCompRef">
- <xsl:with-param name="ref" select="$ref"/>
- <xsl:with-param name="compType">attribute</xsl:with-param>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Generates a link to an attribute group.
- Param(s):
- name (String) optional
- Name of attribute group
- ref (String) optional
- Reference to attribute group
- (One of 'name' and 'ref' must be provided.)
- schemaLoc (String) optional
- Schema file containing this attribute group reference
- if in current schema, 'schemaLoc' is set to 'this'
- -->
- <xsl:template name="PrintAttributeGroupRef">
- <xsl:param name="name"/>
- <xsl:param name="ref"/>
- <xsl:param name="schemaLoc">this</xsl:param>
-
- <xsl:choose>
- <xsl:when test="$name!=''">
- <xsl:call-template name="PrintCompName">
- <xsl:with-param name="name" select="$name"/>
- <xsl:with-param name="compType">attribute group</xsl:with-param>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$ref!=''">
- <xsl:call-template name="PrintCompRef">
- <xsl:with-param name="ref" select="$ref"/>
- <xsl:with-param name="compType">attribute group</xsl:with-param>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Generates a link to an element.
- Param(s):
- name (String) optional
- Name of element
- ref (String) optional
- Reference to element
- (One of 'name' and 'ref' must be provided.)
- schemaLoc (String) optional
- Schema file containing this element reference
- if in current schema, 'schemaLoc' is set to 'this'
- -->
- <xsl:template name="PrintElementRef">
- <xsl:param name="name"/>
- <xsl:param name="ref"/>
- <xsl:param name="schemaLoc">this</xsl:param>
-
- <xsl:choose>
- <xsl:when test="$name!=''">
- <xsl:call-template name="PrintCompName">
- <xsl:with-param name="name" select="$name"/>
- <xsl:with-param name="compType">element</xsl:with-param>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$ref!=''">
- <xsl:call-template name="PrintCompRef">
- <xsl:with-param name="ref" select="$ref"/>
- <xsl:with-param name="compType">element</xsl:with-param>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Generates a link to a group.
- Param(s):
- name (String) optional
- Name of group
- ref (String) optional
- Reference to group
- (One of 'name' and 'ref' must be provided.)
- schemaLoc (String) optional
- Schema file containing this group reference
- if in current schema, 'schemaLoc' is set to 'this'
- -->
- <xsl:template name="PrintGroupRef">
- <xsl:param name="name"/>
- <xsl:param name="ref"/>
- <xsl:param name="schemaLoc">this</xsl:param>
-
- <xsl:choose>
- <xsl:when test="$name!=''">
- <xsl:call-template name="PrintCompName">
- <xsl:with-param name="name" select="$name"/>
- <xsl:with-param name="compType">group</xsl:with-param>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$ref!=''">
- <xsl:call-template name="PrintCompRef">
- <xsl:with-param name="ref" select="$ref"/>
- <xsl:with-param name="compType">group</xsl:with-param>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Generates a link to a key/uniqueness constraint.
- Param(s):
- name (String) optional
- Name of key/uniqueness constraint
- ref (String) optional
- Reference to key/uniqueness constraint
- (One of 'name' and 'ref' must be provided.)
- schemaLoc (String) optional
- Schema file containing this key/uniqueness constraint
- reference; if in current schema, 'schemaLoc' is set
- to 'this'
- -->
- <xsl:template name="PrintKeyRef">
- <xsl:param name="name"/>
- <xsl:param name="ref"/>
- <xsl:param name="schemaLoc">this</xsl:param>
-
- <xsl:choose>
- <xsl:when test="$name!=''">
- <xsl:call-template name="PrintCompName">
- <xsl:with-param name="name" select="$name"/>
- <xsl:with-param name="compType">uniqueness/key constraint</xsl:with-param>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$ref!=''">
- <xsl:call-template name="PrintCompRef">
- <xsl:with-param name="ref" select="$ref"/>
- <xsl:with-param name="compType">uniqueness/key constraint</xsl:with-param>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Generates a link to a type.
- Param(s):
- name (String) optional
- Name of type
- ref (String) optional
- Reference to type
- (One of 'name' and 'ref' must be provided.)
- schemaLoc (String) optional
- Schema file containing this type reference'
- if in current schema, 'schemaLoc' is set
- to 'this'
- -->
- <xsl:template name="PrintTypeRef">
- <xsl:param name="name"/>
- <xsl:param name="ref"/>
- <xsl:param name="schemaLoc">this</xsl:param>
-
- <xsl:choose>
- <xsl:when test="$name!=''">
- <span class="type">
- <xsl:call-template name="PrintCompName">
- <xsl:with-param name="name" select="$name"/>
- <xsl:with-param name="compType">type</xsl:with-param>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </span>
- </xsl:when>
- <xsl:when test="$ref!=''">
- <span class="type">
- <xsl:call-template name="PrintCompRef">
- <xsl:with-param name="ref" select="$ref"/>
- <xsl:with-param name="compType">type</xsl:with-param>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </span>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Prints out a link to a schema component's section.
- Param(s):
- baseFile (String) optional
- Documentation file of schema containing this
- component.
- If this component belongs to the current schema,
- omit this variable.
- If this component is from an included or imported
- schema, provide this variable.
- name (String) required
- Name of schema component
- compType (String) required
- Type of schema component
- errMsg (String) optional
- Sentence fragment.
- If specified, link will open up an alert box with
- an error message. For example, if 'errMsg' was set
- to "could not be found", 'name' was "x", and
- 'compType' was "type", the error message would be:
- "x" type definition could not be found.
- The sentence fragment should not:
- -start with a capital letter.
- -have a space in front
- -end with a period.
- schemaLoc (String) optional
- Schema file containing this component;
- if in current schema, 'schemaLoc' is set to 'this'
- -->
- <xsl:template name="PrintCompName">
- <xsl:param name="baseFile"/>
- <xsl:param name="name"/>
- <xsl:param name="compType"/>
- <xsl:param name="schemaLoc">this</xsl:param>
- <xsl:param name="errMsg"/>
-
- <!-- Get correct terminology for statements -->
- <xsl:variable name="noun">
- <xsl:choose>
- <xsl:when test="$compType='element' or $compType='attribute'">
- <xsl:text>declaration</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>definition</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <!-- Get prefix to use in anchor name. -->
- <xsl:variable name="compPrefix">
- <xsl:choose>
- <xsl:when test="$compType='attribute'">
- <xsl:value-of select="$ATTR_PREFIX"/>
- </xsl:when>
- <xsl:when test="$compType='attribute group'">
- <xsl:value-of select="$ATTR_GRP_PREFIX"/>
- </xsl:when>
- <xsl:when test="$compType='element'">
- <xsl:value-of select="$ELEM_PREFIX"/>
- </xsl:when>
- <xsl:when test="$compType='group'">
- <xsl:value-of select="$GRP_PREFIX"/>
- </xsl:when>
- <xsl:when test="$compType='type'">
- <xsl:value-of select="$TYPE_PREFIX"/>
- </xsl:when>
- <xsl:when test="$compType='uniqueness/key constraint'">
- <xsl:value-of select="$KEY_PREFIX"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
-
- <!-- Get base URI. -->
- <xsl:variable name="baseURI">
- <xsl:choose>
- <xsl:when test="$baseFile!=''">
- <xsl:value-of select="$baseFile"/>
- </xsl:when>
- <xsl:when test="normalize-space($schemaLoc)!='this'">
- <xsl:call-template name="GetSchemaDocLocation">
- <xsl:with-param name="uri" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
-
- <!-- Generate message. -->
- <xsl:variable name="title">
- <xsl:choose>
- <!-- Error message was provided. -->
- <xsl:when test="$errMsg!=''">
- <xsl:text>"</xsl:text><xsl:value-of select="$name"/><xsl:text>" </xsl:text>
- <xsl:value-of select="$compType"/><xsl:text> </xsl:text>
- <xsl:value-of select="$noun"/><xsl:text> </xsl:text>
- <xsl:value-of select="$errMsg"/>
- </xsl:when>
- <!-- There exists a link to the schema component's
- documentation. -->
- <xsl:otherwise>
- <xsl:text>Jump to "</xsl:text>
- <xsl:value-of select="$name"/>
- <xsl:text>" </xsl:text>
- <xsl:value-of select="$compType"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="$noun"/>
- <!-- External link -->
- <xsl:if test="normalize-space($baseURI)!=''">
- <xsl:text>(located in external schema documentation)</xsl:text>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>.</xsl:text>
- </xsl:variable>
-
- <!-- Generate href link -->
- <xsl:variable name="link">
- <xsl:choose>
- <!-- Error message was provided. -->
- <xsl:when test="$errMsg!=''">
- <xsl:text>javascript:void(0)</xsl:text>
- </xsl:when>
- <!-- There exists a link to the schema component's
- documentation. -->
- <xsl:otherwise>
- <!-- Base URI -->
- <xsl:value-of select="normalize-space($baseURI)"/>
- <!-- Anchor within URI -->
- <xsl:value-of select="concat('#',normalize-space($compPrefix),normalize-space($name))"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <a title="{$title}" href="{$link}">
- <!-- External link -->
- <xsl:if test="normalize-space($baseURI)!=''">
- <xsl:attribute name="class">externalLink</xsl:attribute>
- </xsl:if>
-
- <!-- Error message was provided. -->
- <xsl:if test="$errMsg!=''">
- <xsl:attribute name="onclick">
- <xsl:text>alert('</xsl:text>
- <xsl:value-of select="$title"/>
- <xsl:text>');</xsl:text>
- </xsl:attribute>
- </xsl:if>
-
- <xsl:value-of select="$name"/>
- </a>
- </xsl:template>
-
- <!--
- Prints out a reference to a schema component.
- This template will try to work out which schema that this
- component belongs to and print out the appropriate link.
- component.
- It will also print out the namespace prefix given
- in the reference.
- Param(s):
- ref (String) required
- Reference to schema component
- compType (String) required
- Type of schema component
- schemaLoc (String) optional
- Schema file containing this component reference;
- if in current schema, 'schemaLoc' is set to 'this'
- -->
- <xsl:template name="PrintCompRef">
- <xsl:param name="ref"/>
- <xsl:param name="compType"/>
- <xsl:param name="schemaLoc">this</xsl:param>
-
- <!-- Get correct terminology for statements -->
- <xsl:variable name="noun">
- <xsl:choose>
- <xsl:when test="$compType='element' or $compType='attribute'">
- <xsl:text>declaration</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>definition</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <!-- Get local name -->
- <xsl:variable name="refName">
- <xsl:call-template name="GetRefName">
- <xsl:with-param name="ref" select="$ref"/>
- </xsl:call-template>
- </xsl:variable>
-
- <!-- Get prefix -->
- <xsl:variable name="refPrefix">
- <xsl:call-template name="GetRefPrefix">
- <xsl:with-param name="ref" select="$ref"/>
- </xsl:call-template>
- </xsl:variable>
-
- <!-- Get prefix of this schema's target namespace -->
- <xsl:variable name="tnPrefix">
- <xsl:call-template name="GetThisPrefix"/>
- </xsl:variable>
-
- <!-- Get file location of the schema component that is
- being referenced. -->
- <xsl:variable name="compLoc">
- <xsl:call-template name="FindComponent">
- <xsl:with-param name="ref" select="$ref"/>
- <xsl:with-param name="compType" select="$compType"/>
- </xsl:call-template>
- </xsl:variable>
-
- <!-- Print prefix -->
- <xsl:call-template name="PrintNSPrefix">
- <xsl:with-param name="prefix" select="$refPrefix"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
-
- <!-- Print local name -->
- <xsl:choose>
- <!-- Component from XML Schema's or XML's namespace -->
- <xsl:when test="normalize-space($compLoc)='xsd' or normalize-space($compLoc)='xml'">
- <xsl:value-of select="$refName"/>
- </xsl:when>
- <!-- Component found in this schema. -->
- <xsl:when test="normalize-space($compLoc)='this'">
- <xsl:call-template name="PrintCompName">
- <xsl:with-param name="name" select="$refName"/>
- <xsl:with-param name="compType" select="$compType"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Component not found. -->
- <xsl:when test="normalize-space($compLoc)='' or normalize-space($compLoc)='none'">
- <xsl:call-template name="PrintCompName">
- <xsl:with-param name="name" select="$refName"/>
- <xsl:with-param name="compType" select="$compType"/>
- <xsl:with-param name="errMsg">could not be found</xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <!-- Component found in an external schema. -->
- <xsl:otherwise>
- <!-- Get documentation file for included schema. -->
- <xsl:variable name="docFile">
- <xsl:call-template name="GetSchemaDocLocation">
- <xsl:with-param name="uri" select="$compLoc"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:call-template name="PrintCompName">
- <xsl:with-param name="baseFile" select="$docFile"/>
- <xsl:with-param name="name" select="$refName"/>
- <xsl:with-param name="compType" select="$compType"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <!-- ******** Templates for Finding Components in Different
- Schema documents ******** -->
-
- <!-- Special key words: xml, xsd, this, none -->
- <xsl:template name="FindComponent">
- <xsl:param name="ref"/>
- <xsl:param name="compType"/>
-
- <!-- Get local name -->
- <xsl:variable name="refName">
- <xsl:call-template name="GetRefName">
- <xsl:with-param name="ref" select="$ref"/>
- </xsl:call-template>
- </xsl:variable>
-
- <!-- Get prefix -->
- <xsl:variable name="refPrefix">
- <xsl:call-template name="GetRefPrefix">
- <xsl:with-param name="ref" select="$ref"/>
- </xsl:call-template>
- </xsl:variable>
-
- <!-- Get prefix of this schema's target namespace -->
- <xsl:variable name="tnPrefix">
- <xsl:call-template name="GetThisPrefix"/>
- </xsl:variable>
-
- <!-- Get prefix of XML Schema -->
- <xsl:variable name="xsdPrefix">
- <xsl:call-template name="GetXSDPrefix"/>
- </xsl:variable>
-
- <xsl:choose>
- <!-- Schema component from XML Schema's namespace,
- unless this schema is for XML Schema -->
- <xsl:when test="$refPrefix=$xsdPrefix and $xsdPrefix!=$tnPrefix">
- <xsl:text>xsd</xsl:text>
- </xsl:when>
- <!-- Schema component from XML's namespace -->
- <xsl:when test="$refPrefix='xml'">
- <xsl:text>xml</xsl:text>
- </xsl:when>
- <!-- Schema component from current schema's namespace -->
- <xsl:when test="$refPrefix=$tnPrefix">
- <xsl:call-template name="FindComponentInSchema">
- <xsl:with-param name="name" select="$refName"/>
- <xsl:with-param name="compType" select="$compType"/>
- <xsl:with-param name="schema" select="/xsd:schema"/>
- <xsl:with-param name="schemaFileLoc">this</xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <!-- Schema component from imported namespace -->
- <xsl:when test="normalize-space(translate($searchImportedSchemas, 'TRUE', 'true'))='true'">
- <xsl:variable name="refNS" select="/xsd:schema/namespace::*[local-name(.)=normalize-space($refPrefix)]"/>
- <xsl:call-template name="FindComponentInImportedSchemas">
- <xsl:with-param name="name" select="$refName"/>
- <xsl:with-param name="compType" select="$compType"/>
- <xsl:with-param name="compNS" select="$refNS"/>
- <xsl:with-param name="schema" select="/xsd:schema"/>
- <xsl:with-param name="index">1</xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="FindComponentInSchema">
- <xsl:param name="name"/>
- <xsl:param name="compType"/>
- <xsl:param name="schema"/>
- <xsl:param name="schemaFileLoc"/>
- <xsl:param name="schemasSearched"/>
-
- <!-- Don't examine this schema if we've already
- searched it. Prevents infinite recursion.
- Also check if schema actually exists. -->
- <xsl:if test="$schema and not(contains($schemasSearched, concat('*', $schemaFileLoc, '+')))">
- <!-- Find out if the component is in this schema -->
- <xsl:variable name="thisResult">
- <xsl:call-template name="IsComponentInSchema">
- <xsl:with-param name="name" select="$name"/>
- <xsl:with-param name="compType" select="$compType"/>
- <xsl:with-param name="schema" select="$schema"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:choose>
- <!-- Component found -->
- <xsl:when test="normalize-space($thisResult)='true'">
- <xsl:value-of select="$schemaFileLoc"/>
- </xsl:when>
- <!-- Component not found -->
- <xsl:when test="normalize-space(translate($searchIncludedSchemas, 'TRUE', 'true'))='true'">
- <!-- Search included schemas -->
- <xsl:variable name="includeResult">
- <xsl:call-template name="FindComponentInIncludedSchemas">
- <xsl:with-param name="schema" select="$schema"/>
- <xsl:with-param name="name" select="$name"/>
- <xsl:with-param name="compType" select="$compType"/>
- <xsl:with-param name="index">1</xsl:with-param>
- <xsl:with-param name="schemasSearched" select="concat($schemasSearched, '*', $schemaFileLoc, '+')"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="normalize-space($includeResult)!='' and normalize-space($includeResult)!='none'">
- <xsl:value-of select="$includeResult"/>
- </xsl:when>
- <xsl:otherwise>
- <!-- Search redefined schemas -->
- <xsl:call-template name="FindComponentInRedefinedSchemas">
- <xsl:with-param name="schema" select="$schema"/>
- <xsl:with-param name="name" select="$name"/>
- <xsl:with-param name="compType" select="$compType"/>
- <xsl:with-param name="index">1</xsl:with-param>
- <xsl:with-param name="schemasSearched" select="concat($schemasSearched, '*', $schemaFileLoc, '+')"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
-
- <xsl:template name="IsComponentInSchema">
- <xsl:param name="name"/>
- <xsl:param name="compType"/>
- <xsl:param name="schema"/>
-
- <xsl:choose>
- <!-- Schema not found. -->
- <xsl:when test="not($schema)">
- <xsl:text>false</xsl:text>
- </xsl:when>
- <!-- Search for attribute declaration. -->
- <xsl:when test="$compType='attribute' and $schema/xsd:attribute[@name=$name]">
- <xsl:text>true</xsl:text>
- </xsl:when>
- <!-- Search for attribute group definition. -->
- <xsl:when test="$compType='attribute group' and ($schema/xsd:attributeGroup[@name=$name] or $schema/xsd:redefine/xsd:attributeGroup[@name=$name])">
- <xsl:text>true</xsl:text>
- </xsl:when>
- <!-- Search for element declaration. -->
- <xsl:when test="$compType='element' and $schema/xsd:element[@name=$name]">
- <xsl:text>true</xsl:text>
- </xsl:when>
- <!-- Search for group definition. -->
- <xsl:when test="$compType='group' and ($schema/xsd:group[@name=$name] or $schema/xsd:redefine/xsd:group[@name=$name])">
- <xsl:text>true</xsl:text>
- </xsl:when>
- <!-- Search for complex type definition. -->
- <xsl:when test="($compType='type' or $compType='complex type') and ($schema/xsd:complexType[@name=$name] or $schema/xsd:redefine/xsd:complexType[@name=$name])">
- <xsl:text>true</xsl:text>
- </xsl:when>
- <!-- Search for simple type definition. -->
- <xsl:when test="($compType='type' or $compType='simple type') and ($schema/xsd:simpleType[@name=$name] or $schema/xsd:redefine/xsd:simpleType[@name=$name])">
- <xsl:text>true</xsl:text>
- </xsl:when>
- <!-- Search for uniqueness/key constraint definition. -->
- <xsl:when test="$compType='uniqueness/key constraint' and ($schema//xsd:element/xsd:key[@name=$name] or $schema//xsd:element/xsd:unique[@name=$name])">
- <xsl:text>true</xsl:text>
- </xsl:when>
- <!-- Component not found. -->
- <xsl:otherwise>
- <xsl:text>false</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="FindComponentInIncludedSchemas">
- <xsl:param name="schema"/>
- <xsl:param name="name"/>
- <xsl:param name="compType"/>
- <xsl:param name="schemasSearched"/>
- <xsl:param name="index">1</xsl:param>
-
- <xsl:if test="count($schema/xsd:include) &gt;= number($index)">
- <!-- Get the 'schemaLocation' attribute of the 'include'
- element in this schema at position, 'index'. -->
- <xsl:variable name="schemaLoc" select="$schema/xsd:include[position()=$index]/@schemaLocation"/>
-
- <xsl:variable name="thisResult">
- <!-- Search for the component in the current
- included schema. -->
- <xsl:call-template name="FindComponentInSchema">
- <xsl:with-param name="name" select="$name"/>
- <xsl:with-param name="compType" select="$compType"/>
- <xsl:with-param name="schema" select="document($schemaLoc)/xsd:schema"/>
- <xsl:with-param name="schemaFileLoc" select="$schemaLoc"/>
- <xsl:with-param name="schemasSearched" select="$schemasSearched"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:choose>
- <!-- Component was found, so return result. -->
- <xsl:when test="normalize-space($thisResult)!='' and normalize-space($thisResult)!='none'">
- <xsl:value-of select="$thisResult"/>
- </xsl:when>
- <!-- Component was not found, so keep on searching. -->
- <xsl:otherwise>
- <!-- Examine other included schemas in this schema -->
- <xsl:call-template name="FindComponentInIncludedSchemas">
- <xsl:with-param name="schema" select="$schema"/>
- <xsl:with-param name="name" select="$name"/>
- <xsl:with-param name="compType" select="$compType"/>
- <xsl:with-param name="index" select="number($index)+1"/>
- <xsl:with-param name="schemasSearched" select="concat($schemasSearched, '*', $schemaLoc, '+')"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
-
- <xsl:template name="FindComponentInRedefinedSchemas">
- <xsl:param name="schema"/>
- <xsl:param name="name"/>
- <xsl:param name="compType"/>
- <xsl:param name="schemasSearched"/>
- <xsl:param name="index">1</xsl:param>
-
- <xsl:if test="count($schema/xsd:redefine) &gt;= number($index)">
- <!-- Get the 'schemaLocation' attribute of the 'redefine'
- element in this schema at position, 'index'. -->
- <xsl:variable name="schemaLoc" select="$schema/xsd:redefine[position()=$index]/@schemaLocation"/>
-
- <xsl:variable name="thisResult">
- <!-- Search for the component in the current
- redefined schema. -->
- <xsl:call-template name="FindComponentInSchema">
- <xsl:with-param name="name" select="$name"/>
- <xsl:with-param name="compType" select="$compType"/>
- <xsl:with-param name="schema" select="document($schemaLoc)/xsd:schema"/>
- <xsl:with-param name="schemaFileLoc" select="$schemaLoc"/>
- <xsl:with-param name="schemasSearched" select="$schemasSearched"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:choose>
- <!-- Component was found, so return result. -->
- <xsl:when test="normalize-space($thisResult)!='' and normalize-space($thisResult)!='none'">
- <xsl:value-of select="$thisResult"/>
- </xsl:when>
- <!-- Component was not found, so keep on searching. -->
- <xsl:otherwise>
- <!-- Examine other redefined schemas in this schema -->
- <xsl:call-template name="FindComponentInRedefinedSchemas">
- <xsl:with-param name="schema" select="$schema"/>
- <xsl:with-param name="name" select="$name"/>
- <xsl:with-param name="compType" select="$compType"/>
- <xsl:with-param name="index" select="number($index)+1"/>
- <xsl:with-param name="schemasSearched" select="concat($schemasSearched, '*', $schemaLoc, '+')"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
-
- <xsl:template name="FindComponentInImportedSchemas">
- <xsl:param name="schema"/>
- <xsl:param name="name"/>
- <xsl:param name="compType"/>
- <xsl:param name="compNS"/>
- <xsl:param name="schemasSearched"/>
- <xsl:param name="index">1</xsl:param>
-
- <xsl:if test="count($schema/xsd:import) &gt;= number($index)">
- <!-- Get the 'namespace' attribute of the 'import'
- element in this schema at position, 'index'. -->
- <xsl:variable name="schemaNS" select="$schema/xsd:import[position()=$index]/@namespace"/>
- <!-- Get the 'schemaLocation' attribute. -->
- <xsl:variable name="schemaLoc" select="$schema/xsd:import[position()=$index]/@schemaLocation"/>
-
- <xsl:variable name="thisResult">
- <!-- Check that the imported schema has the matching
- namespace as the component that we're looking
- for. -->
- <xsl:if test="normalize-space($compNS)=normalize-space($schemaNS)">
- <!-- Search for the component in the current
- imported schema. -->
- <xsl:call-template name="FindComponentInSchema">
- <xsl:with-param name="name" select="$name"/>
- <xsl:with-param name="compType" select="$compType"/>
- <xsl:with-param name="schema" select="document($schemaLoc)/xsd:schema"/>
- <xsl:with-param name="schemaFileLoc" select="$schemaLoc"/>
- <xsl:with-param name="schemasSearched" select="$schemasSearched"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:variable>
-
- <xsl:choose>
- <!-- Component was found, so return result. -->
- <xsl:when test="normalize-space($thisResult)!='' and normalize-space($thisResult)!='none'">
- <xsl:value-of select="$thisResult"/>
- </xsl:when>
- <!-- Component was not found, so keep on searching. -->
- <xsl:otherwise>
- <!-- Examine other included schemas in this schema -->
- <xsl:call-template name="FindComponentInImportedSchemas">
- <xsl:with-param name="schema" select="$schema"/>
- <xsl:with-param name="name" select="$name"/>
- <xsl:with-param name="compType" select="$compType"/>
- <xsl:with-param name="compNS" select="$compNS"/>
- <xsl:with-param name="index" select="number($index)+1"/>
- <xsl:with-param name="schemasSearched" select="concat($schemasSearched, '*', $schemaLoc, '+')"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
-
-
- <!-- ******** General Utility Templates ******** -->
-
- <!--
- Creates a box that can be opened and closed, such
- that the contents can be hidden away until a button
- is pressed.
- Param(s):
- id (String) required
- Unique ID of the 'div' box
- caption (String) required
- Text describing the contents of the box;
- it will always be shown even when the box
- is closed
- contents (String) required
- Contents of box, which may appear and disappear
- with the press of a button.
- anchor (String) optional
- Anchor, e.g. <a name="...", for this box
- styleClass (String) optional
- Additional CSS class for the entire collapseable box
- isOpened (String) optional
- Set to true if initially opened, and
- false if initially closed
- -->
- <xsl:template name="CollapseableBox">
- <xsl:param name="id"/>
- <xsl:param name="caption"/>
- <xsl:param name="contents"/>
- <xsl:param name="anchor"/>
- <xsl:param name="styleClass"/>
- <xsl:param name="isOpened">false</xsl:param>
-
- <xsl:variable name="buttonID" select="concat($id, '_button')"/>
-
- <div class="{$styleClass} box">
- <div>
- <!-- Button to control the opening and closing of the 'div' box -->
- <xsl:if test="normalize-space(translate($useJavaScript,'TRUE','true'))='true'">
- <input type="button" id="{$buttonID}" class="control" onclick="switchState('{$id}'); return false;" style="display: none"/>
- <!--
- Button's 'display' property is set to 'none',
- so that button will only be displayed if
- box can be successfully opened and closed.
- -->
- </xsl:if>
- <!-- Box Title -->
- <xsl:text> </xsl:text>
- <span class="caption">
- <xsl:choose>
- <xsl:when test="$anchor != ''">
- <a name="{$anchor}">
- <xsl:value-of select="$caption"/>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$caption"/>
- </xsl:otherwise>
- </xsl:choose>
- </span>
- </div>
-
- <!-- Box Contents -->
- <div id="{$id}" class="contents">
- <xsl:copy-of select="$contents"/>
- </div>
- <xsl:if test="normalize-space(translate($useJavaScript,'TRUE','true'))='true'">
- <xsl:call-template name="PrintJSCode">
- <xsl:with-param name="code">setState('<xsl:value-of select="$id"/>', <xsl:value-of select="$isOpened"/>);</xsl:with-param>
- </xsl:call-template>
- </xsl:if>
- </div>
- </xsl:template>
-
- <!--
- Returns the namespace of an attribute
- declaration or reference.
- Param(s):
- attribute (Node) required
- Attribute declaration or reference
- -->
- <xsl:template name="GetAttributeNS">
- <xsl:param name="attribute"/>
-
- <xsl:choose>
- <!-- Qualified local attribute declaration -->
- <xsl:when test="$attribute[@name] and (normalize-space(translate($attribute/@form, 'QUALIFED', 'qualifed'))='qualified' or normalize-space(translate(/xsd:schema/@attributeFormDefault, 'QUALIFED', 'qualifed'))='qualified')">
- <xsl:value-of select="/xsd:schema/@targetNamespace"/>
- </xsl:when>
- <!-- Reference to global attribute declaration -->
- <xsl:when test="$attribute[@ref]">
- <xsl:call-template name="GetRefNS">
- <xsl:with-param name="ref" select="$attribute/@ref"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Otherwise, attribute has no namespace -->
- </xsl:choose>
- </xsl:template>
-
- <!--
- Returns the description that can be used in
- headers for a schema component.
- Param(s):
- component (Node) required
- Schema component
- -->
- <xsl:template name="GetComponentDescription">
- <xsl:param name="component"/>
-
- <xsl:choose>
- <xsl:when test="local-name($component)='all'">
- <xsl:text>All Model Group</xsl:text>
- </xsl:when>
- <xsl:when test="local-name($component)='attribute'">
- <xsl:text>Attribute</xsl:text>
- </xsl:when>
- <xsl:when test="local-name($component)='attributeGroup'">
- <xsl:text>Attribute Group</xsl:text>
- </xsl:when>
- <xsl:when test="local-name($component)='choice'">
- <xsl:text>Choice Model Group</xsl:text>
- </xsl:when>
- <xsl:when test="local-name($component)='complexType'">
- <xsl:text>Complex Type</xsl:text>
- </xsl:when>
- <xsl:when test="local-name($component)='element'">
- <xsl:text>Element</xsl:text>
- </xsl:when>
- <xsl:when test="local-name($component)='group'">
- <xsl:text>Model Group</xsl:text>
- </xsl:when>
- <xsl:when test="local-name($component)='notation'">
- <xsl:text>Notation</xsl:text>
- </xsl:when>
- <xsl:when test="local-name($component)='sequence'">
- <xsl:text>Sequence Model Group</xsl:text>
- </xsl:when>
- <xsl:when test="local-name($component)='simpleType'">
- <xsl:text>Simple Type</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="HandleError">
- <xsl:with-param name="isTerminating">true</xsl:with-param>
- <xsl:with-param name="errorMsg">
-Unknown schema component, <xsl:value-of select="local-name($component)"/>.
- </xsl:with-param>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Returns the unique identifier for a top-level schema
- component. Returns the string "schema" if the 'component'
- is the root schema element.
- Param(s):
- component (Node) required
- Schema component
- -->
- <xsl:template name="GetComponentID">
- <xsl:param name="component"/>
-
- <xsl:choose>
- <xsl:when test="local-name($component)='schema'">
- <xsl:text>schema</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="componentPrefix">
- <xsl:call-template name="GetComponentPrefix">
- <xsl:with-param name="component" select="$component"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="concat($componentPrefix, $component/@name)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Returns the prefix to add in front of a schema component
- name when generating anchor names.
- Param(s):
- component (Node) required
- Schema component
- -->
- <xsl:template name="GetComponentPrefix">
- <xsl:param name="component"/>
-
- <xsl:choose>
- <xsl:when test="local-name($component)='attribute'">
- <xsl:value-of select="$ATTR_PREFIX"/>
- </xsl:when>
- <xsl:when test="local-name($component)='attributeGroup'">
- <xsl:value-of select="$ATTR_GRP_PREFIX"/>
- </xsl:when>
- <xsl:when test="local-name($component)='complexType'">
- <xsl:value-of select="$CTYPE_PREFIX"/>
- </xsl:when>
- <xsl:when test="local-name($component)='element'">
- <xsl:value-of select="$ELEM_PREFIX"/>
- </xsl:when>
- <xsl:when test="local-name($component)='group'">
- <xsl:value-of select="$GRP_PREFIX"/>
- </xsl:when>
- <xsl:when test="local-name($component)='notation'">
- <xsl:value-of select="$NOTA_PREFIX"/>
- </xsl:when>
- <xsl:when test="local-name($component)='simpleType'">
- <xsl:value-of select="$STYPE_PREFIX"/>
- </xsl:when>
- <xsl:when test="local-name($component)='key' or local-name($component)='unique'">
- <xsl:value-of select="$KEY_PREFIX"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="HandleError">
- <xsl:with-param name="isTerminating">true</xsl:with-param>
- <xsl:with-param name="errorMsg">
-Unknown schema component, <xsl:value-of select="local-name($component)"/>.
- </xsl:with-param>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Returns a glossary term reference for the
- schema component type, if applicable.
- Param(s):
- component (Node) required
- Schema component
- -->
- <xsl:template name="GetComponentTermRef">
- <xsl:param name="component"/>
-
- <xsl:choose>
- <xsl:when test="local-name($component)='notation'">
- <xsl:text>Notation</xsl:text>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Returns the namespace prefix of an attribute.
- Param(s):
- attribute (Node) required
- Attribute declaration or reference
- -->
- <xsl:template name="GetAttributePrefix">
- <xsl:param name="attribute"/>
-
- <xsl:choose>
- <!-- Element reference -->
- <xsl:when test="$attribute/@ref">
- <xsl:call-template name="GetRefPrefix">
- <xsl:with-param name="ref" select="$attribute/@ref"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Global element declaration -->
- <xsl:when test="local-name($attribute/..)='schema'">
- <xsl:call-template name="GetThisPrefix"/>
- </xsl:when>
- <!-- Local element declaration -->
- <xsl:otherwise>
- <xsl:if test="($attribute/@form and normalize-space($attribute/@form)='qualified') or (/xsd:schema/@attributeFormDefault and normalize-space(/xsd:schema/@attributeFormDefault)='qualified')">
- <xsl:call-template name="GetThisPrefix"/>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Returns the namespace prefix of an element.
- Param(s):
- element (Node) required
- Element declaration or reference
- -->
- <xsl:template name="GetElementPrefix">
- <xsl:param name="element"/>
-
- <xsl:choose>
- <!-- Element reference -->
- <xsl:when test="$element/@ref">
- <xsl:call-template name="GetRefPrefix">
- <xsl:with-param name="ref" select="$element/@ref"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Global element declaration -->
- <xsl:when test="local-name($element/..)='schema'">
- <xsl:call-template name="GetThisPrefix"/>
- </xsl:when>
- <!-- Local element declaration -->
- <xsl:otherwise>
- <xsl:if test="($element/@form and normalize-space($element/@form)='qualified') or (/xsd:schema/@elementFormDefault and normalize-space(/xsd:schema/@elementFormDefault)='qualified')">
- <xsl:call-template name="GetThisPrefix"/>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Returns the local name of a reference.
- Param(s):
- ref (String) required
- Reference
- -->
- <xsl:template name="GetRefName">
- <xsl:param name="ref"/>
-
- <xsl:choose>
- <xsl:when test="contains($ref, ':')">
- <!-- Ref has namespace prefix -->
- <xsl:value-of select="substring-after($ref, ':')"/>
- </xsl:when>
- <xsl:otherwise>
- <!-- Ref has no namespace prefix -->
- <xsl:value-of select="$ref"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Returns the namespace prefix of a reference.
- Param(s):
- ref (String) required
- Reference
- -->
- <xsl:template name="GetRefPrefix">
- <xsl:param name="ref"/>
- <!-- Get namespace prefix -->
- <xsl:value-of select="substring-before($ref, ':')"/>
- </xsl:template>
-
- <!--
- Returns the namespace of a reference.
- Param(s):
- ref (String) required
- Reference
- -->
- <xsl:template name="GetRefNS">
- <xsl:param name="ref"/>
- <!-- Get namespace prefix -->
- <xsl:variable name="refPrefix" select="substring-before($ref, ':')"/>
- <!-- Get namespace -->
- <xsl:value-of select="/xsd:schema/namespace::*[local-name(.)=normalize-space($refPrefix)]"/>
- </xsl:template>
-
- <!--
- Returns the declared prefix of this schema's target namespace.
- -->
- <xsl:template name="GetThisPrefix">
- <xsl:if test="/xsd:schema/@targetNamespace">
- <xsl:value-of select="local-name(/xsd:schema/namespace::*[normalize-space(.)=normalize-space(/xsd:schema/@targetNamespace)])"/>
- </xsl:if>
- </xsl:template>
-
- <!--
- Returns the declared prefix of XML Schema namespace.
- -->
- <xsl:template name="GetXSDPrefix">
- <xsl:value-of select="local-name(/xsd:schema/namespace::*[normalize-space(.)=$XSD_NS])"/>
- </xsl:template>
-
- <!--
- Returns the schema documentation file location for a
- given URI for a schema, done by looking up the file
- specified in 'linksFile' variable.
- It'll throw a fatal error if a value for 'linksFile' was
- provided and the documentation file for 'uri' could not be
- found.
- Param(s):
- uri (String) required
- Location of schema file
- -->
- <xsl:template name="GetSchemaDocLocation">
- <xsl:param name="uri"/>
-
- <xsl:if test="$linksFile!=''">
- <xsl:variable name="schemaDocFile" select="document($linksFile)/ppp:links/ppp:schema[@file-location=$uri]/@docfile-location"/>
- <xsl:if test="$schemaDocFile=''">
- <xsl:call-template name="HandleError">
- <xsl:with-param name="isTerminating">true</xsl:with-param>
- <xsl:with-param name="errorMsg">
-Documentation file for the schema at, <xsl:value-of select="$uri"/>,
-was not specified in the links file, <xsl:value-of select="$linksFile"/>.
- </xsl:with-param>
- </xsl:call-template>
- </xsl:if>
- <xsl:value-of select="$schemaDocFile"/>
- </xsl:if>
- </xsl:template>
-
- <!--
- Prints out a boolean value.
- Param(s):
- boolean (String) required
- Boolean value
- -->
- <xsl:template name="PrintBoolean">
- <xsl:param name="boolean"/>
-
- <xsl:choose>
- <xsl:when test="normalize-space(translate($boolean,'TRUE', 'true'))='true' or normalize-space($boolean)='1'">
- <xsl:text>yes</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>no</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Prints out a link to the namespace of a prefix,
- and tacks on a colon in the end.
- Param(s):
- prefix (String) required
- Namespace prefix
- nolink (boolean) optional
- If true, doesn't provide a link to the
- namespace in the namespaces table.
- schemaLoc (String) optional
- Schema file containing this namespace prefix;
- if in current schema, 'schemaLoc' is set to 'this'
- -->
- <xsl:template name="PrintNSPrefix">
- <xsl:param name="prefix"/>
- <xsl:param name="nolink">false</xsl:param>
- <xsl:param name="schemaLoc">this</xsl:param>
-
- <xsl:if test="$prefix!='' and normalize-space(translate($printNSPrefixes,'TRUE','true'))='true'">
- <xsl:choose>
- <xsl:when test="$nolink='false'">
- <xsl:call-template name="PrintNamespaceRef">
- <xsl:with-param name="prefix" select="$prefix"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$prefix"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>:</xsl:text>
- </xsl:if>
- </xsl:template>
-
- <!--
- Prints out the min/max occurrences of a schema component.
- Param(s):
- component (Node) optional
- Schema component
- minOccurs (String) optional
- Minimum occurrences
- maxOccurs (String) optional
- Maximum occurrences
- -->
- <xsl:template name="PrintOccurs">
- <xsl:param name="component"/>
- <xsl:param name="minOccurs"/>
- <xsl:param name="maxOccurs"/>
-
- <!-- Get min occurs -->
- <xsl:variable name="min">
- <xsl:choose>
- <xsl:when test="$component and local-name($component)='attribute'">
- <xsl:choose>
- <xsl:when test="normalize-space($component/@use)='required'">
- <xsl:text>1</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>0</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$component and $component/@minOccurs">
- <xsl:value-of select="$component/@minOccurs"/>
- </xsl:when>
- <xsl:when test="$minOccurs != ''">
- <xsl:value-of select="$minOccurs"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>1</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- Get max occurs -->
- <xsl:variable name="max">
- <xsl:choose>
- <xsl:when test="$component and local-name($component)='attribute'">
- <xsl:choose>
- <xsl:when test="normalize-space($component/@use)='prohibited'">
- <xsl:text>0</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>1</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="($component and normalize-space($component/@maxOccurs)='unbounded') or $maxOccurs='unbounded'">
- <xsl:text>*</xsl:text>
- </xsl:when>
- <xsl:when test="$component and $component/@maxOccurs">
- <xsl:value-of select="$component/@maxOccurs"/>
- </xsl:when>
- <xsl:when test="$maxOccurs != ''">
- <xsl:value-of select="$maxOccurs"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>1</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <span class="occurs">
- <xsl:choose>
- <xsl:when test="number($min)=1 and number($max)=1">
- <xsl:text>[1]</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>[</xsl:text>
- <xsl:value-of select="$min"/>
- <xsl:text>..</xsl:text>
- <xsl:value-of select="$max"/>
- <xsl:text>]</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </span>
- </xsl:template>
-
- <!--
- Translates occurrence of '#all' in 'block' value
- of element declarations.
- Param(s):
- EBV (String) required
- Value
- -->
- <xsl:template name="PrintBlockSet">
- <xsl:param name="EBV"/>
-
- <xsl:choose>
- <xsl:when test="normalize-space($EBV)='#all'">
- <xsl:text>restriction, extension, substitution</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$EBV"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Translates occurrence of '#all' in 'final' value
- of element declarations, and 'block' and 'final' values
- in complex type definitions.
- Param(s):
- EBV (String) required
- Value
- -->
- <xsl:template name="PrintDerivationSet">
- <xsl:param name="EBV"/>
-
- <xsl:choose>
- <xsl:when test="normalize-space($EBV)='#all'">
- <xsl:text>restriction, extension</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$EBV"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Translates occurrence of '#all' in 'final' value
- of simple type definitions.
- Param(s):
- EBV (String) required
- Value
- -->
- <xsl:template name="PrintSimpleDerivationSet">
- <xsl:param name="EBV"/>
-
- <xsl:choose>
- <xsl:when test="normalize-space($EBV)='#all'">
- <xsl:text>restriction, list, union</xsl:text>
- </xsl:when>
- <xsl:when test="normalize-space($EBV)!=''">
- <xsl:value-of select="$EBV"/>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Print out a URI. If it starts with 'http', a link is provided.
- Param(s):
- uri (String) required
- URI to be printed
- -->
- <xsl:template name="PrintURI">
- <xsl:param name="uri"/>
-
- <xsl:choose>
- <xsl:when test="starts-with($uri, 'http')">
- <a title="{$uri}" href="{$uri}">
- <xsl:value-of select="$uri"/>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$uri"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Print out a link to the documentation of schema document.
- For this happen, the 'linksFile' variable must be provided,
- it must point to an actual file, and in that file, there
- must be a mapping from the schema file location to the
- schema documentation file location.
- Param(s):
- uri (String) required
- Location of schema file
- -->
- <xsl:template name="PrintSchemaLink">
- <xsl:param name="uri"/>
-
- <xsl:variable name="docFileLoc">
- <xsl:call-template name="GetSchemaDocLocation">
- <xsl:with-param name="uri" select="$uri"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="$docFileLoc!=''">
- <a title="Jump to schema documentation for '{$uri}'." href="{$docFileLoc}">
- <xsl:value-of select="$uri"/>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$uri"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Tokenises a whitespace-separated list of values, and
- displays them appropriately.
- Param(s):
- value (String) required
- Whitespace-separated list
- compType (String) optional
- Specify schema component type if values in list are
- schema components, so appropriate links can be provided.
- isInList (boolean) optional
- If true, place each value within 'li' tags.
- Assumes that this template is called within an HTML
- list element.
- separator (String) optional
- Character(s) to use to separate resulting values in list.
- Only used if 'isInList' is false.
- If none is provided, uses a space character, ' '.
- isFirst (boolean) optional
- If false, it's a recursive call from 'PrintWhitespaceList'.
- schemaLoc (String) optional
- Schema file containing this all model group;
- if in current schema, 'schemaLoc' is set to 'this'
- -->
- <xsl:template name="PrintWhitespaceList">
- <xsl:param name="value"/>
- <xsl:param name="compType"/>
- <xsl:param name="isInList">false</xsl:param>
- <xsl:param name="separator"/>
- <xsl:param name="isFirst">true</xsl:param>
- <xsl:param name="schemaLoc">this</xsl:param>
-
- <xsl:variable name="token" select="normalize-space(substring-before($value, ' '))"/>
- <xsl:choose>
- <xsl:when test="$token!=''">
- <!-- Whitespace found in value -->
- <!-- Print out token -->
- <xsl:call-template name="PrintWhitespaceListToken">
- <xsl:with-param name="token" select="$token"/>
- <xsl:with-param name="compType" select="$compType"/>
- <xsl:with-param name="isInList" select="$isInList"/>
- <xsl:with-param name="separator" select="$separator"/>
- <xsl:with-param name="isFirst" select="$isFirst"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- <!-- Continue parsing -->
- <xsl:variable name="rest" select="normalize-space(substring-after($value, $token))"/>
- <xsl:if test="$rest!=''">
- <xsl:call-template name="PrintWhitespaceList">
- <xsl:with-param name="value" select="$rest"/>
- <xsl:with-param name="compType" select="$compType"/>
- <xsl:with-param name="isInList" select="$isInList"/>
- <xsl:with-param name="separator" select="$separator"/>
- <xsl:with-param name="isFirst">false</xsl:with-param>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <!-- No more whitespaces -->
- <!-- Print out one last token -->
- <xsl:if test="normalize-space($value)!=''">
- <xsl:call-template name="PrintWhitespaceListToken">
- <xsl:with-param name="token" select="$value"/>
- <xsl:with-param name="compType" select="$compType"/>
- <xsl:with-param name="isInList" select="$isInList"/>
- <xsl:with-param name="separator" select="$separator"/>
- <xsl:with-param name="isFirst" select="$isFirst"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Helper template for 'PrintWhitespaceList' template,
- which prints out one token in the list.
- Param(s):
- token (String) required
- Token to be printed
- compType (String) optional
- Schema component type of token, if applicable.
- isInList (boolean) optional
- If true, place token within 'li' tags.
- separator (String) optional
- Character(s) use to separate one token from another.
- Only used if 'isInList' is false.
- If none is provided, uses a space character, ' '.
- isFirst (boolean) optional
- If true, token is the first value in the list.
- schemaLoc (String) optional
- Schema file containing this all model group;
- if in current schema, 'schemaLoc' is set to 'this'
- -->
- <xsl:template name="PrintWhitespaceListToken">
- <xsl:param name="token"/>
- <xsl:param name="compType"/>
- <xsl:param name="isInList">false</xsl:param>
- <xsl:param name="separator"/>
- <xsl:param name="isFirst">true</xsl:param>
- <xsl:param name="schemaLoc">this</xsl:param>
-
- <xsl:variable name="displayValue">
- <xsl:choose>
- <xsl:when test="$compType!=''">
- <xsl:call-template name="PrintCompRef">
- <xsl:with-param name="ref" select="normalize-space($token)"/>
- <xsl:with-param name="compType" select="$compType"/>
- <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="normalize-space($token)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="$isInList!='false'">
- <li>
- <xsl:copy-of select="$displayValue"/>
- </li>
- </xsl:when>
- <xsl:when test="$isFirst!='true'">
- <xsl:choose>
- <xsl:when test="$separator!=''">
- <xsl:value-of select="$separator"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text> </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:copy-of select="$displayValue"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="$displayValue"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Print out a wildcard.
- Param(s):
- componentType (attribute|element) required
- XML Schema component type
- namespaces (String) required
- Namespace attribute of wildcard
- processContents (String) required
- Process contents attribute of wildcard
- namespaces (String) required
- Namespace attribute of wildcard
- -->
- <xsl:template name="PrintWildcard">
- <xsl:param name="componentType">element</xsl:param>
- <xsl:param name="namespace"/>
- <xsl:param name="processContents"/>
- <xsl:param name="minOccurs"/>
- <xsl:param name="maxOccurs"/>
-
- <xsl:text>Allow any </xsl:text>
- <xsl:value-of select="$componentType"/>
- <xsl:text>s from </xsl:text>
-
- <xsl:choose>
- <!-- ##any -->
- <xsl:when test="not($namespace) or normalize-space($namespace)='##any'">
- <xsl:text>any namespace</xsl:text>
- </xsl:when>
- <!-- ##other -->
- <xsl:when test="normalize-space($namespace)='##other'">
- <xsl:text>a namespace other than this schema's namespace</xsl:text>
- </xsl:when>
- <!-- ##targetNamespace, ##local, specific namespaces -->
- <xsl:otherwise>
- <!-- ##targetNamespace -->
- <xsl:variable name="hasTargetNS">
- <xsl:if test="contains($namespace, '##targetNamespace')">
- <xsl:text>true</xsl:text>
- </xsl:if>
- </xsl:variable>
- <!-- ##local -->
- <xsl:variable name="hasLocalNS">
- <xsl:if test="contains($namespace, '##local')">
- <xsl:text>true</xsl:text>
- </xsl:if>
- </xsl:variable>
- <!-- Specific namespaces -->
- <!-- Remove '##targetNamespace' string if any-->
- <xsl:variable name="temp">
- <xsl:choose>
- <xsl:when test="$hasTargetNS='true'">
- <xsl:value-of select="concat(substring-before($namespace, '##targetNamespace'), substring-after($namespace, '##targetNamespace'))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$namespace"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- Remove '##local' string if any -->
- <xsl:variable name="specificNS">
- <xsl:choose>
- <xsl:when test="$hasLocalNS='true'">
- <xsl:value-of select="concat(substring-before($temp, '##local'), substring-after($temp, '##local'))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$temp"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="hasSpecificNS">
- <xsl:if test="normalize-space($specificNS)!=''">
- <xsl:text>true</xsl:text>
- </xsl:if>
- </xsl:variable>
-
- <xsl:if test="$hasLocalNS='true'">
- <xsl:text>no namespace</xsl:text>
- </xsl:if>
-
- <xsl:if test="$hasTargetNS='true'">
- <xsl:choose>
- <xsl:when test="$hasLocalNS='true' and $hasSpecificNS!='true'">
- <xsl:text> and </xsl:text>
- </xsl:when>
- <xsl:when test="$hasLocalNS='true'">
- <xsl:text>, </xsl:text>
- </xsl:when>
- </xsl:choose>
- <xsl:text>this schema's namespace</xsl:text>
- </xsl:if>
-
- <xsl:if test="$hasSpecificNS='true'">
- <xsl:choose>
- <xsl:when test="$hasTargetNS='true' and $hasLocalNS='true'">
- <xsl:text>, and </xsl:text>
- </xsl:when>
- <xsl:when test="$hasTargetNS='true' or $hasLocalNS='true'">
- <xsl:text> and </xsl:text>
- </xsl:when>
- </xsl:choose>
- <xsl:text>the following namespace(s): </xsl:text>
- <xsl:call-template name="PrintWhitespaceList">
- <xsl:with-param name="value" select="normalize-space($specificNS)"/>
- <xsl:with-param name="separator">,</xsl:with-param>
- </xsl:call-template>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- <!-- Process contents -->
- <xsl:text> (</xsl:text>
- <xsl:choose>
- <xsl:when test="$processContents">
- <xsl:value-of select="normalize-space($processContents)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>strict</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text> validation)</xsl:text>
- <xsl:text>.</xsl:text>
-
- <!-- Print min/max occurs -->
- <xsl:if test="$componentType='element'">
- <xsl:text> </xsl:text>
- <xsl:call-template name="PrintOccurs">
- <xsl:with-param name="minOccurs" select="$minOccurs"/>
- <xsl:with-param name="maxOccurs" select="$maxOccurs"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
-
- <!--
- Print out the pattern property for derivations by
- restriction on simple content.
- Param(s):
- simpleRestrict (Node) required
- 'restriction' element
- -->
- <xsl:template name="PrintPatternFacet">
- <xsl:param name="simpleRestrict"/>
-
- <xsl:if test="$simpleRestrict/xsd:pattern">
- <em>pattern</em>
- <xsl:text> = </xsl:text>
- <xsl:value-of select="$simpleRestrict/xsd:pattern/@value"/>
- </xsl:if>
- </xsl:template>
-
- <!--
- Print out the total digits property for derivations by
- restriction on simple content.
- Param(s):
- simpleRestrict (Node) required
- 'restriction' element
- -->
- <xsl:template name="PrintTotalDigitsFacet">
- <xsl:param name="simpleRestrict"/>
-
- <xsl:if test="$simpleRestrict/xsd:totalDigits">
- <em>total no. of digits</em>
- <xsl:text> = </xsl:text>
- <xsl:value-of select="$simpleRestrict/xsd:totalDigits/@value"/>
- </xsl:if>
- </xsl:template>
-
- <!--
- Print out the fraction digits property for derivations by
- restriction on simple content.
- Param(s):
- simpleRestrict (Node) required
- 'restriction' element
- -->
- <xsl:template name="PrintFractionDigitsFacet">
- <xsl:param name="simpleRestrict"/>
-
- <xsl:if test="$simpleRestrict/xsd:fractionDigits">
- <em>
- <xsl:text>no. of fraction digits</xsl:text>
- </em>
- <xsl:text> = </xsl:text>
- <xsl:value-of select="$simpleRestrict/xsd:fractionDigits/@value"/>
- </xsl:if>
- </xsl:template>
-
- <!--
- Print out the enumeration list for derivations by
- restriction on simple content.
- Param(s):
- simpleRestrict (Node) required
- 'restriction' element
- -->
- <xsl:template name="PrintEnumFacets">
- <xsl:param name="simpleRestrict"/>
-
- <xsl:if test="$simpleRestrict/xsd:enumeration">
- <em>value</em>
- <xsl:text> comes from list: {</xsl:text>
-
- <xsl:for-each select="$simpleRestrict/xsd:enumeration">
- <xsl:if test="position()!=1">
- <xsl:text>|</xsl:text>
- </xsl:if>
- <xsl:text>'</xsl:text>
- <xsl:value-of select="@value"/>
- <xsl:text>'</xsl:text>
- </xsl:for-each>
-
- <xsl:text>}</xsl:text>
- </xsl:if>
- </xsl:template>
-
- <!--
- Print out the length property for derivations by
- restriction on simple content.
- Param(s):
- simpleRestrict (Node) required
- 'restriction' element
- -->
- <xsl:template name="PrintLengthFacets">
- <xsl:param name="simpleRestrict"/>
-
- <xsl:choose>
- <xsl:when test="$simpleRestrict/xsd:length">
- <em>
- <xsl:text>length</xsl:text>
- </em>
- <xsl:text> = </xsl:text>
- <xsl:value-of select="$simpleRestrict/xsd:length/@value"/>
- </xsl:when>
- <xsl:when test="$simpleRestrict/xsd:minLength">
- <em>
- <xsl:text>length</xsl:text>
- </em>
- <xsl:text> >= </xsl:text>
- <xsl:value-of select="$simpleRestrict/xsd:minLength/@value"/>
- </xsl:when>
- <xsl:when test="$simpleRestrict/xsd:maxLength">
- <em>
- <xsl:text>length</xsl:text>
- </em>
- <xsl:text> &lt;= </xsl:text>
- <xsl:value-of select="$simpleRestrict/xsd:maxLength/@value"/>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Print out the whitespace property for derivations by
- restriction on simple content.
- Param(s):
- simpleRestrict (Node) required
- 'restriction' element
- -->
- <xsl:template name="PrintWhitespaceFacet">
- <xsl:param name="simpleRestrict"/>
-
- <xsl:variable name="facetValue" select="normalize-space(translate($simpleRestrict/xsd:whiteSpace/@value, 'ACELOPRSV', 'aceloprsv'))"/>
-
- <xsl:choose>
- <xsl:when test="$facetValue='preserve'">
- <em>Whitespace policy: </em>
- <xsl:call-template name="PrintGlossaryTermRef">
- <xsl:with-param name="code">PreserveWS</xsl:with-param>
- <xsl:with-param name="term">preserve</xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$facetValue='replace'">
- <em>Whitespace policy: </em>
- <xsl:call-template name="PrintGlossaryTermRef">
- <xsl:with-param name="code">ReplaceWS</xsl:with-param>
- <xsl:with-param name="term">replace</xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$facetValue='collapse'">
- <em>Whitespace policy: </em>
- <xsl:call-template name="PrintGlossaryTermRef">
- <xsl:with-param name="code">CollapseWS</xsl:with-param>
- <xsl:with-param name="term">collapse</xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Print out the value ranges for derivations by
- restriction on simple content.
- Param(s):
- simpleRestrict (Node) required
- 'restriction' element
- -->
- <xsl:template name="PrintRangeFacets">
- <xsl:param name="simpleRestrict"/>
-
- <xsl:choose>
- <xsl:when test="($simpleRestrict/xsd:minInclusive or $simpleRestrict/xsd:minExclusive) and ($simpleRestrict/xsd:maxInclusive or $simpleRestrict/xsd:maxExclusive)">
- <xsl:choose>
- <xsl:when test="$simpleRestrict/xsd:minInclusive">
- <xsl:value-of select="$simpleRestrict/xsd:minInclusive/@value"/>
- <xsl:text> &lt;= </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$simpleRestrict/xsd:minExclusive/@value"/>
- <xsl:text> &lt; </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <em>
- <xsl:text>value</xsl:text>
- </em>
- <xsl:choose>
- <xsl:when test="$simpleRestrict/xsd:maxInclusive">
- <xsl:text> &lt;= </xsl:text>
- <xsl:value-of select="$simpleRestrict/xsd:maxInclusive/@value"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text> &lt; </xsl:text>
- <xsl:value-of select="$simpleRestrict/xsd:maxExclusive/@value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$simpleRestrict/xsd:minInclusive">
- <em>
- <xsl:text>value</xsl:text>
- </em>
- <xsl:text> >= </xsl:text>
- <xsl:value-of select="$simpleRestrict/xsd:minInclusive/@value"/>
- </xsl:when>
- <xsl:when test="$simpleRestrict/xsd:minExclusive">
- <em>
- <xsl:text>value</xsl:text>
- </em>
- <xsl:text> > </xsl:text>
- <xsl:value-of select="$simpleRestrict/xsd:minExclusive/@value"/>
- </xsl:when>
- <xsl:when test="$simpleRestrict/xsd:maxInclusive">
- <em>
- <xsl:text>value</xsl:text>
- </em>
- <xsl:text> &lt;= </xsl:text>
- <xsl:value-of select="$simpleRestrict/xsd:maxInclusive/@value"/>
- </xsl:when>
- <xsl:when test="$simpleRestrict/xsd:maxExclusive">
- <em>
- <xsl:text>value</xsl:text>
- </em>
- <xsl:text> &lt; </xsl:text>
- <xsl:value-of select="$simpleRestrict/xsd:maxExclusive/@value"/>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Prints out JavaScript code.
- NOTE: Javascript code is placed within comments to make it
- work with current browsers. In strict XHTML, JavaScript code
- should be placed within CDATA sections. However, most
- browsers generate a syntax error if the page contains
- CDATA sections. Placing Javascript code within comments
- means that the code cannot contain two dashes.
- Param(s):
- code (Result Tree Fragment) required
- Javascript code
- -->
- <xsl:template name="PrintJSCode">
- <xsl:param name="code"/>
-
- <script type="text/javascript">
- <!-- If browsers start supporting CDATA sections,
- uncomment the following piece of code. -->
- <!-- <xsl:text disable-output-escaping="yes">
-&lt;![CDATA[
-</xsl:text> -->
- <!-- If browsers start supporting CDATA sections,
- remove the following piece of code. -->
- <xsl:text disable-output-escaping="yes">
-&lt;!--
-</xsl:text>
-
- <xsl:value-of select="$code" disable-output-escaping="yes"/>
- <!-- If browsers start supporting CDATA sections,
- remove the following piece of code. -->
- <xsl:text disable-output-escaping="yes">
-// --&gt;
-</xsl:text>
- <!-- If browsers start supporting CDATA sections,
- uncomment the following piece of code. -->
- <!-- <xsl:text disable-output-escaping="yes">
-]]&gt;
-</xsl:text> -->
- </script>
- </xsl:template>
-
- <!--
- Translates occurrences of a string
- in a piece of text with another string.
- Param(s):
- value (String) required
- Text to translate
- strToReplace (String) required
- String to be replaced
- replacementStr (String) required
- Replacement text
- -->
- <xsl:template name="TranslateStr">
- <xsl:param name="value"/>
- <xsl:param name="strToReplace"/>
- <xsl:param name="replacementStr"/>
-
- <xsl:if test="$value != ''">
- <xsl:variable name="beforeText" select="substring-before($value, $strToReplace)"/>
- <xsl:choose>
- <xsl:when test="$beforeText != ''">
- <xsl:value-of select="$beforeText"/>
- <xsl:value-of select="$replacementStr"/>
- <xsl:call-template name="TranslateStr">
- <xsl:with-param name="value" select="substring-after($value, $strToReplace)"/>
- <xsl:with-param name="strToReplace" select="$strToReplace"/>
- <xsl:with-param name="replacementStr" select="$replacementStr"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
-
- <xsl:template name="HandleError">
- <xsl:param name="errorMsg"/>
- <xsl:param name="isTerminating">false</xsl:param>
-
- <xsl:choose>
- <xsl:when test="$isTerminating='true'">
- <xsl:message terminate="yes">
- <xsl:text>XS3P ERROR: </xsl:text>
- <xsl:value-of select="$errorMsg"/>
- </xsl:message>
- </xsl:when>
- <xsl:otherwise>
- <span style="font-weight: bold; color: red">
- <xsl:text>ERROR: </xsl:text>
- <xsl:value-of select="$errorMsg"/>
- </span>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-</xsl:stylesheet> \ No newline at end of file
diff --git a/tools/Makefile.am b/tools/Makefile.am
deleted file mode 100644
index eef40d2b..00000000
--- a/tools/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = loadmem
diff --git a/tools/git-make-dist b/tools/git-make-dist
deleted file mode 100755
index e96102ce..00000000
--- a/tools/git-make-dist
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/bin/bash
-
-# git-make-dist -- Make a release tag in a git repository. The tag
-# will have the same content as the tarball produced
-# by "make dist", plus the debian/ directory as it is
-# tracked by git.
-
-set -e
-
-exportcwd () {
- for f in `find . -type f`; do
- ff=`echo $f | sed 's,^./,,'`
- if [ -x "$f" ]; then
- echo M 100755 inline $ff
- else
- echo M 100644 inline $ff
- fi
- echo data `wc -c <$f`
- cat $f
- done
-}
-
-exportcommit () {
- echo commit $1
- echo committer `git config user.name` '<'`git config user.email`'>' now
- echo 'data <<EOD'
- echo Prepare for distribution
- echo EOD
- echo from HEAD
- echo deleteall
- exportcwd
-}
-
-if [ $# != 1 ]; then
- echo >&2 "Usage: git-make-dist TAGNAME"
- exit 1
-fi
-
-tagname="$1"
-
-if ! git diff --quiet ; then
- echo >&2 "Your working tree is not clean. Aborting."
- exit 1
-fi
-
-if ! git diff --quiet --cached; then
- echo >&2 "Your index is not clean. Aborting."
- exit 1
-fi
-
-if git rev-parse --verify $tagname >/dev/null >&/dev/null; then
- echo >&2 "Tag $tagname exists already. Aborting."
- exit 1
-fi
-
-distdir=$(mktemp -d tmp.XXXXXX)
-make distdir distdir=$distdir
-for f in `git ls-files debian`; do
- if ! [ -a $distdir/$f ]; then
- mkdir -p $(dirname $distdir/$f)
- ln $f $distdir/$f
- fi
-done
-
-(cd $distdir && exportcommit refs/tags/$tagname) \
- | git fast-import --date-format=now --quiet --force
-
-rm -rf $distdir
diff --git a/tools/loadmem/.gitignore b/tools/loadmem/.gitignore
deleted file mode 100644
index c4f09807..00000000
--- a/tools/loadmem/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-loadmem
diff --git a/tools/tiny_get_frontend.py b/tools/tiny_get_frontend.py
deleted file mode 100644
index eece261b..00000000
--- a/tools/tiny_get_frontend.py
+++ /dev/null
@@ -1,34 +0,0 @@
-import traceback
-import dbus
-import sys
-
-def execute_get(property_names):
- bus = dbus.SessionBus()
- try:
- object = bus.get_object("org.freedesktop.ContextKit","/org/freedesktop/ContextKit/Manager")
- iface = dbus.Interface(object,"org.freedesktop.ContextKit.Manager")
-
- ret = iface.Get(property_names)
- print "Returned:", ret
-
- properties = ret[0]
- undetermined = ret[1]
-
- print "Properties and their values:"
- for name in properties.keys():
- print "Property:", name, ", value:", properties[name]
-
- print "Undetermined properties:"
- print undetermined
- except dbus.DBusException:
- print "Caught an exception"
- traceback.print_exc()
-
-if __name__ == "__main__":
- # You can write the properties of intrest directly here
- #execute_get(["Context.Device.Orientation.displayFacingUp", "Context.Environment.Location.latitude", "Context.Environment.Location.longitude", "Context.Environment.Location.altitude"])
-
- # Or use the parameters from command line
- print "Executing Get with the properties", sys.argv[1:]
- execute_get(sys.argv[1:])
-
diff --git a/tools/tiny_subscribe_frontend.py b/tools/tiny_subscribe_frontend.py
deleted file mode 100644
index cfc56c7a..00000000
--- a/tools/tiny_subscribe_frontend.py
+++ /dev/null
@@ -1,54 +0,0 @@
-import traceback
-import dbus
-import sys
-import gobject
-
-from dbus.mainloop.glib import DBusGMainLoop
-
-def handle_signal(changed, undet):
- print "Got signal"
- print changed
- print undet
-
-def execute_subscribe(property_names):
- bus = dbus.SessionBus()
- try:
- proxy_object_manager = bus.get_object("org.freedesktop.ContextKit","/org/freedesktop/ContextKit/Manager")
- iface_manager = dbus.Interface(proxy_object_manager, "org.freedesktop.ContextKit.Manager")
- print "Requesting the subscriber object"
- # Get the subscriber object
- new_object_path = iface_manager.GetSubscriber()
-
- print "Got an object path", new_object_path
- # And then execute the actual subscribe property_names
-
- proxy_object_subscriber = bus.get_object("org.freedesktop.ContextKit", new_object_path)
- iface_subscriber = dbus.Interface(proxy_object_subscriber, "org.freedesktop.ContextKit.Subscriber")
-
- # Connect to the signal
- print "Connecting to the signal"
- iface_subscriber.connect_to_signal("Changed", handle_signal)
-
- print "Executing the Subscribe"
- ret = iface_subscriber.Subscribe(property_names)
-
- print "Returned:", ret
-
- loop = gobject.MainLoop()
- loop.run()
-
- except dbus.DBusException:
- print "Caught an exception"
- traceback.print_exc()
-
-
-if __name__ == "__main__":
- DBusGMainLoop(set_as_default=True)
-
- # You can write the properties of intrest directly here
- #execute_get(["Context.Device.Orientation.facingUp", "Context.Environment.Location.latitude", "Context.Environment.Location.longitude", "Context.Environment.Location.altitude"])
-
- # Or use the command line parameters
- print "Executing Subscribe with the properties", sys.argv[1:]
- execute_subscribe(sys.argv[1:])
-