Skip to content

Commit

Permalink
Cleanup for first merge #130
Browse files Browse the repository at this point in the history
  • Loading branch information
DaSpood committed Mar 29, 2024
1 parent 6c99984 commit 3167806
Show file tree
Hide file tree
Showing 17 changed files with 244 additions and 524 deletions.
256 changes: 29 additions & 227 deletions README.md

Large diffs are not rendered by default.

11 changes: 2 additions & 9 deletions docs/api/camera.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# The camera scanner

:::{admonition} WIP
:class: attention

This documentation is a work in progress.
:::

**enioka Scan** can still be used to manage barcodes scanned using the Android camera. For that, it
exposes the `CameraBarcodeScanView` and a series of helper classes to handle compatibility with both
Camera 1 and Camera 2 hardware APIs.
Expand All @@ -19,7 +13,7 @@ the API-specific `CameraBarcodeScanViewBase` implementation and handles the API
the device's properties.

For most users, this is the class they will interact with if they need to interact with the Camera
hardware and not just the [`Scanner`](scanner) instance.
hardware and not just the [`Scanner` instance](scanner.md#the-scanner-interface).

:::{method} setReaderMode(CameraReader readerMode) -> void

Expand All @@ -44,8 +38,7 @@ Used by `CameraBarcodeScanViewScanner` to register itself with the view and corr
barcodes read by the camera as any regular scanner reads.

:param ResultHandler handler: the
[`ResultHandler`](scanner_callbacks.md#the-camerabarcodescanviewresulthandler-interface)
implementation
[`ResultHandler` implementation](scanner_callbacks.md#the-camerabarcodescanviewresulthandler-interface)
:::

:::{method} setTorch(boolean value) -> void
Expand Down
15 changes: 6 additions & 9 deletions docs/api/index.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# API reference

% Notes:

% Due to the limitations of Sphinx and MyST, documentation formatting was 'hacked' a bit by using
% python and cpp directives as Java is not natively supported and has no proper third-party option.

:::{admonition} WIP
:class: attention

This documentation is a work in progress.
:::
% API guides for the BluetoothScanner API may be helpful for provider developers but is not a
% priority. A full bluetooth guide may be needed, as well as a detailed overview of the library's
% workflow from service startup to scanner availability.

This section contains more in-depth info about important classes and interfaces of **enioka Scan**.

Expand All @@ -29,7 +29,4 @@ others

lazerscanner
scanner_provider
:::

% API guides for the BluetoothScanner API may be helpful for provider developpers but is not a
% priority. A full bluetooth guide may be needed.
:::
14 changes: 7 additions & 7 deletions docs/api/lazerscanner.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
# The LazerScanner class

:::{admonition} WIP
:class: attention

This documentation is a work in progress.
:::

`LazerScanner` is the main scanner factory and the core of the library. It is in charge of finding
scanner providers and scanner devices. Most users will let the [`ScannerService`](scanner_service)
scanner providers and scanner devices. Most users will let the
[`ScannerService`](scanner_service.md#the-scannerserviceapi-interface)
handle its own instance of `LazerScanner`, but should you need it, you can use its static methods
directly.

Expand Down Expand Up @@ -37,4 +32,9 @@ There is a specific callback when no scanner is available.
:param ScannerConnectionHandler handler: The callback used whenever a scanner is found.
Automatically wrapped by a `ScannerConnectionHandlerProxy`, for which a public overload exists.
:param ScannerSearchOptions options: The options used to refine the search.
:::

:::{seealso}

* The [Callbacks](scanner_callbacks.md) documentation
:::
6 changes: 0 additions & 6 deletions docs/api/others.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# Other useful classes

:::{admonition} WIP
:class: attention

This documentation is a work in progress.
:::

The library contains a lot of other smaller classes you may need to interact with. This page will
regroup most of them.

Expand Down
25 changes: 6 additions & 19 deletions docs/api/scanner.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
# The Scanner API

:::{admonition} WIP
:class: attention

This documentation is a work in progress.
:::

:::{admonition} TODO
:class: attention

* Correct links to specific methods of other API reference pages (e.g. `ScannerProvider.getKey()`)
:::

The `Scanner` interface is the central part of the library. It is the piece of code that gives the
user control on the physical scanner devices. All devices have common methods relating to basic
functionalities (reading a barcode) or lifecycle control. Some devices have access to extra features
Expand All @@ -23,7 +11,7 @@ directly call the overloaded method with a proxy callback.

:::{seealso}

[Callbacks](scanner_callbacks.md) documentation.
* The [Callbacks](scanner_callbacks.md) documentation.
:::

## The `Scanner` interface
Expand Down Expand Up @@ -57,7 +45,7 @@ between the library and the physical devices and registers callbacks.
:::{method} getProviderKey() -> String

For logging and sorting purpose, this is the key of the SDK behind this scanner (same as
[`ScannerProvider.getKey()`](scanner_provider.md#getKey))
[`ScannerProvider.getKey()`](scanner_provider.md#the-scannerprovider-interface))
:::

:::{method} setDataCallBack(ScannerDataCallbackProxy cb) -> void
Expand Down Expand Up @@ -86,7 +74,7 @@ or absent.

:::{method} resume(@Nullable ScannerCommandCallback cb) -> void

Reverse the effects of [`pause()`](#pause). The scanner is once again ready to scan after
Reverse the effects of `pause()`. The scanner is once again ready to scan after
this call. The scanner's status callback should be called if needed. Idempotent.

:param ScannerCommandCallback cb: The callback to call with the result of the operation. May be null
Expand Down Expand Up @@ -171,7 +159,7 @@ or absent.

:::{method} releaseScanTrigger(@Nullable ScannerCommandCallback cb) -> void

Ends the effect of [`pressScanTrigger()`](#pressScanTrigger).
Ends the effect of `pressScanTrigger()`.

:param ScannerCommandCallback cb: The callback to call with the result of the operation. May be null
or absent.
Expand All @@ -196,16 +184,15 @@ or absent.

:::{method} disableIllumination(@Nullable ScannerCommandCallback cb) -> void

Opposite of [`enableIllumination()`](#enableIllumination).
Opposite of `enableIllumination()`.

:param ScannerCommandCallback cb: The callback to call with the result of the operation. May be null
or absent.
:::

:::{method} toggleIllumination(@Nullable ScannerCommandCallback cb) -> void

See [`enableIllumination()`](#enableIllumination) and
[`disableIllumination()`](#disableIllumination).
See `enableIllumination()` and `disableIllumination()`.

:param ScannerCommandCallback cb: The callback to call with the result of the operation. May be null
or absent.
Expand Down
36 changes: 15 additions & 21 deletions docs/api/scanner_activity.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
# The Scanner activity

:::{admonition} WIP
:class: attention

This documentation is a work in progress.
:::

The simplest way to start using **enioka Scan** in an activity is simply to inherit from the
`ScannerCompatActivity` class. This class implements the
[`ScannerClient`](scanner_service.md#the-scannerclient-interface) interface and handles the scanner
[`ScannerClient` interface](scanner_service.md#the-scannerclient-interface) and handles the scanner
service bindings and life cycle. It also exposes a default UI to print scan results, status messages
and some buttons to manually control the scanner device from the app.

Most of its methods are protected and can be overridden if needed. Mainly, methods from the
[`ScannerClient`](scanner_service.md#the-scannerclient-interface) interface should be replaced with
[`ScannerClient` interface](scanner_service.md#the-scannerclient-interface) should be replaced with
your own to adapt the way scan results are handled by your application.

By default, the activity will use the [default search options](scanner_service.md#defaultOptions) to
initiate scanner search. There are two ways to change these options: override the
[`getServiceInitExtras()`](#getServiceInitExtras) method, and passing the search options as extras
to the intent starting the activity. In case both are used, the method is applied first, then intent
extras.
By default, the activity will use the
[default search options](scanner_service.md#the-scannersearchoptions-class) to initiate scanner
search. There are two ways to change these options: override the
[`getServiceInitExtras()` method](#scannercompatactivity-methods), and passing the search options as
extras to the intent starting the activity. In case both are used, the method is applied first, then
intent extras.

This page will describe attributes and methods specific to this activity, disregarding overrides.
For most users, it is recommended to only change the value of attributes or interface methods, as
overriding class methods may cause unexpected side-effects.
overriding class methods may cause unexpected side-effects. For example, using a custom layout only
requires changing the corresponding layout ID attributes.

## `ScannerCompatActivity` attributes

Expand Down Expand Up @@ -95,8 +91,6 @@ The ID of the optional toggle button on which to display the manual input fragme

An optional fragment allowing to input a value with the soft keyboard (for cases when scanners do
not work).

Initialized by the [`displayManualInputButton()`](#displayManualInputButton) method.
:::

:::{cpp:var} List<ManualInputItem> autocompletionItems = new ArrayList<>()
Expand All @@ -114,16 +108,16 @@ How many characters should be entered before auto-completion starts.
The instance of the bound scanner service, can be used to access service methods but should not be
replaced.

Initialized by the [`onStart()`](#onStart) and [`onResume()`](#onResume) methods.
Initialized by the `onStart()` and `onResume()` methods.
:::

:::{cpp:var} CameraBarcodeScanViewScanner cameraScanner;

The instance of the camera scanner, can be used to access camera methods but should not be replaced.
`CameraBarcodeScanViewScanner` is a simple provider-less implementation of the [`Scanner`](scanner)
API.
`CameraBarcodeScanViewScanner` is a simple provider-less implementation of the
[`Scanner` interface](scanner.md#the-scanner-interface).

Initialized by the [`initCamera()`](#initCamera) method.
Initialized by the [`initCamera()`](#scannercompatactivity-methods) method.
:::

## `ScannerCompatActivity` methods
Expand Down Expand Up @@ -169,5 +163,5 @@ Checks whether any available scanner has Illumination toggled on.

:::{seealso}

[`ScannerClient`](scanner_service.md#the-scannerclient-interface) methods.
* The [`ScannerClient` interface](scanner_service.md#the-scannerclient-interface) documentation.
:::
20 changes: 8 additions & 12 deletions docs/api/scanner_callbacks.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# API callbacks

:::{admonition} WIP
:class: attention

This documentation is a work in progress.
:::

Most **enioka Scan** actions use callbacks to communicate their result to your code. In the case of
scanner-related callbacks, proxy classes exist to wrap callback implementations and ensure their
methods are called on the UI thread.
Expand Down Expand Up @@ -33,7 +27,8 @@ Called when the command's expected answer did not arrive in time (usually only w

## The `ScannerConnectionHandler` interface and `ScannerConnectionHandlerProxy` class

Callback used during the scanner search to retrieve created [`Scanner`](scanner) instances.
Callback used during the scanner search to retrieve created
[`Scanner` instances](scanner.md#the-scanner-interface).

:::{method} scannerConnectionProgress(String providerKey, String scannerKey, String message) -> void

Expand All @@ -46,8 +41,8 @@ A SDK-specific localized message signaling a change during the search for a scan

:::{method} scannerCreated(String providerKey, String scannerKey, Scanner s) -> void

Called when a scanner was found and created.
Depending on [`ScannerSearchOptions.returnOnlyFirst`](scanner_service.md#returnOnlyFirst) may be
Called when a scanner was found and created. Depending on
[`ScannerSearchOptions.returnOnlyFirst`](scanner_service.md#the-scannersearchoptions-class) may be
called multiple times.

:param String providerKey: The identifier of the provider/SDK
Expand All @@ -57,8 +52,8 @@ called multiple times.

:::{method} noScannerAvailable() -> void

Called when there is no scanner available on the device.
[`endOfScannerSearch()`](#endOfScannerSearch) is always called after this.
Called when there is no scanner available on the device. `endOfScannerSearch()` is always called
after this.
:::

:::{method} endOfScannerSearch() -> void
Expand Down Expand Up @@ -195,7 +190,8 @@ manage the device it was tested for.

Called if the provider can manage the device.

:param Scanner libraryScanner: The corresponding [`Scanner`](scanner) instance.
:param Scanner libraryScanner: The corresponding
[`Scanner` instance](scanner.md#the-scanner-interface).
:::

:::{method} cannotManage() -> void
Expand Down
34 changes: 13 additions & 21 deletions docs/api/scanner_provider.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# The ScannerProvider API

:::{admonition} WIP
:class: attention

This documentation is a work in progress.
:::

The Scanner Provider is the entrypoint of an SDK. Its purpose is to check if the SDK is able to
interact with a device, and handle the [`Scanner`](scanner.md) creation.

Expand All @@ -22,13 +16,13 @@ The core methods of a provider common between, all types of devices.

This method will make the provider check whether it is compatible with any scanning device while
matching requirements imposed by the search options. If it is able to connect to a device, the
provider will use the callback to notify its availability and return a [`Scanner`](scanner.md)
instance.
provider will use the callback to notify its availability and return a
[`Scanner` instance](scanner.md#the-scanner-interface).

:param Context ctx: The application context.
:param ProviderCallback cb: The [`ProviderCallback`](scanner_callbacks.md#providerCallback) used
to notify the Scanner Service whether this SDK is available (as in, is able to connect to any
scanning device), and the current status of [`Scanner`](scanner.md) creation.
:param ProviderCallback cb: The `ProviderCallback` used to notify the Scanner Service whether this
SDK is available (as in, is able to connect to any scanning device), and the current status of
[`Scanner` instance](scanner.md#the-scanner-interface) creation.
:param ScannerSearchOptions options: The search options the provider may use to further refine its
compatibility checks.
:::
Expand All @@ -40,8 +34,9 @@ instance.

:::{seealso}

Check the documentation of the [`ProviderCallback`](scanner_callbacks.md#providerCallback) for
details on how the provider will communicate its status with the Scanner Service.
Check the documentation of the
[`ProviderCallback` interface](scanner_callbacks.md#the-scannerproviderprovidercallback-interface)
for details on how the provider will communicate its status with the Scanner Service.
:::

## The `IntentScannerProvider` abstract class
Expand All @@ -54,8 +49,8 @@ A provider for an integrated scanner should extend this class and override the f

:::{method} createNewScanner(Context ctx, ScannerSearchOptions options) -> Scanner

This method is called by `ScannerProvider.getScanner()` to create the [`Scanner`](scanner.md)
instance.
This method is called by `ScannerProvider.getScanner()` to create the
[`Scanner` instance](scanner.md#the-scanner-interface).

:param Context ctx: The application context.
:param ScannerSearchOptions options: The search options the provider used to confirm compatibility.
Expand Down Expand Up @@ -121,15 +116,12 @@ Tests whether a scanner is compatible with the provider. Must complete in under

:::{method} getInputHandler() -> ScannerDataParser

:returns: The [`ScannerDataParser`](others.md#scannerDataParser) which should be used to parse
bluetooth messages from compatible devices.
:returns: The parser which should be used to parse bluetooth messages from compatible devices.
:::

:::{seealso}

Check the documentation of the [`ManagementCallback`](scanner_callbacks.md#managementCallback)
Check the documentation of the
[`ManagementCallback` interace](scanner_callbacks.md#the-btsppscannerprovidermanagementcallback-interface)
for details on how the bluetooth provider will communicate its status with the Scanner Service.

Check the documentation of the [`ScannerDataParser`](others.md#scannerDataParser) for
details bluetooth message parsers.
:::
Loading

0 comments on commit 3167806

Please sign in to comment.