1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 #ifndef CXUISERVICEPROVIDER_H_ |
|
18 #define CXUISERVICEPROVIDER_H_ |
|
19 |
|
20 |
|
21 #include <xqserviceprovider.h> |
|
22 #include "cxeerror.h" |
|
23 #include "cxenamespace.h" |
|
24 |
|
25 |
|
26 class CxeEngine; |
|
27 |
|
28 class CxuiServiceProvider : public XQServiceProvider |
|
29 { |
|
30 |
|
31 Q_OBJECT |
|
32 |
|
33 public: |
|
34 |
|
35 static void create(CxeEngine* engine); |
|
36 static CxuiServiceProvider* instance(); |
|
37 static void destroy(); |
|
38 static bool isCameraEmbedded(); |
|
39 |
|
40 Cxe::CameraMode requestedMode(); |
|
41 |
|
42 bool allowModeSwitching(); |
|
43 bool allowQualityChange(); |
|
44 bool allowCameraSwitching(); |
|
45 |
|
46 public slots: |
|
47 |
|
48 /* |
|
49 * Mode: image = 0, video = 1 |
|
50 * Parameters: |
|
51 * |
|
52 * camera_index: int: primary = 0, secondary = 1 |
|
53 * quality: int: 0 = default, 1 = lowest, 2 = highest |
|
54 * allow_mode_switch: bool |
|
55 * allow_camera_switch: bool |
|
56 * allow_quality_change: bool |
|
57 */ |
|
58 void capture(int mode, const QVariantMap ¶meters); |
|
59 |
|
60 void sendFilenameToClientAndExit(QString filename = ""); |
|
61 |
|
62 private: |
|
63 |
|
64 CxuiServiceProvider(CxeEngine *engine); |
|
65 ~CxuiServiceProvider(); |
|
66 |
|
67 bool readParameters(const QVariantMap& parameters); |
|
68 |
|
69 static CxuiServiceProvider *mInstance; |
|
70 int mRequestIndex; |
|
71 CxeEngine *mEngine; |
|
72 Cxe::CameraMode mRequestedMode; |
|
73 int mCameraIndex; |
|
74 int mQuality; |
|
75 bool mAllowModeSwitching; |
|
76 bool mAllowQualityChange; |
|
77 bool mAllowCameraSwitching; |
|
78 |
|
79 }; |
|
80 |
|
81 #endif /* CXUISERVICEPROVIDER_H_ */ |
|