merge with master
[apps/home/mobileprint.git] / mobileprint / include / pts_common.h
index 5bf0252..7ce7b04 100755 (executable)
@@ -20,7 +20,9 @@
 #ifndef PTS_COMMON_H_
 #define PTS_COMMON_H_
 
+#include <appcore-common.h>
 #include <Ecore.h>
+#include <Ecore_X.h>
 #include <stdio.h>
 #include <string.h>
 #include <Elementary.h>
@@ -28,7 +30,7 @@
 #include <pt_api.h>
 #include "pts_debug.h"
 
-#include "preview_engine.h" /* TODO: move to preview widget */
+#include <smsc_smart.h>
 
 #define PTS_2  "Can not register the printer"
 #define PTS_17 "Error option"
 #define IDS_PRT_33     "Paper level error"
 #define IDS_PRT_34     "No print head"
 #define IDS_PRT_35     "Printer related error occurred"
+#define IDS_PRT_41     "Failed to launch mobileprint"
 
 #define IDS_BR_OPT_5X7 "5\"x7\"(13x18cm)"
 #define IDS_BR_OPT_4X6 "4\"x6\"(10x15cm)"
 #define IDS_BR_OPT_3_5X5       "3.5\"x5\"(9x13cm)"
 #define IDS_BR_OPT_WALLET      "Wallet(6.4x8.4cm)"
 
+
+#define IDS_PRT_GET_ATTRS_FOR_PRINTERS "Getting printer attributes..."
+#define IDS_ASEML_POP_GET_ATTRS_FAILED "Failed to get printer attributes"
+
+#define IDS_SCRREAD_CANCEL_SEARCHING_PRINTERS "Double tap to cancel searching for printers"
+#define IDS_SCRREAD_CONFIRM_SELECTED_PRINTER "Press to confirm selected printer"
+#define IDS_SCRREAD_CANCEL_CONNECT_WIFI "Cancel connect to Wi-Fi network"
+#define IDS_SCRREAD_SMPOS_SK3_CANCEL "Press to cancel printing"
+#define IDS_SCRREAD_MORE_OPTIONS "More options"
+#define IDS_SCRREAD_CANCEL_PRINTING "Double tap to cancel printing"
+#define IDS_SCRREAD_MENU_INFO "More options"
+#define IDS_SCRREAD_MENU_CONTEXT "Double click to access options menu"
+#define IDS_SCRREAD_PRINTERS_LIST_IS_BELOW "Printers list is below"
+#define IDS_SCRREAD_PRINT_CONTEXT "Double tap to send document to the printer"
+#define IDS_SCRREAD_PREVIEW_IMAGE_TYPE "Preview of the document to be printed"
+#define IDS_SCRREAD_PREVIEW_IMAGE_CONTEXT "Print button is below"
+#define IDS_SCRREAD_EXPANDABLE_LIST_TYPE "Expandable list"
+#define IDS_SCRREAD_EXPANDABLE_LIST_CONTEXT "Double tap to open list"
+#define IDS_SCRREAD_SETTINS_ITEM_CONTEXT "Double tap to edit"
+#define IDS_SCRREAD_PRINTER_ITEM_CONTEXT "Double tap to change selected printer"
+
 #define SERVICE_LAUNCH_TYPE "LAUNCH_TYPE"
 #define SERVICE_JOB_ID "JOB_ID"
 #define SERVICE_FILES "FILES"
 #define SERVICE_PRINT_FILES_FOLDER_NAME "service_print_files_folder_name"
 #define SERVICE_PRINT_FILES_FILES_NAME "service_print_files_files_name"
 
-#define ICON_PRINTER "/opt/usr/apps/org.tizen.mobileprint/res/images/pt_default_printer.png"
+#define ICON_PRINTER "/usr/apps/org.tizen.mobileprint/res/images/pt_default_printer.png"
 
 #define UG_MAX_FILED_LEN       64
 #define COPIES_MAX     99
 
+#undef MIN
+#define MIN(a,b)  ((((a)-(b))&0x80000000) >> 31)? (a) : (b)
+#define PRINTER_LIST_POPUP_W           656
+#define PRINTER_LIST_POPUP_H           880
+#define PRINTER_LIST_POPUP_LN_W                720
+#define PRINTER_LIST_POPUP_LN_H                480
+
 #ifndef API
 #define API __attribute__ ((visibility("default")))
 #endif
@@ -158,13 +189,14 @@ typedef struct {
        pts_printing_data_t     pt_files;
        char                    *input_file;
        int                             n_up;
+       int                             copies;
 } pts_job_spooling_t;
 
 typedef void (*pts_printer_selection_done_cb)(void *userdata);
 
 typedef struct {
        Evas_Object             *root_win;
-       Evas_Object             *main_win;
+       Evas_Object             *main_layout;
        Evas_Object             *navi;
        Evas_Object             *printer_layout;
        Evas_Object             *printer_label;
@@ -178,6 +210,9 @@ typedef struct {
        Evas_Object             *popup;
        Evas_Object             *wifi_type_popup;
        Evas_Object             *printer_list_popup;
+       Evas_Object             *printer_list_popup_box;
+       Evas_Coord              printer_list_popup_portrait_height;
+       Evas_Coord              printer_list_popup_landscape_height;
        Evas_Object             *no_found_popup;
        Evas_Object             *scaling_popup;
        Evas_Object             *size_popup;
@@ -248,16 +283,13 @@ typedef struct {
        int                                     dummy_noti_id;
        Eina_List                       *job_spooling_list;
 
-       Evas_Object *preview_img;
-       Evas_Object *loading_animation;
+       Evas_Object *smsc;
 
        int                     landscape_toggle;
 
        /* whether in process(searching, printing) */
        int                     is_process;
 
-       struct preview_engine engine; /* TODO: move to widget data */
-
        pts_image_size_e        image_size;
 
        double          custom_width;
@@ -307,6 +339,14 @@ Evas_Object *pts_create_label_btn(Evas_Object *parent, const char *label);
 Evas_Object *pts_create_base_layout(Evas_Object *parent, const char *group);
 
 /**
+ *     This function let the app create the base layout
+ *     @return  void
+ *     @param[in] parent the pointer to the parent of the base layout
+ *     @param[in] desc the pointer to group of the base layout
+ */
+Evas_Object *pts_create_base_layout_with_conform(Evas_Object *parent, const char *group);
+
+/**
  *     This function let the app create the popup element
  *     @return  void
  *     @param[in] parent the pointer to the parent of the popup element
@@ -322,7 +362,7 @@ void pts_set_ugd(pts_core_data_t *ugd);
 pts_core_data_t *pts_get_ugd(void);
 
 
-
+int _pts_get_rotate_angle(enum appcore_rm rotate_mode);
 void pts_search_printer(pts_core_data_t *ugd, Evas_Object *parent, pts_printer_search_state_e search_mode, pts_printer_selection_done_cb cb, void *userdata);
 void pts_create_print_search_popup(Evas_Object *parent, pts_core_data_t *ugd);
 Evas_Object *pts_utils_create_layout(Evas_Object *navi_frame);
@@ -339,7 +379,7 @@ Eina_Bool _pts_printing_data_set_files_count(const char *num_of_files, pts_print
 Eina_Bool _pts_printing_data_set_index(const char *current_index, pts_printing_data_t *data);
 Eina_Bool _pts_printing_data_set_type(const char *type, pts_printing_data_t *data);
 
-charpts_parse_protocol(char *addr);
+char *pts_parse_protocol(char *addr);
 int pts_unstandardization(char *name);
 
 #endif /* PTS_COMMON_H_ */