|
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 //USER |
|
18 #include "logsservicehandlerold.h" |
|
19 #include "logslogger.h" |
|
20 #include "logsmainwindow.h" |
|
21 #include <xqserviceutil.h> |
|
22 |
|
23 //SYSTEM |
|
24 |
|
25 // ----------------------------------------------------------------------------- |
|
26 // LogsServiceHandlerOld::LogsServiceHandlerOld |
|
27 // deprecated Use "logs.com.nokia.symbian.ILogsView" interface and |
|
28 // "show(int,bool,QString)" operation instead |
|
29 // ----------------------------------------------------------------------------- |
|
30 // |
|
31 LogsServiceHandlerOld::LogsServiceHandlerOld(LogsMainWindow& mainWindow) |
|
32 : XQServiceProvider(QLatin1String("com.nokia.services.logsservices.starter"),0), |
|
33 mMainWindow(mainWindow) |
|
34 { |
|
35 LOGS_QDEBUG( "logs [UI] -> LogsServiceHandlerOld::LogsServiceHandlerOld()" ) |
|
36 |
|
37 publishAll(); |
|
38 mIsAppStartedUsingService = XQServiceUtil::isService(); |
|
39 |
|
40 LOGS_QDEBUG_2( |
|
41 "logs [UI] <- LogsServiceHandlerOld::LogsServiceHandlerOld(), is service", |
|
42 mIsAppStartedUsingService ) |
|
43 } |
|
44 |
|
45 // ----------------------------------------------------------------------------- |
|
46 // LogsServiceHandlerOld::~LogsServiceHandlerOld |
|
47 // ----------------------------------------------------------------------------- |
|
48 // |
|
49 LogsServiceHandlerOld::~LogsServiceHandlerOld() |
|
50 { |
|
51 LOGS_QDEBUG( "logs [UI] <-> LogsServiceHandlerOld::~LogsServiceHandlerOld()" ) |
|
52 } |
|
53 |
|
54 // ----------------------------------------------------------------------------- |
|
55 // LogsServiceHandlerOld::start |
|
56 // ----------------------------------------------------------------------------- |
|
57 // |
|
58 int LogsServiceHandlerOld::start(int activatedView, bool showDialpad) |
|
59 { |
|
60 LOGS_QDEBUG_2( "logs [UI] -> LogsServiceHandlerOld::start(), view:", activatedView ) |
|
61 |
|
62 if ( activatedView < LogsServices::ViewAll || |
|
63 activatedView > LogsServices::ViewMissed ){ |
|
64 LOGS_QDEBUG( "logs [UI] <- LogsServiceHandlerOld::start(), incorrect view" ) |
|
65 return -1; |
|
66 } |
|
67 mIsAppStartedUsingService = true; |
|
68 |
|
69 LOGS_QDEBUG( "logs [UI] Bring app to foreground" ) |
|
70 mMainWindow.bringAppToForeground(); |
|
71 |
|
72 emit activateView((LogsServices::LogsView)activatedView, showDialpad); |
|
73 |
|
74 LOGS_QDEBUG( "logs [UI] <- LogsServiceHandlerOld::start()" ) |
|
75 return 0; |
|
76 } |
|
77 |
|
78 // ----------------------------------------------------------------------------- |
|
79 // LogsServiceHandlerOld::startWithNum |
|
80 // ----------------------------------------------------------------------------- |
|
81 // |
|
82 int LogsServiceHandlerOld::startWithNum(int activatedView, bool showDialpad, QString dialpadText) |
|
83 { |
|
84 LOGS_QDEBUG_2( "logs [UI] -> LogsServiceHandlerOld::startWithNum(), view:", activatedView ) |
|
85 |
|
86 Q_UNUSED(showDialpad); |
|
87 |
|
88 if ( activatedView < LogsServices::ViewAll || |
|
89 activatedView > LogsServices::ViewMissed ){ |
|
90 LOGS_QDEBUG( "logs [UI] <- LogsServiceHandlerOld::startWithNum(), incorrect view" ) |
|
91 return -1; |
|
92 } |
|
93 mIsAppStartedUsingService = true; |
|
94 |
|
95 LOGS_QDEBUG( "logs [UI] Bring app to foreground" ) |
|
96 mMainWindow.bringAppToForeground(); |
|
97 |
|
98 emit activateView(dialpadText); |
|
99 |
|
100 LOGS_QDEBUG( "logs [UI] <- LogsServiceHandlerOld::startWithNum()" ) |
|
101 return 0; |
|
102 } |
|
103 |
|
104 // ----------------------------------------------------------------------------- |
|
105 // LogsServiceHandlerOld::isStartedUsingService |
|
106 // ----------------------------------------------------------------------------- |
|
107 // |
|
108 bool LogsServiceHandlerOld::isStartedUsingService() const |
|
109 { |
|
110 return mIsAppStartedUsingService; |
|
111 } |
|
112 |