Unit CastleOpenDocument

Uses
Classes, Interfaces, Objects and Records
Types
Variables

Description

Opening files and URLs.

Overview

Functions and Procedures

function OpenURL(AURL: String): Boolean;
function OpenDocument(APath: String): Boolean;
procedure ShareText(const Title, Subject, Content: string);
procedure OpenApplicationStore(const ApplicationId: string);
procedure Vibrate(const Miliseconds: Cardinal);
procedure OnScreenNotification(const Message: string);

Constants

SCannotOpenURL = 'Browser not found on your system.';

Description

Functions and Procedures

function OpenURL(AURL: String): Boolean;

Open URL with the suitable application.

This detects and handles also local files (as filenames, or URLs with "file:" protocol).

On Android and iOS, it uses the OS functions to open the URL, supporting all URL types that are handled by the installed applications. For example, it will support the market:// URLs on Android.

To use this on Android, declare your Android project type as "integrated", see https://github.com/castle-engine/castle-engine/wiki/Android-Project-Services-Integrated-with-Castle-Game-Engine .

function OpenDocument(APath: String): Boolean;

Warning: this symbol is deprecated.

Open a local file or directory. You should instead use OpenURL, that automatically detects local filenames and URLs leading to local filenames.

procedure ShareText(const Title, Subject, Content: string);

Share a text/link through user-choosen application.

This works only on Android and iOS right now. For Android, you need to declare the project type as "integrated": See https://github.com/castle-engine/castle-engine/wiki/Android-Project-Services-Integrated-with-Castle-Game-Engine .

Parameters
Title
The short title of the share.
Subject
Used as an email subject, and any other app on Android that interprets EXTRA_SUBJECT parameter.
Content
Multi-line share text content, possibly with URL inside.
procedure OpenApplicationStore(const ApplicationId: string);

Show the application in the application store (Google Play on Android, AppStore on iOS). Ignored on other platforms now.

procedure Vibrate(const Miliseconds: Cardinal);

Vibrate the device.

This is available only on Android right now, ignored elsewhere. To include the necessary integration code in your Android project, declare your Android project type as "integrated" with the "vibrate" service inside CastleEngineManifest.xml. See https://github.com/castle-engine/castle-engine/wiki/Android-Project-Services-Integrated-with-Castle-Game-Engine .

procedure OnScreenNotification(const Message: string);

Simple on-screen notification using Android "toast" call.

This is available only on Android right now, ignored elsewhere. To include the necessary integration code in your Android project, you must declare your Android project type as "integrated". See https://github.com/castle-engine/castle-engine/wiki/Android-Project-Services-Integrated-with-Castle-Game-Engine .

Constants

SCannotOpenURL = 'Browser not found on your system.';

If defined, the compiled code will have embedded all the variations of basic fonts for the X3D Text node (see [http://castle-engine.sourceforge.net/x3d_implementation_text.php]). This is comfortable (the FontStyle font works, with 3 * 4 font variations, out of the box), but it increases your exe size — possibly without a reason, if you don't use FontStyle X3D node.

Undefine this to conserve around 0.7 MB in exe size. All the Text X3D nodes will use standard sans non-bold, non-italic font.


Generated by PasDoc 0.15.0.