forked from Samsung/TizenFX
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initialize Tizen.Applications.ToastMessage
Signed-off-by: seungha.son <[email protected]> Change-Id: I9a8ed7dc5f20b7fbae5fe6224d1592b982209a51
- Loading branch information
Showing
15 changed files
with
322 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/Tizen.Applications.ToastMessage/Interop/Interop.Libraries.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the License); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an AS IS BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Libraries | ||
{ | ||
public const string ToastMessage = "libnotification.so.0"; | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/Tizen.Applications.ToastMessage/Interop/Interop.ToastMessage.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the License); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an AS IS BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
using Tizen.Applications; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static class ToastMessage | ||
{ | ||
[DllImport(Libraries.ToastMessage, EntryPoint = "notification_status_message_post")] | ||
internal static extern int ToastMessagePost(string message); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/Tizen.Applications.ToastMessage/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using System.Reflection; | ||
using System.Runtime.InteropServices; | ||
|
||
[assembly: AssemblyTitle("Tizen.Applications.ToastMessage")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("Samsung Electronics")] | ||
[assembly: AssemblyProduct("Tizen.Applications")] | ||
[assembly: AssemblyCopyright("Copyright (c) 2017 Samsung Electronics Co., Ltd")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
[assembly: ComVisible(false)] | ||
[assembly: CLSCompliant(true)] | ||
|
||
[assembly: Guid("d2d1a3ce-000e-4ab3-81c4-a8a44a008989")] | ||
|
||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |
84 changes: 84 additions & 0 deletions
84
src/Tizen.Applications.ToastMessage/Tizen.Applications.ToastMessage.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{C35F85FC-A095-4356-8F17-DD248FB1C9AA}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace> | ||
</RootNamespace> | ||
<AssemblyName>Tizen.Applications.ToastMessage</AssemblyName> | ||
<FileAlignment>512</FileAlignment> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<TargetFrameworkIdentifier>.NETStandard</TargetFrameworkIdentifier> | ||
<TargetFrameworkVersion>v1.3</TargetFrameworkVersion> | ||
<NuGetTargetMoniker>.NETStandard,Version=v1.3</NuGetTargetMoniker> | ||
<AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences> | ||
<NoStdLib>true</NoStdLib> | ||
<NoWarn>$(NoWarn);1701;1702</NoWarn> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<SignAssembly>true</SignAssembly> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<AssemblyOriginatorKeyFile>Tizen.Applications.ToastMessage.snk</AssemblyOriginatorKeyFile> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="Interop\Interop.Libraries.cs" /> | ||
<Compile Include="Interop\Interop.ToastMessage.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<Compile Include="Tizen.Applications\ToastMessage.cs" /> | ||
<Compile Include="Tizen.Applications\ToastMessageErrorFactory.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="Tizen.Applications.ToastMessage.project.json" /> | ||
<None Include="Tizen.Applications.ToastMessage.snk" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\Tizen.Applications.Common\Tizen.Applications.Common.csproj"> | ||
<Project>{663c5a3d-e631-4987-aee7-f498c56a40fc}</Project> | ||
<Name>Tizen.Applications.Common</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
<PropertyGroup> | ||
<!-- https://github.com/dotnet/corefxlab/tree/master/samples/NetCoreSample and | ||
https://docs.microsoft.com/en-us/dotnet/articles/core/tutorials/target-dotnetcore-with-msbuild | ||
--> | ||
<!-- We don't use any of MSBuild's resolution logic for resolving the framework, so just set these two | ||
properties to any folder that exists to skip the GetReferenceAssemblyPaths task (not target) and | ||
to prevent it from outputting a warning (MSB3644). | ||
--> | ||
<_TargetFrameworkDirectories>$(MSBuildThisFileDirectory)</_TargetFrameworkDirectories> | ||
<_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)</_FullFrameworkReferenceAssemblyPaths> | ||
<AutoUnifyAssemblyReferences>true</AutoUnifyAssemblyReferences> | ||
</PropertyGroup> | ||
</Project> |
21 changes: 21 additions & 0 deletions
21
src/Tizen.Applications.ToastMessage/Tizen.Applications.ToastMessage.nuspec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0"?> | ||
<package> | ||
<metadata> | ||
<id>Tizen.Applications.ToastMessage</id> | ||
<version>$version$</version> | ||
<authors>Samsung Electronics</authors> | ||
<requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
<licenseUrl>https://www.apache.org/licenses/LICENSE-2.0</licenseUrl> | ||
<projectUrl>https://www.tizen.org/</projectUrl> | ||
<iconUrl>https://developer.tizen.org/sites/default/files/images/tizen-pinwheel-on-light-rgb_64_64.png</iconUrl> | ||
<copyright>© Samsung Electronics Co., Ltd All Rights Reserved</copyright> | ||
<description>Provides the Application Frameworks API for Tizen.Net</description> | ||
<dependencies> | ||
<dependency id="Tizen" version="1.0.2" /> | ||
<dependency id="Tizen.Applications.Common" version="1.2.0" /> | ||
</dependencies> | ||
</metadata> | ||
<files> | ||
<file src="bin/$Configuration$/Tizen.Applications.ToastMessage.dll" target="lib/netstandard1.3" /> | ||
</files> | ||
</package> |
9 changes: 9 additions & 0 deletions
9
src/Tizen.Applications.ToastMessage/Tizen.Applications.ToastMessage.project.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"dependencies": { | ||
"NETStandard.Library": "1.6.0", | ||
"Tizen": "1.0.2" | ||
}, | ||
"frameworks": { | ||
"netstandard1.3": {} | ||
} | ||
} |
Binary file added
BIN
+596 Bytes
src/Tizen.Applications.ToastMessage/Tizen.Applications.ToastMessage.snk
Binary file not shown.
56 changes: 56 additions & 0 deletions
56
src/Tizen.Applications.ToastMessage/Tizen.Applications/ToastMessage.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the License); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an AS IS BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Tizen.Applications | ||
{ | ||
public sealed class ToastMessage | ||
{ | ||
|
||
/// <summary> | ||
/// Gets and sets message to post ToastMessage | ||
/// </summary> | ||
public string Message { get; set; } | ||
|
||
/// <summary> | ||
/// Posts a message on a toast popup | ||
/// </summary> | ||
/// <exception cref="ArgumentNullException">Thrown when Message is null</exception> | ||
/// <example> | ||
/// <code> | ||
/// ToastMessage toast = new ToastMessage | ||
/// { | ||
/// Message = "Hello TIzen" | ||
/// }; | ||
/// toast.Post(); | ||
/// </code> | ||
/// </example> | ||
public void Post() | ||
{ | ||
int ret = Interop.ToastMessage.ToastMessagePost(Message); | ||
if (ret != (int)ToastMessageError.None) | ||
{ | ||
throw ToastMessageErrorFactory.GetException((ToastMessageError)ret, "post toast message failed"); | ||
} | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.