# HG changeset patch # User hgs # Date 1288002029 -10800 # Node ID 2dc695882abd5dcf42d22fd38895f4105b71cecd # Parent 3592750162a523c7a10722cf3b3cc49ec17f4f80 201041 diff -r 3592750162a5 -r 2dc695882abd package_definition.xml --- a/package_definition.xml Wed Oct 13 13:08:34 2010 +0300 +++ b/package_definition.xml Mon Oct 25 13:20:29 2010 +0300 @@ -80,12 +80,6 @@ - - - - - - diff -r 3592750162a5 -r 2dc695882abd tsrc/testtools/stubsrv/doc/Stub_Server_User_Guide.doc Binary file tsrc/testtools/stubsrv/doc/Stub_Server_User_Guide.doc has changed diff -r 3592750162a5 -r 2dc695882abd usbengines/usbotgwatcher/eabi/usbotgwatcheru.def --- a/usbengines/usbotgwatcher/eabi/usbotgwatcheru.def Wed Oct 13 13:08:34 2010 +0300 +++ b/usbengines/usbotgwatcher/eabi/usbotgwatcheru.def Mon Oct 25 13:20:29 2010 +0300 @@ -1,10 +1,13 @@ EXPORTS _ZN14CUsbOtgWatcher4NewLER4RUsb @ 1 NONAME _ZN14CUsbOtgWatcher9IsDeviceAEv @ 2 NONAME - _ZTI14CUsbOtgWatcher @ 3 NONAME ; ## - _ZTI16CUsbNotifManager @ 4 NONAME ; ## - _ZTIN16CUsbNoteNotifier15CNotifierActiveE @ 5 NONAME ; ## - _ZTV14CUsbOtgWatcher @ 6 NONAME ; ## - _ZTV16CUsbNotifManager @ 7 NONAME ; ## - _ZTVN16CUsbNoteNotifier15CNotifierActiveE @ 8 NONAME ; ## + _ZN14CUsbOtgWatcherD0Ev @ 3 NONAME + _ZN14CUsbOtgWatcherD1Ev @ 4 NONAME + _ZN14CUsbOtgWatcherD2Ev @ 5 NONAME + _ZTI14CUsbOtgWatcher @ 6 NONAME + _ZTI16CUsbNotifManager @ 7 NONAME + _ZTIN16CUsbNoteNotifier15CNotifierActiveE @ 8 NONAME + _ZTV14CUsbOtgWatcher @ 9 NONAME + _ZTV16CUsbNotifManager @ 10 NONAME + _ZTVN16CUsbNoteNotifier15CNotifierActiveE @ 11 NONAME diff -r 3592750162a5 -r 2dc695882abd usbengines/usbotgwatcher/src/cusbindicatornotifier.cpp --- a/usbengines/usbotgwatcher/src/cusbindicatornotifier.cpp Wed Oct 13 13:08:34 2010 +0300 +++ b/usbengines/usbotgwatcher/src/cusbindicatornotifier.cpp Mon Oct 25 13:20:29 2010 +0300 @@ -69,7 +69,7 @@ // C++ constructor // --------------------------------------------------------------------------- // -CUsbIndicatorNotifier::CUsbIndicatorNotifier(CUsbNotifManager& aNotifManager, +CUsbIndicatorNotifier::CUsbIndicatorNotifier(CUsbNotifManager& /*aNotifManager*/, CUsbOtgWatcher& aOtgWatcher) : iOtgWatcher(aOtgWatcher) { @@ -155,7 +155,7 @@ // // --------------------------------------------------------------------------- // -void CUsbIndicatorNotifier::OtgWatcherStateChangedL(TUsbStateIds aState) +void CUsbIndicatorNotifier::OtgWatcherStateChangedL(TUsbStateIds /*aState*/) { LOG_FUNC SetIndicator(); @@ -185,7 +185,7 @@ // // --------------------------------------------------------------------------- // -void CUsbIndicatorNotifier::VBusObserverErrorL(TInt aError) +void CUsbIndicatorNotifier::VBusObserverErrorL(TInt /*aError*/) { LOG_FUNC // do nothing diff -r 3592750162a5 -r 2dc695882abd usbengines/usbotgwatcher/src/cusbnotifmanager.cpp --- a/usbengines/usbotgwatcher/src/cusbnotifmanager.cpp Wed Oct 13 13:08:34 2010 +0300 +++ b/usbengines/usbotgwatcher/src/cusbnotifmanager.cpp Mon Oct 25 13:20:29 2010 +0300 @@ -190,6 +190,7 @@ { LOG1("Unexpected aCat = 0x%X", aCat ); PANIC(EWrongNotifierCategory); + return; } CleanupStack::PushL(notifier); @@ -197,7 +198,7 @@ iWaitNotifiers.AppendL(CWaitNotifierInfo::NewL(notifier, *aObserver)); notifier->ShowL(); - + CleanupStack::Pop(notifier); } diff -r 3592750162a5 -r 2dc695882abd usbengines/usbotgwatcher/src/cusbotgwatcher.cpp --- a/usbengines/usbotgwatcher/src/cusbotgwatcher.cpp Wed Oct 13 13:08:34 2010 +0300 +++ b/usbengines/usbotgwatcher/src/cusbotgwatcher.cpp Mon Oct 25 13:20:29 2010 +0300 @@ -149,7 +149,7 @@ // // --------------------------------------------------------------------------- // -CUsbOtgWatcher::~CUsbOtgWatcher() +EXPORT_C CUsbOtgWatcher::~CUsbOtgWatcher() { LOG_FUNC @@ -366,7 +366,7 @@ // // --------------------------------------------------------------------------- // -void CUsbOtgWatcher::IdPinErrorL(TInt aError) +void CUsbOtgWatcher::IdPinErrorL(TInt /*aError*/) { ASSERT_PANIC(iHostState != NULL, EBadHostState); HandleHostProblemL(EUsbWatcherIdPinError, EUsbStateHostHandleDropping); @@ -398,7 +398,7 @@ // // --------------------------------------------------------------------------- // -void CUsbOtgWatcher::VBusObserverErrorL(TInt aError) +void CUsbOtgWatcher::VBusObserverErrorL(TInt /*aError*/) { ASSERT_PANIC(iHostState != NULL, EBadHostState); HandleHostProblemL(EUsbWatcherVBusObserverError, @@ -480,7 +480,7 @@ // // --------------------------------------------------------------------------- // -void CUsbOtgWatcher::OtgStateErrorL(TInt aError) +void CUsbOtgWatcher::OtgStateErrorL(TInt /*aError*/) { ASSERT_PANIC(iHostState != NULL, EBadHostState); HandleHostProblemL(EUsbWatcherOtgStateError, EUsbStateHostHandleDropping); @@ -511,7 +511,7 @@ // // --------------------------------------------------------------------------- // -void CUsbOtgWatcher::BusActivityErrorL(TInt aError) +void CUsbOtgWatcher::BusActivityErrorL(TInt /*aError*/) { ASSERT_PANIC(iHostState != NULL, EBadHostState); // no action, continue @@ -572,7 +572,7 @@ // // --------------------------------------------------------------------------- // -void CUsbOtgWatcher::HostEventNotificationErrorL(TInt aError) +void CUsbOtgWatcher::HostEventNotificationErrorL(TInt /*aError*/) { ASSERT_PANIC(iHostState != NULL, EBadHostState); HandleHostProblemL(EUsbWatcherHostEventNotificationError, @@ -634,7 +634,7 @@ // // --------------------------------------------------------------------------- // -void CUsbOtgWatcher::MessageNotificationErrorL(TInt aError) +void CUsbOtgWatcher::MessageNotificationErrorL(TInt /*aError*/) { ASSERT_PANIC(iHostState != NULL, EBadHostState); HandleHostProblemL(EUsbWatcherMessageNotificationError, diff -r 3592750162a5 -r 2dc695882abd usbengines/usbotgwatcher/src/cusbstatehostabase.cpp --- a/usbengines/usbotgwatcher/src/cusbstatehostabase.cpp Wed Oct 13 13:08:34 2010 +0300 +++ b/usbengines/usbotgwatcher/src/cusbstatehostabase.cpp Mon Oct 25 13:20:29 2010 +0300 @@ -189,7 +189,7 @@ case KErrUsbBadDevice: // = -6656 case KErrUsbBadHub: case KErrUsbEventOverflow: - case KErrUsbBadDeviceAttached: + // hosterrors.h case KErrUsbUnsupportedDevice: diff -r 3592750162a5 -r 2dc695882abd usbengines/usbotgwatcher/src/cusbstatehostainitiate.cpp --- a/usbengines/usbotgwatcher/src/cusbstatehostainitiate.cpp Wed Oct 13 13:08:34 2010 +0300 +++ b/usbengines/usbotgwatcher/src/cusbstatehostainitiate.cpp Mon Oct 25 13:20:29 2010 +0300 @@ -245,9 +245,10 @@ } case KErrUsbDeviceDetachedDuringDriverLoading: { - //do not show error, due to device is already detached - // Device Detachment will not come after this (it was not attached yet) - // therefore emulate detachment + LOG( "KErrUsbDeviceDetachedDuringDriverLoading" ); + // do not show error, due to device is already detached + // Device Detachment will not come after this (it was not + // normally attached yet), therefore emulate detachment // content of aTdi is not important, due to detachment anyway DeviceDetachedL(aTdi); break; @@ -272,7 +273,7 @@ // // --------------------------------------------------------------------------- // -void CUsbStateHostAInitiate::DeviceDetachedL(TDeviceEventInformation aTdi) +void CUsbStateHostAInitiate::DeviceDetachedL(TDeviceEventInformation /*aTdi*/) { LOG_FUNC @@ -327,7 +328,7 @@ // // --------------------------------------------------------------------------- // -void CUsbStateHostAInitiate::DriverLoadFailureL(TDeviceEventInformation aDei) +void CUsbStateHostAInitiate::DriverLoadFailureL(TDeviceEventInformation /*aDei*/) { LOG_FUNC diff -r 3592750162a5 -r 2dc695882abd usbengines/usbotgwatcher/src/cusbstatehosthandledropping.cpp --- a/usbengines/usbotgwatcher/src/cusbstatehosthandledropping.cpp Wed Oct 13 13:08:34 2010 +0300 +++ b/usbengines/usbotgwatcher/src/cusbstatehosthandledropping.cpp Mon Oct 25 13:20:29 2010 +0300 @@ -17,6 +17,7 @@ #include #include +#include #include "cusbotgwatcher.h" #include "cusbstatehosthandledropping.h" @@ -330,7 +331,7 @@ // --------------------------------------------------------------------------- // void CUsbStateHostHandleDropping::DeviceAttachedL( - TDeviceEventInformation aDevEventInfo) + TDeviceEventInformation /*aDevEventInfo*/) { LOG_FUNC } @@ -385,8 +386,8 @@ switch (aMessage) { - // USBDI - case KEventUsbBadDeviceDetached: + // OTGDI + case KEventUsbOtgBadDeviceDetached: { LOG("BadDeviceDetached" ); ChangeHostStateL( EUsbStateHostUndefined); diff -r 3592750162a5 -r 2dc695882abd usbengines/usbotgwatcher/src/cusbstatehostundefined.cpp --- a/usbengines/usbotgwatcher/src/cusbstatehostundefined.cpp Wed Oct 13 13:08:34 2010 +0300 +++ b/usbengines/usbotgwatcher/src/cusbstatehostundefined.cpp Mon Oct 25 13:20:29 2010 +0300 @@ -15,6 +15,7 @@ * */ +#include #include "cusbotgwatcher.h" #include "cusbstatehostundefined.h" @@ -168,7 +169,8 @@ // // --------------------------------------------------------------------------- // -void CUsbStateHostUndefined::DriverLoadPartialSuccessL(TDeviceEventInformation) +void CUsbStateHostUndefined::DriverLoadPartialSuccessL( + TDeviceEventInformation) { LOG_FUNC } @@ -208,7 +210,25 @@ void CUsbStateHostUndefined::MessageNotificationReceivedL(TInt aMessage) { LOG_FUNC - LOG1( "Unhandled message aMessage = %d" , aMessage); + LOG1( "aMessage = %d" , aMessage); + + switch (aMessage) + { + // OTGDI + case KErrUsbOtgBadDeviceAttached: + { + LOG( "BadDeviceAttached" ); + HandleL(EUsbWatcherErrUnsupportedDevice, + EUsbStateHostHandleDropping); + break; + } + default: + { + LOG1( "Unhandled message = %d" , aMessage); + break; + } + + } } // --------------------------------------------------------------------------- diff -r 3592750162a5 -r 2dc695882abd usbuis/group/bld.inf --- a/usbuis/group/bld.inf Wed Oct 13 13:08:34 2010 +0300 +++ b/usbuis/group/bld.inf Mon Oct 25 13:20:29 2010 +0300 @@ -14,6 +14,3 @@ * Description: Build information file for project usbuis * */ - -#include "../imageprintuiprovider/group/bld.inf" -#include "../imageprintui/group/bld.inf" diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/data/imageprintui.rss --- a/usbuis/imageprintui/data/imageprintui.rss Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,508 +0,0 @@ -/* -* Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for project Image Print UI -* -*/ - - -NAME IMPR - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "imageprintui.hrh" -#include // Localisation file - - -RESOURCE BA_RSS_SIGNATURE { signature = 1; } -RESOURCE TBUF { buf="IMAGEPRINTAPP"; } - -// --------------------------------------------------------------------------- -// eik_app_info, standard resource for symbian application -// This is empty when using avkon's view architecture -// --------------------------------------------------------------------------- -// - -RESOURCE EIK_APP_INFO - { - } - -// --------------------------------------------------------------------------- -// r_empty_view -// Empty view resource, shown when the application starts -// --------------------------------------------------------------------------- -// -RESOURCE AVKON_VIEW r_empty_view - { - menubar = R_AVKON_MENUPANE_EMPTY; - cba = R_AVKON_SOFTKEYS_EXIT; - } - -// --------------------------------------------------------------------------- -// r_imageprint_softkeys_options_change_exit -// Print preview view resource -// --------------------------------------------------------------------------- -// -RESOURCE CBA r_imageprint_softkeys_options_change_exit - { - flags = 0; - buttons = - { - CBA_BUTTON {id=EAknSoftkeyOptions; txt = text_softkey_option;}, - CBA_BUTTON {id=EAknSoftkeyExit; txt = text_softkey_exit;}, - CBA_BUTTON {id=ECmdSettingsChange; txt = qtn_msk_change;} - }; - } - -// --------------------------------------------------------------------------- -// r_settings_view -// settings view resource -// --------------------------------------------------------------------------- -// -RESOURCE AVKON_VIEW r_settings_view - { - menubar = r_settings_view_menubar; - cba = r_imageprint_softkeys_options_change_exit; - } - -// --------------------------------------------------------------------------- -// r_settings_view_menubar -// settings view menu bar -// --------------------------------------------------------------------------- -// -RESOURCE MENU_BAR r_settings_view_menubar - { - titles = - { - MENU_TITLE - { - menu_pane = r_settings_view_menu; - txt = " "; - } - }; - } - -// --------------------------------------------------------------------------- -// r_settings_view_menu -// settings view menu pane -// --------------------------------------------------------------------------- -// -RESOURCE MENU_PANE r_settings_view_menu - { - items = - { - MENU_ITEM - { - command = ECmdSettingsChange; - txt = qtn_usb_opt_change; - }, - MENU_ITEM - { - command = ECmdSettingsPrint; - txt = qtn_usb_option_print; - }, - - #ifdef __SERIES60_HELP - MENU_ITEM - { - command = ECmdSettingsHelp; - txt = qtn_options_help; - }, - #endif - - MENU_ITEM - { - command = EAknCmdExit; - txt = qtn_options_exit; - } - }; - } - -// --------------------------------------------------------------------------- -// r_imageprintui_localisable_app_info -// settings view menu pane -// --------------------------------------------------------------------------- -// -RESOURCE LOCALISABLE_APP_INFO r_imageprintui_localisable_app_info - { - short_caption = qtn_usb_title_image_print; - caption_and_icon = - CAPTION_AND_ICON_INFO - { - caption = qtn_usb_title_image_print; - #ifdef __SCALABLE_ICONS - number_of_icons = 1; - icon_file = APP_BITMAP_DIR"\\imageprintui_aif.mif"; - #else - number_of_icons = 2; - icon_file = APP_BITMAP_DIR"\\imageprintui_aif.mbm"; - #endif // __SCALABLE_ICONS - }; - } - -// --------------------------------------------------------------------------- -// r_print_progress_note -// Resource for print progress dialog -// --------------------------------------------------------------------------- -// -RESOURCE DIALOG r_print_progress_note - { - flags = EAknProgressNoteFlags; - buttons = R_AVKON_SOFTKEYS_CANCEL; - items = - { - DLG_LINE - { - type = EBitmapCtrl; - id = EBrandingBitmap; - }, - DLG_LINE - { - type = EAknCtNote; - id = EAknNoteProgressBar; - control = AVKON_NOTE - { - layout = EProgressLayout; - singular_label = qtn_usb_wait_printing; - imageid = EMbmAvkonQgn_note_progress; - imagemask = EMbmAvkonQgn_note_progress_mask; - }; - } - }; - } - -// --------------------------------------------------------------------------- -// r_connect_usb -// Dialog resource for "Connect USB Printer" -// --------------------------------------------------------------------------- -// -RESOURCE DIALOG r_connect_usb - { - flags = EAknWaitNoteFlags; - buttons = R_AVKON_SOFTKEYS_CANCEL; - items = - { - DLG_LINE - { - type = EAknCtNote; - id = EAknNoteProgressBar; - control = AVKON_NOTE - { - layout = EWaitLayout; - singular_label = qtn_usb_wait_connect_cable; - animation = R_QGN_GRAF_WAIT_BAR_ANIM; - }; - } - }; - } - -// --------------------------------------------------------------------------- -// r_connect_usb -// Dialog resource for "Connect USB Printer" -// --------------------------------------------------------------------------- -// -RESOURCE DIALOG r_not_connect_printer - { - flags = EAknWaitNoteFlags; - buttons = R_AVKON_SOFTKEYS_CANCEL; - items = - { - DLG_LINE - { - type = EAknCtNote; - id = EAknNoteProgressBar; - control = AVKON_NOTE - { - layout = EWaitLayout; - singular_label = qtn_usb_wait_connect_cable_compatible; - animation = R_QGN_GRAF_WAIT_BAR_ANIM; - }; - } - }; - } - -// --------------------------------------------------------------------------- -// r_cancel_printing_dialog -// Dialog resource for "Cancel printing" -// --------------------------------------------------------------------------- -// -RESOURCE DIALOG r_cancel_printing_dialog - { - flags = EAknWaitNoteFlags; - buttons = R_AVKON_SOFTKEYS_EMPTY; - items= - { - DLG_LINE - { - type = EAknCtNote; - id = EGeneralNote; - control= AVKON_NOTE - { - layout = EWaitLayout; - singular_label = qtn_usb_wait_cancelling; - animation =R_QGN_GRAF_WAIT_BAR_ANIM; - }; - } - }; - } - -// -RESOURCE LISTBOX r_usb_print_mode_setting_editor - { - flags = EEikListBoxMultipleSelection; - } - -//----------------------------------------------------------------------------- -// -// r_usb_print_mode_setting_page -// Setting page for setting the USB mode -// -//----------------------------------------------------------------------------- -// -RESOURCE AVKON_SETTING_PAGE r_usb_print_mode_setting_page - { - label = ""; - hint_text = " "; - type = EAknSetListBox; - editor_resource_id = r_usb_print_mode_setting_editor; - } - -// --------------------------------------------------------------------------- -// Layout strings -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_usb_print_layout -{ - buf = qtn_usb_print_layout; -} - -RESOURCE TBUF r_usb_print_layout_default -{ - buf = qtn_usb_print_layout_default; -} - -RESOURCE TBUF r_usb_print_layout_1_up -{ - buf = qtn_usb_print_layout_1_up; -} - -RESOURCE TBUF r_usb_print_layout_2_up -{ - buf = qtn_usb_print_layout_2_up; -} - -RESOURCE TBUF r_usb_print_layout_4_up -{ - buf = qtn_usb_print_layout_4_up; -} - -RESOURCE TBUF r_usb_print_layout_6_up -{ - buf = qtn_usb_print_layout_6_up; -} - -RESOURCE TBUF r_usb_print_layout_9_up -{ - buf = qtn_usb_print_layout_9_up; -} - -RESOURCE TBUF r_usb_print_layout_borderless -{ - buf = qtn_usb_print_layout_borderless; -} - -// --------------------------------------------------------------------------- -// Paper size strings -// --------------------------------------------------------------------------- -// - -RESOURCE TBUF r_usb_print_paper_size -{ - buf = qtn_usb_print_paper_size; -} - -RESOURCE TBUF r_usb_print_paper_size_automatic -{ - buf = qtn_usb_print_paper_size_automatic; -} - -RESOURCE TBUF r_usb_print_paper_size_a4 -{ - buf = qtn_usb_print_paper_size_a4; -} - -RESOURCE TBUF r_usb_print_paper_size_a6 -{ - buf = qtn_usb_print_paper_size_a6; -} - -RESOURCE TBUF r_usb_print_paper_size_inch -{ - buf = qtn_usb_print_paper_size_inch; -} - -RESOURCE TBUF r_usb_print_paper_size_card -{ - buf = qtn_usb_print_paper_size_card; -} - -RESOURCE TBUF r_usb_print_paper_size_letter -{ - buf = qtn_usb_print_paper_size_letter; -} - -// --------------------------------------------------------------------------- -// Quality strings -// --------------------------------------------------------------------------- -// - -RESOURCE TBUF r_usb_print_quality -{ - buf = qtn_usb_print_quality; -} - -RESOURCE TBUF r_usb_print_quality_default -{ - buf = qtn_usb_print_quality_default; -} - -RESOURCE TBUF r_usb_print_quality_high -{ - buf = qtn_usb_print_quality_high; -} - -RESOURCE TBUF r_usb_print_quality_normal -{ - buf = qtn_usb_print_quality_normal; -} - -RESOURCE TBUF r_usb_print_quality_draft -{ - buf = qtn_usb_print_quality_draft; -} - - -// --------------------------------------------------------------------------- -// Printing Error strings -// --------------------------------------------------------------------------- -// - -RESOURCE TBUF r_error_unable_to_connect - { - buf = qtn_usb_error_unable_to_connect; - } -RESOURCE TBUF r_error_printer_busy - { - buf = qtn_usb_error_printer_busy; - } -RESOURCE TBUF r_error_connection_lost - { - buf = qtn_usb_error_connection_lost; - } -RESOURCE TBUF r_error_general - { - buf = qtn_usb_error_in_printing; - } -RESOURCE TBUF r_error_check_status - { - buf = qtn_usb_error_check_status; - } -RESOURCE TBUF r_error_out_of_paper - { - buf = qtn_usb_error_out_of_paper; - } -RESOURCE TBUF r_error_out_of_ink - { - buf = qtn_usb_error_out_of_ink; - } -RESOURCE TBUF r_error_ink_low - { - buf = qtn_usb_error_ink_low; - } -RESOURCE TBUF r_error_paper_jam - { - buf = qtn_usb_error_paper_jam; - } - - -// --------------------------------------------------------------------------- -// Other error strings -// --------------------------------------------------------------------------- -// - -RESOURCE TBUF r_error_file_not_supported - { - buf = qtn_usb_error_file_not_supported; - } -RESOURCE TBUF r_error_file_not_found - { - buf = qtn_usb_error_file_not_found; - } - -RESOURCE TBUF r_error_unsupported_files_removed - { - buf = qtn_usb_error_unsupported_files_removed; - } - -RESOURCE TBUF r_info__select_new_images - { - buf = qtn_usb_info_select_new_images; - } -RESOURCE TBUF r_info_app_in_use - { - buf = qtn_usb_info_app_in_use; - } - - -RESOURCE TBUF r_change_value {buf = qtn_usb_opt_change;} -RESOURCE TBUF r_printing {buf = qtn_usb_option_print;} -RESOURCE TBUF r_help {buf = qtn_options_help;} -RESOURCE TBUF r_qtn_print_progress_note_title { buf = qtn_usb_wait_printing; } - - -// --------------------------------------------------------------------------- -// Note resources -// --------------------------------------------------------------------------- -// - -// modified note resource -RESOURCE DIALOG r_progress_note - { - flags = EAknProgressNoteFlags; - buttons = R_AVKON_SOFTKEYS_CANCEL; - items = - { - DLG_LINE - { - type = EAknCtNote; - id = EAknCtNote; - control = AVERELL_NOTE - { - layout = EProgressLayout; - singular_label = qtn_usb_wait_printing; - imagefile = AVKON_ICON_FILE; - imageid = EMbmAvkonQgn_note_progress; - imagemask = EMbmAvkonQgn_note_progress_mask; - }; - } - }; - } diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/data/imageprintui_reg.rss --- a/usbuis/imageprintui/data/imageprintui_reg.rss Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for project Image Print UI -* -*/ - - -#include -#include -#include - -UID2 KUidAppRegistrationResourceFile -UID3 0x1020E470 - -RESOURCE APP_REGISTRATION_INFO - { - app_file = "imageprintui"; - - localisable_resource_file = APP_RESOURCE_DIR"\\imageprintui"; - localisable_resource_id = R_IMAGEPRINTUI_LOCALISABLE_APP_INFO; - - hidden = KAppIsHidden; - } - - -// End of File diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/data/phonecapability.rss --- a/usbuis/imageprintui/data/phonecapability.rss Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for phone capability -* -*/ - -NAME IMPR - -#include -#include -#include "phonecapability.rh" - - -RESOURCE BA_RSS_SIGNATURE { signature = 1; } - -RESOURCE phonecapability_configuration phonecapability_config - { - } diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/group/bld.inf --- a/usbuis/imageprintui/group/bld.inf Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS -../loc/imageprintui.loc MW_LAYER_LOC_EXPORT_PATH(imageprintui.loc) -../rom/imageprintui.iby CORE_MW_LAYER_IBY_EXPORT_PATH(imageprintui.iby) -../rom/imageprintuiresources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(imageprintuiresources.iby) - -PRJ_MMPFILES -imageprintui.mmp diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/group/imageprintui.mmp --- a/usbuis/imageprintui/group/imageprintui.mmp Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#include -#include - -TARGET imageprintui.exe -TARGETTYPE exe -EPOCSTACKSIZE 0x5000 -UID 0x100039CE 0x1020E470 - -CAPABILITY CAP_APPLICATION -VENDORID VID_DEFAULT - -SOURCEPATH ../src -SOURCE imageprintuiapp.cpp -SOURCE imageprintuiappui.cpp -SOURCE imageprintuidocument.cpp - -SOURCE emptyview.cpp -SOURCE emptycontainer.cpp -SOURCE settingsview.cpp -SOURCE settingscontainer.cpp -SOURCE settingsitems.cpp - -SOURCE connectionmanager.cpp -SOURCE capabilitymanager.cpp -SOURCE eventmanager.cpp -SOURCE requestmanager.cpp -SOURCE notes.cpp -SOURCE notetimer.cpp - -USERINCLUDE ../inc - - -START RESOURCE ../data/imageprintui.rss -HEADER -TARGETPATH APP_RESOURCE_DIR -LANGUAGE_IDS -END - - -START RESOURCE ../data/phonecapability.rss -HEADER -TARGETPATH /private/1020e470 -LANGUAGE_IDS -END - - - -START RESOURCE ../data/imageprintui_reg.rss -DEPENDS imageprintui.rsg -TARGETPATH /private/10003a3f/apps -END - - -APP_LAYER_SYSTEMINCLUDE - -LIBRARY euser.lib apparc.lib cone.lib eikcore.lib -LIBRARY eikcoctl.lib avkon.lib -LIBRARY bafl.lib // Basic Application Framework -LIBRARY aknskins.lib // Skinned icons -LIBRARY aknicon.lib -LIBRARY CommonEngine.lib // Series 60 common components library -LIBRARY pictbridge.lib -LIBRARY eikcdlg.lib eikctl.lib estor.lib efsrv.lib -LIBRARY servicehandler.lib -LIBRARY DRMCommon.lib -LIBRARY imageconversion.lib -LIBRARY PlatformEnv.lib // PathInfo -LIBRARY commonui.lib - - - -#ifdef __SERIES60_HELP -LIBRARY hlplch.lib // Help library -#endif - - -DEBUGLIBRARY flogger.lib // File logging services - -// End of File diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/group/imageprintui_icons_aif_bitmaps_dc.mk --- a/usbuis/imageprintui/group/imageprintui_icons_aif_bitmaps_dc.mk Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -# -# Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: Fork icon for Image Print UI. -# - -ifeq (WINS,$(findstring WINS, $(PLATFORM))) -ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z -else -ZDIR=\epoc32\data\z -endif - -# ---------------------------------------------------------------------------- -# TODO: Configure these -# ---------------------------------------------------------------------------- - -TARGETDIR=$(ZDIR)\resource\apps -ICONTARGETFILENAME=$(TARGETDIR)\imageprintui_aif.mbm - -HEADERDIR=\epoc32\include -HEADERFILENAME=$(HEADERDIR)\imageprintui.mbg - -do_nothing : - @rem do_nothing - -MAKMAKE : do_nothing - -BLD : do_nothing - -CLEAN : do_nothing - -LIB : do_nothing - -CLEANLIB : do_nothing - -# ---------------------------------------------------------------------------- -# TODO: Configure these. -# -# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by -# MifConv if the mask detph is defined. -# -# NOTE 2: Usually, source paths should not be included in the bitmap -# definitions. MifConv searches for the icons in all icon directories in a -# predefined order, which is currently \s60\icons, \s60\bitmaps2. -# The directory \s60\icons is included in the search only if the feature flag -# __SCALABLE_ICONS is defined. -# ---------------------------------------------------------------------------- - -RESOURCE : - mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \ - /c8,8 qgn_prop_usb.bmp - -FREEZE : do_nothing - -SAVESPACE : do_nothing - -RELEASABLES : - @echo $(ICONTARGETFILENAME) - -FINAL : do_nothing - \ No newline at end of file diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/group/imageprintui_icons_aif_scalable_dc.mk --- a/usbuis/imageprintui/group/imageprintui_icons_aif_scalable_dc.mk Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -# -# Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: Fork icon for Image Print UI. -# - -ifeq (WINS,$(findstring WINS, $(PLATFORM))) -ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z -else -ZDIR=\epoc32\data\z -endif - -# ---------------------------------------------------------------------------- -# TODO: Configure these -# ---------------------------------------------------------------------------- - -TARGETDIR=$(ZDIR)\resource\apps -ICONTARGETFILENAME=$(TARGETDIR)\imageprintui_aif.mif - -HEADERDIR=\epoc32\include -HEADERFILENAME=$(HEADERDIR)\imageprintui.mbg - -do_nothing : - @rem do_nothing - -MAKMAKE : do_nothing - -BLD : do_nothing - -CLEAN : do_nothing - -LIB : do_nothing - -CLEANLIB : do_nothing - -# ---------------------------------------------------------------------------- -# TODO: Configure these. -# -# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by -# MifConv if the mask detph is defined. -# -# NOTE 2: Usually, source paths should not be included in the bitmap -# definitions. MifConv searches for the icons in all icon directories in a -# predefined order, which is currently \s60\icons, \s60\bitmaps2. -# The directory \s60\icons is included in the search only if the feature flag -# __SCALABLE_ICONS is defined. -# ---------------------------------------------------------------------------- - -RESOURCE : - mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \ - /c8,8 qgn_prop_usb.svg - -FREEZE : do_nothing - -SAVESPACE : do_nothing - -RELEASABLES : - @echo $(ICONTARGETFILENAME) - -FINAL : do_nothing - \ No newline at end of file diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/inc/capabilitymanager.h --- a/usbuis/imageprintui/inc/capabilitymanager.h Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,276 +0,0 @@ -/* -* Copyright (c) 2006,2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Header file for capabilitymanager -* -*/ - - -#ifndef CAPABILITYMANAGER_H -#define CAPABILITYMANAGER_H - -#include -#include -#include -#include -#include - - -const TInt KPhoneCapabilityVersion = 0; -const TInt KRetryAsk = 2 * 100 * 1000; // 200 ms -const TInt KDefaultArray = 5; -_LIT(KPhoneCapability, "private\\1020e470\\phonecapability.rsc"); - -class CImagePrintUiAppUi; - -/** -* CCapabilityManager is an active object that sends an asynchronous request -* to retrieve capabilities -*/ -class CCapabilityManager : public CActive - { - -public: - - /** - * Factory method NewL - * @param aOwner The observer to be notified on the change. - * @param aEngine the pointer to the PictBridge engine - * @return instance of capability manager - */ - static CCapabilityManager* NewL(CImagePrintUiAppUi* aAppUi, CDpsEngine* aEngine); - - - /** - * Destructor. - */ - virtual ~CCapabilityManager(); - - - /** - * Gives current qualities for doDpsRequest - * - */ - TUint Quality(); - - - /** - * Gives current paper size for doDpsRequest - * - */ - TUint PaperSize(); - - /** - * Gives current paper layout for doDpsRequest - * - */ - TUint Layout(); - - /** - * Gives current print setting to UI - * - */ - TUint CurrentPrintSettings(TInt aDpsArg); - - /** - * All qualities asked by UI engine - * @param aReason the answer for request complete to UI capability query - */ - void QualitiesAsked(TInt aReason); - - - /** - * Return certain type list of Capabilities - * @param aCapability the Capabilities type requested - */ - RArray& GetCapabilitiesL(TInt aCapability); - - /** - * Stores value choosed by user - */ - void SetValue(TInt aCapability, TUint aValue); - - /** - * Ask capabilities when needed - * - */ - void AskCapabilitiesL(TBool aChanged); - - - /** - * Ask layout when user has selected certain papersize - * - */ - void AskLayoutForPaperSizeL(TUint aPaperSize); - - - - /** - * Check if capabilities differ when user start print - * - */ - void CheckIfNewCapabilityDiffer(); - - -private: //from CActive - /** - * Implements CActive - * If this is not a one-shot CR watcher, the listening is restarted. - * @param none - * @return none - */ - void RunL(); - - /** - * Implements CActive - * @param aError the error returned - * @return error - */ - TInt RunError(TInt aError); - - /** - * Implements CActive - * @param none - * @return none - */ - void DoCancel(); - - - /** - * Stores current qualities - * - */ - void StoreQualitiesL(RArray& aCurrQualities); - - /** - * Stores current paper size - * - */ - void StorePaperSizeL(RArray& aSuppPaperSize); - - /** - * Stores current first paper layout - * - */ - void StoreLayouts(RArray& aSuppLayouts); - - /** - * Ask quality from printer - */ - void AskQualityL(); - - /** - * Ask paper size from printer - */ - void AskPaperSizeL(); - - /** - * Ask layout from printer - */ - void AskLayoutL(); - - -private: //own methods - - enum TCapabilityType - { - EQualities, - EPaperSize, - ELayouts - }; - - /** - * Second phase constructor. Operations which might leave should - * be called here - */ - void ConstructL(); - - - /** - * Handles capabilities after RunL - * - */ - void HandleCapabilitiesL(TCapabilityType aType); - - /** - * Read phone supported capabilities - * - */ - void GetPhoneConfigL(); - - /** - * C++ default constructor - * @param aAppUi the pointer to the AppUi instance - * @param aEngine the pointer to the PictBridge engine - */ - CCapabilityManager( CImagePrintUiAppUi* aAppUi, - CDpsEngine* aEngine); - - - - /** - * Handles result of asking layout for certain papersize - * - */ - void HandleLayoutForPaperSize(); - - -private: //data - - CImagePrintUiAppUi* iAppUi; - - /** - * Instance to PictBridge Engine to get capabilities - * Not own - */ - CDpsEngine* iDpsEngine; - - TBool iCapabilityAskFailed; - TBool iCapabilityNotChanged; - TBool iIsCapabilityEmpty; - TBool iLayoutForPaperSize; - - TCapabilityType iCapabilityType; - - // types for DoDpsRequest - TDpsGetCapability iCap; - - - //Arrays for storing and maintaining capabilities data after - //comparing printer and phone supported capabilities - RArray iCurrentQualities; - RArray iCurrentPaperSizes; - RArray iCurrentLayouts; - - - TUint iCurrentQuality; - TUint iCurrentPaperSize; - TUint iCurrentLayout; - - TUint iUserSelectedQuality; - TUint iUserSelectedPaperSize; - TUint iUserSelectedLayout; - - //phone supported capabilities - RArray iPhoneSuppLayout; - RArray iPhoneSuppPaperSize; - RArray iPhoneSuppQuality; - - RArray iReturnArray; - - }; - - -#endif // CAPABILITYMANAGER_H - -// End of File diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/inc/connectionmanager.h --- a/usbuis/imageprintui/inc/connectionmanager.h Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,121 +0,0 @@ -/* -* Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Header file for connectionmanager -* -*/ - - -#ifndef CONNECTIONMANAGER_H -#define CONNECTIONMANAGER_H - -#include - -class CDpsEngine; -class CNotes; -class CImagePrintUiAppUi; - -/** -* CConnectionManager is an active object that sends an asynchronous request -* to know about the connection status. -*/ -class CConnectionManager : public CActive - { - -public: - - /** - * Factory method NewL - * @param aAppUi the pointer to the AppUi instance - * @param aEngine Instance to DpsEngine - * @param aNotes Instance to Notes class - * @return The new object. - */ - static CConnectionManager* NewL(CImagePrintUiAppUi* aAppUi, - CDpsEngine* aEngine, CNotes* aNotes); - - /** - * Destructor. - */ - virtual ~CConnectionManager(); - - /** - * Starts search printer - */ - void StartSearchPrinter(); - -private: - -//from CActive - - /** - * Implements CActive - * @param none - * @return none - */ - void RunL(); - - /** - * Implements CActive - * @param aError the error returned - * @return error - */ - TInt RunError(TInt aError); - - /** - * Implements CActive - * @param none - * @return none - */ - void DoCancel(); - -private: - - /** - * Starts listening for notifications. If already listening, nothing - * happens. - * @param none - * @return none - */ - void StartListening(); - - /** - * C++ default constructor - * @param aAppUi the pointer to the AppUi instance - * @param aEngine Instance of DpsEngine - * @param aNotes Instance to Notes class - */ - CConnectionManager( CImagePrintUiAppUi* aAppUi, - CDpsEngine* aEngine, CNotes* aNotes); - -private: //data - - - CImagePrintUiAppUi* iAppUi; - - /** - * Instance to DpsEngine to get connection status - * Not own - */ - CDpsEngine* iDpsEngine; - - TBool iActiveNote; - TBool iSetPrintCall; - CNotes* iNotes; - TInt iPreviousStatus; - }; - - -#endif // CONNECTIONMANAGER_H - -// End of File diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/inc/emptycontainer.h --- a/usbuis/imageprintui/inc/emptycontainer.h Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -/* -* Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Header file for emptycontainer -* -*/ - -#ifndef CEMPTYCONTAINER_H -#define CEMPTYCONTAINER_H - - -// INCLUDES -#include - - -// FORWARD DECLARATIONS -class CAknsBasicBackgroundControlContext; - - -/** -* Container class for emptyview -*/ -class CEmptyContainer : public CCoeControl - { - - -public: - - /** - * Factory method NewL - * @param aRect Container area - * @return The new object. - */ - static CEmptyContainer* NewL( const TRect& aRect ); - - /** - * Factory method NewLC - * @param aRect Container area - * @return The new object. - */ - static CEmptyContainer* NewLC( const TRect& aRect ); - - - /** - * Destructor. - */ - virtual ~CEmptyContainer(); - - -private: // Methods derived from CCoeControl - - - /** - * From CCoeControl Draw screen - */ - void Draw( const TRect& aRect ) const; - - /** - * From CCoeControl Handles a chage of client area size. - */ - void SizeChanged(); - - /** - * From CCoeControl, Handles a change to the control's resources. - */ - void HandleResourceChange( TInt aType ); - - -private: - - /** - * C++ default constructor - */ - CEmptyContainer(); - - /** - * Second phase constructor. Operations which might leave should - * be called here - */ - void ConstructL( const TRect& aRect ); - - -private: // data - - CAknsBasicBackgroundControlContext* iSkinContext; // skin data - - }; - -#endif // CEMPTYCONTAINER_H diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/inc/emptyview.h --- a/usbuis/imageprintui/inc/emptyview.h Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,113 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Header file for emptyview -* -*/ - -#ifndef CIMAGEPRINTEMPTYVIEW_H -#define CIMAGEPRINTEMPTYVIEW_H - - -#include - -// FORWARD DECLARATIONS -class CEmptyContainer; - -const TUid KImagePrintEmptyViewId = { 1 }; - -/** -* Class for showing empty view before capabilities has retrieved -*/ -class CEmptyView : public CAknView - { - -public: - - /** - * Factory method NewL - * @return The new object. - */ - static CEmptyView* NewL(); - - /** - * Factory method NewLC - * @return The new object. - */ - static CEmptyView* NewLC(); - - /** - * Destructor. - */ - virtual ~CEmptyView(); - -private: // from base class CAknView - - /** - * From CAknView - * Returns view id. - * @param None. - * @return View id. - */ - TUid Id() const; - - /** - * From CAknView - * Handles user commands. - * @param aCommand A command id. - * @return None. - */ - void HandleCommandL(TInt aCommand); - - /** - * From CAknView - * Activates view. - * @param aPrevViewId Id of previous view. - * @param aCustomMessageId Custom message id. - * @param aCustomMessage Custom message. - * @return None. - */ - void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId, - const TDesC8& aCustomMessage); - - /** - * From CAknView - * Deactivates view. - * @param None. - * @return None. - */ - void DoDeactivate(); - - /** - * C++ default constructor - */ - CEmptyView(); - - /** - * Symbian 2nd phase constructor. - * @param None - * @return None - */ - void ConstructL(); - -private: // data - - /** - * Container control of this view - * Own - */ - CEmptyContainer* iContainer; - - }; - -#endif // CIMAGEPRINTEMPTYVIEW_H diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/inc/eventmanager.h --- a/usbuis/imageprintui/inc/eventmanager.h Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,158 +0,0 @@ -/* -* Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Header file for eventmanager -* -*/ - - - -#ifndef C_EVENTMANAGER_H -#define C_EVENTMANAGER_H - -#include -#include -#include - -class CDpsEngine; -class CImagePrintUiAppUi; - -/** -* Class for requesting DPS event -*/ -class CEventManager : public CActive - { - -public: - - enum TEventNotifyType - { - ENewJobOK = 1, - ENewJobNOK, - EInkEmpty, - ECapabilityChange, - EWarning, - EErrorState, - ENotErrorState, - ESeriousError, - EShowError - }; - -public: - - /** - * Two-phase constructors - * @since S60 v3.2 - * @param aAppUi the pointer to the AppUi instance - * @param aEngine Instance of DpsEngine - * @return Initialiazed instance of EventManager - */ - static CEventManager* NewL(CImagePrintUiAppUi* aAppUi, CDpsEngine* aDpsEngine); - - /** - * Destructor. - */ - virtual ~CEventManager(); - - - -private: - - /** - * @see CActive - */ - void RunL(); - - /** - * @see CActive - */ - void DoCancel(); - - /** - * @see CActive - */ - void RunError(); - - -private: - - - /** - * C++ default constructor - * @param aAppUi the pointer to the AppUi instance - * @param aEngine Instance of DpsEngine - */ - CEventManager(CImagePrintUiAppUi* aAppUi, CDpsEngine* aDpsEngine); - - - /** - * Handles return status from PictBridge Engine. - * - */ - void HandleReturnStatusL(); - - - /** - * Start listening events from PictBridge Engine. - * - */ - void StartListening(); - - /** - * Handles error status - * - */ - void HandleErrorStatusL(TInt aStatus); - - /** - * Handles job status - * - */ - void HandleJobStatusL(TInt aStatus); - - /** - * Handles hardware error. - * - */ - void HandleHardwareErrorL(TInt aError); - - - /** - * Handles ink error. - * - */ - void HandleInkErrorL(TInt aError); - - /** - * Handles paper error. - * - */ - void HandlePaperErrorL(TInt aError); - - /** - * Handles file error. - * - */ - void HandleFileErrorL(TInt aError); - -private: - - CImagePrintUiAppUi* iAppUi; - CDpsEngine* iDpsEngine; - TDpsEvents iEventRequest; - TBool iErrorState; - - }; - - -#endif // C_EVENTMANAGER_H diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/inc/imageprintui.hrh --- a/usbuis/imageprintui/inc/imageprintui.hrh Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource headers for project Image Print UI -* -*/ - - - -#ifndef IMAGEPRINTUI_HRH -#define IMAGEPRINTUI_HRH - -enum TCustomControlsIDs - { - EPrintProgressNote = 0x2000, - EPrintWaitNote, - ENoPrintersConfirmation, - EBitmapCtrl, - EBrandingBitmap - }; - - -/** Commands in settings view */ -enum TImagePrintSettingsCommands - { - ECmdSettingsChange = 0x6100, - ECmdSettingsPrint, - ECmdSettingsHelp - - }; - -enum TImagePrintSettingsListItemIndexes - { - ESettingsListItemLayout = 0, - ESettingsListItemPaperSize, - ESettingsListItemPrintQuality - }; - -/* note enums */ -enum - { - EProgressNoteId = 0 - }; - - -#define KImagePrintComponentCount 1 - - -#define KNumberOfSettingsViewItems 3 - - - -#endif // IMAGEPRINTUI_HRH diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/inc/imageprintuiapp.h --- a/usbuis/imageprintui/inc/imageprintuiapp.h Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Header file for imageprintuiapp -* -*/ - - -#ifndef CIMAGEPRINTUIAPP_H -#define CIMAGEPRINTUIAPP_H - -// EXTERNAL INCLUDES -#include -#include - -// CONSTANTS -/** -* UID of the application -*/ -const TUid KUidImagePrint = { 0x1020E470 }; -const TUid KUidUSB = { 0x102068E2 }; - -// CLASS DEFINITION -/** - * S60 Application class - */ -class CImagePrintUiApp : public CAknApplication - { - -private: // Constructors and destructors - - /** - * From CAknApplication, creates CImagePrintUiDocument document - * object. - * @return A pointer to the created document object. - */ - CApaDocument* CreateDocumentL(); - -private: // Methods derived from CApaApplication - - /** - * From CAknApplication, returns application's UID. - * @return The value of KUidImagePrint. - */ - TUid AppDllUid() const; - - }; - -#endif // IMAGEPRINTUIAPP_H diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/inc/imageprintuiappui.h --- a/usbuis/imageprintui/inc/imageprintuiappui.h Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,336 +0,0 @@ -/* -* Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Header file for imageprintuiappui -* -*/ - - -#ifndef C_CIMAGEPRINTUIAPPUI_H -#define C_CIMAGEPRINTUIAPPUI_H - -#include -#include -#include -#include -#include "connectionmanager.h" -#include "capabilitymanager.h" -#include "eventmanager.h" -#include "requestmanager.h" - -#include -#include -#include - -#include - -class CNotes; -class CNoteTimer; -class CAknNavigationDecorator; -class DRMCommon; - - -const TInt KNumberOfUnsupportedFiles = 1; -const TInt KPrintFinishValue = 100; -const TInt KMaxPrinterName = 64; -const TInt KRetryInterval = 1 * 1000 * 1000; // 1 s -const TInt KRetryClose = 1 * 1000 * 1000; // 1 s -const TInt KImageDefaultArray = 2; -const TInt KRemoveValue = 5; -const TInt KImageNumber = 1; - -// CONSTANTS -_LIT( KConfigInfoFile, "config.DPS"); -_LIT( KParamFile, "system\\data\\T_AIW_PRINT.DAT"); -_LIT( KUnSuppFile, "system\\data\\T_AIW_UNSUPP.DAT"); -const TInt KResource = 40; -const TInt KDriver = 3; -const TInt KConfigLength = 16; - - -/** - * S60 application UI class - */ -class CImagePrintUiAppUi : public CAknViewAppUi - { - -public: - - /** - * Destructor - */ - virtual ~CImagePrintUiAppUi(); - - - /** - * Second phase constructor. Operations which might leave should - * be called here - */ - void ConstructL(); - - /** - * Returns instance of Capability Manager. - * @return CCapabilityManager. - */ - CCapabilityManager* CapabilityManager(); - - - /** - * Returns instance of Notes - * @return CNotes. - */ - CNotes* Notes(); - - -public: // Methods derived from CAknViewAppUi base class - - void HandleCommandL( TInt aCommand ); - - -public: //own methods - - - /** - * Starts printing process when user select print - * @return none - */ - void StartPrinting(); - - /** - * Cancel print when user select cancel - * @return none - */ - void CancelPrinting(); - - /** - * Returns print state to other instances - * @return print state - */ - TBool PrintActive(); - - /** - * Provide array of images to be printed - * @return CDesCArrayFlat - */ - CDesCArrayFlat* ImagesToPrint(); - - /** - * Tells if cable is connected or not - * @return TBool . - */ - TBool IsCableConnected(); - - /** - * Shows note if there is unsupported files - * @return none. - */ - void ShowNoteL(); - - /** - * Closes application after showing error note - * @return none. - */ - void CloseAfterNoteL(); - - - /** - * Request Manager notifies result of DoDps Request - * @return none. - */ - void NotifyRequestL( TInt aNotifyType); - - /** - * Request Manager informs about number of images to be printed - * @return none. - */ - void NumberOfImages(TInt aNumberOfImages); - - - /** - * Event Manager notifies DpsEvent - * @return none. - */ - void NotifyEventL(TInt aEventNotifyType); - - /** - * Event Manager notifies about Print Progress - * @return none. - */ - void NotifyPrintProgress(TInt aNumberOfImages, TInt aProgress); - - /** - * Event Manager notifies about Print Status - * @return none. - */ - void NotifyPrintStatus(TInt aStatus); - - - /** - * Connection Manager closes application if cable is disconnect - * or personaluty changes different as PTP - * @return none. - */ - void CloseApplication(TBool aDisconnect); - - /** - * Connection Manager informs PTP printer is found - * @return none. - */ - void CableConnectedL(); - - /** - * Connection Manager informs about cable disconnection - * @return none. - */ - void CableDisConnected(); - - - /** - * Capability Manager informs about capabilities has - * retrieved from printer - * @return none. - */ - void CapabilitiesReady(); - - /** - * Capability Manager informs about error when retrieving - * capabilities from printer - * @return none. - */ - void NotifyError(); - - /** - * Handles situation after timer timeout - * @return none. - */ - void HandleTimeOutL(); - - /** - * Handles requesting DPS request again - * @return none. - */ - void HandleRequestTime(TInt aTime); - - /** - * Handles requsting capabilities again - * @return none. - */ - void HandleCapabilityTime(TInt aTime); - - - /** - * Handles situation after RunError in timer - * @return none. - */ - void HandleTimeErrorL(TInt aError); - - -private: //own methods - - - /** - * Set printer and vendor info to navipane - * @return none. - */ - void SetNavipaneTextL(); - - /** - * Read images to be printed to array - * @return none. - */ - void LoadImagesL(); - - /** - * Reads number of unsupported files - * @return none. - */ - void ReadNumberOfUnSuppL(); - -public: - - /** - * Show all notes - * Own this pointer - */ - CNotes* iNotes; - - -private: // data - - - /** A singleton DPS engine object */ - CDpsEngine* iEngine; - - /** - * Connection manager to check connection status - * Owns this pointer - */ - CConnectionManager* iConnectionManager; - - /** - * Retrieve, restore and change capabilities if needed - * Own this pointer - */ - CCapabilityManager* iCapabilityManager; - - - /** - * Needed when creating navipane text - * Own this pointer - */ - CAknNavigationDecorator* iNaviDecorator; - - - /** - * Performs DPS request towards PictBridge engine - * Own this pointer - */ - CRequestManager* iRequestManager; - - - /** - * Notifies Device- and JobEvent coming from PictBridge engine - * Own this pointer - */ - CEventManager* iEventManager; - - - // images to be printed - CDesCArrayFlat* iImageFiles; - - // timer for unsupported file note - CNoteTimer* iNoteTimer; - - HBufC* iCongFileName; - - TBool iPrintActive; - TBool iCableConnected; - TBool iActiveNote; - TBool iCapabilityChanged; - TBool iUnsupportedFiles; - TBool iNoteShowed; - TInt iNumberOfImages; - TInt iNumberOfUnSuppFiles; - TBool iErrorState; - TBool iStartJobOK; - TBool iPaperEmpty; - TBool iNoteTimeOut; - TBool iCloseTimeOut; - TBool iCapabilityTimeOut; - TBool iRequestTimeOut; - - TFileName iLogFilePath; - - }; - -#endif // C_CIMAGEPRINTUIAPPUI_H diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/inc/imageprintuidebug.h --- a/usbuis/imageprintui/inc/imageprintuidebug.h Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Log file for Image Print UI -* -*/ - - -#ifndef IMAGEPRINTUIDEBUG_H -#define IMAGEPRINTUIDEBUG_H - -#ifdef _DEBUG - -#include -#include - -// =========================================================================== -#ifdef __WINS__ // File logging for WINS -// =========================================================================== -#define FLOG(a) { FPrint(a); } -#define FTRACE(a) { a; } - -#include -#include - -_LIT(KLogFile,"imageprintui.txt"); -_LIT(KLogDirFullName,"c:\\logs\\imageprint\\"); -_LIT(KLogDir,"imageprint"); - -// Declare the FPrint function -inline void FPrint(const TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list,aFmt); - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, - aFmt, list); - } - -// =========================================================================== -#else // RDebug logging for target HW -// =========================================================================== -#define FLOG(a) { RDebug::Print(a); } -#define FTRACE(a) { a; } - -inline void FPrint(const TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list,aFmt); - TInt tmpInt = VA_ARG(list, TInt); - TInt tmpInt2 = VA_ARG(list, TInt); - TInt tmpInt3 = VA_ARG(list, TInt); - VA_END(list); - RDebug::Print(aFmt, tmpInt, tmpInt2, tmpInt3); - } - -inline void FPrint(TRefByValue aFmt, ...) - { - - VA_LIST list; - VA_START(list, aFmt); - TBuf8<256> buf8; - buf8.AppendFormatList(aFmt, list); - - TBuf16<256> buf16(buf8.Length()); - buf16.Copy(buf8); - - TRefByValue tmpFmt(_L("%S")); - RDebug::Print(tmpFmt, &buf16); - } - -#endif //__WINS__ - -// =========================================================================== -#else // // No loggings --> Reduced binary size -// =========================================================================== -#define FLOG(a) -#define FTRACE(a) - -#endif // _DEBUG - - -#endif // IMAGEPRINTDEBUG_H - -// End of File diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/inc/imageprintuidocument.h --- a/usbuis/imageprintui/inc/imageprintuidocument.h Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -/* -* Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Header file for imageprintuidocument -* -*/ - - - -#ifndef IMAGEPRINTUIDOCUMENT_H -#define IMAGEPRINTUIDOCUMENT_H - -#include -#include -#include -#include -#include -#include - - - -// FORWARD DECLARATIONS -class CEikAppUi; -class CImagePrintUiEngine; -/** - * - * S60 document class - */ -class CImagePrintUiDocument : public CAknDocument - { - -public: - - /** - * Factory method NewL - * @param aApp refernce to CEikApplication class - * @return The new object. - */ - static CImagePrintUiDocument* NewL(CEikApplication& aApp); - - /** - * Destructor. - */ - virtual ~CImagePrintUiDocument(); - - -private: - - /** - * Default contructor - */ - CImagePrintUiDocument(CEikApplication& aApp); - - /** - * Default contructor that may leave. - */ - void ConstructL(); - - -private: // From base class CAknDocument - - /** - * Returns AppUi class - * @return Initialized instance of CEikAppUi - */ - CEikAppUi* CreateAppUiL(); - - -public: // New methods - - /** - * Returns Engine - * @Return PictBridge Engine - */ - CDpsEngine* Engine(); - -private: // data - - // Instance to the engine of this application, own - CDpsEngine* iEngine; - }; - -#endif // C_IMAGEPRINTUIDOCUMENT_H diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/inc/notes.h --- a/usbuis/imageprintui/inc/notes.h Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,161 +0,0 @@ -/* -* Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Header file for notes -* -*/ - -#ifndef CNOTES_H -#define CNOTES_H - - -#include -#include -#include -#include - -// FORWARD DECLARATIONS -class MProgressDialogCallback; -class CEikProgressInfo; -class CImagePrintUiAppUi; - - - -/** -* Class for showing different notes -*/ -class CNotes : public CBase, public MProgressDialogCallback - { - -public: - - - /** - * Factory method NewL - * @param aPrintUiAppUi the pointer to AppUi class - * @return the new object - */ - static CNotes* NewL(CImagePrintUiAppUi* aPrintUiAppUi); - - /** - * Destructor. - */ - virtual ~CNotes(); - - - /** - * Shows all string based info notes - * @return none - */ - void ShowInfoNoteL(TInt aResourceId ); - /** - * Shows all string based wait notes - * @return none - */ - void ShowNoteL(TUint aNoteType); - - /** - * Shows print progress note - * @return none - */ - void ShowProgressNoteL(); - - /** - * Informs printing progress - * @return none - */ - void PrintProgress(TUint aProgress ); - - /** - * Informs printing progrees - * @return none - */ - void PrintProgressL(TUint aProgress ); - - /** - * Prepare print progress note - * @return none - */ - void PrepareShowProgressNoteL(); - - /** - * Shows all string based error messages - * @return none - */ - void ShowErrorMsgL(TUint aErr ); - - /** - * Stop shows all string based notes - * @return none - */ - void StopShowNote(TUint aNoteType); - - /** - * Start show printing note - * @return none - */ - void StartPrintingNotesL(); - - /** - * Finish print progress note - * @return none - */ - void PrintFinished(); - - /** - * Sat cancel state - * @return none - */ - void SetCancelState(TBool aCancel); - - /** - * Set disconnect state - * @return none - */ - void SetDisconnectState(TBool aDisconnect); - - -public: - - /** - * From MProgressDialogCallback - * Get's called when a dialog is dismissed. - * @param aButtonId Id of the pressed button. - * @return None. - */ - void DialogDismissedL( TInt aButtonId ); - -private: - - /** - * C++ default constructor - * @param aPrintUiAppUi the pointer to AppUi class - */ - CNotes(CImagePrintUiAppUi* aPrintUiAppUi ); - -private: // data - - /** - * Wait dialog for telling the user to connect the cable - * Own - */ - CAknWaitDialog* iWaitNote; - - CAknProgressDialog* iProgressDialog; - CImagePrintUiAppUi* iPrintUiAppUi; - TBool iDisconnect; - TBool iCancelling; - - }; - -#endif // CNOTES_H diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/inc/notetimer.h --- a/usbuis/imageprintui/inc/notetimer.h Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ -/* -* Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Header file for note timer -* -*/ - - - -#ifndef C_NOTETIMER_H -#define C_NOTETIMER_H - -#include - -class CImagePrintUiAppUi; - -/** -* Timer for showing notes in right time -*/ -class CNoteTimer : public CTimer - { -public: - - /** - * Factory method NewL - * @param aAppUi the pointer to the appui class - * @return instance of notetimer - */ - static CNoteTimer* NewL( CImagePrintUiAppUi* aAppUi); - - /** - * Factory method NewLC - * @param aAppUi the pointer to the appui class - * @return instance of notetimer - */ - static CNoteTimer* NewLC( CImagePrintUiAppUi* aAppUi); - - /** - * Destructor. - */ - ~CNoteTimer(); - - -private: - - /** - * @see CActive - */ - virtual void RunL(); - - /** - * @see CActive - */ - TInt RunError(TInt aError); - - /** - * C++ default constructor - */ - CNoteTimer(); - - /** - * Second phase constructor. Operations which might leave should - * be called here - * @param aAppUi the pointer to the appui class - */ - void ConstructL(CImagePrintUiAppUi* aAppUi); - -private: - - CImagePrintUiAppUi* iAppUi; - }; - -#endif // C_NOTETIMER_H \ No newline at end of file diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/inc/phonecapability.rh --- a/usbuis/imageprintui/inc/phonecapability.rh Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* -* Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: The resource header file for Phone capability configuration. -* -*/ - - - -STRUCT phonecapability_configuration - { - BYTE QualityCount = 4; - BYTE PaperSizeCount = 6; - BYTE LayoutCount = 6; - - WORD EDpsPrintQualityDefault = 0x5000; - WORD EDpsPrintQualityNormal = 0x5001; - WORD EDpsPrintQualityDraft = 0x5002; - WORD EDpsPrintQualityFine = 0x5003; - - WORD EDpsPaperSizeDefault = 0x5100; - WORD EDpsPaperSizeCard = 0x5104; - WORD EDpsPaperSize4x6 = 0x5106; - WORD EDpsPaperSizeLetter = 0x5108; - WORD EDpsPaperSizeA4 = 0x5114; - WORD EDpsPaperSizeA6 = 0x5116; - - WORD EDpsLayoutDefault = 0x5700; - WORD EDpsLayout1Up = 0x5701; - WORD EDpsLayout2Up = 0x5702; - WORD EDpsLayout4Up = 0x5704; - WORD EDpsLayout6Up = 0x5706; - WORD EDpsLayout9Up = 0x5709; - } diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/inc/requestmanager.h --- a/usbuis/imageprintui/inc/requestmanager.h Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,237 +0,0 @@ -/* -* Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Header file for requestmanager -* -*/ - - -#ifndef C_REQUESTMANAGER_H -#define C_REQUESTMANAGER_H - -#include -#include -#include - -class CDpsEngine; -class CCapabilityManager; -class CImagePrintUiAppUi; - -const TInt KDefaultSize = 64; - - -/** -* Class for requesting DPS request -*/ -class CRequestManager : public CActive - { - -public: - - enum TRequestType - { - EConfigurePrintService = 0, - EGetCapability, - EGetJobStatus, - EGetDeviceStatus, - EStartJob, - EAbortJob, - EContinueJob, - ESetPrintMode - }; - - enum TNotifyType - { - EConfigurePrintServiceOK = 1, - EConfigurePrintServiceNOK, - EGetCapabilityOK, - EGetJobStatusOK, - EGetJobStatusNOK, - EGetDeviceStatusOK, - EGetDeviceStatusNOK, - EStartJobOK, - EStartJobNOK, - EAbortJobOK, - EAbortJobNOK, - EContinueJobOK, - EPicturesNotFound - }; - - /** - * Two-phase constructors - * @param aDpsEngine the pointer to the PictBridge engine - * @param aCapabilityManager the pointer to the Capability Manager - * @param aAppUi the pointer to the AppUi class - * @return Initialized instance of CRequestManager - */ - static CRequestManager* NewL( CDpsEngine* aDpsEngine, - CCapabilityManager* aCapabilityManager, CImagePrintUiAppUi* aAppUi); - - /** - * Two-phase constructors - * @param aDpsEngine the pointer to the PictBridge engine - * @param aCapabilityManager the pointer to the Capability Manager - * @param aAppUi the pointer to the AppUi class - * @return Initialized instance of CRequestManager - */ - static CRequestManager* NewLC( CDpsEngine* aDpsEngine, - CCapabilityManager* aCapabilityManager, CImagePrintUiAppUi* aAppUi); - - - /** - * Default destructor. - * @since S60 v3.2 - */ - virtual ~CRequestManager(); - - - /** - * Chooses DoDpsRequest type - * @param aType type of request - * @return none - */ - void ChooseDpsRequestTypeL( TRequestType aType ); - - /** - * Give printer and vendor names to UI - * @param aVendorName the vendor name - * @param aProductName the product name - * @return none - */ - void GetPrinterName(TDes8& aVendorName, TDes8& aProductName); - - /** - * Issues again DoDpsRequest if iStatus indicates timeout or PictBridge is in use - */ - void ReIssueDoDpsRequestL(); - -protected: - - /** - * @see CActive - */ - void RunL(); - - /** - * @see CActive - */ - void DoCancel(); - - /** - * @see CActive - */ - TInt RunError(TInt aError); - - /** - * Externalixe value when save those into config file - */ - void ExternalizeL(RWriteStream& aStream) const; - - -private: - - /** - * Default constructor - * @param aDpsEngine the pointer to the PictBridge engine - * @param aCapabilityManager the pointer to the Capability Manager - * @param aAppUi the pointer to the AppUi class - */ - CRequestManager( CDpsEngine* aDpsEngine, - CCapabilityManager* aCapabilityManager, CImagePrintUiAppUi* aAppUi); - - - /** - * 2nd phase construction - */ - void ConstructL(); - - /** - * Handles return situation after requesting DPS request GetDeviceStatus - */ - void HandleDeviceStatusL(); - - /** - * Handles return situation after requesting DPS request AbortJob - */ - void HandleAbortL(); - - - /** - * Handles return situation after requesting DPS request StartJob - */ - void HandleStartJobL(); - - - /** - * Handles return situation after requesting DPS request GetJobStatus - */ - - void HandleGetJobStatusL(); - - /** - * Handles return situation after requesting DPS request GetConfigure - */ - void HandleConfigureL(); - - /** - * Saves configure info to file - */ - void SaveConfigInfoL(); - - - /** - * Read configure info from file - */ - void ReadConfigInfoL(); - - /** - * Performs start job request - */ - void ExecuteStartJobRequestL(); - - - -private: - - // owned by AppUi - CDpsEngine* iDpsEngine; - CCapabilityManager* iCapabilityManager; - CImagePrintUiAppUi* iAppUi; - - // types for DoDpsRequest - TDpsGetCapability iCap; - TDpsStartJob iStart; - TDpsAbortJob iAbort; - TDpsContinueJob iContinue; - TDpsGetPrinterStatus iPrinter; - TDpsGetJobStatus iJob; - TDpsConfigPrintService iConfig; - - TRequestType iRequestType; - - TInt iNumberOfImages; - - TBool iJobFinished; - TBool iFileExist; - - CDesCArrayFlat* iImageArrayFlat; - - TBuf8 iVendorName; - TBuf8 iProductName; - - HBufC* iCongFileName; - - }; - - -#endif // C_REQUESTMANAGER_H diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/inc/settingscontainer.h --- a/usbuis/imageprintui/inc/settingscontainer.h Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,136 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Header file for settingscontainer -* -*/ - -#ifndef CSETTINGSCONTAINER_H -#define CSETTINGSCONTAINER_H - - -// INCLUDES -#include -#include // AVKON components -#include - -#include "settingsview.h" - - -// FORWARD DECLARATIONS -class CAknsBasicBackgroundControlContext; -class CSettingsItems; -class CImagePrintUiAppUi; -class CCapabilityManager; - - -/** -* Container class for setting items -*/ -class CSettingsContainer : public CCoeControl - { - - -public: - - /** - * Two phase constructor - * @param aRect reference to container area - * @param aAppUi the pointer to the CImagePrintUiAppUi - * @return a CSettingsContainer instance - */ - static CSettingsContainer* NewL( const TRect& aRect, CImagePrintUiAppUi* aAppUi ); - - /** - * Two phase constructor - * - * @param aRect reference to container area - * @param aAppUi the pointer to the CImagePrintUiAppUi - * @return a CSettingsContainer instance - */ - static CSettingsContainer* NewLC( const TRect& aRect, CImagePrintUiAppUi* aAppUi ); - - /** - * Destructor - */ - virtual ~CSettingsContainer(); - - /** - * Forward change event to container - * @param None - * @return None. - */ - void HandleChange(); - - -private: // Methods derived from CCoeControl - - /** - * From CCoeControl Handles a chage of client area size. - */ - void SizeChanged(); - - /** - * From CCoeControl, Handles a change to the control's resources. - */ - void HandleResourceChange( TInt aType ); - - /** - * From CCoeControl Returns the number of components. - */ - TInt CountComponentControls() const; - - /** - * From CCoeControl Returns a pointer of component. - */ - CCoeControl* ComponentControl(TInt aIndex) const; - - /** - * From CCoeControl indicate whether or not a key event was processed - */ - TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,TEventCode aType ); - - #ifdef __SERIES60_HELP - /** - * From CCoeControl read help - */ - void GetHelpContext( TCoeHelpContext& aContext ) const; - #endif - -private: - - /** - * Default constructor - */ - CSettingsContainer(); - - /** - * Second phase constructor. Operations which might leave should - * be called here - * @param aRect reference to container area - * @param aAppUi the pointer to the CImagePrintUiAppUi - */ - void ConstructL( const TRect& aRect, CImagePrintUiAppUi* aAppUi ); - - - -private: // Data - - CAknSettingStyleListBox* iSettingsMainListBox; // The setting items list (scrollable) - CSettingsItems* iSettingsItems; // Format strings for list items - CCapabilityManager* iCapabilityManager; // Contains capability needed by settings - CImagePrintUiAppUi* iAppUi; - CAknsBasicBackgroundControlContext* iSkinContext; // skin data - }; - -#endif // CSETTINGSCONTAINER_H diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/inc/settingsitems.h --- a/usbuis/imageprintui/inc/settingsitems.h Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,162 +0,0 @@ -/* -* Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Header file for settingsitems -* -*/ - - - - -#ifndef CSETTINGSITEMS_H -#define CSETTINGSITEMS_H - -// EXTERNAL INCLUDES -#include -#include -#include "settingstables.h" -#include "pictbridge.h" - -// FORWARD DECLARATIONS -class CCapabilityManager; -class CNotes; - -// CONSTANTS -_LIT( KTab, "\t" ); -const TInt KSettingsMaxSize = 256; -const TInt KDefaultArrayValue = 3; - -/** - * - * List box model that handles the contents of the list box and launches - * the pop-up dialogs that are used . - * - */ -class CSettingsItems : - public CBase, - public MEikListBoxObserver, - public MDesCArray - { - -public: - - /** - * Two-phase constructor - * - * @param aManager the pointer to the CapabilityManager - * @param aNotes the pointer to the CNotes - * @return Initialized instance of CSettingsItems - */ - static CSettingsItems* NewL( CCapabilityManager* aManager, CNotes* aNotes); - - /** - * Two-phase constructor - * - * @param aManager the pointer to the CapabilityManager - * @param aNotes the pointer to the CNotes - * @return Initialized instance of CSettingsItems - */ - static CSettingsItems* NewLC( CCapabilityManager* aManager, CNotes* aNotes); - - - /** - * Destructor - */ - virtual ~CSettingsItems(); - -private: // Constructors and destructors - - /** - * Constructor - * @param aManager the pointer to the CapabilityManager - * @param aNotes the pointer to the CNotes - */ - CSettingsItems( CCapabilityManager* aManager, CNotes* aNotes); - - /** - * 2nd phase constructor - */ - void ConstructL(); - -public: // Methods derived from MEikListBoxObserver - - - /** - * Framework method to handle listbox event - */ - void HandleListBoxEventL( CEikListBox* aListBox, - TListBoxEvent aEventType ); - -public: // Methods derived from MDesCArray - - - - /** - * Return number of items in listbox - */ - TInt MdcaCount() const; - - /** - * Creates the text string for the list box item and returns it, - * set sting to iBubber, can leave - */ - TPtrC MdcaPointL( TInt aIndex ) const; - - /** - * Creates the text string for the list box item and returns it, - * set string to iBuffer - */ - TPtrC MdcaPoint( TInt aIndex ) const; - - -private: - - /** - * Opens the radio button page to change print settings - */ - void HandleEvent( TInt aCapability, - const TConversionTable* aTable, - const TInt aTableSize, const HBufC* aTitle ); - /** - * Opens the radio button page to change print settings, can leave - */ - void HandleEventL(TInt aCapability, - const TConversionTable* aTable, - const TInt aTableSize, const HBufC* aTitle ); - - /** - * Retrieve current print setting string - */ - void GetCurrentStringL( TInt aCapability, - const TConversionTable* aTable, - const TInt aTableSize ) const; - - -private: // Data - - CCapabilityManager* iCapabilityManager; - - CNotes* iNotes; - - TInt iCount; - - HBufC* iBuffer; - - HBufC* iLayout; - - HBufC* iPaperSize; - - HBufC* iQuality; - }; - -#endif \ No newline at end of file diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/inc/settingstables.h --- a/usbuis/imageprintui/inc/settingstables.h Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Contain info about capabilities phone are supporting -* -*/ - - - - -#ifndef SETTINGSTABLES_H -#define SETTINGSTABLES_H - -#include -#include - -/** -* Definitions for phone supported capabilities -*/ - -const TInt KLayoutTableCount( 6 ); -const TInt KLayoutTableIndexCount( 2 ); - -const TInt KPaperSizeTableCount( 6 ); -const TInt KPaperSizeTableIndexCount( 2 ); - -const TInt KQualityTableCount( 4 ); -const TInt KQualityTableIndexCount( 2 ); - -const TInt KTableCount( 16 ); -const TInt KTableIndexCount( 2 ); - -struct TConversionTable - { - TInt iCapabilityID; - TInt iResourceID; - }; - - -const TConversionTable KLayoutTable[] = - { - { EDpsLayoutDefault, R_USB_PRINT_LAYOUT_DEFAULT }, - { EDpsLayout1Up, R_USB_PRINT_LAYOUT_1_UP }, - { EDpsLayout2Up, R_USB_PRINT_LAYOUT_2_UP }, - { EDpsLayout4Up, R_USB_PRINT_LAYOUT_4_UP }, - { EDpsLayout6Up, R_USB_PRINT_LAYOUT_6_UP }, - { EDpsLayout9Up, R_USB_PRINT_LAYOUT_9_UP } - }; - - -const TConversionTable KPaperSizeTable[]= - { - { EDpsPaperSizeDefault, R_USB_PRINT_PAPER_SIZE_AUTOMATIC }, - { EDpsPaperSizeCard, R_USB_PRINT_PAPER_SIZE_CARD }, - { EDpsPaperSize4x6, R_USB_PRINT_PAPER_SIZE_INCH }, - { EDpsPaperSizeLetter, R_USB_PRINT_PAPER_SIZE_LETTER }, - { EDpsPaperSizeA4, R_USB_PRINT_PAPER_SIZE_A4 }, - { EDpsPaperSizeA6, R_USB_PRINT_PAPER_SIZE_A6 } - }; - - -const TConversionTable KQualityTable[] = - { - { EDpsPrintQualityDefault, R_USB_PRINT_QUALITY_DEFAULT }, - { EDpsPrintQualityFine, R_USB_PRINT_QUALITY_HIGH }, - { EDpsPrintQualityNormal, R_USB_PRINT_QUALITY_NORMAL }, - { EDpsPrintQualityDraft, R_USB_PRINT_QUALITY_DRAFT } - }; - - -#endif \ No newline at end of file diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/inc/settingsview.h --- a/usbuis/imageprintui/inc/settingsview.h Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,115 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Header file for settingsview -* -*/ - - -#ifndef CSETTINGSVIEW_H -#define CSETTINGSVIEW_H - - -#include - -class CSettingsContainer; - -const TUid KImagePrintSettingsViewId = { 2 }; - - -/** -* View class to present application main view -*/ -class CSettingsView : public CAknView - { - -public: - - /** - * Two phase constructor - * @return a CSettingsView instance - */ - static CSettingsView* NewL(); - - /** - * Two phase constructor - * @return a CSettingsView instance - */ - static CSettingsView* NewLC(); - - /** - * Destructor - */ - virtual ~CSettingsView(); - - -private: // from base class CAknView - - /** - * From CAknView - * Returns view id. - * @param None. - * @return View id. - */ - TUid Id() const; - - /** - * From CAknView - * Handles user commands. - * @param aCommand A command id. - * @return None. - */ - void HandleCommandL(TInt aCommand); - - /** - * From CAknView - * Activates view. - * @param aPrevViewId Id of previous view. - * @param aCustomMessageId Custom message id. - * @param aCustomMessage Custom message. - * @return None. - */ - void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId, - const TDesC8& aCustomMessage); - - /** - * From CAknView - * Deactivates view. - * @param None. - * @return None. - */ - void DoDeactivate(); - - /** - * Default constructor - */ - CSettingsView(); - - /** - * Symbian 2nd phase constructor. - * @param None - * @return None - */ - void ConstructL(); - -private: // data - - /** - * Container control of this view - * Own - */ - CSettingsContainer* iContainer; - - }; - -#endif // CSETTINGSVIEW_H diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/loc/imageprintui.loc --- a/usbuis/imageprintui/loc/imageprintui.loc Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,312 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Localization strings for project Image Print UI -* -*/ - - - -// LOCALISATION STRINGS - -// d: Text on the status pane on empty view -// l: title_pane_t2/opt9 -// r: 3.2 -// -#define qtn_usb_title_image_print "Image print" - - -// d: Text on the status pane on print preview view -// l: title_pane_t2/opt9 -// r: 3.2 -// -#define qtn_usb_image_print_preview "Print preview" - - -// d: Text on the navi pane which shows the printer name and the vendor name -// l: navi_navi_text_pane_t1 -// r: 3.2 -// -#define qtn_usb_navi_printer_name "%U" - -// d: Print command in the "Options" menu of the print preview view -// l: list_single_pane_t1_cp2 -// r: 3.2 -#define qtn_usb_option_print "Print" - -// d: Print settings command in the "Options" menu of the print preview view -// l: list_single_pane_t1_cp2 -// r: 3.2 -// -#define qtn_usb_print_settings "Print settings" - -// d: Text on the status pane on print settings -// l: title_pane_t2/opt9 -// r: 3.2 -// -#define qtn_print_title_print_settings "Print settings" - -// d: Print settings command in the "Options" menu of the print preview view -// l: list_single_pane_t1_cp2 -// r: 3.2 -// -#define qtn_usb_opt_change "Change" - -// d: Print layout capability presented in the list box in print settings view -// l: list_setting_pane_t1 -// r: 3.2 -// -#define qtn_usb_print_layout "Layout" - -// d: Paper size capability presented in the list box in print settings view -// l: list_setting_pane_t1 -// r: 3.2 -// -#define qtn_usb_print_paper_size "Paper size" - -// d: Print quality capability presented in the list box in print settings view -// l: list_setting_pane_t1 -// r: 3.2 -// -#define qtn_usb_print_quality "Print quality" - -// *** PAPER SIZES *** - -// d: Paper size "Automatic" in the print settings view list box / pop-up window -// l: list_set_graphic_pane_t1 -// r: 3.2 -// -#define qtn_usb_print_paper_size_automatic "Default" - -// d: Paper size "A4" in the print settings view list box / pop-up window -// l: list_set_graphic_pane_t1 -// r: 3.2 -// -#define qtn_usb_print_paper_size_a4 "A4" - -// d: Paper size "A6" in the print settings view list box / pop-up window -// l: list_set_graphic_pane_t1 -// r: 3.2 -// -#define qtn_usb_print_paper_size_a6 "A6" - -// d: Paper size "4*6 (inch)" in the print settings view list box / pop-up window -// l: list_set_graphic_pane_t1 -// r: 3.2 -// -#define qtn_usb_print_paper_size_inch "4*6 (inch)" - -// d: Paper size "Card size" in the print settings view list box / pop-up window -// l: list_set_graphic_pane_t1 -// r: 3.2 -// -#define qtn_usb_print_paper_size_card "Card size" - -// d: Paper size "Letter" in the print settings view list box / pop-up window -// l: list_set_graphic_pane_t1 -// r: 3.2 -// -#define qtn_usb_print_paper_size_letter "Letter" - - -// *** PRINT QUALITIES *** - - -// d: Print quality "Default" in the print settings view list box / pop-up window -// l: list_set_graphic_pane_t1 -// r: 3.2 -// -#define qtn_usb_print_quality_default "Default" - -// d: Print quality "High" in the print settings view list box / pop-up window -// l: list_set_graphic_pane_t1 -// r: 3.2 -// -#define qtn_usb_print_quality_high "High" - -// d: Print quality "Normal" in the print settings view list box / pop-up window -// l: list_set_graphic_pane_t1 -// r: 3.2 -// -#define qtn_usb_print_quality_normal "Normal" - -// d: Print quality "Draft" in the print settings view list box / pop-up window -// l: list_set_graphic_pane_t1 -// r: 3.2 -// -#define qtn_usb_print_quality_draft "Draft" - - -// *** LAYOUTS *** - -// d: Print layout "Default" in the print settings view list box / pop-up window -// l: list_set_graphic_pane_t1 -// r: 3.2 -// -#define qtn_usb_print_layout_default "Default" - -// d: Print layout "1-up" in the print settings view list box / pop-up window -// l: list_set_graphic_pane_t1 -// r: 3.2 -// -#define qtn_usb_print_layout_1_up "1 per page" - -// d: Print layout "2-up" in the print settings view list box / pop-up window -// l: list_set_graphic_pane_t1 -// r: 3.2 -// -#define qtn_usb_print_layout_2_up "Up to 2 per page" - - -// d: Print layout "4-up" in the print settings view list box / pop-up window -// l: list_set_graphic_pane_t1 -// r: 3.2 -// -#define qtn_usb_print_layout_4_up "Up to 4 per page" - - -// d: Print layout "6-up" in the print settings view list box / pop-up window -// l: list_set_graphic_pane_t1 -// r: 3.2 -// -#define qtn_usb_print_layout_6_up "Up to 6 per page" - - -// d: Print layout "9-up" in the print settings view list box / pop-up window -// l: list_set_graphic_pane_t1 -// r: 3.2 -// -#define qtn_usb_print_layout_9_up "Up to 9 per page" - - -// *** NOTES *** - -// d: Progress note -// d: Text on the print progress dialog -// l: popup_note_wait_window -// r: 3.2 -// -#define qtn_usb_wait_printing "Printing" - -// d: Printing error note -// d: Error note is displayed, when connection over the chosen transmission technology fails -// l: popup_note_window -// r: 3.2 -// -#define qtn_usb_error_unable_to_connect "Unable to connect printer" - -// d: Printing error note -// d: Shown when there is already printing process ongoing -// l: popup_note_window -// r: 3.2 -// -#define qtn_usb_error_printer_busy "Unable to send image to printer. Printer may be busy." - -// d: Printing error note -// d: Error note is displayed when the connection is unexpectedly terminated while the -// d: printer is printing or somehow connected to a printer (for example when USB cable is disconnected) -// d: or then a software error happens, data is not transmitted and -// d: system timeout causes transmission to terminate. -// l: popup_note_window -// r: 3.2 -// -#define qtn_usb_error_connection_lost "Connection to printer lost" - -// d: Printing error note -// d: This is a generic error note that is displayed, when no specific error message is available. -// It tells to user that there has been problem during printing and (most probably) the printer -// will cancel its current print job. -// l: popup_note_window -// r: 3.2 -// -#define qtn_usb_error_in_printing "Printing error" - -// d: Printing error note -// d: Shown when something is wrong in the status of printer -// l: popup_note_window -// r: 3.2 -// -#define qtn_usb_error_check_status "Check status of printer" - -// d: Printing error note -// d: Notifies user that the printer has run out of paper -// l: popup_note_window -// r: 3.2 -// -#define qtn_usb_error_out_of_paper "Out of paper" - -// d: Printing error note -// d: Notifies user that the printer is running out of ink -// l: popup_note_window -// r: 3.2 -// -#define qtn_usb_error_ink_low "Ink low" - -// d: Printing error note -// d: Notifies user that the printer has run out of ink -// l: popup_note_window -// r: 3.2 -// -#define qtn_usb_error_out_of_ink "Out of ink" - - -// d: Printing error note -// d: Shown when there is a paper jam in the printer -// l: popup_note_window -// r: 3.2 -// -#define qtn_usb_error_paper_jam "Paper jam" - -// d: Printing error note -// d: Notifies that the file type is not supported -// l: popup_note_window -// r: 3.2 -// -#define qtn_usb_error_file_not_supported "A file that is not supported will be removed from the selection." - -// d: Printing error note. -// d: This note is used to inform the user that one or many files of unsupported type(other than .jpeg) has been -// selected and the application will discard them and continue with the images that are of the supported filetype(.jpeg). -// l: popup_note_window -// r: 3.2 -// -#define qtn_usb_error_unsupported_files_removed "Files that are not supported will be removed from the selection." - -// d: Printing error note -// d: Shown if the selected file could not be found from device/MMC for -// some reason -// l: popup_note_window -// r: 3.2 -// -#define qtn_usb_error_file_not_found "File not found" - -// d: Printing information note. -// d: The purpose of the note is to inform the user that printing is already ongoing -// and it may therefore not be initiated again elsewhere. -// l: popup_note_window -// r: 3.2 -// -#define qtn_usb_info_app_in_use "Application already in use" - -// d: Info note displayed to user connect the cable to PictBridge Printer if connected to -// other printer or PC -// l: popup_note_wait_window -// r: 3.2 -#define qtn_usb_wait_connect_cable_compatible "Connect cable to PictBridge printer" - -// d: Info note displayed to user connect the cable if cable is not connected -// and user has select print from menu option -// l: popup_note_wait_window -// r: 3.2 -#define qtn_usb_wait_connect_cable "Connect USB cable" - diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/rom/imageprintui.iby --- a/usbuis/imageprintui/rom/imageprintui.iby Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Image description file for project imageprintui -* -*/ - -#ifndef IMAGEPRINTUI_IBY -#define IMAGEPRINTUI_IBY -#ifdef __USB_PICTBRIDGE_UI - -#include -data=DATAZ_\Private\10003A3F\Apps\imageprintui_reg.rsc Private\10003A3F\Apps\imageprintui_reg.rsc -data=DATAZ_\Private\1020e470\phonecapability.RSC Private\1020e470\phonecapability.rsc -S60_APP_EXE( imageprintui ) - - -#endif // __USB_PICTBRIDGE_UI -#endif // IMAGEPRINTUI_IBY \ No newline at end of file diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/rom/imageprintuiresources.iby --- a/usbuis/imageprintui/rom/imageprintuiresources.iby Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Language description file for project imageprintui -* -*/ - - - -#ifndef __IMAGEPRINTUIRESOURCES_IBY__ -#define __IMAGEPRINTUIRESOURCES_IBY__ - -#ifdef __USB_PICTBRIDGE_UI -#include - -data=DATAZ_\APP_RESOURCE_DIR\imageprintui.RSC APP_RESOURCE_DIR\imageprintui.rsc - - - -#endif // __USB_PICTBRIDGE_UI -#endif // __IMAGEPRINTUIRESOURCES_IBY__ \ No newline at end of file diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/src/capabilitymanager.cpp --- a/usbuis/imageprintui/src/capabilitymanager.cpp Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,758 +0,0 @@ -/* -* Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Retrieve printing capabilites from printer -* -*/ - - -#include "capabilitymanager.h" -#include "imageprintuidebug.h" -#include "imageprintuiappui.h" -#include -#include -#include -#include -#include -#include -#include -#include - - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CCapabilityManager::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CCapabilityManager* CCapabilityManager::NewL(CImagePrintUiAppUi* aAppUi, CDpsEngine* aEngine) - { - FLOG(_L("[IMAGEPRINTUI]\tCCapabilityManager:NewL")); - CCapabilityManager* self - = new (ELeave) CCapabilityManager(aAppUi, aEngine); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// CCapabilityManager::~CCapabilityManager -// C++ default destructor -// ----------------------------------------------------------------------------- -// -CCapabilityManager::~CCapabilityManager() - { - FLOG(_L("[IMAGEPRINTUI]\tCCapabilityManager: desctructor")); - Cancel(); // cancels any existing active object orders for iStatus - - iReturnArray.Close(); - iCurrentLayouts.Close(); - iCurrentPaperSizes.Close(); - iCurrentQualities.Close(); - - iPhoneSuppQuality.Close(); - iPhoneSuppPaperSize.Close(); - iPhoneSuppLayout.Close(); - FLOG(_L("[IMAGEPRINTUI]\tCCapabilityManager: desctructor complete")); - } - - -// ----------------------------------------------------------------------------- -// CCapabilityManager::CCapabilityManager -// C++ default constructor -// ----------------------------------------------------------------------------- -// -CCapabilityManager::CCapabilityManager(CImagePrintUiAppUi* aAppUi, CDpsEngine* aEngine) - : CActive(EPriorityStandard), - iAppUi(aAppUi), iDpsEngine(aEngine), - iUserSelectedQuality(EDpsPrintQualityDefault), - iUserSelectedPaperSize(EDpsPaperSizeDefault), - iUserSelectedLayout(EDpsLayoutDefault) - { - CActiveScheduler::Add(this); - } - - -// ----------------------------------------------------------------------------- -// CCapabilityManager::RunError -// Standard active object error function. -// ----------------------------------------------------------------------------- -// - -TInt CCapabilityManager::RunError(TInt aError) - { - FTRACE(FPrint(_L("[IMAGEPRINTUI]CCapabilityManager RunError is %d ."), aError)); - return KErrNone; - } - - -// ----------------------------------------------------------------------------- -// CCapabilityManager::RunL -// This function will be called upon a change in the watched key. -// ----------------------------------------------------------------------------- -// -void CCapabilityManager::RunL() - { - FLOG(_L("[IMAGEPRINTUI]\tCCapabilityManager::RunL")); - if(iStatus.Int() == KErrNone && iLayoutForPaperSize) - { - FLOG(_L("[IMAGEPRINTUI]\tCCapabilityManager::RunL layout for papersize asked")); - HandleLayoutForPaperSize(); - return; - } - - if ( iStatus.Int() == KErrNone ) - { - FLOG(_L("[IMAGEPRINTUI]\tCCapabilityManager::RunL, no error in iStatus")); - HandleCapabilitiesL(iCapabilityType); - } - - else - { - FLOG(_L("[IMAGEPRINTUI]\tCCapabilityManager::RunL, there is error in iStatus")); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\tCCapabilityManager::RunL: ERROR is %d ."), iStatus.Int())); - iAppUi->HandleCapabilityTime(KRetryAsk); - FLOG(_L("[IMAGEPRINTUI]\tCCapabilityManager::Timer called")); - } - FLOG(_L("[IMAGEPRINTUI]\tCCapabilityManager::RunL complete.")); - } - - -// ----------------------------------------------------------------------------- -// CCapabilityManager::ConstructL -// Construct member variable iPersonalityRepository that is to access the -// repository. Then start listening of the changes in the repository. -// ----------------------------------------------------------------------------- -// -void CCapabilityManager::ConstructL() - { - FLOG(_L("[IMAGEPRINTUI]<<(KDefaultArray); - iPhoneSuppPaperSize = RArray(KDefaultArray); - iPhoneSuppQuality = RArray(KDefaultArray); - iCurrentQualities = RArray(KDefaultArray); - iCurrentPaperSizes = RArray(KDefaultArray); - iCurrentLayouts = RArray(KDefaultArray); - - iReturnArray = RArray(KDefaultArray); - - GetPhoneConfigL(); - FLOG(_L("[IMAGEPRINTUI]>>>CCapabilityManager: ConstructL complete")); - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CCapabilityManager::AskCapabilitiesL(TBool aChanged) - { - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CCapabilityManager::AskCapabilitiesL iStatus is %d"), iStatus.Int() )); - - if(aChanged) - { - if(iStatus.Int() == KErrNotReady) // this is collision situation, have asked earlier and event capability - { // change requires asking again when AO is already active - FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager::AskCapabilitiesL not ready when capability change")); - return; - } - else - { - FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager::AskCapabilities cancel pending")); - Cancel(); - } - - } - if(!IsActive()) - { - FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager::start ask paper size ")); - AskPaperSizeL(); - } - else - { - FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager::cannot ask quality, already active ")); - } - - FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager::AskCapabilities")); - - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CCapabilityManager::AskQualityL() - { - iCap.iRepParam.Reset(); - FLOG(_L("[IMAGEPRINTUI]>>> CCapabilityManager::AskQualityL ")); - iCap.iReqParam.iCap = EDpsArgQualities; - iCapabilityType = EQualities; - iDpsEngine->DoDpsRequestL(&iCap, iStatus); - SetActive(); - FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager::AskQualityL ")); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CCapabilityManager::AskPaperSizeL() - { - iCap.iRepParam.Reset(); - FLOG(_L("[IMAGEPRINTUI]>>> CCapabilityManager::AskPaperSizeL ")); - iCap.iReqParam.iCap = EDpsArgPaperSizes; - iCapabilityType = EPaperSize; - iDpsEngine->DoDpsRequestL(&iCap, iStatus); - SetActive(); - FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager::AskPaperSizeL ")); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CCapabilityManager::AskLayoutL() - { - iCap.iRepParam.Reset(); - FLOG(_L("[IMAGEPRINTUI]>>> CCapabilityManager::AskLayoutL ")); - - iCap.iReqParam.iCap = EDpsArgLayouts; - iCap.iReqParam.iAttribute = EDpsPaperSizeDefault; - iCapabilityType = ELayouts; - iDpsEngine->DoDpsRequestL(&iCap, iStatus); - SetActive(); - FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager::AskLayoutL ")); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CCapabilityManager::AskLayoutForPaperSizeL(TUint aPaperSize) - { - FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager::AskLayoutForPaperSizeL ")); - iCap.iRepParam.Reset(); - iCap.iReqParam.iCap = EDpsArgLayouts; - iCap.iReqParam.iAttribute = aPaperSize; - iDpsEngine->DoDpsRequestL(&iCap, iStatus); - - if(!IsActive()) - { - iLayoutForPaperSize = ETrue; - SetActive(); - } - } - - -// ----------------------------------------------------------------------------- -// CCapabilityManager::DoCancel -// Standard active object cancellation function. -// ----------------------------------------------------------------------------- -// -void CCapabilityManager::DoCancel() - { - FLOG(_L("[IMAGEPRINTUI]\tCCapabilityManager::DoCancel")); - iDpsEngine->CancelDpsRequest(); - FLOG(_L("[IMAGEPRINTUI]\tCCapabilityManager::DoCancel complete")); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -RArray& CCapabilityManager::GetCapabilitiesL(TInt aCapabilities) - { - FLOG(_L("[IMAGEPRINTUI]<<>>CCapabilityManager.GetCapabilities default brach")); - break; - } - FLOG(_L("[IMAGEPRINTUI]>>>CCapabilityManager.GetCapabilities")); - return iReturnArray; - } - -// --------------------------------------------------------------------------- -// User has choosed value for saving -// --------------------------------------------------------------------------- -// -void CCapabilityManager::SetValue(TInt aCapability, TUint aValue) - { - FLOG(_L("[IMAGEPRINTUI]<<>>CCapabilityManager.SetValue")); - } - -// --------------------------------------------------------------------------- -// UI requires current value -// --------------------------------------------------------------------------- -// -TUint CCapabilityManager::CurrentPrintSettings(TInt aDpsArg) - { - FLOG(_L("[IMAGEPRINTUI]<<>>CCapabilityManager CurrentPrintSettings")); - return retValue; - } - -// --------------------------------------------------------------------------- -// Gives paper size value for DoDpsRequest -// --------------------------------------------------------------------------- -// -TUint CCapabilityManager::PaperSize() - { - return iUserSelectedPaperSize; - } - -// --------------------------------------------------------------------------- -// Gives layout value for DoDpsRequest -// --------------------------------------------------------------------------- -// -TUint CCapabilityManager::Layout() - { - return iUserSelectedLayout; - } - -// --------------------------------------------------------------------------- -// Gives quality value for DoDpsRequest -// --------------------------------------------------------------------------- -// -TUint CCapabilityManager::Quality() - { - return iUserSelectedQuality; - } - -// --------------------------------------------------------------------------- -// Goes through phone supported quality values and compare with printer supported, -// if both supported save value -// --------------------------------------------------------------------------- - -void CCapabilityManager::StoreQualitiesL(RArray& aPrinterQualities) - { - FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: Store qualities")); - TInt countPrinter, countPhone; - TUint compareValue; - countPrinter = aPrinterQualities.Count(); - countPhone = iPhoneSuppQuality.Count(); - iIsCapabilityEmpty = EFalse; - iCurrentQualities.Reset(); - - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CCapabilityManager aPrinterQualities count is %d"), aPrinterQualities.Count() )); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CCapabilityManager iPhoneSuppQuality count is %d"), iPhoneSuppQuality.Count() )); - - - for(int r=0; r < countPrinter; r++) - { - compareValue = aPrinterQualities[r]; - for(int d=0; d < countPhone; d++) - { - if(compareValue == iPhoneSuppQuality[d]) - { - iIsCapabilityEmpty = ETrue; - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CCapabilityManager compareValue save quality is %x"), compareValue )); - iCurrentQualities.AppendL(compareValue); - } - } - } - if(!iIsCapabilityEmpty) - { - FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: qualities add default value")); - iCurrentQualities.AppendL(EDpsPrintQualityDefault); - } - FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: qualities stored, ask layout")); - iCurrentQualities.Sort(); - AskLayoutL(); - } - - -// --------------------------------------------------------------------------- -// Goes through phone supported paper size values and compare with printer supported, -// if both supported save value -// --------------------------------------------------------------------------- -void CCapabilityManager::StorePaperSizeL(RArray& aPrinterPaperSize) - { - FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: Store paper size")); - TInt countPrinter, countPhone; - TUint compareValue; - countPrinter = aPrinterPaperSize.Count(); - countPhone = iPhoneSuppPaperSize.Count(); - iIsCapabilityEmpty = EFalse; - iCurrentPaperSizes.Reset(); - - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CCapabilityManager aPrinterPaperSize count is %d"), aPrinterPaperSize.Count() )); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CCapabilityManager iPhoneSuppPaperSize count is %d"), iPhoneSuppPaperSize.Count() )); - - - for(int r=0; r < countPrinter; r++) - { - compareValue = aPrinterPaperSize[r]; - for(int f=0; f < countPhone; f++) - { - if(compareValue == iPhoneSuppPaperSize[f]) - { - iIsCapabilityEmpty = ETrue; - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CCapabilityManager compareValue save paper size is %x"), compareValue )); - iCurrentPaperSizes.AppendL(compareValue); - } - } - } - if(!iIsCapabilityEmpty) - { - FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: paper size add default value")); - iCurrentPaperSizes.AppendL(EDpsPaperSizeDefault); - } - FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: paper sizes stored, ask quality")); - iCurrentPaperSizes.Sort(); - AskQualityL(); - } - -// --------------------------------------------------------------------------- -// Goes through phone supported layout values and compare with printer supported, -// if both supported save value -// --------------------------------------------------------------------------- -void CCapabilityManager::StoreLayouts(RArray& aPrinterLayouts) - { - FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: Store layouts")); - TInt countPrinter, countPhone; - TInt ret = KErrNone; - TUint compareValue; - countPrinter = aPrinterLayouts.Count(); - countPhone = iPhoneSuppLayout.Count(); - iIsCapabilityEmpty = EFalse; - iCurrentLayouts.Reset(); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CCapabilityManager aPrinterLayouts count is %d"), aPrinterLayouts.Count() )); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CCapabilityManager iPhoneSuppLayout count is %d"), iPhoneSuppLayout.Count() )); - - for(int r=0; r < countPrinter; r++) - { - compareValue = aPrinterLayouts[r]; - for(int e=0; e < countPhone; e++) - { - if(compareValue == iPhoneSuppLayout[e]) - { - iIsCapabilityEmpty = ETrue; - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CCapabilityManager compareValue save layout is %x"), compareValue )); - if ( (ret = iCurrentLayouts.Append(compareValue)) != KErrNone) - { - FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: Store layouts *** append error")); - } - } - } - } - - if(!iIsCapabilityEmpty) - { - FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: layout add default value")); - ret = iCurrentLayouts.Append(EDpsLayoutDefault); - if (ret != KErrNone) - { - FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: Store layouts *** append error")); - } - } - - iCurrentLayouts.Sort(); - if(iCapabilityAskFailed) - { - // all capabilities has asked - // asking one of the tree capabilities was unsuccessfull - FLOG(_L("[IMAGEPRINTUI]<<< :CCapabilityManager, Capabilities NOT ready ")); - iAppUi->CapabilitiesReady(); - } - else - { - FLOG(_L("[IMAGEPRINTUI]<<< :CCapabilityManager, Capabilities are ready ")); - iAppUi->CapabilitiesReady(); - } - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CCapabilityManager::HandleLayoutForPaperSize() - { - FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager::HandleLayoutForPaperSize")); - StoreLayouts(iCap.iRepParam.iContent); - } -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CCapabilityManager::HandleCapabilitiesL(TCapabilityType aType) - { - - if(aType == EQualities) - { - if(iCap.iResult.iMajorCode == EDpsResultOk) - { - FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: Dps request qualities capability OK")); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CCapabilityManager HandleCapabilitiesL qualities amount is %d"), iCap.iRepParam.iContent.Count() )); - for(int r=0; r < iCap.iRepParam.iContent.Count(); r++) - { - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CCapabilityManager HandleCapabilitiesL qualities is %x"), iCap.iRepParam.iContent[r] )); - } - StoreQualitiesL(iCap.iRepParam.iContent); - } - else - { - FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: Dps request qualities capability NOK")); - iCapabilityAskFailed = ETrue; - // if fails add default value - iAppUi->NotifyError(); - iCurrentQualities.Reset(); - iCurrentQualities.AppendL(EDpsPrintQualityDefault); - AskLayoutL(); - } - - } - else if(aType == EPaperSize) - { - if(iCap.iResult.iMajorCode == EDpsResultOk) - { - FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: Dps request paper size capability OK")); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CCapabilityManager HandleCapabilitiesL papersize amount is %d"), iCap.iRepParam.iContent.Count() )); - for(int r=0; r < iCap.iRepParam.iContent.Count(); r++) - { - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CCapabilityManager HandleCapabilitiesL paper size is %x"), iCap.iRepParam.iContent[r] )); - } - - StorePaperSizeL(iCap.iRepParam.iContent); - } - else - { - FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: Dps request paper size capability NOK")); - iCapabilityAskFailed = ETrue; - // if fails add default value; - iAppUi->NotifyError(); - iCurrentPaperSizes.Reset(); - iCurrentPaperSizes.AppendL(EDpsPaperSizeDefault); - AskQualityL(); - } - - } - else if(aType == ELayouts) - { - if(iCap.iResult.iMajorCode == EDpsResultOk) - { - FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: Dps request layout capability OK")); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CCapabilityManager HandleCapabilitiesL layout amount is %d"), iCap.iRepParam.iContent.Count() )); - for(int r=0; r < iCap.iRepParam.iContent.Count(); r++) - { - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CCapabilityManager HandleCapabilitiesL layout is %x"), iCap.iRepParam.iContent[r] )); - } - StoreLayouts(iCap.iRepParam.iContent); - } - else - { - FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: Dps request layout capability NOK")); - iCapabilityAskFailed = ETrue; - //if fails add default value - iAppUi->NotifyError(); - iCurrentLayouts.Reset(); - iCurrentLayouts.AppendL(EDpsLayoutDefault); - // complete even if not succesfull, UI must activate - iAppUi->CapabilitiesReady(); - } - - } - - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CCapabilityManager::GetPhoneConfigL() - { - FLOG(_L("[IMAGEPRINTUI]>>> :CCapabilityManager, GetPhoneConfigL BEGIN")); - - - TBuf resourceFile(PathInfo::RomRootPath()); - TBuf length(KPhoneCapability); - resourceFile.SetLength(KDriver + length.Length()); - resourceFile.Replace(KDriver, length.Length(), KPhoneCapability); - - RResourceFile resource; - resource.OpenL(CCoeEnv::Static()->FsSession(), resourceFile); - FLOG(_L("[IMAGEPRINTUI]>>> CImagePrintUi:CCapabilityManager, Resource open")); - - CleanupClosePushL(resource); - resource.ConfirmSignatureL(KPhoneCapabilityVersion); - - HBufC8* id = resource.AllocReadLC(PHONECAPABILITY_CONFIG); - - TResourceReader reader; - reader.SetBuffer(id); - - TInt qualityCount = reader.ReadUint8(); - TInt papersizeCount = reader.ReadUint8(); - TInt layoutCount = reader.ReadUint8(); - - - for (TInt i = 0; i < qualityCount; i++) - { - iPhoneSuppQuality.AppendL(reader.ReadUint16()); - } - FLOG(_L("[IMAGEPRINTUI]>>> CImagePrintUi:CCapabilityManager, quality readed")); - - for (TInt i = 0; i < papersizeCount; i++) - { - iPhoneSuppPaperSize.AppendL(reader.ReadUint16()); - } - - FLOG(_L("[IMAGEPRINTUI]>>> CImagePrintUi:CCapabilityManager, papersize readed")); - for (TInt i = 0; i < layoutCount; i++) - { - iPhoneSuppLayout.AppendL(reader.ReadUint16()); - } - FLOG(_L("[IMAGEPRINTUI]>>> CImagePrintUi:CCapabilityManager, layout readed")); - - CleanupStack::PopAndDestroy(id); - CleanupStack::PopAndDestroy(&resource); - FLOG(_L("[IMAGEPRINTUI]<<< CImagePrintUi:CCapabilityManager GetPhoneConfigL END ")); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CCapabilityManager::CheckIfNewCapabilityDiffer() - { - FLOG(_L("[IMAGEPRINTUI]>>> CCapabilityManager:: CheckIfNewCapabilityDiffer")); - TBool compareValue = EFalse; - - - for(TInt i = 0; i < iCurrentLayouts.Count(); i++) - { - if(iCurrentLayouts.operator[](i) == iUserSelectedLayout ) - { - compareValue = ETrue; - } - - } - - if(!compareValue) - { - FLOG(_L("[IMAGEPRINTUI]<<< CImagePrintUi:: user selected layout not supported")); - iUserSelectedLayout = EDpsLayoutDefault; - } - - compareValue = EFalse; - - for(TInt i = 0; i < iCurrentQualities.Count(); i++) - { - if(iCurrentQualities.operator[](i) == iUserSelectedQuality ) - { - compareValue = ETrue; - } - - } - - if(!compareValue) - { - FLOG(_L("[IMAGEPRINTUI]<<< CImagePrintUi:: user selected quality not supported")); - iUserSelectedQuality = EDpsPrintQualityDefault; - } - - compareValue = EFalse; - - for(TInt i = 0; i < iCurrentPaperSizes.Count(); i++) - { - if(iCurrentPaperSizes.operator[](i) == iUserSelectedPaperSize ) - { - compareValue = ETrue; - } - } - - if(!compareValue) - { - FLOG(_L("[IMAGEPRINTUI]<<< CImagePrintUi:: user selected paper size not supported")); - iUserSelectedPaperSize = EDpsPaperSizeDefault; - } - FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager:: CheckIfNewCapabilityDiffer")); - } - -// End of file diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/src/connectionmanager.cpp --- a/usbuis/imageprintui/src/connectionmanager.cpp Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,220 +0,0 @@ -/* -* Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Informs about USB connection -* -*/ - - -#include -#include - -#include "connectionmanager.h" -#include "imageprintuidebug.h" -#include "settingsview.h" -#include "notes.h" -#include "imageprintuiappui.h" - - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CConnectionManager::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CConnectionManager* CConnectionManager::NewL( CImagePrintUiAppUi* aAppUi, - CDpsEngine* aEngine, CNotes* aNotes) - { - FLOG(_L("[IMAGEPRINTUI]\tCConnectionManager:NewL")); - CConnectionManager* self - = new (ELeave) CConnectionManager(aAppUi, aEngine, aNotes); - return self; - } - - -// ----------------------------------------------------------------------------- -// CConnectionManager::~CConnectionManager -// C++ default destructor -// ----------------------------------------------------------------------------- -// -CConnectionManager::~CConnectionManager() - { - FLOG(_L("[IMAGEPRINTUI]\tCConnectionManager: desctructor")); - Cancel(); // cancels any existing active object orders for iStatus - - FLOG(_L("[IMAGEPRINTUI]\tCConnectionManager: desctructor complete")); - } - - -// ----------------------------------------------------------------------------- -// CConnectionManager::CConnectionManager -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CConnectionManager::CConnectionManager( CImagePrintUiAppUi* aAppUi, - CDpsEngine* aEngine, CNotes* aNotes) - : CActive(EPriorityStandard), iAppUi(aAppUi), - iDpsEngine(aEngine), iActiveNote(EFalse),iSetPrintCall(EFalse), - iNotes(aNotes), iPreviousStatus(CDpsEngine::ENotConnected) - { - CActiveScheduler::Add(this); - } - - - -// ----------------------------------------------------------------------------- -// CConnectionManager::RunError -// Standard active object error function. -// ----------------------------------------------------------------------------- -// - -TInt CConnectionManager::RunError(TInt aError) - { - FTRACE(FPrint(_L("[IMAGEPRINTUI]\tCConnectionManager::RunError: ERROR %d from RunL."), aError)); - if ( aError == KErrTimedOut) - { - FLOG(_L("[IMAGEPRINTUI] CConnectionManager: Time out, start listen again")); - StartListening(); - } - else - { - FLOG(_L("[IMAGEPRINTUI] CConnectionManager RunError close application")); - iAppUi->CloseApplication(ETrue); - } - return KErrNone; - } -// ----------------------------------------------------------------------------- -// Starts search printer -// ----------------------------------------------------------------------------- -// -void CConnectionManager::StartSearchPrinter() - { - FLOG(_L("[IMAGEPRINTUI]\tCConnectionManager: StartSerchPrinter")); - iDpsEngine->SetPrintMode(iStatus); - iSetPrintCall = ETrue; - SetActive(); - FLOG(_L("[IMAGEPRINTUI]\tCConnectionManager: StartSerchPrinter complete")); - } -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CConnectionManager::RunL() - { - FLOG(_L("[IMAGEPRINTUI]>>>CConnectionManager::RunL")); - FTRACE(FPrint(_L("[IMAGEPRINTUI] CConnectionManager iStatus is %d"), iStatus.Int() )); - FTRACE(FPrint(_L("[IMAGEPRINTUI] CConnectionManager iPreviousStatus is %d"), iPreviousStatus )) - - if ( iStatus.Int() == CDpsEngine::ENotConnected ) - { - FLOG(_L("[IMAGEPRINTUI]>>>CConnectionManager::ENotConnected ")); - if(iPreviousStatus == CDpsEngine::EOtherConnected) - { - FLOG(_L("[IMAGEPRINTUI]\tCConnectionManager:: Previous was EOtherConnected, close earlier note")); - iNotes->StopShowNote(R_NOT_CONNECT_PRINTER); - } - iNotes->ShowNoteL(R_CONNECT_USB); - iActiveNote = ETrue; - iPreviousStatus = CDpsEngine::ENotConnected; - StartListening(); - - } - else if ( iStatus.Int() == CDpsEngine::EOtherConnected ) - { - FLOG(_L("[IMAGEPRINTUI]>>>CConnectionManager::EOtherConnected ")); - if(iPreviousStatus == CDpsEngine::ENotConnected) - { - FLOG(_L("[IMAGEPRINTUI]\tCConnectionManager:: Previous was ENotConnected, close earlier note")); - iNotes->StopShowNote(R_CONNECT_USB); - } - iNotes->ShowNoteL(R_NOT_CONNECT_PRINTER); - iActiveNote = ETrue; - iPreviousStatus = CDpsEngine::EOtherConnected; - StartListening(); - - } - else if (iStatus.Int() == CDpsEngine::EPrinterConnected) - { - FLOG(_L("[IMAGEPRINTUI]>>>CConnectionManager::EPrinterConnected")); - iSetPrintCall = EFalse; - if(iActiveNote) - { - FLOG(_L("[IMAGEPRINTUI]>>>CConnectionManager::Stop show note")); - iNotes->StopShowNote(R_CONNECT_USB); - iActiveNote = EFalse; - } - iPreviousStatus = CDpsEngine::EPrinterConnected; - StartListening(); - TRAPD(err, iAppUi->CableConnectedL()); - if(err) - { - // creation of some manager instance was unsuccessfull, close application - iNotes->ShowErrorMsgL(R_ERROR_GENERAL); - iAppUi->CloseApplication(EFalse); - } - } - else if ( iStatus.Int() == CDpsEngine::EPrinterDisconnected || - iStatus.Int() == CDpsEngine::EWrongPrintModeConnected ) - { - FLOG(_L("[IMAGEPRINTUI]>>>CConnectionManager::EPrinterDisconnected or EWrongPrintModeConnected")); - iAppUi->CloseApplication(ETrue); - } - - FLOG(_L("[IMAGEPRINTUI]<<ConnectStateNotify( iStatus ); - SetActive(); - FLOG(_L("[IMAGEPRINTUI]\tCConnectionManager: StartListeningL complete")); - } - - -// ----------------------------------------------------------------------------- -// CConnectionManager::DoCancel -// Standard active object cancellation function. -// ----------------------------------------------------------------------------- -// -void CConnectionManager::DoCancel() - { - FLOG(_L("[IMAGEPRINTUI]\tCConnectionManager::DoCancel")); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t tCConnectionManager iDpsEngine is %x"), iDpsEngine )); - if(!iDpsEngine) - { - FLOG(_L("[IMAGEPRINTUI]\tCConnectionManager::DpsEngine allredy destroyed, panic")); - } - else - { - iDpsEngine->CancelPrintMode(); - } - FLOG(_L("[IMAGEPRINTUI]\tCConnectionManager::DoCancel complete")); - } - - - -// End of file diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/src/emptycontainer.cpp --- a/usbuis/imageprintui/src/emptycontainer.cpp Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,169 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Empty container for UI -* -*/ - - - -//INCLUDES -#include -#include -#include -#include -#include - -#include "emptycontainer.h" -#include "imageprintuidebug.h" - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CEmptyContainer::CEmptyContainer() - { - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CEmptyContainer::ConstructL( const TRect& aRect ) - { - FLOG(_L("[IMAGEPRINTUI]\t CEmptyContainer::ConstructL")); - CreateWindowL(); - SetRect( aRect ); - - // Temporary rect is passed. Correct rect is set in SizeChanged. - iSkinContext = CAknsBasicBackgroundControlContext::NewL( - KAknsIIDQsnBgAreaMain, Rect(), EFalse); - - ActivateL(); - - FLOG(_L("[IMAGEPRINTUI]\t CEmptyContainer::ConstructL complete")); - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CEmptyContainer* CEmptyContainer::NewL( - const TRect& aRect ) - { - FLOG(_L("[IMAGEPRINTUI]\t CEmptyContainer::NewL")); - CEmptyContainer* self = CEmptyContainer::NewLC( aRect ); - CleanupStack::Pop( self ); - return self; - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CEmptyContainer* CEmptyContainer::NewLC( - const TRect& aRect ) - { - FLOG(_L("[IMAGEPRINTUI]\t CEmptyContainer::NewLC")); - - CEmptyContainer* self = new( ELeave ) CEmptyContainer; - CleanupStack::PushL( self ); - self->ConstructL( aRect ); - return self; - } - - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CEmptyContainer::~CEmptyContainer() - { - FLOG(_L("[IMAGEPRINTUI]\t CEmptyContainer::Destructor")); - delete iSkinContext; - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CEmptyContainer::Draw( const TRect& aRect ) const - { - - FLOG(_L("[IMAGEPRINTUI]\t CEmptyContainer::Draw")); - CWindowGc& gc = SystemGc(); - - // Drawing skin - if (iSkinContext) - { - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - AknsDrawUtils::Background( skin, iSkinContext, this, gc, aRect ); - } - else - {// clear the area - gc.SetBrushColor( iEikonEnv->ControlColor( EColorWindowBackground, *this ) ); - gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); - gc.Clear( aRect ); - } - - FLOG(_L("[IMAGEPRINTUI]\t CEmptyContainer::Draw complete")); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CEmptyContainer::SizeChanged() - { - FLOG(_L("[IMAGEPRINTUI]\t CEmptyContainer::SizeChanged()")); - - TRect parentRect(Rect()); - if (iSkinContext) - { - iSkinContext->SetRect(parentRect); - } - FLOG(_L("[IMAGEPRINTUI]\t CEmptyContainer::SizeChanged() complete")); - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// - void CEmptyContainer::HandleResourceChange(TInt aType) - { - if ( aType == KEikDynamicLayoutVariantSwitch ) - { - TRect rect; - // ask where container's rectangle should be - // EMainPane equals to area returned by CEikAppUi::ClientRect() - - AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, rect); - SetRect(rect); - DrawNow(); - } - else - { - CCoeControl::HandleResourceChange(aType); - } - } - -//End of File diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/src/emptyview.cpp --- a/usbuis/imageprintui/src/emptyview.cpp Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,154 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Empty view for UI -* -*/ - - -#include -#include - -#include "emptyview.h" -#include "emptycontainer.h" -#include "imageprintuidebug.h" - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// constructor -// --------------------------------------------------------------------------- -// -CEmptyView::CEmptyView() - { - } - - -// --------------------------------------------------------------------------- -// ConstructL -// --------------------------------------------------------------------------- -// -void CEmptyView::ConstructL() - { - FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::ConstructL()")); - BaseConstructL( R_EMPTY_VIEW ); - FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::ConstructL() complete")); - } - - -// --------------------------------------------------------------------------- -// NewL -// --------------------------------------------------------------------------- -// -CEmptyView* CEmptyView::NewL() - { - FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::NewL()")); - CEmptyView* self = CEmptyView::NewLC(); - CleanupStack::Pop( self ); - FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::NewL() complete")); - return self; - } - - -// --------------------------------------------------------------------------- -// NewLC -// --------------------------------------------------------------------------- -// -CEmptyView* CEmptyView::NewLC() - { - FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::NewLC()")); - CEmptyView* self = new( ELeave ) CEmptyView; - CleanupStack::PushL( self ); - self->ConstructL(); - FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::NewLC() complete")); - return self; - } - - -// --------------------------------------------------------------------------- -// destructor -// --------------------------------------------------------------------------- -// -CEmptyView::~CEmptyView() - { - FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::Destructor")); - if ( iContainer ) - { - AppUi()->RemoveFromViewStack( *this, iContainer ); - delete iContainer; - } - FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::Destructor complete")); - - } - - -// --------------------------------------------------------------------------- -// Returns the id of the view -// --------------------------------------------------------------------------- -// -TUid CEmptyView::Id() const - { - FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::Id")); - return KImagePrintEmptyViewId; - } - - -// --------------------------------------------------------------------------- -// Forwards all the commands to appUi -// --------------------------------------------------------------------------- -// -void CEmptyView::HandleCommandL( - TInt aCommand ) - { - FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::HandleCommandL")); - AppUi()->HandleCommandL( aCommand ); - FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::HandleCommandL complete")); - } - -// --------------------------------------------------------------------------- -// Creates a container and puts it to stack -// --------------------------------------------------------------------------- -// -void CEmptyView::DoActivateL( - const TVwsViewId& /*aPrevViewId*/, - TUid /*aCustomMessageId*/, - const TDesC8& /*aCustomMessage*/) - { - FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::DoActivateL")); - - iContainer = CEmptyContainer::NewL( ClientRect() ); - iContainer->SetMopParent( this ); - AppUi()->AddToStackL( *this, iContainer ); - FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::DoActivateL complete")); - } - - -// --------------------------------------------------------------------------- -// Deletes container -// --------------------------------------------------------------------------- -// -void CEmptyView::DoDeactivate() - { - FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::DoDeactivate()")); - if ( iContainer ) - { - AppUi()->RemoveFromViewStack( *this, iContainer ); - delete iContainer; - iContainer = NULL; - } - FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::DoDeactivate() complete")); - - } - -//End of File diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/src/eventmanager.cpp --- a/usbuis/imageprintui/src/eventmanager.cpp Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,395 +0,0 @@ -/* -* Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Handles DpeEventNotify call with AO -* -*/ - - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "eventmanager.h" -#include "imageprintuidebug.h" -#include "pictbridge.h" -#include "imageprintuiappui.h" - - -// --------------------------------------------------------------------------- -// constructor -// --------------------------------------------------------------------------- -// -CEventManager::CEventManager(CImagePrintUiAppUi* aAppUi, CDpsEngine* aDpsEngine) - : CActive(CActive::EPriorityStandard), iAppUi(aAppUi),iDpsEngine(aDpsEngine), - iErrorState(EFalse) - { - CActiveScheduler::Add(this); - StartListening(); - } - - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CEventManager* CEventManager::NewL(CImagePrintUiAppUi* aAppUi, CDpsEngine* aDpsEngine) - { - CEventManager* self = new( ELeave ) CEventManager(aAppUi, aDpsEngine); - return self; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CEventManager::~CEventManager() - { - Cancel(); - } - -// --------------------------------------------------------------------------- -// Start listening events -// -// --------------------------------------------------------------------------- -// -void CEventManager::StartListening() - { - FLOG(_L("[IMAGEPRINTUI]\t CEventManager::Start listening")); - iDpsEngine->DpsEventNotify(iEventRequest, iStatus); - SetActive(); - } - -// --------------------------------------------------------------------------- -// Handles situation depends on result after calling DpsEventNotify -// -// --------------------------------------------------------------------------- -// -void CEventManager::HandleReturnStatusL() - { - FLOG(_L("[IMAGEPRINTUI]>>> CEventManager; HandleReturnStatus")); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager event value is %d"), iEventRequest.iEvent )); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager iPrintStatus is %x"), iEventRequest.iPrinterEvent.iRepParam.iPrintStatus )); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager iJobStatus is %x"), iEventRequest.iPrinterEvent.iRepParam.iJobStatus )); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager iErrorStatus hex is %x"), iEventRequest.iPrinterEvent.iRepParam.iErrorStatus )); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager iJobEndReason is %x"), iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iMajor )); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager iPaperMinor is %x"), iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iPaperMinor )); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager iInkMinor is %x"), iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iInkMinor )); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager iHardMinor is %x"), iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iHardMinor )); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager iFileMinor is %x"), iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iFileMinor )); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager iDisconnectEnable is %d"), iEventRequest.iPrinterEvent.iRepParam.iDisconnectEnable )); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager iCapabilityChange is %d"), iEventRequest.iPrinterEvent.iRepParam.iCapabilityChange )); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager iNewJobOk is is %d"), iEventRequest.iPrinterEvent.iRepParam.iNewJobOk )); - - - if(iEventRequest.iEvent == EDpsEvtNotifyJobStatus) - { - FLOG(_L("[IMAGEPRINTUI]<<< CEventManager; NotifyPrintProgress")); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager iImagesPrinted is %d"), iEventRequest.iJobEvent.iRepParam.iImagesPrinted )); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager iProgress is %d"), iEventRequest.iJobEvent.iRepParam.iProgress )); - iAppUi->NotifyPrintProgress(iEventRequest.iJobEvent.iRepParam.iImagesPrinted, - iEventRequest.iJobEvent.iRepParam.iProgress); - } - - else if(iEventRequest.iEvent == EDpsEvtNotifyDeviceStatus) - { - FLOG(_L("[IMAGEPRINTUI]<<< CEventManager; HandleReturnStatus, EDpsEvtNotifyDeviceStatus")); - iAppUi->NotifyPrintStatus(iEventRequest.iPrinterEvent.iRepParam.iPrintStatus); - - HandleJobStatusL(iEventRequest.iPrinterEvent.iRepParam.iJobStatus); - - HandleErrorStatusL(iEventRequest.iPrinterEvent.iRepParam.iErrorStatus); - - if(iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iMajor == EDpsJobErrorPaper) - { - FLOG(_L("[IMAGEPRINTUI] CEventManager::EDpsJobErrorPaper")); - HandlePaperErrorL(iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iPaperMinor); - } - else if(iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iMajor == EDpsJobErrorInk) - { - FLOG(_L("[IMAGEPRINTUI] CEventManager::EDpsJobErrorInk")); - HandleInkErrorL(iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iInkMinor); - } - else if(iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iMajor == EDpsJobErrorFile) - { - FLOG(_L("[IMAGEPRINTUI] CEventManager::EDpsJobErrorFile")); - HandleFileErrorL(iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iFileMinor); - } - else if(iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iMajor == EDpsJobErrorHardware) - { - FLOG(_L("[IMAGEPRINTUI] CEventManager::EDpsJobErrorHardware")); - HandleHardwareErrorL(iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iHardMinor); - } - - if(iEventRequest.iPrinterEvent.iRepParam.iNewJobOk) - { - FLOG(_L("[IMAGEPRINTUI] CEventManager::HandleDeviceStatusL, NewJob is OK")); - iAppUi->NotifyEventL(CEventManager::ENewJobOK ); - } - //capability change - else if(iEventRequest.iPrinterEvent.iRepParam.iCapabilityChange) - { - FLOG(_L("[IMAGEPRINTUI] CEventManager::capability change")); - iAppUi->NotifyEventL(CEventManager::ECapabilityChange); - } - } - FLOG(_L("[IMAGEPRINTUI]<<< CEventManager; HandleReturnStatus, next call StartListening")); - StartListening(); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CEventManager::HandleErrorStatusL(TInt aStatus) - { - FLOG(_L("[IMAGEPRINTUI] CEventManager::HandleErrorStatusL")); - if(aStatus == EDpsErrorStatusOk) - { - FLOG(_L("[IMAGEPRINTUI] CEventManager::HandleDeviceStatusL, EDpsErrorStatusOk")); - iAppUi->NotifyEventL(CEventManager::ENotErrorState); - } - else if(aStatus == EDpsErrorStatusFatal) - { - FLOG(_L("[IMAGEPRINTUI] CEventManager::HandleDeviceStatusL, Fatal error")); - iAppUi->NotifyEventL(CEventManager::EErrorState); - - if(iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iInkMinor == EDpsInkEmpty || - iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iInkMinor == EDpsInkLow || - iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iPaperMinor == EDpsPaperJam ) - { - FLOG(_L("[IMAGEPRINTUI] CEventManager Fatal error, don't show note")); - } - else if(iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iMajor == EDpsJobErrorPaper || - iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iMajor == EDpsJobErrorInk || - iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iMajor == EDpsJobErrorHardware || - iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iMajor == EDpsJobErrorFile ) - { - FLOG(_L("[IMAGEPRINTUI] CEventManager error major, don't show note")); - } - - else - { - FLOG(_L("[IMAGEPRINTUI] CEventManager Fatal error, show note")); - iAppUi->NotifyEventL(EDpsErrorStatusFatal); - } - } - else if(aStatus == EDpsErrorStatusWarning) - { - FLOG(_L("[IMAGEPRINTUI] CEventManager::HandleDeviceStatusL, Warning")); - iAppUi->NotifyEventL(CEventManager::EErrorState); - - if(iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iMajor == EDpsJobErrorPaper || - iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iMajor == EDpsJobErrorInk || - iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iMajor == EDpsJobErrorHardware || - iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iMajor == EDpsJobErrorFile ) - { - FLOG(_L("[IMAGEPRINTUI] CEventManager warning major, don't show note")); - } - else - { - FLOG(_L("[IMAGEPRINTUI] CEventManager warning, show note")); - iAppUi->NotifyEventL(CEventManager::EWarning); - } - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CEventManager::HandleJobStatusL(TInt aStatus) - { - FLOG(_L("[IMAGEPRINTUI] CEventManager::HandleJobStatusL")); - if( aStatus == EDpsJobStatusEndedOther) - { - FLOG(_L("[IMAGEPRINTUI] CEventManager::HandleDeviceStatusL, User cancel from printer")); - iAppUi->NotifyEventL(EDpsJobStatusEndedOther); - } - - else if( aStatus == EDpsJobStatusEndedOk) - { - FLOG(_L("[IMAGEPRINTUI] CEventManager::HandleDeviceStatusL, Job ended normally")); - iAppUi->NotifyEventL(EDpsJobStatusEndedOk ); - } - else if( aStatus == EDpsJobStatusEndedAbortImmediately) - { - FLOG(_L("[IMAGEPRINTUI] CEventManager::HandleDeviceStatusL, User has abort job")); - iAppUi->NotifyEventL(EDpsJobStatusEndedAbortImmediately); - } - - } -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CEventManager::HandleHardwareErrorL(TInt aError) - { - FLOG(_L("[IMAGEPRINTUI] CEventManager::HandleHardwareErrorL")); - if( aError == EDpsHardFatal || aError == EDpsHardServiceCall || - aError == EDpsHardNotAvailable || aError == EDpsHardBusy || - aError == EDpsHardLever || aError == EDpsHardCoverOpen || - aError == EDpsHardNoMarkingHead || aError == EDpsHardInkCoverOpen || - aError == EDpsHardNoInkCartridge ) - { - FLOG(_L("[IMAGEPRINTUI]\t CEventManager::harware minor")); - iAppUi->NotifyEventL(CEventManager::EWarning); - } - else - { - FLOG(_L("[IMAGEPRINTUI] CEventManager::Hardware major")); - iAppUi->NotifyEventL(CEventManager::EShowError); - } - - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CEventManager::HandleInkErrorL(TInt aError) - { - FLOG(_L("[IMAGEPRINTUI] CEventManager::HandleInkErrorL")); - if(aError == EDpsInkEmpty) - { - FLOG(_L("[IMAGEPRINTUI] CEventManager::ink empty")); - iAppUi->NotifyEventL(CEventManager::EInkEmpty); - } - else if(aError == EDpsInkLow ) - { - FLOG(_L("[IMAGEPRINTUI] CEventManager::ink low")); - iAppUi->NotifyEventL(EDpsInkLow); - } - else if( aError== EDpsInkWaste) - { - FLOG(_L("[IMAGEPRINTUI] CEventManager::ink general")); - iAppUi->NotifyEventL(CEventManager::EWarning); - } - else - { - FLOG(_L("[IMAGEPRINTUI] CEventManager ink major, show note")); - iAppUi->NotifyEventL(CEventManager::EShowError); - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CEventManager::HandlePaperErrorL(TInt aError) - { - FLOG(_L("[IMAGEPRINTUI] CEventManager::HandlePaperErrorL")); - - if( aError == EDpsPaperLoad || aError == EDpsPaperEject || - aError == EDpsPaperMedia || aError == EDpsPaperNearlyEmpty || - aError == EDpsPaperTypeSizeNoMatch ) - { - FLOG(_L("[IMAGEPRINTUI]\t CEventManager::paperMinor, show warning")); - iAppUi->NotifyEventL(CEventManager::EWarning); - } - else if( aError == EDpsPaperJam) - { - FLOG(_L("[IMAGEPRINTUI] CEventManager::Paper jam")); - iAppUi->NotifyEventL(EDpsPaperJam); - } - else if( aError == EDpsPaperEmpty) - { - FLOG(_L("[IMAGEPRINTUI] CEventManager::Paper empty")); - iAppUi->NotifyEventL(EDpsPaperEmpty); - } - else - { - FLOG(_L("[IMAGEPRINTUI] CEventManager paper major, show note")); - iAppUi->NotifyEventL(CEventManager::EShowError); - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CEventManager::HandleFileErrorL(TInt aError) - { - FLOG(_L("[IMAGEPRINTUI] CEventManager::HandleFileErrorL")); - - if(aError == EDpsFilePrintInfo || - aError == EDpsFileDecode ) - { - FLOG(_L("[IMAGEPRINTUI] CEventManager::file minor")); - iAppUi->NotifyEventL(CEventManager::EWarning); - } - else - { - FLOG(_L("[IMAGEPRINTUI] CEventManager::file major")); - iAppUi->NotifyEventL(CEventManager::EShowError); - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CEventManager::RunError() - { - FLOG(_L("[IMAGEPRINTUI] CEventManager::RunError")); - - StartListening(); - if(iStatus.Int() == KErrTimedOut) - { - FLOG(_L("[IMAGEPRINTUI]<<< CEventManager; RunError, timed out")); - } - else if( iStatus.Int() == KErrUsbInterfaceNotReady) - { - FLOG(_L("[IMAGEPRINTUI] CEventManager::KErrUsbInterfaceNotReady")); - // iAppUi->NotifyEventL(KErrUsbInterfaceNotReady); - } - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager::RunError iStatus is is %d"), iStatus.Int() )); - // iAppUi->NotifyEventL(CEventManager::ESeriousError); - } -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CEventManager::RunL() - { - FLOG(_L("[IMAGEPRINTUI]\t CEventManager::RunL")); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager::RunL iStatus is %d"), iStatus.Int() )); - if (iStatus.Int() == KErrNone) - { - FLOG(_L("[IMAGEPRINTUI]\t CEventManager::RunL no error")); - HandleReturnStatusL(); - } - else - { - FLOG(_L("[IMAGEPRINTUI]\t CEventManager::RunL there is error in iStatus")); - User::LeaveIfError(iStatus.Int()); - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CEventManager::DoCancel() - { - FLOG(_L("[IMAGEPRINTUI]>>> CEventManager DoCancel")); - iDpsEngine->CancelDpsEventNotify(); - FLOG(_L("[IMAGEPRINTUI]>>> CEventManager DoCancel complete")); - } diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/src/imageprintuiapp.cpp --- a/usbuis/imageprintui/src/imageprintuiapp.cpp Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: S60 UI class -* -*/ - - -// INCLUDE FILES -#include -#include "imageprintuiapp.h" -#include "imageprintuidocument.h" - -// ================= MEMBER FUNCTIONS ========================================= - -// --------------------------------------------------------------------------- -// CImagePrintUiApp::AppDllUid() -// return the Uid of the application -// --------------------------------------------------------------------------- -// -TUid CImagePrintUiApp::AppDllUid() const - { - return KUidImagePrint; - } - -// --------------------------------------------------------------------------- -// CImagePrintUiApp::CreateDocumentL() -// Creates CImagePrintUiDocument object -// --------------------------------------------------------------------------- -// -CApaDocument* CImagePrintUiApp::CreateDocumentL() - { - return CImagePrintUiDocument::NewL( *this ); - } - - -// --------------------------------------------------------------------------- -// Constructs and returns an application object. -// --------------------------------------------------------------------------- -// -LOCAL_C CApaApplication* NewApplication() - { - return new CImagePrintUiApp; - } - - -// --------------------------------------------------------------------------- -// Main function of the application executable. -// --------------------------------------------------------------------------- -// -GLDEF_C TInt E32Main() - { - return EikStart::RunApplication( NewApplication ); - } - -// End of File diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/src/imageprintuiappui.cpp --- a/usbuis/imageprintui/src/imageprintuiappui.cpp Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,883 +0,0 @@ -/* -* Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: S60 AppUi class -* -*/ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -// #include - -#include -#include -#include -#include - -#include "imageprintui.hrh" -#include "imageprintuiappui.h" -#include "imageprintuidocument.h" -#include "emptyview.h" -#include "settingsview.h" -#include "imageprintuidebug.h" -#include "connectionmanager.h" -#include "capabilitymanager.h" -#include "requestmanager.h" -#include "eventmanager.h" -#include "notes.h" -#include "notetimer.h" - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// ConstructL() -// --------------------------------------------------------------------------- -// -void CImagePrintUiAppUi::ConstructL() - { - - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::ConstructL()")); - - BaseConstructL( EAknEnableSkin | EAknEnableMSK ); - iEngine = static_cast(Document())->Engine(); - - iImageFiles = new (ELeave) CDesCArrayFlat(KImageDefaultArray); - iNotes = CNotes::NewL(this); - iNoteShowed = EFalse; - LoadImagesL(); - - CAknView* emptyview = CEmptyView::NewLC(); - AddViewL(emptyview); - CleanupStack::Pop(emptyview); - - CAknView* settingsview = CSettingsView::NewLC(); - AddViewL(settingsview); - CleanupStack::Pop(settingsview); - ActivateLocalViewL( emptyview->Id() ); - - iCableConnected = EFalse; - iActiveNote = EFalse; - iNumberOfUnSuppFiles = 0; - iCapabilityChanged = EFalse; - iPrintActive = EFalse; - iErrorState = EFalse; - iStartJobOK = EFalse; - iPaperEmpty = EFalse; - iNoteTimeOut = EFalse; - iCloseTimeOut = EFalse; - iCapabilityTimeOut = EFalse; - iRequestTimeOut = EFalse; - iNoteTimer = CNoteTimer::NewL(this); - ReadNumberOfUnSuppL(); - - iConnectionManager = CConnectionManager::NewL(this, iEngine, iNotes); - iConnectionManager->StartSearchPrinter(); - - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::ConstructL() complete")); - } - - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -CImagePrintUiAppUi::~CImagePrintUiAppUi() - { - delete iNaviDecorator; - delete iCapabilityManager; - delete iRequestManager; - - delete iEventManager; - delete iConnectionManager; - - delete iNoteTimer; - delete iNotes; - delete iImageFiles; - } - - -// --------------------------------------------------------------------------- -// Handle global commands -// --------------------------------------------------------------------------- -// -void CImagePrintUiAppUi::HandleCommandL(TInt aCommand) - { - - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::HandleCommandL()")); - - // Handle global events - switch ( aCommand ) - { - case EAknSoftkeyExit: - case EAknSoftkeyBack: - case EAknCmdExit: - case EEikCmdExit: - { - Exit(); - break; - } - default: - break; - } - - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::HandleCommandL() complete")); - } - - -// --------------------------------------------------------------------------- -// Closes the application when the cable is disconnected or when some other -// mode is selected. -// --------------------------------------------------------------------------- -// -void CImagePrintUiAppUi::CloseApplication(TBool aDisconnect) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::CloseApplication")); - iNotes->SetDisconnectState(aDisconnect); - if(iPrintActive) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::CloseApplication show note")); - TRAP_IGNORE(iNotes->ShowErrorMsgL(R_ERROR_CONNECTION_LOST)); - if(!iNoteTimer->IsActive()) - iCloseTimeOut = ETrue; - iNoteTimer->After(KRetryClose); - } - else - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::CloseApplication just now")); - TRAPD(err, ProcessCommandL(EAknCmdExit)); - if(err) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::error when CloseApplication")); - } - } - - } - -// --------------------------------------------------------------------------- -// Closes the application after showing note -// --------------------------------------------------------------------------- -// -void CImagePrintUiAppUi::CloseAfterNoteL() - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::CloseAfterNoteL ")); - ProcessCommandL(EAknCmdExit); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CImagePrintUiAppUi::NotifyPrintStatus(TInt aStatus) - { - FLOG(_L("[IMAGEPRINTUI]>>> CImagePrintUiAppUi::NotifyPrintStatus ")); - FTRACE(FPrint(_L("[IMAGEPRINTUI] CImagePrintUiAppUi aStatus is %x"), aStatus )); - FTRACE(FPrint(_L("[IMAGEPRINTUI] CImagePrintUiAppUi aStatus is %d"), aStatus )); - if(aStatus == EDpsPrintServiceStatusPrinting || aStatus == EDpsPrintServiceStatusIdle) - { - FLOG(_L("[IMAGEPRINTUI]>>> CImagePrintUiAppUi::NotifyPrintStatus set flag false ")); - iPaperEmpty = EFalse; - } - if(aStatus == EDpsPrintServiceStatusPrinting) - { - FLOG(_L("[IMAGEPRINTUI]>>> CImagePrintUiAppUi::Print status active ")); - iPrintActive = ETrue; - } - if(aStatus == EDpsPrintServiceStatusIdle) - { - FLOG(_L("[IMAGEPRINTUI]>>> CImagePrintUiAppUi::Print status idle")); - iNotes->PrintProgress(KPrintFinishValue); - iPrintActive = EFalse; - } - FLOG(_L("[IMAGEPRINTUI]>>> CImagePrintUiAppUi::NotifyPrintStatus ")); - } -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CImagePrintUiAppUi::NotifyPrintProgress(TInt aImagesPrinted, TInt aProgress) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::NotifyPrintProgress")); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi aImagesPrinted value is %d"), aImagesPrinted )); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi aProgress value is %d"), aProgress )); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi iNumberOfImages value is %d"), iNumberOfImages )); - TInt realProgress; - TUint currentlayout; - - currentlayout = iCapabilityManager->Layout(); - - if(currentlayout == EDpsLayoutDefault || currentlayout == EDpsLayout1Up) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::NotifyPrintProgress progress print")); - if(iNumberOfImages == KImageNumber) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::NotifyPrintProgress layout case 1 image")); - aImagesPrinted = aImagesPrinted*KPrintFinishValue; - realProgress = aImagesPrinted/iNumberOfImages; - realProgress = (realProgress <= KPrintFinishValue) ? realProgress : KPrintFinishValue; - - if(!iErrorState) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::NotifyPrintProgress no error ")); - iNotes->PrintProgress(realProgress); - } - } - - if(iNumberOfImages > KImageNumber) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::NotifyPrintProgress one print image several images")); - if(aProgress < KPrintFinishValue) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::NotifyPrintProgress one print image several images update")); - if(!iErrorState) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::NotifyPrintProgress no error state ")); - iNotes->PrintProgress(aProgress); - } - } - - } - } - else - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::NotifyPrintProgress NumberOfImages print")); - aImagesPrinted = aImagesPrinted*KPrintFinishValue; - realProgress = aImagesPrinted/iNumberOfImages; - realProgress = (realProgress <= KPrintFinishValue) ? realProgress : KPrintFinishValue; - if(realProgress == KPrintFinishValue) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::NotifyPrintProgress printing done layout big")); - } - - if(realProgress < KPrintFinishValue) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::NotifyPrintProgress show progress layout big")); - if(!iErrorState) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::NotifyPrintProgress no error state")); - iNotes->PrintProgress(realProgress); - } - else - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::NotifyPrintProgress error state")); - } - } - - } - } - -// --------------------------------------------------------------------------- -// To inform about info from eventmanager -// --------------------------------------------------------------------------- -// -void CImagePrintUiAppUi::NotifyEventL( TInt aEventNotifyType) - { - FLOG(_L("[IMAGEPRINTUI] CImagePrintUiAppUi NotifyEvent start")); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi aEventNotifyType is %d"), aEventNotifyType )); - switch(aEventNotifyType) - { - case CEventManager::ENewJobOK: - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi >>> New job OK")); - break; - - case CEventManager::ENewJobNOK: - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi >>> New job NOK")); - iNotes->ShowErrorMsgL(R_ERROR_PRINTER_BUSY); - break; - - case CEventManager::ECapabilityChange: - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi >>> Capability change")); - TRAPD(err, iCapabilityManager->AskCapabilitiesL(ETrue)); - if(err) - { - iNotes->ShowErrorMsgL(R_ERROR_GENERAL); - } - break; - - case EDpsPaperJam: - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi Paper Jam")); - iNotes->ShowErrorMsgL(R_ERROR_PAPER_JAM); - break; - - case EDpsPaperEmpty: - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi Paper empty")); - iPaperEmpty = ETrue; - iNotes->ShowErrorMsgL(R_ERROR_OUT_OF_PAPER); - break; - - case CEventManager::EInkEmpty: - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi Ink empty")); - iNotes->PrintFinished(); - iNotes->ShowErrorMsgL(R_ERROR_OUT_OF_INK); - break; - - case EDpsInkLow: - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi Ink low")); - iNotes->ShowErrorMsgL(R_ERROR_INK_LOW); - break; - - case EDpsJobStatusEndedOther: - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi >>> User cancel from printer")); - if(iPrintActive ) - { - iNotes->PrintFinished(); - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi >>> User cancel print active")); - iPrintActive = EFalse; - } - break; - case EDpsJobStatusEndedOk: - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi >>> Job eneded normally")); - break; - - case EDpsJobStatusEndedAbortImmediately: - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi User aborted")); - break; - - case EDpsErrorStatusFatal: - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi Fatal error in printer side")); - if(iPrintActive) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi Fatal error in printer side, stop progress note")); - iNotes->PrintFinished(); - iPrintActive = EFalse; - } - iNotes->ShowErrorMsgL(R_ERROR_CHECK_STATUS); - break; - - case CEventManager::EWarning: - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi Warning in printer side")); - if(!iPaperEmpty) - { - if(iPrintActive) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi Warning in printer side, stop progress note")); - iNotes->PrintFinished(); - iPrintActive = EFalse; - } - iNotes->ShowErrorMsgL(R_ERROR_CHECK_STATUS); - } - break; - - case CEventManager::ENotErrorState: - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi, Not Error State")); - iErrorState = EFalse; - break; - - case CEventManager::EErrorState: - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi, Error State")); - iErrorState = ETrue; - break; - - case CEventManager::EShowError: - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi, EShowError")); - if(iPrintActive) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi EShowError in printer side, stop progress note")); - iNotes->PrintFinished(); - iPrintActive = EFalse; - } - iNotes->ShowErrorMsgL(R_ERROR_GENERAL); - break; - - // case KErrUsbInterfaceNotReady: - // FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi, KErrUsbInterfaceNotReady")); - // break; - - default: - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi NotifyEvent::Default branch")); - break; - } - } -// --------------------------------------------------------------------------- -// To inform about info from requestmanager -// --------------------------------------------------------------------------- -// -void CImagePrintUiAppUi::NotifyRequestL(TInt aNotifyType) - { - FLOG(_L("[IMAGEPRINTUI] CImagePrintUiAppUi NotifyRequest start")); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi aNotifyType is %d"), aNotifyType )); - switch(aNotifyType) - { - case CRequestManager::EConfigurePrintServiceOK: - FLOG(_L("[IMAGEPRINTUI]<<< CImagePrintUiAppUi NotifyRequest; EConfigurePrintServiceOK ")); - TRAPD(err, iCapabilityManager->AskCapabilitiesL(EFalse)); - if(err) - { - iNotes->ShowErrorMsgL(R_ERROR_GENERAL); - } - break; - - - case CRequestManager::EConfigurePrintServiceNOK: - //printer does not support - FLOG(_L("[IMAGEPRINTUI]<<< CImagePrintUiAppUi NotifyRequest; EConfigurePrintServiceNOK ")); - iNotes->ShowErrorMsgL(R_ERROR_UNABLE_TO_CONNECT); - break; - - case CRequestManager::EGetJobStatusOK: - FLOG(_L("[IMAGEPRINTUI]<<< CImagePrintUiAppUi NotifyRequest; EGetJobStatusOK ")); - break; - - case CRequestManager::EGetJobStatusNOK: - FLOG(_L("[IMAGEPRINTUI]<<< CImagePrintUiAppUi NotifyRequest; EGetJobStatusNOK ")); - iNotes->ShowErrorMsgL(R_ERROR_GENERAL); - break; - - case CRequestManager::EGetDeviceStatusOK: - FLOG(_L("[IMAGEPRINTUI]<<< CImagePrintUiAppUi NotifyRequest; EGetDeviceStatusOK, start print ")); - break; - - case CRequestManager::EGetDeviceStatusNOK: - // printer is busy - FLOG(_L("[IMAGEPRINTUI]<<< CImagePrintUiAppUi NotifyRequest; EGetDeviceStatusNOK ")); - iNotes->ShowErrorMsgL(R_ERROR_PRINTER_BUSY); - break; - - case CRequestManager::EStartJobOK: - //printing start ok - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::EStartJobOK")); - iPrintActive = ETrue; - iStartJobOK = ETrue; - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi EStartJobOK iPrintActiveis %d"), iPrintActive )); - break; - - case CRequestManager::EStartJobNOK: - //printing start nok - FLOG(_L("[IMAGEPRINTUI]<<< CImagePrintUiAppUi NotifyRequest; EStartJobNOK ")); - iNotes->ShowErrorMsgL(R_ERROR_GENERAL); - break; - - case CRequestManager::EAbortJobOK: - FLOG(_L("[IMAGEPRINTUI]<<< CImagePrintUiAppUi NotifyRequest; EAbortJobOK ")); - break; - - case CRequestManager::EAbortJobNOK: - iNotes->ShowErrorMsgL(R_ERROR_GENERAL); - CloseApplication(EFalse); - FLOG(_L("[IMAGEPRINTUI]<<< CImagePrintUiAppUi NotifyRequest; EAbortJobNOK ")); - break; - - case CRequestManager::EPicturesNotFound: - FLOG(_L("[IMAGEPRINTUI]<<< CImagePrintUiAppUi NotifyRequest; EPicturesNotFound ")); - iNotes->ShowErrorMsgL(R_ERROR_FILE_NOT_FOUND); - break; - - default: - FLOG(_L("[IMAGEPRINTUI]<<< CImagePrintUiAppUi NotifyRequest; Default branch")); - break; - - } - - FLOG(_L("[IMAGEPRINTUI] CImagePrintUiAppUi NotifyRequest; END ")); - } - - -// --------------------------------------------------------------------------- -// To inform number of images -// --------------------------------------------------------------------------- -// -void CImagePrintUiAppUi::NumberOfImages(TInt aNumberOfImages) - { - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t NumberOfImages iNumberOfImages is %d"), iNumberOfImages)); - iNumberOfImages = aNumberOfImages; - } - -// --------------------------------------------------------------------------- -// To handle timer timeout -// --------------------------------------------------------------------------- -// -void CImagePrintUiAppUi::HandleTimeOutL() - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi <<< HandleTimeOutL")); - if(iNoteTimeOut) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi <<< HandleTimeOutL, note")); - iNoteTimeOut = EFalse; - ShowNoteL(); - } - else if(iCloseTimeOut) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi <<< HandleTimeOutL, close")); - iCloseTimeOut = EFalse; - CloseAfterNoteL(); - } - else if(iCapabilityTimeOut) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi <<< HandleTimeOutL, capability")); - iCapabilityTimeOut = EFalse; - iCapabilityManager->AskCapabilitiesL(EFalse); - } - else if(iRequestTimeOut) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi <<< HandleTimeOutL, request")); - iRequestTimeOut = EFalse; - iRequestManager->ReIssueDoDpsRequestL(); - } - - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi >>> HandleTimeOutL")); - } - -// --------------------------------------------------------------------------- -// To handle timer error -// --------------------------------------------------------------------------- -// -void CImagePrintUiAppUi::HandleTimeErrorL(TInt aError) - { - if(iNoteTimeOut) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi <<< HandleTimeErrorL, note")); - if(aError == KErrTimedOut) - { - iNoteTimeOut = EFalse; - ShowNoteL(); - } - } - else if(iCloseTimeOut) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi <<< HandleTimeErrorL, close")); - if(aError == KErrTimedOut) - { - iCloseTimeOut = EFalse; - CloseAfterNoteL(); - } - } - else if(iCapabilityTimeOut) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi <<< HandleTimeErrorL, capability")); - if(aError == KErrTimedOut) - { - iCapabilityTimeOut = EFalse; - iCapabilityManager->AskCapabilitiesL(EFalse); - } - } - else if(iRequestTimeOut) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi <<< HandleTimeErrorL, request")); - if(aError == KErrTimedOut) - { - iRequestTimeOut = EFalse; - iRequestManager->ReIssueDoDpsRequestL(); - } - - } - - - } -// --------------------------------------------------------------------------- -// To handle request timeout -// --------------------------------------------------------------------------- -// -void CImagePrintUiAppUi::HandleRequestTime(TInt aTime) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi <<< HandleRequestTimeL")); - iRequestTimeOut = ETrue; - if(!iNoteTimer->IsActive()) - { - iNoteTimer->After(aTime); - } - } - -// --------------------------------------------------------------------------- -// To handle capability timeout -// --------------------------------------------------------------------------- -// -void CImagePrintUiAppUi::HandleCapabilityTime(TInt aTime) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi <<< HandleCapabilityTimeL")); - iCapabilityTimeOut = ETrue; - if(!iNoteTimer->IsActive()) - { - iNoteTimer->After(aTime); - } - } - -// --------------------------------------------------------------------------- -// To inform when the cable is connected -// --------------------------------------------------------------------------- -// -void CImagePrintUiAppUi::CableConnectedL() - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi <<< CableConnected")); - - iCableConnected = ETrue; - iEventManager = CEventManager::NewL(this, iEngine); - iCapabilityManager = CCapabilityManager::NewL(this, iEngine); - iRequestManager = CRequestManager::NewL(iEngine, iCapabilityManager, this); - - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi >>> CableConnected")); - } - - -// --------------------------------------------------------------------------- -// To inform when the cable is disconnected -// --------------------------------------------------------------------------- -// -void CImagePrintUiAppUi::NotifyError() - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::NotifyError")); - TRAP_IGNORE(iNotes->ShowErrorMsgL(R_ERROR_GENERAL)); - } -// --------------------------------------------------------------------------- -// To inform when the cable is disconnected -// --------------------------------------------------------------------------- -// -void CImagePrintUiAppUi::CableDisConnected() - { - iCableConnected = EFalse; - } -// --------------------------------------------------------------------------- -// CapabilityManager informs here when capabilities are fetched from dps engine -// --------------------------------------------------------------------------- -// -void CImagePrintUiAppUi::CapabilitiesReady() -{ - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::CapabilitiesReady, activate local view")); - TRAPD(err,ActivateLocalViewL(KImagePrintSettingsViewId)); - if(err) - { - TRAP_IGNORE(iNotes->ShowErrorMsgL(R_ERROR_GENERAL)); - } - - TRAPD(err2, SetNavipaneTextL()); - if(err2) - { - FLOG(_L("[IMAGEPRINTUI] CImagePrintUiAppUi::Unable to show printer name")); - } -} - - -// --------------------------------------------------------------------------- -// This is called when the user presses Options->Print -// --------------------------------------------------------------------------- -// -void CImagePrintUiAppUi::StartPrinting() - { - // get first device status, then if OK dps type start job - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi >>> StartPrinting called")); - iCapabilityManager->CheckIfNewCapabilityDiffer(); - if(iCableConnected) - { - iNotes->SetCancelState(EFalse); - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi >>> StartPrinting, cable connected")); - TRAPD(err, iRequestManager->ChooseDpsRequestTypeL(CRequestManager::EGetDeviceStatus )); - if(err) - { - TRAP_IGNORE(iNotes->ShowErrorMsgL(R_ERROR_GENERAL)); - } - } - else - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi >>> StartPrinting, cable NOT connected")); - TRAP_IGNORE(iNotes->ShowNoteL(R_CONNECT_USB)); - iActiveNote = ETrue; - } - - } - - -// --------------------------------------------------------------------------- -// This is called when the user presses Options->Cancel Print -// --------------------------------------------------------------------------- -// - -void CImagePrintUiAppUi::CancelPrinting() - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi >>> CancelPrinting BEGIN")); - TBool cancel = ETrue; - iNotes->SetCancelState(cancel); - TRAPD(err, iRequestManager->ChooseDpsRequestTypeL(CRequestManager::EAbortJob )); - if(err) - { - TRAP_IGNORE(iNotes->ShowErrorMsgL(R_ERROR_GENERAL)); - } - - - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi >>> CancelPrinting END")); - } -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CDesCArrayFlat* CImagePrintUiAppUi::ImagesToPrint() - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::ImagesToPrint()")); - FTRACE(FPrint(_L("[IMAGEPRINTUI] ImagesToPrint; iImageFiles is %x"), iImageFiles )); - return iImageFiles; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// - -void CImagePrintUiAppUi::ReadNumberOfUnSuppL() - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::ReadNumberOfUnSuppL start()")); - - TFileName unSuppFile( KResource ); - unSuppFile = PathInfo::PhoneMemoryRootPath(); - TBuf lengthUn(KUnSuppFile); - unSuppFile.SetLength(KDriver + lengthUn.Length()); - unSuppFile.Replace(KDriver, lengthUn.Length(), KUnSuppFile); - - - RFileReadStream readStream; - User::LeaveIfError( readStream.Open(CCoeEnv::Static()->FsSession(), unSuppFile, EFileRead) ); - readStream.PushL(); - iNumberOfUnSuppFiles = readStream.ReadInt16L(); - FTRACE(FPrint(_L("[IMAGEPRINTUI] CImagePrintUiAppUi iNumberOfUnSuppFiles is %d"), iNumberOfUnSuppFiles )); - CleanupStack::PopAndDestroy(&readStream); - - - if(iNumberOfUnSuppFiles < KNumberOfUnsupportedFiles) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::ReadNumberOfUnSuppL none")); - } - else if(iNumberOfUnSuppFiles == KNumberOfUnsupportedFiles || - iNumberOfUnSuppFiles > KNumberOfUnsupportedFiles) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::ReadNumberOfUnSuppL one or more")); - if(!iNoteTimer->IsActive()) - iNoteTimeOut = ETrue; - iNoteTimer->After(KRetryInterval); - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CImagePrintUiAppUi::LoadImagesL() - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::LoadImagesL()")); - - TFileName printNameFile( KResource ); - printNameFile = PathInfo::PhoneMemoryRootPath(); - TBuf length(KParamFile); - printNameFile.SetLength(KDriver + length.Length()); - printNameFile.Replace(KDriver, length.Length(), KParamFile); - - - RFileReadStream readStream; - CleanupClosePushL(readStream); //1 - User::LeaveIfError( readStream.Open(CCoeEnv::Static()->FsSession(), - printNameFile, EFileRead) ); - CAiwGenericParamList* paramList = CAiwGenericParamList::NewLC(readStream); //2 - - TInt index( 0 ); - const TAiwGenericParam* param = paramList->FindFirst(index, - EGenericParamFile, - EVariantTypeDesC); - while ( index != KErrNotFound ) - { - TFileName filename( param->Value().AsDes() ); - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::LoadImagesL; append picture")); - iImageFiles->AppendL( filename ); - - param = paramList->FindNext(index, - EGenericParamFile, - EVariantTypeDesC); - } - - CleanupStack::PopAndDestroy(paramList); - CleanupStack::PopAndDestroy(&readStream); - - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::LoadImagesL() complete")); - } - - -// --------------------------------------------------------------------------- -// Set navi pane text -// --------------------------------------------------------------------------- -// -void CImagePrintUiAppUi::SetNavipaneTextL() - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::SetNavipaneTextL Start")); - CEikStatusPane* sp = - iEikonEnv->AppUiFactory()->StatusPane(); - - CAknNavigationControlContainer* np = - static_cast( - sp->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ); - - delete iNaviDecorator; - iNaviDecorator = NULL; - - TInt blank(1); - TBuf8 printername; - TBuf8 productname; - - iRequestManager->GetPrinterName(printername, productname); - // convert to HBuf16 because CreateNavigationLabel needs TDesC16, not TDesC8 - HBufC* temp = HBufC::NewLC(printername.Length() + productname.Length() + blank); - HBufC* temp2 = HBufC::NewLC(productname.Length()); - FTRACE(FPrint(_L("[IMAGEPRINTUI] CImagePrintUiAppUi printername is %S"), &printername )); - FTRACE(FPrint(_L("[IMAGEPRINTUI] CImagePrintUiAppUi productname is %S"), &productname )); - temp->Des().Copy(printername); - temp->Des().Append(_L(" ")); - temp2->Des().Copy(productname); - temp->Des().Append(temp2->Des()); - - iNaviDecorator = np->CreateNavigationLabelL( *temp ); - CleanupStack::PopAndDestroy(temp2); - CleanupStack::PopAndDestroy(temp); - np->PushL( *iNaviDecorator ); - sp->DrawNow(); - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::SetNavipaneText END")); - } - -CCapabilityManager* CImagePrintUiAppUi::CapabilityManager() - { - return iCapabilityManager; - } - -CNotes* CImagePrintUiAppUi::Notes() - { - return iNotes; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TBool CImagePrintUiAppUi::PrintActive() - { - return iPrintActive; - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CImagePrintUiAppUi::ShowNoteL() - { - iNoteShowed = ETrue; - if(iNumberOfUnSuppFiles == KNumberOfUnsupportedFiles) - { - iNotes->ShowInfoNoteL(R_ERROR_FILE_NOT_SUPPORTED); - } - else if(iNumberOfUnSuppFiles > KNumberOfUnsupportedFiles) - { - iNotes->ShowInfoNoteL(R_ERROR_UNSUPPORTED_FILES_REMOVED); - } - } -// end of file diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/src/imageprintuidocument.cpp --- a/usbuis/imageprintui/src/imageprintuidocument.cpp Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,109 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: S60 Document class -* -*/ - - -#include "imageprintuidocument.h" -#include "imageprintuiappui.h" -#include "imageprintuidebug.h" - -#include -#include -#include - - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Default constructor -// --------------------------------------------------------------------------- -// -CImagePrintUiDocument::CImagePrintUiDocument(CEikApplication& aApp) - : CAknDocument(aApp) - { - } - -// --------------------------------------------------------------------------- -// Symbian 2nd phase constructor -// --------------------------------------------------------------------------- -// -void CImagePrintUiDocument::ConstructL() - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiDocument::ConstructL START")); - - TRAPD(err, iEngine = CDpsEngine::GetEngineL()); - if(err == KErrInUse) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiDocument::ConstructL, already in use")); - } - - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiDocument::ConstructL END")); - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CImagePrintUiDocument* CImagePrintUiDocument::NewL( CEikApplication& aApp) - { - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiDocument::NewL()")); - CImagePrintUiDocument* self = new (ELeave) CImagePrintUiDocument(aApp); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - - FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiDocument::NewL() complete")); - return self; - } - - -// --------------------------------------------------------------------------- -// Constructs CImagePrintUiAppUi -// --------------------------------------------------------------------------- -// -CEikAppUi* CImagePrintUiDocument::CreateAppUiL() - { - return new (ELeave) CImagePrintUiAppUi; - } - - -// --------------------------------------------------------------------------- -// Returns an instance of Image Print UI engine -// --------------------------------------------------------------------------- -// -CDpsEngine* CImagePrintUiDocument::Engine() - { - return iEngine; - } - - -// --------------------------------------------------------------------------- -// destructor -// --------------------------------------------------------------------------- -// -CImagePrintUiDocument::~CImagePrintUiDocument() - { - if(iEngine) - { - iEngine->Delete(); - } - } - - - -//End of File diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/src/notes.cpp --- a/usbuis/imageprintui/src/notes.cpp Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,313 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Show all notes on the screen -* -*/ - - -#include -#include - -#include "imageprintui.hrh" -#include "settingsview.h" -#include -#include -#include - - -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "settingscontainer.h" -#include "imageprintuidebug.h" -#include "imageprintuiappui.h" -#include "notes.h" - -const TUint KProgressFinishValue = 100; - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CNotes* CNotes::NewL(CImagePrintUiAppUi* aPrintUiAppUi) - { - FLOG(_L("[IMAGEPRINTUI]\t CNotes::NewL()")); - CNotes* self = new( ELeave ) CNotes(aPrintUiAppUi); - FLOG(_L("[IMAGEPRINTUI]\t CNotes::NewL() complete")); - return self; - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CNotes::~CNotes() - { - FLOG(_L("[IMAGEPRINTUI]\t CNotes::Destructor")); - if(iWaitNote) - { - FLOG(_L("[IMAGEPRINTUI]\t CNotes::Delete iWaitNote")); - delete iWaitNote; - iWaitNote = NULL; - } - if ( iProgressDialog ) - { - FLOG(_L("[IMAGEPRINTUI]\t CNotes::Delete iProgressDialog")); - delete iProgressDialog; - iProgressDialog = NULL; - } - FLOG(_L("[IMAGEPRINTUI]\t CNotes::Destructor complete")); - - } - -// --------------------------------------------------------------------------- -// Default constructor -// --------------------------------------------------------------------------- -// -CNotes::CNotes(CImagePrintUiAppUi* aPrintUiAppUi): iPrintUiAppUi(aPrintUiAppUi), - iDisconnect(EFalse ), - iCancelling(EFalse) - { - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CNotes::DialogDismissedL(TInt aButtonId ) - { - FLOG(_L("[IMAGEPRINTUI]\t CNotes::DialogDismissedL BEGIN")); - - // If user pressed cancel, cancel printing - if(iProgressDialog) - { - if(!iDisconnect) - { - FLOG(_L("[IMAGEPRINTUI]\t CNotes::DialogMissedL, not disconnect case")); - if ( aButtonId == EAknSoftkeyCancel ) - { - FLOG(_L("[IMAGEPRINTUI]\t CNotes::DialogMissedL ,sotfkey cancel iProgressDialog")); - iCancelling = ETrue; - iPrintUiAppUi->CancelPrinting(); - } - } - } - if(iWaitNote) - { - if(!iDisconnect) - { - if ( aButtonId == EAknSoftkeyCancel ) - { - FLOG(_L("[IMAGEPRINTUI]\t CNotes::DialogMissedL ,sotfkey cancel iWaitNote")); - iPrintUiAppUi->CloseApplication(EFalse); - } - } - } - - FLOG(_L("[IMAGEPRINTUI]\t CNotes::DialogDismissedL END")); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CNotes::ShowNoteL(TUint aNoteType) - { - FLOG(_L("[IMAGEPRINTUI]\t CNotes::ShowNote Start")); - if(!iWaitNote) - { - FLOG(_L("[IMAGEPRINTUI]\t CNotes::Create note")); - iWaitNote = new (ELeave) CAknWaitDialog( - (REINTERPRET_CAST(CEikDialog**,&iWaitNote)), ETrue); - FLOG(_L("[IMAGEPRINTUI]\t CNotes::ShowNoteL; Note created")); - iWaitNote->SetCallback( this ); - FLOG(_L("[IMAGEPRINTUI]\t CNotes::ShowNoteL; Callback set")); - iWaitNote->ExecuteLD(aNoteType); - FLOG(_L("[IMAGEPRINTUI]\t CNotes::ShowNoteL; ExecuteLD passed")); - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CNotes::StopShowNote(TUint /*aNoteType*/) - { - FLOG(_L("[IMAGEPRINTUI]\t CNotes::Stop note")); - delete iWaitNote; - iWaitNote = NULL; - } - - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CNotes::StartPrintingNotesL() - { - FLOG(_L("[IMAGEPRINTUI]>>> CNotes::StartPrintingNotesL")); - PrepareShowProgressNoteL(); - FLOG(_L("[IMAGEPRINTUI]<<< CNotes::StartPrintingNotesL")); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CNotes::PrepareShowProgressNoteL() - { - FLOG(_L("[IMAGEPRINTUI]>>> CNotes::PrepareShowProgressNoteL")); - HBufC* txt; - txt = StringLoader::LoadLC( R_QTN_PRINT_PROGRESS_NOTE_TITLE ); - - if(!iProgressDialog) - { - iProgressDialog = new (ELeave) CAknProgressDialog( - (reinterpret_cast (&iProgressDialog))); - } - - FLOG(_L("[IMAGEPRINTUI]<<< CNotes::PrepareShowProgressNoteL; PrepareLC next")); - iProgressDialog->PrepareLC(R_PROGRESS_NOTE); - CEikProgressInfo* progressBar = iProgressDialog->GetProgressInfoL(); // not taking ownership - FLOG(_L("[IMAGEPRINTUI]<<< CNotes::PrepareShowProgressNoteL; progressinfo got")); - - progressBar->SetFinalValue( KProgressFinishValue ); - iProgressDialog->SetTextL( *txt ); - iProgressDialog->SetCallback( this ); - FLOG(_L("[IMAGEPRINTUI]<<< CNotes::PrepareShowProgressNoteL; RunLD next")); - iProgressDialog->RunLD(); - CleanupStack::PopAndDestroy( txt ); - FLOG(_L("[IMAGEPRINTUI]<<< CNotes::PrepareShowProgressNoteL")); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CNotes::PrintProgress(TUint aProgress ) - { - FLOG(_L("[IMAGEPRINTUI]<<< CNotes::PrintProgress start ")); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CNotes PrintProgress aProgress value is %d"), aProgress )); - TInt err = KErrNone; - TRAP( err, PrintProgressL( aProgress ) ); - if ( err != KErrNone ) - { - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CNotes PrintProgress err value is %d"), err )); - TRAP_IGNORE( CNotes::ShowErrorMsgL( err ) ); - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CNotes::SetCancelState(TBool aCancel) - { - iCancelling = aCancel; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CNotes::SetDisconnectState(TBool aDisconnect) - { - iDisconnect = aDisconnect; - } - - -// --------------------------------------------------------------------------- -// Called to update the print progress -// --------------------------------------------------------------------------- -// -void CNotes::PrintProgressL(TUint aProgress ) - { - FLOG(_L("[IMAGEPRINTUI]<<< CNotes::PrintProgressL start; ")); - if( !iCancelling ) - { - if ( !iProgressDialog ) - { - FLOG(_L("[IMAGEPRINTUI]<<< CNotes::PrintProgressL call PrepareShowProgressNoteL ")); - PrepareShowProgressNoteL(); - } - CEikProgressInfo* progressBar = iProgressDialog->GetProgressInfoL(); // not taking ownership - FLOG(_L("[IMAGEPRINTUI]<<< CNotes::PrintProgressL; Update progress")); - progressBar->SetAndDraw( aProgress ); - if(aProgress == KProgressFinishValue ) - { - FLOG(_L("[IMAGEPRINTUI]<<< CNotes::PrintProgressL; normal printing finish")); - PrintFinished(); - } - } - FLOG(_L("[IMAGEPRINTUI]>>> CNotes::PrintProgressL END ")); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CNotes::ShowErrorMsgL(TUint aErrCode ) - { - if ( aErrCode != KErrNone ) - { - FLOG(_L("[IMAGEPRINTUI]>>> CNotes:Show err note ")); - HBufC* str = StringLoader::LoadLC( aErrCode ); - CAknErrorNote* note = new ( ELeave ) CAknErrorNote; - note->ExecuteLD( *str ); - CleanupStack::PopAndDestroy( str ); // str - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CNotes::ShowInfoNoteL(TInt aResourceId ) - { - HBufC* str = StringLoader::LoadLC( aResourceId ); - CAknInformationNote* note = new ( ELeave ) CAknInformationNote; - note->ExecuteLD( *str ); - CleanupStack::PopAndDestroy( str); // str - } -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CNotes::PrintFinished() - { - FLOG(_L("[IMAGEPRINTUI]<<< CNotes::PrintFinished; START")); - if ( iProgressDialog ) - { - FLOG(_L("[IMAGEPRINTUI]<<< CNotes::PrintFinished, delete progress note")); - delete iProgressDialog; - iProgressDialog = NULL; - iCancelling = EFalse; - } - } - -//End of File - - diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/src/notetimer.cpp --- a/usbuis/imageprintui/src/notetimer.cpp Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/* -* Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Handles situation after timer expired -* -*/ - - -#include "notetimer.h" -#include "imageprintuiappui.h" -#include "imageprintuidebug.h" - -CNoteTimer* CNoteTimer::NewL( CImagePrintUiAppUi* aAppUi) - { - CNoteTimer* self = CNoteTimer::NewLC( aAppUi); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CNoteTimer* CNoteTimer::NewLC( CImagePrintUiAppUi* aAppUi) - { - FLOG(_L("[IMAGEPRINTUI] CNoteTimer: NewLC")); - CNoteTimer* self = new (ELeave) CNoteTimer(); - CleanupStack::PushL(self); - self->ConstructL(aAppUi); - return self; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CNoteTimer::CNoteTimer() - : CTimer(EPriorityStandard) - { - CActiveScheduler::Add(this); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CNoteTimer::~CNoteTimer() - { - FLOG(_L("[IMAGEPRINTUI]\t CNoteTimer::Destructor start")); - Cancel(); - FLOG(_L("[IMAGEPRINTUI]\t CNoteTimer::Destructor end")); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CNoteTimer::ConstructL(CImagePrintUiAppUi* aAppUi) - { - iAppUi = aAppUi; - CTimer::ConstructL(); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CNoteTimer::RunL() - { - FLOG(_L("[IMAGEPRINTUI] CNoteTimer : RunL")); - iAppUi->HandleTimeOutL(); - } - -// ----------------------------------------------------------------------------- -// CNoteTimer::RunError -// Standard active object error function. -// ----------------------------------------------------------------------------- -// - -TInt CNoteTimer::RunError(TInt aError) - { - FTRACE(FPrint(_L("[IMAGEPRINTUI] CNoteTimer::RunError: err %d from RunL"), aError)); - - TRAPD(err,iAppUi->HandleTimeErrorL(aError)); - if(err) - { - FLOG(_L("[IMAGEPRINTUI] CNoteTimer :: err when call HandleTimeError")); - } - - return KErrNone; - } diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/src/requestmanager.cpp --- a/usbuis/imageprintui/src/requestmanager.cpp Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,519 +0,0 @@ -/* -* Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Handles Dps Request call with AO -* -*/ - - -#include -#include -#include -#include -#include -#include - -#include "requestmanager.h" -#include "imageprintuiappui.h" -#include "pictbridge.h" -#include "notes.h" -#include "capabilitymanager.h" -#include "imageprintuidebug.h" - -// --------------------------------------------------------------------------- -// constructor -// --------------------------------------------------------------------------- -// -CRequestManager::CRequestManager(CDpsEngine* aDpsEngine, - CCapabilityManager* aCapabilityManager, CImagePrintUiAppUi* aAppUi) - : CActive(CActive::EPriorityStandard), iDpsEngine(aDpsEngine), - iCapabilityManager(aCapabilityManager), iAppUi(aAppUi), iNumberOfImages(0) - { - CActiveScheduler::Add(this); - } - - -// --------------------------------------------------------------------------- -// 2nd phase construction -// --------------------------------------------------------------------------- -// - -void CRequestManager::ConstructL() - { - FLOG(_L("[IMAGEPRINTUI]>>> CRequestManager ConstructL")); - iFileExist = EFalse; - iCongFileName = HBufC::NewL(iDpsEngine->DpsFolder().Length() + KConfigLength); - iCongFileName->Des().Copy(iDpsEngine->DpsFolder()); - iCongFileName->Des().Append(KConfigInfoFile); - - // always start with configure, this is part of the DPS protocol - ChooseDpsRequestTypeL(EConfigurePrintService); - - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager ConstructL")); - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CRequestManager* CRequestManager::NewL( CDpsEngine* aDpsEngine, - CCapabilityManager* aCapabilityManager,CImagePrintUiAppUi* aAppUi) - { - CRequestManager* self = CRequestManager::NewLC( aDpsEngine, aCapabilityManager, aAppUi); - CleanupStack::Pop( self ); - return self; - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CRequestManager* CRequestManager::NewLC(CDpsEngine* aDpsEngine, - CCapabilityManager* aCapabilityManager, - CImagePrintUiAppUi* aAppUi) - { - CRequestManager* self = new( ELeave ) CRequestManager(aDpsEngine, - aCapabilityManager, aAppUi); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CRequestManager::~CRequestManager() - { - FLOG(_L("[IMAGEPRINTUI]>>> CRequestManager Destructor called")); - delete iCongFileName; - Cancel(); - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager Destructor END")); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CRequestManager::ReIssueDoDpsRequestL() - { - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager ReIssueDoDpsRequestL")); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CRequestManager::reissue request is %d"), iRequestType )); - ChooseDpsRequestTypeL(iRequestType); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CRequestManager::RunL() - { - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager RunL")); - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CRequestManager::RunL iStatus is %d"), iStatus.Int() )); - if(iStatus.Int() == KErrNone) - { - switch ( iRequestType ) - { - case EConfigurePrintService: - FLOG(_L("[IMAGEPRINTUIENGINE]\t CRequestManager: RunL, Handle configure")); - HandleConfigureL(); - break; - - case EGetJobStatus: - FLOG(_L("[IMAGEPRINTUIENGINE]\t CRequestManager: RunL, HandleGetJobStatusL")); - HandleGetJobStatusL(); - break; - - case EGetDeviceStatus: - FLOG(_L("[IMAGEPRINTUIENGINE]\t CRequestManager: RunL, Handle Device Status")); - HandleDeviceStatusL(); - break; - - case EStartJob: - FLOG(_L("[IMAGEPRINTUIENGINE]\t CRequestManager: RunL, Handle Start Job")); - HandleStartJobL(); - break; - - case EAbortJob: - FLOG(_L("[IMAGEPRINTUIENGINE]\t CRequestManager: RunL, HandleAbortL")); - HandleAbortL(); - break; - - case EContinueJob: - FLOG(_L("[IMAGEPRINTUIENGINE]\t CRequestManager: RunL, EContinueJob")); - break; - - default: - FLOG(_L("[IMAGEPRINTUIENGINE]\t CRequestManager: RunL, default branch")); - break; - } - } - else - { - FLOG(_L("[IMAGEPRINTUIENGINE]\t CRequestManager: RunL, call leave, it call RunError")); - User::LeaveIfError(iStatus.Int()); - } - FLOG(_L("[IMAGEPRINTUI]>>> CRequestManager RunL")); - } - - -// ----------------------------------------------------------------------------- -// CRequestManager::RunError -// Standard active object error function. -// ----------------------------------------------------------------------------- -// - -TInt CRequestManager::RunError(TInt aError) - { - FTRACE(FPrint(_L("[IMAGEPRINTUI] CRequestManager::RunError: err %d from RunL"), aError)); - if(aError == KErrNotFound) - { - FLOG(_L("[IMAGEPRINTUI] CRequestManager Pictures not found when printing")); - TRAPD(err,iAppUi->NotifyRequestL(EPicturesNotFound)); - if(err) - { - FLOG(_L("[IMAGEPRINTUI] CRequestManager err calling notify")); - } - } - else if(aError == KErrTimedOut || aError == KErrInUse) - { - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager; RunError, timed out or in use")); - iAppUi->HandleRequestTime(KRetryClose); - } - - return KErrNone; - } -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CRequestManager::DoCancel() - { - FLOG(_L("[IMAGEPRINTUI]>>> CRequestManager DoCancel")); - iDpsEngine->CancelDpsRequest(); - FLOG(_L("[IMAGEPRINTUI]>>> CRequestManager DoCancel complete")); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CRequestManager::ExecuteStartJobRequestL() - { - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager, ExecuteStartJobRequestL ")); - iStart.iReqParam.Reset(); - - TUint layout = iCapabilityManager->Layout(); - TUint quality = iCapabilityManager->Quality(); - TUint paperSize = iCapabilityManager->PaperSize(); - - //fill request parameter by retrieved values - TDpsArgsInt req_quality,req_papersize, req_layout; - - req_quality.iElement = EDpsArgQuality; - req_quality.iContent = quality; - iStart.iReqParam.iJobConfig.AppendL(req_quality); - - req_papersize.iElement = EDpsArgPaperSize; - req_papersize.iContent = paperSize; - iStart.iReqParam.iJobConfig.AppendL(req_papersize); - - req_layout.iElement = EDpsArgLayout; - req_layout.iContent = layout; - iStart.iReqParam.iJobConfig.AppendL(req_layout); - - - // retrieve images - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager, Get Images")); - iImageArrayFlat = iAppUi->ImagesToPrint(); // not taking ownership - - - iNumberOfImages = iImageArrayFlat->Count(); - TDpsPrintInfo* helpTDpsPrintInfo = new (ELeave) TDpsPrintInfo[iNumberOfImages]; - CleanupStack::PushL(helpTDpsPrintInfo); - // go through the list of images and add info for start job request - - for(int i=0; ioperator[](i)); - if(iFileExist) - { - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager, Start job, file exist")); - helpTDpsPrintInfo[i].iFile.Copy(iImageArrayFlat->operator[](i)); - iStart.iReqParam.iPrintInfo.AppendL(helpTDpsPrintInfo[i]); - } - } - - FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CRequestManager iNumberOfImages is %d"), iNumberOfImages)); - iAppUi->NumberOfImages(iNumberOfImages); - if(!iFileExist) - { - FLOG(_L("[IMAGEPRINTUI]>>> CRequestManager, ExecuteStartJobRequestL, file not exist ")); - iAppUi->Notes()->ShowErrorMsgL(R_ERROR_FILE_NOT_FOUND); - } - else - { - iDpsEngine->DoDpsRequestL(&iStart, iStatus); - } - - CleanupStack::PopAndDestroy(helpTDpsPrintInfo); - - - FLOG(_L("[IMAGEPRINTUI]>>> CRequestManager, ExecuteStartJobRequestL ")); - } -// --------------------------------------------------------------------------- -// Choose DoDpsRequest type -// --------------------------------------------------------------------------- -// -void CRequestManager::ChooseDpsRequestTypeL(const TRequestType aType) - { - iRequestType = aType; - switch ( aType ) - { - - case EConfigurePrintService: - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager, ChooseDpsRequestType Configure")); - iConfig.iReqParam.Reset(); - // retrieve current phone settings from DpsEngine and fill req param - iDpsEngine->GetDpsConfigL(iConfig.iReqParam); - iDpsEngine->DoDpsRequestL(&iConfig, iStatus); - break; - - - case EGetJobStatus: - // no need to fill parameter for this Dps request - iJobFinished = EFalse; - iDpsEngine->DoDpsRequestL(&iJob, iStatus); - break; - - case EGetDeviceStatus: - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager, ChooseDpsRequestType Get Device status")); - // no need to fill parameter for this Dps request - iDpsEngine->DoDpsRequestL(&iPrinter, iStatus); - break; - - case EStartJob: - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager, ChooseDpsRequestType Start Job")); - ExecuteStartJobRequestL(); - break; - - case EAbortJob: - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager, ChooseDpsRequestType Abort Job")); - // fill only abort style ref. PictBridge Spec. CIPA DC-001-2003 page 68. - iAbort.iReqParam.iAbortStyle = EDpsAbortStyleImmediately; - iDpsEngine->DoDpsRequestL(&iAbort, iStatus); - break; - - case EContinueJob: - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager, ChooseDpsRequestType Continue Job")); - // no need to fill parameter for this Dps request - iDpsEngine->DoDpsRequestL(&iContinue, iStatus); - break; - - default: - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager, ChooseDpsRequestType default branch")); - break; - } - - if(!IsActive()) // check if active, user might try to print twice which is causing collision - { - if(!iFileExist && iRequestType == EStartJob) - { - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager, ChooseDpsRequestType, file not exist")); - } - else - { - SetActive(); - } - - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CRequestManager::HandleDeviceStatusL() - { - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager HandleDeviceStatus Start")); - - if(!iPrinter.iRepParam.iNewJobOk) - { - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager,HandleDeviceStatus NOK ")); - iAppUi->NotifyRequestL(EGetDeviceStatusNOK); - } - else - { - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager,HandleDeviceStatus OK ")); - iAppUi->NotifyRequestL(EGetDeviceStatusOK); - ChooseDpsRequestTypeL(EStartJob); - } - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager HandleDeviceStatus End")); - } -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CRequestManager::HandleAbortL() - { - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager HandleAbort Start")); - if(iAbort.iResult.iMajorCode != EDpsResultOk) - { - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager HandleAbort EAbortJobNOK")); - iAppUi->NotifyRequestL(EAbortJobNOK); - } - else - { - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager HandleAbort EAbortJobOK")); - iAppUi->NotifyRequestL(EAbortJobOK); - } - - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CRequestManager::HandleStartJobL() - { - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager HandleStartJob Start")); - - if(iStart.iResult.iMajorCode == EDpsResultOk) - { - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager,HandleStartJob OK ")); - iAppUi->NotifyRequestL(EStartJobOK); - } - else - { - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager,HandleStartJob NOK ")); - iAppUi->NotifyRequestL(EStartJobNOK); - } - - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager HandleStartJob End")); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CRequestManager::HandleGetJobStatusL() - { - if(iJob.iResult.iMajorCode == EDpsResultOk) - { - iAppUi->NotifyRequestL(EGetJobStatusOK); - } - else - { - iAppUi->NotifyRequestL(EGetJobStatusNOK); - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CRequestManager::HandleConfigureL() - { - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager HandleConfigure Start")); - if(iConfig.iRepParam.iPrintAvailable == EDpsPrintServiceAvailableTrue) - { - // save name for AppUi - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager,HandleConfigure OK ")); - iVendorName = iConfig.iRepParam.iVendorName; - iProductName = iConfig.iRepParam.iProductName; - SaveConfigInfoL(); - iAppUi->NotifyRequestL(EConfigurePrintServiceOK); - - } - - else if(iConfig.iResult.iMajorCode == EDpsResultNotExecuted) - { - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager,HandleConfigure OK old session")); - ReadConfigInfoL(); - iAppUi->NotifyRequestL(EConfigurePrintServiceOK); - } - else if(iConfig.iRepParam.iPrintAvailable == EDpsPrintServiceAvailableFalse) - { - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager,HandleConfigure NOK ")); - iAppUi->NotifyRequestL(EConfigurePrintServiceNOK); - } - - iConfig.iRepParam.Reset(); - FLOG(_L("[IMAGEPRINTUI]<<< CRequestManager HandleConfigure End")); - } - -void CRequestManager::GetPrinterName(TDes8& aVendorName, TDes8& aProductName) - { - FLOG(_L("[IMAGEPRINTUI]\t CRequestManager::GetPrinterName BEGIN")); - aVendorName = iVendorName.Ptr(); - aProductName = iProductName.Ptr(); - FLOG(_L("[IMAGEPRINTUI]\t CRequestManager::GetPrinterName END")); - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// - -void CRequestManager::SaveConfigInfoL() - { - FLOG(_L("[IMAGEPRINTUI]<<< CEventManager;SaveConfigInfoL ")); - RFileWriteStream stream; - CleanupClosePushL(stream); - if((stream.Replace(CCoeEnv::Static()->FsSession(),iCongFileName->Des() ,EFileWrite)) == KErrNone) - { - ExternalizeL(stream); - } - CleanupStack::PopAndDestroy(&stream); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CRequestManager::ExternalizeL(RWriteStream& aStream) const - { - FLOG(_L("[IMAGEPRINTUI]<<< CEventManager;ExternalizeL ")); - aStream << iVendorName; - aStream << iProductName; - aStream.CommitL(); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CRequestManager::ReadConfigInfoL() - { - FLOG(_L("[IMAGEPRINTUI]\t CRequestManager::ReadConfogInfoL Sstart")); - RFileReadStream readStream; - User::LeaveIfError( readStream.Open(CCoeEnv::Static()->FsSession(), - iCongFileName->Des(), EFileRead) ); - readStream.PushL(); - readStream >> iVendorName; - readStream >> iProductName; - - CleanupStack::PopAndDestroy(&readStream); - - FLOG(_L("[IMAGEPRINTUI]\t CRequestManager::ReadConfogInfoL end")); - } - -// end of file diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/src/settingscontainer.cpp --- a/usbuis/imageprintui/src/settingscontainer.cpp Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,269 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Container class for UI -* -*/ - - - -//INCLUDES -#include -#include -#include -#include -#include -#include - - -#include "imageprintuidocument.h" -#include "imageprintuiappui.h" -#include "imageprintuiapp.h" -#include "capabilitymanager.h" -#include "imageprintui.hrh" -#include "settingscontainer.h" -#include "imageprintuidebug.h" -#include "settingsitems.h" -#include "settingstables.h" -#ifdef __SERIES60_HELP -//#include // Help id -#endif - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CSettingsContainer::CSettingsContainer() - { - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CSettingsContainer::ConstructL( const TRect& aRect, CImagePrintUiAppUi* aAppUi) - { - FLOG(_L("[IMAGEPRINTUI]\t CSettingsContainer::ConstructL")); - - CreateWindowL(); - - - // Create main itemlist - iSettingsMainListBox = new (ELeave) CAknSettingStyleListBox; - iSettingsMainListBox->SetContainerWindowL( *this ); - iSettingsMainListBox->ConstructL( this, EAknListBoxMarkableList ); - iAppUi = aAppUi; - - iSettingsItems = CSettingsItems::NewL( aAppUi->CapabilityManager(), aAppUi->Notes() ); - - // Set up/down arrows at bottom of the screen (scrollbar) - iSettingsMainListBox->CreateScrollBarFrameL( ETrue ); - iSettingsMainListBox->ScrollBarFrame()->SetScrollBarVisibilityL( - CEikScrollBarFrame::EOn, CEikScrollBarFrame::EAuto ); - - // Set up the observer (events listener) - iSettingsMainListBox->SetListBoxObserver( iSettingsItems ); - // Set text labels for list items - iSettingsMainListBox->Model()->SetItemTextArray( iSettingsItems ); - iSettingsMainListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); // Does not delete items array - - SetRect(aRect); - ActivateL(); - - FLOG(_L("[IMAGEPRINTUI]\t CSettingsContainer::ConstructL complete")); - - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CSettingsContainer* CSettingsContainer::NewL( - const TRect& aRect, CImagePrintUiAppUi* aAppUi ) - { - FLOG(_L("[IMAGEPRINTUI]\t CSettingsContainer::NewL")); - CSettingsContainer* self = CSettingsContainer::NewLC( aRect, aAppUi ); - CleanupStack::Pop( self ); - return self; - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CSettingsContainer* CSettingsContainer::NewLC( - const TRect& aRect, CImagePrintUiAppUi* aAppUi) - { - FLOG(_L("[IMAGEPRINTUI]\t CSettingsContainer::NewLC")); - - CSettingsContainer* self = new( ELeave ) CSettingsContainer; - CleanupStack::PushL( self ); - self->ConstructL( aRect, aAppUi ); - return self; - } - - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CSettingsContainer::~CSettingsContainer() - { - FLOG(_L("[IMAGEPRINTUI]\t CSettingsContainer::Destructor")); - delete iSettingsMainListBox; - delete iSettingsItems; - } - - -// --------------------------------------------------------------------------- -// From class CCoeControl -// --------------------------------------------------------------------------- -// -void CSettingsContainer::SizeChanged() - { - FLOG(_L("[IMAGEPRINTUI]\t CSettingsContainer::SizeChanged()")); - - iSettingsMainListBox->SetRect( Rect() ); - iSettingsMainListBox->SetFocus( ETrue ); - - FLOG(_L("[IMAGEPRINTUI]\t CSettingsContainer::SizeChanged() complete")); - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// - void CSettingsContainer::HandleResourceChange(TInt aType) - { - FLOG(_L("[IMAGEPRINTUI]\t CSettingsContainer::HandleResourceChange")); - CCoeControl::HandleResourceChange( aType ); - if( aType == KEikDynamicLayoutVariantSwitch ) - { - TRect mainPaneRect; - AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); - SetRect(mainPaneRect); - - DrawNow(); - } - else if ( aType == KAknsMessageSkinChange ) - { - iSettingsMainListBox->HandleResourceChange(aType); - } - - FLOG(_L("[IMAGEPRINTUI]\t CSettingsContainer::HandleResourceChange complete")); -} - - - -// --------------------------------------------------------------------------- -// Returns the number of controls inside this container -// ---------------------------------------------------------------------------- -// -TInt CSettingsContainer::CountComponentControls() const - { - FLOG(_L("[IMAGEPRINTUI]\t CSettingsContainer::CountComponentControls")); - - return KImagePrintComponentCount; - } - - -// --------------------------------------------------------------------------- -// Returns the control inside this container -// ---------------------------------------------------------------------------- -// -CCoeControl* CSettingsContainer::ComponentControl( TInt aIndex ) const - { - FLOG(_L("[IMAGEPRINTUI]\t CSettingsContainer::ComponentControl")); - - switch ( aIndex ) - { - case 0: - { - return iSettingsMainListBox; - } - default: - { - return NULL; - } - } - } - - - -// --------------------------------------------------------------------------- -// Redirects keypresses to the listbox -// ---------------------------------------------------------------------------- -// -TKeyResponse CSettingsContainer::OfferKeyEventL( - const TKeyEvent& aKeyEvent,TEventCode aType ) - { - FLOG(_L("[IMAGEPRINTUI]\t CSettingsContainer::OfferKeyEventL()")); - - if( ( iSettingsMainListBox ) && ( aKeyEvent.iCode != EKeyLeftArrow ) - && ( aKeyEvent.iCode != EKeyRightArrow ) ) - { - TKeyResponse res = iSettingsMainListBox->OfferKeyEventL( aKeyEvent, aType ); - // Store current item index for options list usage later - return res; - } - - FLOG(_L("[IMAGEPRINTUI]\t CSettingsContainer::OfferKeyEventL complete")); - - return EKeyWasNotConsumed; - - } - -// --------------------------------------------------------------------------- -// This is called by view class when user has selected Change from Options menu -// ---------------------------------------------------------------------------- -void CSettingsContainer::HandleChange() - { - FLOG(_L("[IMAGEPRINTUI]\t CSettingsContainer::HandleChange")); - TRAPD(err, iSettingsItems->HandleListBoxEventL( iSettingsMainListBox, - MEikListBoxObserver::EEventEnterKeyPressed )); - if(err) - { - FLOG(_L("[IMAGEPRINTUI]\t CSettingsContainer::error at HandleChange")); - } - FLOG(_L("[IMAGEPRINTUI]\t CSettingsContainer::HandleChange complete")); - } - - -#ifdef __SERIES60_HELP -// ----------------------------------------------------------------------------- -// From class CCoeControl -// For getting help context -// ----------------------------------------------------------------------------- -// -void CSettingsContainer::GetHelpContext( TCoeHelpContext& aContext ) const - { - /* - FLOG(_L("[IMAGEPRINTUI]\t CSettingsContainer::GetHelpContext")); - aContext.iMajor = KUidUSB; - aContext.iContext = KUSB_HLP_PRINT_SETTINGS; - FLOG(_L("[IMAGEPRINTUI]\t CSettingsContainer::GetHelpContext complete")); -*/ - } - - -#endif //__SERIES60_HELP - -//End of File - diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/src/settingsitems.cpp --- a/usbuis/imageprintui/src/settingsitems.cpp Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,317 +0,0 @@ -/* -* Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Show capabilities on the screen -* -*/ - - -#include -#include -#include - - -#include "imageprintui.hrh" -#include "settingsitems.h" -#include "settingstables.h" -#include "imageprintuidebug.h" -#include "capabilitymanager.h" -#include "notes.h" - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CSettingsItems* CSettingsItems::NewL( - CCapabilityManager* aManager, CNotes* aNotes ) - { - CSettingsItems* self = - CSettingsItems::NewLC( aManager, aNotes ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CSettingsItems* CSettingsItems::NewLC( - CCapabilityManager* aManager, CNotes* aNotes - ) - { - CSettingsItems* self = - new ( ELeave ) CSettingsItems( aManager, aNotes ); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CSettingsItems::CSettingsItems( - CCapabilityManager* aManager, CNotes* aNotes): - iCapabilityManager( aManager ), iNotes( aNotes) - { - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CSettingsItems::~CSettingsItems() - { - delete iBuffer; - delete iLayout; - delete iPaperSize; - delete iQuality; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CSettingsItems::ConstructL() - { - iBuffer = HBufC::NewL(KSettingsMaxSize); - iLayout = StringLoader::LoadL(R_USB_PRINT_LAYOUT); - iPaperSize = StringLoader::LoadL(R_USB_PRINT_PAPER_SIZE); - iQuality = StringLoader::LoadL(R_USB_PRINT_QUALITY); - } - -// --------------------------------------------------------------------------- -// From class MDesCArray. -// Return number of items in listbox -// ---------------------------------------------------------------------------- -// -TInt CSettingsItems::MdcaCount() const - { - return KNumberOfSettingsViewItems; - } - -// --------------------------------------------------------------------------- -// Creates the text string for the list box item and returns it -// ---------------------------------------------------------------------------- -// -TPtrC CSettingsItems::MdcaPointL( - TInt aIndex ) const - { - FLOG(_L("[IMAGEPRINTUI]\t CSettingsItems::MdcaPoint")); - _LIT(KImagePrintUiEmptyFormatString, " \t \t\t "); - TPtr ptr = iBuffer->Des(); - ptr.Zero(); - HBufC* temp; - ptr.Append(KTab); - switch ( aIndex ) - { - case ESettingsListItemLayout: - temp = StringLoader::LoadLC( R_USB_PRINT_LAYOUT ); - ptr.Append(temp->Des()); - CleanupStack::PopAndDestroy(temp); - GetCurrentStringL( EDpsArgLayouts, KLayoutTable, KLayoutTableCount ); - break; - - case ESettingsListItemPaperSize: - temp = StringLoader::LoadLC( R_USB_PRINT_PAPER_SIZE ); - ptr.Append(temp->Des()); - CleanupStack::PopAndDestroy(temp); - GetCurrentStringL( EDpsArgPaperSizes, KPaperSizeTable, KPaperSizeTableCount ); - break; - - case ESettingsListItemPrintQuality: - temp = StringLoader::LoadLC( R_USB_PRINT_QUALITY ); - ptr.Append(temp->Des()); - CleanupStack::PopAndDestroy(temp); - GetCurrentStringL( EDpsArgQualities, KQualityTable, KQualityTableCount ); - break; - - default: - ptr.Append(KImagePrintUiEmptyFormatString); - break; - } - FLOG(_L("[IMAGEPRINTUI]\t CSettingsItems::MdcaPoint complete")); - - return iBuffer->Des(); - } - -// --------------------------------------------------------------------------- -// Creates the text string for the list box item and returns it -// ---------------------------------------------------------------------------- -// -TPtrC CSettingsItems::MdcaPoint( - TInt aIndex ) const - { - FLOG(_L("[IMAGEPRINTUI]\t CSettingsItems::MdcaPoint")); - - TRAPD(err, *iBuffer = MdcaPointL(aIndex)); - if(err) - { - FLOG(_L("[IMAGEPRINTUI]\t CSettingsItems::MdcaPointL error")); - } - else - { - FLOG(_L("[IMAGEPRINTUI]\t CSettingsItems::MdcaPointL no error")); - } - return iBuffer->Des(); - } - - -// --------------------------------------------------------------------------- -// Creates the text string for the list box item and returns it -// ---------------------------------------------------------------------------- -// - -void CSettingsItems::GetCurrentStringL( TInt aCapability, - const TConversionTable* aTable, const TInt aTableSize ) const -{ - FLOG(_L("[IMAGEPRINTUI]\t CSettingsItems::GetCurrentStringL START")); - TPtr ptr = iBuffer->Des(); - ptr.Append(KTab); - ptr.Append(KTab); - - TInt value = iCapabilityManager->CurrentPrintSettings( aCapability ); - - HBufC* temp; - for ( TInt i = 0; i < aTableSize; i++ ) - { - if ( value == aTable[i].iCapabilityID ) - { - temp = StringLoader::LoadLC( aTable[i].iResourceID ); - ptr.Append(temp->Des()); - CleanupStack::PopAndDestroy(temp); - break; - } - } - FLOG(_L("[IMAGEPRINTUI]\t CSettingsItems::GetCurrentString END")); - -} - -// --------------------------------------------------------------------------- -// From class MEikListBoxObserver. -// Handles the list box (enter) events by launching the pop-up list -// ---------------------------------------------------------------------------- -// -void CSettingsItems::HandleListBoxEventL( - CEikListBox* aListBox, - TListBoxEvent aEventType ) - { - if (( aEventType == EEventEnterKeyPressed ) || - ( aEventType == EEventItemDoubleClicked )) //for touch support - { - switch( aListBox->CurrentItemIndex() ) - { - case ESettingsListItemLayout: - HandleEvent(EDpsArgLayouts, KLayoutTable, - KLayoutTableCount, iLayout); - break; - case ESettingsListItemPaperSize: - HandleEvent(EDpsArgPaperSizes, KPaperSizeTable, - KPaperSizeTableCount, iPaperSize); - break; - case ESettingsListItemPrintQuality: - HandleEvent(EDpsArgQualities, KQualityTable, - KQualityTableCount, iQuality); - break; - default: - FLOG(_L("[IMAGEPRINTUI]\t CSettingsItems::HandleListBoxEventL default switch")); - break; - } - - // Redraw item to the screen - // - aListBox->DrawItem( aListBox->CurrentItemIndex() ); - - } - } - - -// --------------------------------------------------------------------------- -// -// ---------------------------------------------------------------------------- -// -void CSettingsItems::HandleEventL(TInt aCapability, - const TConversionTable* aTable, const TInt aTableSize, const HBufC* aTitle ) - { - HBufC* item; - FLOG(_L("[IMAGEPRINTUI]\t CSettingsItems::HandleEvent START")); - RArray capabilityArray = iCapabilityManager->GetCapabilitiesL(aCapability); - - TInt currentItemIndex(0); - CDesCArrayFlat* items = new ( ELeave ) CDesCArrayFlat( KDefaultArrayValue ); - CleanupStack::PushL(items); - TInt j(0); - TInt helpValue(0); - TInt currentItem = iCapabilityManager->CurrentPrintSettings(aCapability); - - for(TInt i= 0; i < capabilityArray.Count(); i++ ) - { - if ( capabilityArray[i] == currentItem ) - { - currentItemIndex = i; - } - for (j=0; j< aTableSize; j++ ) - { - if ( capabilityArray[i] == aTable[j].iCapabilityID) - { - helpValue++; - item = StringLoader::LoadL(aTable[j].iResourceID); - CleanupStack::PushL(item); - items->AppendL(*item); - CleanupStack::PopAndDestroy(item); - break; - } - } - } - FTRACE(FPrint(_L("[IMAGEPRINTUI] CSettingsItems::HandleEventL helpValue is %x"), helpValue )); - // Show the setting page - - CAknRadioButtonSettingPage* dlg = - new ( ELeave ) CAknRadioButtonSettingPage( - R_USB_PRINT_MODE_SETTING_PAGE, currentItemIndex, items ); - CleanupStack::PushL(dlg); - dlg->SetSettingTextL(*aTitle); - CleanupStack::Pop(dlg); - - if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) - { - // User has made the selection. Now we need to save it to - // capabilityManager - iCapabilityManager->SetValue( aCapability, capabilityArray[currentItemIndex]); - } - CleanupStack::PopAndDestroy(items); - FLOG(_L("[IMAGEPRINTUI]\t CSettingsItems::HandleEvent END")); - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CSettingsItems::HandleEvent(TInt aCapability, - const TConversionTable* aTable, const TInt aTableSize, const HBufC* aTitle ) - { - - TRAPD(err, HandleEventL(aCapability, aTable, aTableSize, aTitle)); - if(err) - { - FLOG(_L("[IMAGEPRINTUI]\t CSettingsItems::error in HandleEvenL")); - } - else - { - FLOG(_L("[IMAGEPRINTUI]\t CSettingsItems::HandleEvent successfull")); - } - FLOG(_L("[IMAGEPRINTUI]\t CSettingsItems::HandleEvent END")); - } - -// end of file diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintui/src/settingsview.cpp --- a/usbuis/imageprintui/src/settingsview.cpp Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,205 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Settings view for UI -* -*/ - - -#include -#include -#include - -#include "imageprintui.hrh" -#include "settingsview.h" -#include "settingscontainer.h" -#include "imageprintuidebug.h" -#include "imageprintuiappui.h" - -#ifdef __SERIES60_HELP -#include // Help launcher -#endif - - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CSettingsView* CSettingsView::NewL() - { - FLOG(_L("[IMAGEPRINTUI]\t CSettingsView::NewL()")); - CSettingsView* self = CSettingsView::NewLC(); - CleanupStack::Pop( self ); - FLOG(_L("[IMAGEPRINTUI]\t CSettingsView::NewL() complete")); - return self; - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CSettingsView* CSettingsView::NewLC() - { - FLOG(_L("[IMAGEPRINTUI]\t CSettingsView::NewLC()")); - CSettingsView* self = new( ELeave ) CSettingsView; - CleanupStack::PushL( self ); - self->ConstructL(); - FLOG(_L("[IMAGEPRINTUI]\t CSettingsView::NewLC() complete")); - return self; - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CSettingsView::~CSettingsView() - { - FLOG(_L("[IMAGEPRINTUI]\t CSettingsView::Destructor")); - if ( iContainer ) - { - AppUi()->RemoveFromViewStack( *this, iContainer ); - delete iContainer; - } - FLOG(_L("[IMAGEPRINTUI]\t CSettingsView::Destructor complete")); - - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CSettingsView::CSettingsView() - { - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CSettingsView::ConstructL() - { - FLOG(_L("[IMAGEPRINTUI]\t CSettingsView::ConstructL()")); - BaseConstructL( R_SETTINGS_VIEW ); - FLOG(_L("[IMAGEPRINTUI]\t CSettingsView::ConstructL() complete")); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TUid CSettingsView::Id() const - { - FLOG(_L("[IMAGEPRINTUI]\t CSettingsView::Id")); - return KImagePrintSettingsViewId; - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CSettingsView::HandleCommandL( - TInt aCommand ) - { - FLOG(_L("[IMAGEPRINTUI]\t CSettingsView::HandleCommandL")); - - switch ( aCommand ) - { - case EAknSoftkeyExit: - { - FLOG(_L("[IMAGEPRINTUI]\t CSettingsView::Softkey exit")); - AppUi()->Exit(); - break; - } - - case EEikCmdExit: - { - FLOG(_L("[IMAGEPRINTUI]\t CSettingsView::cmd exit")); - AppUi()->Exit(); - break; - } - - #ifdef __SERIES60_HELP - case ECmdSettingsHelp: - { - HlpLauncher::LaunchHelpApplicationL( - iEikonEnv->WsSession(), AppUi()->AppHelpContextL() ); - break; - } - #endif //__SERIES60_HELP - - case ECmdSettingsPrint: - { - static_cast(AppUi() )->StartPrinting(); - break; - } - - case ECmdSettingsChange: - { - iContainer->HandleChange(); - break; - } - default: - { - FLOG( _L("[IMAGEPRINTUI]\t CSettingsView::HandleCommandL default switch")); - break; - } - - } - FLOG(_L("[IMAGEPRINTUI]\t CSettingsView::HandleCommandL complete")); - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CSettingsView::DoActivateL( - const TVwsViewId& /*aPrevViewId*/, - TUid /*aCustomMessageId*/, - const TDesC8& /*aCustomMessage*/) - { - FLOG(_L("[IMAGEPRINTUI]\t CSettingsView::DoActivateL")); - - iContainer = CSettingsContainer::NewL( ClientRect(), static_cast(AppUi() )); - iContainer->SetMopParent( this ); - AppUi()->AddToStackL( *this, iContainer ); - FLOG(_L("[IMAGEPRINTUI]\t CSettingsView::DoActivateL complete")); - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CSettingsView::DoDeactivate() - { - FLOG(_L("[IMAGEPRINTUI]\t CSettingsView::DoDeactivate()")); - if ( iContainer ) - { - AppUi()->RemoveFromViewStack( *this, iContainer ); - delete iContainer; - iContainer = NULL; - } - FLOG(_L("[IMAGEPRINTUI]\t CSettingsView::DoDeactivate() complete")); - - } - -//End of File - diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintuiprovider/data/1020E471.rss --- a/usbuis/imageprintuiprovider/data/1020E471.rss Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* -* Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ECOM plugin resource -* -*/ - - -#include -#include -#include "aiwprintingprovideruid.h" - -RESOURCE REGISTRY_INFO theInfo - { - resource_format_version = RESOURCE_FORMAT_VERSION_2; - dll_uid = KAiwPrintingProviderDllUid; - interfaces = - { - INTERFACE_INFO - { - interface_uid = KAiwClassMenu; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KAiwPrintingProviderImplUid; - version_no = 1; - display_name = "Image Print"; - default_data = "image/jpeg"; - opaque_data = KAiwCmdPrintStr; - } - }; - } - }; - } - diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintuiprovider/data/imageprintuiprovider.rss --- a/usbuis/imageprintuiprovider/data/imageprintuiprovider.rss Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* -* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for project Image Print UI Provider -* -*/ - - -NAME AWPP // Image Print UI Provider - -// INCLUDES -#include -#include -#include - -#include -#include - -/** - * Standard resource signature - */ -RESOURCE RSS_SIGNATURE { } - -RESOURCE MENU_PANE r_aiw_printing_provider_menu - { - items= - { - MENU_ITEM - { - command = KAiwCmdPrint; - txt = qtn_usb_option_printing; - } - }; - } - -RESOURCE TBUF r_usb_info_app_in_use - { - buf = qtn_usb_info_app_in_use; - } - -// End of File diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintuiprovider/group/bld.inf --- a/usbuis/imageprintuiprovider/group/bld.inf Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#include - -PRJ_PLATFORMS - -PRJ_EXPORTS -../loc/imageprintuiprovider.loc MW_LAYER_LOC_EXPORT_PATH(imageprintuiprovider.loc) -../rom/imageprintuiprovider.iby CORE_MW_LAYER_IBY_EXPORT_PATH(imageprintuiprovider.iby) -../rom/imageprintuiproviderresources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(imageprintuiproviderresources.iby) - -PRJ_MMPFILES -imageprintuiprovider.mmp diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintuiprovider/group/imageprintuiprovider.mmp --- a/usbuis/imageprintuiprovider/group/imageprintuiprovider.mmp Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ -/* -* Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: This is the project file for Image Print UI Provider -* -*/ - - -#include -#include - -TARGET imageprintuiprovider.dll - -TARGETTYPE PLUGIN -CAPABILITY CAP_GENERAL_DLL -UID 0x10009D8D 0x1020E471 -VENDORID VID_DEFAULT - - -SOURCEPATH ../src -SOURCE dllmain.cpp -SOURCE caiwprintingprovider.cpp -SOURCE caiwimageprintIf.cpp - - -USERINCLUDE ../inc -USERINCLUDE ../data - -SYSTEMINCLUDE /epoc32/include/ecom - -MW_LAYER_SYSTEMINCLUDE - - -START RESOURCE ../data/1020E471.rss -TARGET imageprintuiprovider.rsc -END - - -START RESOURCE ../data/imageprintuiprovider.rss -HEADER -TARGETPATH RESOURCE_FILES_DIR -LANGUAGE_IDS -END - - -LIBRARY euser.lib cone.lib -LIBRARY ecom.lib -LIBRARY servicehandler.lib -LIBRARY estor.lib -LIBRARY apgrfx.lib -LIBRARY apparc.lib -LIBRARY ws32.lib -LIBRARY efsrv.lib -LIBRARY bafl.lib -LIBRARY avkon.lib -LIBRARY DRMCommon.lib -LIBRARY imageconversion.lib -LIBRARY eikcdlg.lib -LIBRARY eikctl.lib -LIBRARY PlatformEnv.lib -LIBRARY CommonEngine.lib - - -DEBUGLIBRARY flogger.lib - - -#ifdef ENABLE_LOGGING -#ifdef LOG_TO_FILE -LIBRARY flogger.lib // Only in debug builds -#endif // ENABLE_LOGGING -#endif // LOG_TO_FILE - -// End of File diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintuiprovider/inc/aiwprintingprovideruid.h --- a/usbuis/imageprintuiprovider/inc/aiwprintingprovideruid.h Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: List of UIDs -* -*/ - - -#ifndef __AIFPRINTINGPROVIDERUID_H__ -#define __AIFPRINTINGPROVIDERUID_H__ - - -#define KAiwPrintingProviderDllUid 0x1020E471 -#define KAiwPrintingProviderImplUid 0x10274790 - -#endif // __AIFPRINTINGPROVIDERUID_H__ - diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintuiprovider/inc/caiwimageprintif.h --- a/usbuis/imageprintuiprovider/inc/caiwimageprintif.h Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Header file for caiwprintingif -* -*/ - - - -#ifndef __CAIWIMAGEPRINTIF_H__ -#define __CAIWIMAGEPRINTIF_H__ - -#include -#include -#include - -_LIT( KResourceFile, "resource\\imageprintuiprovider.rsc" ); - -_LIT( KParamFile, "system\\data\\T_AIW_PRINT.DAT"); -_LIT( KUnSuppFile, "system\\data\\T_AIW_UNSUPP.DAT"); -_LIT(KImagePrintUiSearchPatternBySID, "*1020e470*"); -const TInt KImagePrintUID = 0x1020E470; -const TInt KRetryInterval = 5000000; // 500 ms -const TInt KResource = 40; -const TInt KDriver = 3; - -class DRMCommon; -class CNoteTimer; - - -class CAiwImagePrintIf : public CAiwServiceIfMenu -{ - public: - - ~CAiwImagePrintIf(); - - public: - - TInt iNumberOfUnSuppFiles; - TBool iUnsupportedFiles; - CNoteTimer* iNoteTimer; - HBufC* iPrintFileName; - HBufC* iUnsuppFileName; - - - protected: - - CAiwImagePrintIf(); - - protected: // From CAiwServiceIfMenu - - TBool IsPrintingSupported( const CAiwGenericParamList& aInParamList ); - - TBool IsPrintingSupportedL( const TDesC& aFileName ); - - TBool IsProtected( const TDesC& aFileName ); - - TBool CheckMIMETypeL( const TDesC8& aMimeType, const TDesC& aFileName ); - - protected: // Implementation - void ConstructL(); - - protected: // data - - CEikonEnv& iEikEnv; //Allow CAiwPrintingProvider and CAiwPreviewProvider - //to use Eikon Environment without CEikonEnv::Static() - - private: //data - - TInt iResourceOffset; - - // Provides common DRM functions - DRMCommon* iDRM; - - -}; - -#endif \ No newline at end of file diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintuiprovider/inc/caiwprintingprovider.h --- a/usbuis/imageprintuiprovider/inc/caiwprintingprovider.h Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Header file for caiwprintingprovider -* -*/ - - - -#ifndef __CAIWPRINTINGPROVIDER_H__ -#define __CAIWPRINTINGPROVIDER_H__ - -#include -#include -#include - -#include "caiwimageprintif.h" - - -/** -* AIW provider plugin that handles print scenario. -*/ -class CAiwPrintingProvider : - public CAiwImagePrintIf, - public MAknServerAppExitObserver - { - public: //Constructors and destructors - static CAiwPrintingProvider* NewL(); - ~CAiwPrintingProvider(); - - public: // from MAknServerAppExitObserver - void HandleServerAppExit( TInt aReason ); - void StartApplicationL(); - - - private: // From CAiwServiceIfMenu - void InitialiseL(MAiwNotifyCallback& aFrameworkCallback, - const RCriteriaArray& aInterest); - - void InitializeMenuPaneL(CAiwMenuPane& aMenuPane, - TInt aIndex, - TInt aCascadeId, - const CAiwGenericParamList& aInParamList); - - void HandleServiceCmdL(const TInt& aCmdId, - const CAiwGenericParamList& aInParamList, - CAiwGenericParamList& aOutParamList, - TUint aCmdOptions = 0, - const MAiwNotifyCallback* aCallback = NULL); - - void HandleMenuCmdL(TInt aMenuCmdId, - const CAiwGenericParamList& aInParamList, - CAiwGenericParamList& aOutParamList, - TUint aCmdOptions = 0, - const MAiwNotifyCallback* aCallback = NULL); - private: - void DoHandleCmdL(TInt aMenuCmdId, - const CAiwGenericParamList& aInParamList, - CAiwGenericParamList& aOutParamList, - TUint aCmdOptions = 0, - const MAiwNotifyCallback* aCallback = NULL); - - void LaunchImagePrintApplicationL(); - TBool IsImagePrintUiRunning(); - void ShowNoteL(); - - - - private: // Data - TInt iResourceOffset; - const RCriteriaArray* iInterest; - TInt iAiwCall; - MAiwNotifyCallback* iNotifyCallback; - CAknLaunchAppService* iService; - - const CAiwGenericParamList *iConsumerInParamList; - CAiwGenericParamList *iConsumerOutParamList; - const MAiwNotifyCallback *iConsumerCallback; - }; - -#endif // __CAIWPRINTINGPROVIDER_H__ - diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintuiprovider/inc/imageprintuidebug.h --- a/usbuis/imageprintuiprovider/inc/imageprintuidebug.h Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Logging file -* -*/ - - -#ifndef IMAGEPRINTUIDEBUG_H -#define IMAGEPRINTUIDEBUG_H - -#ifdef _DEBUG - -#include -#include - -// =========================================================================== -#ifdef __WINS__ // File logging for WINS -// =========================================================================== -#define FLOG(a) { FPrint(a); } -#define FTRACE(a) { a; } - -#include -#include - -_LIT(KLogFile,"imageprintui.txt"); -_LIT(KLogDirFullName,"c:\\logs\\imageprint\\"); -_LIT(KLogDir,"imageprint"); - -// Declare the FPrint function -inline void FPrint(const TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list,aFmt); - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, - aFmt, list); - } - -// =========================================================================== -#else // RDebug logging for target HW -// =========================================================================== -#define FLOG(a) { RDebug::Print(a); } -#define FTRACE(a) { a; } - -inline void FPrint(const TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list,aFmt); - TInt tmpInt = VA_ARG(list, TInt); - TInt tmpInt2 = VA_ARG(list, TInt); - TInt tmpInt3 = VA_ARG(list, TInt); - VA_END(list); - RDebug::Print(aFmt, tmpInt, tmpInt2, tmpInt3); - } - -inline void FPrint(TRefByValue aFmt, ...) - { - - VA_LIST list; - VA_START(list, aFmt); - TBuf8<256> buf8; - buf8.AppendFormatList(aFmt, list); - - TBuf16<256> buf16(buf8.Length()); - buf16.Copy(buf8); - - TRefByValue tmpFmt(_L("%S")); - RDebug::Print(tmpFmt, &buf16); - } - -#endif //__WINS__ - -// =========================================================================== -#else // // No loggings --> Reduced binary size -// =========================================================================== -#define FLOG(a) -#define FTRACE(a) - -#endif // _DEBUG - - -#endif // IMAGEPRINTDEBUG_H - -// End of File diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintuiprovider/loc/imageprintuiprovider.loc --- a/usbuis/imageprintuiprovider/loc/imageprintuiprovider.loc Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: The localization file for user interface in Image Print UI provider -* -*/ - - -//Release 3 Localisation -//Localisation strings - -// d:Options menu item to launch Image Print UI application from the AIW -// d:consumer application e.g. from Media Gallery. -// l:list_single_pane_t1_cp2 -// r: 5.0 -#define qtn_usb_option_printing "Printing" - -// d:Application launch problem -//l:popup_note_window -#define qtn_usb_info_app_in_use "Application already in use" diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintuiprovider/rom/imageprintuiprovider.iby --- a/usbuis/imageprintuiprovider/rom/imageprintuiprovider.iby Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Image description file for project imageprintuiprovider -* -*/ - - - -#ifndef IMAGEPRINTUIPROVIDER_IBY -#define IMAGEPRINTUIPROVIDER_IBY -#ifdef __USB_PICTBRIDGE_UI -#include - -ECOM_PLUGIN(imageprintuiprovider.dll, 1020E471.rsc) - -#endif // __USB_PICTBRIDGE_UI -#endif // IMAGEPRINTUI_IBY \ No newline at end of file diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintuiprovider/rom/imageprintuiproviderresources.iby --- a/usbuis/imageprintuiprovider/rom/imageprintuiproviderresources.iby Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Language description file for project imageprintuiprovider -* -*/ - - -#ifndef __IMAGEPRINTUIPROVIDERRESOURCES_IBY__ -#define __IMAGEPRINTUIPROVIDERRESOURCES_IBY__ -#ifdef __USB_PICTBRIDGE_UI -#include - -DATA=DATAZ_\RESOURCE_FILES_DIR\imageprintuiprovider.rsc RESOURCE_FILES_DIR\imageprintuiprovider.rsc - -#endif // #ifdef __USB_PICTBRIDGE_UI -#endif // __IMAGEPRINTUIPROVIDERRESOURCES_IBY__ \ No newline at end of file diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintuiprovider/src/caiwimageprintIf.cpp --- a/usbuis/imageprintuiprovider/src/caiwimageprintIf.cpp Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,197 +0,0 @@ -/* -* Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Check if file is OK for printing -* -*/ - - - -//External includes -#include -#include -#include -#include -#include -#include -#include - -//Internal includes -#include "caiwimageprintif.h" -#include "imageprintuidebug.h" - - -_LIT8( KJpegFileType, "image/jpeg" ); -_LIT( KJpegFileType16, "image/jpeg" ); - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiwImagePrintIf::~CAiwImagePrintIf() - { - iEikEnv.FsSession().Delete(*iPrintFileName); - iEikEnv.FsSession().Delete(*iUnsuppFileName); - iEikEnv.DeleteResourceFile( iResourceOffset ); - delete iDRM; - delete iPrintFileName; - delete iUnsuppFileName; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiwImagePrintIf::CAiwImagePrintIf():iEikEnv( *CEikonEnv::Static() ) - { - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiwImagePrintIf::ConstructL() - { - - TFileName file( KResource ); - file = PathInfo::RomRootPath(); - TBuf length2(KResourceFile); - file.SetLength(KDriver + length2.Length()); - file.Replace(KDriver, length2.Length(), KResourceFile); - - BaflUtils::NearestLanguageFile( iEikEnv.FsSession(), file ); - iResourceOffset = iEikEnv.AddResourceFileL( file ); - iDRM = DRMCommon::NewL(); - User::LeaveIfError( iDRM->Connect() ); - iNumberOfUnSuppFiles = 0; - - - TFileName printNameFile( KResource ); - printNameFile = PathInfo::PhoneMemoryRootPath(); - TBuf length3(KParamFile); - printNameFile.SetLength(KDriver + length3.Length()); - printNameFile.Replace(KDriver, length3.Length(), KParamFile); - - iPrintFileName = HBufC::NewL(printNameFile.Length() ); - iPrintFileName->Des().Copy(printNameFile); - - TFileName unSuppFile( KResource ); - unSuppFile = PathInfo::PhoneMemoryRootPath(); - TBuf lengthUn(KUnSuppFile); - unSuppFile.SetLength(KDriver + lengthUn.Length()); - unSuppFile.Replace(KDriver, lengthUn.Length(), KUnSuppFile); - - iUnsuppFileName = HBufC::NewL(unSuppFile.Length() ); - iUnsuppFileName->Des().Copy(unSuppFile); - - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TBool CAiwImagePrintIf::IsPrintingSupported( const CAiwGenericParamList& aInParamList ) - { - TInt index(0); - FLOG(_L("[CAiwImagePrintIf] IsPrintingSupported ")); - const TAiwGenericParam* param = aInParamList.FindFirst( index, EGenericParamMIMEType ); - TBool printable( EFalse ); - - if ( index == KErrNotFound ) - { - index = 0; - const TAiwGenericParam* param = aInParamList.FindFirst(index, EGenericParamFile, EVariantTypeDesC); - - //Check if there is any printable images available. At least image must be - //JPEG and it also must be unprotected to be printable. - while ( index != KErrNotFound && !printable) - { - FLOG(_L("[CAiwImagePrintIf] IsPrintingSupported 3")); - TRAP_IGNORE( printable = IsPrintingSupportedL( param->Value().AsDes() )); - param = aInParamList.FindNext(index, EGenericParamFile, EVariantTypeDesC); - } - FTRACE(FPrint(_L("[CAiwImagePrintIf] IsPrintingSupported printable is %d"), printable )); - return printable; - } - - while ( index != KErrNotFound && !printable ) - { - if ( param->Value().TypeId() == EVariantTypeDesC && - param->Value().AsDes() == KJpegFileType16 ) - { - // MIME-type parameter follows filename parameter in parameter list. - // Because of that previous item in list is used. - if (index > 0) - { - FLOG(_L("[CAiwImagePrintIf] IsPrintingSupported 5")); - printable = !IsProtected( aInParamList[index-1].Value().AsDes() ); - } - } - - if ( !printable ) - { - param = aInParamList.FindNext(index, EGenericParamMIMEType); - } - } - FTRACE(FPrint(_L("[CAiwImagePrintIf] IsPrintingSupported 2 printable is %d"), printable )); - return printable; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TBool CAiwImagePrintIf::IsPrintingSupportedL( const TDesC& aFileName ) - { - //1. check: Mimetype should be correct (JPEG) - FLOG(_L("[CAiwImagePrintIf] IsPrintingSupported TBool 1")); - TBool printable = CheckMIMETypeL( KJpegFileType, aFileName ); - - if (printable) - { - //2. check: file should not be protected - printable = !IsProtected( aFileName ); - } - FTRACE(FPrint(_L("[CAiwImagePrintIf] IsPrintingSupportedL TBool printable is %d"), printable )); - return printable; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TBool CAiwImagePrintIf::IsProtected( const TDesC& aFileName ) - { - TBool fileProtect; - TInt err = iDRM->IsProtectedFile( aFileName, fileProtect ); - FTRACE(FPrint(_L("[CAiwImagePrintIf] IsProtected retVal is %d"), err ? ETrue : fileProtect )); - return err ? ETrue : fileProtect; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TBool CAiwImagePrintIf::CheckMIMETypeL( const TDesC8& aMimeType, - const TDesC& aFileName ) - { - TBuf8<128> mimeType(0); - CImageDecoder::GetMimeTypeFileL(iEikEnv.FsSession(), aFileName, mimeType); - - // Check that MIME-type matches (compare returns 0), otherwise return EFalse - FTRACE(FPrint(_L("[CAiwImagePrintIf] CheckMIMETypeL retVal is %d"), mimeType.CompareF( aMimeType ) ? EFalse : ETrue )); - return mimeType.CompareF( aMimeType ) ? EFalse : ETrue; - } - -// End of file diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintuiprovider/src/caiwprintingprovider.cpp --- a/usbuis/imageprintuiprovider/src/caiwprintingprovider.cpp Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,314 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Launch Image Print App when file is marked or open MG -* -*/ - - - -#include "caiwprintingprovider.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "caiwimageprintif.h" -#include "imageprintuidebug.h" - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiwPrintingProvider* CAiwPrintingProvider::NewL() - { - - CAiwPrintingProvider* self = new( ELeave ) CAiwPrintingProvider; - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiwPrintingProvider::~CAiwPrintingProvider() - { - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiwPrintingProvider::InitialiseL( MAiwNotifyCallback& aFrameworkCallback, - const RCriteriaArray& /*aInterest*/ ) - { - iNotifyCallback = &aFrameworkCallback; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiwPrintingProvider::HandleServiceCmdL( const TInt& aCmdId, - const CAiwGenericParamList& aInParamList, - CAiwGenericParamList& aOutParamList, - TUint aCmdOptions, - const MAiwNotifyCallback* aCallback ) - - { - FLOG(_L("[CAiwPrintingProvider]<<< HandleServiceCmdL BEGIN")); - DoHandleCmdL( aCmdId, aInParamList, aOutParamList, aCmdOptions, aCallback ); - FLOG(_L("[CAiwPrintingProvider]<<< HandleServiceCmdL END")); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiwPrintingProvider::InitializeMenuPaneL - ( CAiwMenuPane& aMenuPane, TInt aIndex, - TInt /*aCascadeId*/, const CAiwGenericParamList& aInParamList ) - { - FLOG(_L("[CAiwPrintingProvider]<<< InitializeMenuPaneL BEGIN")); - if ( IsPrintingSupported( aInParamList ) ) - { - TResourceReader reader; - iEikEnv.CreateResourceReaderLC - ( reader, R_AIW_PRINTING_PROVIDER_MENU ); - aMenuPane.AddMenuItemsL( reader, KAiwCmdPrint, aIndex ); - CleanupStack::PopAndDestroy(); // aResourceId - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiwPrintingProvider::HandleMenuCmdL - ( TInt aMenuCmdId, const CAiwGenericParamList& aInParamList, - CAiwGenericParamList& aOutParamList, TUint aCmdOptions, - const MAiwNotifyCallback* aCallback) - { - FLOG(_L("[CAiwPrintingProvider]<<< HandleMenuCmdL BEGIN")); - DoHandleCmdL( aMenuCmdId, aInParamList, aOutParamList, aCmdOptions, aCallback ); - FLOG(_L("[CAiwPrintingProvider]<<< HandleMenuCmdL END")); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiwPrintingProvider::DoHandleCmdL(TInt aMenuCmdId, - const CAiwGenericParamList& aInParamList, - CAiwGenericParamList& aOutParamList, - TUint /*aCmdOptions*/, - const MAiwNotifyCallback* aCallback) - { - if ( aMenuCmdId == KAiwCmdPrint || aMenuCmdId == KAiwCmdPrintPreview ) - { - FLOG(_L("[CAiwPrintingProvider]<<< DoHandleCmdL")); - - CAiwGenericParamList* checkedParams = CAiwGenericParamList::NewL(); - - iConsumerInParamList = &aInParamList; - iConsumerOutParamList = &aOutParamList; - iConsumerCallback = aCallback; - - TInt index( 0 ); - const TAiwGenericParam* param = aInParamList.FindFirst(index, - EGenericParamFile, - EVariantTypeDesC); - while ( index != KErrNotFound ) - { - TFileName filename( param->Value().AsDes() ); - TInt err = KErrNone; - TBool result = EFalse; - TRAP( err, result = IsPrintingSupportedL( filename ) ); - if ( err == KErrNone && result ) - { - FLOG(_L("[CAiwPrintingProvider] DoHandleCmdL; supported file")); - checkedParams->AppendL(*param); - } - else - { - FLOG(_L("[CAiwPrintingProvider] DoHandleCmdL; not supported")); - ++iNumberOfUnSuppFiles; - iUnsupportedFiles = ETrue; - } - param = aInParamList.FindNext(index, - EGenericParamFile, - EVariantTypeDesC); - } - - - FTRACE(FPrint(_L("[CAiwPrintingProvider] UnSuppFiles is %d"), iNumberOfUnSuppFiles )); - - RFileWriteStream stream; - CleanupClosePushL(stream); - if((stream.Replace(iEikEnv.FsSession(), *iUnsuppFileName ,EFileWrite)) == KErrNone) - { - stream.WriteInt16L(iNumberOfUnSuppFiles); - stream.CommitL(); - } - CleanupStack::PopAndDestroy(&stream); - - FLOG(_L("[IMAGEPRINTUI]<<< CAiwPrintingProvider;Save iUnsupportedFiles is done")); - - - RFileWriteStream writeStream; - User::LeaveIfError( writeStream.Replace(iEikEnv.FsSession(), - *iPrintFileName , EFileWrite) ); - writeStream.PushL(); - checkedParams->ExternalizeL(writeStream); - writeStream.CommitL(); - CleanupStack::PopAndDestroy( &writeStream ); - - iNumberOfUnSuppFiles = 0; - delete checkedParams; - checkedParams = NULL; - - LaunchImagePrintApplicationL(); - FLOG(_L("[CAiwPrintingProvider]>>> DoHandleCmdL ")); - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiwPrintingProvider::StartApplicationL() - { - FLOG(_L("[CAiwPrintingProvider] StartApplicationL")); - LaunchImagePrintApplicationL(); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// - -TBool CAiwPrintingProvider::IsImagePrintUiRunning() - { - TFindThread findt(KImagePrintUiSearchPatternBySID); - TFullName result; - TBool running(EFalse); - if (!findt.Next(result)) - { - FTRACE(FPrint(_L("[CAiwPrintingProvider] Thread '%S'is found"), &result)); - running = ETrue; - } - return running; - } -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiwPrintingProvider::ShowNoteL() - { - FLOG(_L("[CAiwPrintingProvider]>>> App launch error ")); - HBufC* str = StringLoader::LoadLC( R_USB_INFO_APP_IN_USE ); - CAknErrorNote* note = new ( ELeave ) CAknErrorNote; - note->ExecuteLD( *str ); - CleanupStack::PopAndDestroy( str ); // str - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiwPrintingProvider::LaunchImagePrintApplicationL() - { - FLOG(_L("[CAiwPrintingProvider]<<< LaunchImagePrintApplicationL")); - TUid appuid; - appuid.iUid = KImagePrintUID; - if (!IsImagePrintUiRunning()) - { - TRAPD( err, iService = CAknLaunchAppService::NewL( - appuid, - this, - NULL )); - - if ( err != KErrNone ) - { - FTRACE(FPrint(_L("[CAiwPrintingProvider] error when launch is %d"), err )); - FLOG(_L("[CAiwPrintingProvider] LaunchImagePrintApplicationL error")); - } - } - else - { - ShowNoteL(); - } - - FLOG(_L("[CAiwPrintingProvider]>>> LaunchImagePrintApplicationL")); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiwPrintingProvider::HandleServerAppExit( TInt aReason ) - { - delete iService; - iService = NULL; - FLOG(_L("[CAiwPrintingProvider]<<< HandleServerAppExit")); - - // In the case that we want to exit also the parent application, - // ImagePrint is exited with User::Exit() which is seen here as - // KErrServerTerminated (-15). - if( iConsumerInParamList && iConsumerOutParamList && iConsumerCallback && iConsumerCallback ) - { - // Const cast is used to fix weirdness in AIW header files. MWaiNotifyCallback - // does not define any const function but CAiwServiceIfMenu interface provides - // const callback object. - TRAP_IGNORE( const_cast(iConsumerCallback)->HandleNotifyL( - KAiwCmdPrintPreview, KAiwEventCompleted, - *iConsumerOutParamList, *iConsumerInParamList )); - iConsumerInParamList = NULL; - iConsumerOutParamList = NULL; - iConsumerCallback = NULL; - } - if ( aReason == KErrServerTerminated ) - { - FLOG(_L("[CAiwPrintingProvider] HandleServerAppExit KErrServerTerminated")); - } - } - -// End of file - diff -r 3592750162a5 -r 2dc695882abd usbuis/imageprintuiprovider/src/dllmain.cpp --- a/usbuis/imageprintuiprovider/src/dllmain.cpp Wed Oct 13 13:08:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Ecom plugin info for provider -* -*/ - - - - -/// INCLUDES -#include -#include -#include "aiwprintingprovideruid.h" -#include "caiwprintingprovider.h" - - -// Define the interface UIDs -const TImplementationProxy ImplementationTable[] = - { - - IMPLEMENTATION_PROXY_ENTRY(KAiwPrintingProviderImplUid, - CAiwPrintingProvider::NewL), - }; - -// The one and only exported function that is the ECom entry point -EXPORT_C const TImplementationProxy* ImplementationGroupProxy - (TInt& aTableCount) - { - aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); - return ImplementationTable; - } - -#ifndef EKA2 -/** - * Standard Symbian OS DLL entry point. - */ -TBool E32Dll(TDllReason) - { - return ETrue; - } -#endif - diff -r 3592750162a5 -r 2dc695882abd usbuis/usbuinotif/usbuinotif.pro --- a/usbuis/usbuinotif/usbuinotif.pro Wed Oct 13 13:08:34 2010 +0300 +++ b/usbuis/usbuinotif/usbuinotif.pro Mon Oct 25 13:20:29 2010 +0300 @@ -19,9 +19,9 @@ defBlock = \ "$${LITERAL_HASH}if defined(EABI)" \ - "DEFFILE .\eabi/usbavkonnotif.def" \ + "DEFFILE ./eabi/usbavkonnotif.def" \ "$${LITERAL_HASH}else" \ - "DEFFILE .\BWINS/usbavkonnotif.def" \ + "DEFFILE ./BWINS/usbavkonnotif.def" \ "$${LITERAL_HASH}endif" MMP_RULES += defBlock