Added a way to deinitialize running services
[profile/ivi/common-api-dbus-runtime.git] / src / test / commonapi / tests / TestInterfaceStubDefault.h
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 #ifndef COMMONAPI_TESTS_TEST_INTERFACE_STUB_DEFAULT_H_
5 #define COMMONAPI_TESTS_TEST_INTERFACE_STUB_DEFAULT_H_
6
7 #include "TestInterfaceStub.h"
8
9 namespace commonapi {
10 namespace tests {
11
12 class TestInterfaceStubDefault : public TestInterfaceStub {
13  public:
14     TestInterfaceStubDefault();
15
16     TestInterfaceStubRemoteEvent* initStubAdapter(const std::shared_ptr<TestInterfaceStubAdapter>& stubAdapter);
17     void deinitStubAdapter();
18
19     virtual const uint32_t& getTestPredefinedTypeAttributeAttribute();
20     virtual void setTestPredefinedTypeAttributeAttribute(uint32_t value);
21
22     virtual const DerivedTypeCollection::TestStructExtended& getTestDerivedStructAttributeAttribute();
23     virtual void setTestDerivedStructAttributeAttribute(DerivedTypeCollection::TestStructExtended value);
24
25     virtual const DerivedTypeCollection::TestArrayUInt64& getTestDerivedArrayAttributeAttribute();
26     virtual void setTestDerivedArrayAttributeAttribute(DerivedTypeCollection::TestArrayUInt64 value);
27
28
29     virtual void testVoidPredefinedTypeMethod(uint32_t uint32Value, std::string stringValue);
30
31     virtual void testPredefinedTypeMethod(uint32_t uint32InValue, std::string stringInValue, uint32_t& uint32OutValue, std::string& stringOutValue);
32
33     virtual void testVoidDerivedTypeMethod(DerivedTypeCollection::TestEnumExtended2 testEnumExtended2Value, DerivedTypeCollection::TestMap testMapValue);
34
35     virtual void testDerivedTypeMethod(DerivedTypeCollection::TestEnumExtended2 testEnumExtended2InValue, DerivedTypeCollection::TestMap testMapInValue, DerivedTypeCollection::TestEnumExtended2& testEnumExtended2OutValue, DerivedTypeCollection::TestMap& testMapOutValue);
36
37     
38     virtual void fireTestPredefinedTypeBroadcastEvent(const uint32_t& uint32Value, const std::string& stringValue);
39
40  protected:
41     virtual void onRemoteTestPredefinedTypeAttributeAttributeChanged();
42     virtual bool trySetTestPredefinedTypeAttributeAttribute(uint32_t value);
43     virtual bool validateTestPredefinedTypeAttributeAttributeRequestedValue(const uint32_t& value);
44
45     virtual void onRemoteTestDerivedStructAttributeAttributeChanged();
46     virtual bool trySetTestDerivedStructAttributeAttribute(DerivedTypeCollection::TestStructExtended value);
47     virtual bool validateTestDerivedStructAttributeAttributeRequestedValue(const DerivedTypeCollection::TestStructExtended& value);
48
49     virtual void onRemoteTestDerivedArrayAttributeAttributeChanged();
50     virtual bool trySetTestDerivedArrayAttributeAttribute(DerivedTypeCollection::TestArrayUInt64 value);
51     virtual bool validateTestDerivedArrayAttributeAttributeRequestedValue(const DerivedTypeCollection::TestArrayUInt64& value);
52
53     
54  private:
55     class RemoteEventHandler: public TestInterfaceStubRemoteEvent {
56      public:
57         RemoteEventHandler(TestInterfaceStubDefault* defaultStub);
58
59         virtual bool onRemoteSetTestPredefinedTypeAttributeAttribute(uint32_t value);
60         virtual void onRemoteTestPredefinedTypeAttributeAttributeChanged();
61
62         virtual bool onRemoteSetTestDerivedStructAttributeAttribute(DerivedTypeCollection::TestStructExtended value);
63         virtual void onRemoteTestDerivedStructAttributeAttributeChanged();
64
65         virtual bool onRemoteSetTestDerivedArrayAttributeAttribute(DerivedTypeCollection::TestArrayUInt64 value);
66         virtual void onRemoteTestDerivedArrayAttributeAttributeChanged();
67
68
69      private:
70         TestInterfaceStubDefault* defaultStub_;
71     };
72
73     RemoteEventHandler remoteEventHandler_;
74     std::shared_ptr<TestInterfaceStubAdapter> stubAdapter_;
75
76     uint32_t testPredefinedTypeAttributeAttributeValue_;
77     DerivedTypeCollection::TestStructExtended testDerivedStructAttributeAttributeValue_;
78     DerivedTypeCollection::TestArrayUInt64 testDerivedArrayAttributeAttributeValue_;
79 };
80
81 } // namespace tests
82 } // namespace commonapi
83
84 #endif // COMMONAPI_TESTS_TEST_INTERFACE_STUB_DEFAULT_H_