Reorganise to remove redundant folder
[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
18     virtual const uint32_t& getTestPredefinedTypeAttributeAttribute();
19     void setTestPredefinedTypeAttributeAttribute(uint32_t value);
20
21     virtual const DerivedTypeCollection::TestStructExtended& getTestDerivedStructAttributeAttribute();
22     void setTestDerivedStructAttributeAttribute(DerivedTypeCollection::TestStructExtended value);
23
24     virtual const DerivedTypeCollection::TestArrayUInt64& getTestDerivedArrayAttributeAttribute();
25     void setTestDerivedArrayAttributeAttribute(DerivedTypeCollection::TestArrayUInt64 value);
26
27
28     virtual void testVoidPredefinedTypeMethod(uint32_t uint32Value, std::string stringValue);
29
30     virtual void testPredefinedTypeMethod(uint32_t uint32InValue, std::string stringInValue, uint32_t& uint32OutValue, std::string& stringOutValue);
31
32     virtual void testVoidDerivedTypeMethod(DerivedTypeCollection::TestEnumExtended2 testEnumExtended2Value, DerivedTypeCollection::TestMap testMapValue);
33
34     virtual void testDerivedTypeMethod(DerivedTypeCollection::TestEnumExtended2 testEnumExtended2InValue, DerivedTypeCollection::TestMap testMapInValue, DerivedTypeCollection::TestEnumExtended2& testEnumExtended2OutValue, DerivedTypeCollection::TestMap& testMapOutValue);
35
36     virtual void firePredefinedBroadcast(uint32_t value, std::string& sValue);
37
38  protected:
39     void onRemoteTestPredefinedTypeAttributeAttributeChanged();
40     bool trySetTestPredefinedTypeAttributeAttribute(uint32_t value);
41     bool validateTestPredefinedTypeAttributeAttributeRequestedValue(const uint32_t& value);
42
43     void onRemoteTestDerivedStructAttributeAttributeChanged();
44     bool trySetTestDerivedStructAttributeAttribute(DerivedTypeCollection::TestStructExtended value);
45     bool validateTestDerivedStructAttributeAttributeRequestedValue(const DerivedTypeCollection::TestStructExtended& value);
46
47     void onRemoteTestDerivedArrayAttributeAttributeChanged();
48     bool trySetTestDerivedArrayAttributeAttribute(DerivedTypeCollection::TestArrayUInt64 value);
49     bool validateTestDerivedArrayAttributeAttributeRequestedValue(const DerivedTypeCollection::TestArrayUInt64& value);
50
51
52  private:
53     class RemoteEventHandler: public TestInterfaceStubRemoteEvent {
54      public:
55         RemoteEventHandler(TestInterfaceStubDefault* defaultStub);
56
57         virtual bool onRemoteSetTestPredefinedTypeAttributeAttribute(uint32_t value);
58         virtual void onRemoteTestPredefinedTypeAttributeAttributeChanged();
59
60         virtual bool onRemoteSetTestDerivedStructAttributeAttribute(DerivedTypeCollection::TestStructExtended value);
61         virtual void onRemoteTestDerivedStructAttributeAttributeChanged();
62
63         virtual bool onRemoteSetTestDerivedArrayAttributeAttribute(DerivedTypeCollection::TestArrayUInt64 value);
64         virtual void onRemoteTestDerivedArrayAttributeAttributeChanged();
65
66
67      private:
68         TestInterfaceStubDefault* defaultStub_;
69     };
70
71     RemoteEventHandler remoteEventHandler_;
72     std::shared_ptr<TestInterfaceStubAdapter> stubAdapter_;
73
74     uint32_t testPredefinedTypeAttributeAttributeValue_;
75     DerivedTypeCollection::TestStructExtended testDerivedStructAttributeAttributeValue_;
76     DerivedTypeCollection::TestArrayUInt64 testDerivedArrayAttributeAttributeValue_;
77 };
78
79 } // namespace tests
80 } // namespace commonapi
81
82 #endif // COMMONAPI_TESTS_TEST_INTERFACE_STUB_DEFAULT_H_