| 15747 |
anikendra |
1 |
/*
|
|
|
2 |
* Copyright (c) 2013 BlackBerry Limited
|
|
|
3 |
*
|
|
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
5 |
* you may not use this file except in compliance with the License.
|
|
|
6 |
* You may obtain a copy of the License at
|
|
|
7 |
*
|
|
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
9 |
*
|
|
|
10 |
* Unless required by applicable law or agreed to in writing, software
|
|
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
13 |
* See the License for the specific language governing permissions and
|
|
|
14 |
* limitations under the License.
|
|
|
15 |
*/
|
|
|
16 |
|
|
|
17 |
#ifndef Keyboard_NDK_HPP_
|
|
|
18 |
#define Keyboard_NDK_HPP_
|
|
|
19 |
|
|
|
20 |
#include <string>
|
|
|
21 |
#include <pthread.h>
|
|
|
22 |
#include <bb/AbstractBpsEventHandler>
|
|
|
23 |
#include <bps/bps.h>
|
|
|
24 |
#include<bps/netstatus.h>
|
|
|
25 |
#include<bps/locale.h>
|
|
|
26 |
#include<bps/virtualkeyboard.h>
|
|
|
27 |
#include<bps/navigator.h>
|
|
|
28 |
#include <bps/event.h>
|
|
|
29 |
#include <string>
|
|
|
30 |
#include <sstream>
|
|
|
31 |
|
|
|
32 |
class Keyboard_JS;
|
|
|
33 |
|
|
|
34 |
namespace webworks {
|
|
|
35 |
|
|
|
36 |
class Keyboard_NDK {
|
|
|
37 |
public:
|
|
|
38 |
explicit Keyboard_NDK(Keyboard_JS *parent = NULL);
|
|
|
39 |
virtual ~Keyboard_NDK();
|
|
|
40 |
virtual void event(bps_event_t *event);
|
|
|
41 |
|
|
|
42 |
void callKeyboardEmail(); // Method Calls the Keyboard style Email (default)
|
|
|
43 |
|
|
|
44 |
void callKeyboardNumber(); // Method Calls the Keyboard style number
|
|
|
45 |
|
|
|
46 |
void cancelKeyboard(); // Method cancel the keyboard
|
|
|
47 |
|
|
|
48 |
std::string keyboardStartThread();
|
|
|
49 |
|
|
|
50 |
|
|
|
51 |
|
|
|
52 |
|
|
|
53 |
|
|
|
54 |
|
|
|
55 |
|
|
|
56 |
private:
|
|
|
57 |
|
|
|
58 |
Keyboard_JS *m_pParent;
|
|
|
59 |
int keyboardProperty;
|
|
|
60 |
int keyboardThreadCount;
|
|
|
61 |
bool threadHalt;
|
|
|
62 |
std::string threadCallbackId;
|
|
|
63 |
pthread_t m_thread;
|
|
|
64 |
pthread_cond_t cond;
|
|
|
65 |
pthread_mutex_t mutex;
|
|
|
66 |
|
|
|
67 |
};
|
|
|
68 |
|
|
|
69 |
} // namespace webworks
|
|
|
70 |
|
|
|
71 |
#endif /* Keyboard_NDK_HPP_ */
|