17 |
17 |
18 #include <QGraphicsLinearLayout> |
18 #include <QGraphicsLinearLayout> |
19 #include <HbIconItem> |
19 #include <HbIconItem> |
20 #include "hsdialerwidget.h" |
20 #include "hsdialerwidget.h" |
21 #ifdef Q_OS_SYMBIAN |
21 #ifdef Q_OS_SYMBIAN |
|
22 #include "qtphonelog.h" |
22 #include <xqservicerequest.h> |
23 #include <xqservicerequest.h> |
23 #include <XQSettingsManager> |
24 #include <xqcallinfo.h> |
24 #include <xqpublishandsubscribeutils.h> |
25 #include <xqpublishandsubscribeutils.h> |
25 #include <ctsydomainpskeys.h> |
26 #include <ctsydomainpskeys.h> |
26 #include <logsservices.h> |
27 #include <logsservices.h> |
27 #endif |
28 #endif |
28 |
29 |
42 /*! |
43 /*! |
43 Constructs dialer widget with given \a parent and given window \a flags. |
44 Constructs dialer widget with given \a parent and given window \a flags. |
44 */ |
45 */ |
45 HsDialerWidget::HsDialerWidget(QGraphicsItem *parent, Qt::WindowFlags flags) |
46 HsDialerWidget::HsDialerWidget(QGraphicsItem *parent, Qt::WindowFlags flags) |
46 : HbWidget(parent, flags), |
47 : HbWidget(parent, flags), |
47 mSetManager(0) |
48 mXQCallInfo(0) |
48 { |
49 { |
49 HbIconItem *iconItem = new HbIconItem; |
50 HbIconItem *iconItem = new HbIconItem; |
50 HbIcon icon(KDialerWidgetIcon); |
51 HbIcon icon(KDialerWidgetIcon); |
51 iconItem->setIcon(icon); |
52 iconItem->setIcon(icon); |
52 |
53 |
61 /*! |
62 /*! |
62 Destructor. |
63 Destructor. |
63 */ |
64 */ |
64 HsDialerWidget::~HsDialerWidget() |
65 HsDialerWidget::~HsDialerWidget() |
65 { |
66 { |
66 #ifdef Q_OS_SYMBIAN |
|
67 delete mSetManager; |
|
68 #endif |
|
69 } |
67 } |
70 |
68 |
71 /*! |
69 /*! |
72 \fn void HsDialerWidget::startDialer() |
70 \fn void HsDialerWidget::startDialer() |
73 |
71 |
74 Starts dialer widget via view activation service. |
72 Starts dialer widget via view activation service. |
75 */ |
73 */ |
76 void HsDialerWidget::startDialer() |
74 void HsDialerWidget::startDialer() |
77 { |
75 { |
78 #ifdef Q_OS_SYMBIAN |
76 #ifdef Q_OS_SYMBIAN |
79 const quint32 KKCTsyCallState = 0x00000001; |
77 PHONE_DEBUG("HsDialerWidget::startDialer"); |
80 const qint32 KKPSUidCtsyCallInformation = {0x102029AC}; |
78 |
81 if (!mSetManager) { |
79 if (!mXQCallInfo) { |
82 mSetManager = new XQSettingsManager(); |
80 mXQCallInfo = XQCallInfo::create(); |
83 } |
81 mXQCallInfo->setParent(this); |
84 |
82 } |
85 XQPublishAndSubscribeSettingsKey callStateKey(KKPSUidCtsyCallInformation, KKCTsyCallState); |
83 |
86 int callState = mSetManager->readItemValue(callStateKey).toInt(); |
84 QList<CallInfo> calls; |
87 if( (callState != EPSCTsyCallStateNone ) && (callState != EPSCTsyCallStateUninitialized) ) { |
85 mXQCallInfo->getCalls(calls); |
|
86 |
|
87 if( 0 < calls.count() ){ |
|
88 PHONE_DEBUG("call ongoing, bring Telephone to foreground"); |
|
89 |
|
90 // ToDo: should telephone + dialpad be opened when there is a waiting call? |
88 int dialer(1); |
91 int dialer(1); |
89 |
|
90 // ToDo: should telephone + dialpad be opened when there is a waiting call? |
|
91 //if (callState == EPSCTsyCallStateRinging) { |
|
92 //dialer = 0; |
|
93 //} |
|
94 XQServiceRequest snd("com.nokia.services.telephony.uistarter", "start(int)", false); |
92 XQServiceRequest snd("com.nokia.services.telephony.uistarter", "start(int)", false); |
95 snd << dialer; |
93 snd << dialer; |
96 QVariant retValue; |
94 QVariant retValue; |
97 snd.send(retValue); |
95 snd.send(retValue); |
98 } |
96 } |
99 else { |
97 else { |
|
98 PHONE_DEBUG("no calls, open Dialer"); |
100 XQServiceRequest snd("com.nokia.services.logsservices.starter", |
99 XQServiceRequest snd("com.nokia.services.logsservices.starter", |
101 "start(int,bool)", false); |
100 "start(int,bool)", false); |
102 snd << (int)LogsServices::ViewAll; |
101 snd << (int)LogsServices::ViewAll; |
103 snd << true; |
102 snd << true; |
104 int retValue; |
103 int retValue; |