Skip to content

Commit 2517a5a

Browse files
committed
[Interfaces] Sync with Main
1 parent dd9b8d1 commit 2517a5a

20 files changed

+900
-113
lines changed

definitions/Definitions.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,17 @@ ENUM_CONVERSION_BEGIN(Exchange::IPower::PCState)
145145
{ Exchange::IPower::PowerOff, _TXT(_T("off")) },
146146
ENUM_CONVERSION_END(Exchange::IPower::PCState)
147147

148+
ENUM_CONVERSION_BEGIN(Exchange::External::Metadata::protocol)
149+
{ Exchange::External::Metadata::protocol::I2C, _TXT(_T("I2C")) },
150+
{ Exchange::External::Metadata::protocol::ONEWIRE, _TXT(_T("1W")) },
151+
{ Exchange::External::Metadata::protocol::NRF24L01, _TXT(_T("NRF24L01")) },
152+
{ Exchange::External::Metadata::protocol::GPIO, _TXT(_T("GPIO")) },
153+
{ Exchange::External::Metadata::protocol::ZWAVE, _TXT(_T("ZWave")) },
154+
{ Exchange::External::Metadata::protocol::ZIGBEE, _TXT(_T("ZigBee")) },
155+
{ Exchange::External::Metadata::protocol::JSONRPC, _TXT(_T("JSONRPC")) },
156+
{ Exchange::External::Metadata::protocol::VIRTUAL, _TXT(_T("Virtual")) },
157+
ENUM_CONVERSION_END(Exchange::External::Metadata::protocol)
158+
148159
namespace Exchange
149160
{
150161

definitions/Definitions.vcxproj

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
<ClCompile Include="Definitions.cpp" />
2323
</ItemGroup>
2424
<ItemGroup>
25+
<ClInclude Include="..\interfaces\json\ExternalMetadata.h" />
2526
<ClInclude Include="definitions.h" />
26-
<ClInclude Include="Module.h" />
2727
</ItemGroup>
2828
<ItemGroup>
2929
<CustomBuild Include="..\jsonrpc\BluetoothControl.json">
@@ -208,7 +208,7 @@
208208
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
209209
<LinkIncremental>true</LinkIncremental>
210210
<OutDir>$(SolutionDir)..\artifacts\$(Configuration)\</OutDir>
211-
<IntDir>$(OutDir)Interfaces\$(TargetName)\</IntDir>
211+
<IntDir>$(OutDir)WebBridge\$(TargetName)\</IntDir>
212212
<CustomBuildBeforeTargets>
213213
</CustomBuildBeforeTargets>
214214
<CustomBuildAfterTargets>
@@ -217,7 +217,7 @@
217217
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
218218
<LinkIncremental>true</LinkIncremental>
219219
<OutDir>$(SolutionDir)..\artifacts\$(Configuration)\</OutDir>
220-
<IntDir>$(OutDir)Interfaces\$(TargetName)\</IntDir>
220+
<IntDir>$(OutDir)WebBridge\$(TargetName)\</IntDir>
221221
<CustomBuildBeforeTargets>
222222
</CustomBuildBeforeTargets>
223223
<CustomBuildAfterTargets>
@@ -226,7 +226,7 @@
226226
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
227227
<LinkIncremental>false</LinkIncremental>
228228
<OutDir>$(SolutionDir)..\artifacts\$(Configuration)\</OutDir>
229-
<IntDir>$(OutDir)Interfaces\$(TargetName)\</IntDir>
229+
<IntDir>$(OutDir)WebBridge\$(TargetName)\</IntDir>
230230
<CustomBuildBeforeTargets>
231231
</CustomBuildBeforeTargets>
232232
<CustomBuildAfterTargets>
@@ -235,7 +235,7 @@
235235
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
236236
<LinkIncremental>false</LinkIncremental>
237237
<OutDir>$(SolutionDir)..\artifacts\$(Configuration)\</OutDir>
238-
<IntDir>$(OutDir)Interfaces\$(TargetName)\</IntDir>
238+
<IntDir>$(OutDir)WebBridge\$(TargetName)\</IntDir>
239239
<CustomBuildBeforeTargets>
240240
</CustomBuildBeforeTargets>
241241
<CustomBuildAfterTargets>
@@ -255,6 +255,7 @@
255255
<SubSystem>Windows</SubSystem>
256256
<GenerateDebugInformation>true</GenerateDebugInformation>
257257
<AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
258+
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
258259
</Link>
259260
<PreBuildEvent>
260261
<Command>
@@ -303,6 +304,7 @@
303304
<SubSystem>Windows</SubSystem>
304305
<GenerateDebugInformation>true</GenerateDebugInformation>
305306
<AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
307+
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
306308
</Link>
307309
<PreBuildEvent>
308310
<Command>
@@ -355,6 +357,7 @@
355357
<OptimizeReferences>true</OptimizeReferences>
356358
<GenerateDebugInformation>true</GenerateDebugInformation>
357359
<AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
360+
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
358361
</Link>
359362
<PreBuildEvent>
360363
<Command>
@@ -407,6 +410,7 @@
407410
<OptimizeReferences>true</OptimizeReferences>
408411
<GenerateDebugInformation>true</GenerateDebugInformation>
409412
<AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
413+
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
410414
</Link>
411415
<PreBuildEvent>
412416
<Command>

definitions/definitions.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include <interfaces/IStream.h>
3939
#include <interfaces/IVoiceHandler.h>
4040
#include <interfaces/IPower.h>
41+
#include <interfaces/json/ExternalMetadata.h>
4142

4243
namespace WPEFramework {
4344

interfaces/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ set(GENERATOR_SEARCH_PATH ${CMAKE_SYSROOT}${CMAKE_INSTALL_PREFIX}/include/${NAME
2525
ProxyStubGenerator(INPUT "${CMAKE_CURRENT_SOURCE_DIR}" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH ${GENERATOR_SEARCH_PATH})
2626

2727
file(GLOB INTERFACES_HEADERS I*.h)
28+
file(GLOB JSON_HEADERS json/*.h)
2829
list(APPEND INTERFACES_HEADERS Module.h)
2930

3031
file(GLOB PROXY_STUB_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/generated/ProxyStubs*.cpp")
@@ -73,3 +74,8 @@ install(
7374
FILES ${INTERFACES_HEADERS}
7475
DESTINATION include/${NAMESPACE}/interfaces
7576
)
77+
78+
install(
79+
FILES ${JSON_HEADERS}
80+
DESTINATION include/${NAMESPACE}/interfaces/json
81+
)

interfaces/IApplication.h

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
/*
2+
* If not stated otherwise in this file or this component's LICENSE file the
3+
* following copyright and licenses apply:
4+
*
5+
* Copyright 2020 RDK Management
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
#pragma once
20+
21+
#include "Module.h"
22+
23+
namespace WPEFramework {
24+
namespace Exchange {
25+
26+
// @json
27+
struct EXTERNAL IApplication : virtual public Core::IUnknown {
28+
29+
enum { ID = ID_APPLICATION };
30+
31+
virtual ~IApplication() = default;
32+
33+
/* @event */
34+
struct EXTERNAL INotification : virtual public Core::IUnknown {
35+
enum { ID = ID_APPLICATION_NOTIFICATION };
36+
37+
virtual ~INotification() = default;
38+
39+
/* @brief Application visibility changes */
40+
/* @param hidden Denotes if application is currently hidden */
41+
virtual void VisibilityChange(const bool hidden) = 0;
42+
};
43+
44+
enum resettype : uint8_t {
45+
FACTORY,
46+
CACHE,
47+
CREDENTIALS,
48+
RECORDINGS
49+
};
50+
51+
enum launchpointtype : uint8_t {
52+
UNDEFINED,
53+
DIAL,
54+
DEDICATED_BUTTON,
55+
DEDICATED_ICON,
56+
APPLICATION_LIST,
57+
INTEGRATED_TILE,
58+
SEARCH_RESULT,
59+
SEARCH_CONTINUATION,
60+
VOICE_CONTROL,
61+
VOICE_SEARCH_RESULT,
62+
VISUAL_GESTURE,
63+
TOUCH_GESTURE,
64+
EPG_GRID,
65+
CHANNEL_NUMBER,
66+
CHANNEL_ZAP,
67+
CHANNEL_BAR,
68+
WEB_BROWSER,
69+
POWER_ON,
70+
POWER_ON_FROM_DEDICATED_BUTTON,
71+
SUSPENDED_POWER_ON,
72+
RESTART,
73+
SUSPENDED_RESTART,
74+
RESUMED_FROM_SCREENSERVER,
75+
RESUMED_FROM_STANDBY,
76+
BANNER_AD,
77+
TITLE_RECOMENDATION,
78+
APPLICATION_PROMOTION
79+
};
80+
81+
virtual void Register(INotification* sink) = 0;
82+
virtual void Unregister(INotification* sink) = 0;
83+
84+
// @brief Resets application data
85+
// @param type Type of reset to perform
86+
virtual uint32_t Reset(const resettype type) = 0;
87+
88+
// @property
89+
// @brief Application-specific identification string
90+
// @param id Identifier string
91+
virtual uint32_t Identifier(string& id /* @out */) const = 0;
92+
93+
// @property
94+
// @brief URI of the associated application-specific content
95+
// @param link Content URI (e.g. https://youtube.com)
96+
virtual uint32_t ContentLink(const string& link) = 0;
97+
98+
// @property
99+
// @brief Application launching point
100+
virtual uint32_t LaunchPoint(launchpointtype& point /* @out */) const = 0;
101+
virtual uint32_t LaunchPoint(const launchpointtype&) = 0;
102+
103+
// @property
104+
// @brief Current application visibility
105+
virtual uint32_t Visible(bool& visiblity /* @out */) const = 0;
106+
virtual uint32_t Visible(const bool&) = 0;
107+
108+
// @property
109+
// @brief Current application user interface language
110+
// @param language Language string as per RFC5646 (e.g. en)
111+
virtual uint32_t Language(string& language /* @out */) const = 0;
112+
virtual uint32_t Language(const string&) = 0;
113+
};
114+
}
115+
}

interfaces/IBrowser.h

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,23 @@ namespace Exchange {
7272
enum { ID = ID_WEBKITBROWSER_NOTIFICATION };
7373

7474
// Signal changes on the subscribed namespace..
75+
// @brief Initial HTML document has been completely loaded and parsed
76+
// @param URL The URL that has been loaded
77+
// @param code The response code of main resource request
7578
virtual void LoadFinished(const string& URL, const int32_t code) = 0;
79+
// @brief Browser failed to load page
80+
// @param URL The URL that has been failed to load
7681
virtual void LoadFailed(const string& URL) = 0;
82+
// @brief Signals a URL change in the browser
83+
// @param URL The URL that has been loaded or requested
84+
// @param loaded loaded (true) or not (false)
7785
virtual void URLChange(const string& URL, const bool loaded) = 0;
86+
// @brief Signals a visibility change of the browser
87+
// @param hidden hidden (true) or visible (false)
7888
virtual void VisibilityChange(const bool hidden) = 0;
89+
// @brief Notifies that the web page requests to close its window
7990
virtual void PageClosure() = 0;
91+
// @brief Base64 encoded JSON message from legacy $badger bridge
8092
virtual void BridgeQuery(const string& message) = 0;
8193
};
8294

@@ -100,22 +112,41 @@ namespace Exchange {
100112
// @param fps Current FPS
101113
virtual uint32_t FPS(uint8_t& fps /* @out */) const = 0;
102114

115+
// @property
116+
// @brief Headers to send on all requests that the browser makes
117+
// @param header Header Name
103118
virtual uint32_t Headers(string& header /* @out */) const = 0;
104119
virtual uint32_t Headers(const string& header) = 0;
105120

121+
// @property
122+
// @brief UserAgent string used by the browser
123+
// @param useragent UserAgent value
106124
virtual uint32_t UserAgent(string& ua /* @out */) const = 0;
107125
virtual uint32_t UserAgent(const string& ua) = 0;
108126

127+
// @property
128+
// @brief User preferred languages used by the browser
129+
// @param language Preferred language
109130
virtual uint32_t Languages(string& langs /* @out */) const = 0;
110131
virtual uint32_t Languages(const string& langs) = 0;
111132

133+
// @property
134+
// @brief Controls the local storage availability
135+
// @param state enabled or disabled
112136
virtual uint32_t LocalStorageEnabled(bool& enabled /* @out */) const = 0;
113137
virtual uint32_t LocalStorageEnabled(const bool enabled) = 0;
114138

139+
// @property
140+
// @brief HTTP cookies accept policy
141+
// @param policy HTTP Cookie Accept Policy Type
115142
virtual uint32_t HTTPCookieAcceptPolicy(HTTPCookieAcceptPolicyType& policy /* @out */) const = 0;
116143
virtual uint32_t HTTPCookieAcceptPolicy(const HTTPCookieAcceptPolicyType policy) = 0;
117144

145+
// @brief Response for legacy $badger.
146+
// @param payload base64 encoded JSON string response to be delivered to $badger.callback(pid, success, json)
118147
virtual uint32_t BridgeReply(const string& payload) = 0;
148+
// @brief Send legacy $badger event.
149+
// @param payload base64 encoded JSON string response to be delivered to window.$badger.event(handlerId, json)
119150
virtual uint32_t BridgeEvent(const string& payload) = 0;
120151

121152
};

interfaces/IConfiguration.h

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* If not stated otherwise in this file or this component's LICENSE file the
3+
* following copyright and licenses apply:
4+
*
5+
* Copyright 2020 RDK Management
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
20+
#pragma once
21+
#include "Module.h"
22+
23+
namespace WPEFramework {
24+
namespace Exchange {
25+
26+
struct EXTERNAL IConfiguration : virtual public Core::IUnknown {
27+
enum { ID = ID_CONFIGURATION };
28+
29+
virtual uint32_t Configure(PluginHost::IShell* framework) = 0;
30+
};
31+
}
32+
}
33+

interfaces/IDIALServer.h

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* If not stated otherwise in this file or this component's LICENSE file the
3+
* following copyright and licenses apply:
4+
*
5+
* Copyright 2021 RDK Management
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
20+
#pragma once
21+
#include "Module.h"
22+
23+
namespace WPEFramework {
24+
namespace Exchange {
25+
26+
struct EXTERNAL IDIALServer : virtual public Core::IUnknown {
27+
28+
enum { ID = ID_DIALSERVER };
29+
30+
struct EXTERNAL IApplication : virtual public Core::IUnknown {
31+
32+
enum { ID = ID_DIALSERVER_APPLICATION };
33+
34+
virtual ~IApplication() = default;
35+
36+
virtual uint32_t AdditionalDataURL(string& url /* @out */) const = 0;
37+
38+
};
39+
40+
virtual ~IDIALServer() = default;
41+
42+
virtual IApplication* Application(const string& name) = 0;
43+
};
44+
45+
}
46+
}

0 commit comments

Comments
 (0)