--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/data/directprintapp.loc Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,242 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// LOCALISATION STRINGS
+
+// Caption string for app.
+#define text_directprint_captionstring "DirectPrint"
+
+#define text_directprint_loc_resource_file "\\resource\\apps\\directprintapp"
+
+#define text_directprint_setting_directory "c:\\system\\data\\"
+#define text_directprint_setting_file "c:\\system\\data\\directprintsetting.dat"
+
+// Menu item string
+#define text_directprint_menu_item_help "Help"
+#define text_directprint_menu_item_about "About"
+#define text_directprint_menu_item_exit "Back"
+
+// About dialog
+#define text_directprint_about_dialog_title "About"
+#define text_directprint_about_dialog_text "DirectPrintApp Version 1.0.0\n\nAuthor: K3"
+
+// error message
+#define text_directprint_msg_print_in_use "Print in use"
+#define text_directprint_msg_param_incorrect "Incorrect parameter"
+#define text_directprint_msg_param_file_not_found "File not found"
+#define text_directprint_msg_bearer_open_err "Bearer open error [%d]"
+#define text_directprint_msg_submit_print_err "Printing failed [%d]"
+#define text_directprint_msg_preview_err "Preview failed"
+
+// progress message
+#define text_directprint_printing_progress "Printing... %d/%d"
+#define text_directprint_searching_progress "Searching..."
+
+// information message
+#define text_directprint_msg_now_printing "Now printing"
+
+// Global menu item
+#define text_directprint_menu_print "Print"
+#define text_directprint_menu_preview "Preview"
+#define text_directprint_menu_change "Change"
+
+#define text_directprint_toolbar_print "Print"
+#define text_directprint_toolbar_preview "Preview"
+
+#define text_directprint_mainview_title "Print"
+#define text_directprint_mainview_menu_propertysetting "Property settings"
+#define text_directprint_mainview_menu_exit "Exit"
+#define text_directprint_mainview_toolbar_propertysetting "Property"
+#define text_directprint_mainview_item_printername "Printer Name"
+#define text_directprint_mainview_item_bearer "Bearer"
+#define text_directprint_mainview_item_propertysettings "Property Settings"
+
+#define text_directprint_printerlist_title "Printer list"
+#define text_directprint_printerlist_menu_search "Search"
+#define text_directprint_printerlist_menu_new "New"
+#define text_directprint_printerlist_menu_edit "Edit"
+#define text_directprint_printerlist_menu_delete "Delete"
+
+#define text_directprint_printersearch_title "Printer search"
+#define text_directprint_searchresult_menu_search "Search"
+
+#define text_directprint_printersetting_title "Printer settings"
+#define text_directprint_printersetting_item_printername "Printer name"
+#define text_directprint_printersetting_item_driver "Driver"
+#define text_directprint_printersetting_item_bearer "Bearer"
+#define text_directprint_printersetting_item_accesspoint "Access point"
+#define text_directprint_printersetting_item_host "Host"
+#define text_directprint_printersetting_item_port "Port"
+#define text_directprint_printersetting_item_username "User name"
+#define text_directprint_printersetting_item_que "Que"
+#define text_directprint_printersetting_item_type "Type"
+
+#define text_directprint_propertysetting_title "Property settings"
+#define text_directprint_propertysetting_tab_paper "Paper"
+#define text_directprint_propertysetting_tab_page "Page"
+#define text_directprint_propertysetting_tab_margin "Margin"
+#define text_directprint_propertysetting_tab_header "Header"
+#define text_directprint_propertysetting_tab_footer "Footer"
+#define text_directprint_propertysetting_item_papersize "Paper Size"
+#define text_directprint_propertysetting_item_orientation "Orientation"
+#define text_directprint_propertysetting_item_mediatype "Media type"
+#define text_directprint_propertysetting_item_printpage "Print page"
+#define text_directprint_propertysetting_item_printrange "Print range"
+#define text_directprint_propertysetting_item_copy "Number of copies"
+#define text_directprint_propertysetting_item_leftmargin "Margin from left"
+#define text_directprint_propertysetting_item_rightmargin "Margin from right"
+#define text_directprint_propertysetting_item_topmargin "Margin from top"
+#define text_directprint_propertysetting_item_bottommargin "Margin from bottom"
+#define text_directprint_propertysetting_item_headertext "Header text"
+#define text_directprint_propertysetting_item_headerdistance "Distance from top"
+#define text_directprint_propertysetting_item_headerfirstpage "Include on first page"
+#define text_directprint_propertysetting_item_footertext "Footer text"
+#define text_directprint_propertysetting_item_footerdistance "Distance from bottom"
+#define text_directprint_propertysetting_item_footerfirstpage "Include on first page"
+#define text_directprint_propertysetting_item_boaderless "Boaderless"
+
+#define text_directprint_orientation_portrate "Portrate"
+#define text_directprint_orientation_landscape "Landscape"
+
+#define text_directprint_range_all "All"
+#define text_directprint_range_odd "Odd"
+#define text_directprint_range_even "Even"
+
+#define text_directprint_yes "Yes"
+#define text_directprint_no "No"
+
+#define text_directprint_previewview_title "Preview"
+#define text_directprint_previewview_expand "Expand"
+#define text_directprint_previewview_reduce "Reduce"
+
+
+
+
+
+// ----------------------------------------------------------------------------
+//
+// For directprint engine
+//
+// ----------------------------------------------------------------------------
+//
+//
+
+// d:Paper size capability presented in the list box in print settings view
+// l:list_setting_pane_t1
+#define qtn_print_settings_paper_size "Paper size"
+
+// d:Paper size "Automatic" in the print settings view settings value
+// l:list_set_graphic_pane_t1
+#define qtn_print_paper_size_auto "Automatic"
+
+// d:Paper size "US Letter" in the print settings view list box / pop-up window
+// l:list_set_graphic_pane_t1
+#define qtn_print_paper_size_letter "US Letter"
+
+// d:Paper size "A4" in the print settings view list box / pop-up window
+// l:list_set_graphic_pane_t1
+#define qtn_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
+#define qtn_print_paper_size_a6 "A6"
+
+// d:Paper size "4x6" in the print settings view list box / pop-up window
+// d:4x6 means paper size of 4 inches by 6 inches. This needs to be converted
+// d:in country localizations that use metric system
+// l:list_set_graphic_pane_t1
+#define qtn_print_paper_size_4x6 "4x6"
+
+// d:Paper size "5x7" in the print settings view list box / pop-up window
+// d:5x7 means paper size of 5 inches by 7 inches. This needs to be converted
+// d:in country localizations that use metric system
+// l:list_set_graphic_pane_t1
+#define qtn_print_paper_size_5x7 "5x7"
+
+// d:Paper size "Sticker" in the print settings view list box / pop-up window
+// l:list_set_graphic_pane_t1
+#define qtn_print_paper_size_sticker "Sticker"
+
+// d:Print quality capability presented in the list box in print settings view
+// l:list_setting_pane_t1
+#define qtn_print_settings_print_quality "Print quality"
+
+// d:Print quality "Automatic" in the print settings view list box / pop-up window
+// l:list_set_graphic_pane_t1
+#define qtn_print_quality_auto "Automatic"
+
+// d:Print quality "Normal" in the print settings view list box / pop-up window
+// l:list_set_graphic_pane_t1
+#define qtn_print_quality_normal "Normal"
+
+// d:Print quality "Draft" in the print settings view list box / pop-up window
+// l:list_set_graphic_pane_t1
+#define qtn_print_quality_draft "Draft"
+
+// d:Print quality "Fine" in the print settings view list box / pop-up window
+// l:list_set_graphic_pane_t1
+#define qtn_print_quality_fine "Fine"
+
+// d:Template capability as settings item in settings view
+// l:list_setting_pane_t1
+#define qtn_print_settings_template "Images per page"
+
+// d:Template 1 per page "1 borderless" in the print settings view list box / pop-up window
+// l:list_set_graphic_pane_t1
+#define qtn_print_settings_bless "1 borderless"
+
+// d:Default printer "PictBridge" in the print settings view list box / pop-up window
+// l:list_set_graphic_pane_t1
+#define qtn_print_settings_default_usb "PictBridge"
+
+// d:Default printer "Bluetooth" in the print settings view list box / pop-up window
+// l:list_set_graphic_pane_t1
+#define qtn_print_settings_default_bt "Bluetooth"
+
+// d:Default printer "WLAN printer" in the print settings view list box / pop-up window
+// l:list_set_graphic_pane_t1
+#define qtn_print_settings_default_wlan "WLAN printer"
+
+// d:Default printer "LPR printer" in the print settings view list box / pop-up window
+// l:list_set_graphic_pane_t1
+#define qtn_print_settings_default_lpr "LPR"
+
+// d:Text on the device discovery pop-up list
+// l:list_single_large_graphic_pane_t1_cp2/opt1
+#define qtn_print_memory_card "Memory card"
+
+// d: Text when there is no printer selected in settings view
+// l: list_set_graphic_pane_t1
+// r: 6.2
+#define qtn_print_no_printer "No printer"
+
+#define qtn_print_settings_accesspoint "Access point"
+#define qtn_print_settings_host "Host"
+#define qtn_print_settings_port "Port"
+#define qtn_print_settings_user "User name"
+#define qtn_print_settings_que "Que"
+
+#define qtn_print_settings_extent "Extent Item"
+#define qtn_print_settings_extent2 "Extent Item2"
+#define qtn_print_settings_extent_select1 "Select1"
+#define qtn_print_settings_extent_select2 "Select2"
+#define qtn_print_settings_extent_select3 "Select3"
+#define qtn_print_settings_extent_select4 "Select4"
+
+
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/data/directprintapp.rss Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,1740 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// RESOURCE IDENTIFIER
+NAME DIRE // 4 letter ID
+
+
+// INCLUDES
+#include <eikon.rh>
+#include <avkon.rsg>
+#include <avkon.mbg>
+#include <avkon.rh>
+#include <appinfo.rh>
+#include "DirectPrintApp.hrh"
+#include "DirectPrintApp.loc"
+
+#define AVKON_BMPFILE_NAME "z:\\resource\\apps\\avkon2.mbm"
+
+// RESOURCE DEFINITIONS
+// -----------------------------------------------------------------------------
+//
+// Define the resource file signature
+// This resource should be empty.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE
+ {
+ }
+
+// -----------------------------------------------------------------------------
+//
+// Default Document Name
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_default_document_name
+ {
+ buf="DIRE";
+ }
+
+// -----------------------------------------------------------------------------
+//
+// Define default menu and CBA key.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE EIK_APP_INFO
+ {
+ menubar = r_directprint_menubar;
+ cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
+ }
+
+
+// -----------------------------------------------------------------------------
+//
+// r_directprint_menubar
+// Main menubar
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_directprint_menubar
+ {
+ titles =
+ {
+ MENU_TITLE { menu_pane = r_directprint_menu; }
+ };
+ }
+
+
+// -----------------------------------------------------------------------------
+//
+// r_directprint_menu
+// Menu for "Options"
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_directprint_menu
+ {
+ items =
+ {
+ MENU_ITEM
+ {
+ command = EDirectPrintCmdIdMainViewHelp;
+ txt = text_directprint_menu_item_help;
+ },
+ MENU_ITEM
+ {
+ command = EDirectPrintCmdIdMainViewAbout;
+ txt = text_directprint_menu_item_about;
+ },
+ MENU_ITEM
+ {
+ command = EAknSoftkeyExit;
+ txt = text_directprint_menu_item_exit;
+ }
+ };
+ }
+
+// -----------------------------------------------------------------------------
+//
+// About dialog resource.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_about_query_dialog
+ {
+ flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
+ buttons = R_AVKON_SOFTKEYS_OK_EMPTY;
+ items=
+ {
+ DLG_LINE
+ {
+ type = EAknCtPopupHeadingPane;
+ id = EAknMessageQueryHeaderId;
+ itemflags = EEikDlgItemNonFocusing;
+ control = AVKON_HEADING
+ {
+ };
+ },
+ DLG_LINE
+ {
+ type = EAknCtMessageQuery;
+ id = EAknMessageQueryContentId;
+ control = AVKON_MESSAGE_QUERY
+ {
+ };
+ }
+ };
+ }
+
+//-----------------------------------------------------------------------------
+//
+// r_directprint_print_progress_note
+// For progress note.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_directprint_print_progress_note
+ {
+ flags = EAknProgressNoteFlags;
+ buttons = R_AVKON_SOFTKEYS_CANCEL;
+ items =
+ {
+ DLG_LINE
+ {
+ type = EAknCtNote;
+ id = EDirectPrintCtrlIdPrintProgressNote;
+ control = AVKON_NOTE
+ {
+ layout = EProgressLayout;
+ singular_label = text_directprint_printing_progress;
+ imagefile = AVKON_BMPFILE_NAME;
+ imageid = EMbmAvkonQgn_note_progress;
+ imagemask = EMbmAvkonQgn_note_progress_mask;
+ };
+ }
+ };
+ }
+
+//-----------------------------------------------------------------------------
+//
+// r_directprint_search_progress_note
+// For progress note.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_directprint_search_progress_note
+ {
+ flags = EAknProgressNoteFlags;
+ buttons = R_AVKON_SOFTKEYS_CANCEL;
+ items =
+ {
+ DLG_LINE
+ {
+ type = EAknCtNote;
+ id = EDirectPrintCtrlIdSearchProgressNote;
+ control = AVKON_NOTE
+ {
+ layout = EProgressLayout;
+ singular_label = text_directprint_searching_progress;
+ imagefile = AVKON_BMPFILE_NAME;
+ imageid = EMbmAvkonQgn_note_progress;
+ imagemask = EMbmAvkonQgn_note_progress_mask;
+ animation = R_QGN_GRAF_WAIT_BAR_ANIM;
+
+ };
+ }
+ };
+ }
+
+
+// -----------------------------------------------------------------------------
+//
+// Resources for messages.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_directprint_caption_string { buf=text_directprint_captionstring; }
+RESOURCE TBUF r_directprint_about_dialog_title { buf=text_directprint_about_dialog_title; }
+RESOURCE TBUF r_directprint_about_dialog_text { buf=text_directprint_about_dialog_text; }
+
+RESOURCE TBUF r_directprint_msg_print_in_use { buf=text_directprint_msg_print_in_use; }
+RESOURCE TBUF r_directprint_msg_param_file_not_found { buf=text_directprint_msg_param_file_not_found; }
+RESOURCE TBUF r_directprint_msg_param_incorrect { buf=text_directprint_msg_param_incorrect; }
+RESOURCE TBUF r_directprint_msg_bearer_open_err { buf=text_directprint_msg_bearer_open_err; }
+RESOURCE TBUF r_directprint_msg_submit_print_err { buf=text_directprint_msg_submit_print_err; }
+RESOURCE TBUF r_directprint_msg_preview_err { buf=text_directprint_msg_preview_err; }
+
+RESOURCE TBUF r_directprint_msg_printing_progress { buf=text_directprint_printing_progress; }
+RESOURCE TBUF r_directprint_msg_searching_progress { buf=text_directprint_searching_progress; }
+
+RESOURCE TBUF r_directprint_msg_now_printing { buf=text_directprint_msg_now_printing; }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_localisable_app_info
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE LOCALISABLE_APP_INFO r_directprint_localisable_app_info
+ {
+ short_caption = text_directprint_captionstring;
+ caption_and_icon =
+ CAPTION_AND_ICON_INFO
+ {
+ caption = text_directprint_captionstring;
+ number_of_icons = 1;
+ icon_file = "\\resource\\apps\\DirectPrintApp.mif";
+ };
+ }
+
+// -----------------------------------------------------------------------------
+//
+// Resources for messages.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_directprint_setting_directory { buf=text_directprint_setting_directory; }
+RESOURCE TBUF r_directprint_setting_file { buf=text_directprint_setting_file; }
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Print Main View
+//
+////////////////////////////////////////////////////////////////////////////////
+//
+//
+// ----------------------------------------------------------------------------
+//
+// r_directprint_mainview
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_directprint_mainview
+ {
+ cba = R_AVKON_SOFTKEYS_OPTIONS_BACK;
+ menubar = r_directprint_mainview_options_menu;
+ toolbar = r_directprint_mainview_toolbar;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_mainview_title
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE TITLE_PANE r_directprint_mainview_title
+ {
+ txt = text_directprint_mainview_title;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_mainview_options_menu
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_directprint_mainview_options_menu
+ {
+ titles =
+ {
+ MENU_TITLE
+ {
+ menu_pane = r_directprint_mainview_options_menu_pane;
+ }
+ };
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_mainview_options_menu_pane
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_directprint_mainview_options_menu_pane
+ {
+ items =
+ {
+ MENU_ITEM
+ {
+ command = EDirectPrintCmdIdMainViewPrint;
+ txt = text_directprint_menu_print;
+ },
+ MENU_ITEM
+ {
+ command = EDirectPrintCmdIdMainViewPreview;
+ txt = text_directprint_menu_preview;
+ },
+ MENU_ITEM
+ {
+ command = EDirectPrintCmdIdMainViewPropertySetting;
+ txt = text_directprint_mainview_menu_propertysetting;
+ },
+ MENU_ITEM
+ {
+ command = EDirectPrintCmdIdMainViewExit;
+ txt = text_directprint_mainview_menu_exit;
+ }
+ };
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_mainview_options_menu_pane
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE AVKON_TOOLBAR r_directprint_mainview_toolbar
+ {
+ flags = KAknToolbarFixed;
+ items =
+ {
+ TBAR_CTRL
+ {
+ type = EAknCtButton;
+ id = EDirectPrintCmdIdMainViewPrint;
+ control = AVKON_BUTTON
+ {
+ flags = 0;
+ states =
+ {
+ AVKON_BUTTON_STATE
+ {
+ txt = text_directprint_toolbar_print;
+ }
+ };
+ };
+ },
+ TBAR_CTRL
+ {
+ type = EAknCtButton;
+ id = EDirectPrintCmdIdMainViewPreview;
+ control = AVKON_BUTTON
+ {
+ flags = 0;
+ states =
+ {
+ AVKON_BUTTON_STATE
+ {
+ txt = text_directprint_toolbar_preview;
+ }
+ };
+ };
+ },
+ TBAR_CTRL
+ {
+ type = EAknCtButton;
+ id = EDirectPrintCmdIdMainViewPropertySetting;
+ control = AVKON_BUTTON
+ {
+ flags = 0;
+ states =
+ {
+ AVKON_BUTTON_STATE
+ {
+ txt = text_directprint_mainview_toolbar_propertysetting;
+ }
+ };
+ };
+ }
+ };
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_mainview_listbox
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE LISTBOX r_directprint_mainview_listbox
+ {
+ flags = EAknListBoxSelectionList;
+// array_id = r_directprint_mainview_listbox_items;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_mainview_listbox_items
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_directprint_mainview_listbox_items
+ {
+ items =
+ {
+ LBUF
+ {
+ txt = text_directprint_mainview_item_printername;
+ },
+ LBUF
+ {
+ txt = text_directprint_mainview_item_bearer;
+ },
+ LBUF
+ {
+ txt = text_directprint_mainview_item_propertysettings;
+ }
+ };
+ }
+
+// ----------------------------------------------------------------------------
+//
+// Resources for item title.
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_directprint_mainview_item_printername { buf=text_directprint_mainview_item_printername; }
+RESOURCE TBUF r_directprint_mainview_item_bearer { buf=text_directprint_mainview_item_bearer; }
+RESOURCE TBUF r_directprint_mainview_item_propertysettings { buf=text_directprint_mainview_item_propertysettings; }
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Printer List View
+//
+////////////////////////////////////////////////////////////////////////////////
+//
+//
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printerlist_view
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_directprint_printerlist_view
+ {
+ cba = R_AVKON_SOFTKEYS_OPTIONS_DONE;
+ menubar = r_directprint_printerlist_options_menu;
+ toolbar = r_directprint_printerlist_toolbar;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printerlist_title
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE TITLE_PANE r_directprint_printerlist_title
+ {
+ txt = text_directprint_printerlist_title;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printerlist_options_menu
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_directprint_printerlist_options_menu
+ {
+ titles =
+ {
+ MENU_TITLE
+ {
+ menu_pane = r_directprint_printerlist_options_menu_pane;
+ }
+ };
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printerlist_options_menu_pane
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_directprint_printerlist_options_menu_pane
+ {
+ items =
+ {
+ MENU_ITEM
+ {
+ command = EDirectPrintCmdIdPrinterListViewSearch;
+ txt = text_directprint_printerlist_menu_search;
+ },
+ MENU_ITEM
+ {
+ command = EDirectPrintCmdIdPrinterListViewNew;
+ txt = text_directprint_printerlist_menu_new;
+ },
+ MENU_ITEM
+ {
+ command = EDirectPrintCmdIdPrinterListViewEdit;
+ txt = text_directprint_printerlist_menu_edit;
+ },
+ MENU_ITEM
+ {
+ command = EDirectPrintCmdIdPrinterListViewDelete;
+ txt = text_directprint_printerlist_menu_delete;
+ }
+ };
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printerlist_toolbar
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE AVKON_TOOLBAR r_directprint_printerlist_toolbar
+ {
+ flags = KAknToolbarFixed;
+ items =
+ {
+ TBAR_CTRL
+ {
+ type = EAknCtButton;
+ id = EDirectPrintCmdIdPrinterListViewSearch;
+ control = AVKON_BUTTON
+ {
+ flags = 0;
+ states =
+ {
+ AVKON_BUTTON_STATE
+ {
+ txt = text_directprint_printerlist_menu_search;
+ }
+ };
+ };
+ },
+ TBAR_CTRL
+ {
+ type = EAknCtButton;
+ id = EDirectPrintCmdIdPrinterListViewNew;
+ control = AVKON_BUTTON
+ {
+ flags = 0;
+ states =
+ {
+ AVKON_BUTTON_STATE
+ {
+ txt = text_directprint_printerlist_menu_new;
+ }
+ };
+ };
+ },
+ TBAR_CTRL
+ {
+ type = EAknCtButton;
+ id = EDirectPrintCmdIdPrinterListViewEdit;
+ control = AVKON_BUTTON
+ {
+ flags = 0;
+ states =
+ {
+ AVKON_BUTTON_STATE
+ {
+ txt = text_directprint_printerlist_menu_edit;
+ }
+ };
+ };
+ }
+ };
+ }
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Printer search result View
+//
+////////////////////////////////////////////////////////////////////////////////
+//
+//
+// ----------------------------------------------------------------------------
+//
+// r_directprint_searchresult_view
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE AVKON_VIEW r_directprint_searchresult_view
+ {
+ cba = R_AVKON_SOFTKEYS_OPTIONS_CANCEL;
+ menubar = r_directprint_searchresult_options_menu;
+ toolbar = r_directprint_searchresult_toolbar;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printersearch_title
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE TITLE_PANE r_directprint_printersearch_title
+ {
+ txt = text_directprint_printersearch_title;
+ }
+
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printerlist_options_menu
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_directprint_searchresult_options_menu
+ {
+ titles =
+ {
+ MENU_TITLE
+ {
+ menu_pane = r_directprint_searchresult_options_menu_pane;
+ }
+ };
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printerlist_options_menu_pane
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_directprint_searchresult_options_menu_pane
+ {
+ items =
+ {
+ MENU_ITEM
+ {
+ command = EDirectPrintCmdIdSearchResultViewSearch;
+ txt = text_directprint_searchresult_menu_search;
+ }
+ };
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printerlist_toolbar
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE AVKON_TOOLBAR r_directprint_searchresult_toolbar
+ {
+ flags = KAknToolbarFixed;
+ items =
+ {
+ TBAR_CTRL
+ {
+ type = EAknCtButton;
+ id = EDirectPrintCmdIdSearchResultViewSearch;
+ control = AVKON_BUTTON
+ {
+ flags = 0;
+ states =
+ {
+ AVKON_BUTTON_STATE
+ {
+ txt = text_directprint_searchresult_menu_search;
+ }
+ };
+ };
+ }
+ };
+ }
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Printer Setting View
+//
+////////////////////////////////////////////////////////////////////////////////
+//
+//
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printersetting_view
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE AVKON_VIEW r_directprint_printersetting_view
+ {
+ cba = R_AVKON_SOFTKEYS_OPTIONS_BACK;
+ menubar = r_directprint_printersetting_options_menu;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printersetting_title
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE TITLE_PANE r_directprint_printersetting_title
+ {
+ txt = text_directprint_printersetting_title;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printersetting_options_menu
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE MENU_BAR r_directprint_printersetting_options_menu
+ {
+ titles =
+ {
+ MENU_TITLE
+ {
+ menu_pane = r_directprint_printersetting_options_menu_pane;
+ }
+ };
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printersetting_options_menu_pane
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE MENU_PANE r_directprint_printersetting_options_menu_pane
+ {
+ items =
+ {
+ MENU_ITEM
+ {
+ command = EDirectPrintCmdIdPrinterSettingViewChange;
+ txt = text_directprint_menu_change;
+ }
+ };
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printersetting_item_list
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE AVKON_SETTING_ITEM_LIST r_directprint_printersetting_item_list
+ {
+ title = text_directprint_printersetting_title;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printersetting_popup_setting_page
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE AVKON_SETTING_PAGE r_directprint_printersetting_popup_setting_page
+ {
+ type = EAknCtPopupSettingList;
+ editor_resource_id = r_directprint_printersetting_popup_setting_list;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printersetting_popup_setting_list
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE POPUP_SETTING_LIST r_directprint_printersetting_popup_setting_list
+ {
+ flags = 0;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printersetting_text_setting_page
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE AVKON_SETTING_PAGE r_directprint_printersetting_text_setting_page
+ {
+ type = EEikCtEdwin;
+ editor_resource_id = r_directprint_printersetting_text_edwin;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printersetting_text_setting_page
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE EDWIN r_directprint_printersetting_text_edwin
+ {
+ width = 10;
+ maxlength = 50;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printersetting_integer_setting_page
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE AVKON_SETTING_PAGE r_directprint_printersetting_integer_setting_page
+ {
+ type = EAknCtIntegerEdwin;
+ editor_resource_id = r_directprint_printersetting_integer_edwin;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printersetting_integer_edwin
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE AVKON_INTEGER_EDWIN r_directprint_printersetting_integer_edwin
+ {
+ min = 0;
+ max = 65535;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printersetting_ipfield_setting_page
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE AVKON_SETTING_PAGE r_directprint_printersetting_ipfield_setting_page
+ {
+ type = EAknCtIpFieldEditor;
+ editor_resource_id = r_directprint_printersetting_ip_editor;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printersetting_ip_editor
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE IP_FIELD_EDITOR r_directprint_printersetting_ip_editor
+ {
+ min_field_values = IP_FIELD
+ {
+ first_field = 0;
+ second_field = 0;
+ third_field = 0;
+ fourth_field = 0;
+ };
+ max_field_values = IP_FIELD
+ {
+ first_field = 255;
+ second_field = 255;
+ third_field = 255;
+ fourth_field = 255;
+ };
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printersetting_driver_popup_setting_texts
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_directprint_printersetting_driver_popup_setting_texts
+ {
+ setting_texts_resource = r_directprint_printersetting_driver_texts;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printersetting_driver_texts
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE ARRAY r_directprint_printersetting_driver_texts
+ {
+ items =
+ {
+ AVKON_ENUMERATED_TEXT { value=0; text = "General";},
+ AVKON_ENUMERATED_TEXT { value=1; text = "Canon";},
+ AVKON_ENUMERATED_TEXT { value=2; text = "HP";}
+ };
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printersetting_bearer_popup_setting_texts
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_directprint_printersetting_bearer_popup_setting_texts
+ {
+ setting_texts_resource = r_directprint_printersetting_bearer_texts;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printersetting_bearer_texts
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE ARRAY r_directprint_printersetting_bearer_texts
+ {
+ items =
+ {
+ AVKON_ENUMERATED_TEXT { value=0; text = "File output";},
+ AVKON_ENUMERATED_TEXT { value=1; text = "LPR";}
+ };
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printersetting_bearer_popup_setting_texts
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_directprint_printersetting_accesspoint_popup_setting_texts
+ {
+ setting_texts_resource = r_directprint_printersetting_accesspoint_texts;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printersetting_accesspoint_texts
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE ARRAY r_directprint_printersetting_accesspoint_texts
+ {
+ items =
+ {
+ AVKON_ENUMERATED_TEXT { value=0; text = "WLAN_ap1";},
+ AVKON_ENUMERATED_TEXT { value=1; text = "WLAN_ap2";}
+ };
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printersetting_type_popup_setting_texts
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_directprint_printersetting_type_popup_setting_texts
+ {
+ setting_texts_resource = r_directprint_printersetting_type_texts;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printersetting_type_texts
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE ARRAY r_directprint_printersetting_type_texts
+ {
+ items =
+ {
+ AVKON_ENUMERATED_TEXT { value=0; text = "MP990";},
+ AVKON_ENUMERATED_TEXT { value=1; text = "MP640";},
+ AVKON_ENUMERATED_TEXT { value=2; text = "MP560";},
+ AVKON_ENUMERATED_TEXT { value=3; text = "MX860";}
+ };
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printersetting_popup_setting_texts
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_directprint_printersetting_popup_setting_texts
+ {
+ setting_texts_resource = r_directprint_printersetting_texts;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_printersetting_type_texts
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE ARRAY r_directprint_printersetting_texts
+ {
+ items =
+ {
+ AVKON_ENUMERATED_TEXT { value=0; text = "dummy";}
+ };
+ }
+
+// ----------------------------------------------------------------------------
+//
+// Resources for item title.
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_directprint_printersetting_item_printername { buf=text_directprint_printersetting_item_printername; }
+RESOURCE TBUF r_directprint_printersetting_item_driver { buf=text_directprint_printersetting_item_driver; }
+RESOURCE TBUF r_directprint_printersetting_item_bearer { buf=text_directprint_printersetting_item_bearer; }
+RESOURCE TBUF r_directprint_printersetting_item_accesspoint { buf=text_directprint_printersetting_item_accesspoint; }
+RESOURCE TBUF r_directprint_printersetting_item_host { buf=text_directprint_printersetting_item_host; }
+RESOURCE TBUF r_directprint_printersetting_item_port { buf=text_directprint_printersetting_item_port; }
+RESOURCE TBUF r_directprint_printersetting_item_username { buf=text_directprint_printersetting_item_username; }
+RESOURCE TBUF r_directprint_printersetting_item_que { buf=text_directprint_printersetting_item_que; }
+RESOURCE TBUF r_directprint_printersetting_item_type { buf=text_directprint_printersetting_item_type; }
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Property Setting View
+//
+////////////////////////////////////////////////////////////////////////////////
+//
+//
+// ----------------------------------------------------------------------------
+//
+// r_directprint_propertysetting_view
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE AVKON_VIEW r_directprint_propertysetting_view
+ {
+ cba = R_AVKON_SOFTKEYS_OPTIONS_BACK;
+ menubar = r_directprint_propertysetting_options_menu;
+ toolbar = r_directprint_propertysetting_toolbar;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_propertysetting_title
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE TITLE_PANE r_directprint_propertysetting_title
+ {
+ txt = text_directprint_propertysetting_title;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_propertysetting_options_menu
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE MENU_BAR r_directprint_propertysetting_options_menu
+ {
+ titles =
+ {
+ MENU_TITLE
+ {
+ menu_pane = r_directprint_propertysetting_options_menu_pane;
+ }
+ };
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_propertysetting_options_menu_pane
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE MENU_PANE r_directprint_propertysetting_options_menu_pane
+ {
+ items =
+ {
+ MENU_ITEM
+ {
+ command = EDirectPrintCmdIdPropertySettingViewChange;
+ txt = text_directprint_menu_change;
+ },
+ MENU_ITEM
+ {
+ command = EDirectPrintCmdIdPropertySettingViewPrint;
+ txt = text_directprint_menu_print;
+ },
+ MENU_ITEM
+ {
+ command = EDirectPrintCmdIdPropertySettingViewPreview;
+ txt = text_directprint_menu_preview;
+ }
+ };
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_propertysetting_toolbar
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE AVKON_TOOLBAR r_directprint_propertysetting_toolbar
+ {
+ flags = KAknToolbarFixed;
+ items =
+ {
+ TBAR_CTRL
+ {
+ type = EAknCtButton;
+ id = EDirectPrintCmdIdPropertySettingViewPrint;
+ control = AVKON_BUTTON
+ {
+ flags = 0;
+ states =
+ {
+ AVKON_BUTTON_STATE
+ {
+ txt = text_directprint_toolbar_print;
+ }
+ };
+ };
+ },
+ TBAR_CTRL
+ {
+ type = EAknCtButton;
+ id = EDirectPrintCmdIdPropertySettingViewPreview;
+ control = AVKON_BUTTON
+ {
+ flags = 0;
+ states =
+ {
+ AVKON_BUTTON_STATE
+ {
+ txt = text_directprint_toolbar_preview;
+ }
+ };
+ };
+ }
+ };
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_propertysetting_navi_decorator
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE NAVI_DECORATOR r_directprint_propertysetting_navi_decorator
+ {
+ type = ENaviDecoratorControlTabGroup;
+ control = TAB_GROUP
+ {
+ tab_width = EAknTabWidthWithTwoLongTabs;
+ active = 0;
+ tabs =
+ {
+ TAB
+ {
+ id = EDirectPrintPaperSettingTab;
+ txt = text_directprint_propertysetting_tab_paper;
+ },
+ TAB
+ {
+ id = EDirectPrintPageSettingTab;
+ txt = text_directprint_propertysetting_tab_page;
+ },
+ TAB
+ {
+ id = EDirectPrintMarginSettingTab;
+ txt = text_directprint_propertysetting_tab_margin;
+ },
+ TAB
+ {
+ id = EDirectPrintHeaderSettingTab;
+ txt = text_directprint_propertysetting_tab_header;
+ },
+ TAB
+ {
+ id = EDirectPrintFooterSettingTab;
+ txt = text_directprint_propertysetting_tab_footer;
+ }
+ };
+ };
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_propertysetting_setting_item_list
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE AVKON_SETTING_ITEM_LIST r_directprint_propertysetting_setting_item_list
+ {
+ title = text_directprint_propertysetting_title;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_propertysetting_popup_setting_page
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE AVKON_SETTING_PAGE r_directprint_propertysetting_popup_setting_page
+ {
+ type = EAknCtPopupSettingList;
+ editor_resource_id = r_directprint_propertysetting_popup_setting_list;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_propertysetting_popup_setting_list
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE POPUP_SETTING_LIST r_directprint_propertysetting_popup_setting_list
+ {
+ flags = 0;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_propertysetting_text_setting_page
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE AVKON_SETTING_PAGE r_directprint_propertysetting_text_setting_page
+ {
+ type = EEikCtEdwin;
+ editor_resource_id = r_directprint_propertysetting_text_edwin;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_propertysetting_text_edwin
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE EDWIN r_directprint_propertysetting_text_edwin
+ {
+ width = 10;
+ maxlength = 50;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_propertysetting_integer_setting_page
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE AVKON_SETTING_PAGE r_directprint_propertysetting_integer_setting_page
+ {
+ type = EAknCtIntegerEdwin;
+ editor_resource_id = r_directprint_propertysetting_integer_edwin;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_propertysetting_integer_edwin
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE AVKON_INTEGER_EDWIN r_directprint_propertysetting_integer_edwin
+ {
+ min = 0;
+ max = 150;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_propertysetting_size_popup_setting_texts
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_directprint_propertysetting_size_popup_setting_texts
+ {
+ setting_texts_resource = r_directprint_propertysetting_size_texts;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_propertysetting_size_texts
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE ARRAY r_directprint_propertysetting_size_texts
+ {
+ items =
+ {
+ AVKON_ENUMERATED_TEXT { value=0; text = "A4";},
+ AVKON_ENUMERATED_TEXT { value=1; text = "A5";},
+ AVKON_ENUMERATED_TEXT { value=2; text = "B5";},
+ AVKON_ENUMERATED_TEXT { value=3; text = "Letter";},
+ AVKON_ENUMERATED_TEXT { value=4; text = "Regal";},
+ AVKON_ENUMERATED_TEXT { value=5; text = "Post card";},
+ AVKON_ENUMERATED_TEXT { value=6; text = "Envelope";}
+ };
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_propertysetting_orientation_popup_setting_texts
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_directprint_propertysetting_orientation_popup_setting_texts
+ {
+ setting_texts_resource = r_directprint_propertysetting_orientation_texts;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_propertysetting_orientation_texts
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE ARRAY r_directprint_propertysetting_orientation_texts
+ {
+ items =
+ {
+ AVKON_ENUMERATED_TEXT
+ {
+ value=0;
+ text = text_directprint_orientation_portrate;
+ },
+ AVKON_ENUMERATED_TEXT
+ {
+ value=1;
+ text = text_directprint_orientation_landscape;
+ }
+ };
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_propertysetting_mediatype_popup_setting_texts
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_directprint_propertysetting_mediatype_popup_setting_texts
+ {
+ setting_texts_resource = r_directprint_propertysetting_mediatype_texts;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_propertysetting_orientation_texts
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE ARRAY r_directprint_propertysetting_mediatype_texts
+ {
+ items =
+ {
+ AVKON_ENUMERATED_TEXT
+ {
+ value = 0;
+ text = "Plain";
+ },
+ AVKON_ENUMERATED_TEXT
+ {
+ value=1;
+ text = "Photo";
+ }
+ };
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_propertysetting_boaderless_popup_setting_texts
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_directprint_propertysetting_boaderless_popup_setting_texts
+ {
+ setting_texts_resource = r_directprint_propertysetting_boaderless_texts;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_propertysetting_orientation_texts
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE ARRAY r_directprint_propertysetting_boaderless_texts
+ {
+ items =
+ {
+ AVKON_ENUMERATED_TEXT
+ {
+ value = 0;
+ text = "OFF";
+ },
+ AVKON_ENUMERATED_TEXT
+ {
+ value=1;
+ text = "ON";
+ }
+ };
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_propertysetting_page_popup_setting_texts
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_directprint_propertysetting_range_popup_setting_texts
+ {
+ setting_texts_resource = r_directprint_propertysetting_range_texts;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_propertysetting_range_texts
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE ARRAY r_directprint_propertysetting_range_texts
+ {
+ items =
+ {
+ AVKON_ENUMERATED_TEXT { value=0; text = text_directprint_range_all;},
+ AVKON_ENUMERATED_TEXT { value=1; text = text_directprint_range_odd;},
+ AVKON_ENUMERATED_TEXT { value=2; text = text_directprint_range_even;}
+ };
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_propertysetting_print_popup_setting_texts
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_directprint_propertysetting_print_popup_setting_texts
+ {
+ setting_texts_resource = r_directprint_propertysetting_print_texts;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_propertysetting_print_texts
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE ARRAY r_directprint_propertysetting_print_texts
+ {
+ items =
+ {
+ AVKON_ENUMERATED_TEXT { value=0; text = text_directprint_no;},
+ AVKON_ENUMERATED_TEXT { value=1; text = text_directprint_yes;}
+ };
+ }
+
+// ----------------------------------------------------------------------------
+//
+// Resources for item title.
+//
+// ----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_directprint_propertysetting_item_papersize { buf=text_directprint_propertysetting_item_papersize; }
+RESOURCE TBUF r_directprint_propertysetting_item_orientation { buf=text_directprint_propertysetting_item_orientation; }
+RESOURCE TBUF r_directprint_propertysetting_item_mediatype { buf=text_directprint_propertysetting_item_mediatype; }
+RESOURCE TBUF r_directprint_propertysetting_item_printpage { buf=text_directprint_propertysetting_item_printpage; }
+RESOURCE TBUF r_directprint_propertysetting_item_printrange { buf=text_directprint_propertysetting_item_printrange; }
+RESOURCE TBUF r_directprint_propertysetting_item_copy { buf=text_directprint_propertysetting_item_copy; }
+RESOURCE TBUF r_directprint_propertysetting_item_leftmargin { buf=text_directprint_propertysetting_item_leftmargin; }
+RESOURCE TBUF r_directprint_propertysetting_item_rightmargin { buf=text_directprint_propertysetting_item_rightmargin; }
+RESOURCE TBUF r_directprint_propertysetting_item_topmargin { buf=text_directprint_propertysetting_item_topmargin; }
+RESOURCE TBUF r_directprint_propertysetting_item_bottommargin { buf=text_directprint_propertysetting_item_bottommargin; }
+RESOURCE TBUF r_directprint_propertysetting_item_headertext { buf=text_directprint_propertysetting_item_headertext; }
+RESOURCE TBUF r_directprint_propertysetting_item_headerdistance { buf=text_directprint_propertysetting_item_headerdistance; }
+RESOURCE TBUF r_directprint_propertysetting_item_headerfirstpage { buf=text_directprint_propertysetting_item_headerfirstpage; }
+RESOURCE TBUF r_directprint_propertysetting_item_footertext { buf=text_directprint_propertysetting_item_footertext; }
+RESOURCE TBUF r_directprint_propertysetting_item_footerdistance { buf=text_directprint_propertysetting_item_footerdistance; }
+RESOURCE TBUF r_directprint_propertysetting_item_footerfirstpage { buf=text_directprint_propertysetting_item_footerfirstpage; }
+
+RESOURCE TBUF r_directprint_propertysetting_item_boaderless { buf=text_directprint_propertysetting_item_boaderless; }
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Preview View
+//
+////////////////////////////////////////////////////////////////////////////////
+//
+//
+// ----------------------------------------------------------------------------
+//
+// r_directprint_preview_view
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE AVKON_VIEW r_directprint_preview_view
+ {
+ cba = R_AVKON_SOFTKEYS_OPTIONS_BACK;
+ menubar = r_directprint_preview_options_menu;
+ toolbar = r_directprint_preview_toolbar;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_preview_title
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE TITLE_PANE r_directprint_preview_title
+ {
+ txt = text_directprint_previewview_title;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_preview_options_menu
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE MENU_BAR r_directprint_preview_options_menu
+ {
+ titles =
+ {
+ MENU_TITLE
+ {
+ menu_pane = r_directprint_preview_options_menu_pane;
+ }
+ };
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_preview_options_menu_pane
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE MENU_PANE r_directprint_preview_options_menu_pane
+ {
+ items =
+ {
+ MENU_ITEM
+ {
+ command = EDirectPrintCmdIdPreviewViewPrint;
+ txt = text_directprint_menu_print;
+ },
+ MENU_ITEM
+ {
+ command = EDirectPrintCmdIdPreviewViewExpand;
+ txt = text_directprint_previewview_expand;
+ },
+ MENU_ITEM
+ {
+ command = EDirectPrintCmdIdPreviewViewReduce;
+ txt = text_directprint_previewview_reduce;
+ }
+ };
+ }
+
+// ----------------------------------------------------------------------------
+//
+// r_directprint_preview_toolbar
+//
+// ----------------------------------------------------------------------------
+//
+//
+RESOURCE AVKON_TOOLBAR r_directprint_preview_toolbar
+ {
+ flags = KAknToolbarFixed;
+ items =
+ {
+ TBAR_CTRL
+ {
+ type = EAknCtButton;
+ id = EDirectPrintCmdIdPreviewViewPrint;
+ control = AVKON_BUTTON
+ {
+ flags = 0;
+ states =
+ {
+ AVKON_BUTTON_STATE
+ {
+ txt = text_directprint_toolbar_print;
+ }
+ };
+ };
+ },
+ TBAR_CTRL
+ {
+ type = EAknCtButton;
+ id = EDirectPrintCmdIdPreviewViewExpand;
+ control = AVKON_BUTTON
+ {
+ flags = 0;
+ states =
+ {
+ AVKON_BUTTON_STATE
+ {
+ txt = text_directprint_previewview_expand;
+ }
+ };
+ };
+ },
+ TBAR_CTRL
+ {
+ type = EAknCtButton;
+ id = EDirectPrintCmdIdPreviewViewReduce;
+ control = AVKON_BUTTON
+ {
+ flags = 0;
+ states =
+ {
+ AVKON_BUTTON_STATE
+ {
+ txt = text_directprint_previewview_reduce;
+ }
+ };
+ };
+ }
+ };
+ }
+
+
+
+
+
+// ----------------------------------------------------------------------------
+//
+// For directprint engine
+//
+// ----------------------------------------------------------------------------
+//
+//
+
+// d:List box format string - do not localize this!
+#define qtn_lbox_format "\t%0U\t\t%1U"
+
+// Resource strings
+RESOURCE TBUF R_QTN_LBOX_FORMAT { buf = qtn_lbox_format; }
+RESOURCE TBUF R_EMPTY { buf = ""; }
+
+// Paper sizes
+RESOURCE TBUF R_QTN_STR_PAPER_SIZE { buf = qtn_print_settings_paper_size; }
+RESOURCE TBUF R_QTN_STR_SIZE_AUTO { buf = qtn_print_paper_size_auto; }
+RESOURCE TBUF R_QTN_STR_SIZE_LETTER { buf = qtn_print_paper_size_letter; }
+RESOURCE TBUF R_QTN_STR_SIZE_A4 { buf = qtn_print_paper_size_a4; }
+RESOURCE TBUF R_QTN_STR_SIZE_A6 { buf = qtn_print_paper_size_a6; }
+RESOURCE TBUF R_QTN_STR_SIZE_4X6 { buf = qtn_print_paper_size_4x6; }
+RESOURCE TBUF R_QTN_STR_SIZE_5X7 { buf = qtn_print_paper_size_5x7; }
+RESOURCE TBUF R_QTN_STR_SIZE_STICKER { buf = qtn_print_paper_size_sticker; }
+
+// Print quality
+RESOURCE TBUF R_QTN_STR_QUALITY { buf = qtn_print_settings_print_quality; }
+RESOURCE TBUF R_QTN_STR_QUAL_AUTO { buf = qtn_print_quality_auto; }
+RESOURCE TBUF R_QTN_STR_QUAL_NORMAL { buf = qtn_print_quality_normal; }
+RESOURCE TBUF R_QTN_STR_QUAL_DRAFT { buf = qtn_print_quality_draft; }
+RESOURCE TBUF R_QTN_STR_QUAL_FINE { buf = qtn_print_quality_fine; }
+
+// Template
+RESOURCE TBUF R_QTN_STR_TEMPLATE { buf = qtn_print_settings_template; }
+RESOURCE TBUF R_QTN_STR_TEMPLATE_BLESS { buf = qtn_print_settings_bless; }
+RESOURCE TBUF R_QTN_STR_TEMPLATE_ONE { buf = "1"; }
+RESOURCE TBUF R_QTN_STR_TEMPLATE_TWO { buf = "2"; }
+RESOURCE TBUF R_QTN_STR_TEMPLATE_FOUR { buf = "4"; }
+RESOURCE TBUF R_QTN_STR_TEMPLATE_SIX { buf = "6"; }
+RESOURCE TBUF R_QTN_STR_TEMPLATE_NINE { buf = "9"; }
+RESOURCE TBUF R_QTN_STR_TEMPLATE_TWELVE { buf = "12"; }
+RESOURCE TBUF R_QTN_STR_TEMPLATE_SIXTEEN { buf = "16"; }
+
+//
+RESOURCE TBUF r_qtn_print_no_printers { buf = qtn_print_no_printers; }
+RESOURCE TBUF r_qtn_print_settings_default_usb { buf = qtn_print_settings_default_usb; }
+RESOURCE TBUF r_qtn_print_settings_default_bt { buf = qtn_print_settings_default_bt; }
+RESOURCE TBUF r_qtn_print_settings_default_wlan { buf = qtn_print_settings_default_wlan; }
+RESOURCE TBUF r_qtn_print_settings_default_lpr { buf = qtn_print_settings_default_lpr; }
+RESOURCE TBUF r_qtn_print_memory_card { buf = qtn_print_memory_card; }
+
+// DirectPrint
+RESOURCE TBUF R_QTN_STR_ACCESS_POINT { buf = qtn_print_settings_accesspoint; }
+RESOURCE TBUF R_QTN_STR_HOST { buf = qtn_print_settings_host; }
+RESOURCE TBUF R_QTN_STR_PORT { buf = qtn_print_settings_port; }
+RESOURCE TBUF R_QTN_STR_USER { buf = qtn_print_settings_user; }
+RESOURCE TBUF R_QTN_STR_QUE { buf = qtn_print_settings_que; }
+
+// Extent
+RESOURCE TBUF R_QTN_STR_EXTENT { buf = qtn_print_settings_extent; }
+RESOURCE TBUF R_QTN_STR_EXTENT2 { buf = qtn_print_settings_extent2; }
+RESOURCE TBUF R_QTN_STR_EXTENT_SELECT1 { buf = qtn_print_settings_extent_select1; }
+RESOURCE TBUF R_QTN_STR_EXTENT_SELECT2 { buf = qtn_print_settings_extent_select2; }
+RESOURCE TBUF R_QTN_STR_EXTENT_SELECT3 { buf = qtn_print_settings_extent_select3; }
+RESOURCE TBUF R_QTN_STR_EXTENT_SELECT4 { buf = qtn_print_settings_extent_select4; }
+
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/data/directprintapp_reg.rss Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "DirectPrintApp.hrh"
+#include "DirectPrintApp.loc"
+#include <appinfo.rh>
+#include <DirectPrintApp.rsg>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 _UID3
+
+RESOURCE APP_REGISTRATION_INFO
+ {
+ app_file="DirectPrintApp";
+ localisable_resource_file = text_directprint_loc_resource_file;
+ localisable_resource_id = R_DIRECTPRINT_LOCALISABLE_APP_INFO;
+
+ hidden = KAppIsHidden;
+ embeddability=KAppNotEmbeddable;
+ newfile=KAppDoesNotSupportNewFile;
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/engine/inc/directprintband.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* Test print band ECOM plugin
+*
+*/
+
+// Protection against nested includes
+#ifndef DIRECTPRINTBAND_H
+#define DIRECTPRINTBAND_H
+
+// System includes
+#include <e32std.h>
+#include <e32base.h>
+#include <gdi.h>
+#include <ecom/ecom.h>
+
+// Forward declarations
+class CDirectPrintBand;
+class CPrintSetup;
+class RXmlEngDocument;
+class MPageRegionPrinter;
+
+// CLASS DECLARATION
+
+/**
+ * CDirectPrintBand
+ *
+ */
+class CDirectPrintBand : public CBase
+ {
+public:
+ inline static CDirectPrintBand* NewL(TUid aImplementationUid);
+ virtual ~CDirectPrintBand();
+
+ /**
+ * Initialize the print band
+ *
+ * @param aPrintSetup Pointer to the CPrintSetup
+ * @param aParam Xml parameter object
+ * @param aFileName Sets the file name if define the file name to xml,
+ * Not set if not define the file name to xml
+ */
+ virtual void InitPrintBandL(CPrintSetup* aPrintSetup,
+ RXmlEngDocument* aParam,
+ const TDesC& aFileName) = 0;
+
+ /**
+ * Return the print band object
+ *
+ * @return MPageRegionPrinter* Pointer to the print band object
+ */
+ virtual MPageRegionPrinter* RegionPrinter() = 0;
+
+ /**
+ * Return the total page number
+ *
+ * @return TInt the total page number
+ */
+ virtual TInt PageNum() = 0;
+
+public:
+ TUid iDtorIdKey;
+ };
+
+inline CDirectPrintBand* CDirectPrintBand::NewL(TUid aImplementationUid)
+ { // static
+ TAny* any = REComSession::CreateImplementationL(aImplementationUid,
+ _FOFF(CDirectPrintBand, iDtorIdKey));
+ CDirectPrintBand* plugin = reinterpret_cast<CDirectPrintBand*>(any);
+ return plugin;
+ }
+
+inline CDirectPrintBand::~CDirectPrintBand()
+ {
+ REComSession::DestroyedImplementation(iDtorIdKey);
+ }
+
+#endif // DIRECTPRINTBAND_H
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/engine/inc/directprintbanduid.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* Test print band ECOM plugin
+*
+*/
+
+// Protection against nested includes
+#ifndef DIRECTPRINTBANDUID_H
+#define DIRECTPRINTBANDUID_H
+
+// The UIDs are defined for Direct Print band plugin
+
+// Interface Uid for print band plugin
+#define KDirectPrintBandInterfaceUid 0x2002BB30
+
+#endif // DIRECTPRINTBANDUID_H
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/engine/inc/directprintbasecapability.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef DIRECTPRINTBASECAPABILITY_H
+#define DIRECTPRINTBASECAPABILITY_H
+
+// System includes
+#include <e32std.h>
+#include <e32base.h>
+#include <aknsettingitemlist.h>
+
+// TYPE DEFINITIONS
+typedef TBuf<64> TCapabilityTitle;
+
+/**
+ *
+ * Capability base class, pure virtual, needs to be derived
+ *
+ */
+class CDirectPrintBaseCapability : public CBase
+ {
+ public: // New methods
+
+ virtual ~CDirectPrintBaseCapability() {};
+
+ /**
+ * Creates text for the setting item list box
+ *
+ * @return Correctly formatted list box text
+ */
+ virtual HBufC* ListBoxTextL() = 0;
+
+ /**
+ * Clones and returns copy of itself
+ *
+ * @return Cloned copy of the instance itself
+ */
+ virtual CDirectPrintBaseCapability* CloneL() = 0;
+
+ /**
+ * Creates CAknSettingItem for the list box
+ *
+ * @return CAknSettingItem object
+ */
+ virtual CAknSettingItem* SettingItemLC(TInt aIndex) = 0;
+
+ public: // Data
+
+ // The index on the list from the top (0 = topmost)
+ TBool iIndexOnList;
+
+ // Title of this capability
+ TCapabilityTitle iTitle;
+
+ // UID of the capability
+ TInt iUid;
+
+ // Value
+ TInt iValue;
+ };
+
+#endif // DIRECTPRINTBASECAPABILITY_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/engine/inc/directprintengine.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,197 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef __DIRECTPRINTENGINE_H__
+#define __DIRECTPRINTENGINE_H__
+
+// INCLUDES
+#include <e32base.h>
+#include <prninf.h> // MPrintProcessObserver
+#include <prnsetup.h> // CPrintSetup
+#include <fldbltin.h> // MFieldNumPagesInfo
+#include <gdi.h> // CPrinterModelList
+#include <AknProgressDialog.h> // CAknProgressDialog
+#include <EIKPROGI.H>
+#include <xmlengdocument.h> // RXmlEngDocument
+#include "DirectPrintEngineObserver.h"
+#include "directprintband.h"
+
+// CLASS DECLARATION
+class CDirectPrintModel;
+
+class CDirectPrintEngine : public CBase,
+ public MPrintProcessObserver,
+ public MFieldNumPagesInfo,
+ public MProgressDialogCallback
+ {
+public:
+ // Constructors and destructor
+
+ /**
+ * Two-phased constructor.
+ */
+ static CDirectPrintEngine* NewL(CDirectPrintModel& aModel);
+
+ /**
+ * Two-phased constructor.
+ */
+ static CDirectPrintEngine* NewLC(CDirectPrintModel& aModel);
+
+ /**
+ * Destructor.
+ */
+ virtual ~CDirectPrintEngine();
+
+ // from MPrintProcessObserver
+ virtual void NotifyPrintStarted(TPrintParameters aPrintParams);
+ virtual void NotifyBandPrinted(TInt aPercent, TInt aCurrentPageNum, TInt aCurrentCopyNum);
+ virtual void NotifyPrintEnded(TInt aErrNum);
+
+ // from MFieldNumPagesInfo
+ virtual TInt UpdateFieldNumPages()const;
+
+ // from MProgressDialogCallback
+ /**
+ * DialogDismissedL
+ * Called when/if the dialog has been dismissed.
+ * @param aButtonId
+ */
+ void DialogDismissedL( TInt aButtonId );
+
+ // New functions
+ void SetObserver(MDirectPrintEngineObserver* aObserver);
+
+ TInt ModelCount();
+ void ModelName(TInt aIndex, TDes& aDes);
+ TUid ModelUid(TInt aIndex);
+
+ void SetUseModel(TInt aIndex);
+
+ void PrintL();
+
+ void StartPrintPreviewL();
+ void EndPrintPreview();
+
+ inline CPrintSetup* PrintSetup();
+ inline MPageRegionPrinter* PageRegionPrinter();
+ inline TInt PageCounter();
+ inline TInt MaxPageNum();
+
+ void SetParamL(RXmlEngDocument* aParam);
+
+protected:
+ /**
+ * Constructor for performing 1st stage construction
+ */
+ CDirectPrintEngine(CDirectPrintModel& aModel);
+
+ /**
+ * EPOC default constructor for performing 2nd stage construction
+ */
+ void ConstructL();
+
+private:
+ // New functions
+ void DoPrintL(CPrinterPort* aPort);
+
+ void StartPrintProgressNoteL();
+ void EndPrintProgressNoteL();
+ void UpdatePrintProgressNoteL(TInt aPage);
+ void SearchPluginFromFilenameL(const TDesC& aFileName);
+ void LoadPluginFromUidL(const TUid aUid);
+
+ static void CleanupBand( TAny* aData );
+
+private:
+ // Observer
+ MDirectPrintEngineObserver* iObserver;
+
+ // Model object
+ CDirectPrintModel& iModel;
+
+ // File server session
+ RFs iFs;
+ // Member Variable for CPrintSetup
+ CPrintSetup* iPrintSetup;
+
+ // Member Variable for print model name
+ CPrinterModelList* iModelList;
+
+ // Member Variable for page counter
+ TInt iPageCounter;
+
+ // Member Variable for total page
+ TInt iMaxPageNum;
+
+ // Member Variable for total page
+ TInt iModelIndex;
+
+ CDirectPrintBand* iPrintBand;
+ //MPageRegionPrinter* iRegionPrinter;
+
+ /**
+ * iProgressDialog
+ * Owned
+ */
+ CAknProgressDialog* iProgressDialog;
+ /**
+ * iProgressInfo
+ * Not owned by CAknExNoteContainer object.
+ */
+ CEikProgressInfo* iProgressInfo;
+
+ HBufC* iProgressMessage;
+
+ //TBuf<255> iParam;
+ RXmlEngDocument* iParam;
+
+ // identifer returned by ECom
+ TUid iDtorIdKey;
+
+ // last error
+ TInt iLastError;
+ };
+
+inline CPrintSetup* CDirectPrintEngine::PrintSetup()
+ {
+ return iPrintSetup;
+ }
+
+inline MPageRegionPrinter* CDirectPrintEngine::PageRegionPrinter()
+ {
+ if (iPrintBand)
+ {
+ return iPrintBand->RegionPrinter();
+ }
+ return NULL;
+ }
+
+inline TInt CDirectPrintEngine::PageCounter()
+ {
+ return iPageCounter;
+ }
+
+inline TInt CDirectPrintEngine::MaxPageNum()
+ {
+ return iMaxPageNum;
+ }
+
+
+#endif // __DIRECTPRINTENGINE_H__
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/engine/inc/directprintengineobserver.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// Protection against nested includes
+#ifndef __DIRECTPRINTENGINEOBSERVER_H__
+#define __DIRECTPRINTENGINEOBSERVER_H__
+
+// INCLUDES
+#include <e32base.h>
+
+// CLASS DECLARATION
+
+class MDirectPrintEngineObserver
+ {
+public:
+ enum TDirectPrintEngineEvents
+ {
+ EDirectPrintEngineEventStartCreatePrintData,
+ EDirectPrintEngineEventFinishCreatePrintData,
+ EDirectPrintEngineEventCancelCreatePrintData,
+ EDirectPrintEngineEventErrorCreatePrintData,
+
+ EDirectPrintEngineEventErrorConnectBearer,
+ EDirectPrintEngineEventConnectedBearer,
+ // add any events, if needed
+
+ // end of event
+ EDirectPrintEngineEventEnd
+ };
+
+public:
+ virtual void HandlePrintEventL(TDirectPrintEngineEvents aEvent, TInt aError, const TDesC& aParam) = 0;
+ };
+
+#endif // __DIRECTPRINTENGINEOBSERVER_H__
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/engine/inc/directprintfloatcapability.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef DIRECTPRINTFLOATCAPABILITY_H
+#define DIRECTPRINTFLOATCAPABILITY_H
+
+// User includes
+#include "directprintbasecapability.h"
+
+/**
+ *
+ * Capability type for float type of settings
+ *
+ */
+class CDirectPrintFloatCapability : public CDirectPrintBaseCapability
+ {
+ public: // Constructors and destructors
+
+ /**
+ * Destructor
+ */
+ virtual ~CDirectPrintFloatCapability();
+
+ public: // Methods derived from CBaseCapability
+
+ virtual HBufC* ListBoxTextL();
+ virtual CDirectPrintBaseCapability* CloneL();
+ virtual CAknSettingItem* SettingItemLC(TInt aIndex);
+
+ public: // New methods
+
+ /**
+ * Sets the values for denominator, numerator and
+ * maximum numerator. Initializes iRealValue at the same time
+ *
+ * @param aDenom Denominator
+ * @param aNumerator Current numerator
+ * @param aMaxNumerator Maximum numerator
+ * @return Error code
+ */
+ TInt SetValues( TInt aDenom, TInt aNumerator, TInt aMaxNumerator );
+
+ /**
+ * Returns numerator
+ * @return numerator
+ */
+ TInt Numerator() const;
+
+ /**
+ * Returns denominator
+ * @return denominator
+ */
+ TInt Denominator() const;
+
+ private: // Data
+
+ // Denominator / Numerator pair
+ TInt iDenominator;
+ TInt iMaxNumerator;
+
+ TReal iRealValue;
+ };
+
+#endif // DIRECTPRINTFLOATCAPABILITY_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/engine/inc/directprintlistcapability.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef DIRECTPRINTLISTCAPABILITY_H
+#define DIRECTPRINTLISTCAPABILITY_H
+
+// User includes
+#include "directprintbasecapability.h"
+
+/**
+ *
+ * Capability type for list type of settings
+ *
+ */
+class CDirectPrintListCapability : public CDirectPrintBaseCapability
+ {
+ public: // Constructors and destructors
+
+ CDirectPrintListCapability ();
+
+ /**
+ * Destructor
+ */
+ virtual ~CDirectPrintListCapability();
+
+ public: // Methods derived from CBaseCapability
+
+ virtual HBufC* ListBoxTextL();
+ virtual CDirectPrintBaseCapability* CloneL();
+ virtual CAknSettingItem* SettingItemLC(TInt aIndex);
+
+ public: // Data
+
+ // Enumeration IDs and the texts associated to the ids
+ RArray<TInt> iEnumIDs;
+ RPointerArray<HBufC> iTexts;
+
+ TInt iEnumIndex;
+ };
+
+#endif // DIRECTPRINTLISTCAPABILITY_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/engine/inc/directprintprintsettings.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef DIRECTPRINTPRINTSETTINGS_H
+#define DIRECTPRINTPRINTSETTINGS_H
+
+// System includes
+#include <e32std.h>
+#include <e32base.h>
+
+// Forward declarations
+class CDirectPrintBaseCapability;
+
+/**
+ *
+ * Interface to use the device discovery functionality of Image Print Engine
+ *
+ */
+class CDirectPrintPrintSettings : public CBase
+ {
+ public: // Constructors and destructors
+
+ /**
+ * Constructor
+ */
+ CDirectPrintPrintSettings();
+
+ /**
+ * Destructor
+ */
+ virtual ~CDirectPrintPrintSettings();
+
+ public: // New methods
+
+ CDirectPrintPrintSettings* CloneL();
+
+ public: // Data
+
+ // Capability list
+ RPointerArray<CDirectPrintBaseCapability> iCapabilities;
+ };
+
+#endif // DIRECTPRINTPRINTSETTINGS_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/engine/inc/directprintsettingsconverter.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,97 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef DIRECTPRINTSETTINGSCONVERTER_H
+#define DIRECTPRINTSETTINGSCONVERTER_H
+
+#include <e32std.h>
+
+class CDirectPrintTIntCapability;
+class CDirectPrintListCapability;
+class CDirectPrintFloatCapability;
+class CDirectPrintTextCapability;
+class TDirectPrintCapability;
+
+/**
+ *
+ * Utility class for converting capabilities to correct format
+ *
+ */
+class DirectPrintSettingsConverter
+ {
+ public:
+
+ /**
+ * Converts TDirectPrintCapability to CDirectPrintTIntCapability
+ *
+ * @param aCapability Capability coming from the engine
+ * @param aIndexOnList Capability's index on the list box
+ * @param aCapabUid Capability's UID
+ * @return Initialized CDirectPrintTIntCapability instance
+ */
+ static CDirectPrintTIntCapability* AddTIntCapabilityLC(
+ TDirectPrintCapability& aCapability, TInt aIndexOnList, TInt aCapabUid );
+
+ /**
+ * Converts TDirectPrintCapability to CDirectPrintListCapability
+ *
+ * @param aCapability Capability coming from the engine
+ * @param aIndexOnList Capability's index on the list box
+ * @param aCapabUid Capability's UID
+ * @return Initialized CDirectPrintListCapability instance
+ */
+ static CDirectPrintListCapability* AddListCapabilityLC(
+ TDirectPrintCapability& aCapability, TInt aIndexOnList, TInt aCapabUid );
+
+ /**
+ * Converts TDirectPrintCapability to CDirectPrintFloatCapability
+ *
+ * @param aCapability Capability coming from the engine
+ * @param aIndexOnList Capability's index on the list box
+ * @param aCapabUid Capability's UID
+ * @return Initialized CDirectPrintFloatCapability instance
+ */
+ static CDirectPrintFloatCapability* AddFloatCapabilityLC(
+ TDirectPrintCapability& aCapability, TInt aIndexOnList, TInt aCapabUid );
+
+ /**
+ * Converts TDirectPrintCapability to CDirectPrintTextCapability
+ *
+ * @param aCapability Capability coming from the engine
+ * @param aIndexOnList Capability's index on the list box
+ * @param aCapabUid Capability's UID
+ * @return Initialized CDirectPrintTextCapability instance
+ */
+ static CDirectPrintTextCapability* AddTextCapabilityLC(
+ TDirectPrintCapability& aCapability, TInt aIndexOnList, TInt aCapabUid );
+
+ private:
+
+ /**
+ * Creates text string from the enumeration ID
+ *
+ * @param aId Enumeration Id
+ * @return buffer containing the string
+ */
+ static HBufC* TextStringLC( TInt aId );
+ };
+
+#endif // DIRECTPRINTSETTINGSCONVERTER_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/engine/inc/directprintstringids.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef DIRECTPRINTSTRINGIDS_H
+#define DIRECTPRINTSTRINGIDS_H
+
+#include <DirectPrintApp.rsg>
+
+#include "directprintcapabilitycodes.h"
+#include "printmessagecodes.h"
+#include "directprintvariant.h"
+
+const TInt KEmptyString( 0 );
+
+// This table combines the capability IDs with strings so that they
+// can be fetched from the resources
+
+const TInt KConverterTableCount( 18 );
+const TInt KConverterTableIndexCount( 2 );
+const TInt KIDConverterTable[KConverterTableCount][KConverterTableIndexCount] =
+ {
+ { EDirectPrintCapabLayout, R_QTN_STR_TEMPLATE } ,
+ { EDirectPrintCapabQuality, R_QTN_STR_QUALITY },
+ { EDirectPrintCapabQualityDefault, R_QTN_STR_QUAL_AUTO },
+ { EDirectPrintCapabQualityNormal, R_QTN_STR_QUAL_NORMAL },
+ { EDirectPrintCapabQualityDraft, R_QTN_STR_QUAL_DRAFT },
+ { EDirectPrintCapabQualityFine, R_QTN_STR_QUAL_FINE },
+ { EDirectPrintCapabAP, R_QTN_STR_ACCESS_POINT },
+ { EDirectPrintCapabHost, R_QTN_STR_HOST },
+ { EDirectPrintCapabPort, R_QTN_STR_PORT },
+ { EDirectPrintCapabUser, R_QTN_STR_USER },
+ { EDirectPrintCapabQue, R_QTN_STR_QUE },
+ { EDirectPrintCapabExtent, R_QTN_STR_EXTENT },
+ { EDirectPrintCapabExtent2, R_QTN_STR_EXTENT2 },
+ { EDirectPrintCapabExtentSelect1, R_QTN_STR_EXTENT_SELECT1 },
+ { EDirectPrintCapabExtentSelect2, R_QTN_STR_EXTENT_SELECT2 },
+ { EDirectPrintCapabExtentSelect3, R_QTN_STR_EXTENT_SELECT3 },
+ { EDirectPrintCapabExtentSelect4, R_QTN_STR_EXTENT_SELECT4 },
+ { KEmptyString, R_EMPTY }
+ };
+#endif // DIRECTPRINTSTRINGIDS_H
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/engine/inc/directprinttextcapability.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// Protection against nested includes
+#ifndef DIRECTPRINTTEXTCAPABILITY_H
+#define DIRECTPRINTTEXTCAPABILITY_H
+
+// User includes
+#include "directprintbasecapability.h"
+
+/**
+ *
+ * Capability type for TInt type of settings
+ *
+ */
+class CDirectPrintTextCapability : public CDirectPrintBaseCapability
+ {
+public:
+ /** Destructor */
+ virtual ~CDirectPrintTextCapability();
+
+public: // Methods derived from CBaseCapability
+
+ virtual HBufC* ListBoxTextL();
+ virtual CDirectPrintBaseCapability* CloneL();
+ virtual CAknSettingItem* SettingItemLC(TInt aIndex);
+
+public: // Data
+ TBuf<50> iText;
+ };
+
+#endif // DIRECTPRINTTEXTCAPABILITY_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/engine/inc/directprinttintcapability.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef DIRECTPRINTTINTCAPABILITY_H
+#define DIRECTPRINTTINTCAPABILITY_H
+
+// User includes
+#include "directprintbasecapability.h"
+
+/**
+ *
+ * Capability type for TInt type of settings
+ *
+ */
+class CDirectPrintTIntCapability : public CDirectPrintBaseCapability
+ {
+ public: // Constructors and destructors
+
+ /**
+ * Destructor
+ */
+ virtual ~CDirectPrintTIntCapability();
+
+ public: // Methods derived from CBaseCapability
+
+ virtual HBufC* ListBoxTextL();
+ virtual CDirectPrintBaseCapability* CloneL();
+ virtual CAknSettingItem* SettingItemLC(TInt aIndex);
+
+ public: // Data
+
+ // Minimum and maximum value
+ TInt iMin;
+ TInt iMax;
+ };
+
+#endif // DIRECTPRINTTINTCAPABILITY_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/engine/inc/directprintvariant.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// Protection against nested includes
+#ifndef DIRECTPRINTVARIANT_H
+#define DIRECTPRINTVARIANT_H
+
+// Defines dynamic settings to be in use
+#define DIRECT_PRINT_DYNAMIC_PRINT_SETTINGS
+
+#endif // DIRECTPRINTVARIANT_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/engine/src/directprintengine.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,649 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+#include <pdrport.h> // CFilePrinterPort
+#include <TXTETEXT.H> // CEditableText
+#include <TXTRICH.H> // CRichText
+#include <FLDBLTIN.H> // CPageNumField
+#include <flddef.h> // KPageNumberFieldUid, KNumPagesFieldUid
+#include <stringloader.h> // StringLoader
+#include <xmlengdocument.h> // RXmlEngDocument
+#include <xmlengelement.h> // TXmlEngElement
+#include <xmlengattr.h> // TXmlEngAttr
+#include <xmlengnodelist.h> // RXmlEngNodeList
+#include <bautils.h> // BaflUtils
+#include <eikenv.h> // CEikonEnv
+
+#include "clog.h"
+#include <directprintapp.rsg>
+#include "directprintengine.h"
+#include "directprintband.h"
+#include "directprintengineobserver.h"
+#include "directprintmodel.h"
+#include "directprintbanduid.h"
+
+//! Default Page spec in Twips
+#define KDefaultPageSpecInTwips TPageSpec(TPageSpec::EPortrait,TSize(11906,16838))
+
+CDirectPrintEngine::CDirectPrintEngine(CDirectPrintModel& aModel)
+ : iModel(aModel)
+ {
+ }
+
+CDirectPrintEngine::~CDirectPrintEngine()
+ {
+ if (iProgressDialog)
+ {
+ TRAP_IGNORE(iProgressDialog->ProcessFinishedL());
+ delete iProgressDialog;
+ iProgressDialog = NULL;
+ }
+
+ if (iPrintBand)
+ {
+ delete iPrintBand;
+ iPrintBand = NULL;
+ }
+
+ iPrintSetup->FreeModelList();
+ delete iPrintSetup;
+ delete iProgressMessage;
+ iFs.Close();
+ }
+
+CDirectPrintEngine* CDirectPrintEngine::NewL(CDirectPrintModel& aModel)
+ {
+ CDirectPrintEngine* self = CDirectPrintEngine::NewLC(aModel);
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+CDirectPrintEngine* CDirectPrintEngine::NewLC(CDirectPrintModel& aModel)
+ {
+ CDirectPrintEngine* self = new(ELeave) CDirectPrintEngine(aModel);
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ return self;
+ }
+
+void CDirectPrintEngine::ConstructL()
+ {
+ LOG("CDirectPrintEngine::ConstructL BEGIN");
+ iFs.Connect();
+
+ iPrintSetup = CPrintSetup::NewL();
+ iPrintSetup->AddPrinterDriverDirL(KDefaultPrinterDriverPath);
+ iModelList = iPrintSetup->ModelNameListL(iFs);
+
+#ifdef _DEBUG
+ LOG1("ModelCount=[%d]", ModelCount());
+ for (TInt i=0; i < ModelCount(); i++)
+ {
+ TPrinterModelEntry entry = (*iModelList)[i];
+ RDebug::Print(_L("[%d][%S][%d] "), i, &(entry.iModelName), entry.iRequiresPrinterPort);
+ LOG1("ModelName=[%S]", &(entry.iModelName));
+ }
+#endif
+ // read progress message
+ iProgressMessage = StringLoader::LoadL( R_DIRECTPRINT_MSG_PRINTING_PROGRESS );
+
+ LOG("CDirectPrintEngine::ConstructL END");
+ }
+
+void CDirectPrintEngine::SetObserver(MDirectPrintEngineObserver* aObserver)
+ {
+ iObserver = aObserver;
+ }
+
+/**
+ Override of base class virtual.
+ Notifies that a print or print preview operation is about to begin.
+ */
+void CDirectPrintEngine::NotifyPrintStarted(TPrintParameters /*aPrintParams*/)
+ {
+ iPageCounter = 0;
+ TRAPD(err, StartPrintProgressNoteL());
+ iLastError = err;
+ }
+
+/**
+ Override of base class virtual.\n
+ Notifies that a band is about to be printed used to display print progress information,
+ including the current page number.\n
+ It is called immediately before each band is printed.\n
+ */
+void CDirectPrintEngine::NotifyBandPrinted(TInt /*aPercent*/, TInt aCurrentPageNum, TInt /*aCurrentCopyNum*/)
+ {
+ if (iPageCounter==0)
+ {
+ // start print
+ }
+ if (iPageCounter<aCurrentPageNum)
+ {
+ // next page
+ iPageCounter = aCurrentPageNum;
+ TRAPD(err, UpdatePrintProgressNoteL(iPageCounter));
+ iLastError = err;
+ }
+ }
+
+/**
+ Override of base class virtual.\n
+ Notifies that the print or print preview operation has completed.\n
+ used to display information about how the operation completed,
+ for example any errors that occurred.\n
+ */
+void CDirectPrintEngine::NotifyPrintEnded(TInt aErr)
+ {
+ CActiveScheduler::Stop();
+ TInt err = KErrNone;
+
+ if (aErr == KErrNone)
+ {
+ if (iObserver)
+ {
+ TRAP(err, iObserver->HandlePrintEventL(MDirectPrintEngineObserver::EDirectPrintEngineEventFinishCreatePrintData, 0, KNullDesC));
+ }
+ }
+ else
+ {
+ switch (aErr)
+ {
+ case KErrCancel:
+ if (iObserver)
+ {
+ TRAP(err, iObserver->HandlePrintEventL(MDirectPrintEngineObserver::EDirectPrintEngineEventCancelCreatePrintData, aErr, KNullDesC));
+ }
+ break;
+ default:
+ if (iObserver)
+ {
+ TRAP(err, iObserver->HandlePrintEventL(MDirectPrintEngineObserver::EDirectPrintEngineEventErrorCreatePrintData, aErr, KNullDesC));
+ }
+ break;
+ }
+ }
+
+ TRAP(err, EndPrintProgressNoteL());
+ }
+
+/**
+ Override of base class virtual.\n
+ Returns the number of pages in the current document.\n
+ @return - TInt (Number of pages).\n
+ */
+TInt CDirectPrintEngine::UpdateFieldNumPages()const
+ {
+ return iMaxPageNum;
+ }
+
+
+void CDirectPrintEngine::PrintL()
+ {
+
+ // set the total page
+ iMaxPageNum = 1;
+ iPrintSetup->Header()->SetNumPagesInfo(*this);
+
+ TInt modelNum = iModelList->UidToNum(ModelUid(iModelIndex));
+ iPrintSetup->CreatePrinterDeviceL(modelNum);
+
+ // create a port if necessary
+ CPrinterPort* port=NULL;
+ if ((*iModelList)[modelNum].iRequiresPrinterPort)
+ {
+#ifdef __WINSCW__
+ port = CFilePrinterPort::NewL(_L("c:\\fpr.pcl"));
+#else
+// port = CFilePrinterPort::NewL(_L("e:\\fpr.pcl"));
+ port = CFilePrinterPort::NewL(_L("c:\\fpr.pcl"));
+#endif
+ }
+
+ iPrintSetup->PrinterDevice()->SelectPageSpecInTwips(KDefaultPageSpecInTwips);
+ iPrintSetup->iPageMarginsInTwips.iHeaderOffset = 720;
+ iPrintSetup->iPageMarginsInTwips.iFooterOffset = 0;
+ iPrintSetup->iPageMarginsInTwips.iMargins.iLeft = 1440; // 1 inch
+ iPrintSetup->iPageMarginsInTwips.iMargins.iRight = 1440;
+ iPrintSetup->iPageMarginsInTwips.iMargins.iTop = 1440;
+ iPrintSetup->iPageMarginsInTwips.iMargins.iBottom = 1440;
+
+ if (iObserver)
+ {
+ iObserver->HandlePrintEventL(MDirectPrintEngineObserver::EDirectPrintEngineEventStartCreatePrintData, 0, KNullDesC);
+ }
+
+
+ TRAPD(err, DoPrintL(port));
+ if (err == KErrNone)
+ {
+ CActiveScheduler::Start(); // stopped by killing it - subtle...
+ }
+ else
+ {
+ if (iObserver)
+ {
+ iObserver->HandlePrintEventL(MDirectPrintEngineObserver::EDirectPrintEngineEventErrorCreatePrintData, err, KNullDesC);
+ }
+ }
+
+// if (iPrintBand)
+// {
+// delete iPrintBand;
+// iPrintBand = NULL;
+// }
+ }
+
+void CDirectPrintEngine::DoPrintL(CPrinterPort* aPort)
+ {
+ // create a header
+ iPrintSetup->Header()->CreateTextL();
+ TBuf<40> buf(_L("This is the header on page out of "));
+ buf.Append(CEditableText::EParagraphDelimiter);
+ iPrintSetup->Header()->Text()->InsertL(0,buf);
+ CTextField* pNumberfield=iPrintSetup->Header()->Text()->NewTextFieldL(KPageNumberFieldUid);
+ iPrintSetup->Header()->Text()->InsertFieldL(27,pNumberfield,KPageNumberFieldUid);
+ CNumPagesField* numPagesField=(CNumPagesField*)iPrintSetup->Header()->Text()->NewTextFieldL(KNumPagesFieldUid);
+ iPrintSetup->Header()->Text()->InsertFieldL(35,numPagesField,KNumPagesFieldUid);
+ iPrintSetup->Header()->Text()->UpdateFieldL(27);
+ iPrintSetup->Header()->Text()->UpdateFieldL(35);
+ iPrintSetup->Header()->SetFirstPageToPrintTo(1); // no header on first 3 pages
+
+ iPrintSetup->Footer()->CreateTextL();
+ TBuf<40> buf2(_L("This is the footer on page "));
+ buf2.Append(CEditableText::EParagraphDelimiter);
+ iPrintSetup->Footer()->Text()->InsertL(0,buf2);
+ CTextField* pNumberfield2=iPrintSetup->Footer()->Text()->NewTextFieldL(KPageNumberFieldUid);
+ iPrintSetup->Footer()->Text()->InsertFieldL(27,pNumberfield2,KPageNumberFieldUid);
+ iPrintSetup->Footer()->Text()->UpdateFieldL(27);
+
+ // start print to file
+ iPrintSetup->iNumOfFirstPage = 1;
+ TPrintParameters params;
+ params.iFirstPage = 1; // don't print the first page at all, ie print page no's 3-6
+ params.iLastPage = 1;
+ params.iNumCopies = 1;
+ TPageSpec spec;
+ spec.iPortraitPageSize = KA4PaperSizeInTwips;
+ spec.iOrientation = TPageSpec::EPortrait;
+ iPrintSetup->PrinterDevice()->SelectPageSpecInTwips(spec);
+
+ //===========================
+ // start printing
+ //===========================
+ iPrintSetup->StartPrintL(params, *(PageRegionPrinter()), aPort, this);
+
+ }
+
+
+TInt CDirectPrintEngine::ModelCount()
+ {
+ return iModelList->ModelCount();
+ }
+
+void CDirectPrintEngine::ModelName(TInt aIndex, TDes& aDes)
+ {
+ TPtrC name((*iModelList)[aIndex].iModelName);
+ if (name.Length() <= aDes.MaxLength())
+ {
+ aDes.Copy(name);
+ }
+ }
+
+TUid CDirectPrintEngine::ModelUid(TInt aIndex)
+ {
+ return (*iModelList)[aIndex].iUid;
+ }
+
+void CDirectPrintEngine::SetUseModel(TInt aIndex)
+ {
+ iModelIndex = aIndex;
+ }
+
+void CDirectPrintEngine::StartPrintProgressNoteL()
+ {
+ // Delete possible previous CAknProgressDialog.
+ delete iProgressDialog;
+ iProgressDialog = NULL;
+
+ // Create new CAknProgressDialog.
+ iProgressDialog = new ( ELeave ) CAknProgressDialog( reinterpret_cast
+ <CEikDialog**>
+ ( &iProgressDialog ) );
+
+ iProgressDialog->SetCallback( this );
+ iProgressDialog->PrepareLC( R_DIRECTPRINT_PRINT_PROGRESS_NOTE );
+ iProgressInfo = iProgressDialog->GetProgressInfoL();
+ iProgressInfo->SetFinalValue( iMaxPageNum );
+
+ TBuf<32> msg;
+ msg.AppendFormat(*iProgressMessage, iPageCounter, iMaxPageNum);
+ iProgressDialog->SetTextL(msg);
+ iProgressDialog->RunLD();
+ }
+
+void CDirectPrintEngine::EndPrintProgressNoteL()
+ {
+ if (iProgressDialog)
+ {
+ iProgressDialog->ProcessFinishedL();
+ delete iProgressDialog;
+ iProgressDialog = NULL;
+ }
+ }
+
+void CDirectPrintEngine::UpdatePrintProgressNoteL(TInt aPage)
+ {
+ if (iProgressInfo)
+ {
+ TBuf<32> msg;
+ msg.AppendFormat(*iProgressMessage, aPage, iMaxPageNum);
+ iProgressDialog->SetTextL(msg);
+ iProgressInfo->SetAndDraw(aPage);
+ }
+ }
+
+void CDirectPrintEngine::DialogDismissedL( TInt /*aButtonId*/ )
+ {
+ if (iPrintSetup)
+ {
+ iPrintSetup->EndPrint();
+ }
+ }
+
+void CDirectPrintEngine::StartPrintPreviewL()
+ {
+ // Clear previous object
+ EndPrintPreview();
+
+ // set the total page
+ iMaxPageNum = 1;
+ iPrintSetup->Header()->SetNumPagesInfo(*this);
+
+ TInt modelNum = iModelList->UidToNum(ModelUid(iModelIndex));
+ iPrintSetup->CreatePrinterDeviceL(modelNum);
+
+ // create a port if necessary
+ //CPrinterPort* port=NULL;
+ //if ((*iModelList)[modelNum].iRequiresPrinterPort)
+ // {
+ // port = CFilePrinterPort::NewL(_L("e:\\fpr.pcl"));
+ // }
+
+ iPrintSetup->PrinterDevice()->SelectPageSpecInTwips(KDefaultPageSpecInTwips);
+ iPrintSetup->iPageMarginsInTwips.iHeaderOffset = 720;
+ iPrintSetup->iPageMarginsInTwips.iFooterOffset = 0;
+ iPrintSetup->iPageMarginsInTwips.iMargins.iLeft = 1440; // 1 inch
+ iPrintSetup->iPageMarginsInTwips.iMargins.iRight = 1440;
+ iPrintSetup->iPageMarginsInTwips.iMargins.iTop = 1440;
+ iPrintSetup->iPageMarginsInTwips.iMargins.iBottom = 1440;
+ }
+
+void CDirectPrintEngine::EndPrintPreview()
+ {
+ }
+
+void CDirectPrintEngine::SetParamL(RXmlEngDocument* aParam)
+ {
+ LOG("CDirectPrintEngine::SetParamL BEGIN");
+
+ iParam = aParam;
+ if ( iPrintBand )
+ {
+ delete iPrintBand;
+ iPrintBand = NULL;
+ }
+
+ _LIT8(KElementRecogMode, "RecognizeMode");
+ _LIT8(KElementRecogModeAttr, "mode");
+ _LIT8(KElementRecogModeValueFile, "PrintRecognizeModeFile");
+ _LIT8(KElementRecogModeValuePlugin, "PrintRecognizeModePlugin");
+ _LIT8(KElementFile, "PrintFile");
+ _LIT8(KElementFileAttr, "file");
+ _LIT8(KElementPluginUid, "PluginUid");
+ _LIT8(KElementPluginUidAttr, "uid");
+
+ TXmlEngElement element = iParam->DocumentElement().FirstChild().AsElement();
+ HBufC* filename = NULL;
+ TUint uidValue = 0;
+
+ enum {
+ EParamModeFile = 0x0001,
+ EParamModePlugin = 0x0002,
+ EParamFileExist = 0x0008,
+ EParamPluginExist = 0x0010
+ };
+ TUint paramFlag = 0;
+
+ while (element.NotNull())
+ {
+ if (element.Name().CompareF(KElementRecogMode()) == 0)
+ {
+ TXmlEngAttr attr = element.AttributeNodeL(KElementRecogModeAttr,KNullDesC8);
+ if(attr.Value().CompareF(KElementRecogModeValueFile) == 0)
+ {
+ paramFlag |= EParamModeFile;
+ LOG("Param:Mode=File");
+ }
+ else if(attr.Value().CompareF(KElementRecogModeValuePlugin) == 0)
+ {
+ paramFlag |= EParamModePlugin;
+ LOG("Param:Mode=Plugin");
+ }
+ else
+ {
+ LOG("[Error] Param:Mode=Not set");
+ break;
+ }
+ }
+ else if (element.Name().CompareF(KElementFile()) == 0)
+ {
+ TXmlEngAttr attr = element.AttributeNodeL(KElementFileAttr,KNullDesC8);
+ filename = HBufC::NewLC(attr.Value().Length());
+ TPtr ptr(filename->Des());
+ ptr.Copy(attr.Value());
+ if (ptr.Length() > 0)
+ {
+ LOG1("Param:FileName UID=[%S]", &ptr);
+ if (BaflUtils::FileExists(CEikonEnv::Static()->FsSession(), ptr))
+ {
+ paramFlag |= EParamFileExist;
+ }
+ }
+ if (!(paramFlag & EParamFileExist))
+ {
+ LOG("[Error] File not exist");
+ }
+ }
+ else if (element.Name().CompareF(KElementPluginUid()) == 0)
+ {
+ TXmlEngAttr attr = element.AttributeNodeL(KElementPluginUidAttr,KNullDesC8);
+ //HBufC8* bufUid = HBufC8::NewLC(attr.Value().Length());
+ //TPtr8 ptr(bufUid->Des());
+ HBufC* bufUid = HBufC::NewLC(attr.Value().Length());
+ TPtr ptr(bufUid->Des());
+ ptr.Copy(attr.Value());
+ //_LIT8(KHeadOfHexString, "0x");
+ _LIT(KHeadOfHexString, "0x");
+ const TInt KUidStingLength = 8;
+ if (ptr.Left(KHeadOfHexString().Length()).CompareF(KHeadOfHexString()) == 0)
+ {
+ ptr.Delete(0, KHeadOfHexString().Length());
+ }
+ if (ptr.Length() == KUidStingLength)
+ {
+ //TBuf<8> bufUid;
+ //bufUid.Copy(ptr);
+ //TLex lex(bufUid);
+ TLex lex(ptr);
+ if (lex.Val(uidValue,EHex) == KErrNone)
+ {
+ LOG1("Param:Plugin UID=[0x%X]", uidValue);
+ paramFlag |= EParamPluginExist;
+ }
+ else
+ {
+ LOG("[Error] Convert from HEX string to int");
+ }
+ }
+ if (!(paramFlag & EParamPluginExist))
+ {
+ LOG("[Error] File not exist");
+ }
+ CleanupStack::PopAndDestroy(bufUid); //bufUid
+ }
+
+ if (paramFlag == (EParamFileExist|EParamModeFile)
+ || paramFlag == (EParamPluginExist|EParamModePlugin))
+ {
+ break;
+ }
+ element = element.NextSibling().AsElement();
+ }
+
+ if (paramFlag == (EParamFileExist|EParamModeFile)
+ && filename)
+ {
+ TPtrC ptr(filename->Des());
+ SearchPluginFromFilenameL(ptr);
+ }
+ if (paramFlag == (EParamPluginExist|EParamModePlugin)
+ && uidValue)
+ {
+ TUid uid = TUid::Uid(uidValue);
+ LoadPluginFromUidL(uid);
+ }
+
+ if (filename)
+ {
+ CleanupStack::PopAndDestroy(filename); //filename
+ }
+
+ if ( !iPrintBand )
+ {
+ // error xml parameter
+ User::Leave(KErrArgument);
+ }
+
+ LOG("CDirectPrintEngine::SetParamL END");
+ }
+
+void CDirectPrintEngine::SearchPluginFromFilenameL(const TDesC& aFileName)
+ {
+ LOG("CDirectPrintEngine::SearchPluginFromFilenameL START");
+ RImplInfoPtrArray infoArray;
+ TUid interface = TUid::Uid(KDirectPrintBandInterfaceUid);
+ REComSession::ListImplementationsL( interface, infoArray );
+ CleanupClosePushL( infoArray );
+ LOG1("CDirectPrintEngine::SearchPluginFromFilenameL infoArray.Count(): %d", infoArray.Count());
+
+ TParsePtrC parse(aFileName);
+
+ TPtrC8 dataType;
+ TPtrC16 dispName;
+ TPtrC8 opaqueData;
+ HBufC* dataTypeBuf = NULL;
+ TBool bFound = EFalse;
+ TInt findLen;
+ const TChar KDataTypeSeparator = '|';
+
+ for( TInt i = 0; i < infoArray.Count(); i++ )
+ {
+ LOG1("[InfoArray] i=%d", i);
+ CImplementationInformation* info = infoArray[i];
+ dataType.Set( info->DataType() );
+ dispName.Set( info->DisplayName() );
+ opaqueData.Set( info->OpaqueData() );
+
+ dataTypeBuf = HBufC::NewLC( dataType.Length() );
+ TPtr dataTypePtr(dataTypeBuf->Des());
+ dataTypePtr.Copy( dataType );
+
+ LOG1("[DataType]=[%S]", &dataTypePtr);
+ FOREVER
+ {
+ findLen = dataTypePtr.Locate( KDataTypeSeparator );
+ if (findLen < 0)
+ {
+ // the separator is not found
+ if (dataTypePtr.Length() > 0)
+ {
+ findLen = dataTypePtr.Length();
+ }
+ else
+ {
+ break;
+ }
+ }
+// LOG1("[Compare]=[%S]", &(dataTypePtr.Left( findLen )));
+// LOG1("[Ext]=[%S]", &(parse.Ext()));
+// LOG1("[Comp]=[%S]", &(dataTypePtr.Left( findLen )));
+ if ( parse.Ext().CompareF( dataTypePtr.Left( findLen ) ) == 0 )
+ {
+ bFound = ETrue;
+ break;
+ }
+ dataTypePtr.Delete( 0, findLen+1 );
+ }
+
+ CleanupStack::PopAndDestroy(dataTypeBuf); // dataTypeBuf
+
+ if ( bFound )
+ {
+ LOG("Match!!!");
+ LoadPluginFromUidL(info->ImplementationUid());
+ break;
+ }
+ }
+
+ infoArray.ResetAndDestroy();
+ CleanupStack::PopAndDestroy(&infoArray); // infoArray
+
+ LOG("CDirectPrintEngine::SearchPluginFromFilenameL End");
+ }
+
+void CDirectPrintEngine::LoadPluginFromUidL(const TUid aUid)
+ {
+ LOG1("CDirectPrintEngine::LoadPluginFromUidL(0x%X) Start", aUid.iUid);
+
+ CDirectPrintBand* band = NULL;
+ band = CDirectPrintBand::NewL(aUid);
+ TCleanupItem clItem( CleanupBand, band );
+ CleanupStack::PushL( clItem );
+ band->InitPrintBandL( iPrintSetup,
+ iParam,
+ KNullDesC );
+ CleanupStack::Pop(); // band
+ iPrintBand = band;
+
+ LOG("CDirectPrintEngine::LoadPluginFromUidL End");
+ }
+
+void CDirectPrintEngine::CleanupBand( TAny* aData )
+ {
+ LOG("[CDirectPrintEngine::CleanupBand]\t Begin");
+
+ CDirectPrintBand* band = (CDirectPrintBand*)aData;
+ delete band;
+
+ LOG("[CDirectPrintEngine::CleanupBand]\t End");
+ }
+
+
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/engine/src/directprintfloatcapability.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,119 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// System include files
+#include <aknquerydialog.h>
+#include <stringloader.h>
+#include <DirectPrintApp.rsg>
+
+#include "directprintfloatcapability.h"
+
+const TInt KMaxTRealCharNum( 30 );
+const TInt KDecimals( 2 );
+
+// Destructor
+CDirectPrintFloatCapability::~CDirectPrintFloatCapability()
+ {
+ }
+
+// Creates text string for the settings list box
+HBufC* CDirectPrintFloatCapability::ListBoxTextL()
+ {
+ const TInt KGranularity( 4 );
+ TRealFormat format( KMaxTRealCharNum, KDecimals );
+ TBuf<KMaxTRealCharNum> numStr;
+
+ numStr.Zero();
+ numStr.AppendNum( iRealValue, format );
+
+ CDesCArrayFlat* strings = new ( ELeave ) CDesCArrayFlat( KGranularity );
+ CleanupStack::PushL( strings );
+ strings->AppendL( iTitle );
+ strings->AppendL( numStr );
+
+ HBufC* buf = StringLoader::LoadL( R_QTN_LBOX_FORMAT, *strings );
+ CleanupStack::PopAndDestroy(); // strings
+
+ return buf;
+ }
+
+// Clones itself
+CDirectPrintBaseCapability* CDirectPrintFloatCapability::CloneL()
+ {
+ CDirectPrintFloatCapability* clone = new ( ELeave ) CDirectPrintFloatCapability;
+
+ clone->iDenominator = iDenominator;
+ clone->iIndexOnList = iIndexOnList;
+ clone->iMaxNumerator = iMaxNumerator;
+ clone->iValue = iValue;
+ clone->iTitle = iTitle;
+ clone->iUid = iUid;
+ clone->iRealValue = iRealValue;
+
+ return clone;
+ }
+
+// Sets the new values and checks the boundaries
+TInt CDirectPrintFloatCapability::SetValues(
+ TInt aDenom,
+ TInt aNumerator,
+ TInt aMaxNumerator )
+ {
+ TInt err( KErrNone );
+
+ if ( aNumerator > aMaxNumerator )
+ {
+ err = KErrArgument;
+ }
+ else
+ {
+ iDenominator = aDenom;
+ iValue = aNumerator;
+ iMaxNumerator = aMaxNumerator;
+ if( iDenominator != 0 )
+ {
+ iRealValue = TReal( iValue )/TReal( iDenominator );
+ }
+ }
+
+ return err;
+ }
+
+// Numerator
+TInt CDirectPrintFloatCapability::Numerator() const
+ {
+ return iValue;
+ }
+
+// Denominator
+TInt CDirectPrintFloatCapability::Denominator() const
+ {
+ return iDenominator;
+ }
+
+// Creates setting item for the settings list box
+CAknSettingItem* CDirectPrintFloatCapability::SettingItemLC(TInt aIndex)
+ {
+ CAknIntegerEdwinSettingItem* item = new (ELeave) CAknIntegerEdwinSettingItem(aIndex, iValue); // Not Float Edwin
+ CleanupStack::PushL(item);
+ item->ConstructL(EFalse, aIndex, iTitle, NULL, R_DIRECTPRINT_PROPERTYSETTING_INTEGER_SETTING_PAGE, -1);
+
+ return item;
+ }
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/engine/src/directprintlistcapability.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,131 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// System include files
+#include <stringloader.h>
+#include <aknqueryvaluetext.h>
+#include <aknpopupsettingpage.h>
+#include <badesca.h>
+#include <DirectPrintApp.rsg>
+
+#include "directprintlistcapability.h"
+#include "tprinter.h"
+#include "directprintcapabilitycodes.h"
+
+const TInt KArrayGranularity( 4 );
+
+CDirectPrintListCapability::CDirectPrintListCapability()
+ {
+ }
+
+// Destructor
+CDirectPrintListCapability::~CDirectPrintListCapability()
+ {
+ iEnumIDs.Close();
+ iTexts.ResetAndDestroy();
+ }
+
+// Creates text string for the settings list box
+HBufC* CDirectPrintListCapability::ListBoxTextL()
+ {
+ CDesCArrayFlat* strings =
+ new ( ELeave ) CDesCArrayFlat( KArrayGranularity );
+ CleanupStack::PushL( strings );
+ strings->AppendL( iTitle );
+
+ TInt i( 0 );
+ TInt num( iEnumIDs.Count() );
+ TBool found( EFalse );
+ // Find the matching text based on the enumeration value
+ for ( i = 0; i < num && !found; i++ )
+ {
+ if ( iEnumIDs[i] == iValue )
+ {
+ strings->AppendL( iTexts[i]->Des() );
+ found = ETrue;
+ }
+ }
+
+ if ( !found )
+ {
+ User::Leave( KErrNotFound );
+ }
+
+ HBufC* buf = StringLoader::LoadL( R_QTN_LBOX_FORMAT, *strings );
+ CleanupStack::PopAndDestroy(); // strings
+
+ return buf;
+ }
+
+// Clones itself
+CDirectPrintBaseCapability* CDirectPrintListCapability::CloneL()
+ {
+ CDirectPrintListCapability* clone = new ( ELeave ) CDirectPrintListCapability();
+ CleanupStack::PushL( clone );
+
+ clone->iValue = iValue;
+ clone->iIndexOnList = iIndexOnList;
+ clone->iTitle = iTitle;
+ clone->iUid = iUid;
+
+ TInt num( iEnumIDs.Count() );
+ if ( iUid != EDirectPrintCapabLayout )
+ {
+ for ( TInt j = 0; j < num; j++ )
+ {
+ User::LeaveIfError( clone->iEnumIDs.Append( iEnumIDs[j] ) );
+ User::LeaveIfError( clone->iTexts.Append( iTexts[j]->AllocLC() ) );
+ CleanupStack::Pop(); // clone->iTexts
+ }
+ }
+
+ CleanupStack::Pop(); // clone
+ return clone;
+ }
+
+// Creates setting item for the settings list box
+CAknSettingItem* CDirectPrintListCapability::SettingItemLC(TInt aIndex)
+ {
+ CAknEnumeratedTextPopupSettingItem* item = new (ELeave) CAknEnumeratedTextPopupSettingItem(aIndex, iEnumIndex);
+ CleanupStack::PushL(item);
+ item->ConstructL(EFalse, aIndex, iTitle, NULL, R_DIRECTPRINT_PRINTERSETTING_POPUP_SETTING_PAGE, -1, 0, R_DIRECTPRINT_PRINTERSETTING_POPUP_SETTING_TEXTS);
+
+ TInt count = iTexts.Count();
+ if (count > 0)
+ {
+ item->EnumeratedTextArray()->ResetAndDestroy();
+ }
+ for (TInt i=0; i<count; i++ )
+ {
+ CAknEnumeratedText* enumText;
+ enumText = new (ELeave) CAknEnumeratedText(i, iTexts[i]->AllocLC());
+ CleanupStack::Pop();
+ CleanupStack::PushL(enumText);
+ item->EnumeratedTextArray()->AppendL(enumText);
+ CleanupStack::Pop();
+
+ if (iValue == iEnumIDs[i])
+ {
+ iEnumIndex = i;
+ }
+ }
+
+ return item;
+ }
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/engine/src/directprintprintsettings.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// User include files
+#include "directprintprintsettings.h"
+#include "directprintbasecapability.h"
+
+// CONSTRUCTION
+CDirectPrintPrintSettings::CDirectPrintPrintSettings()
+ {
+ }
+
+// Default destructor
+CDirectPrintPrintSettings::~CDirectPrintPrintSettings()
+ {
+ iCapabilities.ResetAndDestroy();
+ }
+
+// Clone this instance and return it
+CDirectPrintPrintSettings* CDirectPrintPrintSettings::CloneL()
+ {
+ CDirectPrintPrintSettings* clone = new ( ELeave ) CDirectPrintPrintSettings;
+ CleanupStack::PushL( clone );
+
+ TInt i( 0 );
+ TInt num( iCapabilities.Count() );
+ for ( i = 0; i < num; i++ )
+ {
+ User::LeaveIfError(
+ clone->iCapabilities.Append( iCapabilities[i]->CloneL() ) );
+ }
+
+ CleanupStack::Pop(); // clone
+
+ return clone;
+ }
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/engine/src/directprintsettingsconverter.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,240 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// System include files
+#include <stringloader.h>
+
+// User include files
+#include "directprintsettingsconverter.h"
+#include "directprinttintcapability.h"
+#include "directprintlistcapability.h"
+#include "directprintfloatcapability.h"
+#include "directprinttextcapability.h"
+#include "directprintstringids.h"
+#include "directprintcapability.h"
+#include "directprintvariant.h"
+#include "clog.h"
+
+const TInt KEngineLimitValue( -1 );
+const TInt KMenuItemsRequired( 2 );
+
+// Converts TDirectPrintCapability to CDirectPrintTIntCapability
+CDirectPrintTIntCapability* DirectPrintSettingsConverter::AddTIntCapabilityLC(
+ TDirectPrintCapability& aCapability,
+ TInt aIndexOnList,
+ TInt aCapabUid )
+ {
+ LOG("DirectPrintSettingsConverter::AddTIntCapabilityLC Begin");
+ CDirectPrintTIntCapability* intC = new ( ELeave ) CDirectPrintTIntCapability;
+ CleanupStack::PushL( intC );
+
+ // If engine returns KEngineLimitValue as low/high limit then it means
+ // that there is no minimum or maximum limit
+ if ( aCapability.iLow == KEngineLimitValue )
+ {
+ intC->iMin = KMinTInt32;
+ }
+ else
+ {
+ intC->iMin = aCapability.iLow;
+ }
+
+ if ( aCapability.iHigh == KEngineLimitValue )
+ {
+ intC->iMax = KMaxTInt32;
+ }
+ else
+ {
+ intC->iMax = aCapability.iHigh;
+ }
+
+ // Initialize TInt capability and return it
+ intC->iTitle = DirectPrintSettingsConverter::TextStringLC( aCapabUid )->Des();
+ CleanupStack::PopAndDestroy(); // SettingsConverter text string
+ intC->iIndexOnList = aIndexOnList;
+ intC->iUid = aCapabUid;
+ intC->iValue = aCapability.iDefaultValue;
+
+ LOG("DirectPrintSettingsConverter::AddTIntCapabilityLC End");
+ return intC;
+ }
+
+// Converts TDirectPrintCapability to CDirectPrintListCapability
+CDirectPrintListCapability* DirectPrintSettingsConverter::AddListCapabilityLC(
+ TDirectPrintCapability& aCapability,
+ TInt aIndexOnList,
+ TInt aCapabUid )
+ {
+ LOG("DirectPrintSettingsConverter::AddListCapabilityLC Begin");
+ CDirectPrintListCapability* listC = new ( ELeave ) CDirectPrintListCapability();
+ CleanupStack::PushL( listC );
+ listC->iIndexOnList = aIndexOnList;
+ listC->iUid = aCapabUid;
+
+ /* There's a problem with some usb printers:
+ They offer "normal" print quality twice and nothing else.
+ This has to be handled so that user is not shown the option
+ as he cannot change it anyway in this case */
+ TBool qualityDuplicates = EFalse;
+ if ( aCapabUid == EDirectPrintCapabQuality &&
+ aCapability.iEnumCount == KMenuItemsRequired )
+ {
+ if ( aCapability.iEnumCodes[0] == aCapability.iEnumCodes[1] )
+ {
+ LOG("DirectPrintSettingsConverter::AddListCapabilityLC duplicate quality detected!");
+ qualityDuplicates = ETrue;
+ }
+ }
+
+ // If there is only one value for certain capability, empty
+ // title is added so the capability is not visible on the
+ // settings menu.
+ if( aCapability.iEnumCount < KMenuItemsRequired || qualityDuplicates )
+ {
+ listC->iTitle = DirectPrintSettingsConverter::TextStringLC( 0 )->Des();
+ }
+ else
+ {
+ listC->iTitle = DirectPrintSettingsConverter::TextStringLC( aCapabUid )->Des();
+ }
+
+ CleanupStack::PopAndDestroy(); // SettingsConverter text string
+ listC->iValue = aCapability.iDefaultValue;
+
+ TBool enumLabels = listC->iTitle.CompareF( KNullDesC() ) != 0;
+ TInt i( 0 );
+ TInt num( aCapability.iEnumCount );
+ for ( i = 0; i < num; i++ )
+ {
+ User::LeaveIfError(
+ listC->iEnumIDs.Append( aCapability.iEnumCodes[i] ) );
+
+ // Find matching text for the enumeration if the capability is
+ // visible on the settings view
+#ifdef DIRECT_PRINT_DYNAMIC_PRINT_SETTINGS
+ if ( enumLabels || aCapability.iEnumCount < KMenuItemsRequired )
+#else
+ // Not for layout if no dynamic print settings
+ if (( enumLabels || aCapability.iEnumCount < KMenuItemsRequired ) &&
+ aCapabUid != EDirectPrintCapabLayout )
+#endif
+ {
+ LOG("DirectPrintSettingsConverter::AddListCapabilityLC Adding real value");
+ User::LeaveIfError( listC->iTexts.Append(
+ DirectPrintSettingsConverter::TextStringLC( aCapability.iEnumCodes[i] )));
+ CleanupStack::Pop(); // SettingsConverter text string
+ }
+ else
+ {
+ LOG("DirectPrintSettingsConverter::AddListCapabilityLC Adding EMPTY value");
+ User::LeaveIfError( listC->iTexts.Append(
+ StringLoader::LoadLC( R_EMPTY ) ) );
+ CleanupStack::Pop(); // SettingsConverter text string
+ }
+ }
+
+ if ( aCapability.iEnumCount > 0 )
+ {
+ i = 0;
+ // Check that current active capability code is found from the
+ // list of codes and activate first one if not found
+ TInt num( aCapability.iEnumCount );
+ while ( i < num &&
+ listC->iValue != aCapability.iEnumCodes[i] )
+ {
+ i++;
+ }
+ if ( i >= aCapability.iEnumCount )
+ {
+ listC->iValue = aCapability.iEnumCodes[0];
+ }
+ }
+
+ LOG("DirectPrintSettingsConverter::AddListCapabilityLC End");
+ return listC;
+ }
+
+// Converts TDirectPrintCapability to CDirectPrintFloatCapability
+CDirectPrintFloatCapability* DirectPrintSettingsConverter::AddFloatCapabilityLC(
+ TDirectPrintCapability& aCapability,
+ TInt aIndexOnList,
+ TInt aCapabUid )
+ {
+ LOG("DirectPrintSettingsConverter::AddFloatCapabilityLC Begin");
+ CDirectPrintFloatCapability* floatC = new ( ELeave ) CDirectPrintFloatCapability;
+ CleanupStack::PushL( floatC );
+
+ floatC->iIndexOnList = aIndexOnList;
+ floatC->iUid = aCapabUid;
+ floatC->iTitle = DirectPrintSettingsConverter::TextStringLC( aCapabUid )->Des();
+ CleanupStack::PopAndDestroy(); // SettingsConverter text string
+
+ floatC->SetValues( aCapability.iLow,
+ aCapability.iDefaultValue, aCapability.iHigh );
+
+ LOG("DirectPrintSettingsConverter::AddFloatCapabilityLC End");
+ return floatC;
+ }
+
+// Converts TDirectPrintCapability to CDirectPrintTextCapability
+CDirectPrintTextCapability* DirectPrintSettingsConverter::AddTextCapabilityLC(
+ TDirectPrintCapability& /*aCapability*/,
+ TInt aIndexOnList,
+ TInt aCapabUid )
+ {
+ LOG("DirectPrintSettingsConverter::AddTextCapabilityLC Begin");
+ CDirectPrintTextCapability* textC = new ( ELeave ) CDirectPrintTextCapability;
+ CleanupStack::PushL( textC );
+
+ textC->iIndexOnList = aIndexOnList;
+ textC->iUid = aCapabUid;
+ textC->iTitle = DirectPrintSettingsConverter::TextStringLC( aCapabUid )->Des();
+ CleanupStack::PopAndDestroy(); // SettingsConverter text string
+
+ LOG("DirectPrintSettingsConverter::AddTextCapabilityLC End");
+ return textC;
+ }
+
+// Fetches text string based on the enumeration ID
+HBufC* DirectPrintSettingsConverter::TextStringLC(
+ TInt aId )
+ {
+ LOG1("DirectPrintSettingsConverter::TextStringLC Begin: %d", aId );
+ HBufC* buf = 0;
+ TBool found( EFalse );
+
+ TInt i( 0 );
+ for ( i = 0; i < KConverterTableCount && !found; i++ )
+ {
+ if ( aId == KIDConverterTable[i][0] )
+ {
+ buf = StringLoader::LoadLC( KIDConverterTable[i][1] );
+ found = ETrue;
+ }
+ }
+
+ if ( !found )
+ {
+ User::Leave( KErrNotFound );
+ }
+
+ LOG("DirectPrintSettingsConverter::TextStringLC End");
+ return buf;
+ }
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/engine/src/directprinttextcapability.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// System include files
+#include <stringloader.h>
+#include <akntextsettingpage.h>
+#include <DirectPrintApp.rsg>
+
+#include "directprinttextcapability.h"
+
+// Destructor
+CDirectPrintTextCapability::~CDirectPrintTextCapability()
+ {
+ }
+
+HBufC* CDirectPrintTextCapability::ListBoxTextL()
+ {
+ const TInt KGranularity( 4 );
+
+ CDesCArrayFlat* strings = new ( ELeave ) CDesCArrayFlat( KGranularity );
+ CleanupStack::PushL( strings );
+ strings->AppendL( iTitle );
+ strings->AppendL( iText );
+
+ HBufC* buf = StringLoader::LoadL( R_QTN_LBOX_FORMAT, *strings );
+ CleanupStack::PopAndDestroy(); // strings
+
+ return buf;
+ }
+
+CDirectPrintBaseCapability* CDirectPrintTextCapability::CloneL()
+ {
+ CDirectPrintTextCapability* clone = new ( ELeave ) CDirectPrintTextCapability;
+
+ clone->iIndexOnList = iIndexOnList;
+ clone->iTitle = iTitle;
+ clone->iUid = iUid;
+ clone->iValue = iValue;
+ clone->iText = iText;
+
+ return clone;
+ }
+
+CAknSettingItem* CDirectPrintTextCapability::SettingItemLC(TInt aIndex)
+ {
+ CAknTextSettingItem* item = new (ELeave) CAknTextSettingItem(aIndex, iText);
+ CleanupStack::PushL(item);
+ item->SetEmptyItemTextL( _L("") );
+ item->ConstructL(EFalse, aIndex, iTitle, NULL, R_DIRECTPRINT_PRINTERSETTING_TEXT_SETTING_PAGE, -1);
+
+ return item;
+ }
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/engine/src/directprinttintcapability.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// System include files
+#include <stringloader.h>
+#include <akntextsettingpage.h>
+#include <DirectPrintApp.rsg>
+
+#include "directprinttintcapability.h"
+
+const TInt KMaxTIntCharNum( 11 );
+
+// Destructor
+CDirectPrintTIntCapability::~CDirectPrintTIntCapability()
+ {
+ }
+
+// Creates text string for the settings list box
+HBufC* CDirectPrintTIntCapability::ListBoxTextL()
+ {
+ const TInt KGranularity( 4 );
+ TBuf<KMaxTIntCharNum> numStr;
+ numStr.Zero();
+ numStr.AppendNum( iValue );
+
+ CDesCArrayFlat* strings = new ( ELeave ) CDesCArrayFlat( KGranularity );
+ CleanupStack::PushL( strings );
+ strings->AppendL( iTitle );
+ strings->AppendL( numStr );
+
+ HBufC* buf = StringLoader::LoadL( R_QTN_LBOX_FORMAT, *strings );
+ CleanupStack::PopAndDestroy(); // strings
+
+ return buf;
+ }
+
+// Clones itself
+CDirectPrintBaseCapability* CDirectPrintTIntCapability::CloneL()
+ {
+ CDirectPrintTIntCapability* clone = new ( ELeave ) CDirectPrintTIntCapability;
+
+ clone->iIndexOnList = iIndexOnList;
+ clone->iMax = iMax;
+ clone->iMin = iMin;
+ clone->iTitle = iTitle;
+ clone->iUid = iUid;
+ clone->iValue = iValue;
+
+ return clone;
+ }
+
+// Creates setting item for the settings list box
+CAknSettingItem* CDirectPrintTIntCapability::SettingItemLC(TInt aIndex)
+ {
+ CAknIntegerEdwinSettingItem* item = new (ELeave) CAknIntegerEdwinSettingItem(aIndex, iValue);
+ CleanupStack::PushL(item);
+ item->ConstructL(EFalse, aIndex, iTitle, NULL, R_DIRECTPRINT_PROPERTYSETTING_INTEGER_SETTING_PAGE, -1);
+
+ return item;
+ }
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/gfx/qgn_menu_directprintapp.svg Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,231 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="レイヤー_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
+ y="0px" width="86px" height="86px" viewBox="0 0 86 86" enable-background="new 0 0 86 86" xml:space="preserve">
+<polyline fill="#EED6FF" points="22.889,27.984 4.625,41.375 4.75,65.688 5.765,67.223 6.865,67.988 7.794,68.883 17.375,70
+ 14.125,75.125 43.5,80.375 47.5,73.75 63.099,75.018 72.485,74.635 73.501,73.954 74.261,73.612 82.125,63.132 82.125,61.726
+ 82.125,33.225 81.618,32.202 80.857,31.436 79.842,31.052 59.249,30.315 59,30.125 59.5,23.375 58.625,23.367 29.125,22.875
+ 28.724,28.112 "/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="19.6255" y1="53.1055" x2="72.8606" y2="19.8405">
+ <stop offset="0" style="stop-color:#A8B0B3"/>
+ <stop offset="0.2537" style="stop-color:#A6AEB0"/>
+ <stop offset="0.4063" style="stop-color:#9EA5A8"/>
+ <stop offset="0.5322" style="stop-color:#90979A"/>
+ <stop offset="0.6435" style="stop-color:#7D8385"/>
+ <stop offset="0.7453" style="stop-color:#65696B"/>
+ <stop offset="0.84" style="stop-color:#464A4B"/>
+ <stop offset="0.9275" style="stop-color:#232525"/>
+ <stop offset="1" style="stop-color:#000000"/>
+ <stop offset="1" style="stop-color:#060606"/>
+ <stop offset="1" style="stop-color:#151515"/>
+ <stop offset="1" style="stop-color:#303030"/>
+ <stop offset="1" style="stop-color:#545454"/>
+ <stop offset="1" style="stop-color:#838383"/>
+ <stop offset="1" style="stop-color:#BCBCBC"/>
+ <stop offset="1" style="stop-color:#C8C8C8"/>
+</linearGradient>
+<polygon fill="url(#SVGID_1_)" points="20.833,30.833 10.5,38.5 12.167,40.167 69.166,44.167 81.501,33.667 79.5,31.833
+ 28.167,28.833 24.5,28.833 22.167,29.5 "/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="5.1665" y1="44.167" x2="71.334" y2="44.167">
+ <stop offset="0.0909" style="stop-color:#000000"/>
+ <stop offset="0.3465" style="stop-color:#020202"/>
+ <stop offset="0.4804" style="stop-color:#0A0A0A"/>
+ <stop offset="0.5862" style="stop-color:#181818"/>
+ <stop offset="0.6771" style="stop-color:#2B2B2B"/>
+ <stop offset="0.7586" style="stop-color:#444444"/>
+ <stop offset="0.8334" style="stop-color:#626262"/>
+ <stop offset="0.9029" style="stop-color:#868686"/>
+ <stop offset="0.9666" style="stop-color:#AFAFAF"/>
+ <stop offset="1" style="stop-color:#C8C8C8"/>
+ <stop offset="1" style="stop-color:#FFFCFF"/>
+</linearGradient>
+<polygon fill="url(#SVGID_2_)" points="5.167,42.167 7.125,43.375 9.158,44.537 11.833,45.167 62.334,49.334 70.167,49.834
+ 71.334,49 69.166,44.167 12.167,40.167 10.5,38.5 "/>
+<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="62.166" y1="51.333" x2="81.5" y2="51.333">
+ <stop offset="0" style="stop-color:#9C9C96;stop-opacity:0.56"/>
+ <stop offset="0.2262" style="stop-color:#9E9E98;stop-opacity:0.7507"/>
+ <stop offset="0.3077" style="stop-color:#A5A59F;stop-opacity:0.8194"/>
+ <stop offset="0.3658" style="stop-color:#B0B0AA;stop-opacity:0.8683"/>
+ <stop offset="0.4128" style="stop-color:#C1C1BB;stop-opacity:0.9079"/>
+ <stop offset="0.453" style="stop-color:#D7D7D1;stop-opacity:0.9418"/>
+ <stop offset="0.488" style="stop-color:#F1F1EC;stop-opacity:0.9713"/>
+ <stop offset="0.503" style="stop-color:#FFFFFA;stop-opacity:0.984"/>
+ <stop offset="0.6882" style="stop-color:#FDFDF8;stop-opacity:0.99"/>
+ <stop offset="0.7549" style="stop-color:#F6F6F2;stop-opacity:0.9921"/>
+ <stop offset="0.8025" style="stop-color:#EBEBE6;stop-opacity:0.9936"/>
+ <stop offset="0.841" style="stop-color:#DADAD5;stop-opacity:0.9949"/>
+ <stop offset="0.8739" style="stop-color:#C4C4C0;stop-opacity:0.9959"/>
+ <stop offset="0.9031" style="stop-color:#A8A8A5;stop-opacity:0.9969"/>
+ <stop offset="0.9295" style="stop-color:#888885;stop-opacity:0.9977"/>
+ <stop offset="0.9537" style="stop-color:#626260;stop-opacity:0.9985"/>
+ <stop offset="0.9763" style="stop-color:#373736;stop-opacity:0.9992"/>
+ <stop offset="0.9963" style="stop-color:#090909;stop-opacity:0.9999"/>
+ <stop offset="1" style="stop-color:#000000"/>
+ <stop offset="1" style="stop-color:#050506"/>
+ <stop offset="1" style="stop-color:#141415"/>
+ <stop offset="1" style="stop-color:#2D2D30"/>
+ <stop offset="1" style="stop-color:#505054"/>
+ <stop offset="1" style="stop-color:#7D7D83"/>
+ <stop offset="1" style="stop-color:#B2B2BC"/>
+ <stop offset="1" style="stop-color:#BDBDC7"/>
+</linearGradient>
+<polyline fill="url(#SVGID_3_)" points="74.001,48.5 74.166,48.5 80.166,41.5 81.5,38.833 81.5,33.5 81.5,38.833 81.5,60.833
+ 74.666,67.666 73.166,69.166 62.166,69.166 62.166,51.167 70.875,51.125 72,50.375 74.166,48.5 80.166,41.5 "/>
+<linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="5.2915" y1="53.333" x2="13.0005" y2="53.333">
+ <stop offset="0" style="stop-color:#ADADAB;stop-opacity:0.56"/>
+ <stop offset="0.3404" style="stop-color:#AFAFAD;stop-opacity:0.7585"/>
+ <stop offset="0.463" style="stop-color:#B6B6B3;stop-opacity:0.8299"/>
+ <stop offset="0.5504" style="stop-color:#C1C1BF;stop-opacity:0.8809"/>
+ <stop offset="0.621" style="stop-color:#D2D2CF;stop-opacity:0.9221"/>
+ <stop offset="0.6808" style="stop-color:#E8E8E4;stop-opacity:0.9569"/>
+ <stop offset="0.7273" style="stop-color:#FFFFFA;stop-opacity:0.984"/>
+ <stop offset="0.8289" style="stop-color:#FDFDF8;stop-opacity:0.99"/>
+ <stop offset="0.8655" style="stop-color:#F6F6F2;stop-opacity:0.9921"/>
+ <stop offset="0.8916" style="stop-color:#EBEBE6;stop-opacity:0.9936"/>
+ <stop offset="0.9127" style="stop-color:#DADAD5;stop-opacity:0.9949"/>
+ <stop offset="0.9308" style="stop-color:#C4C4C0;stop-opacity:0.9959"/>
+ <stop offset="0.9468" style="stop-color:#A8A8A5;stop-opacity:0.9969"/>
+ <stop offset="0.9613" style="stop-color:#888885;stop-opacity:0.9977"/>
+ <stop offset="0.9746" style="stop-color:#626260;stop-opacity:0.9985"/>
+ <stop offset="0.987" style="stop-color:#373736;stop-opacity:0.9992"/>
+ <stop offset="0.998" style="stop-color:#090909;stop-opacity:0.9999"/>
+ <stop offset="1" style="stop-color:#000000"/>
+ <stop offset="1" style="stop-color:#060606"/>
+ <stop offset="1" style="stop-color:#151515"/>
+ <stop offset="1" style="stop-color:#303030"/>
+ <stop offset="1" style="stop-color:#545454"/>
+ <stop offset="1" style="stop-color:#838383"/>
+ <stop offset="1" style="stop-color:#BCBCBC"/>
+ <stop offset="1" style="stop-color:#F7F7F7"/>
+</linearGradient>
+<polygon fill="url(#SVGID_4_)" points="5.292,42.167 5.5,62.833 6.833,63.833 9.833,64.5 12.833,64.167 13,45.334 9.283,44.537 "/>
+<linearGradient id="SVGID_5_" gradientUnits="userSpaceOnUse" x1="12.834" y1="48.25" x2="71.75" y2="48.25">
+ <stop offset="0" style="stop-color:#C9C9BF;stop-opacity:0.56"/>
+ <stop offset="0.4091" style="stop-color:#CBCBC1;stop-opacity:0.772"/>
+ <stop offset="0.5565" style="stop-color:#D1D1C8;stop-opacity:0.8484"/>
+ <stop offset="0.6615" style="stop-color:#DCDCD3;stop-opacity:0.9028"/>
+ <stop offset="0.7458" style="stop-color:#EBEBE4;stop-opacity:0.9465"/>
+ <stop offset="0.8182" style="stop-color:#FFFFFA;stop-opacity:0.984"/>
+ <stop offset="0.8859" style="stop-color:#FDFDF8;stop-opacity:0.99"/>
+ <stop offset="0.9103" style="stop-color:#F6F6F2;stop-opacity:0.9921"/>
+ <stop offset="0.9277" style="stop-color:#EBEBE6;stop-opacity:0.9936"/>
+ <stop offset="0.9418" style="stop-color:#DADAD5;stop-opacity:0.9949"/>
+ <stop offset="0.9539" style="stop-color:#C4C4C0;stop-opacity:0.9959"/>
+ <stop offset="0.9645" style="stop-color:#A8A8A5;stop-opacity:0.9969"/>
+ <stop offset="0.9742" style="stop-color:#888885;stop-opacity:0.9977"/>
+ <stop offset="0.9831" style="stop-color:#626260;stop-opacity:0.9985"/>
+ <stop offset="0.9913" style="stop-color:#373736;stop-opacity:0.9992"/>
+ <stop offset="0.9987" style="stop-color:#090909;stop-opacity:0.9999"/>
+ <stop offset="1" style="stop-color:#000000"/>
+ <stop offset="1" style="stop-color:#060606"/>
+ <stop offset="1" style="stop-color:#151515"/>
+ <stop offset="1" style="stop-color:#303030"/>
+ <stop offset="1" style="stop-color:#545454"/>
+ <stop offset="1" style="stop-color:#838383"/>
+ <stop offset="1" style="stop-color:#BCBCBC"/>
+ <stop offset="1" style="stop-color:#F7F7F7"/>
+</linearGradient>
+<polygon fill="url(#SVGID_5_)" points="70.5,51.167 62.166,51.167 12.834,47 13,45.334 70.167,49.834 71.25,49.125 71.75,50.625 "/>
+<linearGradient id="SVGID_6_" gradientUnits="userSpaceOnUse" x1="5.4995" y1="60.584" x2="81.5" y2="60.584">
+ <stop offset="0" style="stop-color:#C9C9BF;stop-opacity:0.56"/>
+ <stop offset="0.0042" style="stop-color:#C5C5BB;stop-opacity:0.5619"/>
+ <stop offset="0.0499" style="stop-color:#9C9C94;stop-opacity:0.5819"/>
+ <stop offset="0.0998" style="stop-color:#777771;stop-opacity:0.6039"/>
+ <stop offset="0.1556" style="stop-color:#575752;stop-opacity:0.6284"/>
+ <stop offset="0.2171" style="stop-color:#3B3B38;stop-opacity:0.6555"/>
+ <stop offset="0.2867" style="stop-color:#252524;stop-opacity:0.6861"/>
+ <stop offset="0.3679" style="stop-color:#141413;stop-opacity:0.7219"/>
+ <stop offset="0.4683" style="stop-color:#090908;stop-opacity:0.7661"/>
+ <stop offset="0.6091" style="stop-color:#020202;stop-opacity:0.828"/>
+ <stop offset="1" style="stop-color:#000000"/>
+</linearGradient>
+<polygon fill="url(#SVGID_6_)" points="81.5,60.833 81.167,63.334 73.001,73.334 72.001,74 68.834,74 65.001,74.167 61.834,74.167
+ 10,68.5 8.834,68.334 7.334,67.5 5.834,65.667 5.5,62.833 6.833,63.833 9.833,64.5 12.833,64.167 12.834,47 62.166,51.167
+ 62.166,69.166 70,69.25 71.75,69 72.875,68.625 74,67.875 "/>
+<g>
+ <polygon fill="#FFFFFF" points="16.193,74.057 28.847,57.109 54.479,60.105 42.896,79.108 "/>
+ <path fill="#CCCCCC" d="M29.059,57.602l24.646,2.881L42.666,78.592l-25.655-4.854L29.059,57.602 M28.635,56.616l-13.26,17.759
+ l27.75,5.25l12.129-19.897L28.635,56.616L28.635,56.616z"/>
+</g>
+<linearGradient id="SVGID_7_" gradientUnits="userSpaceOnUse" x1="43.6729" y1="40.2471" x2="44.2277" y2="24.3578" gradientTransform="matrix(0.9873 -0.0177 0.0176 0.985 -0.1104 0.7738)">
+ <stop offset="0.49" style="stop-color:#E0E0DE"/>
+ <stop offset="0.6851" style="stop-color:#DEDEDC"/>
+ <stop offset="0.7553" style="stop-color:#D7D7D5"/>
+ <stop offset="0.8054" style="stop-color:#CBCBCA"/>
+ <stop offset="0.8459" style="stop-color:#BBBBB9"/>
+ <stop offset="0.8806" style="stop-color:#A5A5A3"/>
+ <stop offset="0.9114" style="stop-color:#898988"/>
+ <stop offset="0.9392" style="stop-color:#696968"/>
+ <stop offset="0.9647" style="stop-color:#434343"/>
+ <stop offset="0.9875" style="stop-color:#1A1A1A"/>
+ <stop offset="1" style="stop-color:#000000"/>
+ <stop offset="1" style="stop-color:#060606;stop-opacity:0.9437"/>
+ <stop offset="1" style="stop-color:#151515;stop-opacity:0.8718"/>
+ <stop offset="1" style="stop-color:#303030;stop-opacity:0.7914"/>
+ <stop offset="1" style="stop-color:#545454;stop-opacity:0.7049"/>
+ <stop offset="1" style="stop-color:#838383;stop-opacity:0.6134"/>
+ <stop offset="1" style="stop-color:#BCBCBC;stop-opacity:0.5192"/>
+ <stop offset="1" style="stop-color:#C8C8C8;stop-opacity:0.5"/>
+</linearGradient>
+<polygon fill="url(#SVGID_7_)" stroke="#FFFFFF" stroke-width="0.7398" points="29.968,23.748 29.229,38.253 57.516,39.879
+ 58.485,24.731 57.745,24.744 "/>
+<linearGradient id="SVGID_8_" gradientUnits="userSpaceOnUse" x1="25.834" y1="41.75" x2="57.5" y2="41.75">
+ <stop offset="0" style="stop-color:#C8C8C8;stop-opacity:0.5"/>
+ <stop offset="0" style="stop-color:#BCBCBC;stop-opacity:0.5192"/>
+ <stop offset="0" style="stop-color:#838383;stop-opacity:0.6134"/>
+ <stop offset="0" style="stop-color:#545454;stop-opacity:0.7049"/>
+ <stop offset="0" style="stop-color:#303030;stop-opacity:0.7914"/>
+ <stop offset="0" style="stop-color:#151515;stop-opacity:0.8718"/>
+ <stop offset="0" style="stop-color:#060606;stop-opacity:0.9437"/>
+ <stop offset="0" style="stop-color:#000000"/>
+ <stop offset="0.0125" style="stop-color:#1A1A1A"/>
+ <stop offset="0.0353" style="stop-color:#434343"/>
+ <stop offset="0.0608" style="stop-color:#696968"/>
+ <stop offset="0.0886" style="stop-color:#898988"/>
+ <stop offset="0.1194" style="stop-color:#A5A5A3"/>
+ <stop offset="0.1541" style="stop-color:#BBBBB9"/>
+ <stop offset="0.1946" style="stop-color:#CBCBCA"/>
+ <stop offset="0.2447" style="stop-color:#D7D7D5"/>
+ <stop offset="0.3149" style="stop-color:#DEDEDC"/>
+ <stop offset="0.51" style="stop-color:#E0E0DE"/>
+</linearGradient>
+<polygon fill="url(#SVGID_8_)" stroke="#666666" stroke-width="0.5" points="25.834,42.667 29.167,38.833 57.5,40.375
+ 54.667,44.667 "/>
+<polygon fill="#FFFFFF" points="36.375,29.375 36,29.375 35.667,34.875 49.834,35.708 50,29.875 "/>
+<polygon points="23.75,29.375 6.5,42.75 5.375,41.75 22.167,29.5 22.875,29 23.625,28.875 "/>
+<linearGradient id="SVGID_9_" gradientUnits="userSpaceOnUse" x1="69.2783" y1="45.7109" x2="83.5552" y2="36.7898">
+ <stop offset="0" style="stop-color:#A8B0B3"/>
+ <stop offset="0.1726" style="stop-color:#7B8183"/>
+ <stop offset="0.3672" style="stop-color:#4F5355"/>
+ <stop offset="0.5533" style="stop-color:#2D2F30"/>
+ <stop offset="0.7258" style="stop-color:#141516"/>
+ <stop offset="0.8799" style="stop-color:#050506"/>
+ <stop offset="1" style="stop-color:#000000"/>
+ <stop offset="1" style="stop-color:#060606"/>
+ <stop offset="1" style="stop-color:#151515"/>
+ <stop offset="1" style="stop-color:#303030"/>
+ <stop offset="1" style="stop-color:#545454"/>
+ <stop offset="1" style="stop-color:#838383"/>
+ <stop offset="1" style="stop-color:#BCBCBC"/>
+ <stop offset="1" style="stop-color:#C8C8C8"/>
+</linearGradient>
+<polygon fill="url(#SVGID_9_)" points="69.166,44.167 71.334,49 81.5,38.833 81.5,33.5 "/>
+<linearGradient id="SVGID_10_" gradientUnits="userSpaceOnUse" x1="71.334" y1="49" x2="71.334" y2="49">
+ <stop offset="0" style="stop-color:#A8B0B3"/>
+ <stop offset="0.1726" style="stop-color:#7B8183"/>
+ <stop offset="0.3672" style="stop-color:#4F5355"/>
+ <stop offset="0.5533" style="stop-color:#2D2F30"/>
+ <stop offset="0.7258" style="stop-color:#141516"/>
+ <stop offset="0.8799" style="stop-color:#050506"/>
+ <stop offset="1" style="stop-color:#000000"/>
+ <stop offset="1" style="stop-color:#060606"/>
+ <stop offset="1" style="stop-color:#151515"/>
+ <stop offset="1" style="stop-color:#303030"/>
+ <stop offset="1" style="stop-color:#545454"/>
+ <stop offset="1" style="stop-color:#838383"/>
+ <stop offset="1" style="stop-color:#BCBCBC"/>
+ <stop offset="1" style="stop-color:#C8C8C8"/>
+</linearGradient>
+<path fill="url(#SVGID_10_)" d="M71.334,49"/>
+</svg>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/gfx/qgn_menu_directprintapp_org.svg Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="レイヤー_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
+ y="0px" width="86px" height="86px" viewBox="0 0 86 86" enable-background="new 0 0 86 86" xml:space="preserve">
+<g>
+ <g>
+ <rect y="0" fill="none" stroke="#FF0000" width="86" height="86"/>
+ </g>
+</g>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="77.3838" y1="-338.5713" x2="128.4909" y2="-399.4785" gradientTransform="matrix(0.9773 0 0 -0.9773 -254.6002 -293.9144)">
+ <stop offset="0" style="stop-color:#B3DDFF"/>
+ <stop offset="0.8146" style="stop-color:#084296"/>
+ <stop offset="1" style="stop-color:#084296"/>
+</linearGradient>
+<path fill="url(#SVGID_1_)" d="M-159.595,26.247l-17.368,9.789v22.641c0,0,8.723,15.002,10.23,17.592
+ c-2.332,1.665-15.089,10.779-15.089,10.779l21.122,12.364c0,0,12.614-9.626,14.376-10.971c1.934,1.084,15.861,8.895,15.861,8.895
+ l16.285-14.788c0,0-13.746-6.771-16.504-8.129c1.434-2.942,10.291-21.113,10.291-21.113l-21.791-9.372c0,0-1.451,3.102-2.045,4.365
+ c-2-0.859-6.424-2.762-6.424-2.762s-3.628,2.407-5.566,3.692c-0.32-0.728-0.53-1.205-0.642-1.461
+ c0.007-0.806,0.208-23.181,0.208-23.181L-159.595,26.247z"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="178.5576" y1="-312.0112" x2="153.9297" y2="-280.9551" gradientTransform="matrix(0.9773 0 0 -0.9773 -254.6002 -293.9144)">
+ <stop offset="0" style="stop-color:#5AA7E0"/>
+ <stop offset="1" style="stop-color:#3366CC"/>
+</linearGradient>
+<polygon fill="url(#SVGID_2_)" points="-62.291,16.313 -52.045,-4.709 -70.214,-12.523 -72.258,-8.159 -79.45,-11.25 -86.07,-6.859
+ -87.816,-10.829 -87.636,-31.051 -104.009,-21.821 -104.009,-0.85 -93.148,17.824 -107.233,27.885 -89.845,38.064 -75.489,27.109
+ -59.734,35.942 -46.617,24.032 "/>
+<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="171.71" y1="-361.2764" x2="164.9832" y2="-374.5129" gradientTransform="matrix(0.9773 0 0 -0.9773 -254.6002 -293.9144)">
+ <stop offset="0" style="stop-color:#5AA7E0"/>
+ <stop offset="1" style="stop-color:#3366CC"/>
+</linearGradient>
+<polygon fill="url(#SVGID_3_)" points="-105.678,75.675 -96.214,55.477 -78.045,63.291 -88.291,84.313 "/>
+<polygon fill="#0046B7" points="-94.009,58.15 -83.148,76.824 -69.678,66.675 -77.816,48.171 "/>
+<polygon fill="#3366CC" points="-109.009,69.15 -109.009,48.179 -92.636,38.949 -92.816,59.171 "/>
+<polygon fill="#CFECFF" points="-86.911,42.339 -72.45,32.75 -54.83,40.324 -68.489,50.865 "/>
+<path fill="#5AA7E0" stroke="#FF0000" d="M41,54.029"/>
+<polygon fill="#3366CC" points="-107.911,50.339 -107.148,69.824 -89.489,79.109 -89.489,58.865 "/>
+<linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="163.8691" y1="-396.1548" x2="183.3704" y2="-388.6689" gradientTransform="matrix(0.9773 0 0 -0.9773 -254.6002 -293.9144)">
+ <stop offset="0" style="stop-color:#5AA7E0"/>
+ <stop offset="0.0056" style="stop-color:#5AA7E0"/>
+ <stop offset="0.85" style="stop-color:#3366CC"/>
+ <stop offset="1" style="stop-color:#3366CC"/>
+</linearGradient>
+<polygon fill="url(#SVGID_4_)" points="-80.564,76.904 -96.148,88.824 -78.489,98.109 -78.489,77.865 "/>
+<polygon fill="#0046B7" points="-94.489,64.865 -94.489,85.109 -81.291,74.313 -80.83,54.324 "/>
+<linearGradient id="SVGID_5_" gradientUnits="userSpaceOnUse" x1="188.2412" y1="-377.6636" x2="201.8975" y2="-377.6636" gradientTransform="matrix(0.9773 0 0 -0.9773 -254.6002 -293.9144)">
+ <stop offset="0" style="stop-color:#0046B7"/>
+ <stop offset="1" style="stop-color:#3366CC"/>
+</linearGradient>
+<polygon fill="url(#SVGID_5_)" points="-70.638,66.224 -70.489,84.109 -57.291,73.313 "/>
+<linearGradient id="SVGID_6_" gradientUnits="userSpaceOnUse" x1="191.4629" y1="-406.2676" x2="187.8638" y2="-396.3791" gradientTransform="matrix(0.9773 0 0 -0.9773 -254.6002 -293.9144)">
+ <stop offset="0" style="stop-color:#5AA7E0"/>
+ <stop offset="0.4101" style="stop-color:#5AA7E0"/>
+ <stop offset="1" style="stop-color:#3366CC"/>
+</linearGradient>
+<polygon fill="url(#SVGID_6_)" points="-66.734,111.942 -82.489,103.109 -69.291,92.313 -53.617,100.032 "/>
+<image overflow="visible" width="99" height="61" xlink:href="79E366C1.jpg" transform="matrix(0.7739 0 0 0.8457 3.167 21.4995)">
+</image>
+<line fill="none" stroke="#FF0000" x1="21.833" y1="26.167" x2="4.166" y2="39.167"/>
+<line fill="none" stroke="#FF0000" x1="22.166" y1="26.167" x2="79.166" y2="29.833"/>
+<line fill="none" stroke="#FF0000" x1="8.166" y1="35.5" x2="69.833" y2="39.833"/>
+<line fill="none" stroke="#FF0000" x1="77.499" y1="29.833" x2="69.833" y2="39.167"/>
+<line fill="none" stroke="#FF0000" x1="80.166" y1="29.833" x2="83.166" y2="32.833"/>
+<line fill="none" stroke="#FF0000" x1="83.166" y1="32.833" x2="74.166" y2="44.833"/>
+<line fill="none" stroke="#FF0000" x1="73.833" y1="44.833" x2="3.833" y2="39.167"/>
+<line fill="none" stroke="#FF0000" x1="30.5" y1="22.833" x2="25.833" y2="35.833"/>
+<line fill="none" stroke="#FF0000" x1="30.833" y1="22.833" x2="58.166" y2="24.833"/>
+<line fill="none" stroke="#FF0000" x1="58.499" y1="24.5" x2="53.833" y2="37.833"/>
+<line fill="none" stroke="#FF0000" x1="53.499" y1="37.5" x2="24.5" y2="35.833"/>
+<line fill="none" stroke="#FF0000" x1="4.166" y1="38.833" x2="4.5" y2="59.5"/>
+<line fill="none" stroke="#FF0000" x1="4.833" y1="59.5" x2="11.166" y2="61.167"/>
+<line fill="none" stroke="#FF0000" x1="12.833" y1="42.5" x2="12.833" y2="60.5"/>
+<line fill="none" stroke="#FF0000" x1="13.166" y1="42.833" x2="62.166" y2="47.833"/>
+<line fill="none" stroke="#FF0000" x1="61.833" y1="47.167" x2="61.833" y2="64.833"/>
+<line fill="none" stroke="#FF0000" x1="62.166" y1="65.833" x2="73.833" y2="66.167"/>
+<line fill="none" stroke="#FF0000" stroke-width="2.1812" x1="74.166" y1="66.167" x2="83.833" y2="52.167"/>
+<line fill="none" stroke="#FF0000" stroke-width="1.5904" x1="83.167" y1="56.834" x2="73.166" y2="71.167"/>
+<line fill="none" stroke="#FF0000" x1="73.166" y1="71.5" x2="7.166" y2="65.167"/>
+<line fill="none" stroke="#FF0000" x1="4.5" y1="58.833" x2="7.5" y2="64.833"/>
+<line fill="none" stroke="#FF0000" x1="11.833" y1="60.833" x2="61.499" y2="65.833"/>
+<line fill="none" stroke="#FF0000" x1="24.833" y1="52.833" x2="7.5" y2="67.833"/>
+<line fill="none" stroke="#FF0000" x1="24.5" y1="53.167" x2="56.499" y2="56.5"/>
+<line fill="none" stroke="#FF0000" x1="56.499" y1="56.167" x2="42.5" y2="72.167"/>
+<line fill="none" stroke="#FF0000" x1="8.5" y1="68.167" x2="41.833" y2="72.167"/>
+<line fill="none" stroke="#FF0000" x1="83.499" y1="33.167" x2="83.166" y2="57.833"/>
+<path fill="none" stroke="#FF0000" d="M-33.159,34.084c-0.408,2.751-2.008,4.082-5.008,7.749c-2.596,3.173-4.594,6.777-6.89,10.201
+ c8.002,0.428,23.514,0.468,31.557,0.466c2.141,0-1.263,0.412,0.517-0.532c1.139-0.604,3.694-4.268,4.776-5.299
+ c2.897-2.759,4.751-6.604,6.815-9.958c-5.925,0.212-10.649-0.661-16.44-1.878c-3.856-0.811-11.589-2.165-15.325-0.082"/>
+</svg>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/gfx/qgn_menu_directprintapp_pink.svg Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,231 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="レイヤー_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
+ y="0px" width="86px" height="86px" viewBox="0 0 86 86" enable-background="new 0 0 86 86" xml:space="preserve">
+<polyline fill="#EED6FF" points="22.889,27.984 4.625,41.375 4.75,65.688 5.765,67.223 6.865,67.988 7.794,68.883 17.375,70
+ 14.125,75.125 43.5,80.375 47.5,73.75 63.099,75.018 72.485,74.635 73.501,73.954 74.261,73.612 82.125,63.132 82.125,61.726
+ 82.125,33.225 81.618,32.202 80.857,31.436 79.842,31.052 59.249,30.315 59,30.125 59.5,23.375 58.625,23.367 29.125,22.875
+ 28.724,28.112 "/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="19.6255" y1="53.1055" x2="72.8606" y2="19.8405">
+ <stop offset="0" style="stop-color:#A8B0B3"/>
+ <stop offset="0.2537" style="stop-color:#A6AEB0"/>
+ <stop offset="0.4063" style="stop-color:#9EA5A8"/>
+ <stop offset="0.5322" style="stop-color:#90979A"/>
+ <stop offset="0.6435" style="stop-color:#7D8385"/>
+ <stop offset="0.7453" style="stop-color:#65696B"/>
+ <stop offset="0.84" style="stop-color:#464A4B"/>
+ <stop offset="0.9275" style="stop-color:#232525"/>
+ <stop offset="1" style="stop-color:#000000"/>
+ <stop offset="1" style="stop-color:#060606"/>
+ <stop offset="1" style="stop-color:#151515"/>
+ <stop offset="1" style="stop-color:#303030"/>
+ <stop offset="1" style="stop-color:#545454"/>
+ <stop offset="1" style="stop-color:#838383"/>
+ <stop offset="1" style="stop-color:#BCBCBC"/>
+ <stop offset="1" style="stop-color:#C8C8C8"/>
+</linearGradient>
+<polygon fill="url(#SVGID_1_)" points="20.833,30.833 10.5,38.5 12.167,40.167 69.166,44.167 81.501,33.667 79.5,31.833
+ 28.167,28.833 24.5,28.833 22.167,29.5 "/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="5.1665" y1="44.167" x2="71.334" y2="44.167">
+ <stop offset="0.0909" style="stop-color:#000000"/>
+ <stop offset="0.3465" style="stop-color:#020202"/>
+ <stop offset="0.4804" style="stop-color:#0A0A0A"/>
+ <stop offset="0.5862" style="stop-color:#181818"/>
+ <stop offset="0.6771" style="stop-color:#2B2B2B"/>
+ <stop offset="0.7586" style="stop-color:#444444"/>
+ <stop offset="0.8334" style="stop-color:#626262"/>
+ <stop offset="0.9029" style="stop-color:#868686"/>
+ <stop offset="0.9666" style="stop-color:#AFAFAF"/>
+ <stop offset="1" style="stop-color:#C8C8C8"/>
+ <stop offset="1" style="stop-color:#FFFCFF"/>
+</linearGradient>
+<polygon fill="url(#SVGID_2_)" points="5.167,42.167 7.125,43.375 9.158,44.537 11.833,45.167 62.334,49.334 70.167,49.834
+ 71.334,49 69.166,44.167 12.167,40.167 10.5,38.5 "/>
+<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="62.166" y1="51.333" x2="81.5" y2="51.333">
+ <stop offset="0" style="stop-color:#9C9C96;stop-opacity:0.56"/>
+ <stop offset="0.2262" style="stop-color:#9E9E98;stop-opacity:0.7507"/>
+ <stop offset="0.3077" style="stop-color:#A5A59F;stop-opacity:0.8194"/>
+ <stop offset="0.3658" style="stop-color:#B0B0AA;stop-opacity:0.8683"/>
+ <stop offset="0.4128" style="stop-color:#C1C1BB;stop-opacity:0.9079"/>
+ <stop offset="0.453" style="stop-color:#D7D7D1;stop-opacity:0.9418"/>
+ <stop offset="0.488" style="stop-color:#F1F1EC;stop-opacity:0.9713"/>
+ <stop offset="0.503" style="stop-color:#FFFFFA;stop-opacity:0.984"/>
+ <stop offset="0.6882" style="stop-color:#FDFDF8;stop-opacity:0.99"/>
+ <stop offset="0.7549" style="stop-color:#F6F6F2;stop-opacity:0.9921"/>
+ <stop offset="0.8025" style="stop-color:#EBEBE6;stop-opacity:0.9936"/>
+ <stop offset="0.841" style="stop-color:#DADAD5;stop-opacity:0.9949"/>
+ <stop offset="0.8739" style="stop-color:#C4C4C0;stop-opacity:0.9959"/>
+ <stop offset="0.9031" style="stop-color:#A8A8A5;stop-opacity:0.9969"/>
+ <stop offset="0.9295" style="stop-color:#888885;stop-opacity:0.9977"/>
+ <stop offset="0.9537" style="stop-color:#626260;stop-opacity:0.9985"/>
+ <stop offset="0.9763" style="stop-color:#373736;stop-opacity:0.9992"/>
+ <stop offset="0.9963" style="stop-color:#090909;stop-opacity:0.9999"/>
+ <stop offset="1" style="stop-color:#000000"/>
+ <stop offset="1" style="stop-color:#050506"/>
+ <stop offset="1" style="stop-color:#141415"/>
+ <stop offset="1" style="stop-color:#2D2D30"/>
+ <stop offset="1" style="stop-color:#505054"/>
+ <stop offset="1" style="stop-color:#7D7D83"/>
+ <stop offset="1" style="stop-color:#B2B2BC"/>
+ <stop offset="1" style="stop-color:#BDBDC7"/>
+</linearGradient>
+<polyline fill="url(#SVGID_3_)" points="74.001,48.5 74.166,48.5 80.166,41.5 81.5,38.833 81.5,33.5 81.5,38.833 81.5,60.833
+ 74.666,67.666 73.166,69.166 62.166,69.166 62.166,51.167 70.875,51.125 72,50.375 74.166,48.5 80.166,41.5 "/>
+<linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="5.2915" y1="53.333" x2="13.0005" y2="53.333">
+ <stop offset="0" style="stop-color:#ADADAB;stop-opacity:0.56"/>
+ <stop offset="0.3404" style="stop-color:#AFAFAD;stop-opacity:0.7585"/>
+ <stop offset="0.463" style="stop-color:#B6B6B3;stop-opacity:0.8299"/>
+ <stop offset="0.5504" style="stop-color:#C1C1BF;stop-opacity:0.8809"/>
+ <stop offset="0.621" style="stop-color:#D2D2CF;stop-opacity:0.9221"/>
+ <stop offset="0.6808" style="stop-color:#E8E8E4;stop-opacity:0.9569"/>
+ <stop offset="0.7273" style="stop-color:#FFFFFA;stop-opacity:0.984"/>
+ <stop offset="0.8289" style="stop-color:#FDFDF8;stop-opacity:0.99"/>
+ <stop offset="0.8655" style="stop-color:#F6F6F2;stop-opacity:0.9921"/>
+ <stop offset="0.8916" style="stop-color:#EBEBE6;stop-opacity:0.9936"/>
+ <stop offset="0.9127" style="stop-color:#DADAD5;stop-opacity:0.9949"/>
+ <stop offset="0.9308" style="stop-color:#C4C4C0;stop-opacity:0.9959"/>
+ <stop offset="0.9468" style="stop-color:#A8A8A5;stop-opacity:0.9969"/>
+ <stop offset="0.9613" style="stop-color:#888885;stop-opacity:0.9977"/>
+ <stop offset="0.9746" style="stop-color:#626260;stop-opacity:0.9985"/>
+ <stop offset="0.987" style="stop-color:#373736;stop-opacity:0.9992"/>
+ <stop offset="0.998" style="stop-color:#090909;stop-opacity:0.9999"/>
+ <stop offset="1" style="stop-color:#000000"/>
+ <stop offset="1" style="stop-color:#060606"/>
+ <stop offset="1" style="stop-color:#151515"/>
+ <stop offset="1" style="stop-color:#303030"/>
+ <stop offset="1" style="stop-color:#545454"/>
+ <stop offset="1" style="stop-color:#838383"/>
+ <stop offset="1" style="stop-color:#BCBCBC"/>
+ <stop offset="1" style="stop-color:#F7F7F7"/>
+</linearGradient>
+<polygon fill="url(#SVGID_4_)" points="5.292,42.167 5.5,62.833 6.833,63.833 9.833,64.5 12.833,64.167 13,45.334 9.283,44.537 "/>
+<linearGradient id="SVGID_5_" gradientUnits="userSpaceOnUse" x1="12.834" y1="48.25" x2="71.75" y2="48.25">
+ <stop offset="0" style="stop-color:#C9C9BF;stop-opacity:0.56"/>
+ <stop offset="0.4091" style="stop-color:#CBCBC1;stop-opacity:0.772"/>
+ <stop offset="0.5565" style="stop-color:#D1D1C8;stop-opacity:0.8484"/>
+ <stop offset="0.6615" style="stop-color:#DCDCD3;stop-opacity:0.9028"/>
+ <stop offset="0.7458" style="stop-color:#EBEBE4;stop-opacity:0.9465"/>
+ <stop offset="0.8182" style="stop-color:#FFFFFA;stop-opacity:0.984"/>
+ <stop offset="0.8859" style="stop-color:#FDFDF8;stop-opacity:0.99"/>
+ <stop offset="0.9103" style="stop-color:#F6F6F2;stop-opacity:0.9921"/>
+ <stop offset="0.9277" style="stop-color:#EBEBE6;stop-opacity:0.9936"/>
+ <stop offset="0.9418" style="stop-color:#DADAD5;stop-opacity:0.9949"/>
+ <stop offset="0.9539" style="stop-color:#C4C4C0;stop-opacity:0.9959"/>
+ <stop offset="0.9645" style="stop-color:#A8A8A5;stop-opacity:0.9969"/>
+ <stop offset="0.9742" style="stop-color:#888885;stop-opacity:0.9977"/>
+ <stop offset="0.9831" style="stop-color:#626260;stop-opacity:0.9985"/>
+ <stop offset="0.9913" style="stop-color:#373736;stop-opacity:0.9992"/>
+ <stop offset="0.9987" style="stop-color:#090909;stop-opacity:0.9999"/>
+ <stop offset="1" style="stop-color:#000000"/>
+ <stop offset="1" style="stop-color:#060606"/>
+ <stop offset="1" style="stop-color:#151515"/>
+ <stop offset="1" style="stop-color:#303030"/>
+ <stop offset="1" style="stop-color:#545454"/>
+ <stop offset="1" style="stop-color:#838383"/>
+ <stop offset="1" style="stop-color:#BCBCBC"/>
+ <stop offset="1" style="stop-color:#F7F7F7"/>
+</linearGradient>
+<polygon fill="url(#SVGID_5_)" points="70.5,51.167 62.166,51.167 12.834,47 13,45.334 70.167,49.834 71.25,49.125 71.75,50.625 "/>
+<linearGradient id="SVGID_6_" gradientUnits="userSpaceOnUse" x1="5.4995" y1="60.584" x2="81.5" y2="60.584">
+ <stop offset="0" style="stop-color:#C9C9BF;stop-opacity:0.56"/>
+ <stop offset="0.0042" style="stop-color:#C5C5BB;stop-opacity:0.5619"/>
+ <stop offset="0.0499" style="stop-color:#9C9C94;stop-opacity:0.5819"/>
+ <stop offset="0.0998" style="stop-color:#777771;stop-opacity:0.6039"/>
+ <stop offset="0.1556" style="stop-color:#575752;stop-opacity:0.6284"/>
+ <stop offset="0.2171" style="stop-color:#3B3B38;stop-opacity:0.6555"/>
+ <stop offset="0.2867" style="stop-color:#252524;stop-opacity:0.6861"/>
+ <stop offset="0.3679" style="stop-color:#141413;stop-opacity:0.7219"/>
+ <stop offset="0.4683" style="stop-color:#090908;stop-opacity:0.7661"/>
+ <stop offset="0.6091" style="stop-color:#020202;stop-opacity:0.828"/>
+ <stop offset="1" style="stop-color:#000000"/>
+</linearGradient>
+<polygon fill="url(#SVGID_6_)" points="81.5,60.833 81.167,63.334 73.001,73.334 72.001,74 68.834,74 65.001,74.167 61.834,74.167
+ 10,68.5 8.834,68.334 7.334,67.5 5.834,65.667 5.5,62.833 6.833,63.833 9.833,64.5 12.833,64.167 12.834,47 62.166,51.167
+ 62.166,69.166 70,69.25 71.75,69 72.875,68.625 74,67.875 "/>
+<g>
+ <polygon fill="#FFFFFF" points="16.193,74.057 28.847,57.109 54.479,60.105 42.896,79.108 "/>
+ <path fill="#CCCCCC" d="M29.059,57.602l24.646,2.881L42.666,78.592l-25.655-4.854L29.059,57.602 M28.635,56.616l-13.26,17.759
+ l27.75,5.25l12.129-19.897L28.635,56.616L28.635,56.616z"/>
+</g>
+<linearGradient id="SVGID_7_" gradientUnits="userSpaceOnUse" x1="43.6729" y1="40.2471" x2="44.2277" y2="24.3578" gradientTransform="matrix(0.9873 -0.0177 0.0176 0.985 -0.1104 0.7738)">
+ <stop offset="0.49" style="stop-color:#E0E0DE"/>
+ <stop offset="0.6851" style="stop-color:#DEDEDC"/>
+ <stop offset="0.7553" style="stop-color:#D7D7D5"/>
+ <stop offset="0.8054" style="stop-color:#CBCBCA"/>
+ <stop offset="0.8459" style="stop-color:#BBBBB9"/>
+ <stop offset="0.8806" style="stop-color:#A5A5A3"/>
+ <stop offset="0.9114" style="stop-color:#898988"/>
+ <stop offset="0.9392" style="stop-color:#696968"/>
+ <stop offset="0.9647" style="stop-color:#434343"/>
+ <stop offset="0.9875" style="stop-color:#1A1A1A"/>
+ <stop offset="1" style="stop-color:#000000"/>
+ <stop offset="1" style="stop-color:#060606;stop-opacity:0.9437"/>
+ <stop offset="1" style="stop-color:#151515;stop-opacity:0.8718"/>
+ <stop offset="1" style="stop-color:#303030;stop-opacity:0.7914"/>
+ <stop offset="1" style="stop-color:#545454;stop-opacity:0.7049"/>
+ <stop offset="1" style="stop-color:#838383;stop-opacity:0.6134"/>
+ <stop offset="1" style="stop-color:#BCBCBC;stop-opacity:0.5192"/>
+ <stop offset="1" style="stop-color:#C8C8C8;stop-opacity:0.5"/>
+</linearGradient>
+<polygon fill="url(#SVGID_7_)" stroke="#FFFFFF" stroke-width="0.7398" points="29.968,23.748 29.229,38.253 57.516,39.879
+ 58.485,24.731 57.745,24.744 "/>
+<linearGradient id="SVGID_8_" gradientUnits="userSpaceOnUse" x1="25.834" y1="41.75" x2="57.5" y2="41.75">
+ <stop offset="0" style="stop-color:#C8C8C8;stop-opacity:0.5"/>
+ <stop offset="0" style="stop-color:#BCBCBC;stop-opacity:0.5192"/>
+ <stop offset="0" style="stop-color:#838383;stop-opacity:0.6134"/>
+ <stop offset="0" style="stop-color:#545454;stop-opacity:0.7049"/>
+ <stop offset="0" style="stop-color:#303030;stop-opacity:0.7914"/>
+ <stop offset="0" style="stop-color:#151515;stop-opacity:0.8718"/>
+ <stop offset="0" style="stop-color:#060606;stop-opacity:0.9437"/>
+ <stop offset="0" style="stop-color:#000000"/>
+ <stop offset="0.0125" style="stop-color:#1A1A1A"/>
+ <stop offset="0.0353" style="stop-color:#434343"/>
+ <stop offset="0.0608" style="stop-color:#696968"/>
+ <stop offset="0.0886" style="stop-color:#898988"/>
+ <stop offset="0.1194" style="stop-color:#A5A5A3"/>
+ <stop offset="0.1541" style="stop-color:#BBBBB9"/>
+ <stop offset="0.1946" style="stop-color:#CBCBCA"/>
+ <stop offset="0.2447" style="stop-color:#D7D7D5"/>
+ <stop offset="0.3149" style="stop-color:#DEDEDC"/>
+ <stop offset="0.51" style="stop-color:#E0E0DE"/>
+</linearGradient>
+<polygon fill="url(#SVGID_8_)" stroke="#666666" stroke-width="0.5" points="25.834,42.667 29.167,38.833 57.5,40.375
+ 54.667,44.667 "/>
+<polygon fill="#FFFFFF" points="36.375,29.375 36,29.375 35.667,34.875 49.834,35.708 50,29.875 "/>
+<polygon points="23.75,29.375 6.5,42.75 5.375,41.75 22.167,29.5 22.875,29 23.625,28.875 "/>
+<linearGradient id="SVGID_9_" gradientUnits="userSpaceOnUse" x1="69.2783" y1="45.7109" x2="83.5552" y2="36.7898">
+ <stop offset="0" style="stop-color:#A8B0B3"/>
+ <stop offset="0.1726" style="stop-color:#7B8183"/>
+ <stop offset="0.3672" style="stop-color:#4F5355"/>
+ <stop offset="0.5533" style="stop-color:#2D2F30"/>
+ <stop offset="0.7258" style="stop-color:#141516"/>
+ <stop offset="0.8799" style="stop-color:#050506"/>
+ <stop offset="1" style="stop-color:#000000"/>
+ <stop offset="1" style="stop-color:#060606"/>
+ <stop offset="1" style="stop-color:#151515"/>
+ <stop offset="1" style="stop-color:#303030"/>
+ <stop offset="1" style="stop-color:#545454"/>
+ <stop offset="1" style="stop-color:#838383"/>
+ <stop offset="1" style="stop-color:#BCBCBC"/>
+ <stop offset="1" style="stop-color:#C8C8C8"/>
+</linearGradient>
+<polygon fill="url(#SVGID_9_)" points="69.166,44.167 71.334,49 81.5,38.833 81.5,33.5 "/>
+<linearGradient id="SVGID_10_" gradientUnits="userSpaceOnUse" x1="71.334" y1="49" x2="71.334" y2="49">
+ <stop offset="0" style="stop-color:#A8B0B3"/>
+ <stop offset="0.1726" style="stop-color:#7B8183"/>
+ <stop offset="0.3672" style="stop-color:#4F5355"/>
+ <stop offset="0.5533" style="stop-color:#2D2F30"/>
+ <stop offset="0.7258" style="stop-color:#141516"/>
+ <stop offset="0.8799" style="stop-color:#050506"/>
+ <stop offset="1" style="stop-color:#000000"/>
+ <stop offset="1" style="stop-color:#060606"/>
+ <stop offset="1" style="stop-color:#151515"/>
+ <stop offset="1" style="stop-color:#303030"/>
+ <stop offset="1" style="stop-color:#545454"/>
+ <stop offset="1" style="stop-color:#838383"/>
+ <stop offset="1" style="stop-color:#BCBCBC"/>
+ <stop offset="1" style="stop-color:#C8C8C8"/>
+</linearGradient>
+<path fill="url(#SVGID_10_)" d="M71.334,49"/>
+</svg>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/gfx/qgn_menu_directprintapp_yellow.svg Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,236 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="レイヤー_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
+ y="0px" width="86px" height="86px" viewBox="0 0 86 86" enable-background="new 0 0 86 86" xml:space="preserve">
+<polyline fill="#FFFFCC" points="23.125,28.375 5.375,41.75 5.25,65.25 6.25,66.75 7.334,67.5 8.25,68.375 17.25,69.375
+ 13.625,73.75 42.141,79.134 46.75,72.75 62.75,74.375 72.001,74 73.001,73.334 73.75,73 81.5,62.75 81.5,61.375 81.5,33.5 81,32.5
+ 80.25,31.75 79.25,31.375 58.125,30.625 58.729,24.499 29.852,23.5 28.875,28.5 "/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="19.6255" y1="53.1055" x2="72.8606" y2="19.8405">
+ <stop offset="0" style="stop-color:#A8B0B3"/>
+ <stop offset="0.2537" style="stop-color:#A6AEB0"/>
+ <stop offset="0.4063" style="stop-color:#9EA5A8"/>
+ <stop offset="0.5322" style="stop-color:#90979A"/>
+ <stop offset="0.6435" style="stop-color:#7D8385"/>
+ <stop offset="0.7453" style="stop-color:#65696B"/>
+ <stop offset="0.84" style="stop-color:#464A4B"/>
+ <stop offset="0.9275" style="stop-color:#232525"/>
+ <stop offset="1" style="stop-color:#000000"/>
+ <stop offset="1" style="stop-color:#060606"/>
+ <stop offset="1" style="stop-color:#151515"/>
+ <stop offset="1" style="stop-color:#303030"/>
+ <stop offset="1" style="stop-color:#545454"/>
+ <stop offset="1" style="stop-color:#838383"/>
+ <stop offset="1" style="stop-color:#BCBCBC"/>
+ <stop offset="1" style="stop-color:#C8C8C8"/>
+</linearGradient>
+<polygon fill="url(#SVGID_1_)" points="20.833,30.833 10.5,38.5 12.167,40.167 69.166,44.167 81.501,33.667 79.5,31.833
+ 28.167,28.833 24.5,28.833 22.167,29.5 "/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="5.1665" y1="44.167" x2="71.334" y2="44.167">
+ <stop offset="0.0909" style="stop-color:#000000"/>
+ <stop offset="0.3465" style="stop-color:#020202"/>
+ <stop offset="0.4804" style="stop-color:#0A0A0A"/>
+ <stop offset="0.5862" style="stop-color:#181818"/>
+ <stop offset="0.6771" style="stop-color:#2B2B2B"/>
+ <stop offset="0.7586" style="stop-color:#444444"/>
+ <stop offset="0.8334" style="stop-color:#626262"/>
+ <stop offset="0.9029" style="stop-color:#868686"/>
+ <stop offset="0.9666" style="stop-color:#AFAFAF"/>
+ <stop offset="1" style="stop-color:#C8C8C8"/>
+ <stop offset="1" style="stop-color:#FFFCFF"/>
+</linearGradient>
+<polygon fill="url(#SVGID_2_)" points="5.167,42.167 7.125,43.375 9.158,44.537 11.833,45.167 62.334,49.334 70.167,49.834
+ 71.334,49 69.166,44.167 12.167,40.167 10.5,38.5 "/>
+<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="62.166" y1="51.333" x2="81.5" y2="51.333">
+ <stop offset="0" style="stop-color:#9C9C96;stop-opacity:0.56"/>
+ <stop offset="0.2262" style="stop-color:#9E9E98;stop-opacity:0.7507"/>
+ <stop offset="0.3077" style="stop-color:#A5A59F;stop-opacity:0.8194"/>
+ <stop offset="0.3658" style="stop-color:#B0B0AA;stop-opacity:0.8683"/>
+ <stop offset="0.4128" style="stop-color:#C1C1BB;stop-opacity:0.9079"/>
+ <stop offset="0.453" style="stop-color:#D7D7D1;stop-opacity:0.9418"/>
+ <stop offset="0.488" style="stop-color:#F1F1EC;stop-opacity:0.9713"/>
+ <stop offset="0.503" style="stop-color:#FFFFFA;stop-opacity:0.984"/>
+ <stop offset="0.6882" style="stop-color:#FDFDF8;stop-opacity:0.99"/>
+ <stop offset="0.7549" style="stop-color:#F6F6F2;stop-opacity:0.9921"/>
+ <stop offset="0.8025" style="stop-color:#EBEBE6;stop-opacity:0.9936"/>
+ <stop offset="0.841" style="stop-color:#DADAD5;stop-opacity:0.9949"/>
+ <stop offset="0.8739" style="stop-color:#C4C4C0;stop-opacity:0.9959"/>
+ <stop offset="0.9031" style="stop-color:#A8A8A5;stop-opacity:0.9969"/>
+ <stop offset="0.9295" style="stop-color:#888885;stop-opacity:0.9977"/>
+ <stop offset="0.9537" style="stop-color:#626260;stop-opacity:0.9985"/>
+ <stop offset="0.9763" style="stop-color:#373736;stop-opacity:0.9992"/>
+ <stop offset="0.9963" style="stop-color:#090909;stop-opacity:0.9999"/>
+ <stop offset="1" style="stop-color:#000000"/>
+ <stop offset="1" style="stop-color:#050506"/>
+ <stop offset="1" style="stop-color:#141415"/>
+ <stop offset="1" style="stop-color:#2D2D30"/>
+ <stop offset="1" style="stop-color:#505054"/>
+ <stop offset="1" style="stop-color:#7D7D83"/>
+ <stop offset="1" style="stop-color:#B2B2BC"/>
+ <stop offset="1" style="stop-color:#BDBDC7"/>
+</linearGradient>
+<polyline fill="url(#SVGID_3_)" points="74.001,48.5 74.166,48.5 80.166,41.5 81.5,38.833 81.5,33.5 81.5,38.833 81.5,60.833
+ 74.666,67.666 73.166,69.166 62.166,69.166 62.166,51.167 70.875,51.125 72,50.375 74.166,48.5 80.166,41.5 "/>
+<linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="5.2915" y1="53.333" x2="13.0005" y2="53.333">
+ <stop offset="0" style="stop-color:#C9C9BF;stop-opacity:0.56"/>
+ <stop offset="0.4091" style="stop-color:#CBCBC1;stop-opacity:0.772"/>
+ <stop offset="0.5565" style="stop-color:#D1D1C8;stop-opacity:0.8484"/>
+ <stop offset="0.6615" style="stop-color:#DCDCD3;stop-opacity:0.9028"/>
+ <stop offset="0.7458" style="stop-color:#EBEBE4;stop-opacity:0.9465"/>
+ <stop offset="0.8182" style="stop-color:#FFFFFA;stop-opacity:0.984"/>
+ <stop offset="0.8859" style="stop-color:#FDFDF8;stop-opacity:0.99"/>
+ <stop offset="0.9103" style="stop-color:#F6F6F2;stop-opacity:0.9921"/>
+ <stop offset="0.9277" style="stop-color:#EBEBE6;stop-opacity:0.9936"/>
+ <stop offset="0.9418" style="stop-color:#DADAD5;stop-opacity:0.9949"/>
+ <stop offset="0.9539" style="stop-color:#C4C4C0;stop-opacity:0.9959"/>
+ <stop offset="0.9645" style="stop-color:#A8A8A5;stop-opacity:0.9969"/>
+ <stop offset="0.9742" style="stop-color:#888885;stop-opacity:0.9977"/>
+ <stop offset="0.9831" style="stop-color:#626260;stop-opacity:0.9985"/>
+ <stop offset="0.9913" style="stop-color:#373736;stop-opacity:0.9992"/>
+ <stop offset="0.9987" style="stop-color:#090909;stop-opacity:0.9999"/>
+ <stop offset="1" style="stop-color:#000000"/>
+ <stop offset="1" style="stop-color:#060606"/>
+ <stop offset="1" style="stop-color:#151515"/>
+ <stop offset="1" style="stop-color:#303030"/>
+ <stop offset="1" style="stop-color:#545454"/>
+ <stop offset="1" style="stop-color:#838383"/>
+ <stop offset="1" style="stop-color:#BCBCBC"/>
+ <stop offset="1" style="stop-color:#F7F7F7"/>
+</linearGradient>
+<polygon fill="url(#SVGID_4_)" points="5.292,42.167 5.5,62.833 6.833,63.833 9.833,64.5 12.833,64.167 13,45.334 9.283,44.537 "/>
+<linearGradient id="SVGID_5_" gradientUnits="userSpaceOnUse" x1="12.834" y1="48.25" x2="71.75" y2="48.25">
+ <stop offset="0" style="stop-color:#C9C9BF;stop-opacity:0.56"/>
+ <stop offset="0.4091" style="stop-color:#CBCBC1;stop-opacity:0.772"/>
+ <stop offset="0.5565" style="stop-color:#D1D1C8;stop-opacity:0.8484"/>
+ <stop offset="0.6615" style="stop-color:#DCDCD3;stop-opacity:0.9028"/>
+ <stop offset="0.7458" style="stop-color:#EBEBE4;stop-opacity:0.9465"/>
+ <stop offset="0.8182" style="stop-color:#FFFFFA;stop-opacity:0.984"/>
+ <stop offset="0.8859" style="stop-color:#FDFDF8;stop-opacity:0.99"/>
+ <stop offset="0.9103" style="stop-color:#F6F6F2;stop-opacity:0.9921"/>
+ <stop offset="0.9277" style="stop-color:#EBEBE6;stop-opacity:0.9936"/>
+ <stop offset="0.9418" style="stop-color:#DADAD5;stop-opacity:0.9949"/>
+ <stop offset="0.9539" style="stop-color:#C4C4C0;stop-opacity:0.9959"/>
+ <stop offset="0.9645" style="stop-color:#A8A8A5;stop-opacity:0.9969"/>
+ <stop offset="0.9742" style="stop-color:#888885;stop-opacity:0.9977"/>
+ <stop offset="0.9831" style="stop-color:#626260;stop-opacity:0.9985"/>
+ <stop offset="0.9913" style="stop-color:#373736;stop-opacity:0.9992"/>
+ <stop offset="0.9987" style="stop-color:#090909;stop-opacity:0.9999"/>
+ <stop offset="1" style="stop-color:#000000"/>
+ <stop offset="1" style="stop-color:#060606"/>
+ <stop offset="1" style="stop-color:#151515"/>
+ <stop offset="1" style="stop-color:#303030"/>
+ <stop offset="1" style="stop-color:#545454"/>
+ <stop offset="1" style="stop-color:#838383"/>
+ <stop offset="1" style="stop-color:#BCBCBC"/>
+ <stop offset="1" style="stop-color:#F7F7F7"/>
+</linearGradient>
+<polygon fill="url(#SVGID_5_)" points="70.5,51.167 62.166,51.167 12.834,47 13,45.334 70.167,49.834 71.25,49.125 71.75,50.625 "/>
+<linearGradient id="SVGID_6_" gradientUnits="userSpaceOnUse" x1="5.4995" y1="60.584" x2="81.5" y2="60.584">
+ <stop offset="0" style="stop-color:#C9C9BF;stop-opacity:0.56"/>
+ <stop offset="0.0042" style="stop-color:#C5C5BB;stop-opacity:0.5619"/>
+ <stop offset="0.0499" style="stop-color:#9C9C94;stop-opacity:0.5819"/>
+ <stop offset="0.0998" style="stop-color:#777771;stop-opacity:0.6039"/>
+ <stop offset="0.1556" style="stop-color:#575752;stop-opacity:0.6284"/>
+ <stop offset="0.2171" style="stop-color:#3B3B38;stop-opacity:0.6555"/>
+ <stop offset="0.2867" style="stop-color:#252524;stop-opacity:0.6861"/>
+ <stop offset="0.3679" style="stop-color:#141413;stop-opacity:0.7219"/>
+ <stop offset="0.4683" style="stop-color:#090908;stop-opacity:0.7661"/>
+ <stop offset="0.6091" style="stop-color:#020202;stop-opacity:0.828"/>
+ <stop offset="1" style="stop-color:#000000"/>
+</linearGradient>
+<polygon fill="url(#SVGID_6_)" points="81.5,60.833 81.167,63.334 73.001,73.334 72.001,74 68.834,74 65.001,74.167 61.834,74.167
+ 10,68.5 8.834,68.334 7.334,67.5 5.834,65.667 5.5,62.833 6.833,63.833 9.833,64.5 12.833,64.167 12.834,47 62.166,51.167
+ 62.166,69.166 70,69.25 71.75,69 72.875,68.625 74,67.875 "/>
+<g>
+ <polygon fill="#FFFFFF" points="14.951,73.339 28.827,57.106 54.441,60.101 41.928,78.618 "/>
+ <path fill="#CCCCCC" d="M29.019,57.597l24.609,2.877l-11.913,17.63l-25.893-5.068L29.019,57.597 M28.635,56.616L14.081,73.642
+ l28.06,5.492l13.113-19.406L28.635,56.616L28.635,56.616z"/>
+</g>
+<linearGradient id="SVGID_7_" gradientUnits="userSpaceOnUse" x1="43.6719" y1="40.2466" x2="44.2267" y2="24.3573" gradientTransform="matrix(0.9998 -0.0179 0.0179 0.9998 -0.6087 0.1803)">
+ <stop offset="0.49" style="stop-color:#E0E0DE"/>
+ <stop offset="0.6851" style="stop-color:#DEDEDC"/>
+ <stop offset="0.7553" style="stop-color:#D7D7D5"/>
+ <stop offset="0.8054" style="stop-color:#CBCBCA"/>
+ <stop offset="0.8459" style="stop-color:#BBBBB9"/>
+ <stop offset="0.8806" style="stop-color:#A5A5A3"/>
+ <stop offset="0.9114" style="stop-color:#898988"/>
+ <stop offset="0.9392" style="stop-color:#696968"/>
+ <stop offset="0.9647" style="stop-color:#434343"/>
+ <stop offset="0.9875" style="stop-color:#1A1A1A"/>
+ <stop offset="1" style="stop-color:#000000"/>
+ <stop offset="1" style="stop-color:#060606;stop-opacity:0.9437"/>
+ <stop offset="1" style="stop-color:#151515;stop-opacity:0.8718"/>
+ <stop offset="1" style="stop-color:#303030;stop-opacity:0.7914"/>
+ <stop offset="1" style="stop-color:#545454;stop-opacity:0.7049"/>
+ <stop offset="1" style="stop-color:#838383;stop-opacity:0.6134"/>
+ <stop offset="1" style="stop-color:#BCBCBC;stop-opacity:0.5192"/>
+ <stop offset="1" style="stop-color:#C8C8C8;stop-opacity:0.5"/>
+</linearGradient>
+<polygon fill="url(#SVGID_7_)" stroke="#FFFFFF" stroke-width="0.75" points="29.852,23.5 29.104,38.224 57.748,39.875
+ 58.729,24.499 57.979,24.512 "/>
+<linearGradient id="SVGID_8_" gradientUnits="userSpaceOnUse" x1="25.834" y1="41.75" x2="57.5" y2="41.75">
+ <stop offset="0" style="stop-color:#C8C8C8;stop-opacity:0.5"/>
+ <stop offset="0" style="stop-color:#BCBCBC;stop-opacity:0.5192"/>
+ <stop offset="0" style="stop-color:#838383;stop-opacity:0.6134"/>
+ <stop offset="0" style="stop-color:#545454;stop-opacity:0.7049"/>
+ <stop offset="0" style="stop-color:#303030;stop-opacity:0.7914"/>
+ <stop offset="0" style="stop-color:#151515;stop-opacity:0.8718"/>
+ <stop offset="0" style="stop-color:#060606;stop-opacity:0.9437"/>
+ <stop offset="0" style="stop-color:#000000"/>
+ <stop offset="0.0125" style="stop-color:#1A1A1A"/>
+ <stop offset="0.0353" style="stop-color:#434343"/>
+ <stop offset="0.0608" style="stop-color:#696968"/>
+ <stop offset="0.0886" style="stop-color:#898988"/>
+ <stop offset="0.1194" style="stop-color:#A5A5A3"/>
+ <stop offset="0.1541" style="stop-color:#BBBBB9"/>
+ <stop offset="0.1946" style="stop-color:#CBCBCA"/>
+ <stop offset="0.2447" style="stop-color:#D7D7D5"/>
+ <stop offset="0.3149" style="stop-color:#DEDEDC"/>
+ <stop offset="0.51" style="stop-color:#E0E0DE"/>
+</linearGradient>
+<polygon fill="url(#SVGID_8_)" stroke="#666666" stroke-width="0.5" points="25.834,42.667 29.167,38.833 57.5,40.375
+ 54.667,44.667 "/>
+<polygon fill="#FFFFFF" points="36.375,29.375 36,29.375 35.667,34.875 49.834,35.708 50,29.875 "/>
+<polygon points="23.75,29.375 6.5,42.75 5.375,41.75 22.167,29.5 22.875,29 23.625,28.875 "/>
+<linearGradient id="SVGID_9_" gradientUnits="userSpaceOnUse" x1="69.2783" y1="45.7109" x2="83.5552" y2="36.7898">
+ <stop offset="0" style="stop-color:#A8B0B3"/>
+ <stop offset="0.1726" style="stop-color:#7B8183"/>
+ <stop offset="0.3672" style="stop-color:#4F5355"/>
+ <stop offset="0.5533" style="stop-color:#2D2F30"/>
+ <stop offset="0.7258" style="stop-color:#141516"/>
+ <stop offset="0.8799" style="stop-color:#050506"/>
+ <stop offset="1" style="stop-color:#000000"/>
+ <stop offset="1" style="stop-color:#060606"/>
+ <stop offset="1" style="stop-color:#151515"/>
+ <stop offset="1" style="stop-color:#303030"/>
+ <stop offset="1" style="stop-color:#545454"/>
+ <stop offset="1" style="stop-color:#838383"/>
+ <stop offset="1" style="stop-color:#BCBCBC"/>
+ <stop offset="1" style="stop-color:#C8C8C8"/>
+</linearGradient>
+<polygon fill="url(#SVGID_9_)" points="69.166,44.167 71.334,49 81.5,38.833 81.5,33.5 "/>
+<g>
+ <path d="M30.569,60.508c1.881,0.611,3.933,1.166,5.257,1.355l0.652,1.387c-0.071,0.004-0.2-0.045-0.365-0.183
+ c-1.438-0.296-3.623-0.968-5.577-1.644l-1.485,2.334l4.729,3.011l-0.5,0.786l-4.729-3.012l-1.934,3.036l4.94,3.146l-0.492,0.773
+ l-4.94-3.146l-0.63,0.988l-1.094-0.695l5.595-8.787L30.569,60.508z M43.425,68.324l-4.473,7.024
+ c-0.659,1.036-1.451,0.55-3.962-1.05c0.08-0.268,0.118-0.762,0.092-1.079c0.433,0.292,0.856,0.562,1.215,0.79
+ c1.387,0.883,1.387,0.883,1.554,0.621l3.964-6.227L37.411,65.6l-5.799,9.108l-1.109-0.705l6.3-9.895L43.425,68.324z"/>
+</g>
+<linearGradient id="SVGID_10_" gradientUnits="userSpaceOnUse" x1="71.334" y1="49" x2="71.334" y2="49">
+ <stop offset="0" style="stop-color:#A8B0B3"/>
+ <stop offset="0.1726" style="stop-color:#7B8183"/>
+ <stop offset="0.3672" style="stop-color:#4F5355"/>
+ <stop offset="0.5533" style="stop-color:#2D2F30"/>
+ <stop offset="0.7258" style="stop-color:#141516"/>
+ <stop offset="0.8799" style="stop-color:#050506"/>
+ <stop offset="1" style="stop-color:#000000"/>
+ <stop offset="1" style="stop-color:#060606"/>
+ <stop offset="1" style="stop-color:#151515"/>
+ <stop offset="1" style="stop-color:#303030"/>
+ <stop offset="1" style="stop-color:#545454"/>
+ <stop offset="1" style="stop-color:#838383"/>
+ <stop offset="1" style="stop-color:#BCBCBC"/>
+ <stop offset="1" style="stop-color:#C8C8C8"/>
+</linearGradient>
+<path fill="url(#SVGID_10_)" d="M71.334,49"/>
+</svg>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/group/bld.inf Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+
+PRJ_PLATFORMS
+WINSCW ARMV5 GCCE
+
+PRJ_EXPORTS
+../engine/inc/directprintband.h |../../inc/directprintband.h
+../engine/inc/directprintbanduid.h |../../inc/directprintbanduid.h
+
+PRJ_MMPFILES
+
+gnumakefile icons_scalable_dc.mk
+
+DirectPrintApp.mmp
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/group/directprintapp.mmp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,139 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Use standard macros
+#include <platform_paths.hrh>
+
+// Build target
+TARGET DirectPrintApp.exe
+TARGETTYPE exe
+UID 0x100039CE 0x2002BB28
+
+EPOCSTACKSIZE 0x10000 // Min 64kb
+EPOCHEAPSIZE 0x20000 0x1000000 // Min 128kb, max 16Mb
+
+sourcepath ../src
+source directprintapp.cpp
+source directprintappapplication.cpp
+source directprintappappui.cpp
+source directprintappdocument.cpp
+source directprintmodel.cpp
+source directprintbearermgr.cpp
+source directprintprinterdata.cpp
+source directprintbearerdata.cpp
+source directprintproperty.cpp
+source directprintmsgutil.cpp
+source directprintuipluginmgr.cpp
+source directprintprinterinforeader.cpp
+
+sourcepath ../ui/src
+source directprintlistbox.cpp
+source directprintsettinglistbox.cpp
+source directprintlistview.cpp
+source directprintmainview.cpp
+source directprintpreviewview.cpp
+source directprintpropertyview.cpp
+source directprintsearchresultview.cpp
+source directprintsettingview.cpp
+source directprintviewbase.cpp
+source directprintpreviewcontrol.cpp
+
+sourcepath ../engine/src
+source directprintengine.cpp
+source directprintfloatcapability.cpp
+source directprintlistcapability.cpp
+source directprinttintcapability.cpp
+source directprinttextcapability.cpp
+source directprintprintsettings.cpp
+source directprintsettingsconverter.cpp
+
+
+SOURCEPATH ../data
+
+START RESOURCE DirectPrintApp.rss
+HEADER
+TARGET DirectPrintApp
+TARGETPATH resource/apps
+END //RESOURCE
+
+START RESOURCE DirectPrintApp_reg.rss
+TARGET DirectPrintApp_reg
+TARGETPATH /private/10003a3f/apps
+END //RESOURCE
+
+
+
+USERINCLUDE ../inc
+USERINCLUDE ../ui/inc
+USERINCLUDE ../engine/inc
+USERINCLUDE ../../inc
+USERINCLUDE ../../ImagePrintLibrary/inc
+
+SYSTEMINCLUDE /epoc32/include/ecom
+
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY euser.lib
+LIBRARY apparc.lib
+LIBRARY cone.lib
+LIBRARY eikcore.lib
+LIBRARY avkon.lib
+LIBRARY ecom.lib // REComSession
+LIBRARY commonengine.lib
+LIBRARY efsrv.lib
+LIBRARY estor.lib
+LIBRARY aknnotify.lib
+LIBRARY eikdlg.lib
+LIBRARY bafl.lib
+LIBRARY insock.lib
+LIBRARY eikctl.lib
+LIBRARY servicehandler.lib
+LIBRARY ws32.lib
+LIBRARY gdi.lib
+LIBRARY print.lib // CPrintSetup
+LIBRARY prev.lib // CPrintPreviewImage
+LIBRARY fbscli.lib // CFbsBitmap
+LIBRARY etext.lib // CRichText
+LIBRARY pdrprt.lib // CFilePrinterPort
+LIBRARY field.lib // CPageNumField
+LIBRARY eikcoctl.lib // CEikBorderedControl
+LIBRARY egul.lib // TGulBorder
+
+LIBRARY centralrepository.lib // CRepository
+
+LIBRARY directprintclient.lib // CDirectPrintClient
+
+LIBRARY XmlEngineDom.lib
+
+STATICLIBRARY clog.lib
+LIBRARY flogger.lib
+
+LIBRARY platformenv.lib
+
+//not use LIBRARY featmgr.lib
+
+LANG SC
+
+VENDORID 0
+SECUREID 0x2002BB28
+CAPABILITY ALL -TCB
+
+#ifdef ENABLE_ABIV2_MODE
+DEBUGGABLE_UDEBONLY
+#endif
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/group/icons_scalable_dc.mk Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,59 @@
+# ============================================================================
+# Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of the License "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:
+# Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+#
+# Contributors:
+#
+# Description: This is file for creating .mif file (scalable icon)
+#
+# ============================================================================
+
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=$(EPOCROOT)epoc32\release\$(PLATFORM)\$(CFG)\Z
+else
+ZDIR=$(EPOCROOT)epoc32\data\z
+endif
+
+TARGETDIR=$(ZDIR)\resource\apps
+ICONTARGETFILENAME=$(TARGETDIR)\DirectPrintApp.mif
+
+ICONDIR=..\gfx
+
+do_nothing :
+ @rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN :
+ @echo ...Deleting $(ICONTARGETFILENAME)
+ if exist $(ICONTARGETFILENAME) del /q /f $(ICONTARGETFILENAME)
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+RESOURCE : $(ICONTARGETFILENAME)
+
+$(ICONTARGETFILENAME) : $(ICONDIR)\qgn_menu_DirectPrintApp.svg
+ mifconv $(ICONTARGETFILENAME) \
+ /c32 $(ICONDIR)\qgn_menu_DirectPrintApp.svg
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+ @echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/inc/directprintapp.hrh Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef __DIRECTPRINTAPP_HRH__
+#define __DIRECTPRINTAPP_HRH__
+
+#define _UID3 0x2002BB28
+
+enum TDirectPrintViewIds
+ {
+ EDirectPrintMainViewId = 1,
+ EDirectPrintPrinterListViewId,
+ EDirectPrintSearchResultViewId,
+ EDirectPrintPrinterSettingViewId,
+ EDirectPrintPreviewViewId,
+ EDirectPrintPropertyViewId
+ };
+
+// DirectPrintApp enumerate command codes
+enum TDirectPrintCommandIds
+ {
+ EDirectPrintCmdIdMainViewPrint = 0x6001, // start value must not be 0
+ EDirectPrintCmdIdMainViewPreview,
+ EDirectPrintCmdIdMainViewPrinterList,
+ EDirectPrintCmdIdMainViewPrinterSetting,
+ EDirectPrintCmdIdMainViewPropertySetting,
+
+ EDirectPrintCmdIdMainViewHelp,
+ EDirectPrintCmdIdMainViewAbout,
+ EDirectPrintCmdIdMainViewExit,
+
+ EDirectPrintCmdIdPrinterListViewSearch,
+ EDirectPrintCmdIdPrinterListViewNew,
+ EDirectPrintCmdIdPrinterListViewEdit,
+ EDirectPrintCmdIdPrinterListViewDelete,
+ EDirectPrintCmdIdPrinterListViewDone,
+
+ EDirectPrintCmdIdSearchResultViewSearch,
+ EDirectPrintCmdIdSearchResultViewSelect,
+ EDirectPrintCmdIdSearchResultViewCancel,
+
+ EDirectPrintCmdIdPrinterSettingViewChange,
+ EDirectPrintCmdIdPrinterSettingViewBack,
+
+ EDirectPrintCmdIdPropertySettingViewChange,
+ EDirectPrintCmdIdPropertySettingViewPrint,
+ EDirectPrintCmdIdPropertySettingViewPreview,
+ EDirectPrintCmdIdPropertySettingViewBack,
+
+ EDirectPrintCmdIdPreviewViewPrint,
+ EDirectPrintCmdIdPreviewViewExpand,
+ EDirectPrintCmdIdPreviewViewReduce,
+ EDirectPrintCmdIdPreviewViewBack
+ };
+
+enum TDirectPrintPropertyTabIds
+ {
+ EDirectPrintPaperSettingTab = 0,
+ EDirectPrintPageSettingTab,
+ EDirectPrintMarginSettingTab,
+ EDirectPrintHeaderSettingTab,
+ EDirectPrintFooterSettingTab
+ };
+
+enum TDirectPrintPropertyItemIds
+ {
+ EDirectPrintPaperPaperSize = 0,
+ EDirectPrintPaperOrientation,
+ EDirectPrintPaperHight,
+ EDirectPrintPaperWidth,
+ EDirectPrintPagePrintPage,
+ EDirectPrintPagePrintRange,
+ EDirectPrintPageCopy,
+ EDirectPrintMarginLeftMargin,
+ EDirectPrintMarginRightMargin,
+ EDirectPrintMarginTopMargin,
+ EDirectPrintMarginBottomMargin,
+ EDirectPrintHeaderHeaderText,
+ EDirectPrintHeaderDistance,
+ EDirectPrintHeaderFirstPage,
+ EDirectPrintFooterFooterText,
+ EDirectPrintFooterDistance,
+ EDirectPrintFooterFirstPage,
+ EDirectPrintPropertyItemEnd
+ };
+
+enum TDirectPrintCtrlIds
+ {
+ EDirectPrintCtrlIdPrintProgressNote = 1,
+ EDirectPrintCtrlIdSearchProgressNote
+ };
+
+#endif // __DIRECTPRINTAPP_HRH__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/inc/directprintapp.pan Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef __DIRECTPRINTAPP_PAN__
+#define __DIRECTPRINTAPP_PAN__
+
+#include <e32std.h>
+
+/** DirectPrintApp application panic codes */
+enum TDirectPrintAppPanics
+ {
+ EDirectPrintAppUi = 1,
+ EDirectPrintNoObserver,
+ EDirectPrintNullPointer,
+
+ EDirectPrintEnd
+ };
+
+inline void Panic(TDirectPrintAppPanics aReason)
+ {
+ _LIT(applicationName, "DirectPrintApp");
+ User::Panic(applicationName, aReason);
+ }
+
+#endif // __DIRECTPRINTAPP_PAN__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/inc/directprintappapplication.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef __DIRECTPRINTAPPAPPLICATION_H__
+#define __DIRECTPRINTAPPAPPLICATION_H__
+
+// System includes
+#include <aknapp.h>
+
+// User includes
+#include "DirectPrintApp.hrh"
+
+// UID for the application;
+// this should correspond to the uid defined in the mmp file
+const TUid KUidDirectPrintAppApp =
+ {
+ _UID3
+ };
+
+// CLASS DECLARATION
+
+/**
+ * CDirectPrintAppApplication application class.
+ * Provides factory to create concrete document object.
+ * An instance of CDirectPrintAppApplication is the application part of the
+ * AVKON application framework for the DirectPrintApp example application.
+ */
+class CDirectPrintAppApplication : public CAknApplication
+ {
+public:
+ // Functions from base classes
+
+ /**
+ * From CApaApplication, AppDllUid.
+ * @return Application's UID (KUidDirectPrintAppApp).
+ */
+ TUid AppDllUid() const;
+
+protected:
+ // Functions from base classes
+
+ /**
+ * From CApaApplication, CreateDocumentL.
+ * Creates CDirectPrintAppDocument document object. The returned
+ * pointer in not owned by the CDirectPrintAppApplication object.
+ * @return A pointer to the created document object.
+ */
+ CApaDocument* CreateDocumentL();
+ };
+
+#endif // __DIRECTPRINTAPPAPPLICATION_H__
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/inc/directprintappappui.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,246 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef __DIRECTPRINTAPPAPPUI_H__
+#define __DIRECTPRINTAPPAPPUI_H__
+
+// System includes
+#include <aknviewappui.h>
+#include <aknnavide.h>
+#include <AknTabObserver.h>
+#include <e32property.h>
+#include <xmlengdocument.h> // RXmlEngDocument
+#include <xmlengdomparser.h> // RXmlEngDOMParser
+#include <xmlengdomimplementation.h> // RXmlEngDOMImplementation
+
+// User includes
+#include "DirectPrintEngineObserver.h"
+#include "DirectPrintBearerMngObserver.h"
+
+// Forward declarations
+class CDirectPrintMainView;
+class CDirectPrintAppDocument;
+class CDirectPrintEngine;
+class CDirectPrintBearerMgr;
+class CDirectPrintUiPluginMgr;
+
+// Class declaration
+class CDirectPrintAppAppUi : public CAknViewAppUi,
+ public MAknTabObserver,
+ public MDirectPrintEngineObserver,
+ public MDirectPrintBearerMngObserver
+ {
+public: // Constructors and destructor
+ CDirectPrintAppAppUi();
+ virtual ~CDirectPrintAppAppUi();
+ void ConstructL();
+
+private:
+ // Functions from base classes
+
+ /**
+ * From CEikAppUi, HandleCommandL.
+ * Takes care of command handling.
+ * @param aCommand Command to be handled.
+ */
+ void HandleCommandL( TInt aCommand );
+
+ /**
+ * From CEikAppUi, HandleResourceChangeL.
+ * Handles a change to the application's resources.
+ * @param aType Type of resources.
+ */
+ void HandleResourceChangeL( TInt aType );
+
+public: // from MAknTabObserver
+ /**
+ * From MAknTabObserver, TabChangedL.
+ * Handles a change to the tabs.
+ * @param aIndex Index of tabs.
+ */
+ void TabChangedL(TInt aIndex);
+
+public: // from MDirectPrintEngineObserver
+ /**
+ * From MDirectPrintEngineObserver, HandlePrintEventL.
+ * Handles user events.
+ * @param aEvent The ID of the event.
+ * @param aError The ID of the error.
+ * @param aParam Parameter.
+ */
+ void HandlePrintEventL(TDirectPrintEngineEvents aEvent,
+ TInt aError,
+ const TDesC& aParam);
+
+public: // from MDirectPrintBearerMngObserver
+ /**
+ * From MDirectPrintBearerMngObserver, HandleBearerMngEventL.
+ * Handles user events.
+ * @param aEvent The ID of the event.
+ * @param aError Error code.
+ * @param aParam Parameter.
+ */
+ void HandleBearerMngEventL(TDirectPrintBearerMngEvents aEvent,
+ TInt aError,
+ const TDesC& aParam);
+
+ /**
+ * From MDirectPrintBearerMngObserver, PrintJobProgressEvent.
+ * Handles user events.
+ * @param aStatus The ID of the status.
+ * @param aPercentCompletion Percentage of progress.
+ * @param aJobStateCode The ID of job states.
+ */
+ void PrintJobProgressEvent( TInt aStatus,
+ TInt aPercentCompletion,
+ TInt aJobStateCode );
+
+
+ /**
+ * From MDirectPrintBearerMngObserver, PrintJobErrorEvent.
+ * Handles user events.
+ * @param aError The ID of the error.
+ * @param aErrorStringCode The ID of error strings.
+ */
+ void PrintJobErrorEvent( TInt aError,
+ TInt aErrorStringCode );
+
+
+ /**
+ * From MDirectPrintBearerMngObserver, PrinterStatusEvent.
+ * Handles user events.
+ * @param aError The ID of the error.
+ * @param aErrorStringCode The ID of error strings.
+ */
+ void PrinterStatusEvent( TInt aError,
+ TInt aErrorStringCode );
+
+ /**
+ * From MDirectPrintBearerMngObserver, PreviewImageEvent.
+ * Handles user events.
+ * @param aFsBitmapHandle The Handle of the bitmap.
+ */
+ void PreviewImageEvent( TInt aFsBitmapHandle );
+
+ /**
+ * From MDirectPrintBearerMngObserver, ShowMessageL.
+ * Show messages.
+ * @param aMsgLine1Code The ID of message.
+ * @param aMsgLine2Code The ID of message.
+ */
+ void ShowMessageL( TInt aMsgLine1Code,
+ TInt aMsgLine2Code );
+
+ /**
+ * From MDirectPrintBearerMngObserver, AskYesNoQuestionL.
+ * Show Yes/No question.
+ * @param aMsgLine1Code The ID of message.
+ * @param aMsgLine2Code The ID of message.
+ * @return ETrue is Yes. EFalse is No.
+ */
+ TBool AskYesNoQuestionL( TInt aMsgLine1Code,
+ TInt aMsgLine2Code );
+
+ /**
+ * From MDirectPrintBearerMngObserver, AskForInputL.
+ * input.
+ * @param aMsgLine1Code The ID of message.
+ * @param aMsgLine2Code The ID of message.
+ * @return Inputed strings.
+ */
+ const TDesC& AskForInputL( TInt aMsgLine1Code,
+ TInt aMsgLine2Code );
+
+public:
+ /**
+ * engine object.
+ *
+ * @return Pointer to a engine object.
+ */
+ inline CDirectPrintEngine* Engine() {return iEngine;}
+
+ /**
+ * document object.
+ *
+ * @return Pointer to a document object.
+ */
+ inline CDirectPrintAppDocument* Doc() {return iDoc;}
+
+ /**
+ * Plugin manager object.
+ *
+ * @return Reference to a plugin manager object.
+ */
+ inline CDirectPrintUiPluginMgr& PluginMgr() {return *iPluginMgr;}
+
+ /**
+ * Bearer manager object.
+ *
+ * @return Pointer to a bearer manager object.
+ */
+ inline CDirectPrintBearerMgr* BearerMgr() {return iBearerMgr;}
+
+private:
+ void MakeNaviPaneVisibleL(TBool aVisible);
+ void MakeStatusPaneVisible(TBool aVisible);
+
+ void InitializeViewsL();
+ void LoadParamL();
+ void GetParamFromAiwProviderL();
+
+ void InitializeEngineL();
+ void InitializeBearerMngL();
+ void InitializePluginMgrL();
+
+private: // Data
+ // Used for navigation pane text
+ CAknNavigationDecorator* iNaviDecorator;
+
+ // Document class
+ CDirectPrintAppDocument* iDoc;
+
+ // previous view id
+ TUid iBackViewUid;
+
+ // For AIW calls;
+ TInt iAiwState;
+
+ // publish/subscribe of aiw print
+ RProperty iAiwCall;
+
+ // print engine
+ CDirectPrintEngine* iEngine;
+
+ // bearer manager
+ CDirectPrintBearerMgr* iBearerMgr;
+
+ // param xml object
+ RXmlEngDocument iXmlEngDoc;
+ RXmlEngDOMImplementation iXmlDomImpl;
+ RXmlEngDOMParser iXmlParser;
+
+ HBufC8* iXmlParam;
+
+ CDirectPrintUiPluginMgr* iPluginMgr;
+ };
+
+#endif // __DIRECTPRINTAPPAPPUI_H__
+
+// End of File
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/inc/directprintappdocument.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef __DIRECTPRINTAPPDOCUMENT_h__
+#define __DIRECTPRINTAPPDOCUMENT_h__
+
+// System includes
+#include <akndoc.h>
+
+// Forward declarations
+class CDirectPrintAppAppUi;
+class CEikApplication;
+
+// Class declaration
+class CDirectPrintModel;
+
+/**
+ * CDirectPrintAppDocument application class.
+ * An instance of class CDirectPrintAppDocument is the Document part of the
+ * AVKON application framework for the DirectPrintApp example application.
+ */
+class CDirectPrintAppDocument : public CAknDocument
+ {
+public:
+ // Constructors and destructor
+
+ /**
+ * NewL.
+ * Two-phased constructor.
+ * Construct a CDirectPrintAppDocument for the AVKON application aApp
+ * using two phase construction, and return a pointer
+ * to the created object.
+ * @param aApp Application creating this document.
+ * @return A pointer to the created instance of CDirectPrintAppDocument.
+ */
+ static CDirectPrintAppDocument* NewL(CEikApplication& aApp);
+
+ /**
+ * NewLC.
+ * Two-phased constructor.
+ * Construct a CDirectPrintAppDocument for the AVKON application aApp
+ * using two phase construction, and return a pointer
+ * to the created object.
+ * @param aApp Application creating this document.
+ * @return A pointer to the created instance of CDirectPrintAppDocument.
+ */
+ static CDirectPrintAppDocument* NewLC(CEikApplication& aApp);
+
+ /**
+ * ~CDirectPrintAppDocument
+ * Virtual Destructor.
+ */
+ virtual ~CDirectPrintAppDocument();
+
+public:
+ // Functions from base classes
+
+ /**
+ * CreateAppUiL
+ * From CEikDocument, CreateAppUiL.
+ * Create a CDirectPrintAppAppUi object and return a pointer to it.
+ * The object returned is owned by the Uikon framework.
+ * @return Pointer to created instance of AppUi.
+ */
+ CEikAppUi* CreateAppUiL();
+public:
+ // New functions
+ CDirectPrintModel& Model();
+
+private:
+ // Constructors
+
+ /**
+ * ConstructL
+ * 2nd phase constructor.
+ */
+ void ConstructL();
+
+ /**
+ * CDirectPrintAppDocument.
+ * C++ default constructor.
+ * @param aApp Application creating this document.
+ */
+ CDirectPrintAppDocument(CEikApplication& aApp);
+
+
+private:
+ /** Model class */
+ CDirectPrintModel* iModel;
+
+
+ };
+
+#endif // __DIRECTPRINTAPPDOCUMENT_h__
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/inc/directprintbearerdata.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef __DIRECTPRINTBEARERDATA_H__
+#define __DIRECTPRINTBEARERDATA_H__
+
+// System includes
+#include <e32base.h>
+#include <in_sock.h>
+
+// User includes
+#include "DirectPrintDef.h"
+
+// Forward declarations
+class RReadStream;
+class RWriteStream;
+
+// Class declaration
+/**
+ * Bearer data class
+ * more_complete_description
+ */
+class TDirectPrintBearerData
+ {
+public:
+ /**
+ * Internalize operation.
+ *
+ * @param aStream ReadStream.
+ */
+ IMPORT_C void InternalizeL(RReadStream& aStream);
+
+ /**
+ * Externalize operation.
+ *
+ * @param aStream WriteStream.
+ */
+ IMPORT_C void ExternalizeL(RWriteStream& aStream)const;
+
+ /**
+ * Substitution operator.
+ *
+ * @param aData Bearer data.
+ * @return Bearer data.
+ */
+ IMPORT_C TDirectPrintBearerData& operator=(const TDirectPrintBearerData& aData);
+
+public:
+ /** The ID of printer data. */
+ TInt iPrinterId;
+ /** The ID of bearer data. */
+ TInt iBearerId;
+ /** Name of bearer. */
+ TBuf<KDirectPrintNameLength> iBearerName;
+ /** AccessPoint. */
+ TBuf<KDirectPrintNameLength> iAccessPoint;
+ /** HostName. */
+ TBuf<KDirectPrintNameLength> iHostName;
+ /** IPAddress of host. */
+ TInetAddr iHostIp;
+ /** Number of port. */
+ TInt iPort;
+ /** UserName. */
+ TBuf<KDirectPrintNameLength> iUserName;
+ /** Name of que. */
+ TBuf<KDirectPrintNameLength> iQueName;
+ };
+
+typedef RArray<TDirectPrintBearerData> RDPBearerDataArray;
+
+#endif // __DIRECTPRINTBEARERDATA_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/inc/directprintbearermgr.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,130 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef __DIRECTPRINTBEARERMGR_H__
+#define __DIRECTPRINTBEARERMGR_H__
+
+// System includes
+#include <e32base.h>
+
+// User includes
+#include "directprintbearermngobserver.h"
+#include "directprintclient.h"
+#include "directprintjobguarddata.h"
+
+// Forward declarations
+class CDirectPrintModel;
+class CDirectPrintPrintSettings;
+
+// Class declaration
+/**
+ * Bearer manager class
+ * more_complete_description
+ */
+class CDirectPrintBearerMgr : public CActive
+ {
+public:
+ /** Status of bearer manager */
+ enum TBearerMngStatus
+ {
+ EBearerMngNotConnected = 0, // (0)
+ EBearerMngConnected, // (1)
+ EBearerMngCreatingJob, // (2)
+ EBearerMngPrinting, // (3)
+ EBearerMngClosing, // (4)
+ EBearerMngCanceling, // (5)
+ };
+
+public:
+ /** Constructors */
+ static CDirectPrintBearerMgr* NewL(MDirectPrintBearerMngObserver* aObserver,
+ CDirectPrintModel& aModel);
+ static CDirectPrintBearerMgr* NewLC(MDirectPrintBearerMngObserver* aObserver,
+ CDirectPrintModel& aModel);
+ /** Destructor */
+ ~CDirectPrintBearerMgr();
+
+public:
+ /**
+ * Create print job.
+ */
+ void CreateJobL();
+ /**
+ * Submit print job.
+ */
+ void SubmitPrintJobL();
+ /**
+ * Close session.
+ */
+ void CloseSession();
+
+ /**
+ * Get status of bearer manager.
+ *
+ * @return Status of bearer manager
+ */
+ TBearerMngStatus BearerStatus();
+
+ TInt SupportedProtocols();
+
+ TInt GetProtocolNames(RSelectItemArray& aNames);
+
+ void InitCapabilitiesL(TInt aIndex);
+
+ TInt GetJobSetting(TInt aCapabilityID, TInt& aValue);
+
+ TInt SetJobSetting(TInt aCapabilityID, TInt aValue, TInt& aAffectedCapability);
+
+ void SetJobSettings();
+
+ CDirectPrintPrintSettings* PrinterSettingsL();
+
+protected:
+ CDirectPrintBearerMgr(MDirectPrintBearerMngObserver* aObserver,
+ CDirectPrintModel& aModel);
+ void ConstructL();
+
+private: // from CActive
+
+ void RunL();
+ void DoCancel();
+
+private:
+ void SetBearerStatus(TBearerMngStatus aStatus);
+
+ TInt CreatePrinterUid(TInt aIndex);
+
+private:
+ /** Pointer to bearer manager observer. */
+ MDirectPrintBearerMngObserver* iObserver;
+ /** Bearer object. */
+ RDirectPrintClient iBearer;
+ /** Job guard data. */
+ TDirectPrintJobGuardData iJobGuardData;
+ /** Reference to model class. */
+ CDirectPrintModel& iModel;
+
+ /** Status of bearer manager. */
+ TBearerMngStatus iBearerStatus;
+
+ /** Printer settings. */
+ CDirectPrintPrintSettings* iPrintSettings;
+ };
+
+#endif // __DIRECTPRINTBEARERMGR_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/inc/directprintbearermngobserver.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef __DIRECTPRINTBEARERMNGOBSERVER_H__
+#define __DIRECTPRINTBEARERMNGOBSERVER_H__
+
+// System includes
+#include <e32base.h>
+
+// Class declaration
+/**
+ * Bearer manager observer mix-in class
+ * more_complete_description
+ */
+class MDirectPrintBearerMngObserver
+ {
+public:
+ /** The ID of bearer event. */
+ enum TDirectPrintBearerMngEvents
+ {
+ EDirectPrintBearerMngErrorConnectBearer,
+ EDirectPrintBearerMngConnectedBearer,
+ // add any events, if needed
+
+ // end of event
+ EDirectPrintBearerMngEventEnd
+ };
+
+public:
+ /**
+ * Handles user events.
+ * @param aEvent The ID of the event.
+ * @param aError Error code.
+ * @param aParam Parameter.
+ */
+ virtual void HandleBearerMngEventL(
+ TDirectPrintBearerMngEvents aEvent,
+ TInt aError,
+ const TDesC& aParam) = 0;
+
+ /**
+ * Handles user events.
+ * @param aStatus The ID of the status.
+ * @param aPercentCompletion Percentage of progress.
+ * @param aJobStateCode The ID of job states.
+ */
+ virtual void PrintJobProgressEvent( TInt aStatus,
+ TInt aPercentCompletion,
+ TInt aJobStateCode ) = 0;
+
+ /**
+ * Handles user events.
+ * @param aError The ID of the error.
+ * @param aErrorStringCode The ID of error strings.
+ */
+ virtual void PrintJobErrorEvent( TInt aError,
+ TInt aErrorStringCode ) = 0;
+
+ /**
+ * Handles user events.
+ * @param aError The ID of the error.
+ * @param aErrorStringCode The ID of error strings.
+ */
+ virtual void PrinterStatusEvent( TInt aError,
+ TInt aErrorStringCode ) = 0;
+
+ /**
+ * Handles user events.
+ * @param aFsBitmapHandle The Handle of the bitmap.
+ */
+ virtual void PreviewImageEvent( TInt aFsBitmapHandle ) = 0;
+
+ /**
+ * Show messages.
+ * @param aMsgLine1Code The ID of message.
+ * @param aMsgLine2Code The ID of message.
+ */
+ virtual void ShowMessageL( TInt aMsgLine1Code,
+ TInt aMsgLine2Code ) = 0;
+
+ /**
+ * Show Yes/No question.
+ * @param aMsgLine1Code The ID of message.
+ * @param aMsgLine2Code The ID of message.
+ * @return ETrue is Yes. EFalse is No.
+ */
+ virtual TBool AskYesNoQuestionL( TInt aMsgLine1Code,
+ TInt aMsgLine2Code ) = 0;
+
+ /**
+ * input.
+ * @param aMsgLine1Code The ID of message.
+ * @param aMsgLine2Code The ID of message.
+ * @return Inputed strings.
+ */
+ virtual const TDesC& AskForInputL( TInt aMsgLine1Code,
+ TInt aMsgLine2Code ) = 0;
+ };
+
+#endif // __DIRECTPRINTBEARERMNGOBSERVER_H__
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/inc/directprintdef.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef __DIRECTPRINTDEF_H__
+#define __DIRECTPRINTDEF_H__
+
+//Constants
+/** Max length of string data. */
+const TInt KDirectPrintNameLength = 50;
+
+#endif // __DIRECTPRINTDEF_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/inc/directprintmodel.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,319 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* This model class for DirectPrint data managemrnt
+*
+*/
+
+// Protection against nested includes
+#ifndef __DIRECTPRINTMODEL_H__
+#define __DIRECTPRINTMODEL_H__
+
+// System includes
+#include <e32base.h>
+#include <f32file.h>
+#include <prninf.h>
+
+// User includes
+#include "directprintprinterdata.h"
+#include "directprintbearerdata.h"
+#include "directprintpropertydata.h"
+#include "directprintproperty.h"
+
+// Forward declarations
+class CDirectPrintPrinterInfoReader;
+
+// Class declaration
+/**
+ * Model class
+ * more_complete_description
+ */
+class CDirectPrintModel : public CBase
+ {
+public:
+ /** Constructors */
+ static CDirectPrintModel* NewL();
+ static CDirectPrintModel* NewLC();
+ /** Destructor */
+ ~CDirectPrintModel();
+
+ /**
+ * Initialize data.
+ */
+ void InitializeDataL();
+ /**
+ * Internalize data.
+ */
+ void InternalizeDataL();
+ /**
+ * Externalize data.
+ */
+ void ExternalizeDataL();
+
+ /**
+ * Get printer data.
+ *
+ * @param aIndex The index of data array.
+ * @param aData printer data
+ */
+ void GetPrinterDataL(TInt aIndex, TDirectPrintPrinterData& aData);
+ /**
+ * Get bearer data.
+ *
+ * @param aIndex The index of data array.
+ * @param aData bearer data
+ */
+ void GetBearerDataL(TInt aIndex, TDirectPrintBearerData& aData);
+ /**
+ * Get current bearer data.
+ *
+ * @param aData bearer data
+ */
+ void GetCurrentBearerDataL(TDirectPrintBearerData& aData);
+ /**
+ * Get selected bearer data.
+ *
+ * @param aData bearer data
+ */
+ void GetSelectedBearerDataL(TDirectPrintBearerData& aData);
+ /**
+ * Get property data.
+ *
+ * @param aIndex The index of data array.
+ * @return property data
+ */
+ CPrinterProperty* GetPrinterPropertyL(TInt aIndex);
+ /**
+ * Get current property data.
+ *
+ * @param aAppUid Application UID.
+ * @return property data
+ */
+ CPrinterProperty* GetCurrentPrinterPropertyL(TUid aAppUid);
+ /**
+ * Get the id of current printer data.
+ *
+ * @return The id of printer data
+ */
+ TInt GetCurrentPrinterIdL();
+ /**
+ * Get the index of current printer data.
+ *
+ * @return The index of data array.
+ */
+ TInt CurrentPrinter();
+ /**
+ * Get the index of current bearer data.
+ *
+ * @return The index of data array.
+ */
+ TInt CurrentBearer();
+ /**
+ * Get the index of current property data.
+ *
+ * @return The index of data array.
+ */
+ TInt CurrentProperty();
+ /**
+ * Get the index of selected printer data.
+ *
+ * @return The index of data array.
+ */
+ TInt SelectPrinter();
+ /**
+ * Get the count of printer data.
+ *
+ * @return The count of data.
+ */
+ TInt PrinterCount();
+ /**
+ * Get the count of bearer data.
+ *
+ * @return The count of data.
+ */
+ TInt BearerCount();
+ /**
+ * Get the count of property data.
+ *
+ * @return The count of data.
+ */
+ TInt PropertyCount();
+
+ /**
+ * Set printer data.
+ *
+ * @param aIndex The index of data array.
+ * @param aData printer data
+ */
+ void SetPrinterDataL(TInt aIndex, const TDirectPrintPrinterData& aData);
+ /**
+ * Set printer data.
+ *
+ * @param aData printer data
+ */
+ void SetPrinterDataL(const TDirectPrintPrinterData& aData);
+ /**
+ * Set bearer data.
+ *
+ * @param aIndex The index of data array.
+ * @param aData bearer data
+ */
+ void SetBearerDataL(TInt aIndex, const TDirectPrintBearerData& aData);
+ /**
+ * Set bearer data.
+ *
+ * @param aData bearer data
+ */
+ void SetBearerDataL(const TDirectPrintBearerData& aData);
+ /**
+ * Set property data.
+ *
+ * @param aIndex The index of data array.
+ * @param aProperty property data
+ */
+ void SetPrinterPropertyL(TInt aIndex, CPrinterProperty* aProperty);
+ /**
+ * Set property data.
+ *
+ * @param aProperty property data
+ */
+ void SetPrinterPropertyL(CPrinterProperty* aProperty);
+ /**
+ * Set the index of current printer data.
+ *
+ * @param aIndex The index of data array.
+ */
+ void SetCurrentPrinter(TInt aIndex);
+ /**
+ * Set the index of current bearer data.
+ *
+ * @param aIndex The index of data array.
+ */
+ void SetCurrentBearer(TInt aIndex);
+ /**
+ * Set the index of current property data.
+ *
+ * @param aIndex The index of data array.
+ */
+ void SetCurrentProperty(TInt aIndex);
+ /**
+ * Set the index of selected printer data.
+ *
+ * @param aIndex The index of data array.
+ */
+ void SetSelectPrinter(TInt aIndex);
+
+ /**
+ * Add printer data.
+ *
+ * @param aData printer data
+ */
+ void AddPrinterDataL(const TDirectPrintPrinterData& aData);
+ /**
+ * Add bearer data.
+ *
+ * @param aData bearer data
+ */
+ void AddBearerDataL(const TDirectPrintBearerData& aData);
+ /**
+ * Add property data.
+ *
+ * @param aProperty property data
+ */
+ void AddPrinterPropertyL(CPrinterProperty* aProperty);
+
+ /**
+ * Remove printer data from data array.
+ *
+ * @param aIndex The index of data array.
+ */
+ void RemovePrinterDataL(TInt aIndex);
+ /**
+ * Remove bearer data from data array.
+ *
+ * @param aIndex The index of data array.
+ */
+ void RemoveBearerDataL(TInt aIndex);
+ /**
+ * Remove property data from data array.
+ *
+ * @param aIndex The index of data array.
+ */
+ void RemovePrinterPropertyL(TInt aIndex);
+
+ /**
+ * Move printer data to top of data array.
+ *
+ * @param aIndex The index of data array.
+ */
+ void MoveTopPrinterDataL(TInt aIndex);
+
+ /**
+ * Get new data flag.
+ *
+ * @return new data flag.
+ */
+ inline TBool IsNewData() {return iIsNewData;};
+ /**
+ * Set new data flag.
+ *
+ * @param aFlag new data flag.
+ */
+ inline void SetIsNewData(TBool aFlag) {iIsNewData = aFlag;};
+ /**
+ * Generate new printer id.
+ *
+ * @return new data flag.
+ */
+ inline TInt NewPrinterId() {return ++iMaxPrinterId;};
+
+ /**
+ * Get uid of plugin.
+ *
+ * @return uid of plugin.
+ */
+ TUid SettingUIPluginUidL();
+
+protected:
+ CDirectPrintModel();
+ void ConstructL();
+
+private:
+ /** File server session. */
+ RFs iFs;
+
+ /** Printer data Array. */
+ RDPPrinterDataArray iPrinters;
+ /** Bearer data Array. */
+ RDPBearerDataArray iBearers;
+ /** Property data Array. */
+ RPrinterPropertyArray iProperties;
+ /** The index of current printer data. */
+ TInt iCurrentPrinter;
+ /** The index of current bearer datay. */
+ TInt iCurrentBearer;
+ /** The index of current property data. */
+ TInt iCurrentProperty;
+ /** The index of selected printer data. */
+ TInt iSelectPrinter;
+
+ /** New data flag. */
+ TBool iIsNewData;
+ /** Printer id. */
+ TInt iMaxPrinterId;
+
+ CDirectPrintPrinterInfoReader* iPrinterInfoReader;
+ };
+
+#endif // __DIRECTPRINTMODEL_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/inc/directprintmsgutil.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* This class is the message utility class of DirectPrint
+*
+*/
+
+#ifndef __DIRECTPRINTMSGUTIL_H__
+#define __DIRECTPRINTMSGUTIL_H__
+
+// System includes
+#include <e32base.h>
+#include <f32file.h>
+
+// User includes
+
+// Forward declarations
+
+// Class declaration
+/**
+ * one_line_short_description
+ * more_complete_description
+ *
+ */
+class CDirectPrintMsgUtil : public CBase
+ {
+public:
+ static CDirectPrintMsgUtil* NewL();
+ static CDirectPrintMsgUtil* NewLC();
+ ~CDirectPrintMsgUtil();
+
+ /**
+ * Displays error note
+ * @param aResourceId Resource id for note text.
+ */
+ static void DisplayErrorNoteL( TInt aResourceId );
+
+protected:
+ CDirectPrintMsgUtil();
+ void ConstructL();
+
+private:
+ };
+
+#endif // __DIRECTPRINTMSGUTIL_H__
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/inc/directprintprinterdata.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef __DIRECTPRINTPRINTERDATA_H__
+#define __DIRECTPRINTPRINTERDATA_H__
+
+// System includes
+#include <e32cmn.h>
+
+// User includes
+#include "DirectPrintDef.h"
+
+// Forward declarations
+class RReadStream;
+class RWriteStream;
+
+// Class declaration
+/**
+ * Printer data class
+ * more_complete_description
+ */
+class TDirectPrintPrinterData
+ {
+public:
+ /**
+ * Internalize operation.
+ *
+ * @param aStream ReadStream.
+ */
+ IMPORT_C void InternalizeL(RReadStream& aStream);
+
+ /**
+ * Externalize operation.
+ *
+ * @param aStream WriteStream.
+ */
+ IMPORT_C void ExternalizeL(RWriteStream& aStream)const;
+
+ /**
+ * Substitution operator.
+ *
+ * @param aData Printer data.
+ * @return Printer data.
+ */
+ IMPORT_C TDirectPrintPrinterData& operator=(const TDirectPrintPrinterData& aData);
+
+public:
+ /** The ID of printer data. */
+ TInt iPrinterId;
+ /** Name of printer. */
+ TBuf<KDirectPrintNameLength> iPrinterName;
+ /** The UID of printer driver. */
+ TUid iPrinterDriver;
+ /** Name of printer driver. */
+ TBuf<KDirectPrintNameLength> iDriverName;
+ /** The ID of printer type. */
+ TInt iPrinterType;
+ /** Name of printer type. */
+ TBuf<KDirectPrintNameLength> iTypeName;
+ };
+
+typedef RArray<TDirectPrintPrinterData> RDPPrinterDataArray;
+
+#endif // __DIRECTPRINTPRINTERDATA_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/inc/directprintprinterinforeader.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,71 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* Printer information reader class
+*
+*/
+
+// Protection against nested includes
+#ifndef __DIRECTPRINTPRINTERINFOREADER_H__
+#define __DIRECTPRINTPRINTERINFOREADER_H__
+
+// System includes
+#include <e32base.h>
+#include <xmlengdocument.h> // RXmlEngDocument
+#include <xmlengdomparser.h> // RXmlEngDOMParser
+#include <xmlengdomimplementation.h> // RXmlEngDOMImplementation
+
+// User includes
+
+// Forward declarations
+class CDirectPrintModel;
+
+// Class declaration
+/**
+ * Printer information reader class
+ * more_complete_description
+ */
+class CDirectPrintPrinterInfoReader : public CBase
+ {
+public:
+ /** Constructors */
+ static CDirectPrintPrinterInfoReader* NewL(CDirectPrintModel& aModel);
+ static CDirectPrintPrinterInfoReader* NewLC(CDirectPrintModel& aModel);
+ /** Destructor */
+ ~CDirectPrintPrinterInfoReader();
+
+ void ReadPrinterInfoL();
+
+ void GetManufactureL(TDes& aManufacture);
+ TUid GetDriverL(TDesC& aId);
+ TUid GetSettingUIPluginL(TDesC& aId);
+
+protected:
+ CDirectPrintPrinterInfoReader(CDirectPrintModel& aModel);
+ void ConstructL();
+
+private:
+ void ReadXmlDataL(const TDesC& aParam);
+ TBool CheckManufactureL(const TDesC& aParam);
+
+private:
+ // Model object
+ CDirectPrintModel& iModel;
+
+ RXmlEngDocument iXmlEngDoc;
+ RXmlEngDOMImplementation iXmlDomImpl;
+ RXmlEngDOMParser iXmlParser;
+ };
+
+#endif // __DIRECTPRINTPRINTERINFOREADER_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/inc/directprintproperty.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef __DIRECTPRINTPROPERTY_H__
+#define __DIRECTPRINTPROPERTY_H__
+
+// System includes
+#include <e32base.h>
+#include <e32cmn.h>
+
+// User includes
+#include "DirectPrintDef.h"
+#include "directprintpropertydata.h"
+
+// Class declaration
+/**
+ * Printer property class
+ * more_complete_description
+ */
+class CPrinterProperty : public CBase
+ {
+public:
+ /** Constructors */
+ IMPORT_C CPrinterProperty();
+ /** Destructor */
+ IMPORT_C ~CPrinterProperty();
+
+public:
+ /**
+ * Internalize operation.
+ *
+ * @param aStream ReadStream.
+ */
+ IMPORT_C void InternalizeL(RReadStream& aStream);
+
+ /**
+ * Externalize operation.
+ *
+ * @param aStream WriteStream.
+ */
+ IMPORT_C void ExternalizeL(RWriteStream& aStream)const;
+
+ /**
+ * Substitution operator.
+ *
+ * @param aProperty Printer property.
+ * @return Printer property.
+ */
+ IMPORT_C CPrinterProperty& operator=(const CPrinterProperty& aProperty);
+
+public:
+ /** The ID of printer data. */
+ TInt iPrinterId;
+ /** The ID of application. */
+ TInt iApplicationId;
+ /** Printer property data array. */
+ RDPPropertyDataArray iPropertyItems;
+ };
+
+typedef RPointerArray<CPrinterProperty> RPrinterPropertyArray;
+
+#endif // __DIRECTPRINTPROPERTY_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/inc/directprintpropertydata.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,127 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef __DIRECTPRINTPROPERTYDATA_H__
+#define __DIRECTPRINTPROPERTYDATA_H__
+
+// System includes
+#include <e32base.h>
+#include <e32cmn.h>
+
+// User includes
+#include "DirectPrintDef.h"
+
+// Class declaration
+/**
+ * Printer property data class
+ * more_complete_description
+ */
+class TDirectPrintPropertyData
+ {
+public:
+ /**
+ * Internalize operation.
+ *
+ * @param aStream ReadStream.
+ */
+ inline void InternalizeL(RReadStream& aStream);
+
+ /**
+ * Externalize operation.
+ *
+ * @param aStream WriteStream.
+ */
+ inline void ExternalizeL(RWriteStream& aStream)const;
+
+ /**
+ * Substitution operator.
+ *
+ * @param aData Printer property data.
+ * @return Printer property data.
+ */
+ inline TDirectPrintPropertyData& operator=(const TDirectPrintPropertyData& aData);
+
+public:
+ /** The ID of printer data. */
+ TInt iPrinterId;
+ /** The ID of application. */
+ TInt iApplicationId;
+ /** The ID of item type. */
+ TInt iItemType;
+ /** The ID of item. */
+ TInt iItemId;
+ /** Name of item. */
+ TBuf<KDirectPrintNameLength> iItemName;
+ /** Numerical value. */
+ TInt iItemValue;
+ /** Text value. */
+ TBuf<KDirectPrintNameLength> iItemTextValue;
+ };
+
+typedef RArray<TDirectPrintPropertyData> RDPPropertyDataArray;
+
+
+
+inline void TDirectPrintPropertyData::InternalizeL(RReadStream& aStream)
+ {
+ iItemType = aStream.ReadInt32L();
+ iItemId = aStream.ReadInt32L();
+ TInt length = aStream.ReadInt32L();
+ if(length > 0)
+ {
+ aStream.ReadL(iItemName, length);
+ }
+ iItemValue = aStream.ReadInt32L();
+ length = aStream.ReadInt32L();
+ if(length > 0)
+ {
+ aStream.ReadL(iItemTextValue, length);
+ }
+ }
+
+inline void TDirectPrintPropertyData::ExternalizeL(RWriteStream& aStream) const
+ {
+ aStream.WriteInt32L(iItemType);
+ aStream.WriteInt32L(iItemId);
+ aStream.WriteInt32L(iItemName.Length());
+ if (iItemName.Length() > 0)
+ {
+ aStream.WriteL(iItemName);
+ }
+ aStream.WriteInt32L(iItemValue);
+ aStream.WriteInt32L(iItemTextValue.Length());
+ if (iItemTextValue.Length() > 0)
+ {
+ aStream.WriteL(iItemTextValue);
+ }
+ }
+
+inline TDirectPrintPropertyData& TDirectPrintPropertyData::operator=(const TDirectPrintPropertyData& aData)
+ {
+ iPrinterId = aData.iPrinterId;
+ iApplicationId = aData.iApplicationId;
+ iItemType = aData.iItemType;
+ iItemId = aData.iItemId;
+ iItemName.Copy(aData.iItemName);
+ iItemValue = aData.iItemValue;
+ iItemTextValue.Copy(aData.iItemTextValue);
+ return *this;
+ }
+
+#endif // __DIRECTPRINTPROPERTYDATA_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/inc/directprintselectitem.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef __DIRECTPRINTSELECTITEM_H__
+#define __DIRECTPRINTSELECTITEM_H__
+
+// System includes
+#include <e32cmn.h>
+
+// Class declaration
+/**
+ * Select item information class
+ * more_complete_description
+ */
+class TDirectPrintSelectItem
+ {
+public:
+ /** Id. */
+ TInt iId;
+ /** Name. */
+ TBuf<50> iName;
+ };
+
+typedef RArray<TDirectPrintSelectItem> RSelectItemArray;
+
+#endif // __DIRECTPRINTSELECTITEM_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/inc/directprintuipluginmgr.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef _DIRECTPRINTUIPLUGINMGR_H_
+#define _DIRECTPRINTUIPLUGINMGR_H_
+
+// System includes
+#include <e32base.h>
+#include <implementationproxy.h>
+
+// Forward declarations
+class CDirectPrintModel;
+class CDirectPrintUiPlugin;
+
+// Class declaration
+/**
+ * UiPrugin manager class
+ * more_complete_description
+ */
+class CDirectPrintUiPluginMgr : public CBase
+ {
+public:
+ /** Constructors */
+ static CDirectPrintUiPluginMgr* NewL(CDirectPrintModel& aModel);
+ static CDirectPrintUiPluginMgr* NewLC(CDirectPrintModel& aModel);
+ /** Destructor */
+ ~CDirectPrintUiPluginMgr();
+
+public:
+ /**
+ * Load plugin object.
+ *
+ * @param aUid The Uid of plugin.
+ */
+ void LoadPluginL(TUid aUid);
+ /**
+ * Load plugin object.
+ *
+ * @param aKey default_data string.
+ */
+ void LoadPluginL(const TDesC8& aKey);
+ /**
+ * Get current plugin object.
+ *
+ * @return Pointer to plugin object.
+ */
+ CDirectPrintUiPlugin* CurrentPluginL();
+
+protected:
+ CDirectPrintUiPluginMgr(CDirectPrintModel& aModel);
+ void ConstructL();
+
+private:
+ /** Reference to model class. */
+ CDirectPrintModel& iModel;
+ /** Pointer to plugin. */
+ CDirectPrintUiPlugin* iPlugin;
+ /** Uid of current plugin. */
+ TUid iCurrentPluginUid;
+ };
+
+#endif // _DIRECTPRINTUIPLUGINMGR_H_
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/sis/backup_registration.xml Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,5 @@
+<?xml version="1.0" standalone="yes"?>
+<backup_registration>
+ <system_backup/>
+ <restore requires_reboot = "no"/>
+</backup_registration>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/sis/directprintapp_1_0_0.pkg Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,37 @@
+; Installation file for DirectPrintApp application
+;
+; This is an auto-generated PKG file by Carbide.
+; This file uses variables specific to Carbide builds that will not work
+; on command-line builds. If you want to use this generated PKG file from the
+; command-line tools you will need to modify the variables with the appropriate
+; values: $(EPOCROOT), $(PLATFORM), $(TARGET)
+;
+;Language - standard language definitions
+&EN
+
+; standard SIS file header
+#{"DirectPrintApp"},(0x2002BB28),1,0,0
+
+;Localised Vendor name
+%{"Vendor-EN"}
+
+;Unique Vendor name
+:"Vendor"
+
+;Supports Series 60 v 3.0
+[0x101F7961], 0, 0, 0, {"Series60ProductID"}
+
+;Files to install
+;You should change the source paths to match that of your environment
+;<source> <destination>
+"$(EPOCROOT)Epoc32\release\$(PLATFORM)\$(TARGET)\DirectPrintApp.exe" -"!:\sys\bin\DirectPrintApp.exe"
+"$(EPOCROOT)Epoc32\data\z\resource\apps\DirectPrintApp.rsc" -"!:\resource\apps\DirectPrintApp.rsc"
+"$(EPOCROOT)Epoc32\data\z\private\10003a3f\apps\DirectPrintApp_reg.rsc" -"!:\private\10003a3f\import\apps\DirectPrintApp_reg.rsc"
+"$(EPOCROOT)Epoc32\data\z\resource\apps\DirectPrintApp.mif" -"!:\resource\apps\DirectPrintApp.mif"
+"..\help\DirectPrintApp.hlp" -"!:\resource\help\DirectPrintApp.hlp"
+
+; Add any installation notes if applicable
+;"DirectPrintApp.txt" -"!:\private\2002BB28\DirectPrintApp.txt"
+
+;required for application to be covered by backup/restore facility
+"..\sis\backup_registration.xml" -"!:\private\2002BB28\backup_registration.xml"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/src/directprintapp.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// INCLUDE FILES
+#include <eikstart.h>
+#include "DirectPrintAppApplication.h"
+
+LOCAL_C CApaApplication* NewApplication()
+ {
+ return new CDirectPrintAppApplication;
+ }
+
+GLDEF_C TInt E32Main()
+ {
+ return EikStart::RunApplication(NewApplication);
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/src/directprintappapplication.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// INCLUDE FILES
+#include "DirectPrintApp.hrh"
+#include "DirectPrintAppDocument.h"
+#include "DirectPrintAppApplication.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CDirectPrintAppApplication::CreateDocumentL()
+// Creates CApaDocument object
+// -----------------------------------------------------------------------------
+//
+CApaDocument* CDirectPrintAppApplication::CreateDocumentL()
+ {
+ // Create an DirectPrintApp document, and return a pointer to it
+ return CDirectPrintAppDocument::NewL(*this);
+ }
+
+// -----------------------------------------------------------------------------
+// CDirectPrintAppApplication::AppDllUid()
+// Returns application UID
+// -----------------------------------------------------------------------------
+//
+TUid CDirectPrintAppApplication::AppDllUid() const
+ {
+ // Return the UID for the DirectPrintApp application
+ return KUidDirectPrintAppApp;
+ }
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/src/directprintappappui.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,665 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// INCLUDE FILES
+#include <avkon.hrh>
+#include <aknnotewrappers.h>
+#include <akntabgrp.h>
+#include <barsread.h>
+#include <stringloader.h>
+#include <DirectPrintApp.rsg>
+#include <f32file.h>
+#include <s32file.h>
+#include <f32file.h>
+#include <aiwmenu.h> // CAiwGenericParamList
+
+//not use #include <featmgr.h> // FeatureManager
+
+#include <xmlengdomparser.h> // RXmlEngDOMParser
+#include <xmlengdomimplementation.h> // RXmlEngDOMImplementation
+#include <xmlengerrors.h>
+
+// Start ImagePrint Provide
+#include "imageprint.h"
+#include "printmessagecodes.h"
+// End ImagePrint Provide
+
+#include "clog.h"
+#include "aiwprintproperty.h"
+
+#include "directprintapp.pan"
+#include "directprintappappui.h"
+#include "directprintapp.hrh"
+#include "directprintappdocument.h"
+#include "directprintmodel.h"
+
+#include "directprintmainview.h"
+#include "directprintlistview.h"
+#include "directprintsettingview.h"
+#include "directprintpreviewview.h"
+#include "directprintpropertyview.h"
+#include "directprintsearchresultview.h"
+#include "directprintengine.h"
+#include "directprintbearermgr.h"
+#include "directprintmsgutil.h"
+#include "directprintuipluginmgr.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CDirectPrintAppAppUi::ConstructL()
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CDirectPrintAppAppUi::ConstructL()
+ {
+ LOG("CDirectPrintAppAppUi::ConstructL BEGIN");
+ // Initialise app UI with standard value.
+ //BaseConstructL( EAknEnableSkin | EAknEnableMSK );
+ BaseConstructL( EAknEnableSkin );
+
+//not use FeatureManager::InitializeLibL();
+
+ iDoc = static_cast<CDirectPrintAppDocument*>( CAknAppUi::Document() );
+
+ TRAPD( err, InitializeEngineL() );
+ if ( err == KErrInUse )
+ {
+ LOG1("InitializeEngineL Error [%d]", err);
+ CDirectPrintMsgUtil::DisplayErrorNoteL(R_DIRECTPRINT_MSG_PRINT_IN_USE);
+ Exit();
+ }
+ else
+ {
+ User::LeaveIfError( err );
+ }
+
+ TRAP( err, InitializeBearerMngL() );
+ if ( err == KErrInUse || err == KErrAlreadyExists )
+ {
+ LOG1("InitializeBearerMngL Error [%d]", err);
+ CDirectPrintMsgUtil::DisplayErrorNoteL(R_DIRECTPRINT_MSG_PRINT_IN_USE);
+ Exit();
+ }
+ else
+ {
+ User::LeaveIfError( err );
+ }
+
+ InitializePluginMgrL();
+
+ LOG("CDirectPrintAppAppUi::ConstructL StatusPane...");
+ CEikStatusPane* statusPane = StatusPane();
+ CAknNavigationControlContainer* naviPane = (CAknNavigationControlContainer*) statusPane->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
+ {
+ TResourceReader reader;
+ iCoeEnv->CreateResourceReaderLC(reader, R_DIRECTPRINT_PROPERTYSETTING_NAVI_DECORATOR);
+ iNaviDecorator = naviPane->ConstructNavigationDecoratorFromResourceL(reader);
+ CleanupStack::PopAndDestroy();
+ }
+ CAknTabGroup* tabGroup = static_cast<CAknTabGroup*>(iNaviDecorator->DecoratedControl());
+ tabGroup->SetObserver(this);
+
+ LOG("CDirectPrintAppAppUi::ConstructL aiw param...");
+ // aiw param
+ iAiwState = ENotAiwCall;
+ TInt r = iAiwCall.Attach(KPrintPropertyCat,EPrintProperty,EOwnerProcess);
+ if (r == KErrNone)
+ {
+ iAiwCall.Get(KPrintPropertyCat,EPrintProperty,iAiwState);
+ }
+
+ if ( iAiwState == EAiwPrintCall )
+ {
+ // Set the aiw call RProperty key back to default value so that
+ // if application for some reason crashes the value is not left for AIW mode.
+ iAiwCall.Set( KPrintPropertyCat,EPrintProperty, ENotAiwCall );
+ TRAP( err, LoadParamL() );
+ if ( err != KErrNone )
+ {
+ CDirectPrintMsgUtil::DisplayErrorNoteL(R_DIRECTPRINT_MSG_PARAM_INCORRECT);
+ Exit();
+ }
+ }
+
+ LOG("CDirectPrintAppAppUi::ConstructL InitializeViewsL...");
+ InitializeViewsL();
+
+ iCoeEnv->RootWin().EnableScreenChangeEvents();
+
+ LOG("CDirectPrintAppAppUi::ConstructL END");
+ }
+
+// -----------------------------------------------------------------------------
+// CDirectPrintAppAppUi::CDirectPrintAppAppUi()
+// C++ default constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CDirectPrintAppAppUi::CDirectPrintAppAppUi()
+ {
+ // No implementation required
+ }
+
+// -----------------------------------------------------------------------------
+// CDirectPrintAppAppUi::~CDirectPrintAppAppUi()
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CDirectPrintAppAppUi::~CDirectPrintAppAppUi()
+ {
+//not use FeatureManager::UnInitializeLib();
+
+ if (iXmlEngDoc.NotNull())
+ {
+ iXmlEngDoc.Close(); // closing all opened objects
+ iXmlParser.Close();
+ iXmlDomImpl.Close();
+ }
+ delete iXmlParam;
+ delete iEngine;
+ delete iBearerMgr;
+ delete iPluginMgr;
+ delete iNaviDecorator;
+ iAiwCall.Close();
+ }
+
+// -----------------------------------------------------------------------------
+// CDirectPrintAppAppUi::HandleCommandL()
+// Takes care of command handling.
+// -----------------------------------------------------------------------------
+//
+void CDirectPrintAppAppUi::HandleCommandL( TInt aCommand )
+ {
+ LOG1("CDirectPrintAppAppUi::HandleCommandL(%d) BEGIN", aCommand);
+ switch( aCommand )
+ {
+ case EEikCmdExit:
+ case EAknSoftkeyExit:
+ case EDirectPrintCmdIdMainViewExit:
+ {
+ LOG1("BearerStatu=%d", iBearerMgr->BearerStatus());
+
+ TBool isPrinting = EFalse;
+ switch (iBearerMgr->BearerStatus())
+ {
+ case CDirectPrintBearerMgr::EBearerMngCreatingJob:
+ case CDirectPrintBearerMgr::EBearerMngPrinting:
+ isPrinting = ETrue;
+ break;
+ case CDirectPrintBearerMgr::EBearerMngClosing:
+ case CDirectPrintBearerMgr::EBearerMngCanceling:
+ case CDirectPrintBearerMgr::EBearerMngNotConnected:
+ case CDirectPrintBearerMgr::EBearerMngConnected:
+ default:
+ isPrinting = EFalse;
+ break;
+ }
+
+ if (!isPrinting)
+ {
+ iDoc->Model().ExternalizeDataL();
+ Exit();
+ }
+ else
+ {
+ // Show information message
+ HBufC* textResource = StringLoader::LoadLC(R_DIRECTPRINT_MSG_NOW_PRINTING);
+ CAknInformationNote* informationNote;
+ informationNote = new (ELeave) CAknInformationNote;
+ informationNote->ExecuteLD(*textResource);
+ CleanupStack::PopAndDestroy(textResource);
+ }
+ }
+ break;
+ case EDirectPrintCmdIdMainViewPrint:
+ case EDirectPrintCmdIdPropertySettingViewPrint:
+ case EDirectPrintCmdIdPreviewViewPrint:
+ {
+ MakeNaviPaneVisibleL(EFalse);
+ //TInt modelcount = iEngine->ModelCount();
+ iEngine->SetUseModel(0);
+ iEngine->PrintL();
+ }
+ break;
+ case EDirectPrintCmdIdMainViewPreview:
+ case EDirectPrintCmdIdPropertySettingViewPreview:
+ {
+ TVwsViewId id;
+ GetActiveViewId(id);
+ iBackViewUid = id.iViewUid;
+ //MakeStatusPaneVisible(EFalse);
+ MakeNaviPaneVisibleL(EFalse);
+ ActivateLocalViewL(TUid::Uid(EDirectPrintPreviewViewId));
+ }
+ break;
+ case EDirectPrintCmdIdMainViewPropertySetting:
+ {
+ if (iDoc->Model().PrinterCount() > 0)
+ {
+ CAknTabGroup* tabGroup = static_cast<CAknTabGroup*>(iNaviDecorator->DecoratedControl());
+ tabGroup->SetActiveTabByIndex(0);
+ // tabGroup->SetActiveTabByIndex(1);
+ MakeNaviPaneVisibleL(ETrue);
+ // ActivateLocalViewL(TUid::Uid(EDirectPrintPropertySetting1ViewId));
+ // ActivateLocalViewL(TUid::Uid(EDirectPrintPropertySetting2ViewId));
+ ActivateLocalViewL(TUid::Uid(EDirectPrintPropertyViewId));
+ }
+ }
+ break;
+ case EDirectPrintCmdIdMainViewPrinterList:
+ {
+ MakeNaviPaneVisibleL(EFalse);
+ ActivateLocalViewL(TUid::Uid(EDirectPrintPrinterListViewId));
+ }
+ break;
+ case EDirectPrintCmdIdPrinterSettingViewBack:
+ {
+ if (iBackViewUid != TUid::Uid(0))
+ {
+ ActivateLocalViewL(iBackViewUid);
+ iBackViewUid = TUid::Uid(0);
+ }
+ else
+ {
+ ActivateLocalViewL(TUid::Uid(EDirectPrintPrinterListViewId));
+ }
+ }
+ break;
+ case EDirectPrintCmdIdMainViewPrinterSetting:
+ case EDirectPrintCmdIdPrinterListViewNew:
+ case EDirectPrintCmdIdPrinterListViewEdit:
+ {
+ if ((iDoc->Model().PrinterCount() > 0) || (iDoc->Model().IsNewData()))
+ {
+ TVwsViewId id;
+ GetActiveViewId(id);
+ iBackViewUid = id.iViewUid;
+ MakeNaviPaneVisibleL(EFalse);
+ ActivateLocalViewL(TUid::Uid(EDirectPrintPrinterSettingViewId));
+ }
+ }
+ break;
+ case EDirectPrintCmdIdPrinterListViewDone:
+ case EDirectPrintCmdIdPropertySettingViewBack:
+ {
+ MakeNaviPaneVisibleL(EFalse);
+ ActivateLocalViewL(TUid::Uid(EDirectPrintMainViewId));
+ }
+ break;
+ case EDirectPrintCmdIdPrinterListViewSearch:
+ {
+ // Start printer search
+ //SearchPrinterL();
+ ActivateLocalViewL(TUid::Uid(EDirectPrintSearchResultViewId));
+ }
+ break;
+ case EDirectPrintCmdIdSearchResultViewSearch:
+ {
+ // Start printer search
+ //SearchPrinterL();
+ }
+ break;
+ case EDirectPrintCmdIdSearchResultViewSelect:
+ case EDirectPrintCmdIdSearchResultViewCancel:
+ {
+ ActivateLocalViewL(TUid::Uid(EDirectPrintPrinterListViewId));
+ }
+ break;
+ case EDirectPrintCmdIdPreviewViewBack:
+ {
+ MakeStatusPaneVisible(ETrue);
+ if (iBackViewUid != TUid::Uid(0))
+ {
+ if (iBackViewUid != TUid::Uid(EDirectPrintMainViewId))
+ {
+ MakeNaviPaneVisibleL(ETrue);
+ }
+ ActivateLocalViewL(iBackViewUid);
+ iBackViewUid = TUid::Uid(0);
+ }
+ else
+ {
+ ActivateLocalViewL(TUid::Uid(EDirectPrintMainViewId));
+ }
+ }
+ break;
+ case EDirectPrintCmdIdPrinterListViewDelete:
+ default:
+ break;
+ }
+ LOG("CDirectPrintAppAppUi::HandleCommandL END");
+ }
+
+void CDirectPrintAppAppUi::HandleResourceChangeL( TInt aType )
+ {
+ // base-class call also
+ CAknAppUi::HandleResourceChangeL(aType);
+ if (aType == KEikDynamicLayoutVariantSwitch)
+ {
+ }
+ }
+
+void CDirectPrintAppAppUi::TabChangedL(TInt aIndex)
+ {
+ TVwsViewId id;
+ GetActiveViewId(id);
+ if (id.iViewUid.iUid == EDirectPrintPropertyViewId)
+ {
+ CDirectPrintPropertyView* view = static_cast<CDirectPrintPropertyView*>(View(id.iViewUid));
+ view->ChangeTabL(aIndex);
+ }
+ }
+
+void CDirectPrintAppAppUi::MakeNaviPaneVisibleL(TBool aVisible)
+ {
+ CEikStatusPane* statusPane = StatusPane();
+ CAknNavigationControlContainer* naviPane = (CAknNavigationControlContainer*) statusPane->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
+
+ if (aVisible)
+ {
+ naviPane->PushL(*iNaviDecorator);
+ }
+ else
+ {
+ naviPane->Pop(iNaviDecorator);
+ }
+ }
+
+void CDirectPrintAppAppUi::MakeStatusPaneVisible(TBool aVisible)
+ {
+ CEikStatusPane* statusPane = StatusPane();
+ statusPane->MakeVisible(aVisible);
+ }
+
+void CDirectPrintAppAppUi::InitializeViewsL()
+ {
+ LOG("CDirectPrintAppAppUi::InitializeViewsL begin");
+ // Create view
+ LOG("-->CDirectPrintMainView");
+ CDirectPrintMainView* view1 = CDirectPrintMainView::NewL();
+ CleanupStack::PushL(view1);
+ AddViewL(view1);
+ CleanupStack::Pop(view1);
+
+ LOG("-->CDirectPrintListView");
+ CDirectPrintListView* view2 = CDirectPrintListView::NewL();
+ CleanupStack::PushL(view2);
+ AddViewL(view2);
+ CleanupStack::Pop(view2);
+
+ LOG("-->CDirectPrintSearchResultView");
+ CDirectPrintSearchResultView* view3 = CDirectPrintSearchResultView::NewL();
+ AddViewL(view3);
+
+ LOG("-->CDirectPrintPrinterSettingView");
+ CDirectPrintPrinterSettingView* view4 = CDirectPrintPrinterSettingView::NewL();
+ CleanupStack::PushL(view4);
+ AddViewL(view4);
+ CleanupStack::Pop(view4);
+
+ LOG("-->CDirectPrintPreviewView");
+ CDirectPrintPreviewView* view5 = CDirectPrintPreviewView::NewL();
+ CleanupStack::PushL(view5);
+ AddViewL(view5);
+ CleanupStack::Pop(view5);
+
+ LOG("-->CDirectPrintPropertyView");
+ CDirectPrintPropertyView* view6 = CDirectPrintPropertyView::NewL();
+ CleanupStack::PushL(view6);
+ AddViewL(view6);
+ CleanupStack::Pop(view6);
+
+ // Check plugins. Create view, if extended view exists.
+
+ SetDefaultViewL( *view1 );
+
+ iBackViewUid = TUid::Uid(0);
+ LOG("CDirectPrintAppAppUi::InitializeViewsL end");
+ }
+
+
+void CDirectPrintAppAppUi::LoadParamL()
+ {
+ // get the xml parameter from AIW provider
+ // after that iXmlEngDoc is set in the function.
+ GetParamFromAiwProviderL();
+ // set the xml param to the engine side, and
+ // the adapted band plugin is loaded and the xml
+ // parameter is sent to the plugin.
+ iEngine->SetParamL(&iXmlEngDoc);
+ }
+
+void CDirectPrintAppAppUi::GetParamFromAiwProviderL()
+ {
+ LOG("CDirectPrintAppAppUi::GetParamFromAiwProviderL() BEGIN");
+
+ RFileReadStream readStream;
+ TFileName paramFile;
+ _LIT( KParamFile, "c:\\system\\data\\T_AIW_TEMP.DAT");
+ paramFile.Copy(KParamFile);
+
+ User::LeaveIfError( readStream.Open(iCoeEnv->FsSession(), paramFile, EFileRead) );
+ readStream.PushL();
+ CAiwGenericParamList* paramList = CAiwGenericParamList::NewLC(readStream);
+
+ TInt index( 0 );
+ const TAiwGenericParam* param = paramList->FindFirst(index,
+ EGenericParamPrintXMLFile,
+ EVariantTypeDesC8);
+ TPtrC8 ptrParam = param->Value().AsData();
+ if ( ptrParam.Length() == 0)
+ {
+ User::Leave(KErrArgument);
+ }
+
+ // set file name
+ iXmlParam = ptrParam.AllocL();
+
+ // parse XML param
+ // opening DOM implementation object
+ iXmlDomImpl.OpenL();
+ // opening parser object
+ User::LeaveIfError(iXmlParser.Open( iXmlDomImpl ));
+ // ParseL return KXmlEngErrParsing
+ iXmlEngDoc =iXmlParser.ParseL( *iXmlParam ); // parsing buffer
+
+ CleanupStack::PopAndDestroy(paramList); //paramList
+ readStream.Close();
+ readStream.Pop();
+ LOG("CDirectPrintAppAppUi::GetParamFromAiwProviderL() END");
+ }
+
+// ---------------------------------------------------------------------------
+// CDirectPrintAppAppUi::InitializeEngineL()
+// Initialize print engine.
+// ---------------------------------------------------------------------------
+//
+void CDirectPrintAppAppUi::InitializeEngineL()
+ {
+ iEngine = CDirectPrintEngine::NewL(iDoc->Model());
+ iEngine->SetObserver(this);
+ }
+
+
+// ---------------------------------------------------------------------------
+// CDirectPrintAppAppUi::HandlePrintEventL()
+// Handle the events from engine side
+// ---------------------------------------------------------------------------
+//
+void CDirectPrintAppAppUi::HandlePrintEventL(
+ TDirectPrintEngineEvents aEvent,
+ TInt /*aError*/,
+ const TDesC& /*aParam*/)
+ {
+
+ switch (aEvent)
+ {
+ case EDirectPrintEngineEventStartCreatePrintData:
+ break;
+ case EDirectPrintEngineEventFinishCreatePrintData:
+ {
+ //TInt msgid = R_DIRECTPRINT_MSG_BEARER_OPEN_ERR;
+ TRAPD(err, iBearerMgr->CreateJobL());
+ if (err == KErrNone)
+ {
+ //msgid = R_DIRECTPRINT_MSG_SUBMIT_PRINT_ERR;
+ TRAP(err, iBearerMgr->SubmitPrintJobL());
+ }
+
+ if (err != KErrNone)
+ {
+ // show bearer open error
+ CAknErrorNote* errornote = new (ELeave) CAknErrorNote( ETrue );
+ HBufC* format = StringLoader::LoadLC( R_DIRECTPRINT_MSG_BEARER_OPEN_ERR );
+ HBufC* msg = HBufC::NewLC(format->Length()+5);
+ TPtr ptrMsg(msg->Des());
+ ptrMsg.AppendFormat(*format, err);
+ errornote->ExecuteLD( *msg );
+ CleanupStack::PopAndDestroy( msg );
+ CleanupStack::PopAndDestroy( format );
+ }
+ }
+ break;
+ case EDirectPrintEngineEventCancelCreatePrintData:
+ break;
+ case EDirectPrintEngineEventErrorCreatePrintData:
+ break;
+ default:
+ break;
+ }
+ }
+
+// ---------------------------------------------------------------------------
+// CDirectPrintAppAppUi::InitializeBearerMngL()
+// Initialize bearer manager.
+// ---------------------------------------------------------------------------
+//
+void CDirectPrintAppAppUi::InitializeBearerMngL()
+ {
+ iBearerMgr = CDirectPrintBearerMgr::NewL(this, iDoc->Model());
+ }
+
+// ---------------------------------------------------------------------------
+// CDirectPrintAppAppUi::InitializePluginMgrL()
+// Initialize plugin manager.
+// ---------------------------------------------------------------------------
+//
+void CDirectPrintAppAppUi::InitializePluginMgrL()
+ {
+ iPluginMgr = CDirectPrintUiPluginMgr::NewL(iDoc->Model());
+ }
+
+// ---------------------------------------------------------------------------
+// CDirectPrintAppAppUi::HandleBearerMngEventL()
+// Handle the events from engine side
+// ---------------------------------------------------------------------------
+//
+void CDirectPrintAppAppUi::HandleBearerMngEventL(
+ TDirectPrintBearerMngEvents aEvent,
+ TInt /*aError*/,
+ const TDesC& /*aParam*/)
+ {
+
+ switch (aEvent)
+ {
+ case EDirectPrintBearerMngErrorConnectBearer:
+ break;
+ case EDirectPrintBearerMngConnectedBearer:
+ break;
+ default:
+ break;
+ }
+ }
+
+void CDirectPrintAppAppUi::PrintJobProgressEvent( TInt aStatus,
+ TInt aPercentCompletion,
+ TInt aJobStateCode )
+ {
+ LOG3("Start CDirectPrintAppAppUi::PrintJobProgressEvent[%d],[%d],[%d]",
+ aStatus, aPercentCompletion, aJobStateCode);
+ if ( aStatus == EActive )
+ {
+ LOG("aStatus == EActive");
+
+ }
+ else
+ {
+ LOG("aStatus == EDone");
+ if ( aJobStateCode == ECancelling && aStatus == EDone )
+ {
+ LOG("ECancelling");
+ }
+ else if ( aJobStateCode == ECancellingNoMessage && aStatus == EDone )
+ {
+ LOG("ECancellingNoMessage");
+ }
+ else
+ {
+ LOG("Finish");
+ this->iBearerMgr->CloseSession();
+ }
+ }
+ LOG("End CDirectPrintAppAppUi::PrintJobProgressEvent");
+ }
+
+void CDirectPrintAppAppUi::PrintJobErrorEvent( TInt aError,
+ TInt aErrorStringCode )
+ {
+ LOG2("Start CDirectPrintAppAppUi::PrintJobErrorEvent[%d], [%d]", aError, aErrorStringCode);
+ LOG("Finish when error happen");
+ this->iBearerMgr->CloseSession();
+ LOG("End CDirectPrintAppAppUi::PrintJobErrorEvent");
+ }
+
+void CDirectPrintAppAppUi::PrinterStatusEvent( TInt aError,
+ TInt aErrorStringCode )
+ {
+ LOG2("Start CDirectPrintAppAppUi::PrinterStatusEvent[%d], [%d]", aError, aErrorStringCode);
+ LOG("End CDirectPrintAppAppUi::PrinterStatusEvent");
+ }
+
+void CDirectPrintAppAppUi::PreviewImageEvent( TInt /*aFsBitmapHandle*/ )
+ {
+ LOG("Start CDirectPrintAppAppUi::PreviewImageEvent");
+ LOG("End CDirectPrintAppAppUi::PreviewImageEvent");
+ }
+
+void CDirectPrintAppAppUi::ShowMessageL( TInt aMsgLine1Code,
+ TInt aMsgLine2Code )
+ {
+ LOG2("Start CDirectPrintAppAppUi::ShowMessageL[%d], [%d]", aMsgLine1Code, aMsgLine2Code);
+ LOG("End CDirectPrintAppAppUi::ShowMessageL");
+ }
+
+TBool CDirectPrintAppAppUi::AskYesNoQuestionL( TInt aMsgLine1Code,
+ TInt aMsgLine2Code )
+ {
+ LOG2("Start CDirectPrintAppAppUi::AskYesNoQuestionL[%d], [%d]", aMsgLine1Code, aMsgLine2Code);
+ LOG("End CDirectPrintAppAppUi::AskYesNoQuestionL");
+ return EFalse;
+ }
+
+const TDesC& CDirectPrintAppAppUi::AskForInputL( TInt aMsgLine1Code,
+ TInt aMsgLine2Code )
+ {
+ LOG2("Start CDirectPrintAppAppUi::AskForInputL[%d], [%d]", aMsgLine1Code, aMsgLine2Code);
+ LOG("End CDirectPrintAppAppUi::AskForInputL");
+ return KNullDesC;
+ }
+
+// End of File
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/src/directprintappdocument.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// INCLUDE FILES
+#include "clog.h"
+#include "directprintappappui.h"
+#include "directprintappdocument.h"
+#include "directprintmodel.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CDirectPrintAppDocument::NewL()
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CDirectPrintAppDocument* CDirectPrintAppDocument::NewL(CEikApplication& aApp)
+ {
+ CDirectPrintAppDocument* self = NewLC(aApp);
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+// -----------------------------------------------------------------------------
+// CDirectPrintAppDocument::NewLC()
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CDirectPrintAppDocument* CDirectPrintAppDocument::NewLC(CEikApplication& aApp)
+ {
+ CDirectPrintAppDocument* self = new (ELeave) CDirectPrintAppDocument(aApp);
+
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ return self;
+ }
+
+// -----------------------------------------------------------------------------
+// CDirectPrintAppDocument::ConstructL()
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CDirectPrintAppDocument::ConstructL()
+ {
+ LOG("CDirectPrintAppDocument::ConstructL BEGIN");
+ // create the model object
+ iModel = CDirectPrintModel::NewL();
+ LOG("CDirectPrintAppDocument::ConstructL END");
+ }
+
+// -----------------------------------------------------------------------------
+// CDirectPrintAppDocument::CDirectPrintAppDocument()
+// C++ default constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CDirectPrintAppDocument::CDirectPrintAppDocument(CEikApplication& aApp) :
+ CAknDocument(aApp)
+ {
+ // No implementation required
+ }
+
+// ---------------------------------------------------------------------------
+// CDirectPrintAppDocument::~CDirectPrintAppDocument()
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+CDirectPrintAppDocument::~CDirectPrintAppDocument()
+ {
+ delete iModel;
+ }
+
+// ---------------------------------------------------------------------------
+// CDirectPrintAppDocument::CreateAppUiL()
+// Constructs CreateAppUi.
+// ---------------------------------------------------------------------------
+//
+CEikAppUi* CDirectPrintAppDocument::CreateAppUiL()
+ {
+ // Create the application user interface, and return a pointer to it;
+ // the framework takes ownership of this object
+ return new (ELeave) CDirectPrintAppAppUi;
+ }
+
+CDirectPrintModel& CDirectPrintAppDocument::Model()
+ {
+ return *iModel;
+ }
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/src/directprintbearerdata.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// INCLUDE FILES
+#include <s32strm.h>
+
+#include "directprintbearerdata.h"
+
+EXPORT_C void TDirectPrintBearerData::InternalizeL(RReadStream& aStream)
+ {
+ iPrinterId = aStream.ReadInt32L();
+ iBearerId = aStream.ReadInt32L();
+ TInt length = aStream.ReadInt32L();
+ if(length > 0)
+ {
+ aStream.ReadL(iBearerName, length);
+ }
+ length = aStream.ReadInt32L();
+ if(length > 0)
+ {
+ aStream.ReadL(iAccessPoint, length);
+ }
+ length = aStream.ReadInt32L();
+ if(length > 0)
+ {
+ aStream.ReadL(iHostName, length);
+ }
+ iHostIp.SetAddress(aStream.ReadInt32L());
+ iPort = aStream.ReadInt32L();
+ length = aStream.ReadInt32L();
+ if(length > 0)
+ {
+ aStream.ReadL(iUserName, length);
+ }
+ length = aStream.ReadInt32L();
+ if(length > 0)
+ {
+ aStream.ReadL(iQueName, length);
+ }
+ }
+
+EXPORT_C void TDirectPrintBearerData::ExternalizeL(RWriteStream& aStream) const
+ {
+ aStream.WriteInt32L(iPrinterId);
+ aStream.WriteInt32L(iBearerId);
+ aStream.WriteInt32L(iBearerName.Length());
+ if (iBearerName.Length() > 0)
+ {
+ aStream.WriteL(iBearerName);
+ }
+ aStream.WriteInt32L(iAccessPoint.Length());
+ if (iAccessPoint.Length() > 0)
+ {
+ aStream.WriteL(iAccessPoint);
+ }
+ aStream.WriteInt32L(iHostName.Length());
+ if (iHostName.Length() > 0)
+ {
+ aStream.WriteL(iHostName);
+ }
+ aStream.WriteInt32L(iHostIp.Address());
+ aStream.WriteInt32L(iPort);
+ aStream.WriteInt32L(iUserName.Length());
+ if (iUserName.Length() > 0)
+ {
+ aStream.WriteL(iUserName);
+ }
+ aStream.WriteInt32L(iQueName.Length());
+ if (iQueName.Length() > 0)
+ {
+ aStream.WriteL(iQueName);
+ }
+ }
+
+EXPORT_C TDirectPrintBearerData& TDirectPrintBearerData::operator=(const TDirectPrintBearerData& aData)
+ {
+ iPrinterId = aData.iPrinterId;
+ iBearerId = aData.iBearerId;
+ iBearerName.Copy(aData.iBearerName);
+ iAccessPoint.Copy(aData.iAccessPoint);
+ iHostName.Copy(aData.iHostName);
+ //iHostIp.SetAddress(aData.iHostIp.Address());
+ iHostIp = aData.iHostIp;
+ iPort = aData.iPort;
+ iUserName.Copy(aData.iUserName);
+ iQueName.Copy(aData.iQueName);
+ return *this;
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/src/directprintbearermgr.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,357 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// User includes
+#include "clog.h"
+#include "DirectPrintApp.pan"
+#include "DirectPrintBearerMgr.h"
+#include "DirectPrintModel.h"
+#include "directprintbearerdata.h"
+#include "directprintprinterdata.h"
+
+#include "directprintprintsettings.h"
+#include "directprinttintcapability.h"
+#include "directprintlistcapability.h"
+#include "directprintfloatcapability.h"
+#include "directprinttextcapability.h"
+#include "directprintsettingsconverter.h"
+#include "directprintcapability.h"
+
+const TInt PROTOCOL_ID_BIT_COUNT = 6;
+
+CDirectPrintBearerMgr::CDirectPrintBearerMgr(MDirectPrintBearerMngObserver* aObserver,
+ CDirectPrintModel& aModel)
+ : CActive( CActive::EPriorityHigh )
+ , iObserver(aObserver)
+ , iModel(aModel)
+ {
+ LOG("CDirectPrintBearerMgr::CDirectPrintBearerMgr()");
+ CActiveScheduler::Add(this);
+ }
+
+CDirectPrintBearerMgr::~CDirectPrintBearerMgr()
+ {
+ LOG("CDirectPrintBearerMgr::~CDirectPrintBearerMgr()");
+ if (IsActive())
+ {
+ Cancel();
+ }
+ iBearer.Close();
+ delete iPrintSettings;
+ }
+
+CDirectPrintBearerMgr* CDirectPrintBearerMgr::NewL(MDirectPrintBearerMngObserver* aObserver,
+ CDirectPrintModel& aModel)
+ {
+ CDirectPrintBearerMgr* self = CDirectPrintBearerMgr::NewLC(aObserver, aModel);
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+CDirectPrintBearerMgr* CDirectPrintBearerMgr::NewLC(MDirectPrintBearerMngObserver* aObserver,
+ CDirectPrintModel& aModel)
+ {
+ CDirectPrintBearerMgr* self = new(ELeave) CDirectPrintBearerMgr(aObserver, aModel);
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ return self;
+ }
+
+void CDirectPrintBearerMgr::ConstructL()
+ {
+ LOG("CDirectPrintBearerMgr::ConstructL BEGIN");
+ __ASSERT_ALWAYS(iObserver, Panic(EDirectPrintNoObserver));
+ iPrintSettings = new ( ELeave ) CDirectPrintPrintSettings;
+ iBearer.ConnectL();
+ SetBearerStatus(EBearerMngConnected);
+ LOG("CDirectPrintBearerMgr::ConstructL END");
+ }
+
+void CDirectPrintBearerMgr::CreateJobL()
+ {
+ LOG("CDirectPrintBearerMgr::CreateJobL BEGIN");
+ RPointerArray<TDesC> cmdline;
+ CleanupClosePushL(cmdline);
+
+ _LIT(KDPAppName, "DirectPrint");
+ cmdline.AppendL(&(KDPAppName()));
+
+ TDirectPrintBearerData bearerData;
+ TDirectPrintPrinterData printerData;
+ TInt indexBearer = iModel.CurrentBearer();
+ TInt indexPrinter = iModel.CurrentPrinter();
+ if (indexBearer >= 0 && indexPrinter >= 0)
+ {
+ iModel.GetBearerDataL(indexBearer, bearerData);
+ iModel.GetPrinterDataL(indexPrinter, printerData);
+ }
+ else
+ {
+ LOG("CDirectPrintBearerMgr::CreateJobL LEAVE1 KErrNotFound");
+ User::Leave(KErrNotFound);
+ }
+
+ HBufC* apname = HBufC::NewLC(50);
+ TPtr apnamePtr(apname->Des());
+ _LIT(KDPApName, "-S%S");
+ apnamePtr.AppendFormat(KDPApName(), &(bearerData.iHostName));
+ cmdline.AppendL(apname);
+
+ HBufC* printername = HBufC::NewLC(50);
+ TPtr printernamePtr(printername->Des());
+ _LIT(KDPPrinterName, "-P000000439163");
+ printernamePtr.Copy(KDPPrinterName());
+ cmdline.AppendL(printername);
+
+ HBufC* filename = HBufC::NewLC(50);
+ TPtr filenamePtr(filename->Des());
+#ifdef __WINSCW__
+ _LIT(KDPFileName, "c:\\fpr.pcl");
+#else
+// _LIT(KDPFileName, "e:\\fpr.pcl");
+ _LIT(KDPFileName, "c:\\fpr.pcl");
+#endif
+ filenamePtr.Copy(KDPFileName());
+ cmdline.AppendL(filename);
+
+ SetBearerStatus(EBearerMngCreatingJob);
+
+ // bearer ID
+ TInt printerID = 128;
+ TInt err = iBearer.CreateJob(printerID, iJobGuardData,
+ cmdline, iStatus);
+ if( !err )
+ {
+ LOG("Start create JOB");
+ SetActive();
+ }
+ else
+ {
+ LOG1("CDirectPrintBearerMgr::CreateJobL LEAVE2[%d]", err);
+ User::Leave(err);
+ }
+
+ CleanupStack::PopAndDestroy(filename);
+ CleanupStack::PopAndDestroy(printername);
+ CleanupStack::PopAndDestroy(apname);
+ CleanupStack::PopAndDestroy(&cmdline);
+ LOG("CDirectPrintBearerMgr::CreateJobL END");
+ }
+
+void CDirectPrintBearerMgr::RunL()
+ {
+ LOG1("CDirectPrintBearerMgr::RunL begin with iStatus.Int(): %d", iStatus.Int());
+ if( iStatus == KErrNone && iObserver )
+ {
+ switch( iJobGuardData.iCb )
+ {
+ case TDirectPrintJobGuardData::EProgressEventCb:
+ LOG("CJobGuard::RunL TDirectPrintJobGuardData::EProgressEventCb");
+ LOG1("CJobGuard::RunL iJobGuardData.iStatus: %d", iJobGuardData.iStatus);
+ LOG1("CJobGuard::RunL iJobGuardData.iPercentCompletion: %d", iJobGuardData.iPercentCompletion);
+ LOG1("CJobGuard::RunL iJobGuardData.iJobStateCode: %d", iJobGuardData.iJobStateCode);
+ iObserver->PrintJobProgressEvent( iJobGuardData.iStatus, iJobGuardData.iPercentCompletion, iJobGuardData.iJobStateCode );
+ break;
+ case TDirectPrintJobGuardData::EErrorEventCb:
+ LOG("CJobGuard::RunL TDirectPrintJobGuardData::EErrorEventCb");
+ LOG1("CJobGuard::RunL iJobGuardData.iError: %d", iJobGuardData.iError);
+ LOG1("CJobGuard::RunL iJobGuardData.iErrorStringCode: %d", iJobGuardData.iErrorStringCode);
+ iObserver->PrintJobErrorEvent( iJobGuardData.iError, iJobGuardData.iErrorStringCode );
+ break;
+ case TDirectPrintJobGuardData::EStatusEventCb:
+ LOG("CJobGuard::RunL TDirectPrintJobGuardData::EStatusEventCb");
+ LOG1("CJobGuard::RunL iJobGuardData.iError: %d", iJobGuardData.iError);
+ LOG1("CJobGuard::RunL iJobGuardData.iErrorStringCode: %d", iJobGuardData.iErrorStringCode);
+ iObserver->PrintJobErrorEvent( iJobGuardData.iError, iJobGuardData.iErrorStringCode );
+ break;
+ case TDirectPrintJobGuardData::EImageEventCb:
+ LOG("CJobGuard::RunL TDirectPrintJobGuardData::EImageEventCb");
+ LOG1("CJobGuard::RunL iJobGuardData.iFsBitmapHandle: %d", iJobGuardData.iFsBitmapHandle);
+ iObserver->PreviewImageEvent( iJobGuardData.iFsBitmapHandle );
+ break;
+ default:
+ break;
+ }
+
+ LOG1("CDirectPrintBearerMgr::RunL BearerStatus=[%d]", iBearerStatus);
+
+ switch (iBearerStatus)
+ {
+ case EBearerMngNotConnected:
+ case EBearerMngConnected:
+ case EBearerMngCreatingJob:
+ case EBearerMngPrinting:
+ {
+ LOG("CDirectPrintBearerMgr::RunL ContinueCreateJob");
+ iBearer.ContinueCreateJob( iJobGuardData, iStatus );
+ SetActive();
+ }
+ break;
+ case EBearerMngClosing:
+ case EBearerMngCanceling:
+ default:
+ break;
+ }
+
+ }
+ LOG("CDirectPrintBearerMgr::RunL end");
+ }
+
+void CDirectPrintBearerMgr::SubmitPrintJobL()
+ {
+ LOG("CDirectPrintBearerMgr::SubmitPrintJobL BEGIN");
+ SetBearerStatus(EBearerMngPrinting);
+ // Submit print job
+ TInt err = iBearer.SubmitPrintJob();
+ if( err != KErrNone )
+ {
+ User::Leave(err);
+ }
+ LOG("CDirectPrintBearerMgr::SubmitPrintJobL END");
+ }
+
+void CDirectPrintBearerMgr::CloseSession()
+ {
+ LOG("CDirectPrintBearerMgr::CloseSession BEGIN");
+ SetBearerStatus(EBearerMngClosing);
+ Cancel();
+// iBearer.Close();
+ SetBearerStatus(EBearerMngConnected);
+ LOG("CDirectPrintBearerMgr::CloseSession END");
+ }
+
+void CDirectPrintBearerMgr::DoCancel()
+ {
+ LOG("CDirectPrintBearerMgr::DoCancel BEGIN");
+ SetBearerStatus(EBearerMngCanceling);
+ iBearer.CancelCreateJob();
+ LOG("CDirectPrintBearerMgr::DoCancel END");
+ }
+
+void CDirectPrintBearerMgr::SetBearerStatus(TBearerMngStatus aStatus)
+ {
+ LOG1("CDirectPrintBearerMgr::SetBearerStatus [%d]", aStatus);
+ iBearerStatus = aStatus;
+ }
+
+CDirectPrintBearerMgr::TBearerMngStatus CDirectPrintBearerMgr::BearerStatus()
+ {
+ return iBearerStatus;
+ }
+
+TInt CDirectPrintBearerMgr::SupportedProtocols()
+ {
+ return iBearer.SupportedProtocols();
+ }
+
+TInt CDirectPrintBearerMgr::GetProtocolNames(RSelectItemArray& aNames)
+ {
+ return iBearer.GetProtocolNames(aNames);
+ }
+
+void CDirectPrintBearerMgr::InitCapabilitiesL(TInt aIndex)
+ {
+ TInt printerUid = CreatePrinterUid(aIndex);
+
+ RArray<TInt> capabIDs;
+ CleanupClosePushL( capabIDs );
+
+ iBearer.GetPrinterCapabilityIDs( printerUid, capabIDs );
+ CDirectPrintPrintSettings* printSettings = new ( ELeave ) CDirectPrintPrintSettings;
+ CleanupStack::PushL( printSettings );
+
+ TInt i( 0 );
+ TInt num( capabIDs.Count() );
+ for ( i = 0; i < num; i++ )
+ {
+ TDirectPrintCapability capab;
+ iBearer.GetPrinterCapability( printerUid, capabIDs[i], capab );
+ //capab.iType = TDirectPrintCapability::Enum;
+
+ CDirectPrintBaseCapability* capability = 0;
+
+ // Create capability
+ switch ( capab.iType )
+ {
+ case TDirectPrintCapability::Int:
+ capability = DirectPrintSettingsConverter::AddTIntCapabilityLC( capab, i, capabIDs[i] );
+ break;
+ case TDirectPrintCapability::Enum:
+ capability = DirectPrintSettingsConverter::AddListCapabilityLC( capab, i, capabIDs[i] );
+ break;
+ case TDirectPrintCapability::Float:
+ capability = DirectPrintSettingsConverter::AddFloatCapabilityLC( capab, i, capabIDs[i] );
+ break;
+ case TDirectPrintCapability::Text:
+ capability = DirectPrintSettingsConverter::AddTextCapabilityLC( capab, i, capabIDs[i] );
+ break;
+ default:
+ User::Leave( KErrUnknown );
+ break;
+ }
+ //iBearer.GetJobSetting( capabIDs[i], capability->iValue );
+
+ // Add the capability to the list
+ User::LeaveIfError( printSettings->iCapabilities.Append( capability ) );
+ CleanupStack::Pop(); // capability
+ }
+
+ delete iPrintSettings;
+ iPrintSettings = printSettings;
+
+ CleanupStack::Pop(); // printSettings
+ CleanupStack::PopAndDestroy(); // capabIDs
+ }
+
+TInt CDirectPrintBearerMgr::GetJobSetting(TInt aCapabilityID, TInt& aValue)
+ {
+ return iBearer.GetJobSetting(aCapabilityID, aValue);
+ }
+
+TInt CDirectPrintBearerMgr::SetJobSetting(TInt aCapabilityID, TInt aValue, TInt& aAffectedCapability)
+ {
+ return iBearer.SetJobSetting(aCapabilityID, aValue, aAffectedCapability);
+ }
+
+void CDirectPrintBearerMgr::SetJobSettings()
+ {
+ TInt i( 0 );
+ TInt num( iPrintSettings->iCapabilities.Count() );
+ for ( i = 0; i < num; i++ )
+ {
+ TInt getSettings;
+ iBearer.SetJobSetting(iPrintSettings->iCapabilities[i]->iUid, iPrintSettings->iCapabilities[i]->iValue, getSettings);
+ }
+ }
+
+CDirectPrintPrintSettings* CDirectPrintBearerMgr::PrinterSettingsL()
+ {
+ //return iPrintSettings->CloneL();
+ return iPrintSettings;
+ }
+
+TInt CDirectPrintBearerMgr::CreatePrinterUid(TInt aIndex)
+ {
+ TInt printerUid = 0;
+ TInt protocolIndex = aIndex;
+ protocolIndex <<= sizeof(TInt)*8 - PROTOCOL_ID_BIT_COUNT;
+ printerUid |= protocolIndex;
+ return printerUid;
+ }
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/src/directprintmodel.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,476 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* This model class for DirectPrint data managemrnt
+*
+*/
+
+#include <bautils.h>
+#include <eikenv.h>
+#include <s32file.h>
+#include <DirectPrintApp.rsg>
+
+#include "clog.h"
+#include "DirectPrintModel.h"
+#include "directprintprinterinforeader.h"
+
+CDirectPrintModel::CDirectPrintModel()
+ : iCurrentPrinter(-1)
+ , iCurrentBearer(-1)
+ , iCurrentProperty(-1)
+ , iMaxPrinterId(0)
+ {
+ }
+
+CDirectPrintModel::~CDirectPrintModel()
+ {
+ iPrinters.Close();
+ iBearers.Close();
+ iProperties.ResetAndDestroy();
+ delete iPrinterInfoReader;
+ }
+
+CDirectPrintModel* CDirectPrintModel::NewL()
+ {
+ CDirectPrintModel* self = CDirectPrintModel::NewLC();
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+CDirectPrintModel* CDirectPrintModel::NewLC()
+ {
+ CDirectPrintModel* self = new(ELeave) CDirectPrintModel();
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ return self;
+ }
+
+void CDirectPrintModel::ConstructL()
+ {
+ LOG("CDirectPrintModel::ConstructL BEGIN");
+ iFs = CEikonEnv::Static()->FsSession();
+
+ // Read setting data
+ InternalizeDataL();
+
+ iPrinterInfoReader = CDirectPrintPrinterInfoReader::NewL(*this);
+ iPrinterInfoReader->ReadPrinterInfoL();
+
+ LOG("CDirectPrintModel::ConstructL END");
+ }
+
+void CDirectPrintModel::InitializeDataL()
+ {
+ }
+
+void CDirectPrintModel::InternalizeDataL()
+ {
+ LOG("CDirectPrintModel::ConstructL BEGIN");
+ TFileName fileName;
+ CEikonEnv::Static()->ReadResourceAsDes16L(fileName, R_DIRECTPRINT_SETTING_FILE);
+
+ if (BaflUtils::FileExists(iFs, fileName))
+ {
+ LOG("CDirectPrintModel::ConstructL file exist");
+ RFileReadStream stream;
+ TInt err = stream.Open(iFs, fileName, EFileRead|EFileStream);
+
+ TInt count, i;
+ count = stream.ReadInt32L();
+ for (i=0; i<count; i++)
+ {
+ TDirectPrintPrinterData data;
+ data.InternalizeL(stream);
+ AddPrinterDataL(data);
+ if (iMaxPrinterId < data.iPrinterId)
+ {
+ iMaxPrinterId = data.iPrinterId;
+ }
+ }
+ iCurrentPrinter = stream.ReadInt32L();
+
+ count = stream.ReadInt32L();
+ for (i=0; i<count; i++)
+ {
+ TDirectPrintBearerData data;
+ data.InternalizeL(stream);
+ AddBearerDataL(data);
+ }
+ iCurrentBearer = stream.ReadInt32L();
+
+ count = stream.ReadInt32L();
+ for (i=0; i<count; i++)
+ {
+ CPrinterProperty* property = new(ELeave)CPrinterProperty();
+ CleanupStack::PushL(property);
+ property->InternalizeL(stream);
+ CleanupStack::Pop(property);
+ AddPrinterPropertyL(property);
+ }
+ iCurrentProperty = stream.ReadInt32L();
+
+ stream.Close();
+ }
+ LOG("CDirectPrintModel::ConstructL END");
+ }
+
+void CDirectPrintModel::ExternalizeDataL()
+ {
+ LOG("CDirectPrintModel::ExternalizeDataL START");
+ TFileName fileName;
+ CEikonEnv::Static()->ReadResourceAsDes16L(fileName, R_DIRECTPRINT_SETTING_FILE);
+
+ RFileWriteStream stream;
+ TInt err = stream.Replace(iFs, fileName, EFileWrite|EFileStream);
+
+ TInt count, i;
+ count = iPrinters.Count();
+ stream.WriteInt32L(count);
+ for (i=0; i<count; i++)
+ {
+ iPrinters[i].ExternalizeL(stream);
+ }
+ stream.WriteInt32L(iCurrentPrinter);
+
+ count = iBearers.Count();
+ stream.WriteInt32L(count);
+ for (i=0; i<count; i++)
+ {
+ iBearers[i].ExternalizeL(stream);
+ }
+ stream.WriteInt32L(iCurrentBearer);
+
+ count = iProperties.Count();
+ stream.WriteInt32L(count);
+ for (i=0; i<count; i++)
+ {
+ iProperties[i]->ExternalizeL(stream);
+ }
+ stream.WriteInt32L(iCurrentProperty);
+
+ stream.Close();
+ LOG("CDirectPrintModel::ExternalizeDataL END");
+ }
+
+void CDirectPrintModel::GetPrinterDataL(TInt aIndex, TDirectPrintPrinterData& aData)
+ {
+ aData = iPrinters[aIndex];
+ }
+
+void CDirectPrintModel::GetBearerDataL(TInt aIndex, TDirectPrintBearerData& aData)
+ {
+ aData = iBearers[aIndex];
+ }
+
+void CDirectPrintModel::GetCurrentBearerDataL(TDirectPrintBearerData& aData)
+ {
+ TDirectPrintPrinterData printer;
+ GetPrinterDataL(CurrentPrinter(), printer);
+
+ TInt count = BearerCount();
+ for (TInt i=0; i<count; i++)
+ {
+ TInt printerId = iBearers[i].iPrinterId;
+ if (printerId == printer.iPrinterId)
+ {
+ aData = iBearers[i];
+ break;
+ }
+ }
+ }
+
+void CDirectPrintModel::GetSelectedBearerDataL(TDirectPrintBearerData& aData)
+ {
+ TDirectPrintPrinterData printer;
+ GetPrinterDataL(SelectPrinter(), printer);
+
+ TInt count = BearerCount();
+ for (TInt i=0; i<count; i++)
+ {
+ TInt printerId = iBearers[i].iPrinterId;
+ if (printerId == printer.iPrinterId)
+ {
+ aData = iBearers[i];
+ break;
+ }
+ }
+ }
+
+CPrinterProperty* CDirectPrintModel::GetPrinterPropertyL(TInt aIndex)
+ {
+ return iProperties[aIndex];
+ }
+
+CPrinterProperty* CDirectPrintModel::GetCurrentPrinterPropertyL(TUid aAppUid)
+ {
+ CPrinterProperty* property = NULL;
+ TDirectPrintPrinterData printer;
+ GetPrinterDataL(CurrentPrinter(), printer);
+
+ TInt index, count;
+ count = PropertyCount();
+ for (index=0; index<count; index++)
+ {
+ TInt printerId = iProperties[index]->iPrinterId;
+ TUid uid = TUid::Uid(iProperties[index]->iApplicationId);
+ if ((printerId == printer.iPrinterId) &&
+ (uid == aAppUid))
+ {
+ if (iCurrentProperty != index)
+ {
+ iCurrentProperty = index;
+ }
+ property = iProperties[index];
+ break;
+ }
+ }
+
+ return property;
+ }
+
+TInt CDirectPrintModel::GetCurrentPrinterIdL()
+ {
+ TDirectPrintPrinterData printer;
+ GetPrinterDataL(CurrentPrinter(), printer);
+ return printer.iPrinterId;
+ }
+
+TInt CDirectPrintModel::CurrentPrinter()
+ {
+ return iCurrentPrinter;
+ }
+
+TInt CDirectPrintModel::CurrentBearer()
+ {
+ return iCurrentBearer;
+ }
+
+TInt CDirectPrintModel::CurrentProperty()
+ {
+ return iCurrentProperty;
+ }
+
+TInt CDirectPrintModel::SelectPrinter()
+ {
+ return iSelectPrinter;
+ }
+
+TInt CDirectPrintModel::PrinterCount()
+ {
+ return iPrinters.Count();
+ }
+
+TInt CDirectPrintModel::BearerCount()
+ {
+ return iBearers.Count();
+ }
+
+TInt CDirectPrintModel::PropertyCount()
+ {
+ return iProperties.Count();
+ }
+
+void CDirectPrintModel::SetPrinterDataL(TInt aIndex, const TDirectPrintPrinterData& aData)
+ {
+ if ((aIndex >= 0) && (iPrinters.Count() > aIndex))
+ {
+ iPrinters[aIndex] = aData;
+ }
+ else
+ {
+ iPrinters.AppendL(aData);
+ }
+ iPrinterInfoReader->ReadPrinterInfoL();
+ }
+
+void CDirectPrintModel::SetPrinterDataL(const TDirectPrintPrinterData& aData)
+ {
+ TBool isSet = EFalse;
+ TInt count = PrinterCount();
+ for (TInt i=0; i<count; i++)
+ {
+ TInt printerId = iPrinters[i].iPrinterId;
+ if (printerId == aData.iPrinterId)
+ {
+ iPrinters[i] = aData;
+ isSet = ETrue;
+ break;
+ }
+ }
+
+ if (!isSet)
+ {
+ iPrinters.AppendL(aData);
+ }
+ iPrinterInfoReader->ReadPrinterInfoL();
+ }
+
+void CDirectPrintModel::SetBearerDataL(TInt aIndex, const TDirectPrintBearerData& aData)
+ {
+ if ((aIndex >= 0) && (iBearers.Count() > aIndex))
+ {
+ iBearers[aIndex] = aData;
+ }
+ else
+ {
+ iBearers.AppendL(aData);
+ }
+ }
+
+void CDirectPrintModel::SetBearerDataL(const TDirectPrintBearerData& aData)
+ {
+ TBool isSet = EFalse;
+ TInt count = BearerCount();
+ for (TInt i=0; i<count; i++)
+ {
+ TInt printerId = iBearers[i].iPrinterId;
+ if (printerId == aData.iPrinterId)
+ {
+ iBearers[i] = aData;
+ isSet = ETrue;
+ break;
+ }
+ }
+
+ if (!isSet)
+ {
+ iBearers.AppendL(aData);
+ }
+ }
+
+void CDirectPrintModel::SetPrinterPropertyL(TInt aIndex, CPrinterProperty* aProperty)
+ {
+ if ((aIndex >= 0) && (iProperties.Count() > aIndex))
+ {
+ *(iProperties[aIndex]) = *aProperty;
+ delete aProperty;
+ }
+ else
+ {
+ iProperties.AppendL(aProperty);
+ }
+ }
+
+void CDirectPrintModel::SetPrinterPropertyL(CPrinterProperty* aProperty)
+ {
+ CPrinterProperty* property = GetCurrentPrinterPropertyL(TUid::Uid(aProperty->iApplicationId));
+ if (property)
+ {
+ TInt count1, count2;
+ count1 = property->iPropertyItems.Count();
+ count2 = aProperty->iPropertyItems.Count();
+ for (TInt i=0; i<count2; i++)
+ {
+ TBool isSet = EFalse;
+ for (TInt j=0; j<count1; j++)
+ {
+ if (aProperty->iPropertyItems[i].iItemId == property->iPropertyItems[j].iItemId)
+ {
+ (property->iPropertyItems[j]) = (aProperty->iPropertyItems[i]);
+ isSet = ETrue;
+ break;
+ }
+ }
+
+ if (!isSet)
+ {
+ property->iPropertyItems.AppendL(aProperty->iPropertyItems[i]);
+ }
+ }
+ delete aProperty;
+ }
+ else
+ {
+ iProperties.AppendL(aProperty);
+ }
+ }
+
+void CDirectPrintModel::SetCurrentPrinter(TInt aIndex)
+ {
+ iCurrentPrinter = aIndex;
+ }
+
+void CDirectPrintModel::SetCurrentBearer(TInt aIndex)
+ {
+ iCurrentBearer = aIndex;
+ }
+
+void CDirectPrintModel::SetCurrentProperty(TInt aIndex)
+ {
+ iCurrentProperty = aIndex;
+ }
+
+void CDirectPrintModel::SetSelectPrinter(TInt aIndex)
+ {
+ iSelectPrinter = aIndex;
+ }
+
+void CDirectPrintModel::AddPrinterDataL(const TDirectPrintPrinterData& aData)
+ {
+ iPrinters.AppendL(aData);
+ }
+
+void CDirectPrintModel::AddBearerDataL(const TDirectPrintBearerData& aData)
+ {
+ iBearers.AppendL(aData);
+ }
+
+void CDirectPrintModel::AddPrinterPropertyL(CPrinterProperty* aProperty)
+ {
+ iProperties.AppendL(aProperty);
+ }
+
+void CDirectPrintModel::RemovePrinterDataL(TInt aIndex)
+ {
+ if ((aIndex >= 0) && (iPrinters.Count() > aIndex))
+ {
+ iPrinters.Remove(aIndex);
+ }
+ }
+
+void CDirectPrintModel::RemoveBearerDataL(TInt aIndex)
+ {
+ if ((aIndex >= 0) && (iBearers.Count() > aIndex))
+ {
+ iBearers.Remove(aIndex);
+ }
+ }
+
+void CDirectPrintModel::RemovePrinterPropertyL(TInt aIndex)
+ {
+ if ((aIndex >= 0) && (iProperties.Count() > aIndex))
+ {
+ iProperties.Remove(aIndex);
+ }
+ }
+
+void CDirectPrintModel::MoveTopPrinterDataL(TInt aIndex)
+ {
+ if ((aIndex >= 0) && (iPrinters.Count() > aIndex))
+ {
+ TDirectPrintPrinterData data = iPrinters[aIndex];
+ iPrinters.Remove(aIndex);
+ iPrinters.Insert(data, 0);
+ }
+ iPrinterInfoReader->ReadPrinterInfoL();
+ }
+
+TUid CDirectPrintModel::SettingUIPluginUidL()
+ {
+ TDirectPrintPrinterData printer;
+ GetPrinterDataL(0, printer);
+
+ return iPrinterInfoReader->GetSettingUIPluginL(printer.iTypeName);
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/src/directprintmsgutil.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* This class is the message utility class of DirectPrint
+*
+*/
+
+#include <bautils.h>
+#include <eikenv.h>
+#include <s32file.h>
+#include <aknnotewrappers.h>
+#include <DirectPrintApp.rsg>
+
+#include "clog.h"
+#include "DirectPrintMsgUtil.h"
+
+CDirectPrintMsgUtil::CDirectPrintMsgUtil()
+ {
+ }
+
+CDirectPrintMsgUtil::~CDirectPrintMsgUtil()
+ {
+ }
+
+CDirectPrintMsgUtil* CDirectPrintMsgUtil::NewL()
+ {
+ CDirectPrintMsgUtil* self = CDirectPrintMsgUtil::NewLC();
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+CDirectPrintMsgUtil* CDirectPrintMsgUtil::NewLC()
+ {
+ CDirectPrintMsgUtil* self = new(ELeave) CDirectPrintMsgUtil();
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ return self;
+ }
+
+void CDirectPrintMsgUtil::ConstructL()
+ {
+ LOG("CDirectPrintMsgUtil::ConstructL BEGIN");
+
+ LOG("CDirectPrintMsgUtil::ConstructL END");
+ }
+
+// -----------------------------------------------------------------------------
+// Displays error note
+// -----------------------------------------------------------------------------
+//
+void CDirectPrintMsgUtil::DisplayErrorNoteL( TInt aResourceId )
+ {
+ HBufC* noteBuf = CCoeEnv::Static()->AllocReadResourceLC( aResourceId );
+ CAknErrorNote* errorNote = new( ELeave ) CAknErrorNote();
+ errorNote->ExecuteLD( *noteBuf );
+ CleanupStack::PopAndDestroy( noteBuf );
+ }
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/src/directprintprinterdata.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// INCLUDE FILES
+#include <s32strm.h>
+
+#include "directprintprinterdata.h"
+
+EXPORT_C void TDirectPrintPrinterData::InternalizeL(RReadStream& aStream)
+ {
+ iPrinterId = aStream.ReadInt32L();
+ TInt length = aStream.ReadInt32L();
+ if(length > 0)
+ {
+ aStream.ReadL(iPrinterName, length);
+ }
+ iPrinterDriver = TUid::Uid(aStream.ReadInt32L());
+ length = aStream.ReadInt32L();
+ if(length > 0)
+ {
+ aStream.ReadL(iDriverName, length);
+ }
+ iPrinterType = aStream.ReadInt32L();
+ length = aStream.ReadInt32L();
+ if(length > 0)
+ {
+ aStream.ReadL(iTypeName, length);
+ }
+ }
+
+EXPORT_C void TDirectPrintPrinterData::ExternalizeL(RWriteStream& aStream) const
+ {
+ aStream.WriteInt32L(iPrinterId);
+ aStream.WriteInt32L(iPrinterName.Length());
+ if (iPrinterName.Length() > 0)
+ {
+ aStream.WriteL(iPrinterName);
+ }
+ aStream.WriteInt32L(iPrinterDriver.iUid);
+ aStream.WriteInt32L(iDriverName.Length());
+ if (iDriverName.Length() > 0)
+ {
+ aStream.WriteL(iDriverName);
+ }
+ aStream.WriteInt32L(iPrinterType);
+ aStream.WriteInt32L(iTypeName.Length());
+ if (iTypeName.Length() > 0)
+ {
+ aStream.WriteL(iTypeName);
+ }
+ }
+
+EXPORT_C TDirectPrintPrinterData& TDirectPrintPrinterData::operator=(const TDirectPrintPrinterData& aData)
+ {
+ iPrinterId = aData.iPrinterId;
+ iPrinterName.Copy(aData.iPrinterName);
+ iPrinterDriver = aData.iPrinterDriver;
+ iDriverName.Copy(aData.iDriverName);
+ iPrinterType = aData.iPrinterType;
+ iTypeName.Copy(aData.iTypeName);
+ return *this;
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/src/directprintprinterinforeader.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,246 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// INCLUDE FILES
+#include <eikenv.h>
+#include <f32file.h>
+#include <xmlengelement.h>
+#include <xmlengattr.h>
+#include <xmlengnodelist.h>
+
+#include "DirectPrintModel.h"
+#include "directprintprinterinforeader.h"
+
+CDirectPrintPrinterInfoReader::CDirectPrintPrinterInfoReader(CDirectPrintModel& aModel)
+ : iModel(aModel)
+ {
+ }
+
+CDirectPrintPrinterInfoReader::~CDirectPrintPrinterInfoReader()
+ {
+ if (iXmlEngDoc.NotNull())
+ {
+ iXmlEngDoc.Close();
+ iXmlParser.Close();
+ iXmlDomImpl.Close();
+ }
+ }
+
+CDirectPrintPrinterInfoReader* CDirectPrintPrinterInfoReader::NewL(CDirectPrintModel& aModel)
+ {
+ CDirectPrintPrinterInfoReader* self = CDirectPrintPrinterInfoReader::NewLC(aModel);
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+CDirectPrintPrinterInfoReader* CDirectPrintPrinterInfoReader::NewLC(CDirectPrintModel& aModel)
+ {
+ CDirectPrintPrinterInfoReader* self = new(ELeave) CDirectPrintPrinterInfoReader(aModel);
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ return self;
+ }
+
+void CDirectPrintPrinterInfoReader::ConstructL()
+ {
+ iXmlDomImpl.OpenL();
+ TInt err = iXmlParser.Open(iXmlDomImpl);
+ User::LeaveIfError(err);
+ }
+
+void CDirectPrintPrinterInfoReader::ReadPrinterInfoL()
+ {
+ TDirectPrintPrinterData printer;
+ iModel.GetPrinterDataL(0, printer);
+
+ _LIT( KFilePath, "c:\\printers\\*.xml");
+ _LIT( KFilePathFormat, "c:\\printers\\%S");
+
+ CDir* fileList;
+ const TUint KMask = KEntryAttNormal|KEntryAttReadOnly|KEntryAttHidden|KEntryAttSystem;
+ User::LeaveIfError(CEikonEnv::Static()->FsSession().GetDir(KFilePath, KMask, ESortByName, fileList));
+ CleanupStack::PushL(fileList);
+
+ TInt count = fileList->Count();
+ for (TInt i=0; i<count; i++)
+ {
+ TFileName filename;
+ filename.Format(KFilePathFormat, &(*fileList)[i].iName);
+ ReadXmlDataL(filename);
+
+ // Check XML file for current printer driver
+ if (CheckManufactureL(printer.iDriverName))
+ {
+ break;
+ }
+ else
+ {
+ iXmlEngDoc.Close();
+ }
+ }
+
+ CleanupStack::PopAndDestroy(); // fileList
+ }
+
+void CDirectPrintPrinterInfoReader::GetManufactureL(TDes& aManufacture)
+ {
+ if (iXmlEngDoc.NotNull())
+ {
+ _LIT8(KElementManufacture, "Manufacture");
+
+ TXmlEngElement element = iXmlEngDoc.DocumentElement().FirstChild().AsElement();
+
+ while (element.NotNull())
+ {
+ TBuf<50> elementName;
+ elementName.Copy(element.Name());
+ if (element.Name().CompareF(KElementManufacture()) == 0)
+ {
+ aManufacture.Copy(element.Value());
+ break;
+ }
+
+ element = element.NextSibling().AsElement();
+ }
+ }
+ }
+
+TUid CDirectPrintPrinterInfoReader::GetDriverL(TDesC& aId)
+ {
+ TUint uidValue = 0;
+
+ if (iXmlEngDoc.NotNull())
+ {
+ _LIT8(KElementPrinters, "Printers");
+ _LIT8(KElementPrinter, "Printer");
+ _LIT8(KElementDriver, "Driver");
+ _LIT8(KAttributeId, "id");
+
+ TXmlEngElement element = iXmlEngDoc.DocumentElement().FirstChild().AsElement();
+
+ while (element.NotNull())
+ {
+ TBuf<50> elementName;
+ elementName.Copy(element.Name());
+ if (element.Name().CompareF(KElementPrinters()) == 0)
+ {
+ element = element.FirstChild().AsElement();
+ }
+ else if (element.Name().CompareF(KElementPrinter()) == 0)
+ {
+ TBool next = EFalse;
+ TBuf<50> attrValue;
+ TXmlEngAttr attr = element.AttributeNodeL(KAttributeId);
+ attrValue.Copy(attr.Value());
+ if (aId.CompareF(attrValue) == 0)
+ {
+ element = element.FirstChild().AsElement();
+ next = ETrue;
+ }
+
+ if (!next)
+ {
+ element = element.NextSibling().AsElement();
+ }
+ }
+ else if (element.Name().CompareF(KElementDriver()) == 0)
+ {
+ TLex8 lex(element.Value());
+ lex.Val(uidValue, EHex);
+ break;
+ }
+ else
+ {
+ element = element.NextSibling().AsElement();
+ }
+ }
+ }
+
+ return TUid::Uid(uidValue);
+ }
+
+TUid CDirectPrintPrinterInfoReader::GetSettingUIPluginL(TDesC& aId)
+ {
+ TUint uidValue = 0;
+
+ if (iXmlEngDoc.NotNull())
+ {
+ _LIT8(KElementPrinters, "Printers");
+ _LIT8(KElementPrinter, "Printer");
+ _LIT8(KElementSettingUIPlugin, "SettingUIPlugin");
+ _LIT8(KAttributeId, "id");
+
+ TXmlEngElement element = iXmlEngDoc.DocumentElement().FirstChild().AsElement();
+
+ while (element.NotNull())
+ {
+ if (element.Name().CompareF(KElementPrinters()) == 0)
+ {
+ element = element.FirstChild().AsElement();
+ }
+ else if (element.Name().CompareF(KElementPrinter()) == 0)
+ {
+ TBool next = EFalse;
+ TBuf<50> attrValue;
+ TXmlEngAttr attr = element.AttributeNodeL(KAttributeId);
+ attrValue.Copy(attr.Value());
+ if (aId.CompareF(attrValue) == 0)
+ {
+ element = element.FirstChild().AsElement();
+ next = ETrue;
+ }
+
+ if (!next)
+ {
+ element = element.NextSibling().AsElement();
+ }
+ }
+ else if (element.Name().CompareF(KElementSettingUIPlugin()) == 0)
+ {
+ TLex8 lex(element.Value());
+ lex.Val(uidValue, EHex);
+ break;
+ }
+
+ element = element.NextSibling().AsElement();
+ }
+ }
+
+ return TUid::Uid(uidValue);
+ }
+
+void CDirectPrintPrinterInfoReader::ReadXmlDataL(const TDesC& aFilename)
+ {
+ if (iXmlEngDoc.NotNull())
+ {
+ iXmlEngDoc.Close();
+ }
+ iXmlEngDoc = iXmlParser.ParseFileL(aFilename);
+ }
+
+TBool CDirectPrintPrinterInfoReader::CheckManufactureL(const TDesC& aParam)
+ {
+ TBool res = EFalse;
+ TBuf<50> buf;
+ GetManufactureL(buf);
+ if (aParam.Compare(buf) == 0)
+ {
+ res = ETrue;
+ }
+ return res;
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/src/directprintproperty.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// INCLUDE FILES
+#include <s32strm.h>
+
+#include "directprintproperty.h"
+
+EXPORT_C CPrinterProperty::CPrinterProperty()
+ {
+ }
+
+EXPORT_C CPrinterProperty::~CPrinterProperty()
+ {
+ iPropertyItems.Close();
+ }
+
+EXPORT_C void CPrinterProperty::InternalizeL(RReadStream& aStream)
+ {
+ iPrinterId = aStream.ReadInt32L();
+ iApplicationId = aStream.ReadInt32L();
+ iPropertyItems.Reset();
+ TInt count = aStream.ReadInt32L();
+ for (TInt i=0; i<count; i++)
+ {
+ TDirectPrintPropertyData item;
+ item.InternalizeL(aStream);
+ iPropertyItems.Append(item);
+ }
+ }
+
+EXPORT_C void CPrinterProperty::ExternalizeL(RWriteStream& aStream) const
+ {
+ aStream.WriteInt32L(iPrinterId);
+ aStream.WriteInt32L(iApplicationId);
+ TInt count = iPropertyItems.Count();
+ aStream.WriteInt32L(count);
+ for (TInt i=0; i<count; i++)
+ {
+ iPropertyItems[i].ExternalizeL(aStream);
+ }
+ }
+
+EXPORT_C CPrinterProperty& CPrinterProperty::operator=(const CPrinterProperty& aProperty)
+ {
+ iPrinterId = aProperty.iPrinterId;
+ iApplicationId = aProperty.iApplicationId;
+ iPropertyItems.Reset();
+ TInt count = aProperty.iPropertyItems.Count();
+ for (TInt i=0; i<count; i++)
+ {
+ iPropertyItems.Append(aProperty.iPropertyItems[i]);
+ }
+ return *this;
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/src/directprintuipluginmgr.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* This class for DirectPrint UI_Plugin managemrnt
+*
+*/
+
+// User includes
+#include "DirectPrintUiPluginMgr.h"
+#include "DirectPrintModel.h"
+#include "DirectPrintUiPlugin.h"
+#include "directprintprinterdata.h"
+
+CDirectPrintUiPluginMgr::CDirectPrintUiPluginMgr(CDirectPrintModel& aModel)
+ : iModel(aModel)
+ , iPlugin(NULL)
+ {
+ }
+
+CDirectPrintUiPluginMgr::~CDirectPrintUiPluginMgr()
+ {
+ delete iPlugin;
+ }
+
+CDirectPrintUiPluginMgr* CDirectPrintUiPluginMgr::NewL(CDirectPrintModel& aModel)
+ {
+ CDirectPrintUiPluginMgr* self = CDirectPrintUiPluginMgr::NewLC(aModel);
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+CDirectPrintUiPluginMgr* CDirectPrintUiPluginMgr::NewLC(CDirectPrintModel& aModel)
+ {
+ CDirectPrintUiPluginMgr* self = new(ELeave) CDirectPrintUiPluginMgr(aModel);
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ return self;
+ }
+
+void CDirectPrintUiPluginMgr::ConstructL()
+ {
+ iCurrentPluginUid = TUid::Uid(0);
+ }
+
+void CDirectPrintUiPluginMgr::LoadPluginL(TUid aUid)
+ {
+ delete iPlugin;
+ iPlugin = NULL;
+ if (aUid.iUid > 0)
+ {
+ iPlugin = CDirectPrintUiPlugin::NewL(aUid);
+ }
+ }
+
+void CDirectPrintUiPluginMgr::LoadPluginL(const TDesC8& aKey)
+ {
+ delete iPlugin;
+ iPlugin = NULL;
+ if (aKey.Length() > 0)
+ {
+ iPlugin = CDirectPrintUiPlugin::NewL(aKey);
+ }
+ }
+
+CDirectPrintUiPlugin* CDirectPrintUiPluginMgr::CurrentPluginL()
+ {
+ TUid uid = iModel.SettingUIPluginUidL();
+ if (iCurrentPluginUid != uid)
+ {
+ LoadPluginL(uid);
+ iCurrentPluginUid = uid;
+ }
+
+ return iPlugin;
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/ui/inc/directprintlistbox.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,128 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef __DIRECTPRINTLISTBOX_H__
+#define __DIRECTPRINTLISTBOX_H__
+
+// System includes
+#include <aknlists.h>
+
+// User includes
+#include "DirectPrintListObserver.h"
+
+// Class declaration
+/**
+ * Listbox class
+ * more_complete_description
+ */
+class CDirectPrintListBox : public CCoeControl, public MEikListBoxObserver
+ {
+public:
+ // Data types
+ /** The index of controls */
+ enum TControls
+ {
+ EListBox = 0,
+ ELastControl
+ };
+
+public:
+ /** Constructors */
+ static CDirectPrintListBox* NewL(const TRect& aRect, CDesCArray* aItemArray);
+ static CDirectPrintListBox* NewLC(const TRect& aRect, CDesCArray* aItemArray);
+ /** Destructor */
+ virtual ~CDirectPrintListBox();
+
+public:
+ /**
+ * From CCoeControl.
+ * Get count of component controls.
+ *
+ * @return Count of component controls.
+ */
+ TInt CountComponentControls() const;
+ /**
+ * From CCoeControl.
+ * Get component controls.
+ *
+ * @param aIndex The index of controls
+ * @return Component control.
+ */
+ CCoeControl* ComponentControl( TInt aIndex ) const;
+
+public:
+ /**
+ * From MEikListBoxObserver.
+ * Handles listbox events.
+ *
+ * @param aListBox Pointer to listbox control.
+ * @param aEventType Event type.
+ */
+ void HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType);
+
+public: // New Function
+ /**
+ * Set listbox items.
+ *
+ * @param aItemArray Pointer to item array.
+ */
+ void SetItemL(CDesCArray* aItemArray);
+ /**
+ * Set list observer.
+ *
+ * @param aObserver Pointer to list observer.
+ */
+ void SetListObserver(MDirectPrintListObserver* aObserver);
+ /**
+ * Delete current item from listbox.
+ *
+ * @return Result value.
+ */
+ TInt DeleteCurrentItemL();
+ /**
+ * redraw listbox.
+ */
+ void RedrawListL();
+ /**
+ * Get the index of current item.
+ *
+ * @return The index of current listbox item.
+ */
+ TInt CurrentIndex();
+ /**
+ * Set focus.
+ *
+ * @param aIndex The index of listbox item
+ */
+ void SetFocusL(TInt aIndex);
+
+private:
+ CDirectPrintListBox();
+ void ConstructL(const TRect& aRect, CDesCArray* aItemArray);
+
+ void InitializeControlsL();
+
+private:
+ /** Listbox control. */
+ CAknDoubleStyleListBox* iListBox; // Owend Data
+ /** Pointer to list observer. */
+ MDirectPrintListObserver* iListObserver;
+ };
+
+#endif // __DIRECTPRINTLISTBOX_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/ui/inc/directprintlistobserver.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef __DIRECTPRINTLISTOBSERVER_H__
+#define __DIRECTPRINTLISTOBSERVER_H__
+
+// Class declaration
+/**
+ * List observer mix-in class
+ * more_complete_description
+ */
+class MDirectPrintListObserver
+ {
+public:
+ /**
+ * Handles index.
+ *
+ * @param aIndex The index of selected item.
+ */
+ virtual void HandleListIndexL(TInt aIndex) = 0;
+ };
+
+#endif // __DIRECTPRINTLISTOBSERVER_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/ui/inc/directprintlistview.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,90 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef __PRINTERLISTVIEW_H__
+#define __PRINTERLISTVIEW_H__
+
+// System includes
+#include <aknlists.h>
+#include <akntoolbarobserver.h>
+
+// User includes
+#include "DirectPrintViewBase.h"
+#include "DirectPrintListBox.h"
+
+// Class declaration
+/**
+ * List view class
+ * more_complete_description
+ */
+class CDirectPrintListView : public CDirectPrintViewBase, public MAknToolbarObserver
+ {
+public:
+ /** Constructors */
+ static CDirectPrintListView* NewL();
+ static CDirectPrintListView* NewLC();
+ /** Destructor */
+ ~CDirectPrintListView();
+
+public:
+ /**
+ * From CAknView.
+ * Handles user commands.
+ *
+ * @param aCommand The id of commands.
+ */
+ void HandleCommandL(TInt aCommand);
+
+public:
+ /**
+ * From MDirectPrintListObserver.
+ * Handles index.
+ *
+ * @param aIndex The index of list items.
+ */
+ void HandleListIndexL(TInt aIndex);
+
+public: // from MAknToolbarObserver
+ /**
+ * From MAknToolbarObserver.
+ * Handles user commands.
+ *
+ * @param aCommand The id of commands.
+ */
+ void OfferToolbarEventL(TInt aCommand);
+
+protected: // from CAknView
+ void DoActivateL(const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage);
+ void DoDeactivate();
+
+private:
+ CDirectPrintListView();
+ void ConstructL();
+
+ void LoadListDataL();
+ void PrepareNewDataL();
+
+private:
+ /** Pointer to listbox. */
+ CDirectPrintListBox* iListBox; // Owend Data
+ /** Pointer to item array. */
+ CDesCArray* iItemArray;
+ };
+
+#endif // __PRINTERLISTVIEW_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/ui/inc/directprintmainview.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,100 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef __PRINTMAINVIEW_H__
+#define __PRINTMAINVIEW_H__
+
+// System includes
+#include <aknlists.h>
+#include <akntoolbarobserver.h>
+
+// User includes
+#include "DirectPrintViewBase.h"
+#include "DirectPrintListBox.h"
+
+// Class declaration
+/**
+ * Main view class
+ * more_complete_description
+ */
+class CDirectPrintMainView : public CDirectPrintViewBase, public MAknToolbarObserver
+ {
+private:
+ // Data types
+ /** The index of list items */
+ enum
+ {
+ EItemPrinter,
+ EItemBearer,
+ EItemSetting
+ };
+
+public:
+ /** Constructors */
+ static CDirectPrintMainView* NewL();
+ static CDirectPrintMainView* NewLC();
+ /** Destructor */
+ ~CDirectPrintMainView();
+
+public: // from CAknView
+ /**
+ * From CAknView.
+ * Handles user commands.
+ *
+ * @param aCommand The id of commands.
+ */
+ void HandleCommandL(TInt aCommand);
+
+public:
+ /**
+ * From MDirectPrintListObserver.
+ * Handles index.
+ *
+ * @param aIndex The index of list items.
+ */
+ void HandleListIndexL(TInt aIndex);
+
+public:
+ /**
+ * From MAknToolbarObserver.
+ * Handles user commands.
+ *
+ * @param aCommand The id of commands.
+ */
+ void OfferToolbarEventL(TInt aCommand);
+
+protected: // from CAknView
+ void DoActivateL(const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage);
+ void DoDeactivate();
+
+private:
+ CDirectPrintMainView();
+ void ConstructL();
+
+ void LoadListDataL();
+ void MakePropertyStringL(TDes& aProperty);
+
+private:
+ /** Pointer to listbox. */
+ CDirectPrintListBox* iListBox; // Owend Data
+ /** Pointer to item array. */
+ CDesCArray* iItemArray;
+ };
+
+#endif // __PRINTMAINVIEW_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/ui/inc/directprintpreviewcontrol.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,254 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef __DIRECTPRINTPREVIEWCONTROL_H__
+#define __DIRECTPRINTPREVIEWCONTROL_H__
+
+// System includes
+#include <eikbctrl.h>
+#include <prnprev.h>
+
+// Forward declarations
+class CPrintSetup;
+class TPrintPreviewFormat;
+class MPageRegionPrinter;
+class MPrintProcessObserver;
+
+// Class declaration
+/**
+ * Preview control class
+ * more_complete_description
+ */
+class CDirectPrintPreviewControl : public CEikBorderedControl
+ , public MCoeControlObserver
+ {
+public:
+ // Data types
+ /** The index of zoom level */
+ enum TPreviewZoomLevel
+ {
+ EPreviewZoomLevel1, // display into view area
+ EPreviewZoomLevel2,
+ EPreviewZoomLevel3,
+ EPreviewZoomLevel4,
+ EPreviewZoomLevel5,
+ EPreviewZoomLevelMax
+ };
+
+public:
+ /** Constructors */
+ static CDirectPrintPreviewControl* NewL(const CCoeControl* aParent);
+ static CDirectPrintPreviewControl* NewLC(const CCoeControl* aParent);
+ /** Destructor */
+ virtual ~CDirectPrintPreviewControl();
+
+public:
+ /**
+ * Set observer.
+ *
+ * @param aObserver Pointer to observer.
+ */
+ void SetPreviewImageObserver(MPrintProcessObserver* aObserver);
+
+ /**
+ * Initialize display format.
+ *
+ * @param aPrintSetup Setup information.
+ * @param aBodyPrinter Body printer.
+ * @param aFormat Display format information.
+ * @param aNumPagesInDoc Number of all pages.
+ * @param aFirstPageToDisplay Page number of first display.
+ * @param aNumPagesToView Number of pages to view.
+ * @param aMarginState Margin information.
+ */
+ void InitializeFormat( CPrintSetup& aPrintSetup,
+ MPageRegionPrinter& aBodyPrinter,
+ TPrintPreviewFormat& aFormat,
+ TInt& aNumPagesInDoc,
+ TInt& aFirstPageToDisplay,
+ TInt aNumPagesToView,
+ CPrintPreviewImage::TMarginState& aMarginState);
+ /**
+ * Set display format.
+ *
+ * @param aFirstPageToDisplay Page number of first display.
+ * @param aNumPagesToView Count of pages to view.
+ */
+ void SetFormatAndDrawL(TInt& aFirstPageToDisplay,TInt& aNumPagesToView);
+ /**
+ * Set margin.
+ *
+ * @param aMarginState Margin information.
+ */
+ void SetMarginAndDrawL(CPrintPreviewImage::TMarginState aMarginState);
+ /**
+ * Set number of bands.
+ *
+ * @param aNumBands Number of bands.
+ */
+ void SetNumBands(TInt aNumBands);
+ /**
+ * Set page number.
+ *
+ * @param aNumPagesInDoc Number of all pages.
+ * @param aFirstPageToDisplay Page number of first display.
+ * @param aNumPagesToView Number of pages to view.
+ */
+ void SetNumPagesInDoc(TInt aNumPagesInDoc,TInt aFirstPageToDisplay,TInt aNumPagesToView);
+
+public: // from CCoeControl
+ /**
+ * From CCoeControl.
+ * Activate.
+ */
+ void ActivateL();
+ /**
+ * From CCoeControl.
+ * Draw display.
+ *
+ * @param aRect Rect to draw.
+ */
+ void Draw(const TRect& aRect) const;
+
+ /**
+ * From CCoeControl.
+ * Handles key events.
+ *
+ * @param aKeyEvent The code of key event.
+ * @param aType The code of event.
+ * @return The code of key response.
+ */
+ TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
+ /**
+ * From CCoeControl.
+ * Constructor.
+ *
+ * @param aReader ResourceReader.
+ */
+// void ConstructFromResourceL(TResourceReader& aReader);
+ /**
+ * Set flag.
+ *
+ * @param aDraw Draw flag.
+ */
+ void SetDrawFlag(TBool aDraw);
+ /**
+ * Get flag.
+ *
+ * @return Draw flag.
+ */
+ TBool DrawFlag();
+ /**
+ * From CCoeControl.
+ * Get input capabilities.
+ *
+ * @return Input capabilities.
+ */
+ TCoeInputCapabilities InputCapabilities() const;
+
+ // for zoom
+ /**
+ * Set zoom level.
+ *
+ * @param aZoomLevel Zoom level.
+ */
+ void SetZoomLevel(TInt aZoomLevel);
+ /**
+ * Get zoom level.
+ *
+ * @return Zoom level.
+ */
+ TInt GetZoomLebel();
+ /**
+ * Increment zoom level.
+ */
+ void IncrementZoomLevel();
+ /**
+ * Decrement zoom level.
+ */
+ void DecrementZoomLevel();
+
+protected: // from CCoeControl
+ void SizeChanged();
+ TInt CountComponentControls() const;
+ CCoeControl* ComponentControl(TInt aIndex) const;
+
+ void WriteInternalStateL(RWriteStream& aWriteStream) const;
+
+ /**
+ * From CoeControl, HandlePointerEventL.
+ * Called by framework when a pointer touch event occurs.
+ * Note: although this method is compatible with earlier SDKs,
+ * it will not be called in SDKs without Touch support.
+ * @param aPointerEvent the information about this event
+ */
+ virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent);
+
+private: // from CCoeControl
+// void SetContainerWindowL(const CCoeControl& aParent);
+
+private: // from MCoeControlObserver
+ void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEvent);
+
+private:
+ CDirectPrintPreviewControl();
+ void ConstructL(const CCoeControl* aParent);
+
+private:
+ void CreateScrollButtonsL();
+ void DrawPreview(const TRect& aRect);
+ void SwitchFirstPageToDisplayL(TInt& aNewFirstPageToDisplay);
+ void DrawButtons() const;
+ void SetZoomLevelAndDispalyRect(TInt aZoomLevel);
+ void CreatePreviewImageL();
+
+private:
+ /** Pointer to button controls. */
+// CEikScrollButton* iButton[2];
+ /** Pointer to image. */
+ CPrintPreviewImage* iPreview;
+ /** Pointer to setup information. */
+ CPrintSetup* iPrintSetup;
+ /** Pointer to body printer. */
+ MPageRegionPrinter* iBodyPrinter;
+ /** Pointer to format information. */
+ TPrintPreviewFormat* iPrintPreviewFormat;
+ /** Pointer to page number. */
+ TInt* iFirstPageToDisplay;
+ /** Number of all pages. */
+ TInt iNumPagesInDoc;
+ /** Number of pages to view. */
+ TInt iNumPagesToView;
+ /** Number of bands. */
+ TInt iNumBands;
+ /** Margin information. */
+ CPrintPreviewImage::TMarginState iMarginState;
+ /** Display rect. */
+ TRect iDisplayRect;
+ /** Draw flag. */
+ TBool iPreviewDraw;
+ /** Display point. */
+ TPoint iDisplayPoint;
+ /** Position of pointer. */
+ TPoint iPointerDownPos;
+ /** Zoom level. */
+ TInt iZoomLevel; // set TPreviewZoomLevel
+ };
+
+#endif // __DIRECTPRINTPREVIEWCONTROL_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/ui/inc/directprintpreviewview.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef __PREVIEWVIEW_H__
+#define __PREVIEWVIEW_H__
+
+// System includes
+#include <aknview.h>
+#include <akntoolbarobserver.h>
+#include <prninf.h>
+#include <PRNPREV.H>
+
+// User includes
+#include "DirectPrintViewBase.h"
+
+// Forward declarations
+class CDirectPrintPreviewControl;
+
+// Class declaration
+/**
+ * Preview view class
+ * more_complete_description
+ */
+class CDirectPrintPreviewView : public CDirectPrintViewBase
+ , public MAknToolbarObserver
+ , public MPrintProcessObserver
+ {
+public:
+ /** Constructors */
+ static CDirectPrintPreviewView* NewL();
+ static CDirectPrintPreviewView* NewLC();
+ /** Destructor */
+ ~CDirectPrintPreviewView();
+
+public:
+ /**
+ * From CAknView.
+ * Handles user commands.
+ *
+ * @param aCommand The id of commands.
+ */
+ void HandleCommandL(TInt aCommand);
+ /**
+ * From CAknView.
+ * Get the id of view.
+ *
+ * @return The id of view.
+ */
+ TUid Id() const;
+
+protected: // from CAknView
+ void DoActivateL(const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage);
+ void DoDeactivate();
+
+public:
+ /**
+ * From MAknToolbarObserver.
+ * Handles user commands.
+ *
+ * @param aCommand The id of commands.
+ */
+ void OfferToolbarEventL(TInt aCommand);
+
+private: // from MPrintProcessObserver
+ void NotifyPrintStarted(TPrintParameters aPrintParams);
+ void NotifyPrintEnded(TInt anErrorCode);
+ void NotifyBandPrinted(TInt aPercentageOfPagePrinted, TInt aCurrentPageNum, TInt aCurrentCopyNum);
+
+private:
+ CDirectPrintPreviewView();
+ void ConstructL();
+
+ void ChangeVisibleState();
+
+private:
+ /** Pointer to preview control. */
+ CDirectPrintPreviewControl* iPrevCtrl;
+
+ /** Parameter. */
+ TPrintParameters iParameters;
+ /** Preview format. */
+ TPrintPreviewFormat iPrintPreviewFormat;
+ /** Number of pages in document. */
+ TInt iNumPagesInDoc;
+ /** Display flag. */
+ TInt iFirstPageToDisplay;
+ /** Number of pages. */
+ TInt iNumPagesToView;
+ /** Number of bands. */
+ TInt iNumBands;
+ /** Margin state. */
+ CPrintPreviewImage::TMarginState iMarginState;
+ };
+
+#endif // __PREVIEWVIEW_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/ui/inc/directprintpropertyview.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,137 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef __DIRECTPRINTPROPERTYVIEW_H__
+#define __DIRECTPRINTPROPERTYVIEW_H__
+
+// System includes
+#include <aknlists.h>
+#include <akntoolbarobserver.h>
+
+// User includes
+#include "DirectPrintViewBase.h"
+#include "directprintsettinglistbox.h"
+
+// Class declaration
+/**
+ * Property view class
+ * more_complete_description
+ */
+class CDirectPrintPropertyView : public CDirectPrintViewBase, public MAknToolbarObserver
+ {
+public:
+ /** Constructors */
+ static CDirectPrintPropertyView* NewL();
+ static CDirectPrintPropertyView* NewLC();
+ /** Destructor */
+ ~CDirectPrintPropertyView();
+
+public:
+ /**
+ * From CAknView.
+ * Handles user commands.
+ *
+ * @param aCommand The id of commands.
+ */
+ void HandleCommandL(TInt aCommand);
+
+public:
+ /**
+ * From MAknToolbarObserver.
+ * Handles user commands.
+ *
+ * @param aCommand The id of commands.
+ */
+ void OfferToolbarEventL(TInt aCommand);
+
+public: // New function
+ /**
+ * Process by change tab.
+ *
+ * @param aTabIndex The index of tab.
+ */
+ void ChangeTabL(TInt aTabIndex);
+
+protected: // from CAknView
+ void DoActivateL(const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage);
+ void DoDeactivate();
+
+private:
+ CDirectPrintPropertyView();
+ void ConstructL();
+
+ void LoadListL();
+ void ReadDataL();
+ void WriteDataL();
+ void NewDataL();
+
+ void LoadPaperTabL();
+ void LoadPageTabL();
+ void LoadMarginTabL();
+ void LoadHeaderTabL();
+ void LoadFooterTabL();
+
+private:
+ /** Pointer to listbox. */
+ CDirectPrintSettingListBox* iListBox;
+ /** Index of paper size setting. */
+ TInt iPaperSize;
+ /** Index of orientation setting. */
+ TInt iOrientation;
+ /** Paper hight. */
+ TInt iHight;
+ /** Paper width. */
+ TInt iWidth;
+ /** Index of media type setting. */
+ TInt iMediaType;
+ /** Index of print page setting. */
+ TInt iPrintPage;
+ /** Print range. */
+ TBuf<50> iPrintRange;
+ /** Number of copies. */
+ TInt iCopy;
+ /** Left margin. */
+ TInt iLeftMargin;
+ /** Right margin. */
+ TInt iRightMargin;
+ /** Top margin. */
+ TInt iTopMargin;
+ /** Bottom margin. */
+ TInt iBottomMargin;
+ /** Header text. */
+ TBuf<50> iHeaderText;
+ /** Distance of header. */
+ TInt iHeaderDistance;
+ /** First page flag. */
+ TInt iHeaderFirstPage;
+ /** Footer text. */
+ TBuf<50> iFooterText;
+ /** Distance of footer. */
+ TInt iFooterDistance;
+ /** First page flag. */
+ TInt iFooterFirstPage;
+
+ /** Boaderless flag. */
+ TInt iBoaderless;
+
+ /** Index of tab. */
+ TInt iTabIndex;
+ };
+
+#endif // __DIRECTPRINTPROPERTYVIEW_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/ui/inc/directprintsearchresultview.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,125 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef __SEARCHRESULTVIEW_H__
+#define __SEARCHRESULTVIEW_H__
+
+// System includes
+#include <aknlists.h>
+#include <akntoolbarobserver.h>
+#include <AknProgressDialog.h> // CAknProgressDialog
+#include <EIKPROGI.H>
+
+// User includes
+#include "DirectPrintViewBase.h"
+#include "DirectPrintListBox.h"
+
+// Class declaration
+/**
+ * Search result view class
+ * more_complete_description
+ */
+class CDirectPrintSearchResultView : public CDirectPrintViewBase
+ , public MAknToolbarObserver
+ , public MProgressDialogCallback
+ {
+public:
+ /** Constructors */
+ static CDirectPrintSearchResultView* NewL();
+ static CDirectPrintSearchResultView* NewLC();
+ /** Destructor */
+ ~CDirectPrintSearchResultView();
+
+public:
+ /**
+ * From CAknView.
+ * Handles user commands.
+ *
+ * @param aCommand The id of commands.
+ */
+ void HandleCommandL(TInt aCommand);
+
+public:
+ /**
+ * From MDirectPrintListObserver.
+ * Handles index.
+ *
+ * @param aIndex The index of list items.
+ */
+ void HandleListIndexL(TInt aIndex);
+
+public:
+ /**
+ * From MAknToolbarObserver.
+ * Handles user commands.
+ *
+ * @param aCommand The id of commands.
+ */
+ void OfferToolbarEventL(TInt aCommand);
+
+public: // from MProgressDialogCallback
+ /**
+ * DialogDismissedL
+ * Called when/if the dialog has been dismissed.
+ * @param aButtonId
+ */
+ void DialogDismissedL( TInt aButtonId );
+
+protected: // from CAknView
+ void DoActivateL(const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage);
+ void DoDeactivate();
+
+private:
+ CDirectPrintSearchResultView();
+ void ConstructL();
+
+ void StartSearchProgressNoteL();
+ void EndProgressNoteL();
+
+ void StartSearchL();
+
+ static TInt HandleTimeout(TAny* aAny);
+ void HandleTimeoutL();
+
+private:
+ /** Pointer to listbox. */
+ CDirectPrintListBox* iListBox; // Owend Data
+ /** Pointer to array. */
+ CDesCArray* iItemArray;
+
+ /**
+ * iProgressDialog
+ * Owned
+ */
+ CAknProgressDialog* iProgressDialog;
+ /**
+ * iProgressInfo
+ * Not owned by CAknExNoteContainer object.
+ */
+ CEikProgressInfo* iProgressInfo;
+ /** Pointer to progress message. */
+ HBufC* iProgressMessage;
+ /** Pointer to periodic timer object. */
+ CPeriodic* iPeriodic;
+
+ /** Count of timeout. */
+ TInt iTimeoutCount;
+ };
+
+#endif // __SEARCHRESULTVIEW_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/ui/inc/directprintsettinglistbox.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef __DIRECTPRINTSETTINGLISTBOX_H__
+#define __DIRECTPRINTSETTINGLISTBOX_H__
+
+// System includes
+#include <aknsettingitemlist.h>
+
+// User includes
+#include "directprintsettinglistobserver.h"
+
+// Class declaration
+/**
+ * Setting listbox class
+ * more_complete_description
+ */
+class CDirectPrintSettingListBox : public CAknSettingItemList
+ {
+public:
+ /** Constructors */
+ static CDirectPrintSettingListBox* NewL(const TRect& aRect);
+ static CDirectPrintSettingListBox* NewLC(const TRect& aRect);
+ /** Destructor */
+ virtual ~CDirectPrintSettingListBox();
+
+public: // from CAknSettingItemList
+// CAknSettingItem* CreateSettingItemL(TInt identifier);
+ /**
+ * Set focus.
+ *
+ * @param aIndex The index of listbox item
+ * @param aCalledFromMenu The flag of called from menu
+ */
+ void EditItemL(TInt aIndex, TBool aCalledFromMenu);
+
+public: // New function
+ /**
+ * Set list observer.
+ *
+ * @param aObserver Pointer to list observer.
+ */
+ void SetSettingListObserver(MDirectPrintSettingListObserver* aObserver);
+
+private:
+ CDirectPrintSettingListBox();
+ void ConstructL(const TRect& aRect);
+
+private:
+ /** Pointer to list observer. */
+ MDirectPrintSettingListObserver* iObserver;
+ };
+
+#endif // __DIRECTPRINTSETTINGLISTBOX_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/ui/inc/directprintsettinglistobserver.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef __DIRECTPRINTSETTINGLISTOBSERVER_H__
+#define __DIRECTPRINTSETTINGLISTOBSERVER_H__
+
+// Class declaration
+/**
+ * Setting list observer mix-in class
+ * more_complete_description
+ */
+class MDirectPrintSettingListObserver
+ {
+public:
+ /**
+ * Handles index.
+ *
+ * @param aIndex The index of selected item.
+ * @param aChanged The flag of change data.
+ */
+ virtual void HandleEditItemL(TInt aIndex, TBool aChanged) = 0;
+ };
+
+#endif // __DIRECTPRINTSETTINGLISTOBSERVER_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/ui/inc/directprintsettingview.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,153 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef __PRINTERSETTINGVIEW_H__
+#define __PRINTERSETTINGVIEW_H__
+
+// System includes
+#include <aknlists.h>
+#include <aknsettingitemlist.h>
+
+// User includes
+#include "DirectPrintViewBase.h"
+#include "directprintsettinglistbox.h"
+#include "directprintselectitem.h"
+
+// Forward declarations
+class CDirectPrintBearerMgr;
+
+// Class declaration
+/**
+ * Printer setting view class
+ * more_complete_description
+ */
+class CDirectPrintPrinterSettingView : public CDirectPrintViewBase
+ {
+public:
+ enum TListItemIndex
+ {
+ ESettingViewItemPrinterName = 1,
+ ESettingViewItemDriver,
+ ESettingViewItemType,
+ ESettingViewItemBearer,
+ ESettingViewItemExtent
+ };
+
+public:
+ /** Constructors */
+ static CDirectPrintPrinterSettingView* NewL();
+ static CDirectPrintPrinterSettingView* NewLC();
+ /** Destructor */
+ ~CDirectPrintPrinterSettingView();
+
+public:
+ /**
+ * From CAknView.
+ * Handles user commands.
+ *
+ * @param aCommand The id of commands.
+ */
+ void HandleCommandL(TInt aCommand);
+
+public:
+ /**
+ * Handles index.
+ *
+ * @param aIndex The index of selected item.
+ * @param aChanged The flag of change data.
+ */
+ void HandleEditItemL(TInt aIndex, TBool aChanged);
+
+protected: // from CAknView
+ void DoActivateL(const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage);
+ void DoDeactivate();
+
+private:
+ CDirectPrintPrinterSettingView();
+ void ConstructL();
+
+ void LoadListL();
+ void LoadExtendListL();
+ void ReloadListL();
+ void SetBearerListL(CAknEnumeratedTextPopupSettingItem* item);
+
+ void ReadDataL();
+ void WriteDataL();
+ void NewDataL();
+
+ void LoadDriverInfoL();
+ void LoadTypeInfoL();
+ void LoadBearerInfoL();
+ void LoadItemInfoL(TInt aResouceId, const TDesC& aInfo, TInt& aIndex);
+ void LoadExtendSettingsL();
+ void StoreDriverInfoL();
+ void StoreTypeInfoL();
+ void StoreBearerInfoL();
+ void StoreItemInfoL(TInt aResouceId, TDes& aInfo);
+ void StoreExtendSettingsL();
+
+ CAknSettingItem* GetSettingItemL(const TDesC& aItemTitle);
+
+ CDirectPrintBearerMgr* GetBearerMgr();
+
+private:
+ /** Pointer to listbox. */
+ CDirectPrintSettingListBox* iListBox;
+ /** Printer id. */
+ TInt iPrinterId;
+ /** Printer name. */
+ TBuf<50> iPrinterName;
+ /** Index of driver setting. */
+ TInt iDriver;
+ /** Driver uid. */
+ TUid iDriverUid;
+ /** Driver name. */
+ TBuf<50> iDriverName;
+ /** Index of bearer setting. */
+ TInt iBearer;
+ /** Bearer name. */
+ TBuf<50> iBearerName;
+ /** Index of access point setting. */
+ TInt iAccessPoint;
+ /** Access point name. */
+ TBuf<50> iAccessPointName;
+ /** Host name. */
+ TBuf<50> iHost;
+ /** Ip address. */
+ TInetAddr iHostIp;
+ /** Port number. */
+ TInt iPort;
+ /** User name. */
+ TBuf<50> iUserName;
+ /** Que name. */
+ TBuf<50> iQue;
+ /** Printer type name. */
+ TBuf<50> iTypeName;
+ /** Index of printer type setting. */
+ TInt iType;
+
+ /** Array of driver. */
+ RSelectItemArray iDriverList;
+ /** Array of bearer. */
+ RSelectItemArray iBearerList;
+ /** Array of type. */
+ RSelectItemArray iTypeList;
+ };
+
+#endif // __PRINTERSETTINGVIEW_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/ui/inc/directprintviewbase.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef __DIRECTPRINTVIEWBASE_H__
+#define __DIRECTPRINTVIEWBASE_H__
+
+// System includes
+#include <aknview.h>
+
+// User includes
+#include "directprintlistobserver.h"
+#include "directprintsettinglistobserver.h"
+
+// Forward declarations
+class CDirectPrintModel;
+class CDirectPrintUiPluginMgr;
+class CDirectPrintEngine;
+
+// Class declaration
+/**
+ * View base class
+ * more_complete_description
+ */
+class CDirectPrintViewBase : public CAknView, public MDirectPrintListObserver, public MDirectPrintSettingListObserver
+ {
+public:
+ /** Destructor */
+ ~CDirectPrintViewBase();
+
+public:
+ /**
+ * From CAknView.
+ * Get the id of view.
+ *
+ * @return The id of view.
+ */
+ TUid Id() const;
+
+public:
+ /**
+ * Handles index.
+ *
+ * @param aIndex The index of selected item.
+ */
+ virtual void HandleListIndexL(TInt aIndex);
+
+public:
+ /**
+ * Handles index.
+ *
+ * @param aIndex The index of selected item.
+ * @param aChanged The flag of change data.
+ */
+ virtual void HandleEditItemL(TInt aIndex, TBool aChanged);
+
+protected:
+ CDirectPrintViewBase();
+ void ConstructL();
+
+protected: // from CAknView
+ void DoActivateL(const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage);
+ void DoDeactivate();
+
+protected: // New founctions
+ void SetActiveTitleL(TInt aTitleResId);
+ CDirectPrintModel& GetModel();
+ CDirectPrintUiPluginMgr& GetPluginMgr();
+ CDirectPrintEngine& GetEngine();
+
+protected:
+ /** View id. */
+ TUid iViewId;
+
+private:
+ };
+
+#endif // __DIRECTPRINTVIEWBASE_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/ui/src/directprintlistbox.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,167 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <barsread.h>
+#include <DirectPrintApp.rsg>
+
+#include "DirectPrintListBox.h"
+
+CDirectPrintListBox::CDirectPrintListBox()
+ {
+ iListObserver = NULL;
+ }
+
+CDirectPrintListBox::~CDirectPrintListBox()
+ {
+ delete iListBox;
+ }
+
+CDirectPrintListBox* CDirectPrintListBox::NewL(const TRect& aRect, CDesCArray* aItemArray)
+ {
+ CDirectPrintListBox* self = CDirectPrintListBox::NewLC(aRect, aItemArray);
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+CDirectPrintListBox* CDirectPrintListBox::NewLC(const TRect& aRect, CDesCArray* aItemArray)
+ {
+ CDirectPrintListBox* self = new(ELeave) CDirectPrintListBox();
+ CleanupStack::PushL(self);
+ self->ConstructL(aRect, aItemArray);
+ return self;
+ }
+
+void CDirectPrintListBox::ConstructL(const TRect& aRect, CDesCArray* aItemArray)
+ {
+ CreateWindowL();
+ SetRect(aRect);
+
+ InitializeControlsL();
+ iListBox->SetRect(Rect());
+ iListBox->Model()->SetItemTextArray(aItemArray);
+ iListBox->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray);
+ iListBox->HandleItemAdditionL();
+
+ ActivateL();
+ }
+
+TInt CDirectPrintListBox::CountComponentControls() const
+ {
+ return (int)ELastControl;
+ }
+
+CCoeControl* CDirectPrintListBox::ComponentControl(TInt aIndex) const
+ {
+ CCoeControl* ctrl = NULL;
+
+ switch ( aIndex )
+ {
+ case EListBox:
+ {
+ ctrl = iListBox;
+ }
+ break;
+ default:
+ break;
+ }
+
+ return ctrl;
+ }
+
+void CDirectPrintListBox::InitializeControlsL()
+ {
+ TBuf<50> buf;
+ //_LIT ( KStringHeader, "%S\t%S" );
+ iListBox = new(ELeave) CAknDoubleStyleListBox;
+ iListBox->SetContainerWindowL(*this);
+ {
+ TResourceReader reader;
+ iEikonEnv->CreateResourceReaderLC(reader, R_DIRECTPRINT_MAINVIEW_LISTBOX);
+ iListBox->ConstructFromResourceL(reader);
+ CleanupStack::PopAndDestroy(); // reader internal state
+ }
+
+ iListBox->CreateScrollBarFrameL(ETrue);
+ iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOn, CEikScrollBarFrame::EOn);
+ iListBox->ScrollBarFrame()->DrawScrollBarsNow();
+ iListBox->SetFocus( ETrue );
+ iListBox->SetListBoxObserver(this);
+ iListBox->View()->SetListEmptyTextL( _L("No Data") );
+ }
+
+void CDirectPrintListBox::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
+ {
+ switch (aEventType)
+ {
+ case EEventItemClicked:
+ case EEventEnterKeyPressed:
+ {
+ TInt index = iListBox->CurrentItemIndex();
+ if (iListObserver)
+ {
+ iListObserver->HandleListIndexL(index);
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+void CDirectPrintListBox::SetItemL(CDesCArray* aItemArray)
+ {
+ iListBox->Model()->SetItemTextArray(aItemArray);
+ iListBox->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray);
+ iListBox->HandleItemAdditionL();
+ }
+
+void CDirectPrintListBox::SetListObserver(MDirectPrintListObserver* aObserver)
+ {
+ iListObserver = aObserver;
+ }
+
+TInt CDirectPrintListBox::DeleteCurrentItemL()
+ {
+ TInt index = -1;
+ if (iListBox->Model()->NumberOfItems() > 0)
+ {
+ index = iListBox->CurrentItemIndex();
+ CDesCArray* itemArray = static_cast<CDesC16ArrayFlat*>(iListBox->Model()->ItemTextArray());
+ itemArray->Delete(index);
+ }
+ iListBox->HandleItemAdditionL();
+
+ return index;
+ }
+
+void CDirectPrintListBox::RedrawListL()
+ {
+ iListBox->HandleItemAdditionL();
+ iListBox->DrawNow();
+ DrawNow();
+ }
+
+TInt CDirectPrintListBox::CurrentIndex()
+ {
+ return iListBox->CurrentItemIndex();
+ }
+
+void CDirectPrintListBox::SetFocusL(TInt aIndex)
+ {
+ iListBox->SetCurrentItemIndexAndDraw(aIndex);
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/ui/src/directprintlistview.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,197 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// System include files
+#include <aknviewappui.h>
+#include <akntoolbar.h>
+#include <barsread.h>
+#include <DirectPrintApp.rsg>
+
+// User include files go here:
+#include "clog.h"
+#include "directprintapp.hrh"
+#include "directprintmodel.h"
+#include "directprintlistview.h"
+
+CDirectPrintListView::CDirectPrintListView()
+ {
+ iListBox = NULL;
+ }
+
+CDirectPrintListView::~CDirectPrintListView()
+ {
+ AppUi()->RemoveFromViewStack(*this, iListBox);
+ delete iListBox;
+ delete iItemArray;
+ }
+
+CDirectPrintListView* CDirectPrintListView::NewL()
+ {
+ CDirectPrintListView* self = CDirectPrintListView::NewLC();
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+CDirectPrintListView* CDirectPrintListView::NewLC()
+ {
+ CDirectPrintListView* self = new(ELeave) CDirectPrintListView();
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ return self;
+ }
+
+void CDirectPrintListView::ConstructL()
+ {
+ LOG("CDirectPrintListView::ConstructL BEGIN");
+ BaseConstructL(R_DIRECTPRINT_PRINTERLIST_VIEW);
+
+ LOG("CDirectPrintListView::ConstructL 1");
+ iViewId = TUid::Uid(EDirectPrintPrinterListViewId);
+
+ iItemArray = new(ELeave) CDesCArrayFlat(3);
+ LOG("CDirectPrintListView::ConstructL END");
+ }
+
+void CDirectPrintListView::HandleCommandL(TInt aCommand)
+ {
+ switch (aCommand)
+ {
+ case EAknSoftkeyDone:
+ {
+ TInt index = iListBox->CurrentIndex();
+ if (index >= 0)
+ {
+ GetModel().MoveTopPrinterDataL(index);
+ }
+ AppUi()->HandleCommandL(EDirectPrintCmdIdPrinterListViewDone);
+ }
+ break;
+ case EDirectPrintCmdIdPrinterListViewDelete:
+ {
+ TInt index = iListBox->DeleteCurrentItemL();
+ if (index >= 0)
+ {
+ GetModel().RemovePrinterDataL(index);
+ iListBox->SetFocusL(0);
+ }
+ AppUi()->HandleCommandL(aCommand);
+ }
+ break;
+ case EDirectPrintCmdIdPrinterListViewNew:
+ {
+ PrepareNewDataL();
+ AppUi()->HandleCommandL(aCommand);
+ }
+ break;
+ default:
+ {
+ AppUi()->HandleCommandL(aCommand);
+ }
+ break;
+ }
+ }
+
+void CDirectPrintListView::HandleListIndexL(TInt aIndex)
+ {
+ GetModel().SetSelectPrinter(aIndex);
+ AppUi()->HandleCommandL(EDirectPrintCmdIdPrinterListViewEdit);
+ }
+
+void CDirectPrintListView::OfferToolbarEventL(TInt aCommand)
+ {
+ switch (aCommand)
+ {
+ case EDirectPrintCmdIdPrinterListViewEdit:
+ {
+ TInt index = iListBox->CurrentIndex();
+ GetModel().SetSelectPrinter(index);
+ AppUi()->HandleCommandL(aCommand);
+ }
+ break;
+ case EDirectPrintCmdIdPrinterListViewSearch:
+ {
+ AppUi()->HandleCommandL(aCommand);
+ }
+ break;
+ case EDirectPrintCmdIdPrinterListViewNew:
+ {
+ PrepareNewDataL();
+ AppUi()->HandleCommandL(aCommand);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+void CDirectPrintListView::DoActivateL(const TVwsViewId& /*aPrevViewId*/, TUid /*aCustomMessageId*/, const TDesC8& /*aCustomMessage*/)
+ {
+ CAknToolbar* toolbar = AppUi()->CurrentFixedToolbar();
+ toolbar->SetToolbarObserver(this);
+
+ iItemArray->Reset();
+
+ // Create list box
+ if (!iListBox)
+ {
+ iListBox = CDirectPrintListBox::NewL(ClientRect(), iItemArray);
+ iListBox->SetMopParent(this);
+ iListBox->SetListObserver(this);
+ }
+ AppUi()->AddToStackL(*this, iListBox);
+ iListBox->MakeVisible(ETrue);
+
+ LoadListDataL();
+
+ iListBox->RedrawListL();
+
+ // set the title pane
+ SetActiveTitleL(R_DIRECTPRINT_PRINTERLIST_TITLE);
+ }
+
+void CDirectPrintListView::DoDeactivate()
+ {
+ iListBox->MakeVisible(EFalse);
+ AppUi()->RemoveFromViewStack(*this, iListBox);
+ }
+
+void CDirectPrintListView::LoadListDataL()
+ {
+ CDirectPrintModel& model = GetModel();
+ TInt count = model.PrinterCount();
+ for (TInt i=0; i<count; i++)
+ {
+ TDirectPrintPrinterData printerData;
+ model.GetPrinterDataL(i, printerData);
+
+ TBuf<50> buf;
+ buf.Format(_L("\t%S\t%S"), &printerData.iPrinterName, &printerData.iDriverName);
+ iItemArray->AppendL(buf);
+ }
+ }
+
+void CDirectPrintListView::PrepareNewDataL()
+ {
+ CDirectPrintModel& model = GetModel();
+ model.SetIsNewData(ETrue);
+ model.SetSelectPrinter(0);
+ if (model.PrinterCount() == 0)
+ {
+ model.SetCurrentPrinter(0);
+ }
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/ui/src/directprintmainview.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,250 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <aknviewappui.h>
+#include <akntoolbar.h>
+#include <barsread.h>
+#include <DirectPrintApp.rsg>
+
+#include "clog.h"
+#include "directprintapp.hrh"
+#include "directprintmodel.h"
+#include "directprintmainview.h"
+
+CDirectPrintMainView::CDirectPrintMainView()
+ {
+ iListBox = NULL;
+ }
+
+CDirectPrintMainView::~CDirectPrintMainView()
+ {
+ AppUi()->RemoveFromViewStack(*this, iListBox);
+ delete iListBox;
+ iItemArray->Reset();
+ delete iItemArray;
+ }
+
+CDirectPrintMainView* CDirectPrintMainView::NewL()
+ {
+ CDirectPrintMainView* self = CDirectPrintMainView::NewLC();
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+CDirectPrintMainView* CDirectPrintMainView::NewLC()
+ {
+ CDirectPrintMainView* self = new(ELeave) CDirectPrintMainView();
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ return self;
+ }
+
+void CDirectPrintMainView::ConstructL()
+ {
+ LOG("CDirectPrintMainView::ConstructL BEGIN");
+ BaseConstructL(R_DIRECTPRINT_MAINVIEW);
+
+ iViewId = TUid::Uid(EDirectPrintMainViewId);
+
+ iItemArray = new(ELeave) CDesCArrayFlat(3);
+ LOG("CDirectPrintMainView::ConstructL END");
+ }
+
+void CDirectPrintMainView::HandleCommandL(TInt aCommand)
+ {
+ switch (aCommand)
+ {
+ case EAknSoftkeyBack:
+ {
+ AppUi()->HandleCommandL(EDirectPrintCmdIdMainViewExit);
+ }
+ break;
+ case EDirectPrintCmdIdMainViewPrinterList:
+ case EDirectPrintCmdIdMainViewPrint:
+ case EDirectPrintCmdIdMainViewPreview:
+ case EDirectPrintCmdIdMainViewPropertySetting:
+ {
+ AppUi()->HandleCommandL(aCommand);
+ }
+ break;
+ default:
+ {
+ AppUi()->HandleCommandL(aCommand);
+ }
+ break;
+ }
+ }
+
+void CDirectPrintMainView::HandleListIndexL(TInt aIndex)
+ {
+ switch (aIndex)
+ {
+ case EItemPrinter:
+ {
+ AppUi()->HandleCommandL(EDirectPrintCmdIdMainViewPrinterList);
+ }
+ break;
+ case EItemBearer:
+ {
+ CDirectPrintModel& model = GetModel();
+ model.SetSelectPrinter(model.CurrentPrinter());
+ AppUi()->HandleCommandL(EDirectPrintCmdIdMainViewPrinterSetting);
+ }
+ break;
+ case EItemSetting:
+ {
+ AppUi()->HandleCommandL(EDirectPrintCmdIdMainViewPropertySetting);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+void CDirectPrintMainView::OfferToolbarEventL(TInt aCommand)
+ {
+ switch (aCommand)
+ {
+ case EDirectPrintCmdIdMainViewPrint:
+ case EDirectPrintCmdIdMainViewPreview:
+ case EDirectPrintCmdIdMainViewPropertySetting:
+ {
+ AppUi()->HandleCommandL(aCommand);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+void CDirectPrintMainView::DoActivateL(const TVwsViewId& /*aPrevViewId*/, TUid /*aCustomMessageId*/, const TDesC8& /*aCustomMessage*/)
+ {
+ LOG("CDirectPrintMainView::DoActivateL BEGIN");
+ CAknToolbar* toolbar = AppUi()->CurrentFixedToolbar();
+ toolbar->SetToolbarObserver(this);
+
+ iItemArray->Reset();
+ LoadListDataL();
+
+ // Create list box
+ if (!iListBox)
+ {
+ iListBox = CDirectPrintListBox::NewL(ClientRect(), iItemArray);
+ iListBox->SetMopParent(this);
+ iListBox->SetListObserver(this);
+ }
+ AppUi()->AddToStackL(*this, iListBox);
+ iListBox->MakeVisible(ETrue);
+ iListBox->RedrawListL();
+
+ // set the title pane
+ SetActiveTitleL(R_DIRECTPRINT_MAINVIEW_TITLE);
+ LOG("CDirectPrintMainView::DoActivateL END");
+ }
+
+void CDirectPrintMainView::DoDeactivate()
+ {
+ LOG("CDirectPrintMainView::DoDeactivate BEGIN");
+ iListBox->MakeVisible(EFalse);
+ AppUi()->RemoveFromViewStack(*this, iListBox);
+ LOG("CDirectPrintMainView::DoDeactivate END");
+ }
+
+void CDirectPrintMainView::LoadListDataL()
+ {
+ CDirectPrintModel& model = GetModel();
+
+ if (model.PrinterCount() > 0)
+ {
+ TBuf<50> buf;
+ TBuf<25> itemTitle;
+
+ TDirectPrintPrinterData printerData;
+ model.GetPrinterDataL(0, printerData);
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_MAINVIEW_ITEM_PRINTERNAME);
+ buf.Format(_L("\t%S\t%S"), &itemTitle, &printerData.iPrinterName);
+ iItemArray->AppendL(buf);
+
+ TDirectPrintBearerData bearerData;
+ model.GetCurrentBearerDataL(bearerData);
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_MAINVIEW_ITEM_BEARER);
+ buf.Format(_L("\t%S\t%S"), &itemTitle, &bearerData.iBearerName);
+ iItemArray->AppendL(buf);
+
+ TBuf<25> property;
+ MakePropertyStringL(property);
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_MAINVIEW_ITEM_PROPERTYSETTINGS);
+ buf.Format(_L("\t%S\t%S"), &itemTitle, &property);
+ iItemArray->AppendL(buf);
+ }
+ else
+ {
+ TBuf<50> buf;
+ TBuf<30> itemTitle;
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_MAINVIEW_ITEM_PRINTERNAME);
+ buf.Format(_L("\t%S\t"), &itemTitle);
+ iItemArray->AppendL(buf);
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_MAINVIEW_ITEM_BEARER);
+ buf.Format(_L("\t%S\t"), &itemTitle);
+ iItemArray->AppendL(buf);
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_MAINVIEW_ITEM_PROPERTYSETTINGS);
+ buf.Format(_L("\t%S\t"), &itemTitle);
+ iItemArray->AppendL(buf);
+ }
+ }
+
+void CDirectPrintMainView::MakePropertyStringL(TDes& aProperty)
+ {
+ CDirectPrintModel& model = GetModel();
+ CPrinterProperty* property = model.GetCurrentPrinterPropertyL(TUid::Uid(0));
+
+ if (property)
+ {
+ TInt paperSize(0), orientation(0), copy(0);
+ TInt count = property->iPropertyItems.Count();
+ for (TInt i=0; i<count; i++)
+ {
+ if (property->iPropertyItems[i].iItemType == EDirectPrintPageSettingTab)
+ {
+ switch (property->iPropertyItems[i].iItemId)
+ {
+ case EDirectPrintPaperPaperSize:
+ {
+ paperSize = property->iPropertyItems[i].iItemValue;
+ }
+ break;
+ case EDirectPrintPaperOrientation:
+ {
+ orientation = property->iPropertyItems[i].iItemValue;
+ }
+ break;
+ case EDirectPrintPageCopy:
+ {
+ copy = property->iPropertyItems[i].iItemValue;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ //aProperty.Format(_L("%S/%S/%d"), paperSize, orientation, copy);
+ aProperty.Format(_L("%d/%d/%d"), paperSize, orientation, copy);
+ }
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/ui/src/directprintpreviewcontrol.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,500 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// INCLUDE FILES
+#include <coemain.h>
+#include <barsread.h>
+#include <DirectPrintApp.rsg>
+#include <prninf.h>
+#include <prnsetup.h>
+#include <gdi.h>
+#include <prnprev.h>
+#include <eikenv.h>
+#include <gulbordr.h> // TGulBorder
+#include <e32cmn.h>
+
+#include "directprintapp.pan"
+#include "directprintapp.hrh"
+#include "directprintpreviewcontrol.h"
+
+const TInt KFirstPage=0;
+
+const TInt KDraggingAccepted = 10;
+
+// -----------------------------------------------------------------------------
+// CDirectPrintPreviewControl::NewL()
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CDirectPrintPreviewControl* CDirectPrintPreviewControl::NewL(const CCoeControl* aParent)
+ {
+ CDirectPrintPreviewControl* self = CDirectPrintPreviewControl::NewLC(aParent);
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+// -----------------------------------------------------------------------------
+// CDirectPrintPreviewControl::NewLC()
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CDirectPrintPreviewControl* CDirectPrintPreviewControl::NewLC(const CCoeControl* aParent)
+ {
+ CDirectPrintPreviewControl* self = new(ELeave) CDirectPrintPreviewControl();
+ CleanupStack::PushL(self);
+ self->ConstructL(aParent);
+ return self;
+ }
+
+// -----------------------------------------------------------------------------
+// CDirectPrintPreviewControl::CDirectPrintPreviewControl()
+// C++ default constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CDirectPrintPreviewControl::CDirectPrintPreviewControl()
+ {
+ }
+
+// -----------------------------------------------------------------------------
+// CDirectPrintPreviewControl::~CDirectPrintPreviewControl()
+// C++ default constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CDirectPrintPreviewControl::~CDirectPrintPreviewControl()
+ {
+ Window().SetPointerGrab(EFalse);
+ delete iPreview;
+ }
+
+// -----------------------------------------------------------------------------
+// CDirectPrintPreviewControl::ConstructL()
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CDirectPrintPreviewControl::ConstructL(const CCoeControl* aParent)
+ {
+ // Create a window for this application view
+ if (aParent)
+ {
+ CreateBackedUpWindowL(*aParent->DrawableWindow(), EGray4);
+ }
+ else
+ {
+ CreateBackedUpWindowL((RWindowTreeNode&)iCoeEnv->RootWin(), EGray4);
+ }
+
+ EnableDragEvents();
+ Window().SetPointerGrab(ETrue);
+ }
+
+// -----------------------------------------------------------------------------
+// CDirectPrintPreviewControl::SetPreviewImageObserver()
+//
+// -----------------------------------------------------------------------------
+//
+void CDirectPrintPreviewControl::SetPreviewImageObserver(MPrintProcessObserver* aObserver)
+ {
+ __ASSERT_DEBUG(iPreview,Panic(EDirectPrintNullPointer));
+ iPreview->SetObserver(*aObserver);
+ }
+
+// -----------------------------------------------------------------------------
+// CDirectPrintPreviewControl::CountComponentControls()
+// Called by framework
+// -----------------------------------------------------------------------------
+//
+TInt CDirectPrintPreviewControl::CountComponentControls() const
+ {
+// return(2);
+ return(0);
+ }
+
+// -----------------------------------------------------------------------------
+// CDirectPrintPreviewControl::ComponentControl()
+// Called by framework
+// -----------------------------------------------------------------------------
+//
+CCoeControl* CDirectPrintPreviewControl::ComponentControl( TInt aIndex ) const
+ {
+ CCoeControl* control=NULL;
+ switch (aIndex)
+ {
+ case 0:
+// control=iButton[0];
+ break;
+ case 1:
+// control=iButton[1];
+ break;
+ }
+ return(control);
+ }
+
+// -----------------------------------------------------------------------------
+// CDirectPrintPreviewControl::WriteInternalStateL()
+//
+// -----------------------------------------------------------------------------
+//
+#ifndef _DEBUG
+void CDirectPrintPreviewControl::WriteInternalStateL(RWriteStream& /*aWriteStream*/) const
+ {
+ }
+#else
+void CDirectPrintPreviewControl::WriteInternalStateL(RWriteStream& aWriteStream) const
+ {
+ CEikBorderedControl::WriteInternalStateL(aWriteStream);
+ }
+#endif
+
+// -----------------------------------------------------------------------------
+// CDirectPrintAppAppView::HandlePointerEventL()
+// Called by framework to handle pointer touch events.
+// Note: although this method is compatible with earlier SDKs,
+// it will not be called in SDKs without Touch support.
+// -----------------------------------------------------------------------------
+//
+void CDirectPrintPreviewControl::HandlePointerEventL(
+ const TPointerEvent& aPointerEvent)
+ {
+ const TRect rect=Rect();
+ if( !rect.Contains(aPointerEvent.iPosition) )
+ {
+ return;
+ }
+
+ switch ( aPointerEvent.iType )
+ {
+ case TPointerEvent::EButton1Down:
+ {
+ iPointerDownPos = aPointerEvent.iPosition;
+ }
+ break;
+ case TPointerEvent::EButton1Up:
+ case TPointerEvent::EDrag:
+ {
+ TInt x = aPointerEvent.iPosition.iX - iPointerDownPos.iX;
+ TInt y = aPointerEvent.iPosition.iY - iPointerDownPos.iY;
+ if (Abs(x) > KDraggingAccepted || Abs(y) > KDraggingAccepted)
+ {
+ TPoint newPos;
+ TInt maxWidth = iDisplayRect.Width() - rect.Width();
+ TInt maxHeight = iDisplayRect.Height() - rect.Height();
+ newPos.iX = Min(iDisplayPoint.iX + x, maxWidth);
+ if (newPos.iX <= (maxWidth*-1))
+ newPos.iX = (maxWidth*-1);
+ newPos.iY = Min(iDisplayPoint.iY + y, maxHeight);
+ if (newPos.iY <= (maxHeight*-1))
+ newPos.iY = (maxHeight*-1);
+ iDisplayPoint = newPos;
+ iPointerDownPos = aPointerEvent.iPosition;
+ DrawNow();
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+void CDirectPrintPreviewControl::ActivateL()
+ {
+ DrawButtons();
+ CCoeControl::ActivateL();
+ }
+
+TCoeInputCapabilities CDirectPrintPreviewControl::InputCapabilities() const
+ {
+ return TCoeInputCapabilities(TCoeInputCapabilities::ENavigation);
+ }
+
+void CDirectPrintPreviewControl::InitializeFormat(
+ CPrintSetup& aPrintSetup,
+ MPageRegionPrinter& aBodyPrinter,
+ TPrintPreviewFormat& aFormat,
+ TInt& aNumPagesInDoc,
+ TInt& aFirstPageToDisplay,
+ TInt aNumPagesToView,
+ CPrintPreviewImage::TMarginState& aMarginState)
+ {
+ iPrintSetup=&aPrintSetup;
+ iBodyPrinter=&aBodyPrinter;
+ iPrintPreviewFormat=&aFormat;
+ iFirstPageToDisplay=&aFirstPageToDisplay;
+ iNumPagesInDoc=aNumPagesInDoc;
+ iNumPagesToView=aNumPagesToView;
+ iMarginState=aMarginState;
+ }
+
+void CDirectPrintPreviewControl::SetNumBands(TInt aNumBands)
+ {
+ iNumBands=aNumBands;
+ if (iPreview)
+ {
+ iPreview->SetNumBands(aNumBands);
+ }
+ }
+
+// -----------------------------------------------------------------------------
+// CDirectPrintPreviewControl::SizeChanged()
+// Called by framework when the view size is changed.
+// -----------------------------------------------------------------------------
+//
+void CDirectPrintPreviewControl::SizeChanged()
+ // can't recover if CPrintPreviewImage::NewL() fails !!
+ {
+ iPreviewDraw=ETrue;
+
+ // set zoom level
+ SetZoomLevelAndDispalyRect(EPreviewZoomLevel1);
+
+ // create CPrintPreviewImage object
+ TRAP_IGNORE(CreatePreviewImageL());
+ }
+
+// -----------------------------------------------------------------------------
+// CDirectPrintPreviewControl::Draw()
+// Draws the display.
+// -----------------------------------------------------------------------------
+//
+void CDirectPrintPreviewControl::Draw(const TRect& aRect) const
+ {
+ if (!iPreviewDraw)
+ return;
+// DrawButtons();
+ CWindowGc& gc=SystemGc();
+ iBorder.Draw(gc,Rect());
+ gc.Clear();
+ gc.SetPenStyle(CGraphicsContext::ENullPen);
+ gc.SetBrushColor(KRgbWhite);
+ gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
+// TRect rectAboveButton(TPoint(iDisplayRect.iTl.iX-KScrollButtonWidth,iDisplayRect.iTl.iY),TSize(KScrollButtonWidth,iDisplayRect.Height()-(iButton[0]->IsVisible()? KScrollButtonWidth : 0)));
+// gc.DrawRect(rectAboveButton);
+// rectAboveButton=(TPoint(iDisplayRect.iTl.iX-KScrollButtonWidth,iDisplayRect.iTl.iY),TSize(KScrollButtonWidth,iDisplayRect.Height()-(iButton[1]->IsVisible()? KScrollButtonWidth : 0)));
+// rectAboveButton.Move(iDisplayRect.Width()+KScrollButtonWidth+1,1); // why are the 1s needed???
+// gc.DrawRect(rectAboveButton);
+ gc.SetPenStyle(CGraphicsContext::ESolidPen);
+ CONST_CAST(CDirectPrintPreviewControl*,this)->DrawPreview(aRect); // cast away constness
+ }
+
+void CDirectPrintPreviewControl::SetDrawFlag(TBool aDraw)
+ {
+ iPreviewDraw=aDraw;
+ }
+
+TBool CDirectPrintPreviewControl::DrawFlag()
+ {
+ return iPreviewDraw;
+ }
+
+void CDirectPrintPreviewControl::SetFormatAndDrawL(TInt& aFirstPageToDisplay,TInt& aNumPagesToView)
+ {
+ iPreview->FormatL(iNumPagesInDoc,aFirstPageToDisplay,aNumPagesToView);
+ *iFirstPageToDisplay=aFirstPageToDisplay;
+ iNumPagesToView=aNumPagesToView;
+ DrawButtons();
+ DrawNow();
+ }
+
+void CDirectPrintPreviewControl::SetMarginAndDrawL(CPrintPreviewImage::TMarginState aMarginState)
+ {
+ iPreview->SetMargins(aMarginState);
+ iMarginState=aMarginState;
+ DrawNow();
+ }
+
+void CDirectPrintPreviewControl::SetNumPagesInDoc(TInt aNumPagesInDoc,TInt aFirstPageToDisplay,TInt aNumPagesToView)
+ {
+ iNumPagesInDoc=aNumPagesInDoc;
+ *iFirstPageToDisplay=aFirstPageToDisplay;
+ iNumPagesToView=aNumPagesToView;
+ }
+
+void CDirectPrintPreviewControl::DrawPreview(const TRect& aRect)
+ {
+ TRAPD(err,iPreview->DrawL(iDisplayPoint,aRect));
+ if (err)
+ {
+ SystemGc().Clear(iDisplayRect);
+ CEikonEnv::Static()->NotifyIdleErrorWhileRedrawing(err);
+ }
+ }
+
+TKeyResponse CDirectPrintPreviewControl::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
+ {
+ TInt newFirstPageToDisplay=*iFirstPageToDisplay;
+ switch (aKeyEvent.iCode)
+ {
+ case EKeyLeftArrow:
+ case EKeyPageUp:
+ newFirstPageToDisplay--;
+ break;
+ case EKeyRightArrow:
+ case EKeyPageDown:
+ newFirstPageToDisplay++;
+ break;
+ case EKeyHome:
+ newFirstPageToDisplay=KFirstPage;
+ break;
+ case EKeyEnd:
+ newFirstPageToDisplay=iNumPagesInDoc-iNumPagesToView;
+ break;
+ default:
+ return(EKeyWasNotConsumed);
+
+ }
+ SwitchFirstPageToDisplayL(newFirstPageToDisplay);
+ return(EKeyWasConsumed);
+ }
+
+void CDirectPrintPreviewControl::SwitchFirstPageToDisplayL(TInt& aNewFirstPageToDisplay)
+ {
+ if (aNewFirstPageToDisplay<KFirstPage)
+ aNewFirstPageToDisplay=KFirstPage;
+ if (aNewFirstPageToDisplay>iNumPagesInDoc-iNumPagesToView)
+ aNewFirstPageToDisplay=iNumPagesInDoc-iNumPagesToView;
+ if (aNewFirstPageToDisplay!=*iFirstPageToDisplay)
+ SetFormatAndDrawL(aNewFirstPageToDisplay,iNumPagesToView);
+ }
+
+void CDirectPrintPreviewControl::HandleControlEventL(CCoeControl* /*aControl*/,TCoeEvent aEventType)
+ {
+ if (aEventType!=EEventStateChanged)
+ return;
+ TInt newFirstPageToDisplay=*iFirstPageToDisplay;
+// if (aControl==iButton[0])
+// newFirstPageToDisplay--;
+// else if (aControl==iButton[1])
+// newFirstPageToDisplay++;
+ SwitchFirstPageToDisplayL(newFirstPageToDisplay);
+ }
+
+void CDirectPrintPreviewControl::DrawButtons() const
+ {
+ if (iNumPagesToView==iNumPagesInDoc)
+ {
+// iButton[1]->MakeVisible(EFalse);
+// iButton[0]->MakeVisible(EFalse);
+ return;
+ }
+// TBool leftvisible=ETrue;
+// TBool rightvisible=ETrue;
+// if (*iFirstPageToDisplay==KFirstPage)
+// leftvisible=EFalse;
+// else
+// {
+// if (*iFirstPageToDisplay>=iNumPagesInDoc-iNumPagesToView)
+// rightvisible=EFalse;
+// }
+// iButton[0]->MakeVisible(leftvisible);
+// iButton[1]->MakeVisible(rightvisible);
+//// iButton[0]->DrawNow();
+//// iButton[1]->DrawNow();
+ }
+
+
+// for zoom
+void CDirectPrintPreviewControl::SetZoomLevel(TInt /*aZoomLevel*/)
+ {
+ SetZoomLevelAndDispalyRect(iZoomLevel);
+ }
+
+TInt CDirectPrintPreviewControl::GetZoomLebel()
+ {
+ return (TInt)iZoomLevel;
+ }
+
+void CDirectPrintPreviewControl::IncrementZoomLevel()
+ {
+ TInt zoom = iZoomLevel + 1;
+ if (zoom >= EPreviewZoomLevel1
+ && zoom < EPreviewZoomLevelMax)
+ {
+ SetZoomLevelAndDispalyRect(zoom);
+ TRAPD(err, CreatePreviewImageL());
+ if (err == KErrNone)
+ {
+ DrawNow();
+ }
+ }
+ }
+
+void CDirectPrintPreviewControl::DecrementZoomLevel()
+ {
+ TInt zoom = iZoomLevel - 1;
+ if (zoom >= EPreviewZoomLevel1)
+ {
+ SetZoomLevelAndDispalyRect(zoom);
+ TRAPD(err, CreatePreviewImageL());
+ if (err == KErrNone)
+ {
+ DrawNow();
+ }
+ }
+ }
+
+ // set zoom level
+void CDirectPrintPreviewControl::SetZoomLevelAndDispalyRect(TInt aZoomLevel)
+ {
+ static const TInt KZoomPercent[EPreviewZoomLevelMax] = {100, 120, 140, 160, 180};
+ TInt oldZoomLevel = iZoomLevel;
+ if (aZoomLevel == EPreviewZoomLevel1)
+ {
+ iDisplayRect = iBorder.InnerRect(Rect());
+ iDisplayPoint = iDisplayRect.iTl;
+ }
+ else
+ {
+ TRect rect(iBorder.InnerRect(Rect()));
+ TSize newSize;
+ newSize.iWidth = (rect.Size().iWidth * KZoomPercent[aZoomLevel] + 5) / KZoomPercent[EPreviewZoomLevel1];
+ newSize.iHeight = (rect.Size().iHeight * KZoomPercent[aZoomLevel] + 5) / KZoomPercent[EPreviewZoomLevel1];
+ iDisplayRect.SetSize(newSize);
+ if (oldZoomLevel != EPreviewZoomLevel1)
+ {
+ TPoint newPos;
+ newPos.iX = Max(0, ((iDisplayPoint.iX * KZoomPercent[aZoomLevel] + 5) / KZoomPercent[EPreviewZoomLevel1]));
+ newPos.iY = Max(0, ((iDisplayPoint.iY * KZoomPercent[aZoomLevel] + 5) / KZoomPercent[EPreviewZoomLevel1]));
+ iDisplayPoint = newPos;
+ }
+ }
+ iZoomLevel = aZoomLevel;
+ }
+
+void CDirectPrintPreviewControl::CreatePreviewImageL()
+ {
+ if (iPreview)
+ {
+ delete iPreview;
+ iPreview=NULL;
+ }
+
+ iPreview = CPrintPreviewImage::NewL(*iPrintSetup,
+ *iBodyPrinter,
+ CEikonEnv::Static()->WsSession(),
+ Window(),
+ iDisplayRect.Size(),
+ *iPrintPreviewFormat);
+ iPreview->SetNumBands(iNumBands);
+ iPreview->FormatL(iNumPagesInDoc,*iFirstPageToDisplay,iNumPagesToView);
+ iPreview->SetMargins(iMarginState);
+// TRect buttonRect(TPoint(iDisplayRect.iTl.iX-KScrollButtonWidth,iDisplayRect.iBr.iY-KScrollButtonWidth),
+// TSize(KScrollButtonWidth,KScrollButtonWidth));
+// iButton[0]->SetRect(buttonRect);
+// buttonRect.Move(iDisplayRect.Width()+KScrollButtonWidth,0);
+// iButton[1]->SetRect(buttonRect);
+ }
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/ui/src/directprintpreviewview.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,244 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <aknviewappui.h>
+#include <akntoolbar.h>
+#include <barsread.h>
+#include <DirectPrintApp.rsg>
+#include <eikcore.rsg>
+#include <prnprev.h>
+
+#include "clog.h"
+#include "directprintapp.hrh"
+#include "DirectPrintAppAppUi.h"
+#include "DirectPrintEngine.h"
+#include "directprintpreviewview.h"
+#include "directprintpreviewcontrol.h"
+
+CDirectPrintPreviewView::CDirectPrintPreviewView()
+ {
+ }
+
+CDirectPrintPreviewView::~CDirectPrintPreviewView()
+ {
+ delete iPrevCtrl;
+ }
+
+CDirectPrintPreviewView* CDirectPrintPreviewView::NewL()
+ {
+ CDirectPrintPreviewView* self = CDirectPrintPreviewView::NewLC();
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+CDirectPrintPreviewView* CDirectPrintPreviewView::NewLC()
+ {
+ CDirectPrintPreviewView* self = new(ELeave) CDirectPrintPreviewView();
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ return self;
+ }
+
+void CDirectPrintPreviewView::ConstructL()
+ {
+ LOG("CDirectPrintPreviewView::ConstructL BEGIN");
+ BaseConstructL(R_DIRECTPRINT_PREVIEW_VIEW);
+ LOG("CDirectPrintPreviewView::ConstructL END");
+ }
+
+void CDirectPrintPreviewView::HandleCommandL(TInt aCommand)
+ {
+ switch (aCommand)
+ {
+ case EAknSoftkeyBack:
+ {
+ AppUi()->HandleCommandL(EDirectPrintCmdIdPreviewViewBack);
+ }
+ break;
+ case EDirectPrintCmdIdPreviewViewPrint:
+ case EDirectPrintCmdIdPreviewViewExpand:
+ case EDirectPrintCmdIdPreviewViewReduce:
+ case EDirectPrintCmdIdPreviewViewBack:
+ {
+ AppUi()->HandleCommandL(aCommand);
+ }
+ break;
+ default:
+ {
+ AppUi()->HandleCommandL(aCommand);
+ }
+ break;
+ }
+ }
+
+TUid CDirectPrintPreviewView::Id() const
+ {
+ return TUid::Uid(EDirectPrintPreviewViewId);
+ }
+
+void CDirectPrintPreviewView::OfferToolbarEventL(TInt aCommand)
+ {
+ switch (aCommand)
+ {
+ case EDirectPrintCmdIdPreviewViewPrint:
+ {
+ AppUi()->HandleCommandL(aCommand);
+ }
+ break;
+ case EDirectPrintCmdIdPreviewViewExpand:
+ {
+ iPrevCtrl->IncrementZoomLevel();
+ ChangeVisibleState();
+ }
+ break;
+ case EDirectPrintCmdIdPreviewViewReduce:
+ {
+ iPrevCtrl->DecrementZoomLevel();
+ ChangeVisibleState();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+void CDirectPrintPreviewView::DoActivateL(const TVwsViewId& /*aPrevViewId*/, TUid /*aCustomMessageId*/, const TDesC8& /*aCustomMessage*/)
+ {
+ LOG("CDirectPrintPreviewView::DoActivateL BEGIN");
+ CAknToolbar* toolbar = AppUi()->CurrentFixedToolbar();
+ toolbar->SetToolbarObserver(this);
+ // set the title pane
+ SetActiveTitleL(R_DIRECTPRINT_PREVIEW_TITLE);
+
+ if (!iPrevCtrl)
+ {
+ CDirectPrintAppAppUi* appui = static_cast<CDirectPrintAppAppUi*>( AppUi() );
+ CDirectPrintEngine* engine = appui->Engine();
+
+ const TInt KPanelGutter=5;
+ const TInt KShadowWidth=2;
+ const TInt KLabelFontHeight=12;
+
+ TFontSpec normalFontSpec = CEikonEnv::Static()->NormalFont()->FontSpecInTwips();
+ TFontSpec fontSpec(normalFontSpec);
+ fontSpec.iHeight = KLabelFontHeight;
+ iPrintPreviewFormat.iLabelFontSpecInPixels=fontSpec;
+ iPrintPreviewFormat.iMinPanelGutterInPixels=TSize(KPanelGutter,KPanelGutter);
+ iPrintPreviewFormat.iPanelShadowWidthInPixels=KShadowWidth;
+ iPrintPreviewFormat.iPanelShadowColor=KRgbDarkGray;
+ iPrintPreviewFormat.iPanelMarginColor=KRgbGray;
+ iPrintPreviewFormat.iLabelOffsetInPixels=5;
+
+ iPrevCtrl = CDirectPrintPreviewControl::NewL(NULL);
+ iPrevCtrl->SetMopParent(this);
+
+ //iNumPagesInDoc = engine->MaxPageNum();
+ iNumPagesInDoc = 3;
+ iFirstPageToDisplay = 1;
+ iNumPagesToView = 1;
+ iNumBands = 2;
+ iMarginState = CPrintPreviewImage::EShowMargins;
+
+ engine->StartPrintPreviewL();
+
+ iPrevCtrl->InitializeFormat(*(engine->PrintSetup()),
+ *(engine->PageRegionPrinter()),
+ iPrintPreviewFormat,
+ iNumPagesInDoc,
+ iFirstPageToDisplay,
+ iNumPagesToView,
+ iMarginState);
+ iPrevCtrl->ActivateL();
+ iPrevCtrl->SetNumBands(2);
+ }
+ iPrevCtrl->SetRect(ClientRect());
+ iPrevCtrl->SetDrawFlag(ETrue);
+ iPrevCtrl->MakeVisible(ETrue);
+ iPrevCtrl->DrawDeferred();
+ AppUi()->AddToStackL(*this, iPrevCtrl);
+ ChangeVisibleState();
+ LOG("CDirectPrintPreviewView::DoActivateL END");
+ }
+
+void CDirectPrintPreviewView::DoDeactivate()
+ {
+ LOG("CDirectPrintPreviewView::DoDeactivate BEGIN");
+ AppUi()->RemoveFromViewStack(*this, iPrevCtrl);
+ if (iPrevCtrl)
+ {
+ CDirectPrintAppAppUi* appui = static_cast<CDirectPrintAppAppUi*>( AppUi() );
+ CDirectPrintEngine* engine = appui->Engine();
+ engine->EndPrintPreview();
+ delete iPrevCtrl;
+ iPrevCtrl = NULL;
+ }
+ LOG("CDirectPrintPreviewView::DoDeactivate END");
+ }
+
+
+void CDirectPrintPreviewView::NotifyBandPrinted(TInt /*aPercentageOfPagePrinted*/,
+ TInt /*aCurrentPageNum*/,
+ TInt /*aCurrentCopyNum*/)
+ {
+ LOG("CDirectPrintPreviewView::NotifyBandPrinted");
+ }
+
+
+void CDirectPrintPreviewView::NotifyPrintStarted(TPrintParameters /*aPrintParams*/)
+ {
+ LOG("CDirectPrintPreviewView::NotifyPrintStarted");
+ }
+
+void CDirectPrintPreviewView::NotifyPrintEnded(TInt anErrorCode)
+ // ignore any errors before fully initialized
+ {
+ LOG1("CDirectPrintPreviewView::NotifyPrintEnded [%d]", anErrorCode);
+ if (anErrorCode!=KErrNone && anErrorCode!=KErrCancel)
+ {
+ TBuf<80> previewError;
+ if (anErrorCode==KErrNoMemory)
+ iCoeEnv->ReadResource(previewError,R_EIK_TBUF_NOT_ENOUGH_MEMORY);
+ else
+ iCoeEnv->ReadResource(previewError,R_DIRECTPRINT_MSG_PREVIEW_ERR);
+ iEikonEnv->AlertWin(previewError);
+ // ToDo: Go back to Main view
+ //delete this;
+ }
+ }
+
+void CDirectPrintPreviewView::ChangeVisibleState()
+ {
+ CAknToolbar* toolbar = AppUi()->CurrentFixedToolbar();
+
+ TBool isDimmedExpand = EFalse;
+ TBool isDimmedReduce = EFalse;
+ switch (iPrevCtrl->GetZoomLebel())
+ {
+ case CDirectPrintPreviewControl::EPreviewZoomLevel1:
+ isDimmedReduce = ETrue;
+ break;
+ case CDirectPrintPreviewControl::EPreviewZoomLevel5:
+ isDimmedExpand = ETrue;
+ break;
+ default:
+ break;
+ }
+ toolbar->SetItemDimmed(EDirectPrintCmdIdPreviewViewExpand, isDimmedExpand, ETrue);
+ toolbar->SetItemDimmed(EDirectPrintCmdIdPreviewViewReduce, isDimmedReduce, ETrue);
+ }
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/ui/src/directprintpropertyview.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,633 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <aknviewappui.h>
+#include <akntoolbar.h>
+#include <barsread.h>
+#include <DirectPrintApp.rsg>
+
+#include "clog.h"
+#include "directprintapp.hrh"
+#include "directprintmodel.h"
+#include "directprintpropertyview.h"
+#include "DirectPrintUiPluginMgr.h"
+#include "DirectPrintUiPlugin.h"
+
+CDirectPrintPropertyView::CDirectPrintPropertyView()
+ {
+ iListBox = NULL;
+ }
+
+CDirectPrintPropertyView::~CDirectPrintPropertyView()
+ {
+ AppUi()->RemoveFromViewStack(*this, iListBox);
+ delete iListBox;
+ }
+
+CDirectPrintPropertyView* CDirectPrintPropertyView::NewL()
+ {
+ CDirectPrintPropertyView* self = CDirectPrintPropertyView::NewLC();
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+CDirectPrintPropertyView* CDirectPrintPropertyView::NewLC()
+ {
+ CDirectPrintPropertyView* self = new(ELeave) CDirectPrintPropertyView();
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ return self;
+ }
+
+void CDirectPrintPropertyView::ConstructL()
+ {
+ LOG("CDirectPrintPropertyView::ConstructL BEGIN");
+ BaseConstructL(R_DIRECTPRINT_PROPERTYSETTING_VIEW);
+
+ iViewId = TUid::Uid(EDirectPrintPropertyViewId);
+ LOG("CDirectPrintPropertyView::ConstructL END");
+ }
+
+void CDirectPrintPropertyView::HandleCommandL(TInt aCommand)
+ {
+ switch (aCommand)
+ {
+ case EAknSoftkeyBack:
+ {
+ AppUi()->HandleCommandL(EDirectPrintCmdIdPropertySettingViewBack);
+ }
+ break;
+ default:
+ {
+ AppUi()->HandleCommandL(aCommand);
+ }
+ break;
+ }
+ }
+
+void CDirectPrintPropertyView::OfferToolbarEventL(TInt aCommand)
+ {
+ switch (aCommand)
+ {
+ case EDirectPrintCmdIdPropertySettingViewPreview:
+ {
+ AppUi()->HandleCommandL(aCommand);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+void CDirectPrintPropertyView::ChangeTabL(TInt aTabIndex)
+ {
+ iTabIndex = aTabIndex;
+ iListBox->SettingItemArray()->ResetAndDestroy();
+ LoadListL();
+ iListBox->LoadSettingsL();
+ iListBox->DrawNow();
+ }
+
+void CDirectPrintPropertyView::DoActivateL(const TVwsViewId& /*aPrevViewId*/, TUid /*aCustomMessageId*/, const TDesC8& /*aCustomMessage*/)
+ {
+ LOG("CDirectPrintPropertyView::DoActivateL BEGIN");
+ CAknToolbar* toolbar = AppUi()->CurrentFixedToolbar();
+ toolbar->SetToolbarObserver(this);
+
+ ReadDataL();
+
+ // Create list box
+ if (!iListBox)
+ {
+ iListBox = CDirectPrintSettingListBox::NewL(ClientRect());
+ iListBox->SetMopParent(this);
+ iListBox->ConstructFromResourceL(R_DIRECTPRINT_PROPERTYSETTING_SETTING_ITEM_LIST);
+ iListBox->ActivateL();
+ }
+ ChangeTabL(EDirectPrintPaperSettingTab);
+ iListBox->LoadSettingsL();
+ AppUi()->AddToStackL(*this, iListBox);
+ iListBox->MakeVisible(ETrue);
+ iListBox->DrawNow();
+
+ // set the title pane
+ SetActiveTitleL(R_DIRECTPRINT_PROPERTYSETTING_TITLE);
+ LOG("CDirectPrintPropertyView::DoActivateL END");
+ }
+
+void CDirectPrintPropertyView::DoDeactivate()
+ {
+ LOG("CDirectPrintPropertyView::DoDeactivate BEGIN");
+ TInt err = 0;
+
+ if (iListBox)
+ {
+ TRAP(err, iListBox->StoreSettingsL());
+ TRAP(err, WriteDataL());
+
+ iListBox->MakeVisible(EFalse);
+ AppUi()->RemoveFromViewStack(*this, iListBox);
+ }
+ LOG("CDirectPrintPropertyView::DoDeactivate END");
+ }
+
+void CDirectPrintPropertyView::LoadListL()
+ {
+ LOG("CDirectPrintPropertyView::LoadListL BEGIN");
+
+ switch (iTabIndex)
+ {
+ case EDirectPrintPaperSettingTab:
+ {
+ LoadPaperTabL();
+ }
+ break;
+ case EDirectPrintPageSettingTab:
+ {
+ LoadPageTabL();
+ }
+ break;
+ case EDirectPrintMarginSettingTab:
+ {
+ LoadMarginTabL();
+ }
+ break;
+ case EDirectPrintHeaderSettingTab:
+ {
+ LoadHeaderTabL();
+ }
+ break;
+ case EDirectPrintFooterSettingTab:
+ {
+ LoadFooterTabL();
+ }
+ break;
+ default:
+ break;
+ }
+
+ // Set extend setting item
+ CDirectPrintUiPlugin* plugin = GetPluginMgr().CurrentPluginL();
+ if (plugin)
+ {
+ plugin->LoadExtendItemsL(*(iListBox->SettingItemArray()), iTabIndex);
+ }
+
+ iListBox->HandleChangeInItemArrayOrVisibilityL();
+ LOG("CDirectPrintPropertyView::LoadListL END");
+ }
+
+void CDirectPrintPropertyView::ReadDataL()
+ {
+ LOG("CDirectPrintPropertyView::ReadDataL BEGIN");
+
+ CDirectPrintModel& model = GetModel();
+ CPrinterProperty* property = model.GetCurrentPrinterPropertyL(TUid::Uid(0));
+
+ if (property)
+ {
+ TInt count = property->iPropertyItems.Count();
+ for (TInt i=0; i<count; i++)
+ {
+ switch (property->iPropertyItems[i].iItemId)
+ {
+ case EDirectPrintPaperPaperSize:
+ {
+ iPaperSize = property->iPropertyItems[i].iItemValue;
+ }
+ break;
+ case EDirectPrintPaperOrientation:
+ {
+ iOrientation = property->iPropertyItems[i].iItemValue;
+ }
+ break;
+ case EDirectPrintPaperHight:
+ {
+ iHight = property->iPropertyItems[i].iItemValue;
+ }
+ break;
+ case EDirectPrintPaperWidth:
+ {
+ iWidth = property->iPropertyItems[i].iItemValue;
+ }
+ break;
+ case EDirectPrintPagePrintPage:
+ {
+ iPrintPage = property->iPropertyItems[i].iItemValue;
+ }
+ break;
+ case EDirectPrintPagePrintRange:
+ {
+ iPrintRange.Copy(property->iPropertyItems[i].iItemTextValue);
+ }
+ break;
+ case EDirectPrintPageCopy:
+ {
+ iCopy = property->iPropertyItems[i].iItemValue;
+ }
+ break;
+ case EDirectPrintMarginLeftMargin:
+ {
+ iLeftMargin = property->iPropertyItems[i].iItemValue;
+ }
+ break;
+ case EDirectPrintMarginRightMargin:
+ {
+ iRightMargin = property->iPropertyItems[i].iItemValue;
+ }
+ break;
+ case EDirectPrintMarginTopMargin:
+ {
+ iTopMargin = property->iPropertyItems[i].iItemValue;
+ }
+ break;
+ case EDirectPrintMarginBottomMargin:
+ {
+ iBottomMargin = property->iPropertyItems[i].iItemValue;
+ }
+ break;
+ case EDirectPrintHeaderHeaderText:
+ {
+ iHeaderText.Copy(property->iPropertyItems[i].iItemTextValue);
+ }
+ break;
+ case EDirectPrintHeaderDistance:
+ {
+ iHeaderDistance = property->iPropertyItems[i].iItemValue;
+ }
+ break;
+ case EDirectPrintHeaderFirstPage:
+ {
+ iHeaderFirstPage = property->iPropertyItems[i].iItemValue;
+ }
+ break;
+ case EDirectPrintFooterFooterText:
+ {
+ iFooterText.Copy(property->iPropertyItems[i].iItemTextValue);
+ }
+ break;
+ case EDirectPrintFooterDistance:
+ {
+ iFooterDistance = property->iPropertyItems[i].iItemValue;
+ }
+ break;
+ case EDirectPrintFooterFirstPage:
+ {
+ iFooterFirstPage = property->iPropertyItems[i].iItemValue;
+ }
+ break;
+ default:
+ {
+ // Set extend setting item
+ CDirectPrintUiPlugin* plugin = GetPluginMgr().CurrentPluginL();
+ if (plugin)
+ {
+ plugin->ReadDataL(property->iPropertyItems[i]);
+ }
+ }
+ break;
+ }
+ }
+ }
+ else
+ {
+ model.SetCurrentProperty(model.PropertyCount());
+ NewDataL();
+ }
+
+ LOG("CDirectPrintPropertyView::ReadDataL END");
+ }
+
+void CDirectPrintPropertyView::WriteDataL()
+ {
+ LOG("CDirectPrintPropertyView::WriteDataL BEGIN");
+
+ CDirectPrintModel& model = GetModel();
+ CPrinterProperty* property = new (ELeave) CPrinterProperty();
+ CleanupStack::PushL(property);
+ property->iPrinterId = model.GetCurrentPrinterIdL();
+ property->iApplicationId = 0;
+
+ TDirectPrintPropertyData data1;
+ data1.iItemType = EDirectPrintPaperSettingTab;
+ data1.iItemId = EDirectPrintPaperPaperSize;
+ //data1.iItemName.Copy();
+ data1.iItemValue = iPaperSize;
+ property->iPropertyItems.Append(data1);
+
+ TDirectPrintPropertyData data2;
+ data2.iItemType = EDirectPrintPaperSettingTab;
+ data2.iItemId = EDirectPrintPaperOrientation;
+ //data2.iItemName.Copy();
+ data2.iItemValue = iOrientation;
+ property->iPropertyItems.Append(data2);
+
+ TDirectPrintPropertyData data3;
+ data3.iItemType = EDirectPrintPaperSettingTab;
+ data3.iItemId = EDirectPrintPaperHight;
+ //data3.iItemName.Copy();
+ data3.iItemValue = iHight;
+ property->iPropertyItems.Append(data3);
+
+ TDirectPrintPropertyData data4;
+ data4.iItemType = EDirectPrintPaperSettingTab;
+ data4.iItemId = EDirectPrintPaperWidth;
+ //data4.iItemName.Copy();
+ data4.iItemValue = iWidth;
+ property->iPropertyItems.Append(data4);
+
+ TDirectPrintPropertyData data5;
+ data5.iItemType = EDirectPrintPageSettingTab;
+ data5.iItemId = EDirectPrintPagePrintPage;
+ //data5.iItemName.Copy();
+ data5.iItemValue = iPrintPage;
+ property->iPropertyItems.Append(data5);
+
+ TDirectPrintPropertyData data6;
+ data6.iItemType = EDirectPrintPageSettingTab;
+ data6.iItemId = EDirectPrintPagePrintRange;
+ //data6.iItemName.Copy();
+ data6.iItemTextValue.Copy(iPrintRange);
+ property->iPropertyItems.Append(data6);
+
+ TDirectPrintPropertyData data7;
+ data7.iItemType = EDirectPrintPageSettingTab;
+ data7.iItemId = EDirectPrintPageCopy;
+ //data7.iItemName.Copy();
+ data7.iItemValue = iCopy;
+ property->iPropertyItems.Append(data7);
+
+ TDirectPrintPropertyData data8;
+ data8.iItemType = EDirectPrintMarginSettingTab;
+ data8.iItemId = EDirectPrintMarginLeftMargin;
+ //data8.iItemName.Copy();
+ data8.iItemValue = iLeftMargin;
+ property->iPropertyItems.Append(data8);
+
+ TDirectPrintPropertyData data9;
+ data9.iItemType = EDirectPrintMarginSettingTab;
+ data9.iItemId = EDirectPrintMarginRightMargin;
+ //data9.iItemName.Copy();
+ data9.iItemValue = iRightMargin;
+ property->iPropertyItems.Append(data9);
+
+ TDirectPrintPropertyData data10;
+ data10.iItemType = EDirectPrintMarginSettingTab;
+ data10.iItemId = EDirectPrintMarginTopMargin;
+ //data10.iItemName.Copy();
+ data10.iItemValue = iTopMargin;
+ property->iPropertyItems.Append(data10);
+
+ TDirectPrintPropertyData data11;
+ data11.iItemType = EDirectPrintMarginSettingTab;
+ data11.iItemId = EDirectPrintMarginBottomMargin;
+ //data11.iItemName.Copy();
+ data11.iItemValue = iBottomMargin;
+ property->iPropertyItems.Append(data11);
+
+ TDirectPrintPropertyData data12;
+ data12.iItemType = EDirectPrintHeaderSettingTab;
+ data12.iItemId = EDirectPrintHeaderHeaderText;
+ //data12.iItemName.Copy();
+ data12.iItemTextValue.Copy(iHeaderText);
+ property->iPropertyItems.Append(data12);
+
+ TDirectPrintPropertyData data13;
+ data13.iItemType = EDirectPrintHeaderSettingTab;
+ data13.iItemId = EDirectPrintHeaderDistance;
+ //data13.iItemName.Copy();
+ data13.iItemValue = iHeaderDistance;
+ property->iPropertyItems.Append(data13);
+
+ TDirectPrintPropertyData data14;
+ data14.iItemType = EDirectPrintHeaderSettingTab;
+ data14.iItemId = EDirectPrintHeaderFirstPage;
+ //data14.iItemName.Copy();
+ data14.iItemValue = iHeaderFirstPage;
+ property->iPropertyItems.Append(data14);
+
+ TDirectPrintPropertyData data15;
+ data15.iItemType = EDirectPrintFooterSettingTab;
+ data15.iItemId = EDirectPrintFooterFooterText;
+ //data15.iItemName.Copy();
+ data15.iItemTextValue.Copy(iFooterText);
+ property->iPropertyItems.Append(data15);
+
+ TDirectPrintPropertyData data16;
+ data16.iItemType = EDirectPrintFooterSettingTab;
+ data16.iItemId = EDirectPrintFooterDistance;
+ //data16.iItemName.Copy();
+ data16.iItemValue = iFooterDistance;
+ property->iPropertyItems.Append(data16);
+
+ TDirectPrintPropertyData data17;
+ data17.iItemType = EDirectPrintFooterSettingTab;
+ data17.iItemId = EDirectPrintFooterFirstPage;
+ //data17.iItemName.Copy();
+ data17.iItemValue = iFooterFirstPage;
+ property->iPropertyItems.Append(data17);
+
+ // Set extend setting item
+ CDirectPrintUiPlugin* plugin = GetPluginMgr().CurrentPluginL();
+ if (plugin)
+ {
+ plugin->WriteDataL(property->iPropertyItems);
+ }
+
+ CleanupStack::Pop(property);
+ model.SetPrinterPropertyL(property);
+
+ LOG("CDirectPrintPropertyView::WriteDataL END");
+ }
+
+void CDirectPrintPropertyView::NewDataL()
+ {
+ LOG("CDirectPrintPropertyView::NewDataL BEGIN");
+
+ iPaperSize = 0;
+ iOrientation = 0;
+ iHight = 0;
+ iWidth = 0;
+ iPrintPage = 0;
+ iPrintRange.Copy(_L(""));
+ iCopy = 1;
+ iLeftMargin = 2;
+ iRightMargin = 2;
+ iTopMargin = 2;
+ iBottomMargin = 2;
+ iHeaderText.Copy(_L(""));
+ iHeaderDistance = 0;
+ iHeaderFirstPage = 0;
+ iFooterText.Copy(_L(""));
+ iFooterDistance = 0;
+ iFooterFirstPage = 0;
+
+ // Set extend setting item
+ CDirectPrintUiPlugin* plugin = GetPluginMgr().CurrentPluginL();
+ if (plugin)
+ {
+ plugin->NewDataL();
+ }
+
+ LOG("CDirectPrintPropertyView::NewDataL END");
+ }
+
+void CDirectPrintPropertyView::LoadPaperTabL()
+ {
+ TBuf<25> itemTitle;
+
+ // Set common setting item
+ CAknEnumeratedTextPopupSettingItem* item1 = new (ELeave) CAknEnumeratedTextPopupSettingItem(1, iPaperSize);
+ CleanupStack::PushL(item1);
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_PROPERTYSETTING_ITEM_PAPERSIZE);
+ item1->ConstructL(EFalse, 1, itemTitle, NULL, R_DIRECTPRINT_PROPERTYSETTING_POPUP_SETTING_PAGE, -1, 0, R_DIRECTPRINT_PROPERTYSETTING_SIZE_POPUP_SETTING_TEXTS);
+ iListBox->SettingItemArray()->AppendL(item1);
+ CleanupStack::Pop(item1);
+
+ CAknEnumeratedTextPopupSettingItem* item2 = new (ELeave) CAknEnumeratedTextPopupSettingItem(2, iOrientation);
+ CleanupStack::PushL(item2);
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_PROPERTYSETTING_ITEM_ORIENTATION);
+ item2->ConstructL(EFalse, 2, itemTitle, NULL, R_DIRECTPRINT_PROPERTYSETTING_POPUP_SETTING_PAGE, -1, 0, R_DIRECTPRINT_PROPERTYSETTING_ORIENTATION_POPUP_SETTING_TEXTS);
+ iListBox->SettingItemArray()->AppendL(item2);
+ CleanupStack::Pop(item2);
+
+ CAknEnumeratedTextPopupSettingItem* item3 = new (ELeave) CAknEnumeratedTextPopupSettingItem(3, iMediaType);
+ CleanupStack::PushL(item3);
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_PROPERTYSETTING_ITEM_MEDIATYPE);
+ item3->ConstructL(EFalse, 3, itemTitle, NULL, R_DIRECTPRINT_PROPERTYSETTING_POPUP_SETTING_PAGE, -1, 0, R_DIRECTPRINT_PROPERTYSETTING_MEDIATYPE_POPUP_SETTING_TEXTS);
+ iListBox->SettingItemArray()->AppendL(item3);
+ CleanupStack::Pop(item3);
+ }
+
+void CDirectPrintPropertyView::LoadPageTabL()
+ {
+ TBuf<25> itemTitle;
+
+ // Set common setting item
+ CAknEnumeratedTextPopupSettingItem* item1 = new (ELeave) CAknEnumeratedTextPopupSettingItem(1, iPrintPage);
+ CleanupStack::PushL(item1);
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_PROPERTYSETTING_ITEM_PRINTPAGE);
+ item1->ConstructL(EFalse, 1, itemTitle, NULL, R_DIRECTPRINT_PROPERTYSETTING_POPUP_SETTING_PAGE, -1, 0, R_DIRECTPRINT_PROPERTYSETTING_RANGE_POPUP_SETTING_TEXTS);
+ iListBox->SettingItemArray()->AppendL(item1);
+ CleanupStack::Pop(item1);
+
+ CAknTextSettingItem* item2 = new (ELeave) CAknTextSettingItem(2, iPrintRange);
+ CleanupStack::PushL(item2);
+ item2->SetEmptyItemTextL( _L("None") );
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_PROPERTYSETTING_ITEM_PRINTRANGE);
+ item2->ConstructL(EFalse, 2, itemTitle, NULL, R_DIRECTPRINT_PROPERTYSETTING_TEXT_SETTING_PAGE, -1);
+ iListBox->SettingItemArray()->AppendL(item2);
+ CleanupStack::Pop(item2);
+
+ CAknIntegerEdwinSettingItem* item3 = new (ELeave) CAknIntegerEdwinSettingItem(3, iCopy);
+ CleanupStack::PushL(item3);
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_PROPERTYSETTING_ITEM_COPY);
+ item3->ConstructL(EFalse, 3, itemTitle, NULL, R_DIRECTPRINT_PROPERTYSETTING_INTEGER_SETTING_PAGE, -1);
+ iListBox->SettingItemArray()->AppendL(item3);
+ CleanupStack::Pop(item3);
+ }
+
+void CDirectPrintPropertyView::LoadMarginTabL()
+ {
+ TBuf<25> itemTitle;
+
+ // Set common setting item
+ CAknIntegerEdwinSettingItem* item1 = new (ELeave) CAknIntegerEdwinSettingItem(1, iLeftMargin);
+ CleanupStack::PushL(item1);
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_PROPERTYSETTING_ITEM_LEFTMARGIN);
+ item1->ConstructL(EFalse, 1, itemTitle, NULL, R_DIRECTPRINT_PROPERTYSETTING_INTEGER_SETTING_PAGE, -1);
+ iListBox->SettingItemArray()->AppendL(item1);
+ CleanupStack::Pop(item1);
+
+ CAknIntegerEdwinSettingItem* item2 = new (ELeave) CAknIntegerEdwinSettingItem(2, iRightMargin);
+ CleanupStack::PushL(item2);
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_PROPERTYSETTING_ITEM_RIGHTMARGIN);
+ item2->ConstructL(EFalse, 2, itemTitle, NULL, R_DIRECTPRINT_PROPERTYSETTING_INTEGER_SETTING_PAGE, -1);
+ iListBox->SettingItemArray()->AppendL(item2);
+ CleanupStack::Pop(item2);
+
+ CAknIntegerEdwinSettingItem* item3 = new (ELeave) CAknIntegerEdwinSettingItem(3, iTopMargin);
+ CleanupStack::PushL(item3);
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_PROPERTYSETTING_ITEM_TOPMARGIN);
+ item3->ConstructL(EFalse, 3, itemTitle, NULL, R_DIRECTPRINT_PROPERTYSETTING_INTEGER_SETTING_PAGE, -1);
+ iListBox->SettingItemArray()->AppendL(item3);
+ CleanupStack::Pop(item3);
+
+ CAknIntegerEdwinSettingItem* item4 = new (ELeave) CAknIntegerEdwinSettingItem(4, iBottomMargin);
+ CleanupStack::PushL(item4);
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_PROPERTYSETTING_ITEM_BOTTOMMARGIN);
+ item4->ConstructL(EFalse, 4, itemTitle, NULL, R_DIRECTPRINT_PROPERTYSETTING_INTEGER_SETTING_PAGE, -1);
+ iListBox->SettingItemArray()->AppendL(item4);
+ CleanupStack::Pop(item4);
+ }
+
+void CDirectPrintPropertyView::LoadHeaderTabL()
+ {
+ TBuf<25> itemTitle;
+
+ // Set common setting item
+ CAknTextSettingItem* item1 = new (ELeave) CAknTextSettingItem(1, iHeaderText);
+ CleanupStack::PushL(item1);
+ item1->SetEmptyItemTextL( _L("None") );
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_PROPERTYSETTING_ITEM_HEADERTEXT);
+ item1->ConstructL(EFalse, 1, itemTitle, NULL, R_DIRECTPRINT_PROPERTYSETTING_TEXT_SETTING_PAGE, -1);
+ iListBox->SettingItemArray()->AppendL(item1);
+ CleanupStack::Pop(item1);
+
+ CAknIntegerEdwinSettingItem* item2 = new (ELeave) CAknIntegerEdwinSettingItem(2, iHeaderDistance);
+ CleanupStack::PushL(item2);
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_PROPERTYSETTING_ITEM_HEADERDISTANCE);
+ item2->ConstructL(EFalse, 2, itemTitle, NULL, R_DIRECTPRINT_PROPERTYSETTING_INTEGER_SETTING_PAGE, -1);
+ iListBox->SettingItemArray()->AppendL(item2);
+ CleanupStack::Pop(item2);
+
+ CAknEnumeratedTextPopupSettingItem* item3 = new (ELeave) CAknEnumeratedTextPopupSettingItem(3, iHeaderFirstPage);
+ CleanupStack::PushL(item3);
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_PROPERTYSETTING_ITEM_HEADERFIRSTPAGE);
+ item3->ConstructL(EFalse, 3, itemTitle, NULL, R_DIRECTPRINT_PROPERTYSETTING_POPUP_SETTING_PAGE, -1, 0, R_DIRECTPRINT_PROPERTYSETTING_PRINT_POPUP_SETTING_TEXTS);
+ iListBox->SettingItemArray()->AppendL(item3);
+ CleanupStack::Pop(item3);
+ }
+
+void CDirectPrintPropertyView::LoadFooterTabL()
+ {
+ TBuf<25> itemTitle;
+
+ // Set common setting item
+ CAknTextSettingItem* item1 = new (ELeave) CAknTextSettingItem(1, iFooterText);
+ CleanupStack::PushL(item1);
+ item1->SetEmptyItemTextL( _L("None") );
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_PROPERTYSETTING_ITEM_FOOTERTEXT);
+ item1->ConstructL(EFalse, 1, itemTitle, NULL, R_DIRECTPRINT_PROPERTYSETTING_TEXT_SETTING_PAGE, -1);
+ iListBox->SettingItemArray()->AppendL(item1);
+ CleanupStack::Pop(item1);
+
+ CAknIntegerEdwinSettingItem* item2 = new (ELeave) CAknIntegerEdwinSettingItem(2, iFooterDistance);
+ CleanupStack::PushL(item2);
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_PROPERTYSETTING_ITEM_FOOTERDISTANCE);
+ item2->ConstructL(EFalse, 2, itemTitle, NULL, R_DIRECTPRINT_PROPERTYSETTING_INTEGER_SETTING_PAGE, -1);
+ iListBox->SettingItemArray()->AppendL(item2);
+ CleanupStack::Pop(item2);
+
+ CAknEnumeratedTextPopupSettingItem* item3 = new (ELeave) CAknEnumeratedTextPopupSettingItem(3, iFooterFirstPage);
+ CleanupStack::PushL(item3);
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_PROPERTYSETTING_ITEM_FOOTERFIRSTPAGE);
+ item3->ConstructL(EFalse, 3, itemTitle, NULL, R_DIRECTPRINT_PROPERTYSETTING_POPUP_SETTING_PAGE, -1, 0, R_DIRECTPRINT_PROPERTYSETTING_PRINT_POPUP_SETTING_TEXTS);
+ iListBox->SettingItemArray()->AppendL(item3);
+ CleanupStack::Pop(item3);
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/ui/src/directprintsearchresultview.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,255 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <aknviewappui.h>
+#include <akntoolbar.h>
+#include <barsread.h>
+#include <DirectPrintApp.rsg>
+#include <stringloader.h> // StringLoader
+
+#include "clog.h"
+#include "directprintapp.hrh"
+#include "directprintsearchresultview.h"
+
+CDirectPrintSearchResultView::CDirectPrintSearchResultView()
+ {
+ iListBox = NULL;
+ }
+
+CDirectPrintSearchResultView::~CDirectPrintSearchResultView()
+ {
+ AppUi()->RemoveFromViewStack(*this, iListBox);
+
+ if (iPeriodic)
+ {
+ iPeriodic->Cancel();
+ delete iPeriodic;
+ iPeriodic = NULL;
+ }
+
+ if (iProgressDialog)
+ {
+ TRAP_IGNORE(iProgressDialog->ProcessFinishedL());
+ delete iProgressDialog;
+ iProgressDialog = NULL;
+ }
+ if (iProgressMessage)
+ {
+ delete iProgressMessage;
+ iProgressMessage = NULL;
+ }
+
+ delete iListBox;
+ delete iItemArray;
+ }
+
+CDirectPrintSearchResultView* CDirectPrintSearchResultView::NewL()
+ {
+ CDirectPrintSearchResultView* self = CDirectPrintSearchResultView::NewLC();
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+CDirectPrintSearchResultView* CDirectPrintSearchResultView::NewLC()
+ {
+ CDirectPrintSearchResultView* self = new(ELeave) CDirectPrintSearchResultView();
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ return self;
+ }
+
+void CDirectPrintSearchResultView::ConstructL()
+ {
+ LOG("CDirectPrintSearchResultView::ConstructL BEGIN");
+ BaseConstructL(R_DIRECTPRINT_SEARCHRESULT_VIEW);
+
+ iViewId = TUid::Uid(EDirectPrintSearchResultViewId);
+
+ iItemArray = new(ELeave) CDesCArrayFlat(3);
+ LOG("CDirectPrintSearchResultView::ConstructL END");
+ }
+
+void CDirectPrintSearchResultView::HandleCommandL(TInt aCommand)
+ {
+ switch (aCommand)
+ {
+ case EAknSoftkeyCancel:
+ {
+ AppUi()->HandleCommandL(EDirectPrintCmdIdSearchResultViewCancel);
+ }
+ break;
+ case EDirectPrintCmdIdSearchResultViewSearch:
+ {
+ AppUi()->HandleCommandL(aCommand);
+ }
+ break;
+ default:
+ {
+ AppUi()->HandleCommandL(aCommand);
+ }
+ break;
+ }
+ }
+
+void CDirectPrintSearchResultView::HandleListIndexL(TInt /*aIndex*/)
+ {
+ AppUi()->HandleCommandL(EDirectPrintCmdIdSearchResultViewSelect);
+ }
+
+void CDirectPrintSearchResultView::OfferToolbarEventL(TInt aCommand)
+ {
+ switch (aCommand)
+ {
+ case EDirectPrintCmdIdPrinterListViewEdit:
+ {
+ AppUi()->HandleCommandL(aCommand);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+void CDirectPrintSearchResultView::DoActivateL(const TVwsViewId& /*aPrevViewId*/, TUid /*aCustomMessageId*/, const TDesC8& /*aCustomMessage*/)
+ {
+ LOG("CDirectPrintSearchResultView::DoActivateL BEGIN");
+ CAknToolbar* toolbar = AppUi()->CurrentFixedToolbar();
+ toolbar->SetToolbarObserver(this);
+
+ // Create list box
+ if (!iListBox)
+ {
+ iListBox = CDirectPrintListBox::NewL(ClientRect(), iItemArray);
+ iListBox->SetMopParent(this);
+ iListBox->SetListObserver(this);
+ }
+ AppUi()->AddToStackL(*this, iListBox);
+ iListBox->MakeVisible(ETrue);
+
+ // set the title pane
+ SetActiveTitleL(R_DIRECTPRINT_PRINTERSEARCH_TITLE);
+
+ StartSearchL();
+ LOG("CDirectPrintSearchResultView::DoActivateL END");
+ }
+
+void CDirectPrintSearchResultView::DoDeactivate()
+ {
+ LOG("CDirectPrintSearchResultView::DoDeactivate BEGIN");
+ iListBox->MakeVisible(EFalse);
+ AppUi()->RemoveFromViewStack(*this, iListBox);
+ LOG("CDirectPrintSearchResultView::DoDeactivate END");
+ }
+
+void CDirectPrintSearchResultView::StartSearchProgressNoteL()
+ {
+ // Delete possible previous CAknProgressDialog.
+ if (iProgressDialog)
+ {
+ delete iProgressDialog;
+ iProgressDialog = NULL;
+ }
+
+ if (!iProgressMessage)
+ {
+ // read progress message
+ iProgressMessage = StringLoader::LoadL( R_DIRECTPRINT_MSG_SEARCHING_PROGRESS );
+ }
+
+ // Create new CAknProgressDialog.
+ iProgressDialog = new ( ELeave ) CAknProgressDialog( reinterpret_cast
+ <CEikDialog**>
+ ( &iProgressDialog ) );
+ iProgressDialog->SetCallback( this );
+ iProgressDialog->PrepareLC( R_DIRECTPRINT_SEARCH_PROGRESS_NOTE );
+ //iProgressInfo = iProgressDialog->GetProgressInfoL();
+ //iProgressInfo->SetFinalValue( 1 );
+
+ iProgressDialog->SetTextL(*iProgressMessage);
+ iProgressDialog->RunLD();
+ }
+
+void CDirectPrintSearchResultView::EndProgressNoteL()
+ {
+ if (iProgressDialog)
+ {
+ iProgressDialog->ProcessFinishedL();
+ if (iProgressDialog)
+ {
+ delete iProgressDialog;
+ iProgressDialog = NULL;
+ }
+ }
+ }
+
+void CDirectPrintSearchResultView::StartSearchL()
+ {
+ const TInt KSearchTimeoutTime(10000000); // 10 sec
+
+ if (iPeriodic)
+ {
+ iPeriodic->Cancel();
+ }
+ else
+ {
+ iPeriodic = CPeriodic::NewL(CActive::EPriorityIdle);
+ }
+ iPeriodic->Start(KSearchTimeoutTime, KSearchTimeoutTime, TCallBack(HandleTimeout, this));
+ StartSearchProgressNoteL();
+ }
+
+TInt CDirectPrintSearchResultView::HandleTimeout(TAny* aAny)
+ {
+ // Setting size button back to up state
+
+ CDirectPrintSearchResultView* self = static_cast<CDirectPrintSearchResultView*>( aAny );
+ // Cancel timer
+ TRAPD( err, self->HandleTimeoutL());
+ return err;
+ }
+
+void CDirectPrintSearchResultView::HandleTimeoutL()
+ {
+ iTimeoutCount++;
+ if (iTimeoutCount == 1)
+ {
+ // for test
+ TBuf<50> buf;
+ buf.Copy(_L("\tCanon MP640_000XXX\t"));
+ iItemArray->AppendL(buf);
+ iListBox->DrawNow();
+ }
+ else if (iTimeoutCount > 1)
+ {
+ EndProgressNoteL();
+ if (iPeriodic)
+ {
+ iPeriodic->Cancel();
+ delete iPeriodic;
+ iPeriodic = NULL;
+ }
+ iTimeoutCount = 0;
+ }
+ }
+
+void CDirectPrintSearchResultView::DialogDismissedL( TInt aButtonId )
+ {
+ //TInt button = aButtonId;
+ }
+
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/ui/src/directprintsettinglistbox.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "clog.h"
+#include "directprintapp.hrh"
+#include "directprintsettinglistbox.h"
+
+CDirectPrintSettingListBox::CDirectPrintSettingListBox()
+ {
+ }
+
+CDirectPrintSettingListBox::~CDirectPrintSettingListBox()
+ {
+ }
+
+CDirectPrintSettingListBox* CDirectPrintSettingListBox::NewL(const TRect& aRect)
+ {
+ CDirectPrintSettingListBox* self = CDirectPrintSettingListBox::NewLC(aRect);
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+CDirectPrintSettingListBox* CDirectPrintSettingListBox::NewLC(const TRect& aRect)
+ {
+ CDirectPrintSettingListBox* self = new(ELeave) CDirectPrintSettingListBox();
+ CleanupStack::PushL(self);
+ self->ConstructL(aRect);
+ return self;
+ }
+
+void CDirectPrintSettingListBox::ConstructL(const TRect& aRect)
+ {
+ CreateWindowL();
+ SetRect(aRect);
+ }
+
+void CDirectPrintSettingListBox::EditItemL(TInt aIndex, TBool aCalledFromMenu)
+ {
+ TBuf<25> beforeText, afterText;
+ beforeText.Copy((*SettingItemArray())[aIndex]->SettingTextL());
+
+ CAknSettingItemList::EditItemL(aIndex, aCalledFromMenu);
+
+ if (iObserver)
+ {
+ afterText.Copy((*SettingItemArray())[aIndex]->SettingTextL());
+ TBool changed = (beforeText.Compare(afterText) != 0);
+ iObserver->HandleEditItemL(aIndex, changed);
+ }
+ }
+
+void CDirectPrintSettingListBox::SetSettingListObserver(MDirectPrintSettingListObserver* aObserver)
+ {
+ iObserver = aObserver;
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/ui/src/directprintsettingview.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,669 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// System include files
+#include <aknviewappui.h>
+#include <akntoolbar.h>
+#include <barsread.h>
+#include <DirectPrintApp.rsg>
+#include <AknSettingItemList.h>
+#include <eiklbx.h>
+#include <bautils.h>
+#include <driveinfo.h>
+#include <pathinfo.h>
+
+// User include files
+#include "clog.h"
+#include "directprintapp.hrh"
+#include "DirectPrintAppAppUi.h"
+#include "DirectPrintEngine.h"
+#include "DirectPrintModel.h"
+#include "directprintsettingview.h"
+#include "DirectPrintBearerMgr.h"
+
+#include "directprintbasecapability.h"
+#include "directprintlistcapability.h"
+#include "directprinttextcapability.h"
+#include "directprintprintsettings.h"
+#include "imageprint.h"
+#include "directprintcapabilitycodes.h"
+
+CDirectPrintPrinterSettingView::CDirectPrintPrinterSettingView()
+ {
+ iListBox = NULL;
+ }
+
+CDirectPrintPrinterSettingView::~CDirectPrintPrinterSettingView()
+ {
+ AppUi()->RemoveFromViewStack(*this, iListBox);
+ delete iListBox;
+ }
+
+CDirectPrintPrinterSettingView* CDirectPrintPrinterSettingView::NewL()
+ {
+ CDirectPrintPrinterSettingView* self = CDirectPrintPrinterSettingView::NewLC();
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+CDirectPrintPrinterSettingView* CDirectPrintPrinterSettingView::NewLC()
+ {
+ CDirectPrintPrinterSettingView* self = new(ELeave) CDirectPrintPrinterSettingView();
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ return self;
+ }
+
+void CDirectPrintPrinterSettingView::ConstructL()
+ {
+ LOG("CDirectPrintPrinterSettingView::ConstructL BEGIN");
+ BaseConstructL(R_DIRECTPRINT_PRINTERSETTING_VIEW);
+
+ iViewId = TUid::Uid(EDirectPrintPrinterSettingViewId);
+ LOG("CDirectPrintPrinterSettingView::ConstructL END");
+ }
+
+void CDirectPrintPrinterSettingView::HandleCommandL(TInt aCommand)
+ {
+ switch (aCommand)
+ {
+ case EAknSoftkeyBack:
+ {
+ iListBox->StoreSettingsL();
+ StoreDriverInfoL();
+ StoreTypeInfoL();
+ StoreBearerInfoL();
+ StoreExtendSettingsL();
+ WriteDataL(); // write to model
+ GetBearerMgr()->SetJobSettings(); // write to bearer
+ GetModel().SetIsNewData(EFalse);
+
+ AppUi()->HandleCommandL(EDirectPrintCmdIdPrinterSettingViewBack);
+ }
+ break;
+ default:
+ {
+ AppUi()->HandleCommandL(aCommand);
+ }
+ break;
+ }
+ }
+
+void CDirectPrintPrinterSettingView::HandleEditItemL(TInt aIndex, TBool aChanged)
+ {
+ if (aChanged)
+ {
+ TBuf<25> titleBearer;
+ CEikonEnv::Static()->ReadResource(titleBearer, R_DIRECTPRINT_PRINTERSETTING_ITEM_BEARER);
+
+ TPtrC name = (*(iListBox->SettingItemArray()))[aIndex]->SettingName();
+ if (name.Compare(titleBearer) == 0)
+ {
+ ReloadListL();
+ }
+ }
+ }
+
+void CDirectPrintPrinterSettingView::DoActivateL(const TVwsViewId& /*aPrevViewId*/, TUid /*aCustomMessageId*/, const TDesC8& /*aCustomMessage*/)
+ {
+ LOG("CDirectPrintPrinterSettingView::DoActivateL BEGIN");
+
+ if (GetModel().IsNewData())
+ {
+ NewDataL();
+ }
+ else
+ {
+ ReadDataL();
+ }
+
+ if (!iListBox)
+ {
+ // Create list box
+ iListBox = CDirectPrintSettingListBox::NewL(ClientRect());
+ iListBox->SetMopParent(this);
+ iListBox->SetSettingListObserver(this);
+ iListBox->ConstructFromResourceL(R_DIRECTPRINT_PRINTERSETTING_ITEM_LIST);
+ iListBox->ActivateL();
+ }
+ else
+ {
+ iListBox->SettingItemArray()->ResetAndDestroy();
+ }
+
+ LoadListL();
+ LoadDriverInfoL();
+ LoadTypeInfoL();
+ LoadBearerInfoL();
+ LoadExtendListL();
+ iListBox->LoadSettingsL();
+ AppUi()->AddToStackL(*this, iListBox);
+ iListBox->MakeVisible(ETrue);
+ iListBox->DrawNow();
+
+ // set the title pane
+ SetActiveTitleL(R_DIRECTPRINT_PRINTERSETTING_TITLE);
+ LOG("CDirectPrintPrinterSettingView::DoActivateL END");
+ }
+
+void CDirectPrintPrinterSettingView::DoDeactivate()
+ {
+ LOG("CDirectPrintPrinterSettingView::DoDeactivate BEGIN");
+ iListBox->MakeVisible(EFalse);
+ AppUi()->RemoveFromViewStack(*this, iListBox);
+ LOG("CDirectPrintPrinterSettingView::DoDeactivate END");
+ }
+
+void CDirectPrintPrinterSettingView::LoadListL()
+ {
+ LOG("CDirectPrintPrinterSettingView::LoadListL BEGIN");
+
+ TBuf<25> itemTitle;
+
+ // Common setting item
+ CAknTextSettingItem* item1 = new (ELeave) CAknTextSettingItem(ESettingViewItemPrinterName, iPrinterName);
+ CleanupStack::PushL(item1);
+ item1->SetEmptyItemTextL( _L("None") );
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_PRINTERSETTING_ITEM_PRINTERNAME);
+ item1->ConstructL(EFalse, ESettingViewItemPrinterName, itemTitle, NULL, R_DIRECTPRINT_PRINTERSETTING_TEXT_SETTING_PAGE, -1);
+ iListBox->SettingItemArray()->AppendL(item1);
+ CleanupStack::Pop(item1);
+
+ LOG("CDirectPrintPrinterSettingView::LoadListL 1");
+
+ iDriver = 0;
+ CAknEnumeratedTextPopupSettingItem* item2 = new (ELeave) CAknEnumeratedTextPopupSettingItem(ESettingViewItemDriver, iDriver);
+ CleanupStack::PushL(item2);
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_PRINTERSETTING_ITEM_DRIVER);
+ item2->ConstructL(EFalse, ESettingViewItemDriver, itemTitle, NULL, R_DIRECTPRINT_PRINTERSETTING_POPUP_SETTING_PAGE, -1, 0, R_DIRECTPRINT_PRINTERSETTING_POPUP_SETTING_TEXTS);
+
+ LOG("CDirectPrintPrinterSettingView::LoadListL 2");
+ // set printer driver
+ {
+ const TInt KSettingItemArrayGranularity = 5;
+ // Construct the array
+ CArrayPtr<CAknEnumeratedText>* enumeratedTextArray;
+ enumeratedTextArray = new( ELeave ) CArrayPtrFlat<CAknEnumeratedText>( KSettingItemArrayGranularity );
+ CleanupStack::PushL( enumeratedTextArray );
+
+ // Construct a dummy array for popup text, needed to avoid a panic
+ CArrayPtr<HBufC>* popupTextArray;
+ popupTextArray = new( ELeave ) CArrayPtrFlat<HBufC>( KSettingItemArrayGranularity );
+ CleanupStack::PushL( popupTextArray );
+
+ CDirectPrintAppAppUi* appui = static_cast<CDirectPrintAppAppUi*>( AppUi() );
+ CDirectPrintEngine* engine = appui->Engine();
+
+ // Read in the texts to be used in the setting item list
+ TInt index;
+ // Loop through all the texts
+
+ LOG1("ModelCount=[%d]", engine->ModelCount());
+
+ for (index=0; index < engine->ModelCount(); index++)
+ {
+ HBufC* thisText = HBufC::NewLC(KMaxPrinterModelNameLength);
+ TPtr thisTextDes = thisText->Des();
+ engine->ModelName(index, thisTextDes);
+ CAknEnumeratedText* enumeratedText = new( ELeave ) CAknEnumeratedText( index, thisText );
+ CleanupStack::Pop( thisText );
+ CleanupStack::PushL( enumeratedText );
+ enumeratedTextArray->AppendL( enumeratedText );
+ CleanupStack::Pop( enumeratedText );
+ }
+ if (engine->ModelCount() > 0)
+ {
+ item2->SetEnumeratedTextArrays( enumeratedTextArray, popupTextArray );
+ }
+ CleanupStack::Pop( popupTextArray );
+ CleanupStack::Pop( enumeratedTextArray );
+ }
+ LOG("CDirectPrintPrinterSettingView::LoadListL 2-2");
+
+ iListBox->SettingItemArray()->AppendL(item2);
+ CleanupStack::Pop(item2);
+
+ LOG("CDirectPrintPrinterSettingView::LoadListL 3");
+ iType = 0;
+ CAknEnumeratedTextPopupSettingItem* item3 = new (ELeave) CAknEnumeratedTextPopupSettingItem(ESettingViewItemType, iType);
+ CleanupStack::PushL(item3);
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_PRINTERSETTING_ITEM_TYPE);
+ item3->ConstructL(EFalse, ESettingViewItemType, itemTitle, NULL, R_DIRECTPRINT_PRINTERSETTING_POPUP_SETTING_PAGE, -1, 0, R_DIRECTPRINT_PRINTERSETTING_TYPE_POPUP_SETTING_TEXTS);
+ iListBox->SettingItemArray()->AppendL(item3);
+ CleanupStack::Pop(item3);
+
+ iBearer = 0;
+ LOG("CDirectPrintPrinterSettingView::LoadListL 4");
+ CAknEnumeratedTextPopupSettingItem* item4 = new (ELeave) CAknEnumeratedTextPopupSettingItem(ESettingViewItemBearer, iBearer);
+ CleanupStack::PushL(item4);
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_PRINTERSETTING_ITEM_BEARER);
+ item4->ConstructL(EFalse, ESettingViewItemBearer, itemTitle, NULL, R_DIRECTPRINT_PRINTERSETTING_POPUP_SETTING_PAGE, -1, 0, R_DIRECTPRINT_PRINTERSETTING_BEARER_POPUP_SETTING_TEXTS);
+
+ SetBearerListL(item4);
+
+ iListBox->SettingItemArray()->AppendL(item4);
+ CleanupStack::Pop(item4);
+
+ LOG("CDirectPrintPrinterSettingView::LoadListL xxx");
+
+ iListBox->ListBox()->SetCurrentItemIndex(0);
+ LOG("CDirectPrintPrinterSettingView::LoadListL xx");
+ iListBox->HandleChangeInItemArrayOrVisibilityL();
+ LOG("CDirectPrintPrinterSettingView::LoadListL END");
+ }
+
+void CDirectPrintPrinterSettingView::LoadExtendListL()
+ {
+ // Initialize capabilities for bearer
+ GetBearerMgr()->InitCapabilitiesL(iBearer);
+
+ // Extend setting item
+ CDirectPrintPrintSettings* printSettings = GetBearerMgr()->PrinterSettingsL();
+ TInt count = printSettings->iCapabilities.Count();
+ for (TInt i=0; i<count; i++)
+ {
+ CAknSettingItem* item = printSettings->iCapabilities[i]->SettingItemLC(ESettingViewItemExtent+i);
+ iListBox->SettingItemArray()->AppendL(item);
+ CleanupStack::Pop(item);
+ }
+
+ LoadExtendSettingsL();
+
+ iListBox->HandleChangeInItemArrayOrVisibilityL();
+ }
+
+void CDirectPrintPrinterSettingView::ReloadListL()
+ {
+ iListBox->StoreSettingsL();
+ StoreDriverInfoL();
+ StoreTypeInfoL();
+ StoreBearerInfoL();
+ StoreExtendSettingsL();
+
+ iListBox->SettingItemArray()->ResetAndDestroy();
+ LoadListL();
+ LoadDriverInfoL();
+ LoadTypeInfoL();
+ LoadBearerInfoL();
+
+ LoadExtendListL();
+
+ iListBox->LoadSettingsL();
+ iListBox->DrawNow();
+ }
+
+void CDirectPrintPrinterSettingView::SetBearerListL(CAknEnumeratedTextPopupSettingItem* item)
+ {
+ TInt err = GetBearerMgr()->GetProtocolNames(iBearerList);
+ if (!err)
+ {
+ CArrayPtr<CAknEnumeratedText>* textArray = item->EnumeratedTextArray();
+ textArray->ResetAndDestroy();
+
+ TInt count = iBearerList.Count();
+ for (TInt i=0; i<count; i++)
+ {
+ CAknEnumeratedText* enumText = new (ELeave) CAknEnumeratedText(i, iBearerList[i].iName.AllocLC());
+ CleanupStack::Pop();
+ CleanupStack::PushL(enumText);
+ textArray->AppendL(enumText);
+ CleanupStack::Pop();
+ }
+ }
+ }
+
+void CDirectPrintPrinterSettingView::ReadDataL()
+ {
+ LOG("CDirectPrintPrinterSettingView::ReadDataL BEGIN");
+ CDirectPrintModel& model = GetModel();
+ TDirectPrintPrinterData printerData;
+ TInt index = model.SelectPrinter();
+ if (index >= 0)
+ {
+ model.GetPrinterDataL(index, printerData);
+ }
+ else
+ {
+ model.SetCurrentPrinter(0);
+ }
+
+ TDirectPrintBearerData bearerData;
+ index = model.CurrentBearer();
+ if (index >= 0)
+ {
+ //model.GetBearerDataL(index, bearerData);
+ model.GetSelectedBearerDataL(bearerData);
+ }
+ else
+ {
+ model.SetCurrentBearer(0);
+ }
+
+ iPrinterId = printerData.iPrinterId;
+ iPrinterName.Copy(printerData.iPrinterName);
+ iDriverName.Copy(printerData.iDriverName);
+ iTypeName.Copy(printerData.iTypeName);
+ //iDriver = 1;
+ //iBearer = 1;
+ //iAccessPoint = 0;
+ iAccessPointName.Copy(bearerData.iAccessPoint);
+ iBearerName.Copy(bearerData.iBearerName);
+ iPort = bearerData.iPort;
+ if (bearerData.iHostName.Length() > 0)
+ {
+ iHost.Copy(bearerData.iHostName);
+ }
+ iUserName.Copy(bearerData.iUserName);
+ iQue.Copy(bearerData.iQueName);
+
+ LOG("CDirectPrintPrinterSettingView::ReadDataL END");
+ }
+
+void CDirectPrintPrinterSettingView::WriteDataL()
+ {
+ LOG("CDirectPrintPrinterSettingView::WriteDataL BEGIN");
+ TDirectPrintPrinterData printerData;
+ printerData.iPrinterId = iPrinterId;
+ printerData.iPrinterName.Copy(iPrinterName);
+// printerData.iPrinterDriver = iDriverUid;
+ printerData.iDriverName.Copy(iDriverName);
+// printerData.iPrinterType = iType;
+ printerData.iTypeName.Copy(iTypeName);
+
+ TDirectPrintBearerData bearerData;
+ bearerData.iPrinterId = iPrinterId;
+ bearerData.iBearerName.Copy(iBearerName);
+ bearerData.iAccessPoint.Copy(iAccessPointName);
+ bearerData.iHostName.Copy(iHost);
+ bearerData.iPort = iPort;
+ bearerData.iUserName.Copy(iUserName);
+ bearerData.iQueName.Copy(iQue);
+
+ CDirectPrintModel& model = GetModel();
+ if (model.IsNewData())
+ {
+ if (model.PrinterCount() == 0)
+ {
+ model.SetCurrentPrinter(0);
+ model.SetCurrentBearer(0);
+ }
+ model.SetPrinterDataL(model.PrinterCount(), printerData);
+ model.SetBearerDataL(model.BearerCount(), bearerData);
+ }
+ else
+ {
+ model.SetPrinterDataL(model.SelectPrinter(), printerData);
+ //model.SetBearerDataL(model.CurrentBearer(), bearerData);
+ model.SetBearerDataL(bearerData);
+ }
+ LOG("CDirectPrintPrinterSettingView::WriteDataL END");
+ }
+
+void CDirectPrintPrinterSettingView::NewDataL()
+ {
+ CDirectPrintModel& model = GetModel();
+ TInt count = model.PrinterCount();
+
+ TBuf<50> buf;
+ TBool IsNewName = EFalse;
+ for (TInt i=1; !IsNewName; i++)
+ {
+ buf.Format(_L("Printer%d"), count+i);
+ IsNewName = ETrue;
+
+ for (TInt j=0; j<count; j++)
+ {
+ TDirectPrintPrinterData printerData;
+ model.GetPrinterDataL(j, printerData);
+ if (printerData.iPrinterName.Compare(buf) == 0)
+ {
+ IsNewName = EFalse;
+ break;
+ }
+ }
+ }
+
+ iPrinterId = model.NewPrinterId();
+ iPrinterName.Copy(buf);
+ iDriver = 0;
+ iBearer = 0;
+ iAccessPoint = 0;
+// iAccessPointName.Copy(_L("WLAN_ap1"));
+// iHostIp.SetAddress(3232235530);
+ iPort = 80;
+ iUserName.Copy(_L(""));
+ iQue.Copy(_L(""));
+ }
+
+void CDirectPrintPrinterSettingView::LoadDriverInfoL()
+ {
+ TBuf<25> itemTitle;
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_PRINTERSETTING_ITEM_DRIVER);
+ CAknEnumeratedTextPopupSettingItem* item = static_cast<CAknEnumeratedTextPopupSettingItem*>(GetSettingItemL(itemTitle));
+ CArrayPtr<CAknEnumeratedText>* textArray = item->EnumeratedTextArray();
+ TInt count = textArray->Count();
+
+ for (TInt i=0; i<count; i++)
+ {
+ if (iDriverName.Compare((*textArray)[i]->Value()->Des()) == 0)
+ {
+ iDriver = i;
+ }
+ }
+ }
+
+void CDirectPrintPrinterSettingView::LoadTypeInfoL()
+ {
+ TBuf<25> itemTitle;
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_PRINTERSETTING_ITEM_TYPE);
+ CAknEnumeratedTextPopupSettingItem* item = static_cast<CAknEnumeratedTextPopupSettingItem*>(GetSettingItemL(itemTitle));
+ CArrayPtr<CAknEnumeratedText>* textArray = item->EnumeratedTextArray();
+ TInt count = textArray->Count();
+
+ for (TInt i=0; i<count; i++)
+ {
+ if (iTypeName.Compare((*textArray)[i]->Value()->Des()) == 0)
+ {
+ iType = i;
+ }
+ }
+ }
+
+void CDirectPrintPrinterSettingView::LoadBearerInfoL()
+ {
+ TBuf<25> itemTitle;
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_PRINTERSETTING_ITEM_BEARER);
+ CAknEnumeratedTextPopupSettingItem* item = static_cast<CAknEnumeratedTextPopupSettingItem*>(GetSettingItemL(itemTitle));
+ CArrayPtr<CAknEnumeratedText>* textArray = item->EnumeratedTextArray();
+ TInt count = textArray->Count();
+
+ for (TInt i=0; i<count; i++)
+ {
+ if (iBearerName.Compare((*textArray)[i]->Value()->Des()) == 0)
+ {
+ iBearer = i;
+ }
+ }
+ }
+
+void CDirectPrintPrinterSettingView::LoadItemInfoL(TInt aResouceId, const TDesC& aInfo, TInt& aIndex)
+ {
+ TBuf<25> itemTitle;
+ CEikonEnv::Static()->ReadResource(itemTitle, aResouceId);
+ CAknEnumeratedTextPopupSettingItem* item = static_cast<CAknEnumeratedTextPopupSettingItem*>(GetSettingItemL(itemTitle));
+ CArrayPtr<CAknEnumeratedText>* textArray = item->EnumeratedTextArray();
+ TInt count = textArray->Count();
+
+ for (TInt i=0; i<count; i++)
+ {
+ if (aInfo.Compare((*textArray)[i]->Value()->Des()) == 0)
+ {
+ aIndex = i;
+ }
+ }
+ }
+
+void CDirectPrintPrinterSettingView::LoadExtendSettingsL()
+ {
+ CDirectPrintPrintSettings* printSettings = GetBearerMgr()->PrinterSettingsL();
+ TInt count = printSettings->iCapabilities.Count();
+ for (TInt i=0; i<count; i++)
+ {
+ switch (printSettings->iCapabilities[i]->iUid)
+ {
+ case EDirectPrintCapabAP:
+ {
+ CAknEnumeratedTextPopupSettingItem* item = static_cast<CAknEnumeratedTextPopupSettingItem*>(GetSettingItemL(printSettings->iCapabilities[i]->iTitle));
+ CArrayPtr<CAknEnumeratedText>* textArray = item->EnumeratedTextArray();
+ TInt count = textArray->Count();
+
+ for (TInt j=0; j<count; j++)
+ {
+ if (iAccessPointName.Compare((*textArray)[j]->Value()->Des()) == 0)
+ {
+ CDirectPrintListCapability* capability = static_cast<CDirectPrintListCapability*>(printSettings->iCapabilities[i]);
+ capability->iEnumIndex = j;
+ capability->iValue = capability->iEnumIDs[j];
+ break;
+ }
+ }
+ }
+ break;
+ case EDirectPrintCapabHost:
+ {
+ CDirectPrintTextCapability* capability = static_cast<CDirectPrintTextCapability*>(printSettings->iCapabilities[i]);
+ capability->iText.Copy(iHost);
+ }
+ break;
+ case EDirectPrintCapabPort:
+ {
+ printSettings->iCapabilities[i]->iValue = iPort;
+ }
+ break;
+ case EDirectPrintCapabUser:
+ {
+ CDirectPrintTextCapability* capability = static_cast<CDirectPrintTextCapability*>(printSettings->iCapabilities[i]);
+ capability->iText.Copy(iUserName);
+ }
+ break;
+ case EDirectPrintCapabQue:
+ {
+ CDirectPrintTextCapability* capability = static_cast<CDirectPrintTextCapability*>(printSettings->iCapabilities[i]);
+ capability->iText.Copy(iQue);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+void CDirectPrintPrinterSettingView::StoreDriverInfoL()
+ {
+ TBuf<25> itemTitle;
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_PRINTERSETTING_ITEM_DRIVER);
+ iDriverName.Copy(GetSettingItemL(itemTitle)->SettingTextL());
+ }
+
+void CDirectPrintPrinterSettingView::StoreTypeInfoL()
+ {
+ TBuf<25> itemTitle;
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_PRINTERSETTING_ITEM_TYPE);
+ iTypeName.Copy(GetSettingItemL(itemTitle)->SettingTextL());
+ }
+
+void CDirectPrintPrinterSettingView::StoreBearerInfoL()
+ {
+ TBuf<25> itemTitle;
+ CEikonEnv::Static()->ReadResource(itemTitle, R_DIRECTPRINT_PRINTERSETTING_ITEM_BEARER);
+ iBearerName.Copy(GetSettingItemL(itemTitle)->SettingTextL());
+ }
+
+void CDirectPrintPrinterSettingView::StoreItemInfoL(TInt aResouceId, TDes& aInfo)
+ {
+ TBuf<25> itemTitle;
+ CEikonEnv::Static()->ReadResource(itemTitle, aResouceId);
+ aInfo.Copy(GetSettingItemL(itemTitle)->SettingTextL());
+ }
+
+void CDirectPrintPrinterSettingView::StoreExtendSettingsL()
+ {
+ CDirectPrintPrintSettings* printSettings = GetBearerMgr()->PrinterSettingsL();
+ TInt count = printSettings->iCapabilities.Count();
+ for (TInt i=0; i<count; i++)
+ {
+ switch (printSettings->iCapabilities[i]->iUid)
+ {
+ case EDirectPrintCapabAP:
+ {
+ CDirectPrintListCapability* capability = static_cast<CDirectPrintListCapability*>(printSettings->iCapabilities[i]);
+ iAccessPointName.Copy(GetSettingItemL(capability->iTitle)->SettingTextL());
+ capability->iValue = capability->iEnumIDs[capability->iEnumIndex];
+ }
+ break;
+ case EDirectPrintCapabHost:
+ {
+ iHost.Copy(GetSettingItemL(printSettings->iCapabilities[i]->iTitle)->SettingTextL());
+ }
+ break;
+ case EDirectPrintCapabPort:
+ {
+ iPort = printSettings->iCapabilities[i]->iValue;
+ }
+ break;
+ case EDirectPrintCapabUser:
+ {
+ iUserName.Copy(GetSettingItemL(printSettings->iCapabilities[i]->iTitle)->SettingTextL());
+ }
+ break;
+ case EDirectPrintCapabQue:
+ {
+ iQue.Copy(GetSettingItemL(printSettings->iCapabilities[i]->iTitle)->SettingTextL());
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+CAknSettingItem* CDirectPrintPrinterSettingView::GetSettingItemL(const TDesC& aItemTitle)
+ {
+ CAknSettingItem* item = NULL;
+ CAknSettingItemArray* array = iListBox->SettingItemArray();
+ TInt count = array->Count();
+
+ for (TInt i=0; i<count; i++)
+ {
+ item = (*array)[i];
+ TPtrC name = item->SettingName();
+ if (name.Compare(aItemTitle) == 0)
+ {
+ break;
+ }
+ item = NULL;
+ }
+
+ return item;
+ }
+
+CDirectPrintBearerMgr* CDirectPrintPrinterSettingView::GetBearerMgr()
+ {
+ return (static_cast<CDirectPrintAppAppUi*>(AppUi()))->BearerMgr();
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintApp/ui/src/directprintviewbase.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <aknviewappui.h>
+#include <barsread.h>
+#include <akntitle.h>
+
+#include "directprintviewbase.h"
+#include "directprintappappui.h"
+#include "directprintappdocument.h"
+#include "directprintmodel.h"
+#include "directprintuipluginmgr.h"
+#include "directprintengine.h"
+
+CDirectPrintViewBase::CDirectPrintViewBase()
+ {
+ }
+
+CDirectPrintViewBase::~CDirectPrintViewBase()
+ {
+ }
+
+void CDirectPrintViewBase::ConstructL()
+ {
+ }
+
+TUid CDirectPrintViewBase::Id() const
+ {
+ return iViewId;
+ }
+
+void CDirectPrintViewBase::HandleListIndexL(TInt /*aIndex*/)
+ {
+ }
+
+void CDirectPrintViewBase::HandleEditItemL(TInt /*aIndex*/, TBool /*aChanged*/)
+ {
+ }
+
+void CDirectPrintViewBase::DoActivateL(const TVwsViewId& /*aPrevViewId*/, TUid /*aCustomMessageId*/, const TDesC8& /*aCustomMessage*/)
+ {
+ }
+
+void CDirectPrintViewBase::DoDeactivate()
+ {
+ }
+
+void CDirectPrintViewBase::SetActiveTitleL(TInt aTitleResId)
+ {
+ TUid titlePaneUid = TUid::Uid( EEikStatusPaneUidTitle );
+ CEikStatusPaneBase::TPaneCapabilities subPaneTitle =
+ StatusPane()->PaneCapabilities( titlePaneUid );
+ if ( subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned() )
+ {
+ CAknTitlePane* title = static_cast< CAknTitlePane* >(
+ StatusPane()->ControlL( titlePaneUid ) );
+ TResourceReader reader;
+ iEikonEnv->CreateResourceReaderLC( reader, aTitleResId );
+ title->SetFromResourceL( reader );
+ CleanupStack::PopAndDestroy(); // reader internal state
+ }
+ }
+
+CDirectPrintModel& CDirectPrintViewBase::GetModel()
+ {
+ return (static_cast<CDirectPrintAppAppUi*>(AppUi()))->Doc()->Model();
+ }
+
+CDirectPrintUiPluginMgr& CDirectPrintViewBase::GetPluginMgr()
+ {
+ return (static_cast<CDirectPrintAppAppUi*>(AppUi()))->PluginMgr();
+ }
+
+CDirectPrintEngine& CDirectPrintViewBase::GetEngine()
+ {
+ return *((static_cast<CDirectPrintAppAppUi*>(AppUi()))->Engine());
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintClient/bwins/directprintclientu.def Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,31 @@
+EXPORTS
+ ??0RDirectPrintClient@@QAE@XZ @ 1 NONAME ; RDirectPrintClient::RDirectPrintClient(void)
+ ?CancelCreateJob@RDirectPrintClient@@QBEHXZ @ 2 NONAME ; int RDirectPrintClient::CancelCreateJob(void) const
+ ?CancelDiscovery@RDirectPrintClient@@QBEHXZ @ 3 NONAME ; int RDirectPrintClient::CancelDiscovery(void) const
+ ?CancelPrintJob@RDirectPrintClient@@QBEHXZ @ 4 NONAME ; int RDirectPrintClient::CancelPrintJob(void) const
+ ?CancelStartDiscovery@RDirectPrintClient@@QBEHXZ @ 5 NONAME ; int RDirectPrintClient::CancelStartDiscovery(void) const
+ ?Close@RDirectPrintClient@@QAEXXZ @ 6 NONAME ; void RDirectPrintClient::Close(void)
+ ?ConnectL@RDirectPrintClient@@QAEXXZ @ 7 NONAME ; void RDirectPrintClient::ConnectL(void)
+ ?ContinueCreateJob@RDirectPrintClient@@QAEHAAVTDirectPrintJobGuardData@@AAVTRequestStatus@@@Z @ 8 NONAME ; int RDirectPrintClient::ContinueCreateJob(class TDirectPrintJobGuardData &, class TRequestStatus &)
+ ?ContinuePrintJob@RDirectPrintClient@@QBEHXZ @ 9 NONAME ; int RDirectPrintClient::ContinuePrintJob(void) const
+ ?CountConnections@RDirectPrintClient@@QBEHAAH@Z @ 10 NONAME ; int RDirectPrintClient::CountConnections(int &) const
+ ?CreateJob@RDirectPrintClient@@QAEHHAAVTDirectPrintJobGuardData@@AAV?$RPointerArray@VTDesC16@@@@AAVTRequestStatus@@@Z @ 11 NONAME ; int RDirectPrintClient::CreateJob(int, class TDirectPrintJobGuardData &, class RPointerArray<class TDesC16> &, class TRequestStatus &)
+ ?GetJobSetting@RDirectPrintClient@@QBEHHAAH@Z @ 12 NONAME ; int RDirectPrintClient::GetJobSetting(int, int &) const
+ ?GetJobStatus@RDirectPrintClient@@QBEHXZ @ 13 NONAME ; int RDirectPrintClient::GetJobStatus(void) const
+ ?GetJobTemplateIcon@RDirectPrintClient@@QBEHHAAH@Z @ 14 NONAME ; int RDirectPrintClient::GetJobTemplateIcon(int, int &) const
+ ?GetNumPreviewPages@RDirectPrintClient@@QBEHXZ @ 15 NONAME ; int RDirectPrintClient::GetNumPreviewPages(void) const
+ ?GetNumPrintPages@RDirectPrintClient@@QBEHXZ @ 16 NONAME ; int RDirectPrintClient::GetNumPrintPages(void) const
+ ?GetPrinterCapability@RDirectPrintClient@@QBEHHHAAVTDirectPrintCapability@@@Z @ 17 NONAME ; int RDirectPrintClient::GetPrinterCapability(int, int, class TDirectPrintCapability &) const
+ ?GetPrinterCapabilityIDs@RDirectPrintClient@@QBEHHAAV?$RArray@H@@@Z @ 18 NONAME ; int RDirectPrintClient::GetPrinterCapabilityIDs(int, class RArray<int> &) const
+ ?GetPrinterStatus@RDirectPrintClient@@QBEHH@Z @ 19 NONAME ; int RDirectPrintClient::GetPrinterStatus(int) const
+ ?GetProtocolNames@RDirectPrintClient@@QBEHAAV?$RArray@VTDirectPrintSelectItem@@@@@Z @ 20 NONAME ; int RDirectPrintClient::GetProtocolNames(class RArray<class TDirectPrintSelectItem> &) const
+ ?IsPictBridgeMode@RDirectPrintClient@@QBEHXZ @ 21 NONAME ; int RDirectPrintClient::IsPictBridgeMode(void) const
+ ?ReleaseEngine@RDirectPrintClient@@QBEHXZ @ 22 NONAME ; int RDirectPrintClient::ReleaseEngine(void) const
+ ?RemoveCachedPrinter@RDirectPrintClient@@QBEHH@Z @ 23 NONAME ; int RDirectPrintClient::RemoveCachedPrinter(int) const
+ ?ReserveEngine@RDirectPrintClient@@QBEHXZ @ 24 NONAME ; int RDirectPrintClient::ReserveEngine(void) const
+ ?SetForeground@RDirectPrintClient@@QBEHH@Z @ 25 NONAME ; int RDirectPrintClient::SetForeground(int) const
+ ?SetJobSetting@RDirectPrintClient@@QBEHHHAAH@Z @ 26 NONAME ; int RDirectPrintClient::SetJobSetting(int, int, int &) const
+ ?SetNumberOfCopies@RDirectPrintClient@@QBEHABV?$RArray@H@@@Z @ 27 NONAME ; int RDirectPrintClient::SetNumberOfCopies(class RArray<int> const &) const
+ ?SubmitPrintJob@RDirectPrintClient@@QBEHXZ @ 28 NONAME ; int RDirectPrintClient::SubmitPrintJob(void) const
+ ?SupportedProtocols@RDirectPrintClient@@QBEHXZ @ 29 NONAME ; int RDirectPrintClient::SupportedProtocols(void) const
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintClient/eabi/directprintclientu.def Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,32 @@
+EXPORTS
+ _ZN18RDirectPrintClient17ContinueCreateJobER24TDirectPrintJobGuardDataR14TRequestStatus @ 1 NONAME
+ _ZN18RDirectPrintClient5CloseEv @ 2 NONAME
+ _ZN18RDirectPrintClient8ConnectLEv @ 3 NONAME
+ _ZN18RDirectPrintClient9CreateJobEiR24TDirectPrintJobGuardDataR13RPointerArrayI7TDesC16ER14TRequestStatus @ 4 NONAME
+ _ZN18RDirectPrintClientC1Ev @ 5 NONAME
+ _ZN18RDirectPrintClientC2Ev @ 6 NONAME
+ _ZNK18RDirectPrintClient12GetJobStatusEv @ 7 NONAME
+ _ZNK18RDirectPrintClient13GetJobSettingEiRi @ 8 NONAME
+ _ZNK18RDirectPrintClient13ReleaseEngineEv @ 9 NONAME
+ _ZNK18RDirectPrintClient13ReserveEngineEv @ 10 NONAME
+ _ZNK18RDirectPrintClient13SetForegroundEi @ 11 NONAME
+ _ZNK18RDirectPrintClient13SetJobSettingEiiRi @ 12 NONAME
+ _ZNK18RDirectPrintClient14CancelPrintJobEv @ 13 NONAME
+ _ZNK18RDirectPrintClient14SubmitPrintJobEv @ 14 NONAME
+ _ZNK18RDirectPrintClient15CancelCreateJobEv @ 15 NONAME
+ _ZNK18RDirectPrintClient15CancelDiscoveryEv @ 16 NONAME
+ _ZNK18RDirectPrintClient16ContinuePrintJobEv @ 17 NONAME
+ _ZNK18RDirectPrintClient16CountConnectionsERi @ 18 NONAME
+ _ZNK18RDirectPrintClient16GetNumPrintPagesEv @ 19 NONAME
+ _ZNK18RDirectPrintClient16GetPrinterStatusEi @ 20 NONAME
+ _ZNK18RDirectPrintClient16GetProtocolNamesER6RArrayI22TDirectPrintSelectItemE @ 21 NONAME
+ _ZNK18RDirectPrintClient16IsPictBridgeModeEv @ 22 NONAME
+ _ZNK18RDirectPrintClient17SetNumberOfCopiesERK6RArrayIiE @ 23 NONAME
+ _ZNK18RDirectPrintClient18GetJobTemplateIconEiRi @ 24 NONAME
+ _ZNK18RDirectPrintClient18GetNumPreviewPagesEv @ 25 NONAME
+ _ZNK18RDirectPrintClient18SupportedProtocolsEv @ 26 NONAME
+ _ZNK18RDirectPrintClient19RemoveCachedPrinterEi @ 27 NONAME
+ _ZNK18RDirectPrintClient20CancelStartDiscoveryEv @ 28 NONAME
+ _ZNK18RDirectPrintClient20GetPrinterCapabilityEiiR22TDirectPrintCapability @ 29 NONAME
+ _ZNK18RDirectPrintClient23GetPrinterCapabilityIDsEiR6RArrayIiE @ 30 NONAME
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintClient/group/bld.inf Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_EXPORTS
+../inc/directprintclient.h |../../inc/directprintclient.h
+
+//../rom/directprintserver.iby CORE_APP_LAYER_IBY_EXPORT_PATH( directprintserver.iby )
+
+PRJ_PLATFORMS
+WINSCW ARMV5 GCCE
+
+PRJ_MMPFILES
+directprintclient.mmp
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintClient/group/directprintclient.mmp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include <platform_paths.hrh>
+#include <bldvariant.hrh>
+#include <data_caging_paths.hrh>
+
+#include "../../inc/logdef.h"
+
+deffile directprintclient.def
+
+TARGET directprintclient.dll
+TARGETTYPE dll
+CAPABILITY ALL -TCB
+UID 0x1000008D 0x2002BB2B
+
+APP_LAYER_SYSTEMINCLUDE
+
+USERINCLUDE . ../inc
+USERINCLUDE ../../ImagePrintLibrary/inc
+USERINCLUDE ../../inc
+
+SOURCEPATH ../src
+
+SOURCE directprintclient.cpp
+//SOURCE cidleguard.cpp
+//SOURCE cdiscoveryguard.cpp
+//SOURCE cjobguard.cpp
+
+STATICLIBRARY clog.lib
+LIBRARY flogger.lib
+
+LIBRARY euser.lib
+
+// End of File
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintClient/inc/directprintclient.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,315 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef RDIRECTPRINTCLIENT_H
+#define RDIRECTPRINTCLIENT_H
+
+#include <e32std.h>
+
+#include "directprintselectitem.h"
+
+class TDirectPrintCapability;
+//class TIdleGuardData;
+//class TDiscoveryGuardData;
+class TDirectPrintJobGuardData;
+
+class RDirectPrintClient : public RSessionBase
+ {
+ public:
+
+ /**
+ * Constructor
+ */
+ IMPORT_C RDirectPrintClient();
+
+ /**
+ * Connect to the DirectPrint server
+ *
+ * @return KErrNone if successful, otherwise another of the system-wide error codes
+ */
+ IMPORT_C void ConnectL();
+
+ /**
+ * Close the session
+ */
+ IMPORT_C void Close();
+
+ /**
+ * Count connections to the server ( all clients in all prosesses )
+ *
+ * @param aConnections holder for connnections count
+ * @return KErrNone if successful, otherwise another of the system-wide error codes
+ */
+ IMPORT_C TInt CountConnections( TInt& aConnections ) const;
+
+ /**
+ * Inform server about foreground/background state of the client
+ *
+ * @param aFg foreground/background flag
+ * @return KErrNone if successful, otherwise another of the system-wide error codes
+ */
+ IMPORT_C TInt SetForeground( TInt aFg ) const;
+
+
+ /**
+ * Reserves DirectPrint engine for this client
+ *
+ * @return KErrNone if successful, KErrInUse if used by another client
+ */
+ IMPORT_C TInt ReserveEngine() const;
+
+ /**
+ * Releases DirectPrint engine
+ *
+ * @return KErrNone if successful, KErrInUse if used by another client
+ */
+ IMPORT_C TInt ReleaseEngine() const;
+
+ /**
+ * Get protocols supported by DirectPrint engine
+ *
+ * @return OR:ed protocols or KErrInUse if used by another client
+ */
+ IMPORT_C TInt SupportedProtocols() const;
+
+ /**
+ * Gets the number of pages to be printed
+ *
+ * @return Number of pages to print or KErrInUse if used by another client
+ */
+ IMPORT_C TInt GetNumPrintPages() const;
+
+ /**
+ * Gets the status of the printing job created
+ *
+ * @return Printing job status or KErrInUse if used by another client
+ */
+ IMPORT_C TInt GetJobStatus() const;
+
+ /**
+ * Gets the status of the printer
+ *
+ * @param aPrinterID The exposed ID of the printer the client wants to know about.
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt GetPrinterStatus( TInt aPrinterID ) const;
+
+ /**
+ * Cancel discovery
+ *
+ * @return KErrNone or KErrInUse if used by another client
+ */
+ IMPORT_C TInt CancelDiscovery() const;
+
+ /**
+ * Submits a print job already created. The actual job execution is asynchronous so this
+ * function returns immediately. If successful, notification of job status and job
+ * completion is received by the client through the MPrintEventObserver.
+ *
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt SubmitPrintJob() const;
+
+ /**
+ * Cancels the print job. This is an asynchronous command. MPrintEventObserver::PrintJobProgressEvent
+ * will be called with the status of TPrintJobProgressEventStatus::EDone when the cancellation
+ * is completed. The notification can potentially be received by the client before
+ * this command returns to the client.
+ *
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt CancelPrintJob() const;
+
+ /**
+ * Continues printing and / or submitting a print job.
+ *
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt ContinuePrintJob() const;
+
+ /**
+ * Removes a specified cached printer.
+ *
+ * @param aPrinterID The exposed ID of the printer the client wants to remove.
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt RemoveCachedPrinter( TInt aPrinterID ) const;
+
+ /**
+ * Gets the icon representing a given layout or template.
+ *
+ * @param aTemplateID ID of the template / layout of interest.
+ * @param aFbsBitmapHandle Handle to the appropriate bitmap.
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt GetJobTemplateIcon( TInt aTemplateID, TInt& aFbsBitmapHandle ) const;
+
+ /**
+ * Gets the number of pages in the preview.
+ *
+ * @return Number of pages in the preview.
+ */
+ IMPORT_C TInt GetNumPreviewPages() const;
+
+ /**
+ * Sets a print job setting.
+ *
+ * @param aCapabilityID ID of the capability of interest.
+ * @param aValue New capability value.
+ * @param aAffectedCapability ID of any affected capability.
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt SetJobSetting( TInt aCapabilityID, TInt aValue, TInt& aAffectedCapability ) const;
+
+ /**
+ * Gets a setting configured for the created print job.
+ *
+ * @param aCapabilityID ID of the capability of interest.
+ * @param aValue Capability value.
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt GetJobSetting( TInt aCapabilityID, TInt& aValue ) const;
+
+ /**
+ * Gets the detail of a certain capability of a certain printer.
+ *
+ * @param aPrinterID The exposed ID of the printer the client wants to know about.
+ * @param aCapabilityID ID of the capability of interest.
+ * @param aCapability Capability information.
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt GetPrinterCapability(TInt aPrinterID, TInt aCapabilityID, TDirectPrintCapability& aCapability) const;
+
+ /**
+ * Gets the IDs of the capabilities supported by the printer specified.
+ *
+ * @param aPrinterID The exposed ID of the printer the client wants to know about.
+ * @param aCapabilityIDs Array containing the ID's of the capabilities of the specified printer.
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt GetPrinterCapabilityIDs( TInt aPrinterID, RArray<TInt>& aCapabilityIDs ) const;
+
+ /**
+ * Registers the IdleObserver to send idle event notifications. Asynchronous function.
+ *
+ * @param aData place holder for idle event. On function completion contains idle event data.
+ * @param aStatus request status
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+// IMPORT_C TInt RegisterIdleObserver( TIdleGuardData& aData, TRequestStatus& aStatus );
+
+ /**
+ * Cancel registering idle observer
+ *
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+// IMPORT_C TInt CancelRegisterIdleObserver() const;
+
+ /**
+ * Start discovery and set request for discovery event. Asynchronous function.
+ *
+ * @param aData place holder for discovery event. On function completion contains discovery event data.
+ * @param aProtocols OR:ed protocol ids
+ * @param aStatus request status
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+// IMPORT_C TInt StartDiscovery( TDiscoveryGuardData& aData, TUint aProtocols, TRequestStatus& aStatus );
+
+ /**
+ * Set next request for discovery event. Asynchronous function.
+ *
+ * @param aData place holder for discovery event. On function completion contains discovery event data.
+ * @param aStatus request status
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+// IMPORT_C TInt ContinueDiscovery( TDiscoveryGuardData& aData, TRequestStatus& aStatus );
+
+ /**
+ * Create print job and set request for print job event. Asynchronous function.
+ *
+ * @param aPrinterID printer id
+ * @param aData place holder for print job event. On function completion contains print job event data.
+ * @param aImages array of image file names
+ * @param aStatus request status
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt CreateJob( TInt aPrinterID, TDirectPrintJobGuardData& aData, RPointerArray<TDesC>& aImages, TRequestStatus& aStatus );
+
+ /**
+ * Set next request for print job event. Asynchronous function.
+ *
+ * @param aData place holder for print job event. On function completion contains print job event data.
+ * @param aStatus request status
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt ContinueCreateJob( TDirectPrintJobGuardData& aData, TRequestStatus& aStatus );
+
+ /**
+ * Cancel starting discovery
+ *
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt CancelStartDiscovery() const;
+
+ /**
+ * Cancel creating print job
+ *
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt CancelCreateJob() const;
+
+ /**
+ * PictBridge USB mode checker
+ *
+ * @return TInt value more than 0, if PictBridge USB mode is on; 0 if off; negative value if error
+ */
+ IMPORT_C TInt IsPictBridgeMode() const;
+
+ /**
+ * Set number of copies
+ *
+ * @param aArray array of number of copies elements. Each array element corresponds to the array
+ * of image file names of created print job
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt SetNumberOfCopies( const RArray<TInt>& aArray ) const;
+
+ IMPORT_C TInt GetProtocolNames(RSelectItemArray& aNames) const;
+
+ public:
+
+ /**
+ * Version getter
+ *
+ * @return version of the client
+ */
+ TVersion Version() const;
+
+ private:
+
+ TPtr8 iDicsoveryDataPtr;
+ TPtr8 iIdleDataPtr;
+ TPtr8 iJobDataPtr;
+ TDirectPrintCapability* iCapability;
+ TPtr8 iNameDataPtr;
+ };
+
+
+#endif // RDIRECTPRINTCLIENT_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintClient/src/directprintclient.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,577 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include <e32svr.h>
+#include <e32math.h>
+
+#include "directprintclient.h"
+#include "directprintclientserver.h"
+#include "directprintcapability.h"
+#include "clog.h"
+#include "directprintjobguarddata.h"
+
+namespace
+ {
+ // Server startup code
+ TInt StartServer()
+ {
+ // EPOC and EKA2 is easy, we just create a new server process. Simultaneous
+ // launching of two such processes should be detected when the second one
+ // attempts to create the server object, failing with KErrAlreadyExists.
+ RProcess server;
+ TInt r = server.Create( KDirectPrintServerImg, KNullDesC );
+
+ if( r != KErrNone )
+ return r;
+ TRequestStatus stat;
+ server.Rendezvous(stat);
+ if (stat!=KRequestPending)
+ server.Kill(0); // abort startup
+ else
+ server.Resume(); // logon OK - start the server
+ User::WaitForRequest(stat); // wait for start or death
+ // we can't use the 'exit reason' if the server panicked as this
+ // is the panic 'reason' and may be '0' which cannot be distinguished
+ // from KErrNone
+ r=(server.ExitType()==EExitPanic) ? KErrGeneral : stat.Int();
+
+ server.Close();
+ return r;
+ }
+ }
+
+TVersion RDirectPrintClient::Version() const
+ {
+ return TVersion( KDirectPrintServerMajor, KDirectPrintServerMinor, KDirectPrintServerBuild );
+ }
+
+EXPORT_C RDirectPrintClient::RDirectPrintClient()
+ : RSessionBase()
+ , iDicsoveryDataPtr(NULL, 0, 0)
+ , iIdleDataPtr(NULL, 0, 0)
+ , iJobDataPtr(NULL, 0, 0)
+ , iNameDataPtr(NULL, 0, 0)
+ {
+ iCapability = NULL;
+ }
+
+EXPORT_C void RDirectPrintClient::ConnectL()
+ {
+ LOG1("RDirectPrintClient::Connect Handle(): %d", Handle());
+ // check against double-connect
+ if( Handle() != KNullHandle )
+ {
+ User::Leave(KErrAlreadyExists);
+ }
+
+ iCapability = new (ELeave) TDirectPrintCapability();
+
+ // create process
+ TInt err = StartServer();
+ if (err == KErrNone)
+ {
+ // create session
+ err = CreateSession( KDirectPrintServerName, Version() );
+ }
+ User::LeaveIfError(err);
+ }
+
+EXPORT_C void RDirectPrintClient::Close()
+ {
+ LOG("RDirectPrintClient::Close begin");
+ if( iCapability )
+ {
+ delete iCapability;
+ iCapability = NULL;
+ }
+ RSessionBase::Close();
+ LOG("RDirectPrintClient::Close end");
+ }
+
+EXPORT_C TInt RDirectPrintClient::CountConnections( TInt& aConnections ) const
+ {
+ TPckg<TInt> connsBuf( aConnections );
+ return SendReceive( ECountConnections, TIpcArgs( &connsBuf ) );
+ }
+
+EXPORT_C TInt RDirectPrintClient::SetForeground( TInt aFg ) const
+ {
+ return SendReceive( ESetForeground, TIpcArgs( aFg ) );
+ }
+
+EXPORT_C TInt RDirectPrintClient::ReserveEngine() const
+ {
+ return SendReceive( EReserveEngine );
+ }
+
+EXPORT_C TInt RDirectPrintClient::ReleaseEngine() const
+ {
+ return SendReceive( EReleaseEngine );
+ }
+
+EXPORT_C TInt RDirectPrintClient::SupportedProtocols() const
+ {
+ LOG("RDirectPrintClient::SupportedProtocols ESupportedProtocols");
+ TInt prots = SendReceive( ESupportedProtocols );
+ LOG1("RDirectPrintClient::SupportedProtocols end with: %d", prots);
+ return prots;
+ }
+
+EXPORT_C TInt RDirectPrintClient::GetNumPrintPages() const
+ {
+ LOG("RDirectPrintClient::GetNumPrintPages EGetNumPrintPages");
+ TInt pages = SendReceive( EGetNumPrintPages );
+ LOG1("RDirectPrintClient::GetNumPrintPages end with: %d", pages);
+ return pages;
+ }
+
+EXPORT_C TInt RDirectPrintClient::GetJobStatus() const
+ {
+ LOG("RDirectPrintClient::GetJobStatus EGetJobStatus");
+ TInt status = SendReceive( EGetJobStatus );
+ LOG1("RDirectPrintClient::GetJobStatus end with: %d", status);
+ return status;
+ }
+
+EXPORT_C TInt RDirectPrintClient::GetPrinterStatus( TInt aPrinterID ) const
+ {
+ LOG1("RDirectPrintClient::GetPrinterStatus EGetPrinterStatus aPrinterID: %d", aPrinterID);
+ TInt status = SendReceive( EGetPrinterStatus, TIpcArgs( aPrinterID ) );
+ LOG1("RDirectPrintClient::GetPrinterStatus end with: %d", status);
+ return status;
+ }
+
+EXPORT_C TInt RDirectPrintClient::CancelDiscovery() const
+ {
+ LOG("RDirectPrintClient::CancelDiscovery ECancelDiscovery");
+ TInt err = SendReceive( ECancelDiscovery );
+ LOG1("RDirectPrintClient::CancelDiscovery end with: %d", err);
+ return err;
+ }
+
+EXPORT_C TInt RDirectPrintClient::SubmitPrintJob() const
+ {
+ LOG("RDirectPrintClient::SubmitPrintJob ESubmitPrintJob");
+ TInt err = SendReceive( ESubmitPrintJob );
+ LOG1("RDirectPrintClient::SubmitPrintJob end with: %d", err);
+ return err;
+ }
+
+EXPORT_C TInt RDirectPrintClient::CancelPrintJob() const
+ {
+ LOG("RDirectPrintClient::CancelPrintJob ECancelPrintJob");
+ TInt err = SendReceive( ECancelPrintJob );
+ LOG1("RDirectPrintClient::CancelPrintJob end with: %d", err);
+ return err;
+ }
+
+EXPORT_C TInt RDirectPrintClient::ContinuePrintJob() const
+ {
+ LOG("RDirectPrintClient::ContinuePrintJob EContinuePrintJob");
+ TInt err = SendReceive( EContinuePrintJob );
+ LOG1("RDirectPrintClient::ContinuePrintJob end with: %d", err);
+ return err;
+ }
+
+EXPORT_C TInt RDirectPrintClient::RemoveCachedPrinter( TInt aPrinterID ) const
+ {
+ LOG1("RDirectPrintClient::RemoveCachedPrinter ERemoveCachedPrinter aPrinterID: %d", aPrinterID);
+ TInt err = SendReceive( ERemoveCachedPrinter, TIpcArgs( aPrinterID ) );
+ LOG1("RDirectPrintClient::RemoveCachedPrinter end with: %d", err);
+ return err;
+ }
+
+EXPORT_C TInt RDirectPrintClient::GetJobTemplateIcon( TInt aTemplateID, TInt& aFbsBitmapHandle ) const
+ {
+ TPckg<TInt> handleBuf( aFbsBitmapHandle );
+ LOG1("RDirectPrintClient::GetJobTemplateIcon EGetJobTemplateIcon aTemplateID: %d", aTemplateID);
+ TInt err = SendReceive( EGetJobTemplateIcon, TIpcArgs( aTemplateID, &handleBuf ) );
+ LOG1("RDirectPrintClient::GetJobTemplateIcon aFbsBitmapHandle: %d", aFbsBitmapHandle);
+ LOG1("RDirectPrintClient::GetJobTemplateIcon end with: %d", err);
+ return err;
+ }
+
+EXPORT_C TInt RDirectPrintClient::GetNumPreviewPages() const
+ {
+ LOG("RDirectPrintClient::GetNumPreviewPages EGetNumPreviewPages");
+ TInt pages = SendReceive( EGetNumPreviewPages );
+ LOG1("RDirectPrintClient::GetNumPreviewPages end with: %d", pages);
+ return pages;
+ }
+
+EXPORT_C TInt RDirectPrintClient::SetJobSetting( TInt aCapabilityID, TInt aValue, TInt& aAffectedCapability ) const
+ {
+ TPckg<TInt> capBuf( aAffectedCapability );
+ LOG1("RDirectPrintClient::SetJobSetting ESetJobSetting aCapabilityID: %d", aCapabilityID);
+ LOG1("RDirectPrintClient::SetJobSetting ESetJobSetting aValue: %d", aValue);
+ TInt err = SendReceive( ESetJobSetting, TIpcArgs( aCapabilityID, aValue, &capBuf ) );
+ LOG1("RDirectPrintClient::SetJobSetting aAffectedCapability: %d", aAffectedCapability);
+ LOG1("RDirectPrintClient::SetJobSetting end with: %d", err);
+ return err;
+ }
+
+EXPORT_C TInt RDirectPrintClient::GetJobSetting( TInt aCapabilityID, TInt& aValue ) const
+ {
+ TPckg<TInt> valueBuf( aValue );
+ LOG1("RDirectPrintClient::GetJobSetting EGetJobSetting aCapabilityID: %d", aCapabilityID);
+ TInt err = SendReceive( EGetJobSetting, TIpcArgs( aCapabilityID, &valueBuf ) );
+ LOG1("RDirectPrintClient::GetJobSetting aValue: %d", aValue);
+ LOG1("RDirectPrintClient::GetJobSetting end with: %d", err);
+ return err;
+ }
+
+EXPORT_C TInt RDirectPrintClient::GetPrinterCapability(TInt aPrinterID, TInt aCapabilityID, TDirectPrintCapability& aCapability) const
+ {
+ LOG1("RDirectPrintClient::GetPrinterCapability EGetPrinterCapability aPrinterID: %d", aPrinterID);
+ LOG1("RDirectPrintClient::GetPrinterCapability EGetPrinterCapability aCapabilityID: %d", aCapabilityID);
+ TInt err = SendReceive( EGetPrinterCapability, TIpcArgs( aPrinterID, aCapabilityID ) );
+ LOG1("RDirectPrintClient::GetPrinterCapability EGetPrinterCapability err: %d", err);
+
+ if( !err )
+ {
+ TInt capId;
+ TPckg<TInt> capIdBuf( capId );
+ LOG("RDirectPrintClient::GetPrinterCapability EGetPrinterCapId");
+ err = SendReceive( EGetPrinterCapId, TIpcArgs( &capIdBuf ) );
+ LOG1("RDirectPrintClient::GetPrinterCapability EGetPrinterCapId err: %d", err);
+ LOG1("RDirectPrintClient::GetPrinterCapability EGetPrinterCapId capId: %d", capId);
+ if( !err )
+ {
+ iCapability->iCapabilityID = capId;
+ }
+ }
+
+ if( !err )
+ {
+ TInt type;
+ TPckg<TInt> typeBuf( type );
+ LOG("RDirectPrintClient::GetPrinterCapability EGetPrinterCapType");
+ err = SendReceive( EGetPrinterCapType, TIpcArgs( &typeBuf ) );
+ LOG1("RDirectPrintClient::GetPrinterCapability EGetPrinterCapType err: %d", err);
+ LOG1("RDirectPrintClient::GetPrinterCapability EGetPrinterCapType type: %d", type);
+ if( !err )
+ {
+ iCapability->iType = static_cast<TDirectPrintCapability::ECapType>(type);
+ }
+ }
+
+ if( !err )
+ {
+ TInt def;
+ TPckg<TInt> defBuf( def );
+ LOG("RDirectPrintClient::GetPrinterCapability EGetPrinterCapDef");
+ err = SendReceive( EGetPrinterCapDef, TIpcArgs( &defBuf ) );
+ LOG1("RDirectPrintClient::GetPrinterCapability EGetPrinterCapDef err: %d", err);
+ LOG1("RDirectPrintClient::GetPrinterCapability EGetPrinterCapDef def: %d", def);
+ if( !err )
+ {
+ iCapability->iDefaultValue = def;
+ }
+ }
+
+ if( !err )
+ {
+ TInt low;
+ TPckg<TInt> lowBuf( low );
+ LOG("RDirectPrintClient::GetPrinterCapability EGetPrinterCapLow");
+ err = SendReceive( EGetPrinterCapLow, TIpcArgs( &lowBuf ) );
+ LOG1("RDirectPrintClient::GetPrinterCapability EGetPrinterCapLow err: %d", err);
+ LOG1("RDirectPrintClient::GetPrinterCapability EGetPrinterCapLow low: %d", low);
+ if( !err )
+ {
+ iCapability->iLow = low;
+ }
+ }
+
+ if( !err )
+ {
+ TInt high;
+ TPckg<TInt> highBuf( high );
+ LOG("RDirectPrintClient::GetPrinterCapability EGetPrinterCapHigh");
+ err = SendReceive( EGetPrinterCapHigh, TIpcArgs( &highBuf ) );
+ LOG1("RDirectPrintClient::GetPrinterCapability EGetPrinterCapHigh err: %d", err);
+ LOG1("RDirectPrintClient::GetPrinterCapability EGetPrinterCapHigh high: %d", high);
+ if( !err )
+ {
+ iCapability->iHigh = high;
+ }
+ }
+
+ if( !err )
+ {
+ TInt count;
+ TPckg<TInt> countBuf( count );
+ LOG("RDirectPrintClient::GetPrinterCapability EGetPrinterCapEnumCount");
+ err = SendReceive( EGetPrinterCapEnumCount, TIpcArgs( &countBuf ) );
+ LOG1("RDirectPrintClient::GetPrinterCapability EGetPrinterCapEnumCount err: %d", err);
+ LOG1("RDirectPrintClient::GetPrinterCapability EGetPrinterCapEnumCount count: %d", count);
+
+ if( !err )
+ {
+ iCapability->iEnumCount = count;
+ for( TInt i = 0; i < count && ! err; i++ )
+ {
+ TInt value;
+ TPckg<TInt> valueBuf( value );
+ LOG1("RDirectPrintClient::GetPrinterCapability EGetPrinterCapEnum i: %d",i);
+ TInt err = SendReceive( EGetPrinterCapEnum, TIpcArgs( i, &valueBuf ) );
+ LOG1("RDirectPrintClient::GetPrinterCapability EGetPrinterCapEnum err: %d", err);
+ LOG1("RDirectPrintClient::GetPrinterCapability EGetPrinterCapEnum value: %d", value);
+
+ if( !err )
+ {
+ iCapability->iEnumCodes[i] = value;
+ }
+ }
+ }
+ }
+
+ if( !err )
+ {
+ aCapability = *iCapability;
+ }
+
+ LOG1("RDirectPrintClient::GetPrinterCapability end with: %d", err);
+ return err;
+ }
+
+
+EXPORT_C TInt RDirectPrintClient::GetPrinterCapabilityIDs( TInt aPrinterID, RArray<TInt>& aCapabilityIDs ) const
+ {
+ TInt count;
+ TPckg<TInt> countBuf( count );
+
+ LOG1("RDirectPrintClient::GetPrinterCapabilityIDs EGetPrinterCapabilityIDsCount aPrinterID: %d", aPrinterID);
+ TInt err = SendReceive( EGetPrinterCapabilityIDsCount, TIpcArgs( aPrinterID, &countBuf ) );
+ LOG1("RDirectPrintClient::GetPrinterCapabilityIDs EGetPrinterCapabilityIDsCount err: %d", err);
+ if( !err )
+ {
+ LOG1("RDirectPrintClient::GetPrinterCapabilityIDs EGetPrinterCapabilityIDsCount count: %d", count);
+ for( TInt i = 0; i < count && !err; i++ )
+ {
+ TInt capability;
+ TPckg<TInt> capBuf( capability );
+ LOG1("RDirectPrintClient::GetPrinterCapabilityIDs EGetPrinterCapabilityID i: %d", i);
+ err = SendReceive( EGetPrinterCapabilityID, TIpcArgs( i, &capBuf ) );
+ LOG1("RDirectPrintClient::GetPrinterCapabilityIDs EGetPrinterCapabilityID err: %d", err);
+ if( !err )
+ {
+ LOG1("RDirectPrintClient::GetPrinterCapabilityIDs capability id: %d", capability);
+ err = aCapabilityIDs.Append( capability );
+ LOG1("RDirectPrintClient::GetPrinterCapabilityIDs append err: %d", err);
+ }
+ }
+ }
+
+ LOG1("RDirectPrintClient::GetPrinterCapabilityIDs end with: %d", err);
+ return err;
+ }
+/*
+EXPORT_C TInt RDirectPrintClient::RegisterIdleObserver( TIdleGuardData& aData, TRequestStatus& aStatus )
+ {
+ LOG("RDirectPrintClient::RegisterIdleObserver EReserveEngine");
+ TInt err = SendReceive( EReserveEngine );
+ LOG1("RDirectPrintClient::RegisterIdleObserver EReserveEngine err: %d", err);
+ if( !err )
+ {
+ LOG("RDirectPrintClient::RegisterIdleObserver ERegisterIdleObserver");
+ iIdleDataPtr.Set(reinterpret_cast<TUint8*>(&aData), sizeof(aData), sizeof(aData));
+ SendReceive( ERegisterIdleObserver, TIpcArgs( &iIdleDataPtr ), aStatus );
+ }
+ LOG1("RDirectPrintClient::RegisterIdleObserver end with: %d", err);
+ return err;
+ }
+
+EXPORT_C TInt RDirectPrintClient::CancelRegisterIdleObserver() const
+ {
+ LOG("RDirectPrintClient::CancelRegisterIdleObserver ECancelRegisterIdleObserver");
+ TInt err = SendReceive( EReleaseEngine );
+ LOG1("RDirectPrintClient::RegisterIdleObserver EReleaseEngine err: %d", err);
+
+ err = SendReceive( ECancelRegisterIdleObserver );
+ LOG1("RDirectPrintClient::RegisterIdleObserver ECancelRegisterIdleObserver err: %d", err);
+
+ LOG1("RDirectPrintClient::CancelRegisterIdleObserver end with: %d", err);
+ return err;
+ }
+
+EXPORT_C TInt RDirectPrintClient::StartDiscovery( TDiscoveryGuardData& aData, TUint aProtocols, TRequestStatus& aStatus )
+ {
+ LOG("RDirectPrintClient::StartDiscovery EReserveEngine");
+ TInt err = SendReceive( EReserveEngine );
+ LOG1("RDirectPrintClient::StartDiscovery EReserveEngine err: %d", err);
+ if( !err )
+ {
+ LOG1("RDirectPrintClient::StartDiscovery EStartDiscovery aProtocols: %d", aProtocols);
+ err = SendReceive( EStartDiscovery, TIpcArgs( aProtocols ) );
+ LOG1("RDirectPrintClient::StartDiscovery EStartDiscovery err: %d", err);
+ }
+ if( !err )
+ {
+ LOG("RDirectPrintClient::StartDiscovery EContinueDiscovery");
+ iDicsoveryDataPtr.Set(reinterpret_cast<TUint8*>(&aData), sizeof(aData), sizeof(aData));
+ SendReceive( EContinueDiscovery, TIpcArgs( &iDicsoveryDataPtr ), aStatus );
+ }
+ LOG1("RDirectPrintClient::StartDiscovery end with: %d", err);
+ return err;
+ }
+
+EXPORT_C TInt RDirectPrintClient::ContinueDiscovery( TDiscoveryGuardData& aData, TRequestStatus& aStatus )
+ {
+ LOG("RDirectPrintClient::ContinueDiscovery EReserveEngine");
+ TInt err = SendReceive( EReserveEngine );
+ LOG1("RDirectPrintClient::ContinueDiscovery EReserveEngine err: %d", err);
+ if( !err )
+ {
+ LOG("RDirectPrintClient::ContinueDiscovery EContinueDiscovery");
+ iDicsoveryDataPtr.Set(reinterpret_cast<TUint8*>(&aData), sizeof(aData), sizeof(aData));
+ SendReceive( EContinueDiscovery, TIpcArgs( &iDicsoveryDataPtr ), aStatus );
+ }
+ LOG1("RDirectPrintClient::ContinueDiscovery end with: %d", err);
+ return err;
+ }
+*/
+EXPORT_C TInt RDirectPrintClient::CreateJob( TInt aPrinterID, TDirectPrintJobGuardData& aData, RPointerArray<TDesC>& aImages, TRequestStatus& aStatus )
+ {
+ LOG("RDirectPrintClient::CreateJob EReserveEngine");
+ TInt err = SendReceive( EReserveEngine );
+ LOG1("RDirectPrintClient::CreateJob EReserveEngine err: %d", err);
+ if( !err )
+ {
+ TInt count = aImages.Count();
+ LOG1("RDirectPrintClient::CreateJob aImages.Count(): %d", aImages.Count());
+ for( TInt i = 0; i < count && !err; i++ )
+ {
+ LOG("RDirectPrintClient::CreateJob EPrepareJob");
+ err = SendReceive( EPrepareJob, TIpcArgs( aImages[i] ) );
+ LOG1("RDirectPrintClient::CreateJob EPrepareJob err: %d", err);
+ }
+ }
+ if( !err )
+ {
+ LOG("RDirectPrintClient::CreateJob ECreateJob");
+ err = SendReceive( ECreateJob, TIpcArgs( aPrinterID ) );
+ LOG1("RDirectPrintClient::CreateJob ECreateJob err: %d", err);
+ }
+ if( !err )
+ {
+ LOG("RDirectPrintClient::CreateJob EContinueCreateJob");
+ iJobDataPtr.Set(reinterpret_cast<TUint8*>(&aData), sizeof(aData), sizeof(aData));
+ SendReceive( EContinueCreateJob, TIpcArgs( &iJobDataPtr ), aStatus );
+ }
+ LOG1("RDirectPrintClient::CreateJob end with: %d", err);
+ return err;
+ }
+
+EXPORT_C TInt RDirectPrintClient::ContinueCreateJob( TDirectPrintJobGuardData& aData, TRequestStatus& aStatus )
+ {
+ LOG("RDirectPrintClient::ContinueCreateJob EReserveEngine");
+ TInt err = SendReceive( EReserveEngine );
+ LOG1("RDirectPrintClient::ContinueCreateJob EReserveEngine err: %d", err);
+ if( !err )
+ {
+ LOG("RDirectPrintClient::ContinueCreateJob EContinueCreateJob");
+ iJobDataPtr.Set(reinterpret_cast<TUint8*>(&aData), sizeof(aData), sizeof(aData));
+ SendReceive( EContinueCreateJob, TIpcArgs( &iJobDataPtr ), aStatus );
+ }
+ LOG1("RDirectPrintClient::ContinueCreateJob end with: %d", err);
+ return err;
+ }
+
+EXPORT_C TInt RDirectPrintClient::CancelStartDiscovery() const
+ {
+ LOG("RDirectPrintClient::CancelStartDiscovery ECancelStartDiscovery");
+ TInt err = SendReceive( ECancelStartDiscovery );
+ LOG1("RDirectPrintClient::CancelStartDiscovery end with: %d", err);
+ return err;
+ }
+
+EXPORT_C TInt RDirectPrintClient::CancelCreateJob() const
+ {
+ LOG("RDirectPrintClient::CancelCreateJob ECancelCreateJob");
+ TInt err = SendReceive( ECancelCreateJob );
+ LOG1("RDirectPrintClient::CancelCreateJob end with: %d", err);
+ return err;
+ }
+
+EXPORT_C TInt RDirectPrintClient::IsPictBridgeMode() const
+ {
+ LOG("RDirectPrintClient::IsPictBridgeMode EIsPictBridgeMode");
+#ifdef __WINS__
+ TInt err( KErrNotFound );
+#else
+ TInt err = SendReceive( EIsPictBridgeMode );
+#endif
+ LOG1("RDirectPrintClient::IsPictBridgeMode end with: %d", err);
+ return err;
+ }
+
+EXPORT_C TInt RDirectPrintClient::SetNumberOfCopies( const RArray<TInt>& aArray ) const
+ {
+ LOG("RDirectPrintClient::SetNumberOfCopies EReserveEngine");
+ TInt err = SendReceive( EReserveEngine );
+ LOG1("RDirectPrintClient::SetNumberOfCopies EReserveEngine err: %d", err);
+ if( !err )
+ {
+ TInt count = aArray.Count();
+ LOG1("RDirectPrintClient::SetNumberOfCopies count: %d", count);
+ LOG("RDirectPrintClient::SetNumberOfCopies ESetNumberOfCopiesCount");
+ err = SendReceive( ESetNumberOfCopiesCount, TIpcArgs( count ) );
+ LOG1("RDirectPrintClient::SetNumberOfCopies ESetNumberOfCopiesCount err: %d", err);
+ for( TInt i = 0; i < count && !err; i++ )
+ {
+ LOG1("RDirectPrintClient::SetNumberOfCopies i: %d", i);
+ LOG("RDirectPrintClient::SetNumberOfCopies ESetNumberOfCopies");
+ err = SendReceive( ESetNumberOfCopies, TIpcArgs( aArray[i] ) );
+ LOG1("RDirectPrintClient::SetNumberOfCopies ESetNumberOfCopies err: %d", err);
+ }
+ }
+ LOG1("RDirectPrintClient::SetNumberOfCopies end with: %d", err);
+ return err;
+ }
+
+EXPORT_C TInt RDirectPrintClient::GetProtocolNames(RSelectItemArray& aNames) const
+ {
+ //TInt err = SendReceive( EReserveEngine );
+ TInt count;
+ TPckg<TInt> countBuf( count );
+
+ TInt err = SendReceive( EGetProtocolNamesCount, TIpcArgs( &countBuf ) );
+
+ if( !err )
+ {
+ aNames.Reset();
+
+ for( TInt i = 0; i < count && !err; i++ )
+ {
+ TDirectPrintSelectItem item;
+ //iNameDataPtr.Set(reinterpret_cast<TUint8*>(&item), sizeof(item), sizeof(item));
+ TPtr8 ptr(reinterpret_cast<TUint8*>(&item), sizeof(item), sizeof(item));
+ //err = SendReceive( EGetProtocolName, TIpcArgs( i, &iNameDataPtr ) );
+ err = SendReceive( EGetProtocolName, TIpcArgs( i, &ptr ) );
+ if( !err )
+ {
+ aNames.Append(item);
+ }
+ }
+ }
+
+ return err;
+ }
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintServer/group/bld.inf Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_EXPORTS
+
+//../rom/directprintserver.iby CORE_APP_LAYER_IBY_EXPORT_PATH( directprintserver.iby )
+
+../inc/directprintclientserver.h |../../inc/directprintclientserver.h
+../inc/directprintjobguarddata.h |../../inc/directprintjobguarddata.h
+../inc/directprintserveruid.h |../../inc/directprintserveruid.h
+
+PRJ_PLATFORMS
+WINSCW ARMV5 GCCE
+
+PRJ_MMPFILES
+directprintserver.mmp
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintServer/group/directprintserver.mmp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include <platform_paths.hrh>
+#include <bldvariant.hrh>
+#include <data_caging_paths.hrh>
+
+#include "../../inc/logdef.h"
+#include "../../inc/directprintserveruid.h"
+
+TARGET directprintserver.exe
+TARGETTYPE exe
+CAPABILITY ALL -TCB
+
+UID 0x1000008D KDIRECTPRINTSERVERUID3
+EPOCSTACKSIZE 0x5000
+EPOCHEAPSIZE 0x1000 0x1000000
+
+APP_LAYER_SYSTEMINCLUDE
+
+USERINCLUDE . ../inc
+USERINCLUDE ../../ImagePrintLibrary/inc
+USERINCLUDE ../../inc
+
+SOURCEPATH ../src
+
+SOURCE main.cpp
+SOURCE directprintserver.cpp
+SOURCE directprintsession.cpp
+SOURCE directprintbody.cpp
+SOURCE directprintscheduler.cpp
+SOURCE directprintprotocolsloader.cpp
+SOURCE directprintrsimageparser.cpp
+SOURCE directprintserverjobguard.cpp
+SOURCE directprintnumofcopies.cpp
+SOURCE directprintmessage.cpp
+
+SOURCE directprintprotocolinfo.cpp
+
+STATICLIBRARY clog.lib
+LIBRARY flogger.lib
+
+LIBRARY euser.lib
+LIBRARY efsrv.lib
+LIBRARY fbscli.lib
+LIBRARY ecom.lib
+LIBRARY centralrepository.lib
+
+#ifdef _DIRECTPRINT_USE_USB
+LIBRARY usbman.lib
+LIBRARY usbwatcher.lib
+#endif // _DIRECTPRINT_USE_USB
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintServer/inc/directprintbody.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,294 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description: Contains the CDirectPrintBody class definition.
+*
+*/
+
+
+// Protection against nested includes
+#ifndef CDIRECTPRINTBODY_H
+#define CDIRECTPRINTBODY_H
+
+// System includes
+#include <e32base.h>
+
+// User includes
+#include "imageprint.h"
+#include "directprintprotocolsloader.h"
+#include "directprintscheduler.h"
+#include "mprotprintingdevice.h"
+
+// Forward declarations
+class TDpMessage;
+
+/**
+ *
+ * This class is in charge of discoverying devices across the protocols available, of creating
+ * a print job in the right printer and right protocol, etc. It can be considered a controller.
+ * Implements the MProtPrintingDevice observers (MProtDiscoveryObserver, MProtPrintEventObserver) so it can act
+ * accordingly when the protocols report or need something.
+ */
+class CDirectPrintBody : public CBase, public MProtDiscoveryObserver, public MProtPrintEventObserver, public MProtIdleObserver
+ {
+ public:
+
+ /**
+ * 2-phase constructor
+ *
+ * @return new object
+ */
+ static CDirectPrintBody* NewL();
+
+ /**
+ * Destructor
+ */
+ ~CDirectPrintBody();
+
+ /**
+ * Start discovery for one or several protocols
+ *
+ * @param aObserver observer for notifications about discovery events
+ * @param aProtocols OR:ed protocol ids
+ * @return error code
+ */
+ TInt StartDiscovery(MPrinterDiscoveryObserver& aObserver, TUint aProtocols = 0);
+
+ /**
+ * Cancel discovery
+ */
+ void CancelDiscovery();
+
+ /**
+ * Creates print job
+ *
+ * @param aPrinterID printer id
+ * @param aImages array of image file names to be printed
+ * @param aObserver observer for notifications about print job events
+ * @return error code
+ */
+ TInt CreatePrintJobL(TInt aPrinterID, RPointerArray<TDesC>& aImages, MPrintEventObserver& aObserver);
+
+ /**
+ * Start actual printing of previously created print job
+ */
+ void SubmitPrintJobL();
+
+ /**
+ * Cancel print job
+ *
+ * @return error code
+ */
+ TInt CancelPrintJob();
+
+ /**
+ * Continue print job
+ *
+ * @return error code
+ */
+ TInt ContinuePrintJobL();
+
+ /**
+ * Print pages amount getter
+ *
+ * @return amount of print pages with current settings for current print job
+ */
+ TInt GetNumPrintPages();
+
+ /**
+ * Job status getter
+ *
+ * @return job status code
+ */
+ TInt GetJobStatus();
+
+ /**
+ * Printer status getter
+ *
+ * @param aPrinterID printer id
+ * @return printer status code
+ */
+ TInt GetPrinterStatus(TInt aPrinterID);
+
+ /**
+ * Printer capability id getter
+ *
+ * @param aPrinterID printer id
+ * @param aCapabilityIDs place holder for capability ids supported by printer
+ * @return error code
+ */
+ TInt GetPrinterCapabilityIDsL(TInt aPrinterID, RArray<TInt>& aCapabilityIDs);
+
+ /**
+ * Printer capability getter
+ *
+ * @param aPrinterID printer id
+ * @param aCapabilityID capability id
+ * @param aCapability place holder for capability
+ * @return error code
+ */
+ TInt GetPrinterCapabilityL(TInt aPrinterID, TInt aCapabilityID, TDirectPrintCapability& aCapability);
+
+ /**
+ * Printer setting getter
+ *
+ * @param aCapabilityID capability id
+ * @param aValue place holder for capability value
+ * @return error code
+ */
+ TInt GetJobSetting(TInt aCapabilityID, TInt& aValue);
+
+ /**
+ * Printer setting setter
+ *
+ * @param aCapabilityID capability id
+ * @param aValue capability value
+ * @param aAffectedCapability affected capability id
+ * @return error code
+ */
+ TInt SetJobSettingL(TInt aCapabilityID, TInt aValue, TInt& aAffectedCapability);
+
+ /**
+ * Preview pages amount getter for current protocol
+ *
+ * @return preview pages amount
+ */
+ TInt GetNumPreviewPages();
+
+ /**
+ * Template icon getter
+ *
+ * @param aTemplateID template id
+ * @param aFbsBitmapHandle place holder for template bitmap handle
+ * @return error code
+ */
+ TInt GetJobTemplateIconL(TInt aTemplateID, TInt& aFbsBitmapHandle);
+
+ /**
+ *Creates a preview image
+ *
+ * @param aPageNumber Page number to create preview image of
+ * @return error code
+ */
+ TInt CreatePreviewImage(TInt aPageNumber);
+
+ /**
+ * Remove cached printer
+ *
+ * @param aPrinterID printer id
+ * @return error code
+ */
+ TInt RemoveCachedPrinterL(TInt aPrinterID);
+
+ /**
+ * Supported protocols getter
+ *
+ * @return OR:ed protocol ids
+ */
+ TUint SupportedProtocols();
+
+ /**
+ * Register observer for idle events receiving
+ *
+ * @param aObserver observer
+ */
+ void RegisterIdleObserver(MIdleObserver* aObserver);
+
+ /**
+ * Number of copies setter for current print job
+ *
+ * @param aNumsOfCopies number of copies array
+ * @param aErr place holder for error code
+ */
+ void SetNumsOfCopiesL(const RArray<TInt>& aNumsOfCopies, TInt& aErr);
+
+ /**
+ * Handle session disconnection
+ *
+ * @param aIdleObserver idle observer object of that session
+ * @param aDiscoveryObserver discovery observer object of that session
+ * @param aEventObserver print job observer object of that session
+ */
+ void HandleSessionDisconnect( const MIdleObserver* aIdleObserver,
+ const MPrinterDiscoveryObserver* aDiscoveryObserver,
+ const MPrintEventObserver* aEventObserver );
+
+ /**
+ * Number of protocols getter
+ *
+ * @return number of protocols
+ */
+ TInt ProtocolCount();
+
+ /**
+ * Protocol name getter
+ *
+ * @param aMessage message completed upon event arrival
+ * @return error code
+ */
+ TInt GetProtocolNameL(TDpMessage& aMessage);
+
+
+ private: // from MProtDiscoveryObserver
+ void FoundDeviceL(TPrinter& aDeviceInfo);
+ void DiscoveryStatusL(TInt aStatus, TInt aErrorCode, TInt aErrorStringCode);
+ void RemoveDeviceL(TPrinter& aDeviceInfo);
+
+ private: // from MProtPrintEventObserver
+ void PrintJobProgressEvent(TInt aStatus, TInt aPercent, TInt aJobStateCode);
+ void PrintJobErrorEvent(TInt aErrorCode, TInt aErrorStringCode);
+ void PrinterStatusEvent(TInt aErrorCode, TInt aErrorStringCode);
+ void PreviewImageEvent(TInt aFsBitmapHandle);
+ void ShowMessageL(TInt aMsgLine1Code, TInt aMsgLine2Code);
+ TBool AskYesNoQuestionL(TInt aMsgLine1Code, TInt aMsgLine2Code);
+ const TDesC& AskForInputL(TInt aMsgLine1Code, TInt aMsgLine2Code);
+
+ private: // from MProtIdleObserver
+ void StatusEvent(const TEvent &aEvent, TInt aError, TInt aMsgCode);
+
+ private:
+ CDirectPrintBody();
+ void ConstructL();
+ TInt FindInternalDeviceReference(TInt aExternalDeviceID, TInt& aInternalDeviceID, MProtPrintingDevice*& aProtToUse);
+ TInt ValidateImagesL(const RPointerArray<HBufC>& aImageList, TInt &aInvalidCount);
+ CDirectPrintScheduler& ActiveScheduler() const;
+ void TryNextDiscovery();
+ static TInt TryNextDiscoveryL(TAny* aObj);
+ void DoTryNextDiscoveryL();
+
+ private:
+ /// Class loader and manager.
+ CDirectPrintProtocolsLoader* iClassLoader;
+ /// Pointer to store the current protocol in use for discovery.
+ MProtPrintingDevice* iCurrentProtocol;
+ /// Pointer to store the current protocol in use for creating a print job.
+ MProtPrintingDevice* iCurrentPrintJobProtocol;
+ /// DirectPrint Observer.
+ MPrinterDiscoveryObserver* iPrinterDiscoveryObserver;
+ /// DirectPrint Observer.
+ MPrintEventObserver* iPrinterPrintEventObserver;
+ /// DirectPrint Idle Observer.
+ MIdleObserver* iPrinterIdleObserver;
+ /// Used to store the requested protocols.
+ TUint iProtocolsRequested;
+ /// Array of the image filenames to print.
+ RPointerArray<HBufC> iImageFileNames;
+ /// Enables async discovery
+ CIdle* iIdleDiscovery;
+
+ TBool iDiscoveryCancelled;
+ };
+
+#endif // CDIRECTPRINTBODY_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintServer/inc/directprintclientserver.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+// Protection against nested includes
+#ifndef DIRECTPRINTCLIENTSERVER_H
+#define DIRECTPRINTCLIENTSERVER_H
+
+// System include files
+#include <e32std.h>
+
+// User include files
+#include "directprintserveruid.h"
+
+_LIT( KDirectPrintServerName, "directprintserver" );
+_LIT( KDirectPrintServerImg, "directprintserver" ); // EXE name
+
+const TInt KMaxDirectPrintMessage = 512;
+const TInt KDirectPrintServerMajor = 0;
+const TInt KDirectPrintServerMinor = 0;
+const TInt KDirectPrintServerBuild = 0;
+
+enum TDirectPrintMessages
+ {
+ ECountConnections = 0,
+ ESetForeground,
+ EReserveEngine,
+ EReleaseEngine,
+ ESupportedProtocols,
+ EGetNumPrintPages,
+ EGetJobStatus,
+ EGetPrinterStatus,
+ ECancelDiscovery,
+ ESubmitPrintJob,
+ ECancelPrintJob, // 10
+ EContinuePrintJob,
+ ERemoveCachedPrinter,
+ EGetJobTemplateIcon,
+ EGetNumPreviewPages,
+ ESetJobSetting,
+ EGetJobSetting,
+ EGetPrinterCapability,
+ EGetPrinterCapId,
+ EGetPrinterCapType,
+ EGetPrinterCapDef, // 20
+ EGetPrinterCapLow,
+ EGetPrinterCapHigh,
+ EGetPrinterCapEnumCount,
+ EGetPrinterCapEnum,
+ EGetPrinterCapabilityIDsCount,
+ EGetPrinterCapabilityID,
+ ERegisterIdleObserver,
+ ECancelRegisterIdleObserver,
+ EStartDiscovery,
+ EContinueDiscovery, // 30
+ EPrepareJob,
+ ECreateJob,
+ EContinueCreateJob,
+ ECancelStartDiscovery,
+ ECancelCreateJob,
+ EIsPictBridgeMode,
+ ESetNumberOfCopiesCount,
+ ESetNumberOfCopies, // 38
+ EGetProtocolNamesCount,
+ EGetProtocolName
+ };
+
+#endif// DIRECTPRINTCLIENTSERVER_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintServer/inc/directprintjobguarddata.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+// Protection against nested includes
+#ifndef DIRECTPRINTJOBGUARDDATA_H
+#define DIRECTPRINTJOBGUARDDATA_H
+
+// System includes
+#include <e32def.h>
+
+class TDirectPrintJobGuardData
+ {
+public:
+
+ enum TCallbackNum
+ {
+ EProgressEventCb = 0,
+ EErrorEventCb,
+ EStatusEventCb,
+ EImageEventCb
+ };
+
+public:
+
+ TInt iStatus;
+ TInt iPercentCompletion;
+ TInt iJobStateCode;
+ TInt iError;
+ TInt iErrorStringCode;
+ TInt iFsBitmapHandle;
+ TCallbackNum iCb;
+ };
+
+#endif // DIRECTPRINTJOBGUARDDATA_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintServer/inc/directprintmessage.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,136 @@
+/*
+* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+*
+*/
+
+
+#ifndef TMESSAGEWRP2_H
+#define TMESSAGEWRP2_H
+
+#include <e32base.h>
+
+class TDpMessage
+ {
+ public:
+
+ /**
+ * Message wrapper constructor
+ *
+ * @param aMessage message to be wrapped
+ * @param aConnected session connection flag
+ */
+ TDpMessage( const RMessage2& aMessage, const TBool& aConnected );
+
+ public:
+
+ /**
+ * If session connected, write descriptor to the wrapped message
+ *
+ * @param aParam message parameter id
+ * @param aDes descriptor
+ * @param aOffset offset from the start of the client's descriptor
+ */
+ void WriteL(TInt aParam, const TDesC8 &aDes, TInt aOffset=0) const;
+
+ /**
+ * If session connected, complete the wrapped message
+ *
+ * @param aReason completion code
+ */
+ void Complete(TInt aReason) const;
+
+ /**
+ * If session connected, gets the 1st message argument as an integer value
+ *
+ * @return 1st message argument as an integer value
+ */
+ TInt Int0() const;
+
+ /**
+ * If session connected, gets the 2nd message argument as an integer value
+ *
+ * @return 2nd message argument as an integer value
+ */
+ TInt Int1() const;
+
+ /**
+ * If session connected, gets the length of a descriptor argument
+ * in the client's process
+ *
+ * @param aParam index value identifying the argument
+ * @return the length of the descriptor or error code
+ */
+ TInt GetDesLength(TInt aParam) const;
+
+ /**
+ * If session connected, read data from the specified offset within
+ * the 8-bit descriptor argument, into the specified target descriptor
+ *
+ * @param aParam message parameter id
+ * @param aDes target descriptor
+ * @param aOffset offset from the start of the client's descriptor
+ */
+ void ReadL(TInt aParam, TDes8 &aDes, TInt aOffset=0) const;
+
+ /**
+ * If session connected, read data from the specified offset within
+ * the 16-bit descriptor argument, into the specified target descriptor
+ *
+ * @param aParam message parameter id
+ * @param aDes target descriptor
+ * @param aOffset offset from the start of the client's descriptor
+ */
+ void ReadL(TInt aParam, TDes16 &aDes, TInt aOffset=0) const;
+
+ /**
+ * Panic the client thread
+ *
+ * @param aCategory category descriptor
+ * @param aReason reason id
+ */
+ void Panic(const TDesC &aCategory, TInt aReason) const;
+
+ /**
+ * Gets the the number of the function requested by the client
+ *
+ * @return the function number
+ */
+ TInt Function() const;
+
+ /**
+ * Sets the disposable state. Disposable means that the message needs not
+ * to be preserved
+ *
+ * @param aDisposable disposable flag
+ */
+ void SetDisposable( TBool aDisposable );
+
+ /**
+ * Gets the disposable state
+ *
+ * @return the disposable flag
+ */
+ TBool Disposable() const;
+
+ private: // data
+ RMessage2 iMessage;
+ const TBool& iConnected;
+ TBool iDisposable;
+ };
+
+
+#endif // TMESSAGEWRP2_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintServer/inc/directprintnumofcopies.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+// Protection against nested includes
+#ifndef DIRECTPRINTNUMOFCOPIES_H
+#define DIRECTPRINTNUMOFCOPIES_H
+
+// System includes
+#include <e32base.h>
+
+class CDirectPrintNumOfCopies : public CBase
+ {
+ public:
+
+ /**
+ * 2-phase constructor
+ *
+ * @return new object
+ */
+ static CDirectPrintNumOfCopies* NewL();
+
+ /**
+ * Destructor
+ */
+ ~CDirectPrintNumOfCopies();
+
+ private:
+ CDirectPrintNumOfCopies();
+ void ConstructL();
+
+ public:
+
+ /**
+ * Set the amount of coming array elements
+ *
+ * @param aCount amount of coming array elements
+ */
+ void Reset( TInt aCount );
+
+ /**
+ * Append next element to the array
+ *
+ * @param aNumOfCopies number of copies array element
+ * @param aFull place holder for value which indicates that
+ * all elements are added to the array
+ */
+ void AddNumOfCopyL( TInt aNumOfCopies, TBool& aFull );
+
+ /**
+ * Number of copies array getter
+ *
+ * @return number of copies array
+ */
+ const RArray<TInt>& NumsOfCopies() const;
+
+ private: // data
+ TInt iCount;
+ RArray<TInt> iNumsOfCopies;
+ };
+
+
+#endif // DIRECTPRINTNUMOFCOPIES_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintServer/inc/directprintprotocolinfo.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef __DIRECTPRINTPROTOCOLINFO_H__
+#define __DIRECTPRINTPROTOCOLINFO_H__
+
+// System includes
+#include <e32base.h>
+#include <ecom/ImplementationInformation.h>
+
+// Class declaration
+/**
+ * Listbox class
+ * more_complete_description
+ */
+class CDirectPrintProtocolInfo : public CBase
+ {
+public:
+ /** Constructors */
+ static CDirectPrintProtocolInfo* NewLC(const CImplementationInformation& aImplInfo);
+ /** Destructor */
+ ~CDirectPrintProtocolInfo();
+
+ TUid ImplementationUid() const;
+
+ const TDesC& DisplayName() const;
+
+private:
+ CDirectPrintProtocolInfo();
+
+private:
+ /** The implementation UID */
+ TUid iImplementationUid;
+ /** Display name */
+ HBufC* iDisplayName;
+ };
+
+#endif // __DIRECTPRINTPROTOCOLINFO_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintServer/inc/directprintprotocolsloader.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,114 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description: Contains the CDirectPrintProtocolsLoader class definition.
+*
+*/
+
+
+// Protection against nested includes
+#ifndef DIRECTPRINTPROTOCOLSLOADER_H
+#define DIRECTPRINTPROTOCOLSLOADER_H
+
+// System includes
+#include <e32base.h>
+
+// User includes
+#include "directprintprotocolinfo.h"
+
+// Forward declarations
+class MProtPrintingDevice;
+
+class CDirectPrintProtocolsLoader : public CBase
+ {
+ public:
+
+ static CDirectPrintProtocolsLoader* NewL();
+ ~CDirectPrintProtocolsLoader();
+
+ /**
+ * Gets the number of protocol implementations that could be loaded.
+ * @return Number of protocols available.
+ */
+ TInt GetNumberOfProtocolsAvailable() const;
+
+ /**
+ * Gets the next protocol in the internal list of protocols.
+ *
+ * Returns a pointer to the next protocol in the list. If the end of the list is reached, it starts the list over.
+ * The order in which protocols will be returned is: DPOF, BPP, PictBridge, any other protocols (sorted alpha-
+ * betically). This pointer should not be deleted.
+ * @return Pointer to the next protocol instance.
+ */
+ MProtPrintingDevice* GetNextProtocol();
+
+ /**
+ * Gets the protocol located in the position specified.
+ * @param aIndex Index of the desired protocol. If there are 3 protocols, the valid indexes are: 0, 1, 2.
+ * @return Pointer to the next protocol instance. This pointer should not be deleted.
+ */
+ MProtPrintingDevice* GetProtocolAt(TInt aIndex);
+
+ /**
+ * Resets the inner pointers to the beginning of the protocols' list.
+ */
+ void Reset();
+
+ /**
+ * Returns the index of the current protocol
+ */
+ TInt GetProtocolIndex() const;
+
+ /**
+ * @brief Returns the Protocols supported by the DLL. It can be any of the KDirectPrint_PrinterProtocol* constants.
+ * @return An OR'ed value with the supported protocols information.
+ */
+ TUint SupportedProtocols() const;
+
+ /**
+ * Gets the protocol name in the position specified.
+ * @param aIndex Index of the desired protocol. If there are 3 protocols, the valid indexes are: 0, 1, 2.
+ * @param aName Name of the protocol.
+ * @param aUid Uid of the protocol.
+ * @return error code.
+ */
+ TInt GetProtocolName(TInt aIndex, TDes& aName, TInt& aUid);
+
+ private:
+
+ CDirectPrintProtocolsLoader();
+ void ConstructL();
+ void LoadL();
+ static void CleanupProt( TAny* aData );
+
+ private: // data
+
+ /// Used to store the number of protocols loaded and available for use.
+ TInt iAvailableProtocols;
+
+ /// Index of the next protocol available.
+ TInt iProtIndex;
+
+ /// Pointer array used to store the reference to the protocols.
+ RPointerArray<MProtPrintingDevice> iProtocols;
+
+ /// OR'ed value with the supported protocols information.
+ TUint iSupportedProtocols;
+
+ /// Pointer array used to store the reference to the protocol infomations.
+ RPointerArray<CDirectPrintProtocolInfo> iProtocolInfos;
+ };
+
+#endif // DIRECTPRINTPROTOCOLSLOADER_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintServer/inc/directprintrsimageparser.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description: Contains the CDirectPrintRsImageParser class definition.
+*
+*/
+
+
+#ifndef CDIRECTPRINTRSDIRECTPARSER_H
+#define CDIRECTPRINTRSDIRECTPARSER_H
+
+#include <e32base.h>
+#include <f32file.h>
+
+class CDirectPrintRsImageParser : public CBase
+ {
+ public:
+ enum TImageEncoding
+ {
+ EUnknown = 0,
+ ENonDiffHuffmanBaseline = 0xc0,
+ ENonDiffHuffmanExtendedSeq,
+ ENonDiffHuffmanProgressive,
+ ENonDiffHuffmanLossless,
+ EUnused1,
+ EDiffHuffmanSequential,
+ EDiffHuffmanProgressive,
+ EDiffHuffmanLossless,
+ EReserved,
+ ENonDiffArithExtendedSeq,
+ ENonDiffArithProgressive,
+ ENonDiffArithLossless,
+ EUnused2,
+ EDiffArithSequential,
+ EDiffArithProgressive,
+ EDiffArithLossless
+ };
+
+ /**
+ * 2-phase constructor
+ *
+ * @return new object. The object is left on the cleanup stack
+ */
+ static CDirectPrintRsImageParser* NewLC();
+
+ /**
+ * Destructor
+ */
+ ~CDirectPrintRsImageParser();
+
+ /**
+ * JPEG image validator
+ *
+ * @param aFileName image file name
+ * @param aValid place holder for validity indicator
+ * @param aErr place holder for error code
+ */
+ void ValidateL( const TDesC& aFileName, TBool& aValid, TInt& aErr );
+
+ private:
+
+ CDirectPrintRsImageParser();
+ void ConstructL();
+ TBool Validate( TInt aStartOfDataOffset, TInt aWidth, TInt aHeight, TInt aSize, TInt aEncoding, TInt aErr );
+ TInt ReadData( RFile& aFile, TInt aStartByte, TDes8& aData );
+
+ private:
+
+ RFs iFs;
+ };
+
+#endif // CDIRECTPRINTRSDIRECTPARSER_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintServer/inc/directprintscheduler.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+// Protection against nested includes
+#ifndef CDIRECTPRINTSCHEDULER_H
+#define CDIRECTPRINTSCHEDULER_H
+
+// System include files
+#include <e32base.h>
+
+class MProtIdleObserver;
+
+class CDirectPrintScheduler : public CActiveScheduler
+ {
+ public: // from CActiveScheduler
+ void Error(TInt aError) const;
+ public:
+
+ /**
+ * Idle observer setter. Asynchronous errors (leaves) will be
+ * propagated to this observer
+ *
+ * @param aIdleObserver idle observer
+ */
+ void SetIdleObserver( MProtIdleObserver& aIdleObserver );
+
+ /**
+ * Current protocol id setter
+ *
+ * @param aProtocol current protocol id
+ */
+ void SetCurrentProtocol( TInt aProtocol );
+
+ private:
+ MProtIdleObserver* iIdleObserver;
+ TInt iCurrentProtocol;
+ };
+
+
+#endif // CDIRECTPRINTSCHEDULER_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintServer/inc/directprintserver.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,137 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+// Protection against nested includes
+#ifndef CDIRECTPRINTSERVER_H
+#define CDIRECTPRINTSERVER_H
+
+// System include files
+#include <e32base.h>
+#include <fbs.h>
+
+class CDirectPrintBody;
+
+// ----------------------------------------------------------------------------------------
+// Server's policy here
+// ----------------------------------------------------------------------------------------
+
+// Total number of ranges
+const TUint KDirectPrintRangeCount = 2;
+
+// Definition of the ranges of IPC numbers
+const TInt KDirectPrintRanges[KDirectPrintRangeCount] =
+ {
+ 0, // implemented 0-38
+ 41 // non implemented function end of range check ; ENotSupported
+ };
+
+// Policy to implement for each of the above ranges
+const TUint8 KDirectPrintElementsIndex[KDirectPrintRangeCount] =
+ {
+ CPolicyServer::EAlwaysPass, // applies to 0th range
+ CPolicyServer::ENotSupported // applies to 1st range (out of range IPC)
+ };
+
+// Package all the above together into a policy
+const CPolicyServer::TPolicy KDirectPrintPolicy =
+ {
+ CPolicyServer::EAlwaysPass, // specifies all connect attempts should pass
+ KDirectPrintRangeCount, // number of ranges
+ KDirectPrintRanges, // ranges array
+ KDirectPrintElementsIndex, // elements<->ranges index
+ NULL, // array of elements
+ };
+class CDirectPrintServer : public CPolicyServer
+ {
+ public:
+
+ /**
+ * 2-phase constructor
+ *
+ * @return new object. The object is left on the cleanup stack
+ */
+ static CDirectPrintServer* NewLC();
+
+ /**
+ * Destructor
+ */
+ ~CDirectPrintServer();
+
+ /**
+ * Increase session counter
+ */
+ void AddSession();
+
+ /**
+ * Decrease session counter. If the counter is decreased to 0, the
+ * server is shut down
+ */
+ void RemoveSession();
+
+ /**
+ * Session count getter
+ *
+ * @return session count
+ */
+ TInt SessionCount() const;
+
+ /**
+ * Reserve printing engine to the session
+ *
+ * @param aSession session that claims the printing engine
+ * @return error code
+ */
+ TInt ReserveEngine( const CSession2* aSession );
+
+ /**
+ * Release printing engine by the session
+ *
+ * @param aSession session that wants to release the printing engine
+ * @return error code
+ */
+ TInt ReleaseEngine( const CSession2* aSession );
+
+ /**
+ * Printing engine getter
+ *
+ * @return printing engine
+ */
+ CDirectPrintBody& Engine() const;
+
+ private:
+
+ TInt RunError( TInt aError );
+ CDirectPrintServer();
+ void ConstructL();
+ CSession2* NewSessionL( const TVersion& aVersion, const RMessage2& aMessage ) const;
+
+ private:
+
+ TInt iConnsCount;
+
+ const CSession2* iEngineHolder;
+
+ CDirectPrintBody* iEngine;
+
+ RFbsSession iFbs;
+ };
+
+
+#endif // CDIRECTPRINTSERVER_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintServer/inc/directprintserverjobguard.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef DIRECTPRINTSERVERJOBGUARD_H
+#define DIRECTPRINTSERVERJOBGUARD_H
+
+#include <e32base.h>
+
+#include "imageprint.h"
+#include "directprintjobguarddata.h"
+
+class CDirectPrintBody;
+class TDpMessage;
+
+class CDirectPrintServerJobGuard : public CBase, public MPrintEventObserver
+ {
+ public:
+
+ /**
+ * 2-phase constructor
+ *
+ * @param aEngine printing engine
+ * @return new object
+ */
+ static CDirectPrintServerJobGuard* NewL( CDirectPrintBody& aEngine );
+
+ /**
+ * Destructor
+ */
+ ~CDirectPrintServerJobGuard();
+
+ private: // from MPrintEventObserver
+
+ void PrintJobProgressEvent(TInt aStatus, TInt aPercentCompletion, TInt aJobStateCode);
+ void PrintJobErrorEvent(TInt aError, TInt aErrorStringCode);
+ void PrinterStatusEvent(TInt aError, TInt aErrorStringCode);
+ void PreviewImageEvent(TInt aFsBitmapHandle);
+ void ShowMessageL(TInt aMsgLine1Code, TInt aMsgLine2Code);
+ TBool AskYesNoQuestionL(TInt aMsgLine1Code, TInt aMsgLine2Code);
+ const TDesC& AskForInputL(TInt aMsgLine1Code, TInt aMsgLine2Code);
+
+ public:
+
+ /**
+ * Prepare print job by copying image file name into internal buffer
+ *
+ * @param aMessage message contains file name of one image.
+ */
+ void PrepareL( TDpMessage& aMessage );
+
+ /**
+ * Create print job and set this object as print job events observer
+ *
+ * @param aMessage message contains printer id
+ */
+ TInt CreateL( TDpMessage& aMessage );
+
+ /**
+ * Continue waiting for print job events
+ *
+ * @param aMessage message completed upon event arrival
+ */
+ void ContinueCreateL( TDpMessage& aMessage );
+
+ /**
+ * Stop waiting for print job events. Cancel waiting message
+ */
+ void Stop();
+
+ private:
+
+ CDirectPrintServerJobGuard( CDirectPrintBody& aEngine );
+ void ConstructL();
+ void Process( TInt aErr = KErrNone );
+ void DoProcessL();
+ void DoPreProcessL( const TDirectPrintJobGuardData& aData );
+
+ private: // data
+
+ CDirectPrintBody& iEngine;
+ TDpMessage* iMessage;
+ RArray<TDirectPrintJobGuardData> iBuffer;
+ RPointerArray<TDesC> iImages;
+ TBool iRequestActive;
+ };
+
+
+#endif // DIRECTPRINTSERVERJOBGUARD_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintServer/inc/directprintserveruid.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+// Protection against nested includes
+#ifndef DIRECTPRINTSERVERUID_H
+#define DIRECTPRINTSERVERUID_H
+
+// Image Print Server UID3
+
+#define KDIRECTPRINTSERVERUID3 0x2002BB2C
+
+#endif // DIRECTPRINTSERVERUID_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintServer/inc/directprintsession.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+// Protection against nested includes
+#ifndef CDIRECTPRINTSESSION_H
+#define CDIRECTPRINTSESSION_H
+
+// System includes
+#include <e32base.h>
+
+// User includes
+#include "directprintcapability.h"
+#include "directprintmessage.h"
+
+// Forward declarations
+class CDirectPrintServer;
+class CDirectPrintServerJobGuard;
+class CDirectPrintNumOfCopies;
+
+
+class CDirectPrintSession : public CSession2
+ {
+ public: // from CSession2
+ void CreateL();
+
+ private:
+ ~CDirectPrintSession();
+ CDirectPrintServer& Server();
+ void ServiceL( const RMessage2& aMessage );
+ void Disconnect(const RMessage2 &aMessage);
+
+ private:
+ void ServiceFirstPartL( TInt aIndex );
+ void ServiceSecondPartL( TInt aIndex );
+ void ServiceThirdPartL ( TInt aIndex );
+ void CountConnectionsL( TDpMessage& aMessage );
+ void SetForegroundL( TDpMessage& aMessage );
+ void ReserveEngine( TDpMessage& aMessage );
+ void ReleaseEngine( TDpMessage& aMessage );
+ void SupportedProtocols( TDpMessage& aMessage );
+ void GetNumPrintPages( TDpMessage& aMessage );
+ void GetJobStatus( TDpMessage& aMessage );
+ void GetPrinterStatus( TDpMessage& aMessage );
+ void CancelDiscovery( TDpMessage& aMessage );
+ void SubmitPrintJobL( TDpMessage& aMessage );
+ void CancelPrintJob( TDpMessage& aMessage );
+ void ContinuePrintJobL( TDpMessage& aMessage );
+ void RemoveCachedPrinterL( TDpMessage& aMessage );
+ void GetJobTemplateIconL( TDpMessage& aMessage );
+ void GetNumPreviewPages( TDpMessage& aMessage );
+ void SetJobSettingL( TDpMessage& aMessage );
+ void GetJobSettingL( TDpMessage& aMessage );
+ void GetPrinterCapabilityL( TDpMessage& aMessage );
+ void GetPrinterCapIdL( TDpMessage& aMessage );
+ void GetPrinterCapTypeL( TDpMessage& aMessage );
+ void GetPrinterCapDefL( TDpMessage& aMessage );
+ void GetPrinterCapLowL( TDpMessage& aMessage );
+ void GetPrinterCapHighL( TDpMessage& aMessage );
+ void GetPrinterCapEnumCountL( TDpMessage& aMessage );
+ void GetPrinterCapEnumL( TDpMessage& aMessage );
+ void GetPrinterCapabilityIDsCountL( TDpMessage& aMessage );
+ void GetPrinterCapabilityIDL( TDpMessage& aMessage );
+ void RegisterIdleObserverL( TDpMessage& aMessage );
+ void CancelRegisterIdleObserverL( TDpMessage& aMessage );
+ void StartDiscoveryL( TDpMessage& aMessage );
+ void ContinueDiscoveryL( TDpMessage& aMessage );
+ void PrepareJobL( TDpMessage& aMessage );
+ void CreateJobL( TDpMessage& aMessage );
+ void ContinueCreateJobL( TDpMessage& aMessage );
+ void CancelStartDiscoveryL( TDpMessage& aMessage );
+ void CancelCreateJobL( TDpMessage& aMessage );
+ void IsPictBridgeModeL( TDpMessage& aMessage );
+ void SetNumberOfCopiesCountL( TDpMessage& aMessage );
+ void SetNumberOfCopiesL( TDpMessage& aMessage );
+ void GetProtocolNamesCountL( TDpMessage& aMessage );
+ void GetProtocolNameL( TDpMessage& aMessage );
+
+ private: // data
+
+ RPointerArray<TDpMessage> iMsgWrappers;
+ RArray<TInt> iCapabilityIDs;
+ CDirectPrintServerJobGuard* iJobGuard;
+ TDirectPrintCapability iCapability;
+ CDirectPrintNumOfCopies* iNumOfCopies;
+ TBool iConnected;
+ };
+
+
+#endif // CDIRECTPRINTSESSION_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintServer/src/directprintbody.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,739 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description: Contains the CDirectPrintBody class definition.
+*
+*/
+
+
+#include <bluetooth/hci/hcierrors.h>
+
+#include "directprintbody.h"
+#include "directprintrsimageparser.h"
+#include "clog.h"
+#include "directprintselectitem.h"
+#include "directprintmessage.h"
+
+CDirectPrintBody* CDirectPrintBody::NewL()
+ {
+ CDirectPrintBody* self = new (ELeave) CDirectPrintBody();
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+CDirectPrintBody::~CDirectPrintBody()
+ {
+ LOG("CDirectPrintBody::~CDirectPrintBody begin");
+ delete iClassLoader;
+ iImageFileNames.ResetAndDestroy();
+ delete iIdleDiscovery;
+ LOG("CDirectPrintBody::~CDirectPrintBody end");
+ }
+
+TInt CDirectPrintBody::StartDiscovery(MPrinterDiscoveryObserver& aObserver, TUint aProtocols)
+ {
+ LOG1("CDirectPrintBody::StartDiscovery aProtocols: %d", aProtocols);
+ iPrinterDiscoveryObserver = &aObserver;
+
+ if( iCurrentProtocol )
+ {
+ iCurrentProtocol->CancelDiscovery( EFalse );
+ }
+
+ iCurrentProtocol = NULL;
+ iClassLoader->Reset();
+ iProtocolsRequested = aProtocols;
+ iDiscoveryCancelled = EFalse;
+ TryNextDiscovery();
+
+ LOG("CDirectPrintBody::StartDiscovery end");
+ return KErrNone;
+ }
+
+void CDirectPrintBody::CancelDiscovery()
+ {
+ LOG("CDirectPrintBody::CancelDiscovery begin");
+ iDiscoveryCancelled = ETrue;
+ if( iCurrentProtocol )
+ {
+ iCurrentProtocol->CancelDiscovery();
+ }
+ LOG("CDirectPrintBody::CancelDiscovery end");
+ }
+
+
+TInt CDirectPrintBody::CreatePrintJobL(TInt aPrinterID, RPointerArray<TDesC>& aImages, MPrintEventObserver& aObserver)
+ {
+ LOG("CDirectPrintBody::CreatePrintJobL begin");
+ iPrinterPrintEventObserver = &aObserver;
+ iCurrentPrintJobProtocol = NULL;
+
+ if( iCurrentProtocol )
+ {
+ iCurrentProtocol->CancelDiscovery( EFalse );
+ }
+
+#ifdef __IMAGE_PRINT_BASE
+ TInt DeviceID;
+ TInt err = FindInternalDeviceReference( aPrinterID, DeviceID, iCurrentPrintJobProtocol );
+ if( !err )
+ {
+ TInt count = aImages.Count();
+ if( count )
+ {
+ iImageFileNames.ResetAndDestroy();
+ for( TInt i = 0; i < count; ++i )
+ {
+ HBufC* fileName = aImages[i]->AllocLC();
+ iImageFileNames.AppendL( fileName );
+ CleanupStack::Pop(); // fileName
+ }
+
+ ActiveScheduler().SetCurrentProtocol( iCurrentPrintJobProtocol->SupportedProtocols() );
+ err = iCurrentPrintJobProtocol->CreatePrintJobL( DeviceID, aImages, *this );
+ }
+ else
+ {
+ err = KErrInvalidData;
+ }
+ }
+#endif // __IMAGE_PRINT_BASE
+
+ TInt DeviceID;
+ TInt err = FindInternalDeviceReference( aPrinterID, DeviceID, iCurrentPrintJobProtocol );
+ if( !err )
+ {
+ ActiveScheduler().SetCurrentProtocol( iCurrentPrintJobProtocol->SupportedProtocols() );
+ err = iCurrentPrintJobProtocol->CreatePrintJobL( DeviceID, aImages, *this );
+ }
+
+ LOG1("CDirectPrintBody::CreatePrintJobL return: %d", err);
+ return err;
+ }
+
+
+void CDirectPrintBody::SubmitPrintJobL()
+ {
+ LOG1("CDirectPrintBody::SubmitPrintJobL iCurrentPrintJobProtocol: %d", iCurrentPrintJobProtocol);
+ TInt err( KErrNone );
+
+ if( !iCurrentPrintJobProtocol )
+ {
+ err = KErrInvalidSequence;
+ }
+ if( !err )
+ {
+ TInt invalidImages;
+ err = ValidateImagesL( iImageFileNames, invalidImages );
+ LOG1("CDirectPrintBody::SubmitPrintJobL ValidateImagesL returns: %d", err);
+ }
+
+ User::LeaveIfError( err );
+
+ iCurrentPrintJobProtocol->SubmitPrintJobL();
+
+ LOG("CDirectPrintBody::SubmitPrintJobL end");
+ }
+
+
+TInt CDirectPrintBody::CancelPrintJob()
+ {
+ LOG("CDirectPrintBody::CancelPrintJob begin");
+ TInt err( KErrNone );
+ if( !iCurrentPrintJobProtocol )
+ {
+ err = KErrInvalidSequence;
+ }
+ if( !err )
+ {
+ err = iCurrentPrintJobProtocol->CancelPrintJob();
+ }
+ LOG1("CDirectPrintBody::CancelPrintJob return: %d", err);
+ return err;
+ }
+
+
+TInt CDirectPrintBody::ContinuePrintJobL()
+ {
+ LOG("CDirectPrintBody::ContinuePrintJobL begin");
+ TInt err( KErrInvalidSequence );
+ if( iCurrentPrintJobProtocol )
+ {
+ err = iCurrentPrintJobProtocol->ContinuePrintJobL();
+ }
+ LOG1("CDirectPrintBody::ContinuePrintJobL return: %d", err);
+ return err;
+ }
+
+
+TInt CDirectPrintBody::GetNumPrintPages()
+ {
+ LOG("CDirectPrintBody::GetNumPrintPages begin");
+ TInt err( KErrInvalidSequence );
+ if( iCurrentPrintJobProtocol )
+ {
+ err = iCurrentPrintJobProtocol->GetNumPrintPages();
+ }
+ LOG1("CDirectPrintBody::GetNumPrintPages return: %d", err);
+ return err;
+ }
+
+TInt CDirectPrintBody::GetJobStatus()
+ {
+ LOG("CDirectPrintBody::GetJobStatus begin");
+ TInt err( KErrInvalidSequence );
+ if( iCurrentPrintJobProtocol )
+ {
+ err = iCurrentPrintJobProtocol->GetPrintJobStatus();
+ }
+ LOG1("CDirectPrintBody::GetJobStatus return: %d", err);
+ return err;
+ }
+
+TInt CDirectPrintBody::GetPrinterStatus(TInt aPrinterID)
+ {
+ LOG1("CDirectPrintBody::GetPrinterStatus aPrinterID: %d", aPrinterID);
+ TInt DeviceID;
+ MProtPrintingDevice* theProtToQuery = NULL;
+ TInt err = FindInternalDeviceReference( aPrinterID, DeviceID, theProtToQuery );
+ if( !err )
+ {
+ err = theProtToQuery->GetPrinterStatus( DeviceID );
+ }
+ LOG1("CDirectPrintBody::GetPrinterStatus return: %d", err);
+ return err;
+ }
+
+TInt CDirectPrintBody::GetPrinterCapabilityIDsL(TInt aPrinterID, RArray<TInt>& aCapabilityIDs)
+ {
+ LOG1("CDirectPrintBody::GetPrinterCapabilityIDsL aPrinterID: %d", aPrinterID);
+ TInt DeviceID;
+ MProtPrintingDevice* theProtToQuery = NULL;
+
+ TInt err = FindInternalDeviceReference( aPrinterID, DeviceID, theProtToQuery );
+ if( !err )
+ {
+ err = theProtToQuery->GetDeviceCapabilityIDsL( DeviceID, aCapabilityIDs );
+ }
+ else if( err == KErrNotFound )
+ {
+ err = KErrInvalidData;
+ }
+
+ LOG1("CDirectPrintBody::GetPrinterCapabilityIDsL return: %d", err);
+ return err;
+ }
+
+TInt CDirectPrintBody::GetPrinterCapabilityL(TInt aPrinterID, TInt aCapabilityID, TDirectPrintCapability& aCapability)
+ {
+ LOG1("CDirectPrintBody::GetPrinterCapabilityL aPrinterID: %d", aPrinterID);
+ LOG1("CDirectPrintBody::GetPrinterCapabilityL aCapabilityID: %d", aCapabilityID);
+ TInt DeviceID;
+ MProtPrintingDevice* theProtToQuery = NULL;
+
+ TInt err = FindInternalDeviceReference( aPrinterID, DeviceID, theProtToQuery );
+ if( !err )
+ {
+ err = theProtToQuery->GetDeviceCapabilityL( DeviceID, aCapabilityID, aCapability );
+ }
+ else if( err == KErrNotFound )
+ {
+ err = KErrInvalidData;
+ }
+
+ LOG1("CDirectPrintBody::GetPrinterCapabilityL return: %d", err);
+ return err;
+ }
+
+TInt CDirectPrintBody::GetJobSetting(TInt aCapabilityID, TInt& aValue)
+ {
+ LOG1("CDirectPrintBody::GetJobSetting aCapabilityID: %d", aCapabilityID);
+ TInt err( KErrInvalidSequence );
+ if( iCurrentPrintJobProtocol )
+ {
+ err = iCurrentPrintJobProtocol->GetJobSetting( aCapabilityID, aValue );
+ }
+ LOG1("CDirectPrintBody::GetJobSetting return: %d", err);
+ return err;
+ }
+
+TInt CDirectPrintBody::SetJobSettingL(TInt aCapabilityID, TInt aValue, TInt& aAffectedCapability)
+ {
+ LOG1("CDirectPrintBody::SetJobSettingL aCapabilityID: %d", aCapabilityID);
+ LOG1("CDirectPrintBody::SetJobSettingL aValue: %d", aValue);
+ TInt err( KErrInvalidSequence );
+ if( iCurrentPrintJobProtocol )
+ {
+ err = iCurrentPrintJobProtocol->SetJobSettingL( aCapabilityID, aValue, aAffectedCapability );
+ }
+ LOG1("CDirectPrintBody::SetJobSettingL return: %d", err);
+ return err;
+ }
+
+TInt CDirectPrintBody::GetNumPreviewPages()
+ {
+ LOG("CDirectPrintBody::GetNumPreviewPages");
+ TInt err( KErrInvalidSequence );
+ if( iCurrentPrintJobProtocol )
+ {
+ err = iCurrentPrintJobProtocol->GetNumPreviewPages();
+ }
+ LOG1("CDirectPrintBody::GetNumPreviewPages return: %d", err);
+ return err;
+ }
+
+TInt CDirectPrintBody::GetJobTemplateIconL( TInt aTemplateID, TInt& aFbsBitmapHandle )
+ {
+ LOG1("CDirectPrintBody::GetJobTemplateIconL aTemplateID: %d", aTemplateID);
+ TInt err( KErrInvalidSequence );
+ if( iCurrentPrintJobProtocol )
+ {
+ err = iCurrentPrintJobProtocol->GetJobTemplateIconL( aTemplateID, aFbsBitmapHandle );
+ }
+ LOG1("CDirectPrintBody::GetJobTemplateIconL return: %d", err);
+ return err;
+ }
+
+TInt CDirectPrintBody::CreatePreviewImage(TInt aPageNumber)
+ {
+ LOG1("CDirectPrintBody::CreatePreviewImage aPageNumber: %d", aPageNumber);
+ TInt err( KErrInvalidSequence );
+ if( iCurrentPrintJobProtocol )
+ {
+ err = iCurrentPrintJobProtocol->CreatePreviewImage(aPageNumber);
+ }
+ LOG1("CDirectPrintBody::CreatePreviewImage return: %d", err);
+ return err;
+ }
+
+TInt CDirectPrintBody::RemoveCachedPrinterL(TInt aPrinterID)
+ {
+ LOG1("CDirectPrintBody::RemoveCachedPrinterL aPrinterID: %d", aPrinterID);
+ TInt DeviceID;
+ MProtPrintingDevice* theProtToQuery = NULL;
+ TInt err = FindInternalDeviceReference( aPrinterID, DeviceID, theProtToQuery );
+ if( !err )
+ {
+ err = theProtToQuery->RemoveCachedDeviceL( DeviceID );
+ }
+ LOG1("CDirectPrintBody::RemoveCachedPrinterL return: %d", err);
+ return err;
+ }
+
+TUint CDirectPrintBody::SupportedProtocols()
+ {
+ LOG("CDirectPrintBody::SupportedProtocols begin");
+ TUint prots = iClassLoader->SupportedProtocols();
+ LOG1("CDirectPrintBody::SupportedProtocols return: %d", prots);
+ return prots;
+ }
+
+void CDirectPrintBody::RegisterIdleObserver(MIdleObserver *aObserver)
+ {
+ LOG("CDirectPrintBody::RegisterIdleObserver begin");
+ iPrinterIdleObserver = aObserver;
+ LOG("CDirectPrintBody::RegisterIdleObserver end");
+ }
+
+// From MProtDiscoveryObserver.
+void CDirectPrintBody::FoundDeviceL(TPrinter& aDeviceInfo)
+ {
+ LOG("CDirectPrintBody::FoundDeviceL begin");
+ if( iPrinterDiscoveryObserver )
+ {
+ //Check that device id is valid, there can't be any bits in the protocol field (higher bits)
+ if( !( PROTOCOL_ID_FIELD_MASK & aDeviceInfo.iPrinterID ) )
+ {
+ // Get the protocol index number
+ TInt protocolIndex = iClassLoader->GetProtocolIndex();
+
+ // Left shift this number so that it occupies the higher X bits (the PROTOCOL_ID_BIT_COUNT highest bits)
+ protocolIndex <<= sizeof(TInt)*8 - PROTOCOL_ID_BIT_COUNT;
+
+ // Add the protocol index number to the device id
+ aDeviceInfo.iPrinterID |= protocolIndex;
+
+ // Forward the FoundPrinterL callback to the observer
+ iPrinterDiscoveryObserver->FoundPrinterL( aDeviceInfo );
+ }
+ }
+ LOG("CDirectPrintBody::FoundDeviceL end");
+ }
+
+void CDirectPrintBody::DiscoveryStatusL( TInt aStatus, TInt aErrorCode, TInt aErrorStringCode )
+ {
+ LOG1("CDirectPrintBody::DiscoveryStatusL aStatus: %d", aStatus);
+ LOG1("CDirectPrintBody::DiscoveryStatusL aErrorCode: %d", aErrorCode);
+ LOG1("CDirectPrintBody::DiscoveryStatusL aErrorStringCode: %d", aErrorStringCode);
+ if( iPrinterDiscoveryObserver )
+ {
+ switch( aStatus )
+ {
+ case EDiscoveryFinished: // Done with 1 protocol.
+ {
+ // When Bluetooth discovery is finished, but Bluetooth is not enabled pass error code to UI.
+ if ( aErrorCode == ENoConnection )
+ {
+ iPrinterDiscoveryObserver->DiscoveryStatusL( aStatus, aErrorCode, aErrorStringCode );
+ }
+ iCurrentProtocol = NULL;
+ TUint doDiscovery = iProtocolsRequested & iClassLoader->SupportedProtocols();
+ LOG1("CDirectPrintBody::DiscoveryStatusL doDiscovery: %d", doDiscovery);
+ LOG1("CDirectPrintBody::DiscoveryStatusL iDiscoveryCancelled: %d", iDiscoveryCancelled);
+ if( ( !doDiscovery && aErrorCode == KErrCancel ) || iDiscoveryCancelled )
+ {
+ iPrinterDiscoveryObserver->DiscoveryStatusL( aStatus, aErrorCode, aErrorStringCode );
+ }
+ else
+ {
+ TryNextDiscovery();
+ }
+ }
+ break;
+ default: // Discovering, Cancelling.
+ iCurrentProtocol = NULL;
+ iPrinterDiscoveryObserver->DiscoveryStatusL( aStatus, aErrorCode, aErrorStringCode );
+ break;
+ }
+ }
+ LOG("CDirectPrintBody::DiscoveryStatusL end");
+ }
+
+
+void CDirectPrintBody::RemoveDeviceL(TPrinter& aDeviceInfo)
+ {
+ LOG("CDirectPrintBody::RemoveDeviceL begin");
+ if( iPrinterDiscoveryObserver )
+ {
+ if (PROTOCOL_ID_FIELD_MASK & aDeviceInfo.iPrinterID)
+ { //Invalid id, reject printer
+ }
+ else
+ { // Get the protocol index number
+ TInt protocolIndex = iClassLoader->GetProtocolIndex();
+
+ // Left shift this number so that it occupies the higher X bits (the PROTOCOL_ID_BIT_COUNT highest bits)
+ protocolIndex <<= sizeof(TInt)*8 - PROTOCOL_ID_BIT_COUNT;
+
+ // Add the protocol index number to the device id
+ aDeviceInfo.iPrinterID |= protocolIndex;
+
+ // Forward the RemovePrinterL callback to the observer
+ iPrinterDiscoveryObserver->RemovePrinterL( aDeviceInfo );
+ }
+ }
+ LOG("CDirectPrintBody::RemoveDeviceL end");
+ }
+
+// From MProtPrintEventObserver.
+void CDirectPrintBody::PrintJobProgressEvent(TInt aStatus, TInt aPercent, TInt aJobStateCode)
+ {
+ LOG1("CDirectPrintBody::PrintJobProgressEvent aStatus: %d", aStatus);
+ LOG1("CDirectPrintBody::PrintJobProgressEvent aPercent: %d", aPercent);
+ LOG1("CDirectPrintBody::PrintJobProgressEvent aJobStateCode: %d", aJobStateCode);
+ if( iPrinterPrintEventObserver )
+ iPrinterPrintEventObserver->PrintJobProgressEvent(aStatus, aPercent, aJobStateCode);
+ LOG("CDirectPrintBody::PrintJobProgressEvent end");
+ }
+
+void CDirectPrintBody::PrintJobErrorEvent(TInt aErrorCode, TInt aErrorStringCode)
+ {
+ LOG1("CDirectPrintBody::PrintJobErrorEvent aErrorCode: %d", aErrorCode);
+ LOG1("CDirectPrintBody::PrintJobErrorEvent aErrorStringCode: %d", aErrorStringCode);
+ if( iPrinterPrintEventObserver )
+ iPrinterPrintEventObserver->PrintJobErrorEvent(aErrorCode, aErrorStringCode);
+ LOG("CDirectPrintBody::PrintJobErrorEvent end");
+ }
+
+void CDirectPrintBody::PrinterStatusEvent(TInt aErrorCode, TInt aErrorStringCode)
+ {
+ LOG1("CDirectPrintBody::PrinterStatusEvent aErrorCode: %d", aErrorCode);
+ LOG1("CDirectPrintBody::PrinterStatusEvent aErrorStringCode: %d", aErrorStringCode);
+ if( iPrinterPrintEventObserver )
+ iPrinterPrintEventObserver->PrinterStatusEvent(aErrorCode, aErrorStringCode);
+ LOG("CDirectPrintBody::PrinterStatusEvent end");
+ }
+
+void CDirectPrintBody::PreviewImageEvent(TInt aFsBitmapHandle)
+ {
+ LOG1("CDirectPrintBody::PreviewImageEvent aFsBitmapHandle: %d", aFsBitmapHandle);
+ if( iPrinterPrintEventObserver )
+ iPrinterPrintEventObserver->PreviewImageEvent(aFsBitmapHandle);
+ LOG("CDirectPrintBody::PreviewImageEvent end");
+ }
+
+void CDirectPrintBody::ShowMessageL(TInt aMsgLine1Code, TInt aMsgLine2Code)
+ {
+ LOG1("CDirectPrintBody::ShowMessageL aMsgLine1Code: %d", aMsgLine1Code);
+ LOG1("CDirectPrintBody::ShowMessageL aMsgLine2Code: %d", aMsgLine2Code);
+ if( iPrinterPrintEventObserver )
+ iPrinterPrintEventObserver->ShowMessageL(aMsgLine1Code, aMsgLine2Code);
+ LOG("CDirectPrintBody::ShowMessageL end");
+ }
+
+TBool CDirectPrintBody::AskYesNoQuestionL(TInt aMsgLine1Code, TInt aMsgLine2Code)
+ {
+ LOG1("CDirectPrintBody::AskYesNoQuestionL aMsgLine1Code: %d", aMsgLine1Code);
+ LOG1("CDirectPrintBody::AskYesNoQuestionL aMsgLine2Code: %d", aMsgLine2Code);
+ TBool res( EFalse );
+ if( iPrinterPrintEventObserver )
+ {
+ res = iPrinterPrintEventObserver->AskYesNoQuestionL(aMsgLine1Code, aMsgLine2Code);
+ }
+ LOG1("CDirectPrintBody::AskYesNoQuestionL return: %d", res);
+ return res;
+ }
+
+const TDesC& CDirectPrintBody::AskForInputL(TInt aMsgLine1Code, TInt aMsgLine2Code)
+ {
+ LOG1("CDirectPrintBody::ShowMessageL aMsgLine1Code: %d", aMsgLine1Code);
+ LOG1("CDirectPrintBody::ShowMessageL aMsgLine2Code: %d", aMsgLine2Code);
+ if( iPrinterPrintEventObserver )
+ {
+ return iPrinterPrintEventObserver->AskForInputL(aMsgLine1Code, aMsgLine2Code);
+ }
+ else
+ {
+ return KNullDesC;
+ }
+ }
+
+void CDirectPrintBody::StatusEvent(const TEvent& aEvent, TInt aError, TInt aMsgCode)
+ {
+ LOG1("CDirectPrintBody::StatusEvent aError: %d", aError);
+ LOG1("CDirectPrintBody::StatusEvent aMsgCode: %d", aMsgCode);
+ LOG1("CDirectPrintBody::StatusEvent aEvent.iProtocol: %d", aEvent.iProtocol);
+ LOG1("CDirectPrintBody::StatusEvent aEvent.iSeverity: %d", aEvent.iSeverity);
+ LOG1("CDirectPrintBody::StatusEvent aEvent.iEventType: %d", aEvent.iEventType);
+
+ if( iPrinterIdleObserver )
+ {
+ iPrinterIdleObserver->StatusEvent( aEvent, aError, aMsgCode );
+ }
+
+ if( aEvent.iEventType == EAsynchronousLeave )
+ {
+ // a protocol threw an async leave
+ // we continue with other protocols
+ TUint doDiscovery = iProtocolsRequested & iClassLoader->SupportedProtocols();
+ if( doDiscovery ) TryNextDiscovery();
+ }
+ LOG("CDirectPrintBody::StatusEvent end");
+ }
+
+CDirectPrintBody::CDirectPrintBody()
+ : iCurrentProtocol( NULL )
+ , iCurrentPrintJobProtocol( NULL )
+ {
+ LOG("CDirectPrintBody::CDirectPrintBody begin");
+ LOG("CDirectPrintBody::CDirectPrintBody end");
+ }
+
+void CDirectPrintBody::ConstructL()
+ {
+ LOG("CDirectPrintBody::ConstructL begin");
+ iClassLoader = CDirectPrintProtocolsLoader::NewL();
+ iClassLoader->Reset();
+ for( TInt x=0; x < iClassLoader->GetNumberOfProtocolsAvailable(); ++x )
+ {
+ iClassLoader->GetNextProtocol()->RegisterIdleObserver( this );
+ }
+
+ iIdleDiscovery = CIdle::NewL( CActive::EPriorityIdle );
+ ActiveScheduler().SetIdleObserver( *this );
+ LOG("CDirectPrintBody::ConstructL end");
+ }
+
+CDirectPrintScheduler& CDirectPrintBody::ActiveScheduler() const
+ {
+ LOG("CDirectPrintBody::ActiveScheduler begin");
+ CDirectPrintScheduler* scheduler = static_cast<CDirectPrintScheduler*>( CActiveScheduler::Current() );
+ LOG("CDirectPrintBody::ActiveScheduler end");
+ return *scheduler;
+ }
+
+TInt CDirectPrintBody::FindInternalDeviceReference(TInt aExternalDeviceID, TInt& aInternalDeviceID, MProtPrintingDevice*& aProtToUse)
+ {
+ LOG1("CDirectPrintBody::FindInternalDeviceReference aExternalDeviceID: %d", aExternalDeviceID);
+ TInt err( KErrNotFound );
+
+#ifdef __IMAGE_PRINT_BASE
+ aProtToUse = NULL;
+
+ // Separate the external id into the corresponding fields
+ TInt protId = aExternalDeviceID & PROTOCOL_ID_FIELD_MASK;
+
+ TInt deviceId = aExternalDeviceID & DEVICE_ID_FIELD_MASK;
+ protId >>= (sizeof(TInt)*8 - PROTOCOL_ID_BIT_COUNT);
+ // If TInt is more than 4 bytes the mask should clear everything but the 6 least significant bits
+ protId &= PROTOCOL_ID_CLEAR_MASK; //remove 1's if the original protId was negative
+
+ // Check that the external ID does indeed belong to one of the currently
+ // loaded protocols
+ if( protId >= 0 && protId < iClassLoader->GetNumberOfProtocolsAvailable() )
+ {
+ aInternalDeviceID = deviceId;
+ aProtToUse = iClassLoader->GetProtocolAt(protId);
+ if( aProtToUse ) err = KErrNone;
+ }
+#endif // __IMAGE_PRINT_BASE
+#if 1 // ko
+ TInt protId = aExternalDeviceID & PROTOCOL_ID_FIELD_MASK;
+ protId >>= (sizeof(TInt)*8 - PROTOCOL_ID_BIT_COUNT);
+ protId &= PROTOCOL_ID_CLEAR_MASK;
+ if( protId >= 0 && protId < iClassLoader->GetNumberOfProtocolsAvailable() )
+ {
+ aInternalDeviceID = 128;
+ aProtToUse = iClassLoader->GetProtocolAt(protId);
+ if( aProtToUse ) err = KErrNone;
+ }
+#else // ko
+ aInternalDeviceID = 128;
+ aProtToUse = iClassLoader->GetProtocolAt(0);
+ if( aProtToUse ) err = KErrNone;
+#endif // ko
+ LOG1("CDirectPrintBody::FindInternalDeviceReference return: %d", err);
+ return err;
+ }
+
+TInt CDirectPrintBody::ValidateImagesL(const RPointerArray<HBufC>& aImageList, TInt &aInvalidCount)
+ {
+ LOG1("CDirectPrintBody::ValidateImagesL aImageList.Count(): %d", aImageList.Count());
+ aInvalidCount = 0;
+ TInt lastError = KErrNone;
+ CDirectPrintRsImageParser *imageParser = CDirectPrintRsImageParser::NewLC();
+
+ for( TInt nCnt=0; nCnt < aImageList.Count(); ++nCnt )
+ {
+ LOG1("CDirectPrintBody::ValidateImagesL nCnt: %d", nCnt);
+ LOG1("CDirectPrintBody::ValidateImagesL image: %S", aImageList[nCnt]);
+ TBool valid;
+ imageParser->ValidateL(*(aImageList[nCnt]), valid, lastError);
+ LOG1("CDirectPrintBody::ValidateImagesL valid: %d", valid);
+ LOG1("CDirectPrintBody::ValidateImagesL lastError: %d", lastError);
+ if( !valid )
+ {
+ ++aInvalidCount;
+ }
+ }
+
+ CleanupStack::PopAndDestroy(imageParser);
+ LOG1("CDirectPrintBody::ValidateImagesL aInvalidCount: %d", aInvalidCount);
+ LOG1("CDirectPrintBody::ValidateImagesL ends with: %d", lastError);
+ return lastError;
+ }
+
+void CDirectPrintBody::TryNextDiscovery()
+ {
+ LOG("CDirectPrintBody::TryNextDiscovery begin");
+ iIdleDiscovery->Cancel();
+ iIdleDiscovery->Start(TCallBack(TryNextDiscoveryL, this));
+ LOG("CDirectPrintBody::TryNextDiscovery end");
+ }
+
+void CDirectPrintBody::DoTryNextDiscoveryL()
+ {
+ LOG("CDirectPrintBody::DoTryNextDiscoveryL begin");
+ TUint doDiscovery = iProtocolsRequested & iClassLoader->SupportedProtocols();
+ LOG1("CDirectPrintBody::DoTryNextDiscoveryL doDiscovery: %d", doDiscovery);
+ if( doDiscovery )
+ {
+ TBool found( EFalse );
+ TInt protId( 0 );
+ TInt count = iClassLoader->GetNumberOfProtocolsAvailable();
+ LOG1("CDirectPrintBody::DoTryNextDiscoveryL count: %d", count);
+ for( TInt i = 0; i < count && !found; i++ )
+ {
+ iCurrentProtocol = iClassLoader->GetNextProtocol();
+ protId = iCurrentProtocol->SupportedProtocols();
+ if( iProtocolsRequested & protId ) found = ETrue;
+ }
+ LOG1("CDirectPrintBody::DoTryNextDiscoveryL found: %d", found);
+ LOG1("CDirectPrintBody::DoTryNextDiscoveryL protId: %d", protId);
+ if( found )
+ {
+ TUint temp = KMaxTUint ^ protId;
+ iProtocolsRequested &= temp;
+ LOG1("CDirectPrintBody::DoTryNextDiscoveryL iProtocolsRequested: %d", iProtocolsRequested);
+ ActiveScheduler().SetCurrentProtocol( protId );
+ iCurrentProtocol->StartDiscoveryL( *this, protId );
+ }
+ }
+ else
+ {
+ iPrinterDiscoveryObserver->DiscoveryStatusL( EDiscoveryFinished, 0, 0 );
+ }
+ LOG("CDirectPrintBody::DoTryNextDiscoveryL end");
+ }
+
+TInt CDirectPrintBody::TryNextDiscoveryL(TAny* aObj)
+ {
+ LOG("CDirectPrintBody::TryNextDiscoveryL begin");
+ CDirectPrintBody* obj = static_cast<CDirectPrintBody*>(aObj);
+ obj->DoTryNextDiscoveryL();
+ LOG("CDirectPrintBody::TryNextDiscoveryL end");
+ return EFalse;
+ }
+
+void CDirectPrintBody::SetNumsOfCopiesL( const RArray<TInt>& aNumsOfCopies, TInt& aErr )
+ {
+ LOG1("CDirectPrintBody::SetNumberOfCopiesL aNumsOfCopies.Count(): %d", aNumsOfCopies.Count());
+
+ if( iCurrentPrintJobProtocol )
+ {
+ iCurrentPrintJobProtocol->SetNumsOfCopiesL( aNumsOfCopies, aErr );
+ LOG1("CDirectPrintBody::SetNumberOfCopiesL aErr: %d", aErr);
+ }
+
+ LOG("CDirectPrintBody::SetNumberOfCopiesL end");
+ }
+
+void CDirectPrintBody::HandleSessionDisconnect( const MIdleObserver* aIdleObserver,
+ const MPrinterDiscoveryObserver* aDiscoveryObserver,
+ const MPrintEventObserver* aEventObserver )
+ {
+ LOG1("CDirectPrintBody::HandleSessionDisconnect aIdleObserver address: %d", aIdleObserver);
+ LOG1("CDirectPrintBody::HandleSessionDisconnect iPrinterIdleObserver address: %d", iPrinterIdleObserver);
+ LOG1("CDirectPrintBody::HandleSessionDisconnect aDiscoveryObserver address: %d", aDiscoveryObserver);
+ LOG1("CDirectPrintBody::HandleSessionDisconnect iPrinterDiscoveryObserver address: %d", iPrinterDiscoveryObserver);
+ LOG1("CDirectPrintBody::HandleSessionDisconnect aEventObserver address: %d", aEventObserver);
+ LOG1("CDirectPrintBody::HandleSessionDisconnect iPrinterPrintEventObserver address: %d", iPrinterPrintEventObserver);
+ if( aIdleObserver == iPrinterIdleObserver ) iPrinterIdleObserver = NULL;
+ if( aEventObserver == iPrinterPrintEventObserver ) iPrinterPrintEventObserver = NULL;
+ if( aDiscoveryObserver == iPrinterDiscoveryObserver ) iPrinterDiscoveryObserver = NULL;
+ LOG("CDirectPrintBody::HandleSessionDisconnect end");
+ }
+
+TInt CDirectPrintBody::ProtocolCount()
+ {
+ return iClassLoader->GetNumberOfProtocolsAvailable();
+ }
+
+TInt CDirectPrintBody::GetProtocolNameL( TDpMessage& aMessage )
+ {
+ TDirectPrintSelectItem item;
+ TInt index = aMessage.Int0();
+ TInt err = iClassLoader->GetProtocolName(index, item.iName, item.iId);
+
+ if (err == KErrNone)
+ {
+ TPtr8 ptr(reinterpret_cast<TUint8*>(&item), sizeof(item), sizeof(item));
+ aMessage.WriteL( 1, ptr );
+ }
+
+ return err;
+ }
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintServer/src/directprintmessage.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,143 @@
+/*
+* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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 <e32cmn.h>
+
+#include "directprintmessage.h"
+#include "clog.h"
+
+TDpMessage::TDpMessage( const RMessage2& aMessage,
+ const TBool& aConnected ) :
+ iConnected( aConnected ),
+ iDisposable( EFalse )
+
+ {
+ iMessage = aMessage;
+ }
+
+void TDpMessage::WriteL(TInt aParam, const TDesC8 &aDes, TInt aOffset) const
+ {
+ LOG("TDpMessage::WriteL begin");
+ LOG1("TDpMessage::WriteL iConnected: %d", iConnected);
+ if( !iMessage.IsNull() && iConnected )
+ {
+ LOG1("TDpMessage::WriteL iMessage.Function(): %d", iMessage.Function());
+ iMessage.WriteL( aParam, aDes, aOffset );
+ }
+ LOG("TDpMessage::WriteL end");
+ }
+
+void TDpMessage::Complete(TInt aReason) const
+ {
+ LOG("TDpMessage::Complete begin");
+ LOG1("TDpMessage::Complete iConnected: %d", iConnected);
+ if( !iMessage.IsNull() && iConnected )
+ {
+ LOG1("TDpMessage::Complete iMessage.Function(): %d", iMessage.Function());
+ iMessage.Complete( aReason );
+ }
+ LOG("TDpMessage::Complete end");
+ }
+
+TInt TDpMessage::Int0() const
+ {
+ LOG("TDpMessage::Int0 begin");
+ LOG1("TDpMessage::Int0 iConnected: %d", iConnected);
+ TInt value( 0 );
+ if( !iMessage.IsNull() && iConnected )
+ {
+ LOG1("TDpMessage::Int0 iMessage.Function(): %d", iMessage.Function());
+ value = iMessage.Int0();
+ }
+ LOG("TDpMessage::Int0 end");
+ return value;
+ }
+
+TInt TDpMessage::Int1() const
+ {
+ LOG("TDpMessage::Int1 begin");
+ LOG1("TDpMessage::Int1 iConnected: %d", iConnected);
+ TInt value( 0 );
+ if( !iMessage.IsNull() && iConnected )
+ {
+ LOG1("TDpMessage::Int1 iMessage.Function(): %d", iMessage.Function());
+ value = iMessage.Int1();
+ }
+ LOG("TDpMessage::Int1 end");
+ return value;
+ }
+
+TInt TDpMessage::GetDesLength(TInt aParam) const
+ {
+ LOG("TDpMessage::GetDesLength begin");
+ LOG1("TDpMessage::GetDesLength iConnected: %d", iConnected);
+ TInt value( 0 );
+ if( !iMessage.IsNull() && iConnected )
+ {
+ LOG1("TDpMessage::GetDesLength iMessage.Function(): %d", iMessage.Function());
+ value = iMessage.GetDesLength( aParam );
+ }
+ LOG("TDpMessage::GetDesLength end");
+ return value;
+ }
+
+void TDpMessage::ReadL(TInt aParam, TDes8 &aDes, TInt aOffset) const
+ {
+ LOG("TDpMessage::ReadL TDes8 begin");
+ LOG1("TDpMessage::ReadL TDes8 iConnected: %d", iConnected);
+ if( !iMessage.IsNull() && iConnected )
+ {
+ LOG1("TDpMessage::ReadL TDes8 iMessage.Function(): %d", iMessage.Function());
+ iMessage.ReadL( aParam, aDes, aOffset );
+ }
+ LOG("TDpMessage::ReadL TDes8 end");
+ }
+
+void TDpMessage::ReadL(TInt aParam, TDes16 &aDes, TInt aOffset) const
+ {
+ LOG("TDpMessage::ReadL TDes16 begin");
+ LOG1("TDpMessage::ReadL TDes16 iConnected: %d", iConnected);
+ if( !iMessage.IsNull() && iConnected )
+ {
+ LOG1("TDpMessage::ReadL TDes16 iMessage.Function(): %d", iMessage.Function());
+ iMessage.ReadL( aParam, aDes, aOffset );
+ }
+ LOG("TDpMessage::ReadL TDes16 end");
+ }
+
+TInt TDpMessage::Function() const
+ {
+ return iMessage.Function();
+ }
+
+void TDpMessage::SetDisposable( TBool aDisposable )
+ {
+ iDisposable = aDisposable;
+ }
+
+TBool TDpMessage::Disposable() const
+ {
+ return iDisposable;
+ }
+
+void TDpMessage::Panic(const TDesC &aCategory, TInt aReason) const
+ {
+ iMessage.Panic( aCategory, aReason );
+ }
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintServer/src/directprintnumofcopies.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "directprintnumofcopies.h"
+#include "clog.h"
+
+CDirectPrintNumOfCopies* CDirectPrintNumOfCopies::NewL()
+ {
+ CDirectPrintNumOfCopies* obj = new (ELeave) CDirectPrintNumOfCopies();
+ CleanupStack::PushL( obj ) ;
+ obj->ConstructL();
+ CleanupStack::Pop(); // obj
+ return obj;
+ }
+
+CDirectPrintNumOfCopies::~CDirectPrintNumOfCopies()
+ {
+ LOG("CDirectPrintNumOfCopies::~CDirectPrintNumOfCopies begin");
+ iNumsOfCopies.Close();
+ LOG("CDirectPrintNumOfCopies::~CDirectPrintNumOfCopies end");
+ }
+
+CDirectPrintNumOfCopies::CDirectPrintNumOfCopies() : iCount( 0 )
+ {
+ }
+
+void CDirectPrintNumOfCopies::ConstructL()
+ {
+ }
+
+void CDirectPrintNumOfCopies::Reset( TInt aCount )
+ {
+ LOG("CDirectPrintNumOfCopies::Reset begin");
+ iCount = aCount;
+ iNumsOfCopies.Reset();
+ LOG("CDirectPrintNumOfCopies::Reset end");
+ }
+
+void CDirectPrintNumOfCopies::AddNumOfCopyL( TInt aNumOfCopies, TBool& aFull )
+ {
+ LOG1("CDirectPrintNumOfCopies::AddNumOfCopyL aNumOfCopies: %d", aNumOfCopies);
+ iNumsOfCopies.AppendL( aNumOfCopies );
+ aFull = ( iNumsOfCopies.Count() == iCount ) ? ETrue : EFalse;
+ LOG1("CDirectPrintNumOfCopies::AddNumOfCopyL end with aFull: %d", aFull);
+ }
+
+const RArray<TInt>& CDirectPrintNumOfCopies::NumsOfCopies() const
+ {
+ return iNumsOfCopies;
+ }
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintServer/src/directprintprotocolinfo.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "directprintprotocolinfo.h"
+
+CDirectPrintProtocolInfo::CDirectPrintProtocolInfo()
+ {
+ }
+
+CDirectPrintProtocolInfo::~CDirectPrintProtocolInfo()
+ {
+ delete iDisplayName;
+ }
+
+CDirectPrintProtocolInfo* CDirectPrintProtocolInfo::NewLC(const CImplementationInformation& aImplInfo)
+ {
+ CDirectPrintProtocolInfo* self = new (ELeave) CDirectPrintProtocolInfo();
+ CleanupStack::PushL(self);
+
+ self->iImplementationUid = aImplInfo.ImplementationUid();
+
+ if(aImplInfo.DisplayName().Length() != 0)
+ {
+ self->iDisplayName = aImplInfo.DisplayName().AllocL();
+ }
+
+ return self;
+ }
+
+TUid CDirectPrintProtocolInfo::ImplementationUid() const
+ {
+ return iImplementationUid;
+ }
+
+const TDesC& CDirectPrintProtocolInfo::DisplayName() const
+ {
+ if(iDisplayName == NULL)
+ return KNullDesC();
+ else
+ return *iDisplayName;
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintServer/src/directprintprotocolsloader.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,241 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description: Contains the CDirectPrintProtocolsLoader class definition.
+*
+*/
+
+
+#include <ecom/ecom.h>
+
+#include "directprintprotocolsloader.h"
+#include "mprotprintingdevice.h"
+#include "clog.h"
+#include "imageprint.h"
+
+namespace
+ {
+ const TUid KDirectPrintEcomUid = { 0x10208A1E };
+ }
+
+CDirectPrintProtocolsLoader* CDirectPrintProtocolsLoader::NewL()
+ {
+ LOG("[CDirectPrintProtocolsLoader::NewL]\t Begin");
+ CDirectPrintProtocolsLoader* self = new (ELeave) CDirectPrintProtocolsLoader();
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop(self);
+ LOG("[CDirectPrintProtocolsLoader::NewL]\t End");
+ return self;
+ }
+
+
+CDirectPrintProtocolsLoader::~CDirectPrintProtocolsLoader()
+ {
+ LOG("[CDirectPrintProtocolsLoader::~CDirectPrintProtocolsLoader]\t Begin");
+ iProtocols.ResetAndDestroy();
+ iProtocolInfos.ResetAndDestroy();
+ LOG("[CDirectPrintProtocolsLoader::~CDirectPrintProtocolsLoader]\t End");
+ }
+
+
+TInt CDirectPrintProtocolsLoader::GetNumberOfProtocolsAvailable() const
+ {
+ LOG("[CDirectPrintProtocolsLoader::GetNumberOfProtocolsAvailable]\t Begin");
+ LOG1("[CDirectPrintProtocolsLoader::GetNumberOfProtocolsAvailable]\t return: %d", iAvailableProtocols);
+ LOG("[CDirectPrintProtocolsLoader::GetNumberOfProtocolsAvailable]\t End");
+ return iAvailableProtocols;
+ }
+
+
+MProtPrintingDevice* CDirectPrintProtocolsLoader::GetNextProtocol()
+ {
+ LOG("[CDirectPrintProtocolsLoader::GetNextProtocol]\t Begin");
+ if (iAvailableProtocols <= 0)
+ return NULL;
+
+ if (iProtIndex == iAvailableProtocols)
+ iProtIndex = 0;
+
+ MProtPrintingDevice* temp = iProtocols[iProtIndex];
+ iProtIndex++;
+ LOG("[CDirectPrintProtocolsLoader::GetNextProtocol]\t End");
+ return temp;
+ }
+
+
+MProtPrintingDevice* CDirectPrintProtocolsLoader::GetProtocolAt(TInt aIndex)
+ {
+ LOG("[CDirectPrintProtocolsLoader::GetProtocolAt]\t Begin");
+ if( iAvailableProtocols <= 0 ) return NULL;
+
+ MProtPrintingDevice* temp = NULL;
+
+ if (aIndex < 0)
+ temp = (MProtPrintingDevice*) iProtocols[0];
+ else
+ if (aIndex >= iAvailableProtocols)
+ temp = (MProtPrintingDevice*) iProtocols[iAvailableProtocols - 1];
+ else
+ temp = (MProtPrintingDevice*) iProtocols[aIndex];
+
+ LOG("[CDirectPrintProtocolsLoader::GetProtocolAt]\t End");
+ return temp;
+
+ }
+
+
+void CDirectPrintProtocolsLoader::Reset()
+ {
+ LOG("[CDirectPrintProtocolsLoader::Reset]\t Begin");
+ iProtIndex = 0;
+ LOG("[CDirectPrintProtocolsLoader::Reset]\t End");
+ }
+
+
+TInt CDirectPrintProtocolsLoader::GetProtocolIndex() const
+ {
+ LOG("[CDirectPrintProtocolsLoader::GetProtocolIndex]\t Begin");
+
+ TInt retVal = iProtIndex - 1;
+ // The next check is probably unnecessary since GetNextProtocol() should only leave iProtIndex with
+ // a value between 1 and iAvailableProtocols
+ if (retVal < 0)
+ {
+ retVal = iProtocols.Count() - 1;
+ }
+ LOG1("[CDirectPrintProtocolsLoader::GetProtocolIndex] return: %d", retVal);
+ LOG("[CDirectPrintProtocolsLoader::GetProtocolIndex]\t End");
+ return retVal;
+ }
+
+
+TUint CDirectPrintProtocolsLoader::SupportedProtocols() const
+ {
+ LOG("[CDirectPrintProtocolsLoader::SupportedProtocols]\t Begin");
+ LOG1("[CDirectPrintProtocolsLoader::SupportedProtocols] return: %d", iSupportedProtocols);
+ LOG("[CDirectPrintProtocolsLoader::SupportedProtocols]\t End");
+ return iSupportedProtocols;
+ }
+
+
+TInt CDirectPrintProtocolsLoader::GetProtocolName(TInt aIndex, TDes& aName, TInt& aUid)
+ {
+ TInt retVal = KErrNone;
+
+ if( iAvailableProtocols <= 0 )
+ {
+ retVal = KErrNotFound;
+ }
+ else
+ {
+ CDirectPrintProtocolInfo* info = NULL;
+
+ if (aIndex < 0)
+ {
+ info = iProtocolInfos[0];
+ }
+ else
+ {
+ if (aIndex >= iAvailableProtocols)
+ {
+ info = iProtocolInfos[iAvailableProtocols - 1];
+ }
+ else
+ {
+ info = iProtocolInfos[aIndex];
+ }
+ }
+
+ if (info)
+ {
+ aName.Copy(info->DisplayName());
+ aUid = info->ImplementationUid().iUid;
+ }
+ }
+
+ return retVal;
+ }
+
+
+CDirectPrintProtocolsLoader::CDirectPrintProtocolsLoader()
+ {
+ LOG("[CDirectPrintProtocolsLoader::CDirectPrintProtocolsLoader]\t Begin");
+ iAvailableProtocols = 0;
+ iProtIndex = 0;
+ iSupportedProtocols = 0;
+ LOG("[CDirectPrintProtocolsLoader::CDirectPrintProtocolsLoader]\t End");
+ }
+
+void CDirectPrintProtocolsLoader::ConstructL()
+ {
+ LOG("[CDirectPrintProtocolsLoader::ConstructL]\t Begin");
+ LoadL();
+ LOG("[CDirectPrintProtocolsLoader::ConstructL]\t End");
+ }
+
+void CDirectPrintProtocolsLoader::LoadL()
+ {
+ LOG("[CDirectPrintProtocolsLoader::LoadL]\t Begin");
+ RImplInfoPtrArray infoArray;
+ REComSession::ListImplementationsL( KDirectPrintEcomUid, infoArray );
+ CleanupClosePushL( infoArray );
+ MProtPrintingDevice* device = NULL;
+ LOG1("CDirectPrintProtocolsLoader::LoadL infoArray.Count(): %d", infoArray.Count());
+ for( TInt i = 0; i < infoArray.Count(); i++ )
+ {
+ LOG1("CDirectPrintProtocolsLoader::LoadL i: %d", i);
+ CImplementationInformation* info = infoArray[i];
+ if (info->Version() == 2)
+ {
+ CDirectPrintProtocolInfo* protocolInfo = CDirectPrintProtocolInfo::NewLC(*info);
+ iProtocolInfos.AppendL( protocolInfo );
+ CleanupStack::Pop( protocolInfo );
+
+ TPtrC8 dataType = info->DataType();
+ TEComResolverParams resolverParams;
+ resolverParams.SetDataType( dataType );
+ resolverParams.SetWildcardMatch( ETrue );
+ TAny* prot = REComSession::CreateImplementationL( KDirectPrintEcomUid,
+ _FOFF( MProtPrintingDevice, iDtor_ID_Key ), NULL, resolverParams );
+ device = reinterpret_cast<MProtPrintingDevice*>(prot);
+ //device->ConstructL( KNullDesC );
+ //device = reinterpret_cast<MProtPrintingDevice*>(prot);
+
+ TCleanupItem clItem( CleanupProt, device );
+ CleanupStack::PushL( clItem );
+ device->ConstructL( KNullDesC );
+ LOG1("CDirectPrintProtocolsLoader::LoadL device->SupportedProtocols(): %d", device->SupportedProtocols());
+ iProtocols.AppendL( device );
+ iSupportedProtocols |= device->SupportedProtocols();
+ CleanupStack::Pop(); // device
+ device = NULL;
+ }
+ }
+
+ infoArray.ResetAndDestroy();
+ CleanupStack::PopAndDestroy(); // infoArray
+
+ iAvailableProtocols = iProtocols.Count();
+ LOG("[CDirectPrintProtocolsLoader::LoadL]\t End");
+ }
+
+void CDirectPrintProtocolsLoader::CleanupProt( TAny* aData )
+ {
+ LOG("[CDirectPrintProtocolsLoader::CleanupProt]\t Begin");
+ MProtPrintingDevice* prot = (MProtPrintingDevice*)aData;
+ delete prot;
+ LOG("[CDirectPrintProtocolsLoader::CleanupProt]\t End");
+ }
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintServer/src/directprintrsimageparser.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,163 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description: Contains the CDirectPrintRsImageParser class definition.
+*
+*/
+
+
+// DirectPrintRsImageParser.cpp: implementation of the CDirectPrintRsImageParser class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "directprintrsimageparser.h"
+#include "clog.h"
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CDirectPrintRsImageParser* CDirectPrintRsImageParser::NewLC()
+ {
+ CDirectPrintRsImageParser* self = new (ELeave) CDirectPrintRsImageParser();
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ return self;
+ }
+
+
+void CDirectPrintRsImageParser::ConstructL()
+ {
+ User::LeaveIfError(iFs.Connect());
+ }
+
+
+CDirectPrintRsImageParser::~CDirectPrintRsImageParser()
+ {
+ iFs.Close();
+ }
+
+CDirectPrintRsImageParser::CDirectPrintRsImageParser()
+ {
+ }
+
+void CDirectPrintRsImageParser::ValidateL( const TDesC& aFileName, TBool& aValid, TInt& aErr )
+ {
+ LOG1("CDirectPrintRsImageParser::ValidateL aFileName: %S", &aFileName);
+ aValid = EFalse;
+ TInt dataPos( 0 );
+ TBuf8<9> imgData;
+ TBool bAllDone( EFalse );
+ TInt height( 0 );
+ TInt width( 0 );
+ TInt startOfDataOffset( 0 );
+ TInt encoding( EUnknown );
+ TInt size( 0 );
+
+ RFile file;
+ aErr = file.Open( iFs, aFileName, EFileRead | EFileShareReadersOnly );
+ LOG1("CDirectPrintRsImageParser::ValidateL file.Open (shareread mode): %d", aErr);
+ if ( aErr != KErrNone )
+ {
+ aErr = file.Open( iFs, aFileName, EFileRead | EFileShareAny );
+ LOG1("CDirectPrintRsImageParser::ValidateL file.Open (shareany mode): %d", aErr);
+ }
+
+ // magic numbers used here are JPEG format related
+ else // if ( aErr == KErrNone ) // 1 IF
+ {
+ CleanupClosePushL( file );
+ aErr = file.Size( size );
+ if( size && aErr == KErrNone ) // 2 IF
+ {
+ aErr = ReadData( file, dataPos, imgData );
+ if( aErr == KErrNone && imgData.Length() == 9 ) // 3 IF
+ {
+ // First check for the JPEG header "FF D8"
+ if( imgData[0] == 0xff && imgData[1] == 0xd8 ) // 4 IF
+ {
+ // Start skipping headers until we find the one we're looking for
+ dataPos = (imgData[4] << 8) + imgData[5] + 4;
+
+ aErr = ReadData( file, dataPos, imgData );
+
+ while( aErr == KErrNone && imgData.Length() == 9 && imgData[0] == 0xff )
+ {
+ switch( imgData[1] )
+ {
+ case 0xda:
+ // Start of data
+ startOfDataOffset = dataPos + ((imgData[2] << 8) + imgData[3] + 2);
+ bAllDone = ETrue;
+ break;
+
+ case EDiffArithLossless:
+ encoding = imgData[1];
+ height = (imgData[5] << 8) + imgData[6];
+ width = (imgData[7] << 8) + imgData[8];
+ break;
+
+ default:
+ break;
+ } // SWITCH
+
+ if( bAllDone )
+ {
+ break;
+ }
+ else
+ {
+ dataPos += (imgData[2] << 8) + imgData[3] + 2;
+ aErr = ReadData( file, dataPos, imgData );
+ }
+ } // WHILE
+ } // 4 IF
+ else
+ {
+ // Not a JPG
+ aErr = KErrCorrupt;
+ }
+ } // 3 IF
+ } // 2 IF
+
+ CleanupStack::PopAndDestroy( &file );
+ } // 1 IF
+
+ aValid = Validate( startOfDataOffset, width, height, size, encoding, aErr );
+
+ LOG1("CDirectPrintRsImageParser::ValidateL aValid: %d", aValid);
+ LOG1("CDirectPrintRsImageParser::ValidateL aErr: %d", aErr);
+ LOG("CDirectPrintRsImageParser::ValidateL end");
+ }
+
+TBool CDirectPrintRsImageParser::Validate( TInt aStartOfDataOffset, TInt aWidth, TInt aHeight, TInt aSize, TInt aEncoding, TInt aErr )
+ {
+ if ( aStartOfDataOffset && aWidth && aHeight && aSize && aEncoding && !aErr )
+ {
+ return ETrue;
+ }
+ else
+ {
+ return EFalse;
+ }
+ }
+
+TInt CDirectPrintRsImageParser::ReadData( RFile& aFile, TInt aStartByte, TDes8& aData )
+ {
+ LOG("CDirectPrintRsImageParser::ReadData begin");
+ TInt err = aFile.Read( aStartByte, aData );
+ LOG1("CDirectPrintRsImageParser::ReadData return: %d", err);
+ return err;
+ }
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintServer/src/directprintscheduler.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "directprintscheduler.h"
+#include "mprotprintingdevice.h"
+#include "tidleevent.h"
+#include "printmessagecodes.h"
+#include "clog.h"
+
+void CDirectPrintScheduler::Error(TInt aError) const
+ {
+ LOG1("CDirectPrintScheduler::Error aError: %d", aError);
+ if( iIdleObserver )
+ {
+ TEvent event;
+ event.iProtocol = iCurrentProtocol;
+ event.iSeverity = ESevere;
+ event.iEventType = EAsynchronousLeave;
+ LOG("CDirectPrintScheduler::Error informing observer");
+ iIdleObserver->StatusEvent( event, aError, ENoMessage );
+ }
+ LOG("CDirectPrintScheduler::Error end");
+ }
+
+void CDirectPrintScheduler::SetIdleObserver( MProtIdleObserver& aIdleObserver )
+ {
+ LOG("CDirectPrintScheduler::SetIdleObserver begin");
+ iIdleObserver = &aIdleObserver;
+ LOG("CDirectPrintScheduler::SetIdleObserver end");
+ }
+
+void CDirectPrintScheduler::SetCurrentProtocol( TInt aProtocol )
+ {
+ LOG1("CDirectPrintScheduler::SetCurrentProtocol aProtocol: %d", aProtocol);
+ iCurrentProtocol = aProtocol;
+ LOG("CDirectPrintScheduler::SetCurrentProtocol end");
+ }
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintServer/src/directprintserver.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,166 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "directprintserver.h"
+#include "directprintclientserver.h"
+#include "directprintsession.h"
+#include "clog.h"
+#include "directprintbody.h"
+
+namespace
+ {
+ // panic
+ _LIT( KDirectPrintServerPanic, "CIPSer" );
+ enum TDirectPrintServerPanic
+ {
+ EBadDescriptor
+ };
+
+ void PanicClient( const RMessage2& aMessage, TDirectPrintServerPanic aCategory )
+ {
+ aMessage.Panic( KDirectPrintServerPanic, aCategory );
+ }
+ }
+
+
+CDirectPrintServer* CDirectPrintServer::NewLC()
+ {
+ CDirectPrintServer* server = new (ELeave) CDirectPrintServer();
+ CleanupStack::PushL( server ) ;
+ server->ConstructL();
+ return server;
+ }
+
+
+CDirectPrintServer::CDirectPrintServer()
+ : CPolicyServer( 0, KDirectPrintPolicy, ESharableSessions )
+ {
+ }
+
+CDirectPrintServer::~CDirectPrintServer()
+ {
+ LOG("CDirectPrintServer::~CDirectPrintServer begin");
+ delete iEngine;
+ iFbs.Disconnect();
+ LOG("CDirectPrintServer::~CDirectPrintServer end");
+ }
+
+void CDirectPrintServer::ConstructL()
+ {
+ LOG("CDirectPrintServer::ConstructL begin");
+ StartL( KDirectPrintServerName );
+ User::LeaveIfError( iFbs.Connect() );
+ iEngine = CDirectPrintBody::NewL();
+ LOG("CDirectPrintServer::ConstructL end");
+ }
+
+void CDirectPrintServer::AddSession()
+ {
+ LOG("CDirectPrintServer::AddSession begin");
+ ++iConnsCount;
+ LOG("CDirectPrintServer::AddSession end");
+ }
+
+void CDirectPrintServer::RemoveSession()
+ {
+ --iConnsCount;
+ LOG1("CDirectPrintServer::RemoveSession iConnsCount: %d", iConnsCount);
+ if( iConnsCount == 0 )
+ {
+ delete iEngine;
+ iEngine = NULL;
+ iFbs.Disconnect();
+ CActiveScheduler::Stop();
+ }
+ LOG("CDirectPrintServer::RemoveSession end");
+ }
+
+TInt CDirectPrintServer::SessionCount() const
+ {
+ LOG("CDirectPrintServer::SessionCount begin");
+ LOG1("CDirectPrintServer::SessionCount return: %d", iConnsCount);
+ return iConnsCount;
+ }
+
+TInt CDirectPrintServer::RunError( TInt aError )
+ {
+ LOG1("CDirectPrintServer::RunError aError: %d", aError);
+ if( aError == KErrBadDescriptor )
+ {
+ PanicClient( Message(), EBadDescriptor );
+ }
+ else
+ {
+ Message().Complete( aError );
+ }
+ ReStart();
+ LOG("CDirectPrintServer::RunError end");
+ return KErrNone;
+ }
+
+
+CSession2* CDirectPrintServer::NewSessionL( const TVersion& aVersion, const RMessage2& ) const
+ {
+ LOG("CDirectPrintServer::NewSessionL begin");
+ TBool supported = User::QueryVersionSupported( TVersion( KDirectPrintServerMajor,
+ KDirectPrintServerMinor,
+ KDirectPrintServerBuild ),
+ aVersion );
+ if( !supported )
+ {
+ User::Leave( KErrNotSupported );
+ }
+
+ LOG("CDirectPrintServer::NewSessionL end");
+ return new (ELeave) CDirectPrintSession();
+ }
+
+TInt CDirectPrintServer::ReserveEngine( const CSession2* aSession )
+ {
+ LOG("CDirectPrintServer::ReserveEngine begin");
+ TInt err( KErrInUse );
+ if( iEngineHolder == aSession || !iEngineHolder )
+ {
+ iEngineHolder = aSession;
+ err = KErrNone;
+ }
+ LOG1("CDirectPrintServer::ReserveEngine return: %d", err);
+ return err;
+ }
+
+TInt CDirectPrintServer::ReleaseEngine( const CSession2* aSession )
+ {
+ LOG("CDirectPrintServer::ReleaseEngine begin");
+ TInt err( KErrInUse );
+ if( iEngineHolder == aSession || !iEngineHolder )
+ {
+ iEngineHolder = NULL;
+ err = KErrNone;
+ }
+ LOG1("CDirectPrintServer::ReleaseEngine return: %d", err);
+ return err;
+ }
+
+CDirectPrintBody& CDirectPrintServer::Engine() const
+ {
+ LOG("CDirectPrintServer::Engine begin");
+ LOG("CDirectPrintServer::Engine end");
+ return *iEngine;
+ }
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintServer/src/directprintserverjobguard.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,237 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#include "directprintserverjobguard.h"
+#include "directprintbody.h"
+#include "clog.h"
+#include "directprintmessage.h"
+
+CDirectPrintServerJobGuard* CDirectPrintServerJobGuard::NewL( CDirectPrintBody& aEngine )
+ {
+ CDirectPrintServerJobGuard* self = new ( ELeave ) CDirectPrintServerJobGuard( aEngine );
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ CleanupStack::Pop(); // self
+ return self;
+ }
+
+CDirectPrintServerJobGuard::CDirectPrintServerJobGuard( CDirectPrintBody& aEngine )
+ : iEngine( aEngine )
+ , iRequestActive( EFalse )
+ {
+ }
+
+CDirectPrintServerJobGuard::~CDirectPrintServerJobGuard()
+ {
+ LOG("CDirectPrintServerJobGuard::~CDirectPrintServerJobGuard begin");
+ iImages.ResetAndDestroy();
+ iImages.Close();
+ iBuffer.Close();
+ LOG("CDirectPrintServerJobGuard::~CDirectPrintServerJobGuard end");
+ }
+
+void CDirectPrintServerJobGuard::ConstructL()
+ {
+ }
+
+void CDirectPrintServerJobGuard::PrepareL( TDpMessage& aMessage )
+ {
+ LOG("CDirectPrintServerJobGuard::PrepareL begin");
+ TInt len = aMessage.GetDesLength( 0 );
+ HBufC* buf = HBufC::NewLC( len );
+ TPtr ptr( buf->Des() );
+ aMessage.ReadL( 0, ptr );
+ iImages.AppendL( buf );
+ CleanupStack::Pop(); // buf
+ LOG("CDirectPrintServerJobGuard::PrepareL end");
+ }
+
+void CDirectPrintServerJobGuard::Stop()
+ {
+ LOG("CDirectPrintServerJobGuard::Stop begin");
+ iImages.ResetAndDestroy();
+ if( iRequestActive )
+ {
+ LOG("CDirectPrintServerJobGuard::Stop cancelling...");
+ iMessage->Complete( KErrCancel );
+ iRequestActive = EFalse;
+ }
+ LOG("CDirectPrintServerJobGuard::Stop end");
+ }
+
+TInt CDirectPrintServerJobGuard::CreateL( TDpMessage& aMessage )
+ {
+ LOG("CDirectPrintServerJobGuard::CreateL begin");
+ iRequestActive = EFalse;
+ iBuffer.Reset();
+ TInt printer = aMessage.Int0();
+ TInt err = iEngine.CreatePrintJobL( printer, iImages, *this );
+ LOG1("CDirectPrintServerJobGuard::CreateL err: %d", err);
+ if( err )
+ {
+ iImages.ResetAndDestroy();
+ }
+ LOG1("CDirectPrintServerJobGuard::CreateL return: %d", err);
+ return err;
+ }
+
+void CDirectPrintServerJobGuard::ContinueCreateL( TDpMessage& aMessage )
+ {
+ LOG("CDirectPrintServerJobGuard::ContinueCreateL begin");
+ if( iMessage ) iMessage->SetDisposable( ETrue );
+ iMessage = &aMessage;
+ iRequestActive = ETrue;
+ if( iBuffer.Count() )
+ {
+ LOG("CDirectPrintServerJobGuard::ContinueCreateL before ProcessL");
+ Process();
+ LOG("CDirectPrintServerJobGuard::ContinueCreateL after ProcessL");
+ }
+ LOG("CDirectPrintServerJobGuard::ContinueCreateL end");
+ }
+
+void CDirectPrintServerJobGuard::PrintJobProgressEvent(TInt aStatus, TInt aPercentCompletion, TInt aJobStateCode)
+ {
+ LOG("CDirectPrintServerJobGuard::PrintJobProgressEvent begin");
+ LOG1("CDirectPrintServerJobGuard::PrintJobProgressEvent aStatus: %d", aStatus);
+ LOG1("CDirectPrintServerJobGuard::PrintJobProgressEvent aPercentCompletion: %d", aPercentCompletion);
+ LOG1("CDirectPrintServerJobGuard::PrintJobProgressEvent aJobStateCode: %d", aJobStateCode);
+ TDirectPrintJobGuardData data;
+ data.iCb = TDirectPrintJobGuardData::EProgressEventCb;
+ data.iStatus = aStatus;
+ data.iPercentCompletion = aPercentCompletion;
+ data.iJobStateCode = aJobStateCode;
+ TRAPD( err, DoPreProcessL( data ) );
+ LOG1("CDirectPrintServerJobGuard::PrintJobProgressEvent DoPreProcessL's TRAP err: %d", err);
+ Process( err );
+ LOG("CDirectPrintServerJobGuard::PrintJobProgressEvent end");
+ }
+
+void CDirectPrintServerJobGuard::PrintJobErrorEvent(TInt aError, TInt aErrorStringCode)
+ {
+ LOG("CDirectPrintServerJobGuard::PrintJobErrorEvent begin");
+ LOG1("CDirectPrintServerJobGuard::PrintJobErrorEvent aError: %d", aError);
+ LOG1("CDirectPrintServerJobGuard::PrintJobErrorEvent aErrorStringCode: %d", aErrorStringCode);
+ TDirectPrintJobGuardData data;
+ data.iCb = TDirectPrintJobGuardData::EErrorEventCb;
+ data.iError = aError;
+ data.iErrorStringCode = aErrorStringCode;
+ TRAPD( err, DoPreProcessL( data ) );
+ LOG1("CDirectPrintServerJobGuard::PrintJobErrorEvent DoPreProcessL's TRAP err: %d", err);
+ Process( err );
+ LOG("CDirectPrintServerJobGuard::PrintJobErrorEvent end");
+ }
+
+void CDirectPrintServerJobGuard::PrinterStatusEvent(TInt aError, TInt aErrorStringCode)
+ {
+ LOG("CDirectPrintServerJobGuard::PrinterStatusEvent begin");
+ LOG1("CDirectPrintServerJobGuard::PrinterStatusEvent aError: %d", aError);
+ LOG1("CDirectPrintServerJobGuard::PrinterStatusEvent aErrorStringCode: %d", aErrorStringCode);
+ TDirectPrintJobGuardData data;
+ data.iCb = TDirectPrintJobGuardData::EStatusEventCb;
+ data.iError = aError;
+ data.iErrorStringCode = aErrorStringCode;
+ TRAPD( err, DoPreProcessL( data ) );
+ LOG1("CDirectPrintServerJobGuard::PrinterStatusEvent DoPreProcessL's TRAP err: %d", err);
+ Process( err );
+ LOG("CDirectPrintServerJobGuard::PrinterStatusEvent end");
+ }
+
+void CDirectPrintServerJobGuard::PreviewImageEvent(TInt aFsBitmapHandle)
+ {
+ LOG("CDirectPrintServerJobGuard::PreviewImageEvent begin");
+ LOG1("CDirectPrintServerJobGuard::PreviewImageEvent aFsBitmapHandle: %d", aFsBitmapHandle);
+ TDirectPrintJobGuardData data;
+ data.iCb = TDirectPrintJobGuardData::EImageEventCb;
+ data.iFsBitmapHandle = aFsBitmapHandle;
+ TRAPD( err, DoPreProcessL( data ) );
+ LOG1("CDirectPrintServerJobGuard::PreviewImageEvent DoPreProcessL's TRAP err: %d", err);
+ Process( err );
+ LOG("CDirectPrintServerJobGuard::PreviewImageEvent end");
+ }
+
+void CDirectPrintServerJobGuard::DoPreProcessL( const TDirectPrintJobGuardData& aData )
+ {
+ LOG("CDirectPrintServerJobGuard::DoPreProcessL begin");
+ User::LeaveIfError( iBuffer.Append( aData ) );
+ LOG("CDirectPrintServerJobGuard::DoPreProcessL end");
+ }
+
+void CDirectPrintServerJobGuard::DoProcessL()
+ {
+ LOG("CDirectPrintServerJobGuard::ProcessL begin");
+ if( iBuffer.Count() && iRequestActive )
+ {
+ LOG("CDirectPrintServerJobGuard::DoProcessL step 1");
+ TPtr8 ptr(reinterpret_cast<TUint8*>(&(iBuffer[0])), sizeof(iBuffer[0]), sizeof(iBuffer[0]));
+ LOG("CDirectPrintServerJobGuard::DoProcessL step 2");
+ iMessage->WriteL( 0, ptr );
+ LOG("CDirectPrintServerJobGuard::DoProcessL step 3");
+ iMessage->Complete( KErrNone );
+ LOG("CDirectPrintServerJobGuard::DoProcessL step 4");
+ iRequestActive = EFalse;
+ LOG("CDirectPrintServerJobGuard::DoProcessL step 5");
+ iBuffer.Remove( 0 );
+ LOG("CDirectPrintServerJobGuard::DoProcessL step 6");
+ }
+ LOG("CDirectPrintServerJobGuard::ProcessL end");
+ }
+
+void CDirectPrintServerJobGuard::Process( TInt aErr )
+ {
+ LOG("CDirectPrintServerJobGuard::Process begin");
+ if( aErr )
+ {
+ LOG1("CDirectPrintServerJobGuard::Process aErr: %d", aErr);
+ iMessage->Complete( aErr );
+ iRequestActive = EFalse;
+ }
+ else
+ {
+ LOG("CDirectPrintServerJobGuard::Process calling DoProcessL");
+ TRAPD( err, DoProcessL() );
+ LOG1("CDirectPrintServerJobGuard::Process DoProcessL's TRAP err: %d", err);
+ if( err )
+ {
+ iMessage->Complete( err );
+ iRequestActive = EFalse;
+ }
+ }
+ LOG("CDirectPrintServerJobGuard::Process end");
+ }
+
+
+
+// DEPRECATED
+
+void CDirectPrintServerJobGuard::ShowMessageL( TInt /*aMsgLine1Code*/, TInt /*aMsgLine2Code*/ )
+ {
+ }
+
+TBool CDirectPrintServerJobGuard::AskYesNoQuestionL( TInt /*aMsgLine1Code*/, TInt /*aMsgLine2Code*/ )
+ {
+ return EFalse;
+ }
+
+const TDesC& CDirectPrintServerJobGuard::AskForInputL( TInt /*aMsgLine1Code*/, TInt /*aMsgLine2Code*/ )
+ {
+ return KNullDesC;
+ }
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintServer/src/directprintsession.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,823 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifdef _DIRECTPRINT_USE_USB
+#include <usbman.h>
+#include <usbstates.h>
+#include <usbpersonalityids.h>
+#endif // _DIRECTPRINT_USE_USB
+
+#include "directprintsession.h"
+#include "directprintclientserver.h"
+#include "directprintserver.h"
+#include "clog.h"
+#include "directprintbody.h"
+#include "directprintserverjobguard.h"
+#include "directprintnumofcopies.h"
+
+namespace
+ {
+ // panic
+ _LIT( KDirectPrintSessionPanic, "CIPSes" );
+ enum TDirectPrintSessionPanic
+ {
+ ENotSupported
+ };
+
+ void PanicClient( const TDpMessage& aMessage, TDirectPrintSessionPanic aCategory )
+ {
+ aMessage.Panic( KDirectPrintSessionPanic, aCategory );
+ }
+ }
+
+CDirectPrintSession::~CDirectPrintSession()
+ {
+ LOG("CDirectPrintSession::~CDirectPrintSession begin");
+ delete iNumOfCopies;
+ delete iJobGuard;
+ iCapabilityIDs.Close();
+ iMsgWrappers.ResetAndDestroy();
+ iMsgWrappers.Close();
+ Server().ReleaseEngine( this );
+ Server().RemoveSession();
+ LOG("CDirectPrintSession::~CDirectPrintSession end");
+ }
+
+CDirectPrintServer& CDirectPrintSession::Server()
+ {
+ return *static_cast<CDirectPrintServer*>( const_cast<CServer2*>( CSession2::Server() ) );
+ }
+
+void CDirectPrintSession::CreateL()
+ {
+ LOG("CDirectPrintSession::CreateL begin");
+ Server().AddSession();
+ iJobGuard = CDirectPrintServerJobGuard::NewL( Server().Engine() );
+ iNumOfCopies = CDirectPrintNumOfCopies::NewL();
+ iConnected = ETrue;
+ LOG("CDirectPrintSession::CreateL end");
+ }
+
+void CDirectPrintSession::Disconnect(const RMessage2 &aMessage)
+ {
+ LOG("CDirectPrintSession::Disconnect begin");
+// Server().Engine().HandleSessionDisconnect( iIdleGuard, iDiscoveryGuard, iJobGuard );
+ Server().Engine().HandleSessionDisconnect( NULL, NULL, iJobGuard );
+ iConnected = EFalse;
+ CSession2::Disconnect( aMessage );
+ LOG("CDirectPrintSession::Disconnect end");
+ }
+
+void CDirectPrintSession::ServiceL( const RMessage2& aMessage )
+ {
+ LOG1("CDirectPrintSession::ServiceL aMessage.Function(): %d", aMessage.Function());
+
+ // wrapper array clean begin
+ TInt index = iMsgWrappers.Count();
+ LOG1("CDirectPrintSession::ServiceL index: %d", index);
+ TBool result( EFalse );
+ while( --index >= 0 && !result )
+ {
+ if( ( iMsgWrappers[index] )->Disposable() )
+ {
+ TDpMessage* toDispose = iMsgWrappers[index];
+ iMsgWrappers.Remove( index );
+ delete toDispose;
+ toDispose = NULL;
+ result = ETrue;
+ }
+ }
+ // wrapper array clean end
+
+ TDpMessage* msgWrapper = new (ELeave) TDpMessage( aMessage, iConnected );
+ TInt err = iMsgWrappers.Insert( msgWrapper, 0 );
+ if( err )
+ {
+ delete msgWrapper;
+ User::Leave( err );
+ }
+ else
+ {
+ msgWrapper = NULL;
+ }
+
+ TInt messageIndex = aMessage.Function();
+
+ if ( messageIndex <= EContinuePrintJob )
+ {
+ ServiceFirstPartL( messageIndex );
+ }
+ else if ( messageIndex >= ERemoveCachedPrinter && messageIndex <= EGetPrinterCapHigh )
+ {
+ ServiceSecondPartL( messageIndex );
+ }
+ else if ( messageIndex >= EGetPrinterCapEnumCount && messageIndex <= EGetProtocolName )
+ {
+ ServiceThirdPartL ( messageIndex );
+ }
+ else
+ {
+ PanicClient( *iMsgWrappers[0], ENotSupported );
+ }
+
+ LOG("CDirectPrintSession::ServiceL end");
+ }
+void CDirectPrintSession::ServiceFirstPartL( TInt aIndex )
+ {
+ switch( aIndex )
+ {
+ case ECountConnections:
+ CountConnectionsL( *iMsgWrappers[0] );
+ break;
+
+ case ESetForeground:
+ SetForegroundL( *iMsgWrappers[0] );
+ break;
+
+ case EReserveEngine:
+ ReserveEngine( *iMsgWrappers[0] );
+ break;
+
+ case EReleaseEngine:
+ ReleaseEngine( *iMsgWrappers[0] );
+ break;
+
+ case ESupportedProtocols:
+ SupportedProtocols( *iMsgWrappers[0] );
+ break;
+
+ case EGetNumPrintPages:
+ GetNumPrintPages( *iMsgWrappers[0] );
+ break;
+
+ case EGetJobStatus:
+ GetJobStatus( *iMsgWrappers[0] );
+ break;
+
+ case EGetPrinterStatus:
+ GetPrinterStatus( *iMsgWrappers[0] );
+ break;
+
+ case ECancelDiscovery:
+ CancelDiscovery( *iMsgWrappers[0] );
+ break;
+
+ case ESubmitPrintJob:
+ SubmitPrintJobL( *iMsgWrappers[0] );
+ break;
+
+ case ECancelPrintJob:
+ CancelPrintJob( *iMsgWrappers[0] );
+ break;
+
+ case EContinuePrintJob:
+ ContinuePrintJobL( *iMsgWrappers[0] );
+ break;
+
+ default:
+ LOG1("[CDirectPrintSession::ServiceFirstPartL]\t Method reached to an end with index: %d", aIndex);
+ break;
+ }
+ }
+
+void CDirectPrintSession::ServiceSecondPartL( TInt aIndex )
+ {
+ switch( aIndex )
+ {
+ case ERemoveCachedPrinter:
+ RemoveCachedPrinterL( *iMsgWrappers[0] );
+ break;
+
+ case EGetJobTemplateIcon:
+ GetJobTemplateIconL( *iMsgWrappers[0] );
+ break;
+
+ case EGetNumPreviewPages:
+ GetNumPreviewPages( *iMsgWrappers[0] );
+ break;
+
+ case ESetJobSetting:
+ SetJobSettingL( *iMsgWrappers[0] );
+ break;
+
+ case EGetJobSetting:
+ GetJobSettingL( *iMsgWrappers[0] );
+ break;
+
+ case EGetPrinterCapability:
+ GetPrinterCapabilityL( *iMsgWrappers[0] );
+ break;
+
+ case EGetPrinterCapId:
+ GetPrinterCapIdL( *iMsgWrappers[0] );
+ break;
+
+ case EGetPrinterCapType:
+ GetPrinterCapTypeL( *iMsgWrappers[0] );
+ break;
+
+ case EGetPrinterCapDef:
+ GetPrinterCapDefL( *iMsgWrappers[0] );
+ break;
+
+ case EGetPrinterCapLow:
+ GetPrinterCapLowL( *iMsgWrappers[0] );
+ break;
+
+ case EGetPrinterCapHigh:
+ GetPrinterCapHighL( *iMsgWrappers[0] );
+ break;
+
+ default:
+ LOG1("[CDirectPrintSession::ServiceSecondPartL]\t Method reached to an end with index: %d", aIndex);
+ break;
+ }
+ }
+
+void CDirectPrintSession::ServiceThirdPartL( TInt aIndex )
+ {
+ switch( aIndex )
+ {
+ case EGetPrinterCapEnumCount:
+ GetPrinterCapEnumCountL( *iMsgWrappers[0] );
+ break;
+
+ case EGetPrinterCapEnum:
+ GetPrinterCapEnumL( *iMsgWrappers[0] );
+ break;
+
+ case EGetPrinterCapabilityIDsCount:
+ GetPrinterCapabilityIDsCountL( *iMsgWrappers[0] );
+ break;
+
+ case EGetPrinterCapabilityID:
+ GetPrinterCapabilityIDL( *iMsgWrappers[0] );
+ break;
+
+ case ERegisterIdleObserver:
+ RegisterIdleObserverL( *iMsgWrappers[0] );
+ break;
+
+ case ECancelRegisterIdleObserver:
+ CancelRegisterIdleObserverL( *iMsgWrappers[0] );
+ break;
+
+ case EStartDiscovery:
+ StartDiscoveryL( *iMsgWrappers[0] );
+ break;
+
+ case EContinueDiscovery:
+ ContinueDiscoveryL( *iMsgWrappers[0] );
+ break;
+
+ case EPrepareJob:
+ PrepareJobL( *iMsgWrappers[0] );
+ break;
+
+ case ECreateJob:
+ CreateJobL( *iMsgWrappers[0] );
+ break;
+
+ case EContinueCreateJob:
+ ContinueCreateJobL( *iMsgWrappers[0] );
+ break;
+
+ case ECancelStartDiscovery:
+ CancelStartDiscoveryL( *iMsgWrappers[0] );
+ break;
+
+ case ECancelCreateJob:
+ CancelCreateJobL( *iMsgWrappers[0] );
+ break;
+
+ case EIsPictBridgeMode:
+ IsPictBridgeModeL( *iMsgWrappers[0] );
+ break;
+
+ case ESetNumberOfCopiesCount:
+ SetNumberOfCopiesCountL( *iMsgWrappers[0] );
+ break;
+
+ case ESetNumberOfCopies:
+ SetNumberOfCopiesL( *iMsgWrappers[0] );
+ break;
+
+ case EGetProtocolNamesCount:
+ GetProtocolNamesCountL( *iMsgWrappers[0] );
+ break;
+
+ case EGetProtocolName:
+ GetProtocolNameL( *iMsgWrappers[0] );
+ break;
+
+ default:
+ LOG1("[CDirectPrintSession::ServiceThirdPartL]\t Method reached to an end with index: %d", aIndex);
+ break;
+ }
+ }
+
+
+void CDirectPrintSession::CountConnectionsL( TDpMessage& aMessage )
+ {
+ TInt count = Server().SessionCount();
+ TPckgC<TInt> countDes( count );
+ aMessage.WriteL( 0, countDes );
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( KErrNone );
+ }
+
+void CDirectPrintSession::SetForegroundL( TDpMessage& aMessage )
+ {
+ TInt fg = aMessage.Int0();
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( KErrNone );
+ }
+
+void CDirectPrintSession::ReserveEngine( TDpMessage& aMessage )
+ {
+ TInt err = Server().ReserveEngine( this );
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( err );
+ }
+
+void CDirectPrintSession::ReleaseEngine( TDpMessage& aMessage )
+ {
+ TInt err = Server().ReleaseEngine( this );
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( err );
+ }
+
+void CDirectPrintSession::SupportedProtocols( TDpMessage& aMessage )
+ {
+ TInt err = Server().ReserveEngine( this );
+ aMessage.SetDisposable( ETrue );
+ if( !err )
+ {
+ TInt protocols = Server().Engine().SupportedProtocols();
+ aMessage.Complete( protocols );
+ }
+ else
+ {
+ aMessage.Complete( err );
+ }
+ }
+
+void CDirectPrintSession::GetNumPrintPages( TDpMessage& aMessage )
+{
+ TInt err = Server().ReserveEngine( this );
+ aMessage.SetDisposable( ETrue );
+ if( !err )
+ {
+ TInt pages = Server().Engine().GetNumPrintPages();
+ aMessage.Complete( pages );
+ }
+ else
+ {
+ aMessage.Complete( err );
+ }
+ }
+
+void CDirectPrintSession::GetJobStatus( TDpMessage& aMessage )
+{
+ TInt err = Server().ReserveEngine( this );
+ aMessage.SetDisposable( ETrue );
+ if( !err )
+ {
+ TInt status = Server().Engine().GetJobStatus();
+ aMessage.Complete( status );
+ }
+ else
+ {
+ aMessage.Complete( err );
+ }
+ }
+
+void CDirectPrintSession::GetPrinterStatus( TDpMessage& aMessage )
+{
+ TInt err = Server().ReserveEngine( this );
+ aMessage.SetDisposable( ETrue );
+ if( !err )
+ {
+ TInt id = aMessage.Int0();
+ TInt status = Server().Engine().GetPrinterStatus( id );
+ aMessage.Complete( status );
+ }
+ else
+ {
+ aMessage.Complete( err );
+ }
+ }
+
+void CDirectPrintSession::CancelDiscovery( TDpMessage& aMessage )
+ {
+ TInt err = Server().ReserveEngine( this );
+ if( !err )
+ {
+ Server().Engine().CancelDiscovery();
+ }
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( err );
+ }
+
+void CDirectPrintSession::SubmitPrintJobL( TDpMessage& aMessage )
+ {
+ TInt err = Server().ReserveEngine( this );
+ if( !err )
+ {
+ Server().Engine().SubmitPrintJobL();
+ }
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( err );
+ }
+
+void CDirectPrintSession::CancelPrintJob( TDpMessage& aMessage )
+ {
+ TInt err = Server().ReserveEngine( this );
+ if( !err )
+ {
+ err = Server().Engine().CancelPrintJob();
+ }
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( err );
+ }
+
+void CDirectPrintSession::ContinuePrintJobL( TDpMessage& aMessage )
+ {
+ TInt err = Server().ReserveEngine( this );
+ if( !err )
+ {
+ err = Server().Engine().ContinuePrintJobL();
+ }
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( err );
+ }
+
+void CDirectPrintSession::RemoveCachedPrinterL( TDpMessage& aMessage )
+ {
+ TInt err = Server().ReserveEngine( this );
+ if( !err )
+ {
+ TInt id = aMessage.Int0();
+ err = Server().Engine().RemoveCachedPrinterL( id );
+ }
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( err );
+ }
+
+void CDirectPrintSession::GetJobTemplateIconL( TDpMessage& aMessage )
+ {
+ TInt err = Server().ReserveEngine( this );
+ if( !err )
+ {
+ TInt id = aMessage.Int0();
+ TInt handle;
+ err = Server().Engine().GetJobTemplateIconL( id, handle );
+ TPckgC<TInt> handleDes( handle );
+ aMessage.WriteL( 1, handleDes );
+ }
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( err );
+ }
+
+void CDirectPrintSession::GetNumPreviewPages( TDpMessage& aMessage )
+ {
+ TInt err = Server().ReserveEngine( this );
+ aMessage.SetDisposable( ETrue );
+ if( !err )
+ {
+ TInt num = Server().Engine().GetNumPreviewPages();
+ aMessage.Complete( num );
+ }
+ else
+ {
+ aMessage.Complete( err );
+ }
+ }
+
+void CDirectPrintSession::SetJobSettingL( TDpMessage& aMessage )
+ {
+ TInt err = Server().ReserveEngine( this );
+ if( !err )
+ {
+ TInt capabilityID = aMessage.Int0();
+ TInt value = aMessage.Int1();
+ TInt affectedCapability;
+
+ LOG2("CDirectPrintSession::SetJobSettingL || capabilityID = %d, value = %d", capabilityID, value );
+
+ err = Server().Engine().SetJobSettingL( capabilityID, value, affectedCapability );
+ TPckgC<TInt> affectedCapabilityDes( affectedCapability );
+ aMessage.WriteL( 2, affectedCapabilityDes );
+ }
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( err );
+ }
+
+void CDirectPrintSession::GetJobSettingL( TDpMessage& aMessage )
+ {
+ TInt err = Server().ReserveEngine( this );
+ if( !err )
+ {
+ TInt capabilityID = aMessage.Int0();
+ TInt value;
+ err = Server().Engine().GetJobSetting( capabilityID, value );
+ TPckgC<TInt> valueDes( value );
+ aMessage.WriteL( 1, valueDes );
+ }
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( err );
+ }
+
+void CDirectPrintSession::GetPrinterCapabilityL( TDpMessage& aMessage )
+ {
+ TInt err = Server().ReserveEngine( this );
+ if( !err )
+ {
+ TInt printerID = aMessage.Int0();
+ TInt capabilityID = aMessage.Int1();
+ err = Server().Engine().GetPrinterCapabilityL( printerID, capabilityID, iCapability );
+ }
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( err );
+ }
+
+void CDirectPrintSession::GetPrinterCapIdL( TDpMessage& aMessage )
+ {
+ TInt err = Server().ReserveEngine( this );
+ if( !err )
+ {
+ TPckgC<TInt> capIdDes( iCapability.iCapabilityID );
+ aMessage.WriteL( 0, capIdDes );
+ }
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( err );
+ }
+
+void CDirectPrintSession::GetPrinterCapTypeL( TDpMessage& aMessage )
+ {
+ TInt err = Server().ReserveEngine( this );
+ if( !err )
+ {
+ TPckgC<TInt> typeDes( iCapability.iType );
+ aMessage.WriteL( 0, typeDes );
+ }
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( err );
+ }
+
+void CDirectPrintSession::GetPrinterCapDefL( TDpMessage& aMessage )
+ {
+ TInt err = Server().ReserveEngine( this );
+ if( !err )
+ {
+ TPckgC<TInt> defDes( iCapability.iDefaultValue );
+ aMessage.WriteL( 0, defDes );
+ }
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( err );
+ }
+
+void CDirectPrintSession::GetPrinterCapLowL( TDpMessage& aMessage )
+ {
+ TInt err = Server().ReserveEngine( this );
+ if( !err )
+ {
+ TPckgC<TInt> lowDes( iCapability.iLow );
+ aMessage.WriteL( 0, lowDes );
+ }
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( err );
+ }
+
+void CDirectPrintSession::GetPrinterCapHighL( TDpMessage& aMessage )
+ {
+ TInt err = Server().ReserveEngine( this );
+ if( !err )
+ {
+ TPckgC<TInt> highDes( iCapability.iHigh );
+ aMessage.WriteL( 0, highDes );
+ }
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( err );
+ }
+
+void CDirectPrintSession::GetPrinterCapEnumCountL( TDpMessage& aMessage )
+ {
+ TInt err = Server().ReserveEngine( this );
+ if( !err )
+ {
+ TPckgC<TInt> countDes( iCapability.iEnumCount );
+ aMessage.WriteL( 0, countDes );
+ }
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( err );
+ }
+
+void CDirectPrintSession::GetPrinterCapEnumL( TDpMessage& aMessage )
+ {
+ TInt err = Server().ReserveEngine( this );
+ if( !err )
+ {
+ TInt index = aMessage.Int0();
+ TPckgC<TInt> enumDes( iCapability.iEnumCodes[index] );
+ aMessage.WriteL( 1, enumDes );
+ }
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( err );
+ }
+
+
+void CDirectPrintSession::GetPrinterCapabilityIDsCountL( TDpMessage& aMessage )
+ {
+ TInt err = Server().ReserveEngine( this );
+ if( !err )
+ {
+ iCapabilityIDs.Reset();
+ TInt printerID = aMessage.Int0();
+ err = Server().Engine().GetPrinterCapabilityIDsL( printerID, iCapabilityIDs );
+ if( !err )
+ {
+ TInt count = iCapabilityIDs.Count();
+ TPckgC<TInt> countDes( count );
+ aMessage.WriteL( 1, countDes );
+ }
+ }
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( err );
+ }
+
+void CDirectPrintSession::GetPrinterCapabilityIDL( TDpMessage& aMessage )
+ {
+ TInt err = Server().ReserveEngine( this );
+ if( !err )
+ {
+ TInt index = aMessage.Int0();
+ TInt id = iCapabilityIDs[index];
+ TPckgC<TInt> idDes( id );
+ aMessage.WriteL( 1, idDes );
+ }
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( err );
+ }
+
+void CDirectPrintSession::RegisterIdleObserverL( TDpMessage& aMessage )
+ {
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( KErrNotSupported );
+ }
+
+void CDirectPrintSession::CancelRegisterIdleObserverL( TDpMessage& aMessage )
+ {
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( KErrNotSupported );
+ }
+
+void CDirectPrintSession::StartDiscoveryL( TDpMessage& aMessage )
+ {
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( KErrNotSupported );
+ }
+
+void CDirectPrintSession::ContinueDiscoveryL( TDpMessage& aMessage )
+ {
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( KErrNotSupported );
+ }
+
+void CDirectPrintSession::PrepareJobL( TDpMessage& aMessage )
+ {
+ iJobGuard->PrepareL( aMessage );
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( KErrNone );
+ }
+
+void CDirectPrintSession::CreateJobL( TDpMessage& aMessage )
+ {
+ TInt err = iJobGuard->CreateL( aMessage );
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( err );
+ }
+
+void CDirectPrintSession::ContinueCreateJobL( TDpMessage& aMessage )
+ {
+ iJobGuard->ContinueCreateL( aMessage );
+ }
+
+void CDirectPrintSession::CancelStartDiscoveryL( TDpMessage& aMessage )
+ {
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( KErrNotSupported );
+ }
+
+void CDirectPrintSession::CancelCreateJobL( TDpMessage& aMessage )
+ {
+ TInt err = Server().ReserveEngine( this );
+ if( !err )
+ {
+ iJobGuard->Stop();
+ }
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( err );
+ }
+
+void CDirectPrintSession::IsPictBridgeModeL( TDpMessage& aMessage )
+ {
+#ifdef _DIRECTPRINT_USE_USB
+ RUsb usbManager;
+ TUsbDeviceState dState;
+ TInt personality;
+ TInt err = EFalse;
+ User::LeaveIfError( usbManager.Connect());
+ User::LeaveIfError( usbManager.GetDeviceState(dState));
+ User::LeaveIfError( usbManager.GetCurrentPersonalityId(personality));
+ usbManager.Close();
+
+ /*
+ * If there is some problems with pictbridge, check from usbpersonalityids.h that constants haven't been changed.
+ */
+ if( dState == EUsbDeviceStateConfigured && personality == KUsbPersonalityIdMTP )
+ err = ETrue;
+
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( err );
+#else
+ aMessage.SetDisposable( EFalse );
+ aMessage.Complete( EFalse );
+#endif // _DIRECTPRINT_USE_USB
+ }
+
+void CDirectPrintSession::SetNumberOfCopiesCountL( TDpMessage& aMessage )
+ {
+ LOG("CDirectPrintSession::CheckNumberOfCopiesL begin");
+ TInt count = aMessage.Int0();
+ LOG1("CDirectPrintSession::CheckNumberOfCopiesL count: %d", count);
+ TInt err = ( count > 0 ) ? KErrNone : KErrInvalidData;
+ if( !err )
+ {
+ iNumOfCopies->Reset( count );
+ }
+ LOG1("CDirectPrintSession::CheckNumberOfCopiesL return: %d", err);
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( err );
+ }
+
+void CDirectPrintSession::SetNumberOfCopiesL( TDpMessage& aMessage )
+ {
+ LOG("CDirectPrintSession::SetNumberOfCopiesL begin");
+ TInt copies = aMessage.Int0();
+ LOG1("CDirectPrintSession::SetNumberOfCopiesL copies: %d", copies);
+ TInt err = ( copies < 0 ) ? KErrInvalidData : KErrNone;
+ if( !err )
+ {
+ TBool full;
+ iNumOfCopies->AddNumOfCopyL( copies, full );
+ LOG1("CDirectPrintSession::SetNumberOfCopiesL full: %d", full);
+ if( full )
+ {
+ Server().Engine().SetNumsOfCopiesL( iNumOfCopies->NumsOfCopies(), err );
+ }
+ }
+ LOG1("CDirectPrintSession::SetNumberOfCopiesL return: %d", err);
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( err );
+ }
+
+void CDirectPrintSession::GetProtocolNamesCountL( TDpMessage& aMessage )
+ {
+ TInt err = Server().ReserveEngine( this );
+ if( !err )
+ {
+ TPckgC<TInt> count( Server().Engine().ProtocolCount() );
+ aMessage.WriteL( 0, count );
+ }
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( err );
+ }
+
+void CDirectPrintSession::GetProtocolNameL( TDpMessage& aMessage )
+ {
+ TInt err = Server().ReserveEngine( this );
+ if( !err )
+ {
+ err = Server().Engine().GetProtocolNameL( aMessage );
+ }
+ aMessage.SetDisposable( ETrue );
+ aMessage.Complete( err );
+ }
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/DirectPrintServer/src/main.cpp Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include <e32base.h>
+
+#include "directprintclientserver.h"
+#include "directprintserver.h"
+#include "directprintscheduler.h"
+#include "clog.h"
+
+// init and run the server
+static void RunTheServerL()
+ {
+#ifndef __SECURE_API__
+ User::LeaveIfError( RThread().Rename( KDirectPrintServerName ) ); //Deprecated! Replace this with the line below as soon as possible
+#else
+ User::LeaveIfError( RThread().RenameMe( KDirectPrintServerName ) );
+#endif
+
+ CActiveScheduler* scheduler = new (ELeave) CDirectPrintScheduler;
+ CleanupStack::PushL( scheduler );
+ CActiveScheduler::Install( scheduler );
+
+ CDirectPrintServer::NewLC();
+
+ RProcess::Rendezvous( KErrNone );
+
+ CActiveScheduler::Start();
+ CleanupStack::PopAndDestroy( 2 ); // CDirectPrintServer, scheduler
+ }
+
+// Server process entry-point
+TInt E32Main()
+ {
+ CTrapCleanup* cleanup = CTrapCleanup::New();
+ TInt r( KErrNoMemory );
+ if( cleanup )
+ {
+ TRAP( r, RunTheServerL() );
+ delete cleanup;
+ }
+ return r;
+ }
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/ImagePrintLibrary/inc/imageprint.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,153 @@
+/*
+* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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: Client include file for the ImagePrint server. Contains the
+* CImagePrint class definition, and the following interfaces:
+* MIdleObserver, MPrinterDiscoveryObserver and MPrintEventObserver
+*
+*/
+
+
+// Protection against nested includes
+#ifndef IMAGEPRINT_H
+#define IMAGEPRINT_H
+
+// System includes
+#include <e32base.h>
+
+class TPrinter;
+class TEvent;
+
+_LIT( KTabChar, "\t" );
+_LIT( KParamFile, "\\system\\data\\T_AIW_TEMP.DAT");
+
+/// Error constant defined to indicate Invalid Sequence.
+const TInt KErrInvalidSequence = -50;
+/// Error constant defined to indicate Invalid Data.
+const TInt KErrInvalidData = -51;
+/// Error constant defined to indicate that a printer has been connected
+const TInt KErrConnected = -500;
+
+/// BPP Protocol Identifier.
+const TUint KImagePrint_PrinterProtocol_BPP = 1;
+/// BIP Protocol Identifier.
+const TUint KImagePrint_PrinterProtocol_BIP = 2;
+/// OPP Protocol Identifier (Printer).
+const TUint KImagePrint_PrinterProtocol_OPP_Printer = 4;
+/// DPOF Protocol Identifier.
+const TUint KImagePrint_PrinterProtocol_DPOF = 8;
+/// PictBridge Protocol Identifier.
+const TUint KImagePrint_PrinterProtocol_PictBridge = 16;
+/// OPP Protocol Identifier (PC).
+const TUint KImagePrint_PrinterProtocol_OPP_PC = 32;
+/// UPnP Protocol Identifier
+const TUint KImagePrint_PrinterProtocol_UPnP = 64;
+/// LPR Protocol Identifier
+const TUint KImagePrint_PrinterProtocol_LPR = 128;
+
+/// Enums used to specify the current state in the DiscoveryStatusL callback.
+enum TDiscoveryStatus
+ {
+ EDiscoverying = 0,
+ EDiscoveryFinished = 1,
+ EDiscoveryCancelling = 2
+ };
+
+/// Enums used to specify the current state in the PrintJobProgressEvent callback.
+enum TPrintJobProgressEventStatus
+ {
+ EActive = 0,
+ EDone = 1
+ };
+
+/**
+ * @brief Interface to be implemented by the class using CImagePrint. It is used by CImagePrint to report anything related
+ * to the discovery process.
+ */
+class MPrinterDiscoveryObserver
+ {
+ public:
+ /**
+ * Called by Image Printer Server to notify the client application that a printer was discovered.
+ * @param aPrinterInfo Contains printer information of the discovered device.
+ */
+ virtual void FoundPrinterL( const TPrinter& aPrinterInfo ) = 0;
+ /**
+ * Called by Image Printer Server to notify the client application that an operation
+ * has completed, either successfully or with an error.
+ * @param aStatus Indicate the status of the discovery process. One of the values of \c ::TDiscoveryStatus
+ * @param aErrorCode \c KErrNone if there was no error, otherwise another of the system-wide error codes.
+ * @param aErrorStringCode StringCode - Descriptive text that can be used to further explain error.
+ */
+ virtual void DiscoveryStatusL( TInt aStatus,
+ TInt aErrorCode,
+ TInt aErrorStringCode ) = 0;
+ /**
+ * Called by Image Printer Server to notify the client application that a printer
+ * returned from the cache was not discovered during the discovery phase,
+ * and should be removed from the UI. If this call is needed, it will be made
+ * after all BPP printers have been returned, but before the discovery completes.
+ * @param aPrinterInfo Contains printer information of the printer that was not found during discovery
+ */
+ virtual void RemovePrinterL( const TPrinter& aPrinterInfo ) = 0;
+ };
+
+/**
+ * @brief Interface to be implemented by the class using CImagePrint. It is used by CImagePrint to report anything related
+ * to the printing process, once it is started.
+ */
+class MPrintEventObserver
+ {
+ public:
+ virtual void PrintJobProgressEvent( TInt aStatus,
+ TInt aPercentCompletion,
+ TInt aJobStateCode ) = 0;
+
+ virtual void PrintJobErrorEvent( TInt aError,
+ TInt aErrorStringCode ) = 0;
+
+ virtual void PrinterStatusEvent( TInt aError,
+ TInt aErrorStringCode ) = 0;
+
+ virtual void PreviewImageEvent( TInt aFsBitmapHandle ) = 0;
+
+ virtual void ShowMessageL( TInt aMsgLine1Code,
+ TInt aMsgLine2Code ) = 0;
+
+ virtual TBool AskYesNoQuestionL( TInt aMsgLine1Code,
+ TInt aMsgLine2Code ) = 0;
+
+ virtual const TDesC& AskForInputL( TInt aMsgLine1Code,
+ TInt aMsgLine2Code ) = 0;
+ };
+
+/**
+ * @brief Interface to be implemented by the class using CImagePrint. It is used by CImagePrint to report
+ * anything related to status changes in the handling protocol.
+ * @sa CImagePrint::RegisterIdleObserver
+ */
+class MIdleObserver
+ {
+ public:
+ /** Called by CImagePrint to notify of events. The meaning of the event and associated error and mesage codes
+ * is protocol dependant.
+ */
+ virtual void StatusEvent( const TEvent &aEvent,
+ TInt aError,
+ TInt aMsgCode ) = 0;
+ };
+
+
+#endif // IMAGEPRINT_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/ImagePrintLibrary/inc/imageprint.rh Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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: Contains the following interfaces: MProtPrintingDevice,
+* MProtIdleObserver, MProtPrintEventObserver and MProtDiscoveryObserver.
+*
+*/
+
+
+STRUCT RS_CAPABILITY
+{
+ LONG printerclass;
+ LONG capabilityid;
+ LONG type;
+ LONG defaultvalue;
+ LONG low;
+ LONG high;
+ LONG enumcodes[]; //code and link pair
+ LONG linkid;
+}
+
+STRUCT RS_CAPABILITIES
+{
+ STRUCT capabilities[];
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/ImagePrintLibrary/inc/mprotprintingdevice.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,326 @@
+/*
+* Copyright (c) 2004-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: Contains the following interfaces: MProtPrintingDevice,
+* MProtIdleObserver, MProtPrintEventObserver and MProtDiscoveryObserver.
+*
+*/
+
+
+#ifndef MPROTPRINTINGDEVICE_H
+#define MPROTPRINTINGDEVICE_H
+
+#include <e32base.h>
+
+#include "tprinter.h"
+#include "directprintcapability.h"
+#include "tidleevent.h"
+
+const TInt DEVICE_ID_FIELD_MASK = 0x03FFFFFF; // most significant bits: 0000 0011 rest is 1's
+const TInt PROTOCOL_ID_FIELD_MASK = 0xFC000000; // most significant bits: 1111 1100
+const TInt PROTOCOL_ID_CLEAR_MASK = 0x0000003F; // less siginificant bits: 0011 1111
+const TInt PROTOCOL_ID_BIT_COUNT = 6;
+
+
+/**
+ * @brief Interface to be implemented by a class observing the discovery events of a class implementing MProtPrintingDevice.
+ *
+ * Interface used by a Protocol implementing "MProtPrintingDevice" to report back any device found or not found and
+ * the general status of the discovery process. This should be implemented by the class using "MProtPrintingDevice"; in
+ * this case, it's already implemented in a class in the Image Print Library.
+ */
+class MProtDiscoveryObserver
+ {
+ public:
+ virtual void FoundDeviceL( TPrinter& aDeviceInfo ) = 0;
+ virtual void RemoveDeviceL( TPrinter& aDeviceInfo ) = 0;
+
+ /**
+ * @brief
+ * @param aStatus ( EDiscovering | ECancellingDiscovery | EDoneDiscovery | EDiscoveryFinished )
+ * EDiscovering = currently discovering
+ * ECancellingDiscovery = cancel request on discovery
+ * EDiscoveryFinished = on discovery time-out
+ * @param aErrorCode
+ * @param aErrorStringCode
+ */
+ virtual void DiscoveryStatusL( TInt aStatus,
+ TInt aErrorCode,
+ TInt aErrorStringCode = KErrNone ) = 0;
+ };
+
+/**
+ * @brief Interface to be implemented by a class observing the printing events of a class implementing MProtPrintingDevice.
+ *
+ * Interface used by a Protocol implementing "MProtPrintingDevice" to report back the printing progress, any error or
+ * the printer status. This should be implemented by the class using "MProtPrintingDevice"; in this case, it's already
+ * implemented in a class in the Image Print Library.
+ * These methods should be used only when actual printing is ongoing
+ */
+class MProtPrintEventObserver
+ {
+ public:
+ /**
+ * @brief Method to inform observer about printing proggress.
+ *
+ * @param aStatus Defines the printing status defined in ImagePrint.h.
+ * @param aPercent Percents of job readiness.
+ * @param aJobStateCode Job's state defined in PrintMessageCodes.h.
+ */
+ virtual void PrintJobProgressEvent( TInt aStatus,
+ TInt aPercent,
+ TInt aJobStateCode ) = 0;
+
+ /**
+ * @brief Method to inform observer about error occured during printing.
+ *
+ * @param aErrorCode Defines the error code that is symbian wide or defined in PrintMessageCodes.h.
+ * @param aErrorStringCode Reserved for future use.
+ */
+ virtual void PrintJobErrorEvent( TInt aErrorCode,
+ TInt aErrorStringCode = KErrNone ) = 0;
+
+ /**
+ * @brief Method to inform observer about error concerning the printing device.
+ *
+ * @param aErrorCode Defines the error code that is symbian wide or defined in PrintMessageCodes.h.
+ * @param aErrorStringCode Reserved for future use.
+ */
+ virtual void PrinterStatusEvent( TInt aErrorCode,
+ TInt aErrorStringCode = KErrNone ) = 0;
+
+ // DEPRECATED - DO NOT USE
+ virtual void PreviewImageEvent( TInt aFsBitmapHandle ) = 0;
+
+ // DEPRECATED - DO NOT USE
+ virtual void ShowMessageL( TInt aMsgLine1Code,
+ TInt aMsgLine2Code ) = 0;
+
+ // DEPRECATED - DO NOT USE
+ virtual TBool AskYesNoQuestionL( TInt aMsgLine1Code,
+ TInt aMsgLine2Code ) = 0;
+
+ // DEPRECATED - DO NOT USE
+ virtual const TDesC& AskForInputL( TInt aMsgLine1Code,
+ TInt aMsgLine2Code ) = 0;
+ };
+
+/**
+ * @brief Interface to be implemented by CImagePrint. It is used to report
+ * anything related to status changes in the handling protocol.
+ * @sa MProtPrintingDevice::RegisterIdleObserver
+ */
+class MProtIdleObserver
+ {
+ public:
+ /** Called by a protocol to notify CImagePrint of events. The meaning of the event and associated error and mesage codes
+ * is protocol dependant. This should be used only when actual printing is not ongoing.
+ */
+ virtual void StatusEvent( const TEvent &aEvent,
+ TInt aError,
+ TInt aMsgCode ) = 0;
+ };
+
+/**
+ * @brief Interface to be implemented in the Polymorphic DLLs.
+ *
+ * Interface to be implemented by any printing protocol that wants to be added to the Image Print library, so it can
+ * be seen by the library and used in a transparent way. This implementation should be encapsulated within a Polymorphic
+ * DLL and put in a specific directory.
+ */
+class MProtPrintingDevice
+ {
+ public:
+ // General.
+ /**
+ * @brief Part of the standard construction pattern.
+ * @param aDLLPath Path where the DLL was found so it can know where it is located and use that information
+ * when looking for resource files and such. The path includes the DLL itself.
+ */
+ virtual void ConstructL( const TDesC& aDLLPath ) = 0;
+ /**
+ * @brief Reports the Version of the DLL.
+ * @return A TVersion object containing the version of the protocol.
+ */
+ virtual TVersion Version() = 0;
+ /**
+ * @brief Returns the Protocols supported by the DLL. It can be any of the KImagePrint_PrinterProtocol* constants.
+ * @return An OR'ed value with the supported protocols information.
+ */
+ virtual TUint SupportedProtocols() = 0;
+ // Discovery.
+ /**
+ * @brief Starts the discovery process.
+ *
+ * This process is to find whatever printing device is available nearby. After this call server waits
+ * DiscoveryStatusL from MProtDiscoveryObserver to be called with value aStatus = EDiscoveryFinished
+ * after the discovey is finished.
+ * @param aObserver The discovery observer.
+ * @param aProtocol Used to indicate what protocols to search for. 0 = all, 1 = BPP, 2 = BIP, 4 = OPP, 8 = DPOF, 16 = PB.
+ * @return Any standard Symbian error code.
+ */
+ virtual void StartDiscoveryL( MProtDiscoveryObserver& aObserver,
+ TUint aProtocol = 0 ) = 0;
+ /**
+ * @brief Removes a specified cached printer.
+ * @param[in] aDeviceID The ID of the printer the client wants to remove.
+ * @return Any standard Symbian error code or ( KErrInvalidSequence and KErrInvalidData ).
+ */
+ virtual TInt RemoveCachedDeviceL( TInt aDeviceID ) = 0;
+
+ /**
+ * @brief Cancels the discovery process.
+ * The caller expects to get notification of cancelled discovery via 'DiscoveryStatusL' with value 'EDiscoveryCancelling'
+ * @param[in] aDoCallBack Flag to indicate whether to call back the observer or not. Default = True.
+ */
+ virtual void CancelDiscovery( TBool aDoCallBack = ETrue ) = 0;
+
+ // Print.
+ /**
+ * @brief Creates a print job in the specified printer.
+ * @param[in] aDeviceID The ID of the printer where the client wishes to create the print job.
+ * @param aImages Array containing the full names of the files to print.
+ * @param aObserver The print event observer.
+ * @return Any standard Symbian error code or ( KErrInvalidSequence and KErrInvalidData ).
+ */
+ virtual TInt CreatePrintJobL( TInt aDeviceID,
+ RPointerArray<TDesC>& aImages,
+ MProtPrintEventObserver& aObserver ) = 0;
+ /**
+ * @brief Submits a print job already created.
+ */
+ virtual void SubmitPrintJobL() = 0;
+ /**
+ * @brief Cancels the print job.
+ */
+ virtual TInt CancelPrintJob() = 0;
+ /**
+ * @brief Continues printing and / or submitting a print job. Implementation may vary from protocol to protocol.
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ virtual TInt ContinuePrintJobL() = 0;
+ /**
+ * @brief Gets the number of pages to be printed.
+ * @return Number of pages to print.
+ */
+ virtual TInt GetNumPrintPages() = 0;
+ /**
+ * DEPRECATED - DO NOT USE
+ * @brief Gets the status of the printing job created.
+ * @return Printing job status.
+ */
+ virtual TInt GetPrintJobStatus() = 0;
+ /**
+ * DEPRECATED - DO NOT USE
+ * @brief Gets the status of the printer.
+ * @param[in] aDeviceID The ID of the printer the client wants to know about.
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ virtual TInt GetPrinterStatus( TInt aDeviceID ) = 0;
+ // Capabilities.
+ /**
+ * @brief Gets the IDs of the capabilities supported by the printer specified.
+ * @param[in] aDeviceID The ID of the printer the client wants to know about.
+ * @param[out] aCapabilityIDs Array containing the ID's of the capabilities of the specified printer.
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ virtual TInt GetDeviceCapabilityIDsL( TInt aDeviceID,
+ RArray<TInt>& aCapabilityIDs ) = 0;
+ /**
+ * @brief Gets the detail of a certain capability of a certain printer.
+ * @param[in] aDeviceID The exposed ID of the printer the client wants to know about.
+ * @param[in] aCapabilityID ID of the capability of interest.
+ * @param[out] aCapability Capability information.
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ virtual TInt GetDeviceCapabilityL( TInt aDeviceID,
+ TInt aCapabilityID,
+ TDirectPrintCapability& aCapability ) = 0;
+ /**
+ * @brief Gets a setting (i.e., papersize selected) from an existing job.
+ * @param[in] aCapabilityID ID of the capability of interest.
+ * @param[out] aValue Capability value.
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ virtual TInt GetJobSetting( TInt aCapabilityID,
+ TInt& aValue ) = 0;
+ /**
+ * @brief Sets a print job setting.
+ * @param[in] aCapabilityID ID of the capability of interest.
+ * @param[in] aValue New capability value.
+ * @param[out] aAffectedCapability ID of any affected capability.
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ virtual TInt SetJobSettingL( TInt aCapabilityID,
+ TInt aValue,
+ TInt& aAffectedCapability ) = 0;
+ // Preview.
+ /**
+ * DEPRECATED - DO NOT USE
+ * @brief Gets the number of pages in the preview.
+ * @return Number of pages in the preview.
+ */
+ virtual TInt GetNumPreviewPages() = 0;
+ /**
+ * DEPRECATED - DO NOT USE
+ * @brief Gets the icon representing a given layout or template.
+ * @param[in] aTemplateID ID of the template / layout of interest.
+ * @param[out] aFsBitmapHandle Handle to the appropriate bitmap.
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ virtual TInt GetJobTemplateIconL( TInt aTemplateID,
+ TInt& aFsBitmapHandle ) = 0;
+ /**
+ * DEPRECATED - DO NOT USE
+ * @brief Creates a preview image.
+ * @param[in] aPageNumber Page number to create preview image of.
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ virtual TInt CreatePreviewImage( TInt aPageNumber ) = 0;
+
+ /**
+ * @brief Destructor.
+ */
+ virtual ~MProtPrintingDevice() {}
+
+
+ /**
+ * @brief Registers the IdleObserver to send idle event notifications
+ * @param A pointer to an object implementing MIdleObserver interface that will be notified of events
+ * @note In order to stop sending notifications, send NULL as the parameter.
+ */
+ virtual void RegisterIdleObserver( MProtIdleObserver *aObserver ) = 0;
+
+
+ /**
+ * @brief Number of copies setter. Must be called after the print job is created but before
+ * submission. Amount of array elements must be the same with the amount of image files
+ * in the print job. Array elements must be greater than 0.
+ * @param aNumsOfCopies number of copies array
+ * @param aErr contains error code on return
+ */
+ virtual void SetNumsOfCopiesL( const RArray<TInt>& aNumsOfCopies,
+ TInt& aErr ) = 0;
+
+ public:
+ TUid iDtor_ID_Key;
+ protected:
+ /// Protocol API observer.
+ MProtDiscoveryObserver* iDiscoveryObserver;
+ /// Protocol API observer.
+ MProtPrintEventObserver* iPrintEventObserver;
+ };
+
+#endif // MPROTPRINTINGDEVICE_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/ImagePrintLibrary/inc/printmessagecodes.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,174 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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: Contains the TPrintErrorMessageCodes and TPrintMessageCodes enumerations.
+*
+*/
+
+
+#ifndef PRINTMESSAGECODES_H
+#define PRINTMESSAGECODES_H
+
+/// Global printing Error Message Codes.
+// All supported by UI
+enum TPrintErrorMessageCodes
+{
+ EObexConnectError = -3000,
+ EObexSendError = -3001,
+ EObexDisconnectError = -3002,
+ EObexGeneralError = -3003,
+};
+
+/// Global printing Message Codes.
+enum TPrintMessageCodes
+{
+ // No message
+ ENoMessage = 0,
+
+ // Print Progress Codes
+ EJobPending = 3100,
+ EPrinting = 3101,
+ ECopying = 3102,
+ ECancelling = 3103,
+ ECancellingNoMessage = 3104,
+
+ // Pict Bridge
+ EPbOutOfPaper = 3300, ///<@deprecated Use TPrintMessageCodes::EPbStatusErrorReasonPaperEmpty
+ EPbCheckPrinter = 3301,
+ EPbPrinterIsDisconnected = 3302,
+ EPbPrinterIsConnected = 3303,
+ EPbFileNotSupported = 3304,
+ EPbFileNotFound = 3305,
+
+ EPbStatusErrorReasonNoReason, /*3306*/ ///<@brief No reason
+ EPbStatusErrorReasonPaper, ///<@brief Paper-related error
+ EPbStatusErrorReasonInk, ///<@brief Ink-related error
+ EPbStatusErrorReasonHardware, ///<@brief Hardware-related error
+ EPbStatusErrorReasonFile, ///<@brief File-related error
+ EPbStatusErrorReasonPaperEmpty, /*3311*/ ///<@brief Paper is empty
+ EPbStatusErrorReasonPaperLoad, ///<@brief Load error - paper not loaded correctly
+ EPbStatusErrorReasonPaperEject, ///<@brief Eject error - paper not ejected correctly
+ EPbStatusErrorReasonPaperMedia, ///<@brief Media error - paper is not detected, paper skewed, roll paper connot be cut or torn-off
+ EPbStatusErrorReasonPaperJam, ///<@brief Paper jam
+ EPbStatusErrorReasonPaperNearlyEmpty, ///<@brief Paper nearly empty
+ EPbStatusErrorReasonPaperCombination, ///<@brief Paper type / paper size combination not supported, or paper found in printer does not match request
+ EPbStatusErrorReasonInkEmpty, /*18*/ ///<@brief Ink empty
+ EPbStatusErrorReasonInkLow, ///<@brief Ink low
+ EPbStatusErrorReasonInkWaste, ///<@brief Waste ink error (waste-ink reservior full).
+ EPbStatusErrorReasonHardwareFatal, /*21*/ ///<@brief Fatal error
+ EPbStatusErrorReasonWarning, // warning
+ EPbStatusErrorReasonHardwareServiceCall, ///<@brief Service call
+ EPbStatusErrorReasonHardwarePrinterUnavailable, ///<@brief Printer unavailable (performing maintenance or otherwise occupied)
+ EPbStatusErrorReasonHardwarePrinterBusy, ///<@brief Printer busy (processing a job from another source, e.g. a PC)
+ EPbStatusErrorReasonHardwareLever, ///<@brief Lever error (lever position not correct)
+ EPbStatusErrorReasonHardwareCoverOpen, ///<@brief Cover open
+ EPbStatusErrorReasonHardwareNoMarkingAgent, ///<@brief No marking agent (e.g. missing printer head)
+ EPbStatusErrorReasonHardwareInkCoverOpen, ///<@brief Ink cover open
+ EPbStatusErrorReasonHardwareNoInkCartridge, ///<@brief No ink cartridge
+ EPbStatusErrorReasonFilePrintInfo, /*31*/ ///<@brief printInfo error (specified <printInfo> is too large).
+ EPbStatusErrorReasonFileFileDecode, ///<@brief File decode error (picture format of specified image cannot be decoded).
+
+ // Printer status reasons
+ EPrintReasonAttentionRequired, /*33*/ ///<@brief Indicates reason other than those listed
+ EPrintReasonPaused, ///<@brief Someone has paused the printer and the PrinterState is "stopped". In this state, a Printer may not produce printed output.
+ EPrintReasonOutputAreaAlmostFull, ///<@brief One or more output area is almost full: e.g., tray, stacker, collator.
+ EPrintReasonOutputAreaFull, ///<@brief One or more output area is full: e.g., tray, stacker, collator.
+ EPrintReasonMarkerSupplyLow, ///<@brief The device is low on at least one marker supply: e.g., toner, ink, ribbon.
+ EPrintReasonMarkerSupplyEmpty, ///<@brief The device is out of at least one marker supply: e.g., toner, ink, ribbon.
+ EPrintReasonMarkerFailure, ///<@brief The device has at least one marking device which has failed and requires service or replacement: e.g., pen.
+
+ // OBEX response codes
+ EObexReserved, ///<@brief Reserved
+ EObexContinue, ///<@brief Continue
+ EObexOKSuccess, ///<@brief OK, Success
+ EObexCreated, ///<@brief Created
+ EObexAccepted, ///<@brief Accepted
+ EObexNonAuthoritativeInformation, ///<@brief Non-Authoritative Information
+ EObexNoContent, ///<@brief No Content
+ EObexResetContent, ///<@brief Reset Content
+ EObexPartialContent, ///<@brief Partial Content
+ EObexMultipleChoices, ///<@brief Multiple Choices
+ EObexMovedPermanently, ///<@brief Moved Permanently
+ EObexMovedTemporarily, ///<@brief Moved Temporarily
+ EObexSeeOther, ///<@brief See Other
+ EObexNotModified, ///<@brief Not Modified
+ EObexUseProxy, ///<@brief Use Proxy
+ EObexBadRequest, ///<@brief Bad Request - server could not understand the request
+ EObexUnauthorized, ///<@brief Unauthorized
+ EObexPaymentRequired, ///<@brief Payment required
+ EObexForbidden, ///<@brief Forbidden: operation is understood but refused
+ EObexNotFound, ///<@brief Not found DPS: Object or File does not exist.
+ EObexMethodNotAllowed, ///<@brief Method not allowed
+ EObexNotAcceptable, ///<@brief Not acceptable
+ EObexProxyAuthRequired, ///<@brief Proxy authentication is required
+ EObexRequestTimedOut, ///<@brief Request timed out
+ EObexConflict, ///<@brief Conflict
+ EObexGone, ///<@brief Gone
+ EObexLengthRequired, ///<@brief Length Required
+ EObexPreconditionFailed, ///<@brief Precondition failed
+ EObexRequestedEntityTooLarge, ///<@brief Requested entity is too large
+ EObexRequestedURLTooLarge, ///<@brief Requested URL is too large
+ EObexUnsupportedMediaType, ///<@brief Unsupported media type. Note: Refers to MIME media-type
+ EObexInternalReceiverError, ///<@brief Internal receiver error
+ EObexNotImplemented, ///<@brief Not implemented
+ EObexBadGateway, ///<@brief Bad Gateway
+ EObexServiceUnavailable, ///<@brief Service Unavailable
+ EObexGatewayTimeout, ///<@brief Gateway Timeout
+ EObexHTTPVersionNotSupported, ///<@brief HTTP protocol version is not supported
+ EObexDatabaseFull, ///<@brief Database Full
+ EObexDatabaseLocked, ///<@brief Database Locked
+
+ EKErrIrObexRespTimedOut = -5572, // OBEX command timed out
+
+};
+
+enum TOperationStatusCodes
+{
+ EOperationStatusOk = 0x0000, ///<@brief successful-ok
+ EOperationStatusOkIgnoredOrSubstitutedAttributes = 0x0001, ///<@brief successful-ok-ignored-or-substituted-attributes
+ EOperationStatusOkConflictingAttributes = 0x0002, ///<@brief successful-ok-conflicting-attributes
+ EOperationStatusClientBadRequest = 0x0400, ///<@brief client-error-bad-request
+ EOperationStatusClientForbidden = 0x0401, ///<@brief client-error-forbidden
+ EOperationStatusClientNotAuthenticated = 0x0402, ///<@brief client-error-not-authenticated
+ EOperationStatusClientNotAuthorized = 0x0403, ///<@brief client-error-not-authorized
+ EOperationStatusClientNotPossible = 0x0404, ///<@brief client-error-not-possible
+ EOperationStatusClientTimeout = 0x0405, ///<@brief client-error-timeout
+ EOperationStatusClientNotFound = 0x0406, ///<@brief client-error-not-found
+ EOperationStatusClientGone = 0x0407, ///<@brief client-error-gone
+ EOperationStatusClientRequestEntityTooLarge = 0x0408, ///<@brief client-error-request-entity-too-large
+ EOperationStatusClientRequestValueTooLong = 0x0409, ///<@brief client-error-request-value-too-long
+ EOperationStatusClientDocumentFormatNotSupported = 0x040a, ///<@brief client-error-document-format-not-supported
+ EOperationStatusClientAttributesOrValuesNotSupported = 0x040b, ///<@brief client-error-attributes-or-values-not-supported
+ EOperationStatusClientUriSchemeNotSupported = 0x040c, ///<@brief client-error-uri-scheme-not-supported
+ EOperationStatusClientCharsetNotSupported = 0x040d, ///<@brief client-error-charset-not-supported
+ EOperationStatusClientConflictingAttributes = 0x040e, ///<@brief client-error-conflicting-attributes
+ EOperationStatusClientCompressionNotSupported = 0x040f, ///<@brief client-error-compression-not-supported
+ EOperationStatusClientCompression = 0x0410, ///<@brief client-error-compression-error
+ EOperationStatusClientDocumentFormat = 0x0411, ///<@brief client-error-document-format-error
+ EOperationStatusClientDocumentAccess = 0x0412, ///<@brief client-error-document-access-error
+ EOperationStatusClientMediaNotLoaded = 0x0418, ///<@brief client-error-media-not-loaded
+ EOperationStatusServerInternalError = 0x0500, ///<@brief server-error-internal-error
+ EOperationStatusServerOperation = 0x0501, ///<@brief server-error-operation-not-supported
+ EOperationStatusServerServiceUnavailable = 0x0502, ///<@brief server-error-service-unavailable
+ EOperationStatusServerVersionNotSupported = 0x0503, ///<@brief server-error-version-not-supported
+ EOperationStatusServerDeviceError = 0x0504, ///<@brief server-error-device-error
+ EOperationStatusServerTemporaryError = 0x0505, ///<@brief server-error-temporary-error
+ EOperationStatusServerNotAcceptingJobs = 0x0506, ///<@brief server-error-not-accepting-jobs
+ EOperationStatusServerBusy = 0x0507, ///<@brief server-error-busy
+ EOperationStatusServerJobCanceled = 0x0508, ///<@brief server-error-job-canceled
+ EOperationStatusServerMultipleDocument = 0x0509 ///<@brief server-error-multiple-document-jobs-not-supported
+};
+
+#endif // PRINTMESSAGECODES_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/ImagePrintLibrary/inc/tdiscoveryguarddata.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+*
+*/
+
+
+
+#ifndef TDISCOVERYGUARDDATA_H
+#define TDISCOVERYGUARDDATA_H
+
+#include <e32def.h>
+
+#include "tprinter.h"
+
+class TDiscoveryGuardData
+ {
+ public:
+
+ enum TCallbackNum
+ {
+ EFoundCb = 0,
+ EStatusCb,
+ ERemoveCb
+ };
+
+ public:
+
+ TPrinter iPrinterInfo;
+ TInt iStatus;
+ TInt iErrorCode;
+ TInt iErrorStringCode;
+ TCallbackNum iCb;
+ };
+
+#endif // TDISCOVERYGUARDDATA_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/ImagePrintLibrary/inc/tidleevent.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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: Contains the types necesary for MIdleObserver TPrinter class definition.
+*
+*/
+
+
+#ifndef IDLEEVENT_H
+#define IDLEEVENT_H
+
+/** The severity associated of the notification.
+ */
+enum TSeverity
+ {
+ ///The event doesn't have a specific severity. Used in cases where severity is irrelevant, unknown or can be ignored.
+ ENotSpecified,
+ ///The event does not cause an error
+ ENoError,
+ ///The event was caused by a warning. Generally this is recoverable.
+ EWarning,
+ ///The event was caused by a fatal error. Generally this is not recoverable
+ EFatal,
+ ///The event was caused by a severe error. Generally this is a async leave
+ ESevere
+ };
+
+/** The type of event the observer is being notified of. The types of events being raised vary by protocol
+ */
+enum TEventType
+ {
+ ///The protocol has made a connection to the printer, device or transport
+ EConnect,
+ ///The protocol has been disconnected from the printer, device or transport
+ EDisconnect,
+ ///The protocol can be disconnected
+ EDisconnectReady,
+ ///The protocol cannot be disconnected
+ EDisconnectNotReady,
+ ///The device or printer is ready to accept print jobs
+ EPrintReady,
+ ///The device or printer is not ready to accept print jobs
+ EPrintNotReady,
+ ///The event is notifying a change in the device status, or is reporting an error sent from the device
+ EPrinterStatus,
+ ///The event is notifying that the capabilities that the printer supports have changed
+ EPrinterCapabilityChanged,
+ ///The event is notifying that asynchronous leave has happened
+ EAsynchronousLeave
+ };
+
+/** The event object. This object provides information about the event.
+ */
+class TEvent
+ {
+ public:
+ /** The protocol that is sending the notification
+ * @sa KImagePrint_PrinterProtocol_BPP @sa KImagePrint_PrinterProtocol_BIP @sa KImagePrint_PrinterProtocol_OPP
+ * @sa KImagePrint_PrinterProtocol_DPOF @sa KImagePrint_PrinterProtocol_PictBridge
+ */
+ TInt iProtocol;
+ ///The associated severity of the event
+ TSeverity iSeverity;
+ ///What kind of event is being sent
+ TEventType iEventType;
+ };
+
+
+#endif // IDLEEVENT_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/ImagePrintLibrary/inc/tidleguarddata.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+*
+*/
+
+
+#ifndef TIDLEGUARDDATA_H
+#define TIDLEGUARDDATA_H
+
+#include <e32def.h>
+
+#include "tidleevent.h"
+
+class TIdleGuardData
+ {
+ public:
+
+ TEvent iEvent;
+ TInt iError;
+ TInt iMsgCode;
+ };
+
+#endif // TIDLEGUARDDATA_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/ImagePrintLibrary/inc/tjobguarddata.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+*
+*/
+
+
+#ifndef TJOBGUARDDATA_H
+#define TJOBGUARDDATA_H
+
+#include <e32def.h>
+
+class TJobGuardData
+ {
+ public:
+
+ enum TCallbackNum
+ {
+ EProgressEventCb = 0,
+ EErrorEventCb,
+ EStatusEventCb,
+ EImageEventCb
+ };
+
+ public:
+
+ TInt iStatus;
+ TInt iPercentCompletion;
+ TInt iJobStateCode;
+ TInt iError;
+ TInt iErrorStringCode;
+ TInt iFsBitmapHandle;
+ TCallbackNum iCb;
+ };
+
+#endif // TJOBGUARDDATA_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/ImagePrintLibrary/inc/tmessagewrp2.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,136 @@
+/*
+* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+*
+*/
+
+
+#ifndef TMESSAGEWRP2_H
+#define TMESSAGEWRP2_H
+
+#include <e32base.h>
+
+class TMessageWrp2
+ {
+ public:
+
+ /**
+ * Message wrapper constructor
+ *
+ * @param aMessage message to be wrapped
+ * @param aConnected session connection flag
+ */
+ TMessageWrp2( const RMessage2& aMessage, const TBool& aConnected );
+
+ public:
+
+ /**
+ * If session connected, write descriptor to the wrapped message
+ *
+ * @param aParam message parameter id
+ * @param aDes descriptor
+ * @param aOffset offset from the start of the client's descriptor
+ */
+ void WriteL(TInt aParam, const TDesC8 &aDes, TInt aOffset=0) const;
+
+ /**
+ * If session connected, complete the wrapped message
+ *
+ * @param aReason completion code
+ */
+ void Complete(TInt aReason) const;
+
+ /**
+ * If session connected, gets the 1st message argument as an integer value
+ *
+ * @return 1st message argument as an integer value
+ */
+ TInt Int0() const;
+
+ /**
+ * If session connected, gets the 2nd message argument as an integer value
+ *
+ * @return 2nd message argument as an integer value
+ */
+ TInt Int1() const;
+
+ /**
+ * If session connected, gets the length of a descriptor argument
+ * in the client's process
+ *
+ * @param aParam index value identifying the argument
+ * @return the length of the descriptor or error code
+ */
+ TInt GetDesLength(TInt aParam) const;
+
+ /**
+ * If session connected, read data from the specified offset within
+ * the 8-bit descriptor argument, into the specified target descriptor
+ *
+ * @param aParam message parameter id
+ * @param aDes target descriptor
+ * @param aOffset offset from the start of the client's descriptor
+ */
+ void ReadL(TInt aParam, TDes8 &aDes, TInt aOffset=0) const;
+
+ /**
+ * If session connected, read data from the specified offset within
+ * the 16-bit descriptor argument, into the specified target descriptor
+ *
+ * @param aParam message parameter id
+ * @param aDes target descriptor
+ * @param aOffset offset from the start of the client's descriptor
+ */
+ void ReadL(TInt aParam, TDes16 &aDes, TInt aOffset=0) const;
+
+ /**
+ * Panic the client thread
+ *
+ * @param aCategory category descriptor
+ * @param aReason reason id
+ */
+ void Panic(const TDesC &aCategory, TInt aReason) const;
+
+ /**
+ * Gets the the number of the function requested by the client
+ *
+ * @return the function number
+ */
+ TInt Function() const;
+
+ /**
+ * Sets the disposable state. Disposable means that the message needs not
+ * to be preserved
+ *
+ * @param aDisposable disposable flag
+ */
+ void SetDisposable( TBool aDisposable );
+
+ /**
+ * Gets the disposable state
+ *
+ * @return the disposable flag
+ */
+ TBool Disposable() const;
+
+ private: // data
+ RMessage2 iMessage;
+ const TBool& iConnected;
+ TBool iDisposable;
+ };
+
+
+#endif // TMESSAGEWRP2_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/ImagePrintLibrary/inc/tprinter.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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: Contains the TPrinter class definition.
+*
+*/
+
+
+#ifndef TPRINTER_H
+#define TPRINTER_H
+
+#include <e32base.h>
+
+/**
+ * @brief A printer abstraction.
+ *
+ * Class representing the basic properties of a printing device.
+ * Published as part of the ImagePrint Server API.
+ */
+class TPrinter
+ {
+ public:
+ enum TPrinterProperty
+ {
+ Cached = 1,
+ SupportsPreview = 2
+ };
+ enum TPrinterVendor
+ {
+ EVendorNone = 0 // No Vendor
+ // Add other vendors
+ };
+ TInt iPrinterID;
+ TBuf<84> iDisplayName;
+ TUint iProperties;
+ TUint iProtocol;
+ TUint iVendor;
+ };
+
+#endif // TPRINTER_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/group/bld.inf Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+#include "../directprintclient/group/bld.inf"
+#include "../directprintserver/group/bld.inf"
+
+#include "../directprintapp/group/bld.inf"
+
+PRJ_PLATFORMS
+WINSCW ARMV5 GCCE
+PRJ_EXPORTS
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/inc/aiwprintproperty.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// Protection against nested includes
+#ifndef __AIWPRINTPROPERTY_H__
+#define __AIWPRINTPROPERTY_H__
+
+const TUid KPrintPropertyCat = {0x10012345};
+enum TPrintPropertyKeys
+ {
+ EPrintProperty,
+ };
+
+enum
+ {
+ ENotAiwCall,
+ EAiwPrintCall,
+ EAiwQuickPrintCall
+ };
+
+#endif // __AIWPRINTPROPERTY_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/inc/clog.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+// Protection against nested includes
+#ifndef __CLOG_H__
+#define __CLOG_H__
+
+// System includes
+#include <e32base.h>
+#include <e32std.h>
+
+#include "logdef.h"
+
+#ifdef ENABLE_LOGGING
+#define LOG(s) Log::DoLog(_L(s))
+#define LOG1(s, v) Log::DoLog( _L(s), v )
+#define LOG2(s, v1, v2) Log::DoLog( _L(s), v1, v2 )
+#define LOG3(s, v1, v2, v3) Log::DoLog( _L(s), v1, v2, v3 )
+
+#define LOG8(s) Log::DoLog8(_L8(s))
+#define LOG81(s, v) Log::DoLog8( _L8(s), v )
+#define LOG82(s, v1, v2) Log::DoLog8( _L8(s), v1, v2 )
+#define LOG83(s, v1, v2, v3) Log::DoLog8( _L8(s), v1, v2, v3 )
+
+#else
+#define LOG(s)
+#define LOG1(s, v)
+#define LOG2(s, v1, v2)
+#define LOG3(s, v1, v2, v3)
+
+#define LOG8(s)
+#define LOG81(s, v)
+#define LOG82(s, v1, v2)
+#define LOG83(s, v1, v2, v3)
+#endif // ENABLE_LOGGING
+
+class Log
+ {
+
+ public:
+
+ static void DoLog( TRefByValue<const TDesC> aText, ... );
+
+ static void DoLog8( TRefByValue<const TDesC8> aText, ... );
+ };
+
+#endif // __CLOG_H__
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/inc/directprintband.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* Test print band ECOM plugin
+*
+*/
+
+// Protection against nested includes
+#ifndef DIRECTPRINTBAND_H
+#define DIRECTPRINTBAND_H
+
+// System includes
+#include <e32std.h>
+#include <e32base.h>
+#include <gdi.h>
+#include <ecom/ecom.h>
+
+// Forward declarations
+class CDirectPrintBand;
+class CPrintSetup;
+class RXmlEngDocument;
+class MPageRegionPrinter;
+
+// CLASS DECLARATION
+
+/**
+ * CDirectPrintBand
+ *
+ */
+class CDirectPrintBand : public CBase
+ {
+public:
+ inline static CDirectPrintBand* NewL(TUid aImplementationUid);
+ virtual ~CDirectPrintBand();
+
+ /**
+ * Initialize the print band
+ *
+ * @param aPrintSetup Pointer to the CPrintSetup
+ * @param aParam Xml parameter object
+ * @param aFileName Sets the file name if define the file name to xml,
+ * Not set if not define the file name to xml
+ */
+ virtual void InitPrintBandL(CPrintSetup* aPrintSetup,
+ RXmlEngDocument* aParam,
+ const TDesC& aFileName) = 0;
+
+ /**
+ * Return the print band object
+ *
+ * @return MPageRegionPrinter* Pointer to the print band object
+ */
+ virtual MPageRegionPrinter* RegionPrinter() = 0;
+
+ /**
+ * Return the total page number
+ *
+ * @return TInt the total page number
+ */
+ virtual TInt PageNum() = 0;
+
+public:
+ TUid iDtorIdKey;
+ };
+
+inline CDirectPrintBand* CDirectPrintBand::NewL(TUid aImplementationUid)
+ { // static
+ TAny* any = REComSession::CreateImplementationL(aImplementationUid,
+ _FOFF(CDirectPrintBand, iDtorIdKey));
+ CDirectPrintBand* plugin = reinterpret_cast<CDirectPrintBand*>(any);
+ return plugin;
+ }
+
+inline CDirectPrintBand::~CDirectPrintBand()
+ {
+ REComSession::DestroyedImplementation(iDtorIdKey);
+ }
+
+#endif // DIRECTPRINTBAND_H
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/inc/directprintbanduid.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* Test print band ECOM plugin
+*
+*/
+
+// Protection against nested includes
+#ifndef DIRECTPRINTBANDUID_H
+#define DIRECTPRINTBANDUID_H
+
+// The UIDs are defined for Direct Print band plugin
+
+// Interface Uid for print band plugin
+#define KDirectPrintBandInterfaceUid 0x2002BB30
+
+#endif // DIRECTPRINTBANDUID_H
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/inc/directprintcapability.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description: Contains the TDirectPrintCapability class definition.
+*
+*/
+
+
+// Protection against nested includes
+#ifndef DIRECTPRINTCAPABILITY_H
+#define DIRECTPRINTCAPABILITY_H
+
+// System includes
+#include <e32base.h>
+
+/**
+ * @brief A printer capability abstraction.
+ *
+ * Class describing a capability (i.e. paper sizes or layouts) supported by a printing device.
+ * Published as part of the ImagePrint Server API.
+ */
+
+#define KMaxEnumAmount 20
+
+class TDirectPrintCapability
+ {
+ public:
+ enum ECapType
+ {
+ Int = 0,
+ Enum = 1,
+ Float = 2,
+ Text = 3
+ };
+
+ TInt iCapabilityID;
+ ECapType iType;
+ TInt iDefaultValue;
+ TInt iLow;
+ TInt iHigh;
+ TInt iEnumCount;
+ TInt iEnumCodes[KMaxEnumAmount];
+ };
+
+#endif // DIRECTPRINTCAPABILITY_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/inc/directprintcapabilitycodes.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,71 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description: Contains the TPrintCapabilityCodes and TPrintCapabilityOptions enumerations.
+*
+*/
+
+
+// Protection against nested includes
+#ifndef PRINTCAPABILITYCODES_H
+#define PRINTCAPABILITYCODES_H
+
+/// All the printer capabilities
+enum TPrintCapabilityCodes
+ {
+ EDirectPrintCapabLayout = 500,
+ EDirectPrintCapabPaperSize = 501,
+ EDirectPrintCapabQuality = 502,
+ EDirectPrintCapabAP = 600,
+ EDirectPrintCapabHost = 601,
+ EDirectPrintCapabPort = 602,
+ EDirectPrintCapabUser = 603,
+ EDirectPrintCapabQue = 604,
+ EDirectPrintCapabExtent = 901,
+ EDirectPrintCapabExtent2 = 902
+ };
+
+/// Print capability generic options
+enum TPrintCapabilityOptions
+ {
+ // Generic
+ EDirectPrintCapabYes = 1000,
+ EDirectPrintCapabNo = 1001,
+ EDirectPrintCapabOn = 1002,
+ EDirectPrintCapabOff = 1003,
+
+ // Quality
+ EDirectPrintCapabQualityDefault = 1100,
+ EDirectPrintCapabQualityNormal = 1101,
+ EDirectPrintCapabQualityDraft = 1102,
+ EDirectPrintCapabQualityFine = 1103,
+
+ // Paper size
+ EDirectPrintCapabPaperSizeAuto = 1200,
+ EDirectPrintCapabPaperSizeLetter = 1201,
+ EDirectPrintCapabPaperSizeA4 = 1221,
+ EDirectPrintCapabPaperSizeA6 = 1222,
+ EDirectPrintCapabPaperSize4x6 = 1250,
+ EDirectPrintCapabPaperSize5x7 = 1251,
+ EDirectPrintCapabPaperSizeSticker = 1270,
+
+ // Extent
+ EDirectPrintCapabExtentSelect1 = 9001,
+ EDirectPrintCapabExtentSelect2 = 9002,
+ EDirectPrintCapabExtentSelect3 = 9003,
+ EDirectPrintCapabExtentSelect4 = 9004
+ };
+
+#endif // PRINTCAPABILITYCODES_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/inc/directprintclient.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,315 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef RDIRECTPRINTCLIENT_H
+#define RDIRECTPRINTCLIENT_H
+
+#include <e32std.h>
+
+#include "directprintselectitem.h"
+
+class TDirectPrintCapability;
+//class TIdleGuardData;
+//class TDiscoveryGuardData;
+class TDirectPrintJobGuardData;
+
+class RDirectPrintClient : public RSessionBase
+ {
+ public:
+
+ /**
+ * Constructor
+ */
+ IMPORT_C RDirectPrintClient();
+
+ /**
+ * Connect to the DirectPrint server
+ *
+ * @return KErrNone if successful, otherwise another of the system-wide error codes
+ */
+ IMPORT_C void ConnectL();
+
+ /**
+ * Close the session
+ */
+ IMPORT_C void Close();
+
+ /**
+ * Count connections to the server ( all clients in all prosesses )
+ *
+ * @param aConnections holder for connnections count
+ * @return KErrNone if successful, otherwise another of the system-wide error codes
+ */
+ IMPORT_C TInt CountConnections( TInt& aConnections ) const;
+
+ /**
+ * Inform server about foreground/background state of the client
+ *
+ * @param aFg foreground/background flag
+ * @return KErrNone if successful, otherwise another of the system-wide error codes
+ */
+ IMPORT_C TInt SetForeground( TInt aFg ) const;
+
+
+ /**
+ * Reserves DirectPrint engine for this client
+ *
+ * @return KErrNone if successful, KErrInUse if used by another client
+ */
+ IMPORT_C TInt ReserveEngine() const;
+
+ /**
+ * Releases DirectPrint engine
+ *
+ * @return KErrNone if successful, KErrInUse if used by another client
+ */
+ IMPORT_C TInt ReleaseEngine() const;
+
+ /**
+ * Get protocols supported by DirectPrint engine
+ *
+ * @return OR:ed protocols or KErrInUse if used by another client
+ */
+ IMPORT_C TInt SupportedProtocols() const;
+
+ /**
+ * Gets the number of pages to be printed
+ *
+ * @return Number of pages to print or KErrInUse if used by another client
+ */
+ IMPORT_C TInt GetNumPrintPages() const;
+
+ /**
+ * Gets the status of the printing job created
+ *
+ * @return Printing job status or KErrInUse if used by another client
+ */
+ IMPORT_C TInt GetJobStatus() const;
+
+ /**
+ * Gets the status of the printer
+ *
+ * @param aPrinterID The exposed ID of the printer the client wants to know about.
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt GetPrinterStatus( TInt aPrinterID ) const;
+
+ /**
+ * Cancel discovery
+ *
+ * @return KErrNone or KErrInUse if used by another client
+ */
+ IMPORT_C TInt CancelDiscovery() const;
+
+ /**
+ * Submits a print job already created. The actual job execution is asynchronous so this
+ * function returns immediately. If successful, notification of job status and job
+ * completion is received by the client through the MPrintEventObserver.
+ *
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt SubmitPrintJob() const;
+
+ /**
+ * Cancels the print job. This is an asynchronous command. MPrintEventObserver::PrintJobProgressEvent
+ * will be called with the status of TPrintJobProgressEventStatus::EDone when the cancellation
+ * is completed. The notification can potentially be received by the client before
+ * this command returns to the client.
+ *
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt CancelPrintJob() const;
+
+ /**
+ * Continues printing and / or submitting a print job.
+ *
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt ContinuePrintJob() const;
+
+ /**
+ * Removes a specified cached printer.
+ *
+ * @param aPrinterID The exposed ID of the printer the client wants to remove.
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt RemoveCachedPrinter( TInt aPrinterID ) const;
+
+ /**
+ * Gets the icon representing a given layout or template.
+ *
+ * @param aTemplateID ID of the template / layout of interest.
+ * @param aFbsBitmapHandle Handle to the appropriate bitmap.
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt GetJobTemplateIcon( TInt aTemplateID, TInt& aFbsBitmapHandle ) const;
+
+ /**
+ * Gets the number of pages in the preview.
+ *
+ * @return Number of pages in the preview.
+ */
+ IMPORT_C TInt GetNumPreviewPages() const;
+
+ /**
+ * Sets a print job setting.
+ *
+ * @param aCapabilityID ID of the capability of interest.
+ * @param aValue New capability value.
+ * @param aAffectedCapability ID of any affected capability.
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt SetJobSetting( TInt aCapabilityID, TInt aValue, TInt& aAffectedCapability ) const;
+
+ /**
+ * Gets a setting configured for the created print job.
+ *
+ * @param aCapabilityID ID of the capability of interest.
+ * @param aValue Capability value.
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt GetJobSetting( TInt aCapabilityID, TInt& aValue ) const;
+
+ /**
+ * Gets the detail of a certain capability of a certain printer.
+ *
+ * @param aPrinterID The exposed ID of the printer the client wants to know about.
+ * @param aCapabilityID ID of the capability of interest.
+ * @param aCapability Capability information.
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt GetPrinterCapability(TInt aPrinterID, TInt aCapabilityID, TDirectPrintCapability& aCapability) const;
+
+ /**
+ * Gets the IDs of the capabilities supported by the printer specified.
+ *
+ * @param aPrinterID The exposed ID of the printer the client wants to know about.
+ * @param aCapabilityIDs Array containing the ID's of the capabilities of the specified printer.
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt GetPrinterCapabilityIDs( TInt aPrinterID, RArray<TInt>& aCapabilityIDs ) const;
+
+ /**
+ * Registers the IdleObserver to send idle event notifications. Asynchronous function.
+ *
+ * @param aData place holder for idle event. On function completion contains idle event data.
+ * @param aStatus request status
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+// IMPORT_C TInt RegisterIdleObserver( TIdleGuardData& aData, TRequestStatus& aStatus );
+
+ /**
+ * Cancel registering idle observer
+ *
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+// IMPORT_C TInt CancelRegisterIdleObserver() const;
+
+ /**
+ * Start discovery and set request for discovery event. Asynchronous function.
+ *
+ * @param aData place holder for discovery event. On function completion contains discovery event data.
+ * @param aProtocols OR:ed protocol ids
+ * @param aStatus request status
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+// IMPORT_C TInt StartDiscovery( TDiscoveryGuardData& aData, TUint aProtocols, TRequestStatus& aStatus );
+
+ /**
+ * Set next request for discovery event. Asynchronous function.
+ *
+ * @param aData place holder for discovery event. On function completion contains discovery event data.
+ * @param aStatus request status
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+// IMPORT_C TInt ContinueDiscovery( TDiscoveryGuardData& aData, TRequestStatus& aStatus );
+
+ /**
+ * Create print job and set request for print job event. Asynchronous function.
+ *
+ * @param aPrinterID printer id
+ * @param aData place holder for print job event. On function completion contains print job event data.
+ * @param aImages array of image file names
+ * @param aStatus request status
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt CreateJob( TInt aPrinterID, TDirectPrintJobGuardData& aData, RPointerArray<TDesC>& aImages, TRequestStatus& aStatus );
+
+ /**
+ * Set next request for print job event. Asynchronous function.
+ *
+ * @param aData place holder for print job event. On function completion contains print job event data.
+ * @param aStatus request status
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt ContinueCreateJob( TDirectPrintJobGuardData& aData, TRequestStatus& aStatus );
+
+ /**
+ * Cancel starting discovery
+ *
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt CancelStartDiscovery() const;
+
+ /**
+ * Cancel creating print job
+ *
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt CancelCreateJob() const;
+
+ /**
+ * PictBridge USB mode checker
+ *
+ * @return TInt value more than 0, if PictBridge USB mode is on; 0 if off; negative value if error
+ */
+ IMPORT_C TInt IsPictBridgeMode() const;
+
+ /**
+ * Set number of copies
+ *
+ * @param aArray array of number of copies elements. Each array element corresponds to the array
+ * of image file names of created print job
+ * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ].
+ */
+ IMPORT_C TInt SetNumberOfCopies( const RArray<TInt>& aArray ) const;
+
+ IMPORT_C TInt GetProtocolNames(RSelectItemArray& aNames) const;
+
+ public:
+
+ /**
+ * Version getter
+ *
+ * @return version of the client
+ */
+ TVersion Version() const;
+
+ private:
+
+ TPtr8 iDicsoveryDataPtr;
+ TPtr8 iIdleDataPtr;
+ TPtr8 iJobDataPtr;
+ TDirectPrintCapability* iCapability;
+ TPtr8 iNameDataPtr;
+ };
+
+
+#endif // RDIRECTPRINTCLIENT_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/inc/directprintclientserver.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+// Protection against nested includes
+#ifndef DIRECTPRINTCLIENTSERVER_H
+#define DIRECTPRINTCLIENTSERVER_H
+
+// System include files
+#include <e32std.h>
+
+// User include files
+#include "directprintserveruid.h"
+
+_LIT( KDirectPrintServerName, "directprintserver" );
+_LIT( KDirectPrintServerImg, "directprintserver" ); // EXE name
+
+const TInt KMaxDirectPrintMessage = 512;
+const TInt KDirectPrintServerMajor = 0;
+const TInt KDirectPrintServerMinor = 0;
+const TInt KDirectPrintServerBuild = 0;
+
+enum TDirectPrintMessages
+ {
+ ECountConnections = 0,
+ ESetForeground,
+ EReserveEngine,
+ EReleaseEngine,
+ ESupportedProtocols,
+ EGetNumPrintPages,
+ EGetJobStatus,
+ EGetPrinterStatus,
+ ECancelDiscovery,
+ ESubmitPrintJob,
+ ECancelPrintJob, // 10
+ EContinuePrintJob,
+ ERemoveCachedPrinter,
+ EGetJobTemplateIcon,
+ EGetNumPreviewPages,
+ ESetJobSetting,
+ EGetJobSetting,
+ EGetPrinterCapability,
+ EGetPrinterCapId,
+ EGetPrinterCapType,
+ EGetPrinterCapDef, // 20
+ EGetPrinterCapLow,
+ EGetPrinterCapHigh,
+ EGetPrinterCapEnumCount,
+ EGetPrinterCapEnum,
+ EGetPrinterCapabilityIDsCount,
+ EGetPrinterCapabilityID,
+ ERegisterIdleObserver,
+ ECancelRegisterIdleObserver,
+ EStartDiscovery,
+ EContinueDiscovery, // 30
+ EPrepareJob,
+ ECreateJob,
+ EContinueCreateJob,
+ ECancelStartDiscovery,
+ ECancelCreateJob,
+ EIsPictBridgeMode,
+ ESetNumberOfCopiesCount,
+ ESetNumberOfCopies, // 38
+ EGetProtocolNamesCount,
+ EGetProtocolName
+ };
+
+#endif// DIRECTPRINTCLIENTSERVER_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/inc/directprintjobguarddata.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+// Protection against nested includes
+#ifndef DIRECTPRINTJOBGUARDDATA_H
+#define DIRECTPRINTJOBGUARDDATA_H
+
+// System includes
+#include <e32def.h>
+
+class TDirectPrintJobGuardData
+ {
+public:
+
+ enum TCallbackNum
+ {
+ EProgressEventCb = 0,
+ EErrorEventCb,
+ EStatusEventCb,
+ EImageEventCb
+ };
+
+public:
+
+ TInt iStatus;
+ TInt iPercentCompletion;
+ TInt iJobStateCode;
+ TInt iError;
+ TInt iErrorStringCode;
+ TInt iFsBitmapHandle;
+ TCallbackNum iCb;
+ };
+
+#endif // DIRECTPRINTJOBGUARDDATA_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/inc/directprintselectitem.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef __DIRECTPRINTSELECTITEM_H__
+#define __DIRECTPRINTSELECTITEM_H__
+
+// System includes
+#include <e32cmn.h>
+
+// Class declaration
+/**
+ * Select item information class
+ * more_complete_description
+ */
+class TDirectPrintSelectItem
+ {
+public:
+ /** Id. */
+ TInt iId;
+ /** Name. */
+ TBuf<50> iName;
+ };
+
+typedef RArray<TDirectPrintSelectItem> RSelectItemArray;
+
+#endif // __DIRECTPRINTSELECTITEM_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/inc/directprintserveruid.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+// Protection against nested includes
+#ifndef DIRECTPRINTSERVERUID_H
+#define DIRECTPRINTSERVERUID_H
+
+// Image Print Server UID3
+
+#define KDIRECTPRINTSERVERUID3 0x2002BB2C
+
+#endif // DIRECTPRINTSERVERUID_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/inc/directprintuiplugin.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* {Description of the file}
+*
+*/
+
+// Protection against nested includes
+#ifndef _DIRECTPRINTUIPLUGIN_H_
+#define _DIRECTPRINTUIPLUGIN_H_
+
+// System includes
+#include <e32base.h>
+#include <coecntrl.h>
+#include <ecom.h>
+
+// User includes
+#include "directprintpropertydata.h"
+
+// Forward declarations
+class CAknSettingItemArray;
+class RReadStream;
+class RWriteStream;
+
+//Constants
+/** Interface UID */
+const TUid KUidDirectPrintUiPluginInterface = { 0x2002BB33 };
+
+// Class declaration
+/**
+ * Ui plugin class
+ * more_complete_description
+ */
+class CDirectPrintUiPlugin : public CBase
+ {
+public:
+ inline static CDirectPrintUiPlugin* NewL(TUid aUid);
+ inline static CDirectPrintUiPlugin* NewL(const TDesC8& aKey);
+ virtual ~CDirectPrintUiPlugin();
+
+public:
+ inline static void GetPluginListL(RImplInfoPtrArray& aArray);
+
+public:
+ virtual void InternalizePropertiesL(RReadStream& aStream) = 0;
+ virtual void ExternalizePropertiesL(RWriteStream& aStream) = 0;
+
+ virtual void LoadExtendItemsL(CAknSettingItemArray& aArray, TInt aId) = 0;
+ virtual void ReadDataL(TDirectPrintPropertyData& aData) = 0;
+ virtual void WriteDataL(RDPPropertyDataArray& aArray) = 0;
+ virtual void NewDataL() = 0;
+
+protected:
+ inline CDirectPrintUiPlugin();
+
+private:
+ TUid iDtor_ID_Key;
+ };
+
+
+// Inline codepart
+inline CDirectPrintUiPlugin::CDirectPrintUiPlugin()
+ {
+ }
+
+inline CDirectPrintUiPlugin* CDirectPrintUiPlugin::NewL(TUid aUid)
+ {
+ TAny* any = REComSession::CreateImplementationL(aUid, _FOFF(CDirectPrintUiPlugin, iDtor_ID_Key));
+ CDirectPrintUiPlugin* plugin = reinterpret_cast<CDirectPrintUiPlugin*>(any);
+ return plugin;
+ }
+
+inline CDirectPrintUiPlugin* CDirectPrintUiPlugin::NewL(const TDesC8& aKey)
+ {
+ TEComResolverParams params;
+ params.SetDataType(aKey);
+ params.SetWildcardMatch(ETrue);
+
+ TAny* any = REComSession::CreateImplementationL(KUidDirectPrintUiPluginInterface, _FOFF(CDirectPrintUiPlugin, iDtor_ID_Key), NULL, params);
+ CDirectPrintUiPlugin* plugin = reinterpret_cast<CDirectPrintUiPlugin*>(any);
+ return plugin;
+ }
+
+inline CDirectPrintUiPlugin::~CDirectPrintUiPlugin()
+ {
+ REComSession::DestroyedImplementation(iDtor_ID_Key);
+ }
+
+inline void CDirectPrintUiPlugin::GetPluginListL(RImplInfoPtrArray& aArray)
+ {
+ REComSession::ListImplementationsL(KUidDirectPrintUiPluginInterface, aArray);
+ }
+
+#endif // _DIRECTPRINTUIPLUGIN_H_
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DirectPrint/inc/logdef.h Wed Mar 31 00:04:55 2010 +0900
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "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:
+* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+// Protection against nested includes
+#ifndef LOGDEF_H
+#define LOGDEF_H
+
+//#define ENABLE_LOGGING
+//#define LOG_TO_FILE
+
+/*
+#ifdef _DEBUG
+// logging is always enabled in debug builds
+#define ENABLE_LOGGING
+#else
+// manually enable in release builds
+//#define ENABLE_LOGGING
+#endif // _DEBUG
+
+#define LOG_TO_FILE
+*/
+
+#endif // LOGDEF_H
+
+// End of File