34
|
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: FM Radio widget radio service client
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef RADIOHSWIDGETRADIOSERVICECLIENT_H_
|
|
19 |
#define RADIOHSWIDGETRADIOSERVICECLIENT_H_
|
|
20 |
|
|
21 |
// System includes
|
|
22 |
#include <QObject>
|
|
23 |
#include <xqappmgr.h>
|
|
24 |
|
|
25 |
// User includes
|
|
26 |
#include "radiohswidget.h"
|
|
27 |
#include "radioservicedef.h"
|
|
28 |
|
|
29 |
class RadioHsWidgetRadioServiceClient : public QObject
|
|
30 |
{
|
|
31 |
Q_OBJECT
|
|
32 |
|
|
33 |
public:
|
|
34 |
explicit RadioHsWidgetRadioServiceClient(RadioHsWidget *parent = 0);
|
|
35 |
virtual ~RadioHsWidgetRadioServiceClient();
|
|
36 |
|
|
37 |
public:
|
|
38 |
void commandFmRadio(const RadioServiceCommand::CommandId command);
|
|
39 |
void startMonitoring(
|
|
40 |
const FmRadio::VisibiltyAfterRequest visibility);
|
|
41 |
void stopMonitoring();
|
|
42 |
QVariant createRadioNotificationData(int type, const QVariant& data);
|
|
43 |
|
|
44 |
private slots:
|
|
45 |
void handleError(const int errorCode, const QString &errorMessage);
|
|
46 |
void handleFmRadioChange(const QVariant &value);
|
|
47 |
|
|
48 |
private:
|
|
49 |
void handleRequestError(const int error);
|
|
50 |
|
|
51 |
void createControlServiceRequest();
|
|
52 |
void createMonitorServiceRequest();
|
|
53 |
|
|
54 |
void sendMonitorRequest(
|
|
55 |
const FmRadio::VisibiltyAfterRequest visibility);
|
|
56 |
void sendControlRequest(const QVariant &argument,
|
|
57 |
const FmRadio::VisibiltyAfterRequest visibility);
|
|
58 |
|
|
59 |
void prepareRequestInfo(XQAiwRequest *request,
|
|
60 |
const FmRadio::VisibiltyAfterRequest visibility);
|
|
61 |
|
|
62 |
private: // data
|
|
63 |
/*!
|
|
64 |
Stores the reference to parent. This is used to call parents
|
|
65 |
functions when notifications are received.
|
|
66 |
*/
|
|
67 |
RadioHsWidget &mParent;
|
|
68 |
/*! Is the request send. */
|
|
69 |
bool mRequestPending;
|
|
70 |
/*! For service and interface listings and request creation. */
|
|
71 |
XQApplicationManager mApplicationManager;
|
|
72 |
/*! Asynchronous monitoring request. */
|
|
73 |
XQAiwRequest* mRadioMonitorRequest;
|
|
74 |
/*! Synchronous control request. */
|
|
75 |
XQAiwRequest* mRadioControlRequest;
|
|
76 |
|
|
77 |
/*! Is the first monitoring request done. */
|
|
78 |
bool mDataInitialized;
|
|
79 |
};
|
|
80 |
|
|
81 |
#endif /* RADIOHSWIDGETRADIOSERVICECLIENT_H_ */
|