summaryrefslogtreecommitdiff
path: root/android/experimental/LibreOffice4Android/dummies.cxx
blob: 5607ecfd72d630cf976d86b277496820cee239f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

// Dummy implementations of the callback functions in the UI layer
// that the LO layer calls. As this experimental Android app doesn't
// handle any of that, these do nothing.

#include <android/log.h>

#include <touch/touch.h>

extern "C"
__attribute__ ((visibility("default")))
void
touch_ui_selection_start(MLOSelectionKind kind,
                         const void *documentHandle,
                         MLORect *rectangles,
                         int rectangleCount,
                         void *preview)
{
}

extern "C"
__attribute__ ((visibility("default")))
void
touch_ui_selection_resize_done(bool success,
                               const void *documentHandle,
                               MLORect *rectangles,
                               int rectangleCount)
{
}

extern "C"
__attribute__ ((visibility("default")))
void
touch_ui_selection_none()
{
}


static const char *
dialog_kind_to_string(MLODialogKind kind)
{
    switch (kind) {
    case MLODialogMessage:
        return "MSG";
    case MLODialogInformation:
        return "INF";
    case MLODialogWarning:
        return "WRN";
    case MLODialogError:
        return "ERR";
    case MLODialogQuery:
        return "QRY";
    default:
        return "WTF";
    }
}

extern "C"
__attribute__ ((visibility("default")))
MLODialogResult
touch_ui_dialog_modal(MLODialogKind kind, const char *message)
{
    __android_log_print(ANDROID_LOG_INFO, "===>  %s: %s", dialog_kind_to_string(kind), message);
    return MLODialogOK;
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */