├── .cproject
├── .gitignore
├── .project
├── .settings
├── org.eclipse.core.resources.prefs
├── org.eclipse.core.runtime.prefs
└── org.eclipse.ltk.core.refactoring.prefs
├── LICENSE.txt
├── README.md
├── data
├── RFterm.l01
├── RFterm.l04
├── RFterm.l16
├── RFterm.l93
├── RFterm.loc
├── RFterm.rss
├── RFterm_reg.rss
├── fontnote_EN.txt
├── fontnote_RU.txt
├── fontnote_SP.txt
└── fontnote_UK.txt
├── gfx
├── qgn_menu_RFterm.svg
├── rfterm_promo_en.gif
├── rfterm_promo_ru.gif
├── signal_off.svg
└── signal_on.svg
├── group
├── Icons_scalable_dc.mk
├── RFterm.mmp
├── bld.inf
└── cpfont.mmp
├── help
├── Custom.xml
├── RFterm_01.cshlp
├── RFterm_04.cshlp
├── RFterm_16.cshlp
├── RFterm_93.cshlp
├── build_help.mk
├── out
│ ├── RFterm_0xae7f53fa.h01
│ ├── RFterm_0xae7f53fa.h01.hrh
│ ├── RFterm_0xae7f53fa.h04
│ ├── RFterm_0xae7f53fa.h04.hrh
│ ├── RFterm_0xae7f53fa.h16
│ ├── RFterm_0xae7f53fa.h16.hrh
│ ├── RFterm_0xae7f53fa.h93
│ └── RFterm_0xae7f53fa.h93.hrh
└── src
│ ├── RFterm_01.rtf
│ ├── RFterm_04.rtf
│ ├── RFterm_16.rtf
│ └── RFterm_93.rtf
├── inc
├── BatteryLevel.h
├── ChargingStatus.h
├── ColorControl.h
├── ColorControl.hrh
├── ColorControl.rh
├── RFterm.hrh
├── RFterm.pan
├── RFtermAppUi.h
├── RFtermAppView.h
├── RFtermApplication.h
├── RFtermBatteryStatus.h
├── RFtermBt.h
├── RFtermBtObserver.h
├── RFtermBtServiceAdvertiser.h
├── RFtermBtServiceSearcher.h
├── RFtermBtServiceSearcher.pan
├── RFtermCodePages.h
├── RFtermConstants.h
├── RFtermDocument.h
├── RFtermOutput.h
├── RFtermOutputObserver.h
├── RFtermScrollBarModel.h
├── RFtermScrollBars.h
├── RFtermScrollBarsObserver.h
├── RFtermSdpAttributeNotifier.h
├── RFtermSdpAttributeParser.h
├── RFtermSdpAttributeParser.pan
├── RFtermSettings.h
├── RFtermSettingsDialog.h
├── RFtermSignalQueryDialog.h
├── RFtermTextQueryDialog.h
└── blddef.h
├── sis
├── RFterm_S60v3.pkg
├── RFterm_S60v5.pkg
└── backup_registration.xml
└── src
├── BatteryLevel.cpp
├── ChargingStatus.cpp
├── ColorControl.cpp
├── RFterm.cpp
├── RFtermAppUi.cpp
├── RFtermAppView.cpp
├── RFtermApplication.cpp
├── RFtermBatteryStatus.cpp
├── RFtermBt.cpp
├── RFtermBtServiceAdvertiser.cpp
├── RFtermBtServiceSearcher.cpp
├── RFtermDocument.cpp
├── RFtermOutput.cpp
├── RFtermScrollBars.cpp
├── RFtermSdpAttributeParser.cpp
├── RFtermSettings.cpp
├── RFtermSettingsDialog.cpp
├── RFtermSignalQueryDialog.cpp
├── RFtermTextQueryDialog.cpp
└── cpfont.cpp
/.gitignore:
--------------------------------------------------------------------------------
1 | sis/*.sis
2 | sis/*.sisx
3 | group/ABLD.BAT
4 | help/temp
5 | TODO.txt
6 |
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | RFterm
4 |
5 |
6 |
7 |
8 |
9 | com.nokia.carbide.cdt.builder.carbideCPPBuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.cdt.core.cnature
16 | org.eclipse.cdt.core.ccnature
17 | com.nokia.carbide.cdt.builder.carbideCPPBuilderNature
18 |
19 |
20 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.core.resources.prefs:
--------------------------------------------------------------------------------
1 | #Thu Feb 27 13:06:11 EET 2020
2 | eclipse.preferences.version=1
3 | encoding/=UTF-8
4 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.core.runtime.prefs:
--------------------------------------------------------------------------------
1 | #Tue Jun 23 20:49:48 EEST 2020
2 | eclipse.preferences.version=1
3 | line.separator=\n
4 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.ltk.core.refactoring.prefs:
--------------------------------------------------------------------------------
1 | #Tue Jun 23 20:49:48 EEST 2020
2 | eclipse.preferences.version=1
3 | org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
4 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Features
2 |
3 | 
4 |
5 | * Data to send:
6 | * Text message
7 | * Control character or any byte
8 | * RS-232 signal
9 | * File
10 | * History of recent messages
11 | * Saving the output to a file
12 | * Supported code pages:
13 | * ISO 8859-1 (Latin-1)
14 | * ISO 8859-2 (Latin-2)
15 | * ISO 8859-3 (Latin-3)
16 | * ISO 8859-4 (Latin-4)
17 | * ISO 8859-5 (Latin/Cyrillic)
18 | * CP 1251 (Cyrillic)
19 | * CP 1252 (Latin-1)
20 | * KOI-8
21 | * Supported control characters:
22 | * CARRIAGE RETURN (^M)
23 | * LINE FEED (^J)
24 | * CHARACTER TABULATION (^I)
25 | * BACKSPACE (^H)
26 | * BELL (^G)
27 | * LINE TABULATION (^K)
28 | * FORM FEED (^L)
29 | * NULL (^@)
30 | * DELETE
31 | * Localizations:
32 | * English
33 | * Spanish
34 | * Russian
35 | * Ukrainian
36 |
--------------------------------------------------------------------------------
/data/RFterm.l01:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFterm.l01
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : This is a localisation file for RFterm (EN).
7 | ============================================================================
8 | */
9 |
10 | // LOCALISATION STRINGS
11 |
12 | // Caption string for app.
13 | #define qtn_caption_string "RFterm"
14 |
15 | // Items in "Options" menu pane
16 | #define qtn_connect "Connect"
17 | #define qtn_disconnect "Disconnect"
18 |
19 | #define qtn_start "Start"
20 | #define qtn_stop "Stop"
21 |
22 | #define qtn_send "Send"
23 | #define qtn_send_message "Message"
24 | #define qtn_send_history "Message from history"
25 | #define qtn_send_ctrl_char "Control character"
26 | #define qtn_send_signal "Signal"
27 | #define qtn_send_file "File"
28 |
29 | #define qtn_clear "Clear"
30 |
31 | #define qtn_save "Save"
32 |
33 | #define qtn_settings "Settings"
34 |
35 | #define qtn_help "Help"
36 |
37 | #define qtn_exit "Exit"
38 |
39 | // Navigation pane
40 | #define qtn_str_navi_disconnected "disconnected"
41 |
42 | // Bluetooth
43 | #define qtn_rfterm_service_name "Serial Port"
44 | #define qtn_rfterm_service_description "RFterm application"
45 |
46 | // Dialogs
47 | #define qtn_str_text_query_label "Send:"
48 | #define qtn_str_ignoresym_confirmation "Next symbols are not supported by code page and will be ignored:\n%S\nDo you wisht to continue?"
49 | #define qtn_str_history_query_label "Message History"
50 | #define qtn_str_ctrlchar_query_label "Control Characters"
51 | #define qtn_str_ctrlchar_custom "Custom..."
52 | #define qtn_str_int_query_label "Byte (0-255)"
53 | #define qtn_str_signal_query_label "RS-232 signals"
54 |
55 | // Settings
56 | #define qtn_str_settings_input_label "Input"
57 |
58 | #define qtn_str_setting_appendix_label "Append to message"
59 | #define qtn_str_setting_appendix_item0 "CARRIAGE RETURN"
60 | #define qtn_str_setting_appendix_item1 "LINE FEED"
61 | #define qtn_str_setting_appendix_item2 "CR+LF"
62 | #define qtn_str_setting_appendix_item3 "Nothing"
63 |
64 | #define qtn_str_setting_historysize_label "Message history size"
65 |
66 | #define qtn_str_setting_echo_label "Output sent message (echo)"
67 | #define qtn_str_setting_no_label "No"
68 | #define qtn_str_setting_yes_label "Yes"
69 |
70 |
71 | #define qtn_str_settings_output_label "Output"
72 |
73 | #define qtn_str_setting_fontsize_label "Font size"
74 |
75 | #define qtn_str_setting_tabsize_label "Tab size"
76 |
77 | #define qtn_str_setting_font_antialiasing_label "Smooth font"
78 |
79 | #define qtn_str_setting_wrap_text_label "Wrap text"
80 |
81 | #define qtn_str_setting_mapping_label "Control char mapping"
82 | #define qtn_str_setting_mapping_item0 "CR -> LF"
83 | #define qtn_str_setting_mapping_item1 "CR -> CR+LF"
84 | #define qtn_str_setting_mapping_item2 "LF -> CR"
85 | #define qtn_str_setting_mapping_item3 "LF -> CR+LF"
86 | #define qtn_str_setting_mapping_item4 "None"
87 |
88 | #define qtn_str_setting_codepage_label "Code page"
89 | #define qtn_str_setting_codepage_item0 "ISO 8859-1 (Latin-1)"
90 | #define qtn_str_setting_codepage_item1 "ISO 8859-2 (Latin-2)"
91 | #define qtn_str_setting_codepage_item2 "ISO 8859-3 (Latin-3)"
92 | #define qtn_str_setting_codepage_item3 "ISO 8859-4 (Latin-4)"
93 | #define qtn_str_setting_codepage_item4 "ISO 8859-5 (Latin/Cyrillic)"
94 | #define qtn_str_setting_codepage_item5 "CP 1251 (Cyrillic)"
95 | #define qtn_str_setting_codepage_item6 "CP 1252 (Latin-1)"
96 | #define qtn_str_setting_codepage_item7 "KOI-8"
97 |
98 | #define qtn_str_setting_save_notifies_label "Save notifies"
99 |
100 |
101 | #define qtn_str_settings_colors_label "Colors"
102 |
103 | #define qtn_str_setting_color_bg_label "Background"
104 | #define qtn_str_setting_color_font_label "Text"
105 | #define qtn_str_setting_color_cursor_label "Cursor"
106 | #define qtn_str_setting_color_sb_label "Scrollbars"
107 |
108 | // RS-232 Signals
109 | #define qtn_str_signal_input "input"
110 | #define qtn_str_signal_output "output"
111 |
112 | // Messages
113 | #define qtn_str_disconnected "Disconnected"
114 | #define qtn_str_disconnect_complete "Disconnect complete"
115 | #define qtn_str_connected "Connected"
116 | #define qtn_str_found_service "Found service"
117 | #define qtn_str_client_busy "Client busy"
118 | #define qtn_str_releasing_conn "Releasing connection"
119 | #define qtn_str_connecting "Connecting to service"
120 | #define qtn_str_waiting_conn "Waiting connection"
121 | #define qtn_str_port_number "Channel %N"
122 | #define qtn_str_bell "RFterm: BELL"
123 | #define qtn_str_output_is_saved "Output has been saved."
124 | #define qtn_str_file_is_sent "File has been sent."
125 | //#define qtn_str_
126 |
127 | #define qtn_err_no_bt "Bluetooth unavailable."
128 | #define qtn_err_no_device_selected "No device selected"
129 | #define qtn_err_cant_get_device_list "Can't get device list"
130 | #define qtn_err_connection_error "Connection error"
131 | #define qtn_err_lost_connection "Lost connection"
132 | #define qtn_err_message_failed "Message Failed"
133 | #define qtn_err_file_sending_failed "File sending Failed"
134 | #define qtn_err_failed_to_disconnect "Failed to disconnect"
135 | #define qtn_err_no_conn "No connection!"
136 | #define qtn_err_nrrc_error "NRRC error %N"
137 | #define qtn_err_nrrc_no_records "NRRC No records"
138 | #define qtn_err_cant_get_attribute "Can't get attribute %N"
139 | #define qtn_err_attr_req_com "AttrReqCom"
140 | #define qtn_err_registry "Unknown device"
141 | #define qtn_err_file_opening "File opening error"
142 | //#define qtn_err_
143 |
144 | // End of File
145 |
--------------------------------------------------------------------------------
/data/RFterm.l04:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFterm.l04
4 | Author : huhungahuru
5 | Copyright : GPLv3
6 | Description : This is a localisation file for RFterm (SP).
7 | ============================================================================
8 | */
9 |
10 | CHARACTER_SET UTF8
11 |
12 | // LOCALISATION STRINGS
13 |
14 | // Caption string for app.
15 | #define qtn_caption_string "RFterm"
16 |
17 | // Items in "Opciones" menu pane
18 | #define qtn_connect "Conectar"
19 | #define qtn_disconnect "Desconectar"
20 |
21 | #define qtn_start "Iniciar"
22 | #define qtn_stop "Detener"
23 |
24 | #define qtn_send "Enviar"
25 | #define qtn_send_message "Nuevo mensaje"
26 | #define qtn_send_history "Mensajes enviados"
27 | #define qtn_send_ctrl_char "Caracteres de control"
28 | #define qtn_send_signal "Señales"
29 | #define qtn_send_file "Archivos"
30 |
31 | #define qtn_clear "Limpiar terminal"
32 |
33 | #define qtn_save "Guardar registro"
34 |
35 | #define qtn_settings "Configurac."
36 |
37 | #define qtn_help "Ayuda"
38 |
39 | #define qtn_exit "Salir"
40 |
41 | // Navigation pane
42 | #define qtn_str_navi_disconnected "desconectado"
43 |
44 | // Bluetooth
45 | #define qtn_rfterm_service_name "Puerto Serial"
46 | #define qtn_rfterm_service_description "Aplicación RFterm"
47 |
48 | // Dialogs
49 | #define qtn_str_text_query_label "Enviar:"
50 | #define qtn_str_ignoresym_confirmation "Estos símbolos no son compatibles con la página de código y se ignorarán:\n%S\n¿Desea continuar?"
51 | #define qtn_str_history_query_label "Historial de mensajes:"
52 | #define qtn_str_ctrlchar_query_label "Caracteres de control:"
53 | #define qtn_str_ctrlchar_custom "Agregar..."
54 | #define qtn_str_int_query_label "Byte (0-255)"
55 | #define qtn_str_signal_query_label "Señales RS-232:"
56 |
57 | // Settings
58 | #define qtn_str_settings_input_label "Entrada"
59 |
60 | #define qtn_str_setting_appendix_label "Anexar al mensaje"
61 | #define qtn_str_setting_appendix_item0 "CARRIAGE RETURN"
62 | #define qtn_str_setting_appendix_item1 "LINE FEED"
63 | #define qtn_str_setting_appendix_item2 "CR+LF"
64 | #define qtn_str_setting_appendix_item3 "Ninguno"
65 |
66 | #define qtn_str_setting_historysize_label "Tamaño del historial de mensajes"
67 |
68 | #define qtn_str_setting_echo_label "Mensaje enviado (repetir)"
69 | #define qtn_str_setting_no_label "No"
70 | #define qtn_str_setting_yes_label "Sí"
71 |
72 |
73 | #define qtn_str_settings_output_label "Salida"
74 |
75 | #define qtn_str_setting_fontsize_label "Tamaño de la fuente"
76 |
77 | #define qtn_str_setting_tabsize_label "Tamaño de la pestaña"
78 |
79 | #define qtn_str_setting_font_antialiasing_label "Suavizado de la fuente"
80 |
81 | #define qtn_str_setting_wrap_text_label "Ajustar texto"
82 |
83 | #define qtn_str_setting_mapping_label "Control de mapeo de caracteres"
84 | #define qtn_str_setting_mapping_item0 "CR -> LF"
85 | #define qtn_str_setting_mapping_item1 "CR -> CR+LF"
86 | #define qtn_str_setting_mapping_item2 "LF -> CR"
87 | #define qtn_str_setting_mapping_item3 "LF -> CR+LF"
88 | #define qtn_str_setting_mapping_item4 "Ninguno"
89 |
90 | #define qtn_str_setting_codepage_label "Codificación"
91 | #define qtn_str_setting_codepage_item0 "ISO 8859-1 (Latin-1)"
92 | #define qtn_str_setting_codepage_item1 "ISO 8859-2 (Latin-2)"
93 | #define qtn_str_setting_codepage_item2 "ISO 8859-3 (Latin-3)"
94 | #define qtn_str_setting_codepage_item3 "ISO 8859-4 (Latin-4)"
95 | #define qtn_str_setting_codepage_item4 "ISO 8859-5 (Latin/Cyrillic)"
96 | #define qtn_str_setting_codepage_item5 "CP 1251 (Cyrillic)"
97 | #define qtn_str_setting_codepage_item6 "CP 1252 (Latin-1)"
98 | #define qtn_str_setting_codepage_item7 "KOI-8"
99 |
100 | #define qtn_str_setting_save_notifies_label "Guardar notificaciones"
101 |
102 |
103 | #define qtn_str_settings_colors_label "Colores"
104 |
105 | #define qtn_str_setting_color_bg_label "Fondo de pantalla"
106 | #define qtn_str_setting_color_font_label "Texto"
107 | #define qtn_str_setting_color_cursor_label "Cursor"
108 | #define qtn_str_setting_color_sb_label "Barra de desplazamiento"
109 |
110 | // RS-232 Signals
111 | #define qtn_str_signal_input "entrada"
112 | #define qtn_str_signal_output "salida"
113 |
114 | // Messages
115 | #define qtn_str_disconnected "Desconectado"
116 | #define qtn_str_disconnect_complete "Desconexión completa"
117 | #define qtn_str_connected "Conectado"
118 | #define qtn_str_found_service "Servicio encontrado"
119 | #define qtn_str_client_busy "Cliente ocupado"
120 | #define qtn_str_releasing_conn "Realizando conexión"
121 | #define qtn_str_connecting "Conectando al servicio..."
122 | #define qtn_str_waiting_conn "Desvinculando"
123 | #define qtn_str_port_number "Canal %N"
124 | #define qtn_str_bell "RFterm: Alerta"
125 | #define qtn_str_output_is_saved "Registro guardado."
126 | #define qtn_str_file_is_sent "Archivo enviado."
127 | //#define qtn_str_
128 |
129 | #define qtn_err_no_bt "Bluetooth no disponible."
130 | #define qtn_err_no_device_selected "Dispositivo no seleccionado"
131 | #define qtn_err_cant_get_device_list "No hay lista de dispositivos"
132 | #define qtn_err_connection_error "Error de conexión"
133 | #define qtn_err_lost_connection "Conexión perdida"
134 | #define qtn_err_message_failed "Error al enviar mensaje"
135 | #define qtn_err_file_sending_failed "Error al enviar archivo"
136 | #define qtn_err_failed_to_disconnect "Error al desconectar"
137 | #define qtn_err_no_conn "¡Sin conexión!"
138 | #define qtn_err_nrrc_error "Error NRRC %N"
139 | #define qtn_err_nrrc_no_records "No hay registros NRRC"
140 | #define qtn_err_cant_get_attribute "No se puede obtener atributo %N"
141 | #define qtn_err_attr_req_com "AttrReqCom"
142 | #define qtn_err_registry "Dispositivo desconocido"
143 | #define qtn_err_file_opening "Error al abrir archivo"
144 | //#define qtn_err_
145 |
146 | // End of File
147 |
--------------------------------------------------------------------------------
/data/RFterm.l16:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFterm.l16
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : This is a localisation file for RFterm (RU).
7 | ============================================================================
8 | */
9 |
10 | CHARACTER_SET UTF8
11 |
12 | // LOCALISATION STRINGS
13 |
14 | // Caption string for app.
15 | #define qtn_caption_string "RFterm"
16 |
17 | // Items in "Options" menu pane
18 | #define qtn_connect "Подключиться"
19 | #define qtn_disconnect "Отключиться"
20 |
21 | #define qtn_start "Запустить"
22 | #define qtn_stop "Остановить"
23 |
24 | #define qtn_send "Отправить"
25 | #define qtn_send_message "Сообщение"
26 | #define qtn_send_history "Недавнее сообщение"
27 | #define qtn_send_ctrl_char "Управляющий символ"
28 | #define qtn_send_signal "Сигнал"
29 | #define qtn_send_file "Файл"
30 |
31 | #define qtn_clear "Очистить"
32 |
33 | #define qtn_save "Сохранить"
34 |
35 | #define qtn_settings "Настройки"
36 |
37 | #define qtn_help "Справка"
38 |
39 | #define qtn_exit "Выйти"
40 |
41 | // Navigation pane
42 | #define qtn_str_navi_disconnected "не подключён"
43 |
44 | // Bluetooth
45 | #define qtn_rfterm_service_name "Serial Port"
46 | #define qtn_rfterm_service_description "RFterm application"
47 |
48 | // Dialogs
49 | #define qtn_str_text_query_label "Отправить:"
50 | #define qtn_str_ignoresym_confirmation "Следующие символы не поддерживаются кодовой страницей и будут исключены:\n%S\nПродолжить?"
51 | #define qtn_str_history_query_label "История сообщений"
52 | #define qtn_str_ctrlchar_query_label "Управляющие символы"
53 | #define qtn_str_ctrlchar_custom "Другой..."
54 | #define qtn_str_int_query_label "Байт (0-255)"
55 | #define qtn_str_signal_query_label "Сигналы RS-232"
56 |
57 | // Settings
58 | #define qtn_str_settings_input_label "Ввод"
59 |
60 | #define qtn_str_setting_appendix_label "Добавить к сообщению"
61 | #define qtn_str_setting_appendix_item0 "CARRIAGE RETURN"
62 | #define qtn_str_setting_appendix_item1 "LINE FEED"
63 | #define qtn_str_setting_appendix_item2 "CR+LF"
64 | #define qtn_str_setting_appendix_item3 "Ничего"
65 |
66 | #define qtn_str_setting_historysize_label "Размер истории сообщ."
67 |
68 | #define qtn_str_setting_echo_label "Выводить отпр. сообщ. (эхо)"
69 | #define qtn_str_setting_no_label "Нет"
70 | #define qtn_str_setting_yes_label "Да"
71 |
72 |
73 | #define qtn_str_settings_output_label "Вывод"
74 |
75 | #define qtn_str_setting_fontsize_label "Размер шрифта"
76 |
77 | #define qtn_str_setting_tabsize_label "Размер табуляции"
78 |
79 | #define qtn_str_setting_font_antialiasing_label "Сглаживть шрифт"
80 |
81 | #define qtn_str_setting_wrap_text_label "Переносить текст"
82 |
83 | #define qtn_str_setting_mapping_label "Замена cимв. новой строки"
84 | #define qtn_str_setting_mapping_item0 "CR -> LF"
85 | #define qtn_str_setting_mapping_item1 "CR -> CR+LF"
86 | #define qtn_str_setting_mapping_item2 "LF -> CR"
87 | #define qtn_str_setting_mapping_item3 "LF -> CR+LF"
88 | #define qtn_str_setting_mapping_item4 "Не заменять"
89 |
90 | #define qtn_str_setting_codepage_label "Кодовая страница"
91 | #define qtn_str_setting_codepage_item0 "ISO 8859-1 (Latin-1)"
92 | #define qtn_str_setting_codepage_item1 "ISO 8859-2 (Latin-2)"
93 | #define qtn_str_setting_codepage_item2 "ISO 8859-3 (Latin-3)"
94 | #define qtn_str_setting_codepage_item3 "ISO 8859-4 (Latin-4)"
95 | #define qtn_str_setting_codepage_item4 "ISO 8859-5 (Latin/Cyrillic)"
96 | #define qtn_str_setting_codepage_item5 "CP 1251 (Cyrillic)"
97 | #define qtn_str_setting_codepage_item6 "CP 1252 (Latin-1)"
98 | #define qtn_str_setting_codepage_item7 "KOI-8"
99 |
100 | #define qtn_str_setting_save_notifies_label "Сохранять уведомления"
101 |
102 |
103 | #define qtn_str_settings_colors_label "Цвета"
104 |
105 | #define qtn_str_setting_color_bg_label "Фон"
106 | #define qtn_str_setting_color_font_label "Текст"
107 | #define qtn_str_setting_color_cursor_label "Курсор"
108 | #define qtn_str_setting_color_sb_label "Полосы прокрутки"
109 |
110 |
111 | // RS-232 Signals
112 | #define qtn_str_signal_input "вход"
113 | #define qtn_str_signal_output "выход"
114 |
115 | // Messages
116 | #define qtn_str_disconnected "Отключён"
117 | #define qtn_str_disconnect_complete "Отключение завершено"
118 | #define qtn_str_connected "Подключён"
119 | #define qtn_str_found_service "Сервис найден"
120 | #define qtn_str_client_busy "Клиент занят"
121 | #define qtn_str_releasing_conn "Освобождение соединения"
122 | #define qtn_str_connecting "Подключение к сервису"
123 | #define qtn_str_waiting_conn "Ожидание подключения"
124 | #define qtn_str_port_number "Канал %N"
125 | #define qtn_str_bell "RFterm: BELL"
126 | #define qtn_str_output_is_saved "Вывод сохранён."
127 | #define qtn_str_file_is_sent "Файл отправлен."
128 | //#define qtn_str_
129 |
130 | #define qtn_err_no_bt "Bluetooth недоступен."
131 | #define qtn_err_no_device_selected "Устройство не выбрано"
132 | #define qtn_err_cant_get_device_list "Не удалось получить список устройств"
133 | #define qtn_err_connection_error "Ошибка подключения"
134 | #define qtn_err_lost_connection "Соединение потеряно"
135 | #define qtn_err_message_failed "Сообщение не отправлено"
136 | #define qtn_err_file_sending_failed "Файл не отправлен"
137 | #define qtn_err_failed_to_disconnect "Не удалось отключиться"
138 | #define qtn_err_no_conn "Нет соединения!"
139 | #define qtn_err_nrrc_error "Ошибка NRRC %N"
140 | #define qtn_err_nrrc_no_records "Нет записей NRRC"
141 | #define qtn_err_cant_get_attribute "Не удалось получить атрибут %N"
142 | #define qtn_err_attr_req_com "AttrReqCom"
143 | #define qtn_err_registry "Неизвестное устройство"
144 | #define qtn_err_file_opening "Ошибка открытия файла"
145 | //#define qtn_err_
146 |
147 | // End of File
148 |
--------------------------------------------------------------------------------
/data/RFterm.l93:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFterm.l93
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : This is a localisation file for RFterm (UK).
7 | ============================================================================
8 | */
9 |
10 | CHARACTER_SET UTF8
11 |
12 | // LOCALISATION STRINGS
13 |
14 | // Caption string for app.
15 | #define qtn_caption_string "RFterm"
16 |
17 | // Items in "Options" menu pane
18 | #define qtn_connect "З'єднатись"
19 | #define qtn_disconnect "Від’єднатись"
20 |
21 | #define qtn_start "Запустити"
22 | #define qtn_stop "Зупинити"
23 |
24 | #define qtn_send "Надіслати"
25 | #define qtn_send_message "Повідомлення"
26 | #define qtn_send_history "Нещодавнє повідомлення"
27 | #define qtn_send_ctrl_char "Керівний символ"
28 | #define qtn_send_signal "Сигнал"
29 | #define qtn_send_file "Файл"
30 |
31 | #define qtn_clear "Очистити"
32 |
33 | #define qtn_save "Зберегти"
34 |
35 | #define qtn_settings "Налаштування"
36 |
37 | #define qtn_help "Довідка"
38 |
39 | #define qtn_exit "Вийти"
40 |
41 | // Navigation pane
42 | #define qtn_str_navi_disconnected "не підключений"
43 |
44 | // Bluetooth
45 | #define qtn_rfterm_service_name "Serial Port"
46 | #define qtn_rfterm_service_description "RFterm application"
47 |
48 | // Dialogs
49 | #define qtn_str_text_query_label "Надіслати:"
50 | #define qtn_str_ignoresym_confirmation "Наступні символи не підтримуються кодовою сторінкою та будуть вилучені:\n%S\nПродовжити?"
51 | #define qtn_str_history_query_label "Історія повідомлень"
52 | #define qtn_str_ctrlchar_query_label "Керівні символи"
53 | #define qtn_str_ctrlchar_custom "Інший..."
54 | #define qtn_str_int_query_label "Байт (0-255)"
55 | #define qtn_str_signal_query_label "Сигнали RS-232"
56 |
57 | // Settings
58 | #define qtn_str_settings_input_label "Ввід"
59 |
60 | #define qtn_str_setting_appendix_label "Додати до повідомлення"
61 | #define qtn_str_setting_appendix_item0 "CARRIAGE RETURN"
62 | #define qtn_str_setting_appendix_item1 "LINE FEED"
63 | #define qtn_str_setting_appendix_item2 "CR+LF"
64 | #define qtn_str_setting_appendix_item3 "Нічого"
65 |
66 | #define qtn_str_setting_historysize_label "Розмір історії повід."
67 |
68 | #define qtn_str_setting_echo_label "Виводити відпр. повід. (ехо)"
69 | #define qtn_str_setting_no_label "Ні"
70 | #define qtn_str_setting_yes_label "Так"
71 |
72 |
73 | #define qtn_str_settings_output_label "Вивід"
74 |
75 | #define qtn_str_setting_fontsize_label "Розмір шрифту"
76 |
77 | #define qtn_str_setting_tabsize_label "Розмір табуляції"
78 |
79 | #define qtn_str_setting_font_antialiasing_label "Згладжувати шрифт"
80 |
81 | #define qtn_str_setting_wrap_text_label "Переносити текст"
82 |
83 | #define qtn_str_setting_mapping_label "Заміна cимв. нового рядка"
84 | #define qtn_str_setting_mapping_item0 "CR -> LF"
85 | #define qtn_str_setting_mapping_item1 "CR -> CR+LF"
86 | #define qtn_str_setting_mapping_item2 "LF -> CR"
87 | #define qtn_str_setting_mapping_item3 "LF -> CR+LF"
88 | #define qtn_str_setting_mapping_item4 "Не замінювати"
89 |
90 | #define qtn_str_setting_codepage_label "Кодова сторінка"
91 | #define qtn_str_setting_codepage_item0 "ISO 8859-1 (Latin-1)"
92 | #define qtn_str_setting_codepage_item1 "ISO 8859-2 (Latin-2)"
93 | #define qtn_str_setting_codepage_item2 "ISO 8859-3 (Latin-3)"
94 | #define qtn_str_setting_codepage_item3 "ISO 8859-4 (Latin-4)"
95 | #define qtn_str_setting_codepage_item4 "ISO 8859-5 (Latin/Cyrillic)"
96 | #define qtn_str_setting_codepage_item5 "CP 1251 (Cyrillic)"
97 | #define qtn_str_setting_codepage_item6 "CP 1252 (Latin-1)"
98 | #define qtn_str_setting_codepage_item7 "KOI-8"
99 |
100 | #define qtn_str_setting_save_notifies_label "Зберігати сповіщення"
101 |
102 |
103 | #define qtn_str_settings_colors_label "Кольори"<0x0001>"Колір"
104 |
105 | #define qtn_str_setting_color_bg_label "Фон"
106 | #define qtn_str_setting_color_font_label "Текст"
107 | #define qtn_str_setting_color_cursor_label "Курсор"
108 | #define qtn_str_setting_color_sb_label "Смуги прокрутки"
109 |
110 | // RS-232 Signals
111 | #define qtn_str_signal_input "вхід"
112 | #define qtn_str_signal_output "вихід"
113 |
114 | // Messages
115 | #define qtn_str_disconnected "Роз’єднаний"
116 | #define qtn_str_disconnect_complete "Від’єднання завершено"
117 | #define qtn_str_connected "З’єднаний"
118 | #define qtn_str_found_service "Сервіс знайдено"
119 | #define qtn_str_client_busy "Клієнт зайнятий"
120 | #define qtn_str_releasing_conn "Звільнення з’єднання"
121 | #define qtn_str_connecting "З’єднання з сервісом"
122 | #define qtn_str_waiting_conn "Очікування під’єднання"
123 | #define qtn_str_port_number "Канал %N"
124 | #define qtn_str_bell "RFterm: BELL"
125 | #define qtn_str_output_is_saved "Вивід збережено."
126 | #define qtn_str_file_is_sent "Файл надіслано."
127 | //#define qtn_str_
128 |
129 | #define qtn_err_no_bt "Bluetooth недоступний."
130 | #define qtn_err_no_device_selected "Пристрій не обрано"
131 | #define qtn_err_cant_get_device_list "Не вдалось отримати список пристроїв"
132 | #define qtn_err_connection_error "Помилка з’єднання"
133 | #define qtn_err_lost_connection "З’єднання втрачено"
134 | #define qtn_err_message_failed "Повідомлення не відправлено"
135 | #define qtn_err_file_sending_failed "Файл не відправлено"
136 | #define qtn_err_failed_to_disconnect "Не вдалось від’єднатись"
137 | #define qtn_err_no_conn "Немає з’єднання!"
138 | #define qtn_err_nrrc_error "Помилка NRRC %N"
139 | #define qtn_err_nrrc_no_records "Немає записів NRRC"
140 | #define qtn_err_cant_get_attribute "Не вдалось отримати атрибут %N"
141 | #define qtn_err_attr_req_com "AttrReqCom"
142 | #define qtn_err_registry "Невідомий пристрій"
143 | #define qtn_err_file_opening "Помилка відкриття файлу"
144 | //#define qtn_err_
145 |
146 | // End of File
147 |
--------------------------------------------------------------------------------
/data/RFterm.loc:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFterm.loc
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : This is a localisation file for RFterm.
7 | ============================================================================
8 | */
9 | #ifndef __RFTERM_LOC__
10 | #define __RFTERM_LOC__
11 |
12 | // Other resources
13 | #define qtn_loc_resource_file "\\resource\\apps\\RFterm_0xae7f53fa"
14 |
15 | #ifdef LANGUAGE_01
16 | #include "RFterm.l01"
17 | #elif LANGUAGE_04
18 | #include "RFterm.l04"
19 | #elif LANGUAGE_16
20 | #include "RFterm.l16"
21 | #elif LANGUAGE_93
22 | #include "RFterm.l93"
23 | #else
24 | #include "RFterm.l01" // default
25 | #endif
26 |
27 | #endif /* __RFTERM_LOC__ */
28 |
--------------------------------------------------------------------------------
/data/RFterm_reg.rss:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFterm.rss
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : This file contains the application registration resource.
7 | ============================================================================
8 | */
9 |
10 | #include "RFterm.hrh"
11 | #include "RFterm.loc"
12 | #include
13 | #include
14 |
15 | UID2 KUidAppRegistrationResourceFile
16 | UID3 _UID3
17 |
18 | RESOURCE APP_REGISTRATION_INFO
19 | {
20 | app_file="RFterm_0xae7f53fa";
21 | localisable_resource_file = qtn_loc_resource_file;
22 | localisable_resource_id = R_LOCALISABLE_APP_INFO;
23 |
24 | embeddability=KAppNotEmbeddable;
25 | newfile=KAppDoesNotSupportNewFile;
26 | }
27 |
28 |
--------------------------------------------------------------------------------
/data/fontnote_EN.txt:
--------------------------------------------------------------------------------
1 | It is highly recommended to reboot the device to be sure the installed font is loaded properly.
--------------------------------------------------------------------------------
/data/fontnote_RU.txt:
--------------------------------------------------------------------------------
1 | Настоятельно рекомендуется перезагрузить устройство чтобы быть уверенным, что установленный шрифт будет загружен верно.
--------------------------------------------------------------------------------
/data/fontnote_SP.txt:
--------------------------------------------------------------------------------
1 | Reinicie el teléfono para que la aplicación funcione correctamente.
2 |
--------------------------------------------------------------------------------
/data/fontnote_UK.txt:
--------------------------------------------------------------------------------
1 | Наполегливо рекомендується перезавантажити пристрій щоб бути впевненим, що встановлений шрифт буде завантажено вірно.
--------------------------------------------------------------------------------
/gfx/qgn_menu_RFterm.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
23 |
--------------------------------------------------------------------------------
/gfx/rfterm_promo_en.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/baranovskiykonstantin/rfterm/de06afbcfd477bc84b4090a4a21683a5f4334174/gfx/rfterm_promo_en.gif
--------------------------------------------------------------------------------
/gfx/rfterm_promo_ru.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/baranovskiykonstantin/rfterm/de06afbcfd477bc84b4090a4a21683a5f4334174/gfx/rfterm_promo_ru.gif
--------------------------------------------------------------------------------
/gfx/signal_off.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
--------------------------------------------------------------------------------
/gfx/signal_on.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
--------------------------------------------------------------------------------
/group/Icons_scalable_dc.mk:
--------------------------------------------------------------------------------
1 | # ============================================================================
2 | # Name : Icons_scalable_dc.mk
3 | # Part of : RFterm
4 | #
5 | # Description: This is file for creating .mif file (scalable icon)
6 | #
7 | # ============================================================================
8 |
9 |
10 | ifeq (WINS,$(findstring WINS, $(PLATFORM)))
11 | ZDIR=$(EPOCROOT)epoc32\release\$(PLATFORM)\$(CFG)\Z
12 | else
13 | ZDIR=$(EPOCROOT)epoc32\data\z
14 | endif
15 |
16 | TARGETDIR=$(ZDIR)\resource\apps
17 | ICONTARGETFILENAME=$(TARGETDIR)\RFterm_0xae7f53fa.mif
18 |
19 | HEADERDIR=$(EPOCROOT)epoc32\include
20 | HEADERFILENAME=$(HEADERDIR)\RFterm_0xae7f53fa.mbg
21 |
22 | ICONDIR=..\gfx
23 |
24 | do_nothing :
25 | @rem do_nothing
26 |
27 | MAKMAKE : do_nothing
28 |
29 | BLD : do_nothing
30 |
31 | CLEAN :
32 | @echo ...Deleting $(ICONTARGETFILENAME)
33 | del /q /f $(ICONTARGETFILENAME)
34 | @echo ...Deleting $(HEADERFILENAME)
35 | del /q /f $(HEADERFILENAME)
36 |
37 | LIB : do_nothing
38 |
39 | CLEANLIB : do_nothing
40 |
41 | # ----------------------------------------------------------------------------
42 | # NOTE: if you have JUSTINTIME enabled for your S60 3rd FP1 or newer SDK
43 | # and this command crashes, consider adding "/X" to the command line.
44 | # See
45 | # ----------------------------------------------------------------------------
46 |
47 | RESOURCE : $(ICONTARGETFILENAME)
48 |
49 | # Animated flag ( /A ) must be set otherwise the icon will be shown a bit smaller!
50 | $(ICONTARGETFILENAME) : $(ICONDIR)\qgn_menu_RFterm.svg
51 | mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \
52 | /A /c32 $(ICONDIR)\qgn_menu_RFterm.svg \
53 | /c32,8 $(ICONDIR)\signal_off.svg \
54 | /c32,8 $(ICONDIR)\signal_on.svg
55 |
56 | FREEZE : do_nothing
57 |
58 | SAVESPACE : do_nothing
59 |
60 | RELEASABLES :
61 | @echo $(HEADERFILENAME)&& \
62 | @echo $(ICONTARGETFILENAME)
63 |
64 | FINAL : do_nothing
65 |
66 |
--------------------------------------------------------------------------------
/group/RFterm.mmp:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFterm.mmp
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : This is the project specification file for RFterm.
7 | ============================================================================
8 | */
9 | #include "blddef.h"
10 |
11 | MACRO _HELP_AVAILABLE_
12 |
13 | TARGET RFterm_0xae7f53fa.exe
14 | TARGETTYPE exe
15 | UID 0x100039CE 0xae7f53fa
16 |
17 | SOURCEPATH ..\src
18 | SOURCE BatteryLevel.cpp
19 | SOURCE ChargingStatus.cpp
20 | SOURCE RFterm.cpp
21 | SOURCE RFtermAppUi.cpp
22 | SOURCE RFtermAppView.cpp
23 | SOURCE RFtermApplication.cpp
24 | SOURCE RFtermBatteryStatus.cpp
25 | SOURCE RFtermBt.cpp
26 | SOURCE RFtermBtServiceAdvertiser.cpp
27 | SOURCE RFtermBtServiceSearcher.cpp
28 | SOURCE RFtermDocument.cpp
29 | SOURCE RFtermOutput.cpp
30 | SOURCE RFtermScrollBars.cpp
31 | SOURCE RFtermSdpAttributeParser.cpp
32 | SOURCE RFtermSettings.cpp
33 | SOURCE RFtermSettingsDialog.cpp
34 | SOURCE RFtermSignalQueryDialog.cpp
35 | SOURCE RFtermTextQueryDialog.cpp
36 | SOURCE ColorControl.cpp
37 |
38 | SOURCEPATH ..\data
39 |
40 | START RESOURCE RFterm.rss
41 | HEADER
42 | TARGET RFterm_0xae7f53fa
43 | TARGETPATH resource\apps
44 | END //RESOURCE
45 |
46 | START RESOURCE RFterm_reg.rss
47 | TARGET RFterm_0xae7f53fa_reg
48 | TARGETPATH \private\10003a3f\apps
49 | END //RESOURCE
50 |
51 | USERINCLUDE ..\inc
52 | USERINCLUDE ..\help\out
53 |
54 | SYSTEMINCLUDE /epoc32/include
55 |
56 | LIBRARY aknicon.lib
57 | LIBRARY aknnotify.lib
58 | LIBRARY apparc.lib
59 | LIBRARY avkon.lib
60 | LIBRARY bafl.lib
61 | LIBRARY bluetooth.lib
62 | LIBRARY btdevice.lib
63 | LIBRARY btextnotifiers.lib
64 | LIBRARY charconv.lib
65 | LIBRARY commondialogs.lib
66 | LIBRARY commonengine.lib
67 | LIBRARY cone.lib
68 | LIBRARY efsrv.lib
69 | LIBRARY egul.lib
70 | LIBRARY eikcoctl.lib
71 | LIBRARY eikcore.lib
72 | LIBRARY eikctl.lib
73 | LIBRARY eikdlg.lib
74 | LIBRARY esock.lib
75 | LIBRARY estor.lib
76 | LIBRARY etext.lib
77 | LIBRARY euser.lib
78 | LIBRARY form.lib
79 | LIBRARY gdi.lib
80 | LIBRARY hlplch.lib
81 | LIBRARY sdpagent.lib
82 | LIBRARY sdpdatabase.lib
83 | LIBRARY uiklaf.lib
84 | LIBRARY ws32.lib
85 | #if defined(__S60v5__)
86 | LIBRARY touchfeedback.lib
87 | #endif
88 | LIBRARY aknskins.lib
89 | LIBRARY aknskinsrv.lib
90 | LIBRARY aknswallpaperutils.lib
91 |
92 | LANG 01 04 16 93
93 |
94 | VENDORID 0
95 | SECUREID 0xae7f53fa
96 | CAPABILITY ReadUserData LocalServices
97 |
98 | EPOCSTACKSIZE 0x5000
99 |
100 | #if defined(__S60v5__)
101 | DEBUGGABLE_UDEBONLY
102 | #endif
103 |
104 | // End of File
105 |
--------------------------------------------------------------------------------
/group/bld.inf:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : bld.inf
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : This file provides the information required for building the
7 | whole of a RFterm.
8 | ============================================================================
9 | */
10 |
11 | PRJ_PLATFORMS
12 | WINSCW ARMV5 GCCE
13 |
14 |
15 | #ifdef SBSV2
16 |
17 | PRJ_EXTENSIONS
18 |
19 | START EXTENSION s60/mifconv
20 | OPTION TARGETFILE rfterm_0xae7f53fa.mif
21 | OPTION HEADERFILE rfterm_0xae7f53fa.mbg
22 | OPTION SOURCEDIR ../gfx
23 | OPTION SOURCES -c32 qgn_menu_RFterm
24 | END
25 |
26 | // help compiler is not always available; see similar comment in *.pkg file
27 | START EXTENSION techview/bldhelp
28 | OPTION HELPPROJECTFILE RFterm.cshlp
29 | OPTION HELPTOOLTARGETNAME rfterm_0xae7f53fa.hlp
30 | END
31 |
32 | #else
33 |
34 | PRJ_MMPFILES
35 |
36 | gnumakefile icons_scalable_dc.mk
37 |
38 | // help compiler is not always available; see similar comment in *.pkg file
39 | gnumakefile ../help/build_help.mk
40 |
41 | #endif
42 |
43 | PRJ_MMPFILES
44 |
45 | RFterm.mmp
46 | cpfont.mmp
47 |
--------------------------------------------------------------------------------
/group/cpfont.mmp:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFterm.mmp
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : This is the project specification file for cpfont.
7 | ============================================================================
8 | */
9 |
10 | TARGET cpfont_0xaa40a41a.exe
11 | TARGETTYPE exe
12 | UID 0x0 0xaa40a81a
13 |
14 | SOURCEPATH ..\src
15 | SOURCE cpfont.cpp
16 |
17 | USERINCLUDE ..\inc
18 | SYSTEMINCLUDE \epoc32\include
19 |
20 | LIBRARY euser.lib efsrv.lib
21 |
22 | CAPABILITY Tcb
--------------------------------------------------------------------------------
/help/Custom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/help/RFterm_01.cshlp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 0xae7f53fa
6 |
7 | src\
8 |
9 |
10 | temp\
11 |
12 |
13 |
14 | RFterm_01.rtf
15 |
16 | RFterm_0xae7f53fa.h01
17 | Custom.xml
18 |
19 |
20 |
--------------------------------------------------------------------------------
/help/RFterm_04.cshlp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 0xae7f53fa
6 |
7 | src\
8 |
9 |
10 | temp\
11 |
12 |
13 |
14 | RFterm_04.rtf
15 |
16 | RFterm_0xae7f53fa.h04
17 | Custom.xml
18 |
19 |
20 |
--------------------------------------------------------------------------------
/help/RFterm_16.cshlp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 0xae7f53fa
6 |
7 | src\
8 |
9 |
10 | temp\
11 |
12 |
13 |
14 | RFterm_16.rtf
15 |
16 | RFterm_0xae7f53fa.h16
17 | Custom.xml
18 |
19 |
20 |
--------------------------------------------------------------------------------
/help/RFterm_93.cshlp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 0xae7f53fa
6 |
7 | src\
8 |
9 |
10 | temp\
11 |
12 |
13 |
14 | RFterm_93.rtf
15 |
16 | RFterm_0xae7f53fa.h93
17 | Custom.xml
18 |
19 |
20 |
--------------------------------------------------------------------------------
/help/build_help.mk:
--------------------------------------------------------------------------------
1 | # ============================================================================
2 | # Name : build_help.mk
3 | # Part of : RFterm
4 | # ============================================================================
5 | # Name : build_help.mk
6 | # Part of : RFterm
7 | #
8 | # Description: This make file will build the application help file (.hlp)
9 | #
10 | # ============================================================================
11 |
12 | do_nothing :
13 | @rem do_nothing
14 |
15 | # build the help from the MAKMAKE step so the header file generated
16 | # will be found by cpp.exe when calculating the dependency information
17 | # in the mmp makefiles.
18 |
19 | MAKMAKE :
20 | cshlpcmp.bat RFterm_01.cshlp
21 | cshlpcmp.bat RFterm_04.cshlp
22 | cshlpcmp.bat RFterm_16.cshlp
23 | cshlpcmp.bat RFterm_93.cshlp
24 | ifeq (WINSCW,$(findstring WINSCW, $(PLATFORM)))
25 | md $(EPOCROOT)epoc32\$(PLATFORM)\c\resource\help & \
26 | copy out\RFterm_0xae7f53fa.h01 $(EPOCROOT)epoc32\$(PLATFORM)\c\resource\help & \
27 | copy out\RFterm_0xae7f53fa.h04 $(EPOCROOT)epoc32\$(PLATFORM)\c\resource\help & \
28 | copy out\RFterm_0xae7f53fa.h16 $(EPOCROOT)epoc32\$(PLATFORM)\c\resource\help & \
29 | copy out\RFterm_0xae7f53fa.h93 $(EPOCROOT)epoc32\$(PLATFORM)\c\resource\help
30 | endif
31 |
32 | BLD : do_nothing
33 |
34 | CLEAN :
35 | del out\RFterm_0xae7f53fa.h01
36 | del out\RFterm_0xae7f53fa.h01.hrh
37 | del out\RFterm_0xae7f53fa.h04
38 | del out\RFterm_0xae7f53fa.h04.hrh
39 | del out\RFterm_0xae7f53fa.h16
40 | del out\RFterm_0xae7f53fa.h16.hrh
41 | del out\RFterm_0xae7f53fa.h93
42 | del out\RFterm_0xae7f53fa.h93.hrh
43 |
44 | LIB : do_nothing
45 |
46 | CLEANLIB : do_nothing
47 |
48 | RESOURCE : do_nothing
49 |
50 | FREEZE : do_nothing
51 |
52 | SAVESPACE : do_nothing
53 |
54 | RELEASABLES :
55 | @echo RFterm_0xae7f53fa.h01
56 | @echo RFterm_0xae7f53fa.h04
57 | @echo RFterm_0xae7f53fa.h16
58 | @echo RFterm_0xae7f53fa.h93
59 |
60 | FINAL : do_nothing
61 |
--------------------------------------------------------------------------------
/help/out/RFterm_0xae7f53fa.h01:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/baranovskiykonstantin/rfterm/de06afbcfd477bc84b4090a4a21683a5f4334174/help/out/RFterm_0xae7f53fa.h01
--------------------------------------------------------------------------------
/help/out/RFterm_0xae7f53fa.h01.hrh:
--------------------------------------------------------------------------------
1 | //
2 | // RFterm_0xae7f53fa.h01.hrh
3 | //
4 |
5 | //
6 | // File generated by cshlpcmp Version 011
7 | //
8 |
9 | #ifndef __RFTERM_0XAE7F53FA_H01_HRH__
10 | #define __RFTERM_0XAE7F53FA_H01_HRH__
11 |
12 |
13 | _LIT(KAbout,"About");
14 |
15 | #endif
16 |
--------------------------------------------------------------------------------
/help/out/RFterm_0xae7f53fa.h04:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/baranovskiykonstantin/rfterm/de06afbcfd477bc84b4090a4a21683a5f4334174/help/out/RFterm_0xae7f53fa.h04
--------------------------------------------------------------------------------
/help/out/RFterm_0xae7f53fa.h04.hrh:
--------------------------------------------------------------------------------
1 | //
2 | // RFterm_0xae7f53fa.h04.hrh
3 | //
4 |
5 | //
6 | // File generated by cshlpcmp Version 011
7 | //
8 |
9 | #ifndef __RFTERM_0XAE7F53FA_H04_HRH__
10 | #define __RFTERM_0XAE7F53FA_H04_HRH__
11 |
12 |
13 | _LIT(KAbout,"About");
14 |
15 | #endif
16 |
--------------------------------------------------------------------------------
/help/out/RFterm_0xae7f53fa.h16:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/baranovskiykonstantin/rfterm/de06afbcfd477bc84b4090a4a21683a5f4334174/help/out/RFterm_0xae7f53fa.h16
--------------------------------------------------------------------------------
/help/out/RFterm_0xae7f53fa.h16.hrh:
--------------------------------------------------------------------------------
1 | //
2 | // RFterm_0xae7f53fa.h16.hrh
3 | //
4 |
5 | //
6 | // File generated by cshlpcmp Version 011
7 | //
8 |
9 | #ifndef __RFTERM_0XAE7F53FA_H16_HRH__
10 | #define __RFTERM_0XAE7F53FA_H16_HRH__
11 |
12 |
13 | _LIT(KAbout,"About");
14 |
15 | #endif
16 |
--------------------------------------------------------------------------------
/help/out/RFterm_0xae7f53fa.h93:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/baranovskiykonstantin/rfterm/de06afbcfd477bc84b4090a4a21683a5f4334174/help/out/RFterm_0xae7f53fa.h93
--------------------------------------------------------------------------------
/help/out/RFterm_0xae7f53fa.h93.hrh:
--------------------------------------------------------------------------------
1 | //
2 | // RFterm_0xae7f53fa.h93.hrh
3 | //
4 |
5 | //
6 | // File generated by cshlpcmp Version 011
7 | //
8 |
9 | #ifndef __RFTERM_0XAE7F53FA_H93_HRH__
10 | #define __RFTERM_0XAE7F53FA_H93_HRH__
11 |
12 |
13 | _LIT(KAbout,"About");
14 |
15 | #endif
16 |
--------------------------------------------------------------------------------
/inc/BatteryLevel.h:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : BatteryLevel.h
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Battery level notifier.
7 | ============================================================================
8 | */
9 |
10 | #ifndef __BATTERYLEVEL_H__
11 | #define __BATTERYLEVEL_H__
12 |
13 | #include
14 | #include
15 | #include
16 |
17 | /**
18 | * MBatteryLevelObserver mixin.
19 | * Handles the battery level change.
20 | */
21 | class MBatteryLevelObserver
22 | {
23 |
24 | public:
25 |
26 | /**
27 | * HandleBatteryLevelChangeL()
28 | * Battery level change notify.
29 | *
30 | * Derived classes provide the implementation.
31 | *
32 | * @param aBatteryLevel Contains the new level of the battery.
33 | */
34 | virtual void HandleBatteryLevelChangeL(EPSHWRMBatteryLevel aBatteryLevel) = 0;
35 |
36 | };
37 |
38 | /**
39 | * CBatteryLevel
40 | * Checks the battery level and sends the notification of battery level change
41 | * to MBatteryLevelObserver.
42 | */
43 | class CBatteryLevel : public CActive
44 | {
45 |
46 | public: // Constructors and destructor
47 |
48 | static CBatteryLevel* NewL(MBatteryLevelObserver* aObserver);
49 | virtual ~CBatteryLevel();
50 |
51 | private: // Constructors
52 |
53 | CBatteryLevel(MBatteryLevelObserver* aObserver);
54 | void ConstructL();
55 |
56 | private: // From CActive
57 |
58 | void RunL();
59 | void DoCancel();
60 |
61 | private: // Data
62 |
63 | /**
64 | * iProperty
65 | * Reflects level of the battery.
66 | */
67 | RProperty iProperty;
68 |
69 | /**
70 | * iBatteryLevelObserver
71 | * Handles the battery level change.
72 | * Non-owning pointer.
73 | */
74 | MBatteryLevelObserver* iBatteryLevelObserver;
75 |
76 | };
77 |
78 | #endif /* __BATTERYLEVEL_H__ */
79 |
80 | // End of File
81 |
--------------------------------------------------------------------------------
/inc/ChargingStatus.h:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : ChargingStatus.h
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Charging status notifier.
7 | ============================================================================
8 | */
9 |
10 | #ifndef __CHARGINGSTATUS_H__
11 | #define __CHARGINGSTATUS_H__
12 |
13 | #include
14 | #include
15 | #include
16 |
17 | /**
18 | * MChargingStatusObserver mixin.
19 | * Handles the charging status change.
20 | */
21 | class MChargingStatusObserver
22 | {
23 |
24 | public:
25 |
26 | /**
27 | * HandleChargingStatusChangeL()
28 | * Charging status change notify.
29 | *
30 | * Derived classes provide the implementation.
31 | *
32 | * @param aChargingStatus Contains the new status of the charging.
33 | */
34 | virtual void HandleChargingStatusChangeL(EPSHWRMChargingStatus aChargingStatus) = 0;
35 |
36 | };
37 |
38 | /**
39 | * CChargingStatus
40 | * Checks the charging status and sends the notification of charging status change
41 | * to MChargingStatusObserver.
42 | */
43 | class CChargingStatus : public CActive
44 | {
45 |
46 | public: // Constructors and destructor
47 |
48 | static CChargingStatus* NewL(MChargingStatusObserver* aObserver);
49 | virtual ~CChargingStatus();
50 |
51 | private: // Constructors
52 |
53 | CChargingStatus(MChargingStatusObserver* aObserver);
54 | void ConstructL();
55 |
56 | private: // From CActive
57 |
58 | void RunL();
59 | void DoCancel();
60 |
61 | private: // Data
62 |
63 | /**
64 | * iProperty
65 | * Reflects status of the charging.
66 | */
67 | RProperty iProperty;
68 |
69 | /**
70 | * iObserver
71 | * Handles the charging status change.
72 | * Non-owning pointer.
73 | */
74 | MChargingStatusObserver* iChargingStatusObserver;
75 |
76 | };
77 |
78 | #endif /* __CHARGINGSTATUS_H__ */
79 |
80 | // End of File
81 |
--------------------------------------------------------------------------------
/inc/ColorControl.h:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : ColorControl.h
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Custom control for the color setup.
7 | ============================================================================
8 | */
9 |
10 | #ifndef __COLORCONTROL_H__
11 | #define __COLORCONTROL_H__
12 |
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 |
20 | // FORWARD DECLARATION
21 | class CAknsBasicBackgroundControlContext;
22 |
23 |
24 | /**
25 | * CColorPreview class.
26 | * Small control for previewing the initial
27 | * and current colors.
28 | */
29 | class CColorPreview : public CAknControl
30 | {
31 |
32 | public: // Constructor
33 | void ConstructL(const CCoeControl* aParent,
34 | const TRgb* aInitialColor,
35 | const TRgb* aColor);
36 |
37 | public: // From CAknControl
38 | TSize MinimumSize();
39 |
40 | private: // From CAknControl
41 | void Draw(const TRect& aRect) const;
42 |
43 | private: // Data
44 | /**
45 | * Non owning pointers to colors to preview.
46 | */
47 | const TRgb* iInitialColor;
48 | const TRgb* iColor;
49 |
50 | };
51 |
52 |
53 | /**
54 | * CColorControl class.
55 | * Control for setting up RGB color with sliders.
56 | */
57 | class CColorControl : public CAknControl, public MCoeControlObserver
58 | {
59 |
60 | public: // Constructor, destructor
61 | ~CColorControl();
62 | void ConstructL(const CCoeControl* aParent, TRgb aColor);
63 |
64 | public: // From CAknControl
65 | TSize MinimumSize();
66 | TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
67 | TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
68 |
69 | public: // From MCoeControlObserver
70 | void HandleControlEventL(CCoeControl *aControl, TCoeEvent aEventType);
71 |
72 | public: // New functions
73 | TRgb Color();
74 |
75 | private: // New functions
76 | void UpdateNaviLabelL();
77 |
78 | protected: // From CAknControl
79 | void SizeChanged();
80 |
81 | private: // From CAknControl
82 | void Draw(const TRect& aRect) const;
83 |
84 | private: // Data
85 | /**
86 | * First member shomehow resets to zero, why?!!!
87 | */
88 | TInt iDumy;
89 |
90 | CAknsBasicBackgroundControlContext* iBackground;
91 | TInt iActiveSlider;
92 |
93 | TRgb iInitialColor;
94 | TRgb iColor;
95 |
96 | CFont* iFont;
97 |
98 | CAknNavigationDecorator* iNaviDecorator;
99 |
100 | };
101 |
102 |
103 | /**
104 | * CColorDialog class.
105 | * Dialog for setting up RGB color.
106 | */
107 | class CColorDialog : public CAknDialog
108 | {
109 |
110 | public: // Constructor
111 | CColorDialog(TRgb* aColor);
112 |
113 | public: // From CAknDialog
114 | TBool OkToExitL(TInt aButtonId);
115 |
116 | private: // From CAknDialog
117 | SEikControlInfo CreateCustomControlL(TInt aControlType);
118 | void PreLayoutDynInitL();
119 |
120 | private: // Data
121 | // Non owning pointer to color setup control.
122 | CColorControl* iColorControl;
123 | // Non owning pointer to color to setup.
124 | TRgb* iColor;
125 |
126 | };
127 |
128 |
129 | class CColorEditor;
130 |
131 |
132 | /**
133 | * CColorEditorPreviewTimer class.
134 | * Timer for deferred redrawing of CColorEditorPreview.
135 | */
136 | class MColorEditorPreviewTimerCallback { public: virtual void HandleTimedOut() = 0; };
137 | class CColorEditorPreviewTimer : public CTimer
138 | {
139 |
140 | public:
141 | static CColorEditorPreviewTimer* NewL(MColorEditorPreviewTimerCallback& aCallback);
142 |
143 | private:
144 | CColorEditorPreviewTimer(MColorEditorPreviewTimerCallback& aCallback);
145 | void ConstructL();
146 | void RunL();
147 |
148 | private:
149 | MColorEditorPreviewTimerCallback& iCallback;
150 |
151 | };
152 |
153 |
154 | /**
155 | * CColorEditorPreview class.
156 | * Small control for previewing the color.
157 | * This control is drawn over CColorEditor.
158 | */
159 | class CColorEditorPreview : public CAknControl, public MColorEditorPreviewTimerCallback
160 | {
161 |
162 | public: // Constructor and destructor
163 | ~CColorEditorPreview();
164 | void ConstructL(const CColorEditor* aParent);
165 |
166 | public: // New functions
167 | void UpdateDeferred();
168 |
169 | public: // From MColorEditorPreviewTimerCallback
170 | void HandleTimedOut();
171 |
172 | private: // From CAknControl
173 | void Draw(const TRect& aRect) const;
174 |
175 | private: // Data
176 | const CColorEditor* iParent;
177 | CColorEditorPreviewTimer* iTimer;
178 |
179 | };
180 |
181 |
182 | /**
183 | * CColorEditor class.
184 | * Color editor for forms.
185 | */
186 | class CColorEditor : public CEikMfne, public MCoeControlObserver
187 | {
188 |
189 | public: // From CCoeControl
190 | void ConstructFromResourceL(TResourceReader& aResourceReader);
191 | TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
192 | void HandlePointerEventL(const TPointerEvent& aPointerEvent);
193 |
194 | public: // From MCoeControlObserver
195 | void HandleControlEventL(CCoeControl *aControl, TCoeEvent aEventType);
196 |
197 | public: // New functions
198 | TRgb Color() const;
199 | void SetColor(TRgb aColor);
200 | void SetColorWithDialog();
201 |
202 | protected: // From CCoeControl
203 | void SizeChanged();
204 |
205 | private: // Data
206 | CColorEditorPreview* iPreview;
207 |
208 | };
209 |
210 | #endif /* __COLORCONTROL_H__ */
211 |
212 | // End of File
213 |
--------------------------------------------------------------------------------
/inc/ColorControl.hrh:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : ColorControl.hrh
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : This file contains declarations for constants of ColorControl.
7 | The file can be included in C++ or resource file.
8 | ============================================================================
9 | */
10 | #ifndef __COLORCONTROL_HRH__
11 | #define __COLORCONTROL_HRH__
12 |
13 | /**
14 | * Control ID.
15 | * Must be in range 0x2001-0x2800
16 | * for custom controls.
17 | */
18 | enum
19 | {
20 | EColorControl = 0x2137,
21 | EColorEditor
22 | };
23 |
24 | #endif // __COLORCONTROL_HRH__
25 |
26 | // End of File
27 |
--------------------------------------------------------------------------------
/inc/ColorControl.rh:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : ColorControl.rh
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : This file contains declarations for resources of ColorControl.
7 | ============================================================================
8 | */
9 | #ifndef __COLORCONTROL_RH__
10 | #define __COLORCONTROL_RH__
11 |
12 | STRUCT COLOREDITOR
13 | {
14 |
15 | }
16 |
17 | #endif // __COLORCONTROL_RH__
18 |
19 | // End of File
20 |
--------------------------------------------------------------------------------
/inc/RFterm.hrh:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFterm.hrh
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : This file contains declarations for constants of RFterm.
7 | The file can be included in C++ or resource file.
8 | ============================================================================
9 | */
10 | #ifndef __RFTERM_HRH__
11 | #define __RFTERM_HRH__
12 |
13 | #define _UID3 0xae7f53fa
14 |
15 | // RFterm command codes of menu entries
16 | enum TRFtermCommandIds
17 | {
18 | ERFtermConnect = 0x6001, // start value must not be 0
19 | ERFtermDisconnect,
20 | ERFtermStart,
21 | ERFtermStop,
22 | ERFtermSend,
23 | ERFtermMessage,
24 | ERFtermHistory,
25 | ERFtermCtrlChar,
26 | ERFtermFile,
27 | ERFtermSignal,
28 | ERFtermClear,
29 | ERFtermSave,
30 | ERFtermSettings,
31 | ERFtermHelp
32 | };
33 |
34 | // Identifiers of settings dialog pages
35 | enum TRFtermSettingPageIds
36 | {
37 | ESettingPageInput = 1,
38 | ESettingPageOutput,
39 | ESettingPageColors
40 | };
41 |
42 | // Identifiers of settings dialog controls
43 | enum TRFtermSettingControlIds
44 | {
45 | // input
46 | ESettingAppendix = 1,
47 | ESettingHistorySize,
48 | ESettingEcho,
49 | // output
50 | ESettingFontSize,
51 | ESettingTabSize,
52 | ESettingFontAntialiasing,
53 | ESettingWrapText,
54 | ESettingMapping,
55 | ESettingCodePage,
56 | ESettingSaveNotifies,
57 | // colors
58 | ESettingColorBackground,
59 | ESettingColorFont,
60 | ESettingColorCursor,
61 | ESettingColorScrollbars
62 | };
63 |
64 | #endif // __RFTERM_HRH__
65 |
66 | // End of File
67 |
--------------------------------------------------------------------------------
/inc/RFterm.pan:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFterm.pan
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : This file contains panic codes.
7 | ============================================================================
8 | */
9 |
10 | #ifndef __RFTERM_PAN__
11 | #define __RFTERM_PAN__
12 |
13 | /** RFterm application panic codes */
14 | enum TRFtermPanics
15 | {
16 | ERFtermUi = 1,
17 | ERFtermInvalidControlIndex,
18 | ERFtermCannotLoadFont,
19 | ERFtermInvalidLogicState,
20 | ERFtermUnableToDisconnect,
21 | ERFtermOutputIllegalPosition,
22 | ERFtermOutputBadCtrlChar,
23 | ERFtermOutputBadCodePage,
24 | ERFtermOutputBadContent,
25 | ERFtermInputBadCtrlChar,
26 | ERFtermSignalsAreUnavailable,
27 | // add further panics here
28 | };
29 |
30 | /** Panic Category */
31 | _LIT(KPanicRFterm, "RFterm");
32 | _LIT(KPanicBTServiceAdvertiser, "BTServiceAdvertiser");
33 |
34 | inline void Panic(TRFtermPanics aReason)
35 | {
36 | User::Panic(KPanicRFterm, aReason);
37 | }
38 |
39 | #endif // __RFTERM_PAN__
40 |
41 | // End of File
42 |
--------------------------------------------------------------------------------
/inc/RFtermAppUi.h:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermAppUi.h
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Declares UI class for application.
7 | ============================================================================
8 | */
9 |
10 | #ifndef __RFTERMAPPUI_H__
11 | #define __RFTERMAPPUI_H__
12 |
13 | #include
14 | #include "RFtermAppView.h"
15 | #include "RFtermBt.h"
16 | #include "RFtermSettings.h"
17 |
18 | /**
19 | * CRFtermAppUi application UI class.
20 | * Interacts with the user through the UI and request message processing
21 | * from the handler class
22 | */
23 | class CRFtermAppUi : public CAknAppUi
24 | {
25 |
26 | public: // Constructors and destructor
27 |
28 | /**
29 | * ConstructL.
30 | * 2nd phase constructor.
31 | */
32 | void ConstructL();
33 |
34 | /**
35 | * CRFtermAppUi.
36 | * C++ default constructor. This needs to be public due to
37 | * the way the framework constructs the AppUi
38 | */
39 | CRFtermAppUi();
40 |
41 | /**
42 | * ~CRFtermAppUi.
43 | * Virtual Destructor.
44 | */
45 | virtual ~CRFtermAppUi();
46 |
47 | private: // Functions from base classes
48 |
49 | /**
50 | * From CEikAppUi, handles key events.
51 | * @param aKeyEvent Event to handled.
52 | * @param aType Type of the key event.
53 | * @return Response code (EKeyWasConsumed, EKeyWasNotConsumed).
54 | */
55 | virtual TKeyResponse HandleKeyEventL(
56 | const TKeyEvent& aKeyEvent,TEventCode aType );
57 |
58 | /**
59 | * From CEikAppUi, HandleCommandL.
60 | * Takes care of command handling.
61 | * @param aCommand Command to be handled.
62 | */
63 | void HandleCommandL(TInt aCommand);
64 |
65 | /**
66 | * HandleStatusPaneSizeChange.
67 | * Called by the framework when the application status pane
68 | * size is changed.
69 | */
70 | void HandleStatusPaneSizeChange();
71 |
72 | /**
73 | * From CCoeAppUi, HelpContextL.
74 | * Provides help context for the application.
75 | * size is changed.
76 | */
77 | CArrayFix* HelpContextL() const;
78 |
79 | private: // From MEikMenuObserver
80 |
81 | void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
82 |
83 | private: // New functions
84 |
85 | void InternalizeSettingsL();
86 | void ExternalizeSettingsL() const;
87 |
88 | void HandleSettingsChange();
89 |
90 | /**
91 | * ShowBTNotAvailableNoteL.
92 | * Show note if BT is not available
93 | */
94 | void ShowBTNotAvailableNoteL();
95 |
96 | /**
97 | * ShowOutputIsSavedNoteL.
98 | * Show note if output has been saved successfully
99 | */
100 | void ShowOutputIsSavedNoteL();
101 |
102 | private: // Data
103 |
104 | /**
105 | * The application view
106 | * Owned by CRFtermAppUi
107 | */
108 | CRFtermAppView* iAppView;
109 |
110 | /**
111 | * iClient
112 | * the BT engine
113 | * Owned by CRFtermAppUi
114 | */
115 | CRFtermBt* iBtClient;
116 |
117 | /**
118 | * iBtAvailable, ETrue if an SDP session can be opened, EFalse otherwise.
119 | */
120 | TBool iBtAvailable;
121 |
122 | /**
123 | * iSettingsFileName - name of the file with stored settings.
124 | */
125 | TFileName iSettingsFileName;
126 |
127 | public:
128 |
129 | /**
130 | * iSettings - application settings.
131 | */
132 | CRFtermSettings* iSettings;
133 | };
134 |
135 | #endif // __RFTERMAPPUI_H__
136 |
137 | // End of File
138 |
--------------------------------------------------------------------------------
/inc/RFtermAppView.h:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermAppView.h
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Declares view class for application.
7 | ============================================================================
8 | */
9 |
10 | #ifndef __RFTERMAPPVIEW_H__
11 | #define __RFTERMAPPVIEW_H__
12 |
13 | #include
14 | #include
15 | #include
16 | #ifdef __S60v5__
17 | #include
18 | #endif
19 | #include "RFtermOutput.h"
20 | #include "RFtermScrollBars.h"
21 | #include "RFtermSettings.h"
22 | #include "RFtermBtObserver.h"
23 |
24 | /**
25 | * Controls of main view
26 | */
27 | enum TRFtermAppViewControls
28 | {
29 | ERFtermAppViewScrollBars,
30 | ERFtermAppViewOutput
31 | };
32 |
33 | /**
34 | * CRFtermAppView class.
35 | * Main view of RFterm application.
36 | */
37 | class CRFtermAppView
38 | : public CCoeControl
39 | , public MRFtermSettingsObserver
40 | , public MRFtermBtObserver
41 | {
42 |
43 | public: // New methods
44 |
45 | /**
46 | * NewL.
47 | * Two-phased constructor.
48 | * Create a CRFtermAppView object, which will draw itself to aRect.
49 | * @param aRect The rectangle this view will be drawn to.
50 | * @return a pointer to the created instance of CRFtermAppView.
51 | */
52 | static CRFtermAppView* NewL(const TRect& aRect);
53 |
54 | /**
55 | * NewLC.
56 | * Two-phased constructor.
57 | * Create a CRFtermAppView object, which will draw itself
58 | * to aRect.
59 | * @param aRect Rectangle this view will be drawn to.
60 | * @return A pointer to the created instance of CRFtermAppView.
61 | */
62 | static CRFtermAppView* NewLC(const TRect& aRect);
63 |
64 | /**
65 | * ~CRFtermAppView
66 | * Virtual Destructor.
67 | */
68 | virtual ~CRFtermAppView();
69 |
70 | /**
71 | * ShowTextQueryL()
72 | * Show text query.
73 | * @param aInitialText for inial value
74 | * @param aText text of the query
75 | */
76 | TBool ShowTextQueryL(const TDesC& aInitialText, TDes& aText);
77 |
78 | /**
79 | * ShowHistoryQueryL()
80 | * Show history query.
81 | * @param aText chosen text from history
82 | */
83 | TBool ShowHistoryQueryL(TDes& aText);
84 |
85 | /**
86 | * ShowCtrlCharQueryL()
87 | * Show control character query.
88 | * @param aText chosen control character as text
89 | */
90 | TBool ShowCtrlCharQueryL(TDes& aText);
91 |
92 | /**
93 | * ShowIntQueryL()
94 | * Show integer query.
95 | * @param aInt integer of the query
96 | */
97 | TBool ShowIntQueryL(TInt& aInt);
98 |
99 | public: // from CCoeControl
100 |
101 | /**
102 | * From CCoeControl, Draw
103 | * Draw this CRFtermAppView to the screen.
104 | * @param aRect the rectangle of this view that needs updating
105 | */
106 | void Draw(const TRect& aRect) const;
107 |
108 | /**
109 | * From CoeControl, SizeChanged.
110 | * Called by framework when the view size is changed.
111 | */
112 | virtual void SizeChanged();
113 |
114 | /**
115 | * From CoeControl, HandlePointerEventL.
116 | * Called by framework when a pointer touch event occurs.
117 | * Note: although this method is compatible with earlier SDKs,
118 | * it will not be called in SDKs without Touch support.
119 | * @param aPointerEvent the information about this event
120 | */
121 | virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent);
122 |
123 | /**
124 | * OfferKeyEventL()
125 | * Offer the key event to the list box
126 | * @param aKeyEvent the key that caused the event
127 | * @param aType the type of event that occured
128 | * @return indicates whether or not the key event
129 | * was used by this control
130 | */
131 | TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,
132 | TEventCode aType);
133 |
134 | /**
135 | * CountComponentControls()
136 | * Return the number of component controls
137 | * @return the number of component controls
138 | */
139 | TInt CountComponentControls() const;
140 |
141 | /**
142 | * ComponentControl()
143 | * Return a component control
144 | * @param aIndex the index of the control to return
145 | * @return the specified component control
146 | */
147 | CCoeControl* ComponentControl(TInt aIndex) const;
148 |
149 | protected: // from CCoeControl
150 |
151 | void FocusChanged(TDrawNow aDrawNow);
152 |
153 | private: // Constructors
154 |
155 | /**
156 | * ConstructL
157 | * 2nd phase constructor.
158 | * Perform the second phase construction of a
159 | * CRFtermAppView object.
160 | * @param aRect The rectangle this view will be drawn to.
161 | */
162 | void ConstructL(const TRect& aRect);
163 |
164 | /**
165 | * CRFtermAppView.
166 | * C++ default constructor.
167 | */
168 | CRFtermAppView();
169 |
170 | private: // New functions
171 |
172 | void SetNaviLabelL(const TDesC& aText);
173 |
174 | public:
175 |
176 | void MakeNaviLabelVisible(TBool aVisible);
177 |
178 | private: // From MRFtermSettingsObserver
179 |
180 | void HandleSettingsChange(const CRFtermSettings* aSettings);
181 |
182 | private: // From MRFtermBtObserver
183 |
184 | void HandleBtDeviceChangeL(CBTDevice* aRemoteDevice);
185 | void HandleBtNotifyL(const TDesC& aMessage);
186 | void HandleBtDataL(const TDesC& aData);
187 | void HandleBtFileSendingFinishL();
188 |
189 | private: // Data
190 |
191 | /**
192 | * iDownPointerPos
193 | */
194 | TPoint iDownPointerPos;
195 |
196 | /**
197 | * iHistorySize
198 | */
199 | TInt iMessageHistorySize;
200 |
201 | /**
202 | * iRFtermScrollBars
203 | */
204 | CRFtermScrollBars* iRFtermScrollBars;
205 |
206 | /**
207 | * iRFtermOutput
208 | */
209 | CRFtermOutput* iRFtermOutput;
210 |
211 | /**
212 | * iNaviDecorator
213 | * Decorator for status bar label.
214 | */
215 | CAknNavigationDecorator* iNaviDecorator;
216 |
217 | /**
218 | * iTouchFeedback
219 | * Tactile feedback instance.
220 | */
221 | #ifdef __S60v5__
222 | MTouchFeedback* iTouchFeedback;
223 | #endif
224 |
225 | public:
226 |
227 | /**
228 | * iMessageHistoryArray
229 | */
230 | CDesCArraySeg* iMessageHistoryArray;
231 |
232 | };
233 |
234 | #endif // __RFTERMAPPVIEW_H__
235 | // End of File
236 |
--------------------------------------------------------------------------------
/inc/RFtermApplication.h:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermApplication.h
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Declares main application class.
7 | ============================================================================
8 | */
9 |
10 | #ifndef __RFTERMAPPLICATION_H__
11 | #define __RFTERMAPPLICATION_H__
12 |
13 | #include
14 | #include "RFtermConstants.h"
15 |
16 | /**
17 | * CRFtermApplication application class.
18 | * Provides factory to create concrete document object.
19 | * An instance of CRFtermApplication is the application part of the
20 | * AVKON application framework for the RFterm example application.
21 | */
22 | class CRFtermApplication : public CAknApplication
23 | {
24 |
25 | public: // Functions from base classes
26 |
27 | /**
28 | * From CApaApplication, AppDllUid.
29 | * @return Application's UID (KUidRFtermApp).
30 | */
31 | TUid AppDllUid() const;
32 |
33 | protected: // Functions from base classes
34 |
35 | /**
36 | * From CApaApplication, CreateDocumentL.
37 | * Creates CRFtermDocument document object. The returned
38 | * pointer in not owned by the CRFtermApplication object.
39 | * @return A pointer to the created document object.
40 | */
41 | CApaDocument* CreateDocumentL();
42 | };
43 |
44 | #endif // __RFTERMAPPLICATION_H__
45 |
46 | // End of File
47 |
--------------------------------------------------------------------------------
/inc/RFtermBatteryStatus.h:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermBatteryStatus.h
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Battery status notifier.
7 | ============================================================================
8 | */
9 |
10 | #ifndef __RFTERMBATTERYSTATUS_H__
11 | #define __RFTERMBATTERYSTATUS_H__
12 |
13 | #include
14 | #include
15 |
16 | /**
17 | * MRFtermBatteryStatusObserver mixin.
18 | * Handles the battery status change.
19 | */
20 | class MRFtermBatteryStatusObserver
21 | {
22 |
23 | public:
24 |
25 | /**
26 | * HandleBatteryStatusChangeL()
27 | * Battery status change notify.
28 | *
29 | * Derived classes provide the implementation.
30 | */
31 | virtual void HandleBatteryStatusChangeL() = 0;
32 |
33 | };
34 |
35 | /**
36 | * CRFtermBatteryStatus
37 | * Checks the battery status and sends the notification of battery status change
38 | * to MRFtermBatteryStatusObserver.
39 | */
40 | class CRFtermBatteryStatus :
41 | public CBase,
42 | private MBatteryLevelObserver,
43 | private MChargingStatusObserver
44 | {
45 |
46 | public: // Constructors and destructor
47 |
48 | static CRFtermBatteryStatus* NewL(MRFtermBatteryStatusObserver* aObserver);
49 | virtual ~CRFtermBatteryStatus();
50 |
51 | private: // Constructors
52 |
53 | CRFtermBatteryStatus(MRFtermBatteryStatusObserver* aObserver);
54 | void ConstructL();
55 |
56 | private: // From MBatteryLevelObserver
57 |
58 | void HandleBatteryLevelChangeL(EPSHWRMBatteryLevel aBatteryLevel);
59 |
60 | private: // From MChargingStatusObserver
61 |
62 | void HandleChargingStatusChangeL(EPSHWRMChargingStatus aChargingStatus);
63 |
64 | public: // New public functions
65 |
66 | /**
67 | * IsOK()
68 | * Get status of the battery.
69 | */
70 | TBool IsOK();
71 |
72 | private: // Data
73 |
74 | /**
75 | * iBatteryLevel
76 | */
77 | CBatteryLevel* iBatteryLevel;
78 | EPSHWRMBatteryLevel iBatteryLevelValue;
79 |
80 | /**
81 | * iChargingStatus
82 | */
83 | CChargingStatus* iChargingStatus;
84 | EPSHWRMChargingStatus iChargingStatusValue;
85 |
86 | /**
87 | * iObserver
88 | * Handles the battery status change.
89 | * Non-owning pointer.
90 | */
91 | MRFtermBatteryStatusObserver* iObserver;
92 |
93 | };
94 |
95 | #endif /* __RFTERMBATTERYSTATUS_H__ */
96 |
97 | // End of File
98 |
--------------------------------------------------------------------------------
/inc/RFtermBtObserver.h:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermBtObserver.h
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : RFterm's bluetooth client observer.
7 | ============================================================================
8 | */
9 |
10 | #ifndef RFTERMBTOBSERVER_H
11 | #define RFTERMBTOBSERVER_H
12 |
13 | #include
14 |
15 | /**
16 | * MRFtermBtObserver mixin.
17 | * All information from BT client is sent
18 | * to observer using this interface.
19 | */
20 | class MRFtermBtObserver
21 | {
22 |
23 | public:
24 |
25 | /**
26 | * HandleBtDeviceChangeL()
27 | * BT device connection/disconnection notify.
28 | *
29 | * Derived classes provide the implementation.
30 | *
31 | * @param aRemoteDevice Contains the name and address of connected device.
32 | */
33 | virtual void HandleBtDeviceChangeL(CBTDevice* aRemoteDevice) = 0;
34 |
35 | /**
36 | * HandleBtNotifyL()
37 | * Notify/error message from BT client.
38 | *
39 | * Derived classes provide the implementation.
40 | *
41 | * @param aMessage Message from BT client.
42 | */
43 | virtual void HandleBtNotifyL(const TDesC& aMessage) = 0;
44 |
45 | /**
46 | * HandleBtDataL()
47 | * Received data from remote BT device.
48 | *
49 | * Derived classes provide the implementation.
50 | *
51 | * @param aData Received BT data.
52 | */
53 | virtual void HandleBtDataL(const TDesC& aData) = 0;
54 |
55 | /**
56 | * HandleBtFileSendingFinishL()
57 | * File has been successfully sent.
58 | *
59 | * Derived classes provide the implementation.
60 | *
61 | */
62 | virtual void HandleBtFileSendingFinishL() = 0;
63 |
64 | };
65 |
66 | #endif /* RFTERMBTOBSERVER_H */
67 |
68 | // End of File
69 |
--------------------------------------------------------------------------------
/inc/RFtermBtServiceAdvertiser.h:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermBtServiceAdvertiser.h
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Advertises a service in the SDP database.
7 | ============================================================================
8 | */
9 |
10 | #ifndef __RFTERMBTSERVICEADVERTISER_H__
11 | #define __RFTERMBTSERVICEADVERTISER_H__
12 |
13 | #include
14 | #include
15 | #include
16 |
17 | /**
18 | * CRFtermBtServiceAdvertiser
19 | * Advertises a service in the SDP database.
20 | */
21 | class CRFtermBtServiceAdvertiser : public CBase
22 | {
23 |
24 | public: // Constructors and destructor
25 |
26 | /**
27 | * NewL()
28 | * Create a CRFtermBtServiceAdvertiser object
29 | * @return a pointer to the created instance of
30 | * CRFtermBtServiceAdvertiser
31 | */
32 | static CRFtermBtServiceAdvertiser* NewL();
33 |
34 | /**
35 | * NewLC()
36 | * Create a CRFtermBtServiceAdvertiser object, which will
37 | * draw itself to aRect.
38 | * @return a pointer to the created instance of
39 | * CRFtermBtServiceAdvertiser
40 | */
41 | static CRFtermBtServiceAdvertiser* NewLC();
42 |
43 | /**
44 | * ~CRFtermBtServiceAdvertiser
45 | * Destroy the object, close all open handles and remove
46 | * the advertised service.
47 | */
48 | virtual ~CRFtermBtServiceAdvertiser();
49 |
50 | public: // New functions
51 |
52 | /**
53 | * StartAdvertisingL
54 | * Start the advertising of this service
55 | * @param aPort the port being used by the service
56 | */
57 | void StartAdvertisingL(TInt aPort);
58 |
59 | /**
60 | * StopAdvertisingL
61 | * Stop advertising this service. Remove the record
62 | * from the sdp database
63 | */
64 | void StopAdvertisingL();
65 |
66 | /**
67 | * IsAdvertising
68 | * Does the SDP database contain a record for this service
69 | * @return ETrue whether the service is being advertised
70 | */
71 | TBool IsAdvertising();
72 |
73 | /**
74 | * UpdateAvailabilityL
75 | * Update the service availability field of the service record
76 | * @param aIsAvailable ETrue is the service is not busy.
77 | */
78 | void UpdateAvailabilityL(TBool aIsAvailable);
79 |
80 | protected: // New functions
81 |
82 | /**
83 | * ConnectL
84 | * Connect to the SDP database
85 | * CRFtermBtServiceAdvertiser()
86 | * Constructs this object^M
87 | */
88 | void ConnectL();
89 |
90 | /**
91 | * BuildProtocolDescriptionL
92 | * Builds the protocol description
93 | * @param aProtocolDescriptor the protocol descriptor
94 | * @param aPort the service port
95 | */
96 | void BuildProtocolDescriptionL(
97 | CSdpAttrValueDES* aProtocolDescriptor, TInt aPort);
98 |
99 | /**
100 | * ServiceClass
101 | * @return the service class
102 | */
103 | TInt ServiceClass();
104 |
105 | /**
106 | * ServiceName
107 | * @return the service name
108 | */
109 | const TDesC& ServiceName();
110 |
111 | /**
112 | * ServiceDescription
113 | * @return the service description
114 | */
115 | const TDesC& ServiceDescription();
116 |
117 | private: // Constructors
118 |
119 | /**
120 | * CRFtermBtServiceAdvertiser()
121 | * Constructs this object
122 | */
123 | CRFtermBtServiceAdvertiser();
124 |
125 | /**
126 | * ConstructL()
127 | * 2nd phase construction of this object
128 | */
129 | void ConstructL();
130 |
131 | private: // data
132 |
133 | /**
134 | * iSdpSession
135 | * a handle to the SDP session
136 | */
137 | RSdp iSdpSession;
138 |
139 | /**
140 | * iSdpDatabase
141 | * a connection to the SDP database
142 | */
143 | RSdpDatabase iSdpDatabase;
144 |
145 | /**
146 | * iRecord
147 | * the record handle of the service record for this server
148 | */
149 | TSdpServRecordHandle iRecord;
150 |
151 | /**
152 | * iRecordState
153 | * the current record state - change number
154 | */
155 | TInt iRecordState;
156 |
157 | /**
158 | * iIsConnected
159 | * has a connection been made to the SDP Database
160 | */
161 | TBool iIsConnected;
162 |
163 | /**
164 | * iServiceName
165 | * Owned by CRFtermBtServiceAdvertiser
166 | */
167 | HBufC* iServiceName;
168 |
169 | /**
170 | * iServiceDescription
171 | * Owned by CRFtermBtServiceAdvertiser
172 | */
173 | HBufC* iServiceDescription;
174 |
175 | };
176 |
177 | #endif // __RFTERMBTSERVICEADVERTISER_H__
178 |
179 | // End of File
180 |
--------------------------------------------------------------------------------
/inc/RFtermBtServiceSearcher.h:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermBtServiceSearcher.h
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Searching for a service on a remote machine.
7 | ============================================================================
8 | */
9 |
10 | #ifndef __RFTERMTBTSERVICESEARCHER_H__
11 | #define __RFTERMTBTSERVICESEARCHER_H__
12 |
13 | #include
14 | #include
15 | #include
16 | #include "RFtermBtObserver.h"
17 | #include "RFtermSdpAttributeParser.h"
18 | #include "RFtermSdpAttributeNotifier.h"
19 | #include "RFtermConstants.h"
20 |
21 | /**
22 | * CRFtermBtServiceSearcher
23 | * Searches for a service on a remote machine
24 | */
25 |
26 | class CRFtermBtServiceSearcher
27 | : public CBase
28 | , public MSdpAgentNotifier
29 | , public MRFtermSdpAttributeNotifier
30 | {
31 |
32 | public: // Constructors and destructor
33 |
34 | /*
35 | * NewL()
36 | * Create a CRFtermBtServiceSearcher object
37 | * @return a pointer to the created instance of
38 | * CRFtermBtServiceSearcher
39 | */
40 | static CRFtermBtServiceSearcher* NewL();
41 |
42 | /**
43 | * NewLC()
44 | * Create a CRFtermBtServiceSearcher object
45 | * @return a pointer to the created instance of
46 | * CRFtermBtServiceSearcher
47 | */
48 | static CRFtermBtServiceSearcher* NewLC();
49 |
50 | /**
51 | * ~CRFtermBtServiceSearcher()
52 | * Destroy the object and release all memory objects
53 | */
54 | virtual ~CRFtermBtServiceSearcher();
55 |
56 | public: // New functions
57 |
58 | /**
59 | * SelectDeviceByDiscoveryL()
60 | * Select a device
61 | * @param aObserverRequestStatus the observer that is to
62 | * be notified when the device selection is complete.
63 | */
64 | void SelectDeviceByDiscoveryL(
65 | TRequestStatus& aObserverRequestStatus);
66 |
67 | /**
68 | * FindServiceL()
69 | * Find a service on the specified device
70 | * @param aObserverRequestStatus the observer that is to be notified
71 | * when the service search is complete
72 | */
73 | void FindServiceL(TRequestStatus& aObserverRequestStatus);
74 |
75 | /**
76 | * BTDevAddr()
77 | * @return the bluetooth device address
78 | */
79 | const TBTDevAddr& BTDevAddr();
80 |
81 | /**
82 | * ResponseParams()
83 | * @return Information about the device selected by the user
84 | */
85 | const TBTDeviceResponseParams& ResponseParams();
86 |
87 | /**
88 | * Port()
89 | * Retrieve the port on which the service is installed
90 | * @return the port number
91 | */
92 | TInt Port();
93 |
94 | /**
95 | * SetObserver()
96 | * Assing an observer to receive log messages.
97 | */
98 | void SetObserver(MRFtermBtObserver* aObserver);
99 |
100 | protected: // New functions
101 |
102 | /**
103 | * Finished()
104 | * The search has finished. Notify the observer
105 | * that the process is complete.
106 | */
107 | virtual void Finished(TInt aError = KErrNone);
108 |
109 | /**
110 | * HasFinishedSearching()
111 | * Is the instance still wanting to search.
112 | * @return EFalse if the instance wants searching to continue.
113 | */
114 | virtual TBool HasFinishedSearching() const;
115 |
116 | /**
117 | * HasFoundService()
118 | * @return ETrue if a service has been found
119 | */
120 | TBool HasFoundService() const;
121 |
122 | /**
123 | * ServiceClass()
124 | * @return the service class uid.
125 | */
126 | const TUUID& ServiceClass() const;
127 |
128 | /**
129 | * FoundElementL()
130 | * Read the data element
131 | * @param aKey a key that identifies the element
132 | * @param aValue the data element
133 | */
134 | virtual void FoundElementL(TInt aKey, CSdpAttrValue& aValue);
135 |
136 | /**
137 | * ProtocolList()
138 | * @return the attribute list.
139 | */
140 | RArray& ProtocolList();
141 |
142 | private: // Constructors
143 |
144 | /**
145 | * CRFtermBtServiceSearcher()
146 | * Constructs this object
147 | */
148 | CRFtermBtServiceSearcher();
149 |
150 | /**
151 | * ConstructL()
152 | * Performs second phase construction of this object
153 | */
154 | void ConstructL();
155 |
156 | private: // New functions
157 |
158 | /**
159 | * NotifyL()
160 | * Send log message to observer.
161 | */
162 | void NotifyL(const TDesC& aMessage);
163 | void NotifyL(TInt aResId);
164 |
165 | public: // from MSdpAgentNotifier
166 |
167 | /**
168 | * NextRecordRequestComplete()
169 | * Process the result of the next record request
170 | * @param aError the error code
171 | * @param aHandle the handle of the service record
172 | * @param aTotalRecordsCount the total number of matching
173 | * service records
174 | */
175 | void NextRecordRequestComplete(TInt aError,
176 | TSdpServRecordHandle aHandle,
177 | TInt aTotalRecordsCount);
178 |
179 | /**
180 | * AttributeRequestResult()
181 | * Process the next attribute requested
182 | * @param aHandle the handle of the service record
183 | * @param aAttrID the id of the attribute
184 | * @param aAttrValue the value of the attribute
185 | */
186 | void AttributeRequestResult(TSdpServRecordHandle aHandle,
187 | TSdpAttributeID aAttrID,
188 | CSdpAttrValue* aAttrValue);
189 |
190 | /**
191 | * AttributeRequestComplete()
192 | * Process the arrtibute request completion
193 | * @param aHandle the handle of the service record
194 | * @param aError the error code
195 | */
196 | void AttributeRequestComplete(TSdpServRecordHandle aHandle,
197 | TInt aError);
198 |
199 | private: // Functions from base classes
200 |
201 | /**
202 | * NextRecordRequestCompleteL()
203 | * Process the result of the next record request
204 | * @param aError the error code
205 | * @param aHandle the handle of the service record
206 | * @param aTotalRecordsCount the total number of
207 | * matching service records
208 | */
209 | void NextRecordRequestCompleteL(TInt aError,
210 | TSdpServRecordHandle aHandle,
211 | TInt aTotalRecordsCount);
212 |
213 | /**
214 | * AttributeRequestResultL()
215 | * Process the next attribute requested
216 | * @param aHandle the handle of the service record
217 | * @param aAttrID the id of the attribute
218 | * @param aAttrValue the value of the attribute
219 | */
220 | void AttributeRequestResultL(TSdpServRecordHandle aHandle,
221 | TSdpAttributeID aAttrID,
222 | CSdpAttrValue* aAttrValue);
223 |
224 | /**
225 | * AttributeRequestCompleteL()
226 | * Process the arrtibute request completion
227 | * @param aHandle the handle of the service record
228 | * @param aError the error code
229 | */
230 | void AttributeRequestCompleteL(TSdpServRecordHandle,
231 | TInt aError);
232 |
233 | private: // data
234 |
235 | /**
236 | * iStatusObserver pointer to the request status observer
237 | * Not owned by CRFtermBtServiceSearcher
238 | */
239 | TRequestStatus* iStatusObserver;
240 |
241 | /**
242 | * iIsDeviceSelectorConnected is the device
243 | * selector connected?
244 | */
245 | TBool iIsDeviceSelectorConnected;
246 |
247 | /**
248 | * iDeviceSelector
249 | * a handle to the bluetooth device selector notifier
250 | */
251 | RNotifier iDeviceSelector;
252 |
253 | /**
254 | * iResponse
255 | * the response of the device selection.
256 | */
257 | TBTDeviceResponseParamsPckg iResponse;
258 |
259 | /**
260 | * iSelectionFilter
261 | * Request a device selection
262 | */
263 | TBTDeviceSelectionParamsPckg iSelectionFilter;
264 | /**
265 | * iAgent a connetction to the SDP client
266 | * Owned by CRFtermBtServiceSearcher
267 | */
268 | CSdpAgent* iAgent;
269 |
270 | /**
271 | * iSdpSearchPattern a search pattern
272 | * Owned by CRFtermBtServiceSearcher
273 | */
274 | CSdpSearchPattern* iSdpSearchPattern;
275 |
276 | /**
277 | * iHasFoundService has the service been found ?
278 | */
279 | TBool iHasFoundService;
280 |
281 | /**
282 | * iServiceClass
283 | * the service class UUID to search for
284 | */
285 | TUUID iServiceClass;
286 |
287 | /**
288 | * iPort
289 | * the port number that the remote service is installed
290 | */
291 | TInt iPort;
292 |
293 | /**
294 | * iProtocolArray
295 | * the attribute list
296 | */
297 | RArray iProtocolArray;
298 |
299 | /**
300 | * iObserver the handler of log messages
301 | */
302 | MRFtermBtObserver* iObserver;
303 |
304 | };
305 |
306 | #endif // __RFTERMTBTSERVICESEARCHER_H__
307 |
308 | // End of File
309 |
--------------------------------------------------------------------------------
/inc/RFtermBtServiceSearcher.pan:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermBtServiceSearcher.pan
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : This file contains service searcher panic codes.
7 | ============================================================================
8 | */
9 |
10 | #ifndef RFTERMBTSERVICESEARCHER_PAN
11 | #define RFTERMBTSERVICESEARCHER_PAN
12 |
13 | #include
14 |
15 | /** RFtermBtServiceSearcher application panic codes */
16 | enum TRFtermBtServiceSearcherPanics
17 | {
18 | ERFtermBtServiceSearcherNextRecordRequestComplete = 1,
19 | ERFtermBtServiceSearcherAttributeRequestResult,
20 | ERFtermBtServiceSearcherAttributeRequestComplete,
21 | ERFtermBtServiceSearcherProtocolRead
22 | };
23 |
24 |
25 | /** Panic Category */
26 | _LIT(KPanicServiceSearcher, "ServiceSearcher");
27 |
28 |
29 | inline void Panic(TRFtermBtServiceSearcherPanics aReason)
30 | {
31 | User::Panic(KPanicServiceSearcher, aReason);
32 | }
33 |
34 | #endif // RFTERMBTSERVICESEARCHER_PAN
35 |
36 | // End of File
37 |
--------------------------------------------------------------------------------
/inc/RFtermCodePages.h:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermCodePages.h
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Characters from range 128-255 of different code pages.
7 | ============================================================================
8 | */
9 |
10 | #ifndef __RFTERMCODEPAGES_H__
11 | #define __RFTERMCODEPAGES_H__
12 |
13 | const TUint KCodePageSize = 256;
14 |
15 | // 0123456789ABCDEF
16 | // " " //8
17 | // " " //9
18 | // " ¡¢£¤¥¦§¨©ª«¬®¯" //A
19 | // "°±²³´µ¶·¸¹º»¼½¾¿" //B
20 | // "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ" //C
21 | // "ÐÑÒÓÔÕÖרÙÚÛÜÝÞß" //D
22 | // "àáâãäåæçèéêëìíîï" //E
23 | // "ðñòóôõö÷øùúûüýþÿ" //F
24 | _LIT(KCodePageLatin1,
25 | "\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020"
26 | "\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020"
27 | "\u00a0\u00a1\u00a2\u00a3\u00a4\u00a5\u00a6\u00a7\u00a8\u00a9\u00aa\u00ab\u00ac\u00ad\u00ae\u00af"
28 | "\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00b8\u00b9\u00ba\u00bb\u00bc\u00bd\u00be\u00bf"
29 | "\u00c0\u00c1\u00c2\u00c3\u00c4\u00c5\u00c6\u00c7\u00c8\u00c9\u00ca\u00cb\u00cc\u00cd\u00ce\u00cf"
30 | "\u00d0\u00d1\u00d2\u00d3\u00d4\u00d5\u00d6\u00d7\u00d8\u00d9\u00da\u00db\u00dc\u00dd\u00de\u00df"
31 | "\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5\u00e6\u00e7\u00e8\u00e9\u00ea\u00eb\u00ec\u00ed\u00ee\u00ef"
32 | "\u00f0\u00f1\u00f2\u00f3\u00f4\u00f5\u00f6\u00f7\u00f8\u00f9\u00fa\u00fb\u00fc\u00fd\u00fe\u00ff"
33 | );
34 |
35 | // 0123456789ABCDEF
36 | // " " //8
37 | // " " //9
38 | // " Ą˘Ł¤ĽŚ§¨ŠŞŤŹŽŻ" //A
39 | // "°ą˛ł´ľśˇ¸šşťź˝žż" //B
40 | // "ŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎ" //C
41 | // "ĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢß" //D
42 | // "ŕáâăäĺćçčéęëěíîď" //E
43 | // "đńňóôőö÷řůúűüýţ˙" //F
44 | _LIT(KCodePageLatin2,
45 | "\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020"
46 | "\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020"
47 | "\u00a0\u0104\u02d8\u0141\u00a4\u013d\u015a\u00a7\u00a8\u0160\u015e\u0164\u0179\u00ad\u017d\u017b"
48 | "\u00b0\u0105\u02db\u0142\u00b4\u013e\u015b\u02c7\u00b8\u0161\u015f\u0165\u017a\u02dd\u017e\u017c"
49 | "\u0154\u00c1\u00c2\u0102\u00c4\u0139\u0106\u00c7\u010c\u00c9\u0118\u00cb\u011a\u00cd\u00ce\u010e"
50 | "\u0110\u0143\u0147\u00d3\u00d4\u0150\u00d6\u00d7\u0158\u016e\u00da\u0170\u00dc\u00dd\u0162\u00df"
51 | "\u0155\u00e1\u00e2\u0103\u00e4\u013a\u0107\u00e7\u010d\u00e9\u0119\u00eb\u011b\u00ed\u00ee\u010f"
52 | "\u0111\u0144\u0148\u00f3\u00f4\u0151\u00f6\u00f7\u0159\u016f\u00fa\u0171\u00fc\u00fd\u0163\u02d9"
53 | );
54 |
55 | // 0123456789ABCDEF
56 | // " " //8
57 | // " " //9
58 | // " Ħ˘£¤¥Ĥ§¨İŞĞĴ®Ż" //A
59 | // "°ħ²³´µĥ·¸ışğĵ½¾ż" //B
60 | // "ÀÁÂ ÄĊĈÇÈÉÊËÌÍÎÏ" //C
61 | // " ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜß" //D
62 | // "àáâ äċĉçèéêëìíîï" //E
63 | // " ñòóôġö÷ĝùúûüŭŝ˙" //F
64 | _LIT(KCodePageLatin3,
65 | "\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020"
66 | "\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020"
67 | "\x0020\u0126\u02d8\u00a3\u00a4\u00a5\u0124\u00a7\u00a8\u0130\u015e\u011e\u0134\u00ad\u00ae\u017b"
68 | "\u00b0\u0127\u00b2\u00b3\u00b4\u00b5\u0125\u00b7\u00b8\u0131\u015f\u011f\u0135\u00bd\u00be\u017c"
69 | "\u00c0\u00c1\u00c2\x0020\u00c4\u010a\u0108\u00c7\u00c8\u00c9\u00ca\u00cb\u00cc\u00cd\u00ce\u00cf"
70 | "\x0020\u00d1\u00d2\u00d3\u00d4\u0120\u00d6\u00d7\u011c\u00d9\u00da\u00db\u00dc\u016c\u015c\u00df"
71 | "\u00e0\u00e1\u00e2\x0020\u00e4\u010b\u0109\u00e7\u00e8\u00e9\u00ea\u00eb\u00ec\u00ed\u00ee\u00ef"
72 | "\x0020\u00f1\u00f2\u00f3\u00f4\u0121\u00f6\u00f7\u011d\u00f9\u00fa\u00fb\u00fc\u016d\u015d\u02d9"
73 | );
74 |
75 | // 0123456789ABCDEF
76 | // " " //8
77 | // " " //9
78 | // " ĄĸŖ¤Ĩϧ¨ŠĒĢŦޝ" //A
79 | // "°ą˛ŗ´ĩšēģŧŊžŋ" //B
80 | // "ĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪ" //C
81 | // "ĐŅŌĶÔÕÖרŲÚÛÜŨŪß" //D
82 | // "āáâãäåæįčéęëėíîī" //E
83 | // "đņōķôõö÷øųúûüũū˙" //F
84 | _LIT(KCodePageLatin4,
85 | "\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020"
86 | "\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020"
87 | "\u00a0\u0104\u0138\u0156\u00a4\u0128\u013b\u00a7\u00a8\u0160\u0112\u0122\u0166\u00ad\u017d\u00af"
88 | "\u00b0\u0105\u02db\u0157\u00b4\u0129\u013c\u02c7\u00b8\u0161\u0113\u0123\u0167\u014a\u017e\u014b"
89 | "\u0100\u00c1\u00c2\u00c3\u00c4\u00c5\u00c6\u012e\u010c\u00c9\u0118\u00cb\u0116\u00cd\u00ce\u012a"
90 | "\u0110\u0145\u014c\u0136\u00d4\u00d5\u00d6\u00d7\u00d8\u0172\u00da\u00db\u00dc\u0168\u016a\u00df"
91 | "\u0101\u00e1\u00e2\u00e3\u00e4\u00e5\u00e6\u012f\u010d\u00e9\u0119\u00eb\u0117\u00ed\u00ee\u012b"
92 | "\u0111\u0146\u014d\u0137\u00f4\u00f5\u00f6\u00f7\u00f8\u0173\u00fa\u00fb\u00fc\u0169\u016b\u02d9"
93 | );
94 |
95 | // 0123456789ABCDEF
96 | // " " //8
97 | // " " //9
98 | // " ЁЂЃЄЅІЇЈЉЊЋЌ ЎЏ" //A
99 | // "АБВГДЕЖЗИЙКЛМНОП" //B
100 | // "РСТУФХЦЧШЩЪЫЬЭЮЯ" //C
101 | // "абвгдежзийклмноп" //D
102 | // "рстуфхцчшщъыьэюя" //E
103 | // "№ёђѓєѕіїјљњћќ§ўџ" //F
104 | _LIT(KCodePageLatinCyrillic,
105 | "\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020"
106 | "\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020"
107 | "\u00a0\u0401\u0402\u0403\u0404\u0405\u0406\u0407\u0408\u0409\u040a\u040b\u040c\x0020\u040e\u040f"
108 | "\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041a\u041b\u041c\u041d\u041e\u041f"
109 | "\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042a\u042b\u042c\u042d\u042e\u042f"
110 | "\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043a\u043b\u043c\u043d\u043e\u043f"
111 | "\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044a\u044b\u044c\u044d\u044e\u044f"
112 | "\u2116\u0451\u0452\u0453\u0454\u0455\u0456\u0457\u0458\u0459\u045a\u045b\u045c\u00a7\u045e\u045f"
113 | );
114 |
115 | // 0123456789ABCDEF
116 | // "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏ" //8
117 | // "ђ‘’“”•–—™ љ›њќћџ" //9
118 | // " ЎўЈ¤Ґ¦§Ё©Є«¬®Ї" //A
119 | // "°±Ііґµ¶·ё№є»јЅѕї" //B
120 | // "АБВГДЕЖЗИЙКЛМНОП" //C
121 | // "РСТУФХЦЧШЩЪЫЬЭЮЯ" //D
122 | // "абвгдежзийклмноп" //E
123 | // "рстуфхцчшщъыьэюя" //F
124 | _LIT(KCodePage1251,
125 | "\u0402\u0403\u201a\u0453\u201e\u2026\u2020\u2021\u20ac\u2030\u0409\u2039\u040a\u040c\u040b\u040f"
126 | "\u0452\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u2122\x0020\u0459\u203a\u045a\u045c\u045b\u045f"
127 | "\u00a0\u040e\u045e\u0408\u00a4\u0490\u00a6\u00a7\u0401\u00a9\u0404\u00ab\u00ac\u00ad\u00ae\u0407"
128 | "\u00b0\u00b1\u0406\u0456\u0491\u00b5\u00b6\u00b7\u0451\u2116\u0454\u00bb\u0458\u0405\u0455\u0457"
129 | "\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041a\u041b\u041c\u041d\u041e\u041f"
130 | "\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042a\u042b\u042c\u042d\u042e\u042f"
131 | "\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043a\u043b\u043c\u043d\u043e\u043f"
132 | "\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044a\u044b\u044c\u044d\u044e\u044f"
133 | );
134 |
135 | // 0123456789ABCDEF
136 | // "€ ‚ƒ„…†‡ˆ‰Š‹Œ Ž " //8
137 | // " ‘’“”•–—˜™š›œ žŸ" //9
138 | // " ¡¢£¤¥¦§¨©ª«¬®¯" //A
139 | // "°±²³´µ¶·¸¹º»¼½¾¿" //B
140 | // "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ" //C
141 | // "ÐÑÒÓÔÕÖרÙÚÛÜÝÞß" //D
142 | // "àáâãäåæçèéêëìíîï" //E
143 | // "ðñòóôõö÷øùúûüýþÿ" //F
144 | _LIT(KCodePage1252,
145 | "\u20ac\x0020\u201a\u0192\u201e\u2026\u2020\u2021\u02c6\u2030\u0160\u2039\u0152\x0020\u017d\x0020"
146 | "\x0020\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u02dc\u2122\u0161\u203a\u0153\x0020\u017e\u0178"
147 | "\u00a0\u00a1\u00a2\u00a3\u00a4\u00a5\u00a6\u00a7\u00a8\u00a9\u00aa\u00ab\u00ac\u00ad\u00ae\u00af"
148 | "\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00b8\u00b9\u00ba\u00bb\u00bc\u00bd\u00be\u00bf"
149 | "\u00c0\u00c1\u00c2\u00c3\u00c4\u00c5\u00c6\u00c7\u00c8\u00c9\u00ca\u00cb\u00cc\u00cd\u00ce\u00cf"
150 | "\u00d0\u00d1\u00d2\u00d3\u00d4\u00d5\u00d6\u00d7\u00d8\u00d9\u00da\u00db\u00dc\u00dd\u00de\u00df"
151 | "\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5\u00e6\u00e7\u00e8\u00e9\u00ea\u00eb\u00ec\u00ed\u00ee\u00ef"
152 | "\u00f0\u00f1\u00f2\u00f3\u00f4\u00f5\u00f6\u00f7\u00f8\u00f9\u00fa\u00fb\u00fc\u00fd\u00fe\u00ff"
153 | );
154 |
155 | // 0123456789ABCDEF
156 | // " " //8
157 | // " " //9
158 | // " " //A
159 | // " " //B
160 | // "юабцдефгхийклмно" //C
161 | // "пярстужвьызшэщчъ" //D
162 | // "ЮАБЦДЕФГХИЙКЛМНО" //E
163 | // "ПЯРСТУЖВЬЫЗШЭЩЧ " //F
164 | _LIT(KCodePageKOI8,
165 | "\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020"
166 | "\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020"
167 | "\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020"
168 | "\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020\x0020"
169 | "\u044e\u0430\u0431\u0446\u0434\u0435\u0444\u0433\u0445\u0438\u0439\u043a\u043b\u043c\u043d\u043e"
170 | "\u043f\u044f\u0440\u0441\u0442\u0443\u0436\u0432\u044c\u044b\u0437\u0448\u044d\u0449\u0447\u044a"
171 | "\u042e\u0410\u0411\u0426\u0414\u0415\u0424\u0413\u0425\u0418\u0419\u041a\u041b\u041c\u041d\u041e"
172 | "\u041f\u042f\u0420\u0421\u0422\u0423\u0416\u0412\u042c\u042b\u0417\u0428\u042d\u0429\u0427\x0020"
173 | );
174 |
175 | #endif /* __RFTERMCODEPAGES_H__ */
176 |
177 | // End of File
178 |
--------------------------------------------------------------------------------
/inc/RFtermConstants.h:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermConstants.h
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Common constants.
7 | ============================================================================
8 | */
9 |
10 | #ifndef __RFTERMCONSTANTS_H__
11 | #define __RFTERMCONSTANTS_H__
12 |
13 | #include
14 | #include
15 | #include "RFterm.hrh"
16 |
17 | const TInt KRfcommChannel = 1;
18 | const TInt KServiceClass = 0x1101; // SerialPort
19 |
20 | const TUid KUidRFtermApp = {_UID3};
21 |
22 | _LIT(KSettingsFile, "settings.ini");
23 |
24 | _LIT(KStrRFCOMM, "RFCOMM");
25 |
26 | const TInt KListeningQueSize = 1;
27 | const TInt KRFtermTextBufLength = 128;
28 |
29 | const TInt KRFtermTimeOut = 20000000; // 20 seconds time-out
30 |
31 | _LIT(KRFtermFontPath, "c:\\resource\\apps\\RFterm_0xae7f53fa_font.ttf");
32 | _LIT(KCourierNewFontPath, "c:\\resource\\fonts\\cour.ttf");
33 | _LIT(KRFtermFontName, "Courier New");
34 |
35 | _LIT(KRFtermIconsFile, "\\resource\\apps\\RFterm_0xae7f53fa.mif");
36 |
37 | const TUint KRFtermOutputNotifyMark = 0xfeff; // ZERO WIDTH NO-BREAK SPACE
38 | _LIT(KRFtermOutputNotifyLabel, "\xfeff RFterm: ");
39 |
40 | _LIT(KCtrlChars, "\r\n\t\b\a\v\f\0\x007f");
41 | _LIT(KCR, "\r"); // CARRIAGE RETURN ^M
42 | _LIT(KLF, "\n"); // LINE FEED ^J
43 | _LIT(KCRLF, "\r\n"); // CR+LF
44 | _LIT(KTB, "\t"); // CHARACTER TABULATION ^I
45 | _LIT(KBS, "\b"); // BACKSPACE ^H
46 | _LIT(KBL, "\a"); // BELL ^G
47 | _LIT(KLT, "\v"); // LINE TABULATION ^K
48 | _LIT(KFF, "\f"); // FORM FEED ^L
49 | _LIT(KNL, "\0"); // NULL ^@
50 | _LIT(KDL, "\x007f"); // Delete
51 |
52 | const TInt KRFtermScrollBarBreadth = 5;
53 | const TInt KRFtermScrollBarSensorBreadth = 30;
54 |
55 | const TRgb KDefaultFontColor(0xE0E0E0);
56 |
57 | #endif /* __RFTERMCONSTANTS_H__ */
58 |
59 | // End of File
60 |
--------------------------------------------------------------------------------
/inc/RFtermDocument.h:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermDocument.h
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Declares document class for application.
7 | ============================================================================
8 | */
9 |
10 | #ifndef __RFTERMDOCUMENT_H__
11 | #define __RFTERMDOCUMENT_H__
12 |
13 | #include
14 |
15 | class CRFtermAppUi;
16 | class CEikApplication;
17 |
18 | /**
19 | * CRFtermDocument application class.
20 | * An instance of class CRFtermDocument is the Document part of the
21 | * AVKON application framework for the RFterm example application.
22 | */
23 | class CRFtermDocument : public CAknDocument
24 | {
25 |
26 | public: // Constructors and destructor
27 |
28 | /**
29 | * NewL.
30 | * Two-phased constructor.
31 | * Construct a CRFtermDocument for the AVKON application aApp
32 | * using two phase construction, and return a pointer
33 | * to the created object.
34 | * @param aApp Application creating this document.
35 | * @return A pointer to the created instance of CRFtermDocument.
36 | */
37 | static CRFtermDocument* NewL(CEikApplication& aApp);
38 |
39 | /**
40 | * NewLC.
41 | * Two-phased constructor.
42 | * Construct a CRFtermDocument for the AVKON application aApp
43 | * using two phase construction, and return a pointer
44 | * to the created object.
45 | * @param aApp Application creating this document.
46 | * @return A pointer to the created instance of CRFtermDocument.
47 | */
48 | static CRFtermDocument* NewLC(CEikApplication& aApp);
49 |
50 | /**
51 | * ~CRFtermDocument
52 | * Virtual Destructor.
53 | */
54 | virtual ~CRFtermDocument();
55 |
56 | public: // Functions from base classes
57 |
58 | /**
59 | * CreateAppUiL
60 | * From CEikDocument, CreateAppUiL.
61 | * Create a CRFtermAppUi object and return a pointer to it.
62 | * The object returned is owned by the Uikon framework.
63 | * @return Pointer to created instance of AppUi.
64 | */
65 | CEikAppUi* CreateAppUiL();
66 |
67 | private: // Constructors
68 |
69 | /**
70 | * ConstructL
71 | * 2nd phase constructor.
72 | */
73 | void ConstructL();
74 |
75 | /**
76 | * CRFtermDocument.
77 | * C++ default constructor.
78 | * @param aApp Application creating this document.
79 | */
80 | CRFtermDocument(CEikApplication& aApp);
81 |
82 | };
83 |
84 | #endif // __RFTERMDOCUMENT_H__
85 |
86 | // End of File
87 |
--------------------------------------------------------------------------------
/inc/RFtermOutput.h:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermOutput.h
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : RFterm's output control.
7 | ============================================================================
8 | */
9 |
10 | #ifndef __RFTERMOUTPUT_H__
11 | #define __RFTERMOUTPUT_H__
12 |
13 | #include
14 | #include
15 | #include "RFtermSettings.h"
16 | #include "RFtermOutputObserver.h"
17 | #include "RFtermScrollBarsObserver.h"
18 |
19 | /**
20 | * CRFtermOutput class.
21 | * The control to represent textual data.
22 | */
23 | class CRFtermOutput : public CEikEdwin , public MRFtermScrollBarsObserver
24 | {
25 |
26 | public: // Constructor, destructor
27 |
28 | static CRFtermOutput* NewL(const CCoeControl *aParent);
29 | static CRFtermOutput* NewLC(const CCoeControl *aParent);
30 | virtual ~CRFtermOutput();
31 |
32 | public: // New functions
33 |
34 | // Font size in twips.
35 | void SetFontSizeL(TInt aFontSize);
36 | void SetCtrlCharMapping(TCtrlCharMapping aMapping);
37 | void SetTabSize(TInt aSize);
38 | void SetFontAntialiasingL(TBool aState);
39 | void SetTextWrapping(TBool aState);
40 | void SetNotifySaving(TBool aSaveNotifies);
41 | void SetColorsL(TRgb aBg, TRgb aFg, TRgb aCursor);
42 | void ChangeCodePage(TCodePage aCodePage);
43 | TBool IsEmpty() const;
44 | void ClearL();
45 | void AppendTextL(const TDesC& aText);
46 | void AppendMessageL(const TDesC& aMessage);
47 | // There is no ability to override SizeChanged() of CEikEdwin here,
48 | // so custom method is used to properly change the rect of the control.
49 | void UpdateRect(const TRect& aNewRect);
50 | void GetCurrentCodePage(TPtrC& aCodePage);
51 | TBool SaveOutputAsTextL();
52 |
53 | public: // CEikEdwin
54 |
55 | void HandlePointerEventL(const TPointerEvent &aPointerEvent);
56 | TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
57 |
58 | public: // From MRFtermOutputObserver
59 |
60 | void NotifyViewRectChangedL();
61 | void SetObserver(MRFtermOutputObserver* aObserver);
62 |
63 | private: // Constructors
64 |
65 | void ConstructL(const CCoeControl* aParent);
66 | CRFtermOutput();
67 |
68 | private: // CEikEdwin
69 |
70 | void FocusChanged(TDrawNow aDrawNow);
71 |
72 | private: // New functions
73 |
74 | void AppendNewLineL();
75 | void AppendRawTextL(const TDesC& aBuf);
76 | void AppendCRL();
77 | void AppendLFL();
78 | void AppendIndentL(TInt aIndentLength);
79 | void ScrollToCursorPosL(TBool aSkipAdditionalScroll=EFalse);
80 | void UpdateCursorL();
81 | void UpdateFormatL();
82 | /*
83 | * Find control character (one of KCtrlChars).
84 | * aText - the text for searching;
85 | * aCtrlChar - the special character that has been found;
86 | * aPos - the index of aCtrlChar in aText;
87 | * Returns ETrue if found and EFalse otherwise.
88 | */
89 | TBool TextHasCtrlChar(const TDesC& aText, TDes& aCtrlChar, TInt& aPos);
90 |
91 | private: // From MRFtermScrollBarsObserver
92 |
93 | void HandleScrollEventL(
94 | TRFtermScrollBarType aScrollBarType,
95 | const TRFtermScrollBarModel& aModel);
96 | void HandleScrollBarVisibilityChangeL(
97 | TBool aVScrollBarIsVisible,
98 | TBool aHScrollBarIsVisible);
99 |
100 | private: // Data
101 |
102 | TInt iRFtermFontID;
103 | TInt iFontSize;
104 | TInt iTabSize;
105 | TBool iFontAntialiasing;
106 | TBool iWrapText;
107 | TCtrlCharMapping iCtrlCharMapping;
108 | TPtrC iCodePage;
109 | TTextCursor iOutputCursor;
110 | TBool iSaveNotifies;
111 |
112 | TInt iLastLineStartPos;
113 | TInt iLastLineCursorPos;
114 |
115 | CAknGlobalNote* iBellNote;
116 | TInt iBellNoteID;
117 |
118 | MRFtermOutputObserver* iObserver;
119 | TRect iContentRect;
120 | /**
121 | * iOutputRect
122 | * Position and size of the view rect
123 | * relative to the content rect pos (0, 0).
124 | */
125 | TRect iOutputRect;
126 |
127 | TRgb iBgColor;
128 | TRgb iFgColor;
129 |
130 | };
131 |
132 | inline void CRFtermOutput::SetCtrlCharMapping(TCtrlCharMapping aMapping) { iCtrlCharMapping = aMapping; }
133 | inline void CRFtermOutput::SetTabSize(TInt aSize) { iTabSize = aSize; }
134 | inline void CRFtermOutput::SetNotifySaving(TBool aSaveNotifies) { iSaveNotifies = aSaveNotifies; }
135 |
136 | #endif /* __RFTERMOUTPUT_H__ */
137 |
138 | // End of File
139 |
--------------------------------------------------------------------------------
/inc/RFtermOutputObserver.h:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermOutputObserver.h
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : RFterm's output control observer.
7 | ============================================================================
8 | */
9 |
10 | #ifndef __RFTERMOUTPUTOBSERVER_H__
11 | #define __RFTERMOUTPUTOBSERVER_H__
12 |
13 | /**
14 | * MRFtermOutputObserver mixin.
15 | * This class is designed to notify the scrollbars
16 | * control about content and view changes.
17 | */
18 | class MRFtermOutputObserver
19 | {
20 |
21 | public:
22 |
23 | /**
24 | * HandleViewRectChangedL()
25 | *
26 | * Derived classes provide the implementation.
27 | *
28 | * @param aContentRect Contains the size of the total content.
29 | * @param aViewRect Contains the sizs and position of the visible content.
30 | */
31 | virtual void HandleViewRectChangedL(const TRect& aContentRect, const TRect& aViewRect) = 0;
32 |
33 | };
34 |
35 | #endif /* __RFTERMOUTPUTOBSERVER_H__ */
36 |
37 | // End of File
38 |
--------------------------------------------------------------------------------
/inc/RFtermScrollBarModel.h:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermScrollBarModel.h
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Data model of custom scrollbars control.
7 | ============================================================================
8 | */
9 |
10 | #ifndef __RFTERMSCROLLBARMODEL_H__
11 | #define __RFTERMSCROLLBARMODEL_H__
12 |
13 | /**
14 | * TRFtermScrollBarModel class.
15 | * Holds data of scrollbar.
16 | */
17 | struct TRFtermScrollBarModel
18 | {
19 |
20 | TRFtermScrollBarModel() : iTotal(1), iVisible(1), iPos(0) {}
21 |
22 | /**
23 | * Height/width of the total content.
24 | */
25 | TInt iTotal;
26 |
27 | /**
28 | * Height/width of the visible content.
29 | */
30 | TInt iVisible;
31 |
32 | /**
33 | * Offset of the top left corner of the visible content
34 | * relative to the top left corner of total content.
35 | */
36 | TInt iPos;
37 |
38 | };
39 |
40 | #endif /* __RFTERMSCROLLBARMODEL_H__ */
41 |
42 | // End of File
43 |
--------------------------------------------------------------------------------
/inc/RFtermScrollBars.h:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermScrollBars.h
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Custom scrollbars control.
7 | ============================================================================
8 | */
9 |
10 | #ifndef __RFTERMSCROLLBARS_H__
11 | #define __RFTERMSCROLLBARS_H__
12 |
13 | #include
14 | #include
15 | #include "RFtermConstants.h"
16 | #include "RFtermScrollBarModel.h"
17 | #include "RFtermScrollBarsObserver.h"
18 | #include "RFtermOutputObserver.h"
19 |
20 | /**
21 | * CRFtermScrollBars class.
22 | * The scrollbars control occupies all client area.
23 | * The related container control is placed over
24 | * the scrollbars control at the same position (0, 0).
25 | * To make vertical/horizontal scrollbar visible
26 | * the related container control has to shrink its right/bottom edge.
27 | */
28 | class CRFtermScrollBars : public CCoeControl, public MRFtermOutputObserver
29 | {
30 |
31 | public: // Constructor, destructor
32 |
33 | CRFtermScrollBars(const CCoeControl *aParent);
34 | ~CRFtermScrollBars();
35 |
36 | public: // New functions
37 |
38 | void SetVModel(const TRFtermScrollBarModel& aModel);
39 | void SetHModel(const TRFtermScrollBarModel& aModel);
40 | void SetVisibility(TBool aVertical, TBool aHorizontal);
41 | inline TBool IsVScrollBarVisible() const;
42 | inline TBool IsHScrollBarVisible() const;
43 | void Update(TBool aDrawNow);
44 | void SetColors(TRgb aBg, TRgb aSb);
45 | /**
46 | * Area that can be occupied by the container control.
47 | */
48 | void GetFreeRect(TRect& aRect) const;
49 | void DrawVScrollBarNow() const;
50 | void DrawHScrollBarNow() const;
51 | void DrawCornerNow() const;
52 |
53 | public: // For MRFtermScrollBarsObserver
54 |
55 | void SetObserver(MRFtermScrollBarsObserver* aObserver);
56 |
57 | private: // New functions
58 |
59 | void SetModel(TRFtermScrollBarModel& aTarget, const TRFtermScrollBarModel& aModel);
60 | void DrawVScrollBar(CWindowGc& aGc) const;
61 | void DrawHScrollBar(CWindowGc& aGc) const;
62 | void DrawCorner(CWindowGc& aGc) const;
63 | void Draw(const TRect& aRect) const;
64 | /**
65 | * Change color to look different when a scrollbar is pressed.
66 | */
67 | void HighlightColor(TRgb& aColor) const;
68 |
69 | private: // From MRFtermOutputObserver
70 |
71 | void HandleViewRectChangedL(const TRect& aContentRect, const TRect& aViewRect);
72 |
73 | private: // From CCoeControl
74 |
75 | void SizeChanged();
76 | void HandlePointerEventL(const TPointerEvent& aPointerEvent);
77 |
78 | private: // Data
79 |
80 | struct TRFtermScrollBarModel iVModel;
81 | TBool iVIsVisible;
82 | TRect iVThumbRect;
83 | TRect iVBackgroundRect;
84 |
85 | struct TRFtermScrollBarModel iHModel;
86 | TBool iHIsVisible;
87 | TRect iHThumbRect;
88 | TRect iHBackgroundRect;
89 |
90 | // Bottom right corner between vertical and horizontal scrollbars.
91 | TRect iCornerBackgroundRect;
92 |
93 | TPoint iPrevPointerPos;
94 | TBool iVScrollBarIsActive;
95 | TBool iHScrollBarIsActive;
96 |
97 | // Non owning pointer to observer
98 | MRFtermScrollBarsObserver* iObserver;
99 |
100 | TRgb iBgColor;
101 | TRgb iSbColor;
102 |
103 | };
104 |
105 | inline TBool CRFtermScrollBars::IsVScrollBarVisible() const
106 | { return iVIsVisible; }
107 |
108 | inline TBool CRFtermScrollBars::IsHScrollBarVisible() const
109 | { return iHIsVisible; }
110 |
111 | #endif /* __RFTERMSCROLLBARS_H__ */
112 |
113 | // End of File
114 |
--------------------------------------------------------------------------------
/inc/RFtermScrollBarsObserver.h:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermScrollBarsObserver.h
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Custom scrollbars control observer.
7 | ============================================================================
8 | */
9 |
10 | #ifndef __RFTERMSCROLLBARSOBSERVER_H__
11 | #define __RFTERMSCROLLBARSOBSERVER_H__
12 |
13 | #include "RFtermScrollBarModel.h"
14 |
15 | /**
16 | * Enum TRFtermScrollBarType.
17 | * IDs to identify the scrollbar type.
18 | */
19 | enum TRFtermScrollBarType
20 | {
21 | EVerticalScrollBar,
22 | EHorizontalScrollBar
23 | };
24 |
25 | /**
26 | * MRFtermScrollBarsObserver mixin.
27 | * Provides interface to handle events from scrollbars.
28 | */
29 | class MRFtermScrollBarsObserver
30 | {
31 |
32 | public:
33 |
34 | /**
35 | * HandleScrollEventL()
36 | * Scrollbar model change notification.
37 | *
38 | * Derived classes provide the implementation.
39 | *
40 | * @param aScrollBarType Specify which of the scrollbars is affected.
41 | * @param aModel Reference to the changed scrollbar model.
42 | */
43 | virtual void HandleScrollEventL(
44 | TRFtermScrollBarType aScrollBarType,
45 | const TRFtermScrollBarModel& aModel) = 0;
46 |
47 | /**
48 | * HandleScrollBarVisibilityChangeL()
49 | * Scrollbar visibility change notification.
50 | *
51 | * Derived classes provide the implementation.
52 | *
53 | * @param aVScrollBarIsVisible Visibility of vertical scrollbar.
54 | * @param aHScrollBarIsVisible Visibility of horizontal scrollbar.
55 | */
56 | virtual void HandleScrollBarVisibilityChangeL(
57 | TBool aVScrollBarIsVisible,
58 | TBool aHScrollBarIsVisible) = 0;
59 |
60 | };
61 |
62 | #endif /* __RFTERMSCROLLBARSOBSERVER_H__ */
63 |
64 | // End of File
65 |
--------------------------------------------------------------------------------
/inc/RFtermSdpAttributeNotifier.h:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermSdpAttributeNotifier.h
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Read selected SDP Attributes.
7 | ============================================================================
8 | */
9 |
10 | #ifndef __RFTERMSDPATTRIBUTENOTIFIER_H__
11 | #define __RFTERMSDPATTRIBUTENOTIFIER_H__
12 |
13 | class CSdpAttrValue;
14 |
15 | /**
16 | * MRFtermSdpAttributeNotifier
17 | * An instance of MRFtermSdpAttributeNotifier is used to read selected SDP Attribute
18 | * elements from an attribute value.
19 | */
20 | class MRFtermSdpAttributeNotifier
21 | {
22 |
23 | public: // New functions
24 |
25 | /**
26 | * FoundElementL
27 | * Read the data element
28 | * @param aKey a key that identifies the element
29 | * @param aValue the data element
30 | */
31 | virtual void FoundElementL(TInt aKey, CSdpAttrValue& aValue) = 0;
32 |
33 | };
34 |
35 | #endif // __RFTERMSDPATTRIBUTENOTIFIER_H__
36 |
37 | // End of File
38 |
--------------------------------------------------------------------------------
/inc/RFtermSdpAttributeParser.h:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermSdpAttributeParser.h
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Check an SDP attribute value and read selected parts.
7 | ============================================================================
8 | */
9 |
10 | #ifndef __RFTERMSDPATTRIBUTEPARSER_H__
11 | #define __RFTERMSDPATTRIBUTEPARSER_H__
12 |
13 | #include
14 |
15 | class MRFtermSdpAttributeNotifier;
16 |
17 | /**
18 | * TRFtermSdpAttributeParser
19 | * An instance of TRFtermSdpAttributeParser is used to check an SDP
20 | * attribute value, and read selected parts
21 | */
22 | class TRFtermSdpAttributeParser : public MSdpAttributeValueVisitor
23 | {
24 |
25 | public: // Enumerations
26 |
27 | /**
28 | * TNodeCommand
29 | * The command to be carried out at a node
30 | * ECheckType. Check the type of the value
31 | * ECheckValue. Check the type and the value
32 | * ECheckEnd. Check that a list ends at this point
33 | * ESkip. Do not check this value - can not match a list end
34 | * EReadValue. Pass the value onto the observer
35 | * EFinished. Marks the end of the node list
36 | */
37 | enum TNodeCommand
38 | {
39 | ECheckType,
40 | ECheckValue,
41 | ECheckEnd,
42 | ESkip,
43 | EReadValue,
44 | EFinished
45 | };
46 |
47 | /**
48 | * TRFtermSdpAttributeNode
49 | * An instance of TRFtermSdpAttributeNode is used to determine how
50 | * to parse an SDP attribute value data element
51 | */
52 | class TRFtermSdpAttributeNode
53 | {
54 |
55 | public:
56 |
57 | /**
58 | * TRFtermSdpAttributeNode
59 | * Construct a TRFtermSdpAttributeNode
60 | */
61 | TRFtermSdpAttributeNode();
62 |
63 | /**
64 | * ~TRFtermSdpAttributeNode
65 | * destructor
66 | */
67 | ~TRFtermSdpAttributeNode();
68 |
69 | /**
70 | * SetCommand
71 | * set value of iCommand member variable,
72 | * iCommand is the command for the node
73 | * @param aCommand the value of the iCommand
74 | */
75 | void SetCommand(TNodeCommand aCommand);
76 |
77 | /**
78 | * SetType
79 | * set value of iType member variable
80 | * iType is the expected type
81 | * @param aType the value of the iType
82 | */
83 | void SetType(TSdpElementType aType);
84 |
85 | /**
86 | * SetValue
87 | * set value of iValue member variable,
88 | * iValue the expected value for ECheckValue,the value of aKey
89 | * passed to the observer for EReadValue
90 | * @param aValue the value of the iValue
91 | */
92 | void SetValue(TInt aValue);
93 |
94 | /**
95 | * Command
96 | * get value of iCommand member variable
97 | * @return the value of the iCommand
98 | */
99 | TNodeCommand Command() const;
100 |
101 | /**
102 | * Type
103 | * get value of iType member variable
104 | * @return the value of the iType
105 | */
106 | TSdpElementType Type() const;
107 |
108 | /**
109 | * Value
110 | * get value of iValue member variable
111 | * @return the value of the iValue
112 | */
113 | TInt Value() const;
114 |
115 | private:
116 |
117 | /**
118 | * iCommand the command for the node
119 | */
120 | TNodeCommand iCommand;
121 |
122 | /**
123 | * iType the expected type
124 | */
125 | TSdpElementType iType;
126 |
127 | /**
128 | * iValue the expected value for ECheckValue,the value of aKey
129 | * passed to the observer for EReadValue
130 | */
131 | TInt iValue;
132 |
133 | };
134 |
135 |
136 | /**
137 | * TRFtermSdpAttributeParser
138 | * Construct a TRFtermSdpAttributeParser
139 | * @param aNodeList the list of expected nodes
140 | * @param aObserver an observer to read specified node values
141 | */
142 | TRFtermSdpAttributeParser(
143 | RArray& aNodeList,
144 | MRFtermSdpAttributeNotifier& aObserver);
145 |
146 | /**
147 | * ~TRFtermSdpAttributeParser
148 | * Destructor
149 | */
150 | virtual ~TRFtermSdpAttributeParser();
151 |
152 | /**
153 | * HasFinished
154 | * Check if parsing processed the whole list
155 | * @return true is the index refers to the EFinished node
156 | */
157 | TBool HasFinished() const;
158 |
159 | public: // from MSdpAttributeValueVisitor
160 |
161 | /**
162 | * VisitAttributeValueL
163 | * Process a data element
164 | * @param aValue the data element
165 | * @param aType the type of the data element
166 | */
167 | void VisitAttributeValueL(CSdpAttrValue& aValue,
168 | TSdpElementType aType);
169 |
170 | /**
171 | * StartListL
172 | * Process the start of a data element list
173 | * @param aList the data element list
174 | */
175 | void StartListL(CSdpAttrValueList& aList);
176 |
177 | /**
178 | * EndListL
179 | * Process the end of a data element list
180 | */
181 | void EndListL();
182 |
183 | private: // Functions from base classes
184 |
185 | /**
186 | * CheckTypeL
187 | * Check the type of the current node is the same as
188 | * the specified type.
189 | * @param aElementType the type of the current data element
190 | */
191 | void CheckTypeL(TSdpElementType aElementType) const;
192 |
193 | /**
194 | * CheckValueL
195 | * Check the value of the current node is the same as the specified value
196 | * @param aValue the value of the current data element.
197 | */
198 | void CheckValueL(CSdpAttrValue& aValue) const;
199 |
200 | /**
201 | * ReadValueL
202 | * Pass the data element value to the observer
203 | * @param aValue the value of the current data element.
204 | */
205 | void ReadValueL(CSdpAttrValue& aValue) const;
206 |
207 | /**
208 | * AdvanceL
209 | * Advance to the next node. Leaves with KErrEof
210 | * if at the finished node.
211 | */
212 | void AdvanceL();
213 |
214 | private: // data
215 |
216 | /**
217 | * iObserver the observer to read values
218 | */
219 | MRFtermSdpAttributeNotifier& iObserver;
220 |
221 | /**
222 | * iNodeList a list defining the expected
223 | * structure of the value
224 | */
225 | RArray& iNodeList;
226 |
227 | /**
228 | * iCurrentNodeIndex the index of the current node in iNodeList
229 | */
230 | TInt iCurrentNodeIndex;
231 |
232 | /**
233 | * iCurrentNode the current node
234 | */
235 | TRFtermSdpAttributeNode iCurrentNode;
236 |
237 | };
238 |
239 | #endif // __RFTERMSDPATTRIBUTEPARSER_H__
240 |
241 | // End of File
242 |
--------------------------------------------------------------------------------
/inc/RFtermSdpAttributeParser.pan:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermAttributeparser.pan
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : This file contains SDP attr panic codes.
7 | ============================================================================
8 | */
9 |
10 | #ifndef __RFTERMSDPATTRIBUTEPARSER_PAN__
11 | #define __RFTERMSDPATTRIBUTEPARSER_PAN__
12 |
13 | #include
14 |
15 | /** Panic Category */
16 | _LIT(KPanicSAP, "SAP");
17 |
18 | /** RFterm application panic codes */
19 | enum TRFtermSdpAttributeParserPanics
20 | {
21 | ERFtermSdpAttributeParserInvalidCommand = 1,
22 | ERFtermSdpAttributeParserNoValue,
23 | ERFtermSdpAttributeParserValueIsList,
24 | ERFtermSdpAttributeParserValueTypeUnsupported
25 | };
26 |
27 | inline void Panic(TRFtermSdpAttributeParserPanics aReason)
28 | {
29 | User::Panic(KPanicSAP, aReason);
30 | }
31 |
32 | #endif // __RFTERMSDPATTRIBUTEPARSER_PAN__
33 |
34 | // End of File
35 |
--------------------------------------------------------------------------------
/inc/RFtermSettings.h:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermSettings.h
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Application settings.
7 | ============================================================================
8 | */
9 |
10 | #ifndef __RFTERMSETTINGS_H__
11 | #define __RFTERMSETTINGS_H__
12 |
13 | #include
14 | #include
15 | #include
16 | #include
17 |
18 | /**
19 | * Enum TCtrlCharMapping.
20 | * Range of values of the CtrlCharMapping setting.
21 | */
22 | enum TCtrlCharMapping {
23 | EMapCRtoLF = 1,
24 | EMapCRtoCRLF,
25 | EMapLFtoCR,
26 | EMapLFtoCRLF,
27 | EMapNone
28 | };
29 |
30 | /**
31 | * Enum TCodePage.
32 | * List of supported code pages.
33 | */
34 | enum TCodePage {
35 | ECodePageLatin1 = 1,
36 | ECodePageLatin2,
37 | ECodePageLatin3,
38 | ECodePageLatin4,
39 | ECodePageLatinCyrilic,
40 | ECodePage1251,
41 | ECodePage1252,
42 | ECodePageKOI8,
43 | };
44 |
45 | class CRFtermSettings;
46 |
47 | /**
48 | * MRFtermSettingsObserver mixin.
49 | * Interface for objects that wish to receive
50 | * notifications of settings changes.
51 | */
52 | class MRFtermSettingsObserver
53 | {
54 |
55 | public:
56 |
57 | /**
58 | * HandleSettingsChange()
59 | *
60 | * Derived classes provide the implementation.
61 | *
62 | * @param aSettings Pointer to observed settings that have been changed.
63 | */
64 | virtual void HandleSettingsChange(const CRFtermSettings* aSettings) = 0;
65 |
66 | };
67 |
68 | /**
69 | * CRFtermSettings class.
70 | * Contains and provides access to settings of RFterm applications.
71 | */
72 | class CRFtermSettings : public CBase
73 | {
74 |
75 | public: // Constructors, destructor
76 | static CRFtermSettings* NewL();
77 | static CRFtermSettings* NewLC();
78 | virtual ~CRFtermSettings();
79 |
80 | public: // New functions
81 |
82 | // Loads settings from stream.
83 | void LoadL(RReadStream& aStream);
84 |
85 | // Saves settings to stream.
86 | void SaveL(RWriteStream& aStream) const;
87 |
88 | // Using default values.
89 | void SetDefaultValues(TBool aNotify=ETrue);
90 |
91 | // Getters
92 | const TDesC& MessageAddendum() const;
93 | TInt MessageHistorySize() const;
94 | TBool IsEchoEnabled() const;
95 | TInt FontSize() const;
96 | TInt TabSize() const;
97 | TBool FontAntialiasing() const;
98 | TBool DoWrapText() const;
99 | TCtrlCharMapping CtrlCharMapping() const;
100 | TCodePage CodePage() const;
101 | TBool DoSaveNotifies() const;
102 | TRgb BackgroundColor() const;
103 | TRgb FontColor() const;
104 | TRgb CursorColor() const;
105 | TRgb ScrollbarsColor() const;
106 |
107 | // Setters
108 | void SetMessageAddendum(const TDesC& aAddendum, TBool aNotify=ETrue);
109 | void SetMessageHistorySize(TInt aSize, TBool aNotify=ETrue);
110 | void EnableEcho(TBool aState, TBool aNotify=ETrue);
111 | void SetFontSize(TInt aSize, TBool aNotify=ETrue);
112 | void SetTabSize(TInt aSize, TBool aNotify=ETrue);
113 | void SetFontAntialiasing(TBool aState, TBool aNotify=ETrue);
114 | void SetTextWrapping(TBool aState, TBool aNotify=ETrue);
115 | void SetCtrlCharMapping(TCtrlCharMapping aMapping, TBool aNotify=ETrue);
116 | void SetCodePage(TCodePage aCodePage, TBool aNotify=ETrue);
117 | void SetNotifySaving(TBool aSaveNotifies, TBool aNotify=ETrue);
118 | void SetBackgroundColor(TRgb aColor, TBool aNotify=ETrue);
119 | void SetFontColor(TRgb aColor, TBool aNotify=ETrue);
120 | void SetCursorColor(TRgb aColor, TBool aNotify=ETrue);
121 | void SetScrollbarsColor(TRgb aColor, TBool aNotify=ETrue);
122 |
123 | // MRFtermSettingsObserver
124 | void AddObserver(MRFtermSettingsObserver* aObserver);
125 | void RemoveObserver(MRFtermSettingsObserver* aObserver);
126 |
127 | private: // Constructors
128 |
129 | CRFtermSettings();
130 | void ConstructL();
131 |
132 | private: // For MRFtermSettingsObserver
133 |
134 | // Send messages to observers.
135 | void Notify();
136 |
137 | private: // Data
138 |
139 | /**
140 | * Finish a message with iMessageAddendum on sending.
141 | */
142 | TBuf<2> iMessageAddendum;
143 |
144 | /**
145 | * Size of the message history.
146 | */
147 | TInt iMessageHistorySize;
148 |
149 | /**
150 | * Output sent message
151 | */
152 | TBool iEcho;
153 |
154 | /**
155 | * Size of the output font.
156 | */
157 | TInt iFontSize;
158 |
159 | /**
160 | * Size of the tabulation step.
161 | */
162 | TInt iTabSize;
163 |
164 | /**
165 | * Font antialiasing
166 | */
167 | TBool iFontAntialiasing;
168 |
169 | /**
170 | * Text wrapping
171 | */
172 | TBool iWrapText;
173 |
174 | /**
175 | * Map one control character with another.
176 | */
177 | TCtrlCharMapping iCtrlCharMapping;
178 |
179 | /**
180 | * Output code page
181 | */
182 | TCodePage iCodePage;
183 |
184 | /**
185 | * Save notifies or not
186 | */
187 | TBool iSaveNotifies;
188 |
189 | /**
190 | * Output background color
191 | */
192 | TRgb iBgColor;
193 |
194 | /**
195 | * Output font color
196 | */
197 | TRgb iFontColor;
198 |
199 | /**
200 | * Output cursor color
201 | */
202 | TRgb iCursorColor;
203 |
204 | /**
205 | * Output scrollbars color
206 | */
207 | TRgb iSbColor;
208 |
209 | private: // Observers
210 |
211 | /**
212 | * Array of non ownign pointers to settings observers.
213 | */
214 | RPointerArray iObservers;
215 |
216 | };
217 |
218 | inline const TDesC& CRFtermSettings::MessageAddendum() const { return iMessageAddendum; }
219 | inline TInt CRFtermSettings::MessageHistorySize() const { return iMessageHistorySize; }
220 | inline TBool CRFtermSettings::IsEchoEnabled() const { return iEcho; }
221 | inline TInt CRFtermSettings::FontSize() const { return iFontSize; }
222 | inline TInt CRFtermSettings::TabSize() const { return iTabSize; }
223 | inline TBool CRFtermSettings::FontAntialiasing() const { return iFontAntialiasing; }
224 | inline TBool CRFtermSettings::DoWrapText() const { return iWrapText; }
225 | inline TCtrlCharMapping CRFtermSettings::CtrlCharMapping() const { return iCtrlCharMapping; }
226 | inline TCodePage CRFtermSettings::CodePage() const { return iCodePage; }
227 | inline TBool CRFtermSettings::DoSaveNotifies() const { return iSaveNotifies; }
228 | inline TRgb CRFtermSettings::BackgroundColor() const { return iBgColor; }
229 | inline TRgb CRFtermSettings::FontColor() const { return iFontColor; }
230 | inline TRgb CRFtermSettings::CursorColor() const { return iCursorColor; }
231 | inline TRgb CRFtermSettings::ScrollbarsColor() const { return iSbColor; }
232 |
233 | #endif /* __RFTERMSETTINGS_H__ */
234 |
235 | // End of File
236 |
--------------------------------------------------------------------------------
/inc/RFtermSettingsDialog.h:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermSettingsDialog.h
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Query of send data.
7 | ============================================================================
8 | */
9 |
10 | #ifndef __RFTERMSETTINGSDIALOG_H__
11 | #define __RFTERMSETTINGSDIALOG_H__
12 |
13 | #include
14 | #include "RFtermSettings.h"
15 |
16 | /**
17 | * CRFtermSettingsDialog class.
18 | * Dialog to edit settings of RFterm application.
19 | */
20 | class CRFtermSettingsDialog: public CAknForm
21 | {
22 |
23 | public: // Run settings dialog
24 |
25 | static TInt RunDlgLD(CRFtermSettings* aSettings);
26 |
27 | private: // Constructor, destructor
28 |
29 | CRFtermSettingsDialog(CRFtermSettings* aSettings);
30 | ~CRFtermSettingsDialog();
31 |
32 | public: // From CAknForm
33 |
34 | TBool OkToExitL(TInt aButtonId);
35 | void HandlePointerEventL(const TPointerEvent &aPointerEvent);
36 | TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
37 | TBool SaveFormDataL();
38 | void DoNotSaveFormDataL();
39 | void PreLayoutDynInitL();
40 | MEikDialogPageObserver::TFormControlTypes ConvertCustomControlTypeToBaseControlType(TInt aControlType) const;
41 |
42 | private: // From CAknForm
43 |
44 | void LoadFormDataL();
45 | SEikControlInfo CreateCustomControlL(TInt aControlType);
46 |
47 | private: // From CCoeControl
48 |
49 | void ActivateL();
50 |
51 | private: // New functions
52 |
53 | void StartEditing();
54 |
55 | private: // Data
56 |
57 | // Not owning pointer to application settings
58 | CRFtermSettings* iSettings;
59 |
60 | // Pointer position at down event
61 | TPoint iDownPointerPos;
62 |
63 | };
64 |
65 | #endif /* __RFTERMSETTINGSDIALOG_H__ */
66 |
67 | // End of File
68 |
--------------------------------------------------------------------------------
/inc/RFtermSignalQueryDialog.h:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermSignalQueryDialog.h
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Dialog with the list of RS-232 input/output signals.
7 | ============================================================================
8 | */
9 |
10 | #ifndef __RFTERMSIGNALQUERYDIALOG_H__
11 | #define __RFTERMSIGNALQUERYDIALOG_H__
12 |
13 | #include // CPeriodic
14 | #include
15 | #include "RFtermBt.h"
16 |
17 | /**
18 | * CRFtermSignalQueryDialog class.
19 | * This class shows the dialog with the list of RS-232 input/output signals.
20 | */
21 | class CRFtermSignalQueryDialog : public CAknListQueryDialog
22 | {
23 |
24 | public: // New functions
25 |
26 | /**
27 | * RunDlgLD()
28 | * Run RS-232 signal dialog
29 | * @param aBtClient Pointer to Bluetooth client.
30 | */
31 | static TInt RunDlgLD(CRFtermBt* aBtClient);
32 |
33 | public: // from CCoeControl
34 |
35 | /**
36 | * OfferKeyEventL()
37 | * Offer the key event to the list box
38 | * @param aKeyEvent the key that caused the event
39 | * @param aType the type of event that occured
40 | * @return indicates whether or not the key event
41 | * was used by this control
42 | */
43 | TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
44 |
45 | protected: // From CAknListQueryDialog
46 |
47 | TBool OkToExitL(TInt aButtonId);
48 |
49 | protected: // From MEikListBoxObserver
50 |
51 | void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
52 |
53 | private: // Constructors, destructor
54 |
55 | CRFtermSignalQueryDialog(CRFtermBt* aBtClient);
56 | void ConstructL();
57 | ~CRFtermSignalQueryDialog();
58 |
59 | private: // New functions
60 |
61 | static TInt TimerCallBack(TAny* aObject);
62 | void UpdateSignalStatesL();
63 |
64 | private: // Data
65 |
66 | /**
67 | * iBtClient
68 | * Non owining pointer to CRFtermBt.
69 | */
70 | CRFtermBt* iBtClient;
71 |
72 | /**
73 | * iTimer
74 | * Timer for updating signal states.
75 | */
76 | CPeriodic* iTimer;
77 | /**
78 | * iIndex
79 | * Dummy index of selected item.
80 | */
81 | TInt iIndex;
82 |
83 | };
84 |
85 | #endif /* __RFTERMSIGNALQUERYDIALOG_H__ */
86 |
87 | // End of File
88 |
--------------------------------------------------------------------------------
/inc/RFtermTextQueryDialog.h:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermTextQueryDialog.h
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Query of send data.
7 | ============================================================================
8 | */
9 |
10 | #ifndef __RFTERMTEXTQUERYDIALOG_H__
11 | #define __RFTERMTEXTQUERYDIALOG_H__
12 |
13 | #include
14 |
15 | /**
16 | * CRFtermTextQueryDialog class.
17 | * This class is inherited from CAknTextQueryDialog to override
18 | * the UpdateLeftSoftKey method that hides OK button if query is empty.
19 | * Overrided method allows to accept emty text input.
20 | */
21 | class CRFtermTextQueryDialog: public CAknTextQueryDialog
22 | {
23 |
24 | public: // Static constructor
25 |
26 | static CRFtermTextQueryDialog* NewL(TDes &aDataText);
27 |
28 | protected: // From CAknTextQueryDialog
29 |
30 | virtual void UpdateLeftSoftKeyL();
31 |
32 | private: // Constructor, destructor
33 |
34 | CRFtermTextQueryDialog(TDes &aDataText);
35 | ~CRFtermTextQueryDialog();
36 |
37 | };
38 |
39 | #endif /* __RFTERMTEXTQUERYDIALOG_H__ */
40 |
41 | // End of File
42 |
--------------------------------------------------------------------------------
/inc/blddef.h:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : blddef.h
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Target platform definition.
7 | ============================================================================
8 | */
9 |
10 | #ifndef __BLDDEF_H__
11 | #define __BLDDEF_H__
12 |
13 | // Copy this file to S60v5 SDK's epoc32\include
14 | // and uncomment the next line:
15 | //#define __S60v5__
16 |
17 | // Copy this file to S60v3 SDK's epoc32\include
18 | // and uncomment the next line:
19 | //#define __S60v3__
20 |
21 | #endif /* __BLDDEF_H__ */
22 |
23 | // End of File
24 |
--------------------------------------------------------------------------------
/sis/RFterm_S60v3.pkg:
--------------------------------------------------------------------------------
1 | ; Installation file for RFterm application
2 | ; makesis from S60v3 SDK supports the Windows EOL format only!!!
3 | ;
4 | ; This is an auto-generated PKG file by Carbide.
5 | ; This file uses variables specific to Carbide builds that will not work
6 | ; on command-line builds. If you want to use this generated PKG file from the
7 | ; command-line tools you will need to modify the variables with the appropriate
8 | ; values: $(EPOCROOT), $(PLATFORM), $(TARGET)
9 | ;
10 | ;Language - standard language definitions
11 | &EN,SP,RU,UK
12 |
13 | ; standard SIS file header
14 | #{"RFterm","RFterm","RFterm","RFterm"},(0xae7f53fa),1,1,0
15 |
16 | ;Localised Vendor name
17 | %{"Konstantin Baranovskiy","Konstantin Baranovskiy","Барановский Константин","Барановський Костянтин"}
18 |
19 | ;Unique Vendor name
20 | :"Konstantin Baranovskiy"
21 |
22 | ;Supports Series 60 v 3.0
23 | [0x101F7961], 0, 0, 0, {"Series60ProductID","Series60ProductID","Series60ProductID","Series60ProductID"}
24 |
25 | ;Files to install
26 | ;You should change the source paths to match that of your environment
27 | ;
28 | "$(EPOCROOT)epoc32\release\$(PLATFORM)\$(TARGET)\RFterm_0xae7f53fa.exe" -"c:\sys\bin\RFterm_0xae7f53fa.exe"
29 | "$(EPOCROOT)epoc32\data\z\resource\apps\RFterm_0xae7f53fa.r01" -"c:\resource\apps\RFterm_0xae7f53fa.r01"
30 | "$(EPOCROOT)epoc32\data\z\resource\apps\RFterm_0xae7f53fa.r04" -"c:\resource\apps\RFterm_0xae7f53fa.r04"
31 | "$(EPOCROOT)epoc32\data\z\resource\apps\RFterm_0xae7f53fa.r16" -"c:\resource\apps\RFterm_0xae7f53fa.r16"
32 | "$(EPOCROOT)epoc32\data\z\resource\apps\RFterm_0xae7f53fa.r93" -"c:\resource\apps\RFterm_0xae7f53fa.r93"
33 | "$(EPOCROOT)epoc32\data\z\private\10003a3f\apps\RFterm_0xae7f53fa_reg.r01" -"c:\private\10003a3f\import\apps\RFterm_0xae7f53fa_reg.r01"
34 | "$(EPOCROOT)epoc32\data\z\private\10003a3f\apps\RFterm_0xae7f53fa_reg.r04" -"c:\private\10003a3f\import\apps\RFterm_0xae7f53fa_reg.r04"
35 | "$(EPOCROOT)epoc32\data\z\private\10003a3f\apps\RFterm_0xae7f53fa_reg.r16" -"c:\private\10003a3f\import\apps\RFterm_0xae7f53fa_reg.r16"
36 | "$(EPOCROOT)epoc32\data\z\private\10003a3f\apps\RFterm_0xae7f53fa_reg.r93" -"c:\private\10003a3f\import\apps\RFterm_0xae7f53fa_reg.r93"
37 | "$(EPOCROOT)epoc32\data\z\resource\apps\RFterm_0xae7f53fa.mif" -"c:\resource\apps\RFterm_0xae7f53fa.mif"
38 | "..\help\out\RFterm_0xae7f53fa.h01" -"c:\resource\help\RFterm_0xae7f53fa.h01"
39 | "..\help\out\RFterm_0xae7f53fa.h04" -"c:\resource\help\RFterm_0xae7f53fa.h04"
40 | "..\help\out\RFterm_0xae7f53fa.h16" -"c:\resource\help\RFterm_0xae7f53fa.h16"
41 | "..\help\out\RFterm_0xae7f53fa.h93" -"c:\resource\help\RFterm_0xae7f53fa.h93"
42 | "$(EPOCROOT)epoc32\winscw\c\resource\apps\RFterm_0xae7f53fa_font.ttf" -"c:\resource\apps\RFterm_0xae7f53fa_font.ttf"
43 | "$(EPOCROOT)epoc32\release\$(PLATFORM)\$(TARGET)\cpfont_0xaa40a41a.exe" -"c:\sys\bin\cpfont_0xaa40a41a.exe", FR, RI, RW
44 | ;For Unicode text files to be displayed correctly, it is recommended that the
45 | ;Byte Order Mark (BOM) be specified at the beginning of the text files.
46 | {"..\data\fontnote_EN.txt" "..\data\fontnote_SP.txt" "..\data\fontnote_RU.txt" "..\data\fontnote_UK.txt"} -"", FT, TC
47 |
48 | ;required for application to be covered by backup/restore facility
49 | "..\sis\backup_registration.xml" -"c:\private\ae7f53fa\backup_registration.xml"
50 |
--------------------------------------------------------------------------------
/sis/RFterm_S60v5.pkg:
--------------------------------------------------------------------------------
1 | ; Installation file for RFterm application
2 | ;
3 | ; This is an auto-generated PKG file by Carbide.
4 | ; This file uses variables specific to Carbide builds that will not work
5 | ; on command-line builds. If you want to use this generated PKG file from the
6 | ; command-line tools you will need to modify the variables with the appropriate
7 | ; values: $(EPOCROOT), $(PLATFORM), $(TARGET)
8 | ;
9 | ;Language - standard language definitions
10 | &EN,SP,RU,UK
11 |
12 | ; standard SIS file header
13 | #{"RFterm","RFterm","RFterm","RFterm"},(0xae7f53fa),1,1,0
14 |
15 | ;Localised Vendor name
16 | %{"Konstantin Baranovskiy","Konstantin Baranovskiy","Барановский Константин","Барановський Костянтин"}
17 |
18 | ;Unique Vendor name
19 | :"Konstantin Baranovskiy"
20 |
21 | ;Supports Series 60 v 5.0
22 | [0x1028315F], 0, 0, 0, {"Series60ProductID","Series60ProductID","Series60ProductID","Series60ProductID"}
23 |
24 | ;Files to install
25 | ;You should change the source paths to match that of your environment
26 | ;
27 | "$(EPOCROOT)epoc32\release\$(PLATFORM)\$(TARGET)\RFterm_0xae7f53fa.exe" -"c:\sys\bin\RFterm_0xae7f53fa.exe"
28 | "$(EPOCROOT)epoc32\data\z\resource\apps\RFterm_0xae7f53fa.r01" -"c:\resource\apps\RFterm_0xae7f53fa.r01"
29 | "$(EPOCROOT)epoc32\data\z\resource\apps\RFterm_0xae7f53fa.r04" -"c:\resource\apps\RFterm_0xae7f53fa.r04"
30 | "$(EPOCROOT)epoc32\data\z\resource\apps\RFterm_0xae7f53fa.r16" -"c:\resource\apps\RFterm_0xae7f53fa.r16"
31 | "$(EPOCROOT)epoc32\data\z\resource\apps\RFterm_0xae7f53fa.r93" -"c:\resource\apps\RFterm_0xae7f53fa.r93"
32 | "$(EPOCROOT)epoc32\data\z\private\10003a3f\apps\RFterm_0xae7f53fa_reg.r01" -"c:\private\10003a3f\import\apps\RFterm_0xae7f53fa_reg.r01"
33 | "$(EPOCROOT)epoc32\data\z\private\10003a3f\apps\RFterm_0xae7f53fa_reg.r04" -"c:\private\10003a3f\import\apps\RFterm_0xae7f53fa_reg.r04"
34 | "$(EPOCROOT)epoc32\data\z\private\10003a3f\apps\RFterm_0xae7f53fa_reg.r16" -"c:\private\10003a3f\import\apps\RFterm_0xae7f53fa_reg.r16"
35 | "$(EPOCROOT)epoc32\data\z\private\10003a3f\apps\RFterm_0xae7f53fa_reg.r93" -"c:\private\10003a3f\import\apps\RFterm_0xae7f53fa_reg.r93"
36 | "$(EPOCROOT)epoc32\data\z\resource\apps\RFterm_0xae7f53fa.mif" -"c:\resource\apps\RFterm_0xae7f53fa.mif"
37 | "..\help\out\RFterm_0xae7f53fa.h01" -"c:\resource\help\RFterm_0xae7f53fa.h01"
38 | "..\help\out\RFterm_0xae7f53fa.h04" -"c:\resource\help\RFterm_0xae7f53fa.h04"
39 | "..\help\out\RFterm_0xae7f53fa.h16" -"c:\resource\help\RFterm_0xae7f53fa.h16"
40 | "..\help\out\RFterm_0xae7f53fa.h93" -"c:\resource\help\RFterm_0xae7f53fa.h93"
41 | "$(EPOCROOT)epoc32\winscw\c\resource\apps\RFterm_0xae7f53fa_font.ttf" -"c:\resource\apps\RFterm_0xae7f53fa_font.ttf"
42 | "$(EPOCROOT)epoc32\release\$(PLATFORM)\$(TARGET)\cpfont_0xaa40a41a.exe" -"c:\sys\bin\cpfont_0xaa40a41a.exe", FR, RI, RW
43 | ;For Unicode text files to be displayed correctly, it is recommended that the
44 | ;Byte Order Mark (BOM) be specified at the beginning of the text files.
45 | {"..\data\fontnote_EN.txt" "..\data\fontnote_SP.txt" "..\data\fontnote_RU.txt" "..\data\fontnote_UK.txt"} -"", FT, TC
46 |
47 | ;required for application to be covered by backup/restore facility
48 | "..\sis\backup_registration.xml" -"c:\private\ae7f53fa\backup_registration.xml"
49 |
--------------------------------------------------------------------------------
/sis/backup_registration.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/BatteryLevel.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : BatteryLevel.h
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Battery level notifier.
7 | ============================================================================
8 | */
9 |
10 | // INCLUDE FILES
11 | #include "BatteryLevel.h"
12 |
13 | // ============================ MEMBER FUNCTIONS ==============================
14 |
15 | // ----------------------------------------------------------------------------
16 | // CBatteryLevel::CBatteryLevel()
17 | // Constructor.
18 | // ----------------------------------------------------------------------------
19 | //
20 | CBatteryLevel::CBatteryLevel(MBatteryLevelObserver* aObserver) :
21 | CActive(CActive::EPriorityStandard),
22 | iBatteryLevelObserver(aObserver)
23 | {
24 | }
25 |
26 | // ----------------------------------------------------------------------------
27 | // CBatteryLevel::NewL()
28 | // Two-phased constructor.
29 | // ----------------------------------------------------------------------------
30 | //
31 | CBatteryLevel* CBatteryLevel::NewL(MBatteryLevelObserver* aObserver)
32 | {
33 | CBatteryLevel* self = new(ELeave) CBatteryLevel(aObserver);
34 | CleanupStack::PushL(self);
35 | self->ConstructL();
36 | CleanupStack::Pop(self);
37 | return self;
38 | }
39 |
40 | // ----------------------------------------------------------------------------
41 | // CBatteryLevel::ConstructL()
42 | // Perform second phase construction of this object.
43 | // ----------------------------------------------------------------------------
44 | //
45 | void CBatteryLevel::ConstructL()
46 | {
47 | User::LeaveIfError(iProperty.Attach(KPSUidHWRMPowerState, KHWRMBatteryLevel));
48 | CActiveScheduler::Add(this);
49 | // initial subscription and process current property value
50 | RunL();
51 | }
52 |
53 | // ----------------------------------------------------------------------------
54 | // CBatteryLevel::~CBatteryLevel()
55 | // Destructor.
56 | // ----------------------------------------------------------------------------
57 | //
58 | CBatteryLevel::~CBatteryLevel()
59 | {
60 | Cancel();
61 | iProperty.Close();
62 | }
63 |
64 | // ----------------------------------------------------------------------------
65 | // CBatteryLevel::DoCancel()
66 | // Cancel any outstanding requests.
67 | // ----------------------------------------------------------------------------
68 | //
69 | void CBatteryLevel::DoCancel()
70 | {
71 | iProperty.Cancel();
72 | }
73 |
74 | // ----------------------------------------------------------------------------
75 | // CBatteryLevel::RunL()
76 | // Respond to an event.
77 | // ----------------------------------------------------------------------------
78 | //
79 | void CBatteryLevel::RunL()
80 | {
81 | //resubscribe before processing new value to prevent missing updates
82 | iProperty.Subscribe(iStatus);
83 | SetActive();
84 |
85 | if (iBatteryLevelObserver)
86 | {
87 | TInt keyValue;
88 | if (iProperty.Get(keyValue) == KErrNotFound)
89 | {
90 | // property deleted
91 | iBatteryLevelObserver->HandleBatteryLevelChangeL(EBatteryLevelUnknown);
92 | }
93 | else
94 | {
95 | iBatteryLevelObserver->HandleBatteryLevelChangeL((EPSHWRMBatteryLevel)keyValue);
96 | }
97 | }
98 | }
99 |
100 | // End of File
101 |
--------------------------------------------------------------------------------
/src/ChargingStatus.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : ChargingStatus.h
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Charging status notifier.
7 | ============================================================================
8 | */
9 |
10 | // INCLUDE FILES
11 | #include "ChargingStatus.h"
12 |
13 | // ============================ MEMBER FUNCTIONS ==============================
14 |
15 | // ----------------------------------------------------------------------------
16 | // CChargingStatus::CChargingStatus()
17 | // Constructor.
18 | // ----------------------------------------------------------------------------
19 | //
20 | CChargingStatus::CChargingStatus(MChargingStatusObserver* aObserver) :
21 | CActive(CActive::EPriorityStandard),
22 | iChargingStatusObserver(aObserver)
23 | {
24 | }
25 |
26 | // ----------------------------------------------------------------------------
27 | // CChargingStatus::NewL()
28 | // Two-phased constructor.
29 | // ----------------------------------------------------------------------------
30 | //
31 | CChargingStatus* CChargingStatus::NewL(MChargingStatusObserver* aObserver)
32 | {
33 | CChargingStatus* self = new(ELeave) CChargingStatus(aObserver);
34 | CleanupStack::PushL(self);
35 | self->ConstructL();
36 | CleanupStack::Pop(self);
37 | return self;
38 | }
39 |
40 | // ----------------------------------------------------------------------------
41 | // CChargingStatus::ConstructL()
42 | // Perform second phase construction of this object.
43 | // ----------------------------------------------------------------------------
44 | //
45 | void CChargingStatus::ConstructL()
46 | {
47 | User::LeaveIfError(iProperty.Attach(KPSUidHWRMPowerState, KHWRMChargingStatus));
48 | CActiveScheduler::Add(this);
49 | // initial subscription and process current property value
50 | RunL();
51 | }
52 |
53 | // ----------------------------------------------------------------------------
54 | // CChargingStatus::~CChargingStatus()
55 | // Destructor.
56 | // ----------------------------------------------------------------------------
57 | //
58 | CChargingStatus::~CChargingStatus()
59 | {
60 | Cancel();
61 | iProperty.Close();
62 | }
63 |
64 | // ----------------------------------------------------------------------------
65 | // CChargingStatus::DoCancel()
66 | // Cancel any outstanding requests.
67 | // ----------------------------------------------------------------------------
68 | //
69 | void CChargingStatus::DoCancel()
70 | {
71 | iProperty.Cancel();
72 | }
73 |
74 | // ----------------------------------------------------------------------------
75 | // CChargingStatus::RunL()
76 | // Respond to an event.
77 | // ----------------------------------------------------------------------------
78 | //
79 | void CChargingStatus::RunL()
80 | {
81 | //resubscribe before processing new value to prevent missing updates
82 | iProperty.Subscribe(iStatus);
83 | SetActive();
84 |
85 | if (iChargingStatusObserver)
86 | {
87 | TInt keyValue;
88 | if (iProperty.Get(keyValue) == KErrNotFound)
89 | {
90 | // property deleted
91 | iChargingStatusObserver->HandleChargingStatusChangeL(EChargingStatusError);
92 | }
93 | else
94 | {
95 | iChargingStatusObserver->HandleChargingStatusChangeL((EPSHWRMChargingStatus)keyValue);
96 | }
97 | }
98 | }
99 |
100 | // End of File
101 |
--------------------------------------------------------------------------------
/src/RFterm.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFterm.cpp
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Main application class
7 | ============================================================================
8 | */
9 |
10 | // INCLUDE FILES
11 | #include
12 | #include "RFtermApplication.h"
13 |
14 | LOCAL_C CApaApplication* NewApplication()
15 | {
16 | return new CRFtermApplication;
17 | }
18 |
19 | GLDEF_C TInt E32Main()
20 | {
21 | return EikStart::RunApplication(NewApplication);
22 | }
23 |
24 |
--------------------------------------------------------------------------------
/src/RFtermApplication.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermApplication.cpp
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Main application class
7 | ============================================================================
8 | */
9 |
10 | // INCLUDE FILES
11 | #include "RFterm.hrh"
12 | #include "RFtermDocument.h"
13 | #include "RFtermApplication.h"
14 |
15 | // ============================ MEMBER FUNCTIONS ===============================
16 |
17 | // -----------------------------------------------------------------------------
18 | // CRFtermApplication::CreateDocumentL()
19 | // Creates CApaDocument object
20 | // -----------------------------------------------------------------------------
21 | //
22 | CApaDocument* CRFtermApplication::CreateDocumentL()
23 | {
24 | // Create an RFterm document, and return a pointer to it
25 | return CRFtermDocument::NewL(*this);
26 | }
27 |
28 | // -----------------------------------------------------------------------------
29 | // CRFtermApplication::AppDllUid()
30 | // Returns application UID
31 | // -----------------------------------------------------------------------------
32 | //
33 | TUid CRFtermApplication::AppDllUid() const
34 | {
35 | // Return the UID for the RFterm application
36 | return KUidRFtermApp;
37 | }
38 |
39 | // End of File
40 |
--------------------------------------------------------------------------------
/src/RFtermBatteryStatus.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermBatteryStatus.h
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Battery status notifier.
7 | ============================================================================
8 | */
9 |
10 | // INCLUDE FILES
11 | #include "RFtermBatteryStatus.h"
12 |
13 | // ============================ MEMBER FUNCTIONS ==============================
14 |
15 | // ----------------------------------------------------------------------------
16 | // CRFtermBatteryStatus::CRFtermBatteryStatus()
17 | // Constructor.
18 | // ----------------------------------------------------------------------------
19 | //
20 | CRFtermBatteryStatus::CRFtermBatteryStatus(MRFtermBatteryStatusObserver* aObserver) :
21 | iBatteryLevelValue(EBatteryLevelUnknown),
22 | iChargingStatusValue(EChargingStatusNotConnected),
23 | iObserver(aObserver)
24 | {
25 | }
26 |
27 | // ----------------------------------------------------------------------------
28 | // CRFtermBatteryStatus::NewL()
29 | // Two-phased constructor.
30 | // ----------------------------------------------------------------------------
31 | //
32 | CRFtermBatteryStatus* CRFtermBatteryStatus::NewL(MRFtermBatteryStatusObserver* aObserver)
33 | {
34 | CRFtermBatteryStatus* self = new(ELeave) CRFtermBatteryStatus(aObserver);
35 | CleanupStack::PushL(self);
36 | self->ConstructL();
37 | CleanupStack::Pop(self);
38 | return self;
39 | }
40 |
41 | // ----------------------------------------------------------------------------
42 | // CRFtermBatteryStatus::ConstructL()
43 | // Perform second phase construction of this object.
44 | // ----------------------------------------------------------------------------
45 | //
46 | void CRFtermBatteryStatus::ConstructL()
47 | {
48 | iBatteryLevel = CBatteryLevel::NewL(this);
49 | iChargingStatus = CChargingStatus::NewL(this);
50 | }
51 |
52 | // ----------------------------------------------------------------------------
53 | // CRFtermBatteryStatus::~CRFtermBatteryStatus()
54 | // Destructor.
55 | // ----------------------------------------------------------------------------
56 | //
57 | CRFtermBatteryStatus::~CRFtermBatteryStatus()
58 | {
59 | delete iChargingStatus;
60 | iChargingStatus = NULL;
61 |
62 | delete iBatteryLevel;
63 | iBatteryLevel = NULL;
64 | }
65 |
66 | // ----------------------------------------------------------------------------
67 | // CRFtermBatteryStatus::IsOK()
68 | // Get status of the battery.
69 | // ----------------------------------------------------------------------------
70 | //
71 | TBool CRFtermBatteryStatus::IsOK()
72 | {
73 | if (iBatteryLevelValue > EBatteryLevelLevel2 || iChargingStatusValue >= EChargingStatusCharging)
74 | {
75 | return ETrue;
76 | }
77 | return EFalse;
78 | }
79 |
80 | // ----------------------------------------------------------------------------
81 | // CRFtermBatteryStatus::HandleBatteryLevelChangeL()
82 | // Battery level change notify.
83 | // ----------------------------------------------------------------------------
84 | //
85 | void CRFtermBatteryStatus::HandleBatteryLevelChangeL(EPSHWRMBatteryLevel aBatteryLevel)
86 | {
87 | TBool prevStatus = IsOK();
88 | iBatteryLevelValue = aBatteryLevel;
89 | TBool newStatus = IsOK();
90 | if (iObserver && prevStatus != newStatus)
91 | {
92 | iObserver->HandleBatteryStatusChangeL();
93 | }
94 | }
95 |
96 | // ----------------------------------------------------------------------------
97 | // CRFtermBatteryStatus::HandleChargingStatusChangeL()
98 | // Charging status change notify.
99 | // ----------------------------------------------------------------------------
100 | //
101 | void CRFtermBatteryStatus::HandleChargingStatusChangeL(EPSHWRMChargingStatus aChargingStatus)
102 | {
103 | TBool prevStatus = IsOK();
104 | iChargingStatusValue = aChargingStatus;
105 | TBool newStatus = IsOK();
106 | if (iObserver && prevStatus != newStatus)
107 | {
108 | iObserver->HandleBatteryStatusChangeL();
109 | }
110 | }
111 |
112 | // End of File
113 |
--------------------------------------------------------------------------------
/src/RFtermBtServiceAdvertiser.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermBtServiceAdvertiser.cpp
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Advertises a service in the SDP database.
7 | ============================================================================
8 | */
9 |
10 | #include
11 | #include
12 | #include
13 | #include "RFtermBtServiceAdvertiser.h"
14 | #include "RFterm.pan"
15 | #include "RFtermConstants.h"
16 |
17 | // ----------------------------------------------------------------------------
18 | // CRFtermBtServiceAdvertiser::NewL()
19 | // Two-phased constructor.
20 | // ----------------------------------------------------------------------------
21 | //
22 | CRFtermBtServiceAdvertiser* CRFtermBtServiceAdvertiser::NewL()
23 | {
24 | CRFtermBtServiceAdvertiser* self = CRFtermBtServiceAdvertiser::NewLC();
25 | CleanupStack::Pop(self);
26 | return self;
27 | }
28 |
29 | // ----------------------------------------------------------------------------
30 | // CRFtermBtServiceAdvertiser::NewLC()
31 | // Two-phased constructor.
32 | // ----------------------------------------------------------------------------
33 | //
34 | CRFtermBtServiceAdvertiser* CRFtermBtServiceAdvertiser::NewLC()
35 | {
36 | CRFtermBtServiceAdvertiser* self = new (ELeave) CRFtermBtServiceAdvertiser();
37 | CleanupStack::PushL(self);
38 | self->ConstructL();
39 | return self;
40 | }
41 |
42 | // ----------------------------------------------------------------------------
43 | // CRFtermBtServiceAdvertiser::CRFtermBtServiceAdvertiser()
44 | // Constructor.
45 | // ----------------------------------------------------------------------------
46 | //
47 | CRFtermBtServiceAdvertiser::CRFtermBtServiceAdvertiser() :
48 | iRecord(0),
49 | iIsConnected(EFalse)
50 | {
51 | // no implementation required
52 | }
53 |
54 | // ----------------------------------------------------------------------------
55 | // CRFtermBtServiceAdvertiser::~CRFtermBtServiceAdvertiser()
56 | // Destructor.
57 | // ----------------------------------------------------------------------------
58 | //
59 | CRFtermBtServiceAdvertiser::~CRFtermBtServiceAdvertiser()
60 | {
61 | if (IsAdvertising())
62 | {
63 | TRAPD(err, StopAdvertisingL());
64 | if (err != KErrNone)
65 | {
66 | User::Panic(KPanicBTServiceAdvertiser, err);
67 | }
68 | }
69 |
70 | iSdpDatabase.Close();
71 | iSdpSession.Close();
72 |
73 | delete iServiceName;
74 | delete iServiceDescription;
75 | }
76 |
77 | // ----------------------------------------------------------------------------
78 | // CRFtermBtServiceAdvertiser::ConstructL()
79 | // Perform second phase construction of this object.
80 | // ----------------------------------------------------------------------------
81 | //
82 | void CRFtermBtServiceAdvertiser::ConstructL()
83 | {
84 | iServiceName = StringLoader::LoadL(R_RFTERM_SERVICE_NAME);
85 | iServiceDescription = StringLoader::LoadL(R_RFTERM_SERVICE_DESCRIPTION);
86 | }
87 |
88 | // ----------------------------------------------------------------------------
89 | // CRFtermBtServiceAdvertiser::ConnectL()
90 | // Connect to the SDP database.
91 | // ----------------------------------------------------------------------------
92 | //
93 | void CRFtermBtServiceAdvertiser::ConnectL()
94 | {
95 | if (!iIsConnected)
96 | {
97 | User::LeaveIfError(iSdpSession.Connect());
98 | User::LeaveIfError(iSdpDatabase.Open(iSdpSession));
99 | iIsConnected = ETrue;
100 | }
101 | }
102 |
103 | // ----------------------------------------------------------------------------
104 | // CRFtermBtServiceAdvertiser::StartAdvertisingL()
105 | // Start the advertising of this service.
106 | // ----------------------------------------------------------------------------
107 | //
108 | void CRFtermBtServiceAdvertiser::StartAdvertisingL(TInt aPort)
109 | {
110 | if (IsAdvertising())
111 | {
112 | // could be advertising on a different port
113 | StopAdvertisingL();
114 | }
115 | if (! iIsConnected)
116 | {
117 | ConnectL();
118 | }
119 | iSdpDatabase.CreateServiceRecordL(ServiceClass(), iRecord);
120 |
121 | // add a Protocol to the record
122 | CSdpAttrValueDES* vProtocolDescriptor = CSdpAttrValueDES::NewDESL(NULL);
123 | CleanupStack::PushL(vProtocolDescriptor);
124 |
125 | BuildProtocolDescriptionL(vProtocolDescriptor,aPort);
126 |
127 | iSdpDatabase.UpdateAttributeL(iRecord, KSdpAttrIdProtocolDescriptorList,
128 | *vProtocolDescriptor);
129 |
130 | CleanupStack::PopAndDestroy(vProtocolDescriptor);
131 |
132 | // Add a name to the record
133 | iSdpDatabase.UpdateAttributeL(iRecord,
134 | KSdpAttrIdBasePrimaryLanguage +
135 | KSdpAttrIdOffsetServiceName,
136 | ServiceName());
137 |
138 | // Add a description to the record
139 | iSdpDatabase.UpdateAttributeL(iRecord,
140 | KSdpAttrIdBasePrimaryLanguage +
141 | KSdpAttrIdOffsetServiceDescription,
142 | ServiceDescription());
143 |
144 | }
145 |
146 | // ----------------------------------------------------------------------------
147 | // CRFtermBtServiceAdvertiser::UpdateAvailabilityL()
148 | // Update the service availability field of the service record.
149 | // ----------------------------------------------------------------------------
150 | //
151 | void CRFtermBtServiceAdvertiser::UpdateAvailabilityL(TBool aIsAvailable)
152 | {
153 | TUint state;
154 | if (aIsAvailable)
155 | {
156 | state = 0xFF; // Fully unused
157 | }
158 | else
159 | {
160 | state = 0x00; // Fully used -> can't connect
161 | }
162 |
163 | // Update the availibility attribute field
164 | iSdpDatabase.UpdateAttributeL(iRecord,
165 | KSdpAttrIdServiceAvailability,
166 | state);
167 |
168 | // Mark the record as changed - by increasing its state number (version)
169 | iSdpDatabase.UpdateAttributeL(iRecord,
170 | KSdpAttrIdServiceRecordState,
171 | ++iRecordState);
172 | }
173 |
174 | // ----------------------------------------------------------------------------
175 | // CRFtermBtServiceAdvertiser::StopAdvertisingL()
176 | // Stop advertising this service. Remove the record from the sdp database.
177 | // ----------------------------------------------------------------------------
178 | //
179 | void CRFtermBtServiceAdvertiser::StopAdvertisingL()
180 | {
181 | if (IsAdvertising())
182 | {
183 | iSdpDatabase.DeleteRecordL(iRecord);
184 | iRecord = 0;
185 | }
186 | }
187 |
188 | // ----------------------------------------------------------------------------
189 | // CRFtermBtServiceAdvertiser::IsAdvertising()
190 | // Does the SDP database contain a record for this service.
191 | // ----------------------------------------------------------------------------
192 | //
193 | TBool CRFtermBtServiceAdvertiser::IsAdvertising()
194 | {
195 | return iRecord != 0;
196 | }
197 |
198 | // -----------------------------------------------------------------------------
199 | // CRFtermBtServiceAdvertiser::BuildProtocolDescriptionL()
200 | // Builds the protocol description.
201 | // -----------------------------------------------------------------------------
202 | //
203 | void CRFtermBtServiceAdvertiser
204 | ::BuildProtocolDescriptionL(CSdpAttrValueDES* aProtocolDescriptor, TInt aPort)
205 | {
206 | TBuf8<1> channel;
207 | channel.Append((TChar)aPort);
208 |
209 | aProtocolDescriptor
210 | ->StartListL()
211 | ->BuildDESL()
212 | ->StartListL() // Details of lowest level protocol
213 | ->BuildUUIDL(KL2CAP)
214 | ->EndListL()
215 |
216 | ->BuildDESL()
217 | ->StartListL()
218 | ->BuildUUIDL(KRFCOMM)
219 | ->BuildUintL(channel)
220 | ->EndListL()
221 | ->EndListL();
222 | }
223 |
224 | // ----------------------------------------------------------------------------
225 | // CRFtermBtServiceAdvertiser::ServiceName()
226 | // ----------------------------------------------------------------------------
227 | //
228 | const TDesC& CRFtermBtServiceAdvertiser::ServiceName()
229 | {
230 | return *iServiceName;
231 | }
232 |
233 | // ----------------------------------------------------------------------------
234 | // CRFtermBtServiceAdvertiser::ServiceDescription()
235 | // ----------------------------------------------------------------------------
236 | //
237 | const TDesC& CRFtermBtServiceAdvertiser::ServiceDescription()
238 | {
239 | return *iServiceDescription;
240 | }
241 |
242 | // ----------------------------------------------------------------------------
243 | // CRFtermBtServiceAdvertiser::ServiceClass()
244 | // ----------------------------------------------------------------------------
245 | //
246 | TInt CRFtermBtServiceAdvertiser::ServiceClass()
247 | {
248 | return KServiceClass;
249 | }
250 |
251 | // End of File
252 |
--------------------------------------------------------------------------------
/src/RFtermDocument.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermDocument.cpp
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : CRFtermDocument implementation
7 | ============================================================================
8 | */
9 |
10 | // INCLUDE FILES
11 | #include "RFtermAppUi.h"
12 | #include "RFtermDocument.h"
13 |
14 | // ============================ MEMBER FUNCTIONS ===============================
15 |
16 | // -----------------------------------------------------------------------------
17 | // CRFtermDocument::NewL()
18 | // Two-phased constructor.
19 | // -----------------------------------------------------------------------------
20 | //
21 | CRFtermDocument* CRFtermDocument::NewL(CEikApplication& aApp)
22 | {
23 | CRFtermDocument* self = NewLC(aApp);
24 | CleanupStack::Pop(self);
25 | return self;
26 | }
27 |
28 | // -----------------------------------------------------------------------------
29 | // CRFtermDocument::NewLC()
30 | // Two-phased constructor.
31 | // -----------------------------------------------------------------------------
32 | //
33 | CRFtermDocument* CRFtermDocument::NewLC(CEikApplication& aApp)
34 | {
35 | CRFtermDocument* self = new (ELeave) CRFtermDocument(aApp);
36 |
37 | CleanupStack::PushL(self);
38 | self->ConstructL();
39 | return self;
40 | }
41 |
42 | // -----------------------------------------------------------------------------
43 | // CRFtermDocument::ConstructL()
44 | // Symbian 2nd phase constructor can leave.
45 | // -----------------------------------------------------------------------------
46 | //
47 | void CRFtermDocument::ConstructL()
48 | {
49 | // No implementation required
50 | }
51 |
52 | // -----------------------------------------------------------------------------
53 | // CRFtermDocument::CRFtermDocument()
54 | // C++ default constructor can NOT contain any code, that might leave.
55 | // -----------------------------------------------------------------------------
56 | //
57 | CRFtermDocument::CRFtermDocument(CEikApplication& aApp) :
58 | CAknDocument(aApp)
59 | {
60 | // No implementation required
61 | }
62 |
63 | // ---------------------------------------------------------------------------
64 | // CRFtermDocument::~CRFtermDocument()
65 | // Destructor.
66 | // ---------------------------------------------------------------------------
67 | //
68 | CRFtermDocument::~CRFtermDocument()
69 | {
70 | // No implementation required
71 | }
72 |
73 | // ---------------------------------------------------------------------------
74 | // CRFtermDocument::CreateAppUiL()
75 | // Constructs CreateAppUi.
76 | // ---------------------------------------------------------------------------
77 | //
78 | CEikAppUi* CRFtermDocument::CreateAppUiL()
79 | {
80 | // Create the application user interface, and return a pointer to it;
81 | // the framework takes ownership of this object
82 | return new (ELeave) CRFtermAppUi;
83 | }
84 |
85 | // End of File
86 |
--------------------------------------------------------------------------------
/src/RFtermScrollBars.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermScrollBars.cpp
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Custom scrollbars control.
7 | ============================================================================
8 | */
9 |
10 | #include "RFtermScrollBars.h"
11 |
12 | CRFtermScrollBars::CRFtermScrollBars(const CCoeControl *aParent)
13 | : iVIsVisible(EFalse)
14 | , iHIsVisible(EFalse)
15 | , iObserver(NULL)
16 | , iBgColor(KRgbBlack)
17 | , iSbColor(KDefaultFontColor)
18 | {
19 | SetContainerWindowL(*aParent);
20 | }
21 |
22 | CRFtermScrollBars::~CRFtermScrollBars()
23 | {
24 | }
25 |
26 | void CRFtermScrollBars::DrawVScrollBar(CWindowGc& aGc) const
27 | {
28 | aGc.SetPenStyle(CGraphicsContext::ENullPen);
29 | aGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
30 | aGc.SetBrushColor(iBgColor);
31 | aGc.Clear(iVBackgroundRect);
32 | if (iVScrollBarIsActive)
33 | {
34 | TRgb hlColor = iSbColor;
35 | HighlightColor(hlColor);
36 | aGc.SetBrushColor(hlColor);
37 | }
38 | else
39 | {
40 | aGc.SetBrushColor(iSbColor);
41 | }
42 | aGc.DrawRect(iVThumbRect);
43 | }
44 |
45 | void CRFtermScrollBars::DrawHScrollBar(CWindowGc& aGc) const
46 | {
47 | aGc.SetPenStyle(CGraphicsContext::ENullPen);
48 | aGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
49 | aGc.SetBrushColor(iBgColor);
50 | aGc.Clear(iHBackgroundRect);
51 | if (iHScrollBarIsActive)
52 | {
53 | TRgb hlColor = iSbColor;
54 | HighlightColor(hlColor);
55 | aGc.SetBrushColor(hlColor);
56 | }
57 | else
58 | {
59 | aGc.SetBrushColor(iSbColor);
60 | }
61 | aGc.DrawRect(iHThumbRect);
62 | }
63 |
64 | void CRFtermScrollBars::DrawCorner(CWindowGc& aGc) const
65 | {
66 | aGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
67 | aGc.SetBrushColor(iBgColor);
68 | aGc.Clear(iCornerBackgroundRect);
69 | }
70 |
71 | void CRFtermScrollBars::Draw(const TRect& aRect) const
72 | {
73 | CWindowGc& gc = SystemGc();
74 | gc.SetClippingRect(aRect);
75 |
76 | if (aRect.Intersects(iVBackgroundRect))
77 | {
78 | DrawVScrollBar(gc);
79 | }
80 | if (aRect.Intersects(iHBackgroundRect))
81 | {
82 | DrawHScrollBar(gc);
83 | }
84 | if (aRect.Intersects(iCornerBackgroundRect))
85 | {
86 | DrawCorner(gc);
87 | }
88 | }
89 |
90 | void CRFtermScrollBars::DrawVScrollBarNow() const
91 | {
92 | Window().Invalidate(iVBackgroundRect);
93 | ActivateGc();
94 | Window().BeginRedraw(iVBackgroundRect);
95 | DrawVScrollBar(SystemGc());
96 | Window().EndRedraw();
97 | DeactivateGc();
98 | }
99 |
100 | void CRFtermScrollBars::DrawHScrollBarNow() const
101 | {
102 | Window().Invalidate(iHBackgroundRect);
103 | ActivateGc();
104 | Window().BeginRedraw(iHBackgroundRect);
105 | DrawHScrollBar(SystemGc());
106 | Window().EndRedraw();
107 | DeactivateGc();
108 | }
109 |
110 | void CRFtermScrollBars::DrawCornerNow() const
111 | {
112 | Window().Invalidate(iCornerBackgroundRect);
113 | ActivateGc();
114 | Window().BeginRedraw(iCornerBackgroundRect);
115 | DrawCorner(SystemGc());
116 | Window().EndRedraw();
117 | DeactivateGc();
118 | }
119 |
120 | void CRFtermScrollBars::SizeChanged()
121 | {
122 | Update(EFalse);
123 | }
124 |
125 | void CRFtermScrollBars::HandlePointerEventL(const TPointerEvent& aPointerEvent)
126 | {
127 | if (TPointerEvent::EButton1Down == aPointerEvent.iType)
128 | {
129 | iVScrollBarIsActive = EFalse;
130 | iHScrollBarIsActive = EFalse;
131 | iPrevPointerPos = aPointerEvent.iPosition;
132 | TRect vSensorRect = iVBackgroundRect;
133 | vSensorRect.iTl.iX -= KRFtermScrollBarSensorBreadth;
134 | TRect hSensorRect = iHBackgroundRect;
135 | vSensorRect.iTl.iY -= KRFtermScrollBarSensorBreadth;
136 | if (vSensorRect.Contains(aPointerEvent.iPosition))
137 | {
138 | iVScrollBarIsActive = ETrue;
139 | }
140 | else if (hSensorRect.Contains(aPointerEvent.iPosition))
141 | {
142 | iHScrollBarIsActive = ETrue;
143 | }
144 | }
145 | else if (TPointerEvent::EDrag == aPointerEvent.iType)
146 | {
147 | if (iVScrollBarIsActive)
148 | {
149 | TInt deltaY = aPointerEvent.iPosition.iY - iPrevPointerPos.iY;
150 | if (deltaY < 0 && -(deltaY) > iVThumbRect.iTl.iY)
151 | {
152 | // Limit vertical scrollbar movement on upward direction.
153 | deltaY = -iVThumbRect.iTl.iY;
154 | }
155 | else if (deltaY > (iVBackgroundRect.Height() - iVThumbRect.iTl.iY - iVThumbRect.Height()))
156 | {
157 | // Limit vertical scrollbar movement on downward direction.
158 | deltaY = iVBackgroundRect.Height() - iVThumbRect.iTl.iY - iVThumbRect.Height();
159 | }
160 | iVThumbRect.Move(0, deltaY);
161 |
162 | DrawVScrollBarNow();
163 |
164 | iVModel.iPos = iVModel.iTotal * iVThumbRect.iTl.iY / iVBackgroundRect.Height();
165 | if (iObserver)
166 | {
167 | iObserver->HandleScrollEventL(EVerticalScrollBar, iVModel);
168 | }
169 |
170 | iPrevPointerPos = aPointerEvent.iPosition;
171 | }
172 | else if (iHScrollBarIsActive)
173 | {
174 | TInt deltaX = aPointerEvent.iPosition.iX - iPrevPointerPos.iX;
175 | if (deltaX < 0 && -(deltaX) > iHThumbRect.iTl.iX)
176 | {
177 | // Limit vertical scrollbar movement on leftward direction.
178 | deltaX = -iHThumbRect.iTl.iX;
179 | }
180 | else if (deltaX > (iHBackgroundRect.Width() - iHThumbRect.iTl.iX - iHThumbRect.Width()))
181 | {
182 | // Limit vertical scrollbar movement on rightward direction.
183 | deltaX = iHBackgroundRect.Width() - iHThumbRect.iTl.iX - iHThumbRect.Width();
184 | }
185 | iHThumbRect.Move(deltaX, 0);
186 |
187 | DrawHScrollBarNow();
188 |
189 | iHModel.iPos = iHModel.iTotal * iHThumbRect.iTl.iX / iHBackgroundRect.Width();
190 | if (iObserver)
191 | {
192 | iObserver->HandleScrollEventL(EHorizontalScrollBar, iHModel);
193 | }
194 |
195 | iPrevPointerPos = aPointerEvent.iPosition;
196 |
197 | }
198 | }
199 | else if (TPointerEvent::EButton1Up == aPointerEvent.iType)
200 | {
201 | if (iVScrollBarIsActive)
202 | {
203 | iVScrollBarIsActive = EFalse;
204 | DrawVScrollBarNow();
205 | }
206 | if (iHScrollBarIsActive)
207 | {
208 | iHScrollBarIsActive = EFalse;
209 | DrawHScrollBarNow();
210 | }
211 | }
212 | }
213 |
214 | void CRFtermScrollBars::SetModel(TRFtermScrollBarModel& aTarget, const TRFtermScrollBarModel& aModel)
215 | {
216 | aTarget = aModel;
217 | if (aTarget.iTotal < 1)
218 | {
219 | aTarget.iTotal = 1;
220 | }
221 | if (aTarget.iVisible > aTarget.iTotal)
222 | {
223 | aTarget.iVisible = aTarget.iTotal;
224 | }
225 | if (aTarget.iVisible < 1)
226 | {
227 | aTarget.iVisible = 1;
228 | }
229 | if (aTarget.iPos > (aTarget.iTotal - aTarget.iVisible))
230 | {
231 | aTarget.iPos = aTarget.iTotal - aTarget.iVisible;
232 | }
233 | if (aTarget.iPos < 0)
234 | {
235 | aTarget.iPos = -(aTarget.iPos);
236 | aTarget.iTotal += aTarget.iPos;
237 | }
238 | }
239 |
240 | void CRFtermScrollBars::SetVModel(const TRFtermScrollBarModel& aModel)
241 | {
242 | SetModel(iVModel, aModel);
243 | }
244 |
245 | void CRFtermScrollBars::SetHModel(const TRFtermScrollBarModel& aModel)
246 | {
247 | SetModel(iHModel, aModel);
248 | }
249 |
250 | void CRFtermScrollBars::SetVisibility(TBool aVertical, TBool aHorizontal)
251 | {
252 | if (iVIsVisible != aVertical || iHIsVisible != aHorizontal)
253 | {
254 | iVIsVisible = aVertical;
255 | iHIsVisible = aHorizontal;
256 | if (iObserver)
257 | {
258 | iObserver->HandleScrollBarVisibilityChangeL(
259 | aVertical, aHorizontal);
260 | }
261 | }
262 | }
263 |
264 | void CRFtermScrollBars::Update(TBool aDrawNow)
265 | {
266 | TRect windowRect = Rect();
267 | TRect restRect;
268 | GetFreeRect(restRect);
269 |
270 | iVBackgroundRect = TRect();
271 | iVBackgroundRect.Move(windowRect.Width(), 0);
272 | iVBackgroundRect.SetHeight(windowRect.Height());
273 | iVThumbRect = iVBackgroundRect;
274 | if (iVIsVisible)
275 | {
276 | iVBackgroundRect.iTl.iX -= KRFtermScrollBarBreadth;
277 | if (iHIsVisible)
278 | {
279 | iVBackgroundRect.iBr.iY -= KRFtermScrollBarBreadth;
280 | }
281 |
282 | iVThumbRect = iVBackgroundRect;
283 | TInt thumbSize = iVModel.iVisible * restRect.Height() / iVModel.iTotal;
284 | TInt thumbPos = iVModel.iPos * restRect.Height() / iVModel.iTotal;
285 | iVThumbRect.Move(0, thumbPos);
286 | iVThumbRect.SetHeight(thumbSize);
287 |
288 | if (aDrawNow)
289 | {
290 | DrawVScrollBarNow();
291 | }
292 | }
293 |
294 | iHBackgroundRect = TRect();
295 | iHBackgroundRect.Move(0, windowRect.Height());
296 | iHBackgroundRect.SetWidth(windowRect.Width());
297 | iHThumbRect = iHBackgroundRect;
298 | if (iHIsVisible)
299 | {
300 | iHBackgroundRect.iTl.iY -= KRFtermScrollBarBreadth;
301 | if (iVIsVisible)
302 | {
303 | iHBackgroundRect.iBr.iX -= KRFtermScrollBarBreadth;
304 | }
305 |
306 | iHThumbRect = iHBackgroundRect;
307 | TInt thumbSize = iHModel.iVisible * restRect.Width() / iHModel.iTotal;
308 | TInt thumbPos = iHModel.iPos * restRect.Width() / iHModel.iTotal;
309 | iHThumbRect.Move(thumbPos, 0);
310 | iHThumbRect.SetWidth(thumbSize);
311 |
312 | if (aDrawNow)
313 | {
314 | DrawHScrollBarNow();
315 | }
316 | }
317 |
318 | iCornerBackgroundRect = TRect();
319 | iCornerBackgroundRect.Move(windowRect.Width(), windowRect.Height());
320 | if (iVIsVisible && iHIsVisible)
321 | {
322 | // Bottom right corner area.
323 | iCornerBackgroundRect.iTl.iX -= KRFtermScrollBarBreadth;
324 | iCornerBackgroundRect.iTl.iY -= KRFtermScrollBarBreadth;
325 |
326 | if (aDrawNow)
327 | {
328 | DrawCornerNow();
329 | }
330 | }
331 | }
332 |
333 | void CRFtermScrollBars::SetColors(TRgb aBg, TRgb aSb)
334 | {
335 | iBgColor = aBg;
336 | iSbColor = aSb;
337 | DrawDeferred();
338 | }
339 |
340 | void CRFtermScrollBars::HighlightColor(TRgb& aColor) const
341 | {
342 | const TInt hlValue = 50;
343 | TInt r = aColor.Red();
344 | TInt g = aColor.Green();
345 | TInt b = aColor.Blue();
346 | TInt maxColor = Max(r, Max(g, b));
347 | if (maxColor < 127)
348 | {
349 | r = Min(255, r + hlValue);
350 | g = Min(255, g + hlValue);
351 | b = Min(255, b + hlValue);
352 | }
353 | else
354 | {
355 | r = Max(0, r - hlValue);
356 | g = Max(0, g - hlValue);
357 | b = Max(0, b - hlValue);
358 | }
359 | aColor = TRgb(r, g, b);
360 | }
361 |
362 | void CRFtermScrollBars::GetFreeRect(TRect& aRect) const
363 | {
364 | TRect windowRect = Rect();
365 | aRect = windowRect;
366 | if (iVIsVisible)
367 | {
368 | aRect.SetWidth(windowRect.Width() - KRFtermScrollBarBreadth);
369 | }
370 | if (iHIsVisible)
371 | {
372 | aRect.SetHeight(windowRect.Height() - KRFtermScrollBarBreadth);
373 | }
374 | }
375 |
376 | void CRFtermScrollBars::SetObserver(MRFtermScrollBarsObserver* aObserver)
377 | {
378 | iObserver = aObserver;
379 | }
380 |
381 | void CRFtermScrollBars::HandleViewRectChangedL(const TRect& aContentRect, const TRect& aViewRect)
382 | {
383 | TBool vIsVisible = EFalse;
384 | TBool hIsVisible = EFalse;
385 |
386 | TRect outputRect = aViewRect;
387 |
388 | vIsVisible = aContentRect.Height() > outputRect.Height();
389 | hIsVisible = aContentRect.Width() > outputRect.Width();
390 |
391 | outputRect = aViewRect;
392 |
393 | TRFtermScrollBarModel model;
394 |
395 | model.iTotal = aContentRect.Height();
396 | model.iVisible = outputRect.Height();
397 | model.iPos = outputRect.iTl.iY;
398 | SetVModel(model);
399 |
400 | model.iTotal = aContentRect.Width();
401 | model.iVisible = outputRect.Width();
402 | model.iPos = outputRect.iTl.iX;
403 | SetHModel(model);
404 |
405 | SetVisibility(vIsVisible, hIsVisible);
406 |
407 | Update(ETrue);
408 | }
409 |
410 |
--------------------------------------------------------------------------------
/src/RFtermSdpAttributeParser.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermSdpAttributeParser.cpp
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Check an SDP attribute value and read selected parts.
7 | ============================================================================
8 | */
9 |
10 | // INCLUDE FILES
11 | #include
12 |
13 | #include "RFtermSdpAttributeParser.h"
14 | #include "RFtermSdpAttributeParser.pan"
15 | #include "RFtermSdpAttributeNotifier.h"
16 |
17 | // ============================ MEMBER FUNCTIONS ==============================
18 |
19 | // ----------------------------------------------------------------------------
20 | // TRFtermSdpAttributeParser::TRFtermSdpAttributeParser()
21 | // Construct a TRFtermSdpAttributeParser.
22 | // ----------------------------------------------------------------------------
23 | //
24 | TRFtermSdpAttributeParser::TRFtermSdpAttributeParser(
25 | RArray& aNodeList,
26 | MRFtermSdpAttributeNotifier& aObserver) :
27 | iObserver(aObserver),
28 | iNodeList(aNodeList),
29 | iCurrentNodeIndex(0)
30 | {
31 | iCurrentNode = iNodeList[iCurrentNodeIndex];
32 | }
33 |
34 | // ----------------------------------------------------------------------------
35 | // TRFtermSdpAttributeParser::~TRFtermSdpAttributeParser()
36 | // Destructor.
37 | // ----------------------------------------------------------------------------
38 | //
39 | TRFtermSdpAttributeParser::~TRFtermSdpAttributeParser()
40 | {
41 | // No implementation needed
42 | }
43 |
44 | // ----------------------------------------------------------------------------
45 | // TRFtermSdpAttributeParser::HasFinished()
46 | // Check if parsing processed the whole list.
47 | // ----------------------------------------------------------------------------
48 | //
49 | TBool TRFtermSdpAttributeParser::HasFinished() const
50 | {
51 | return (iCurrentNode.Command() == EFinished);
52 | }
53 |
54 | // ----------------------------------------------------------------------------
55 | // TRFtermSdpAttributeParser::VisitAttributeValueL()
56 | // Process a data element.
57 | // ----------------------------------------------------------------------------
58 | //
59 | void TRFtermSdpAttributeParser::VisitAttributeValueL(CSdpAttrValue& aValue,
60 | TSdpElementType aType)
61 | {
62 | switch (iCurrentNode.Command())
63 | {
64 | case ECheckType:
65 | CheckTypeL(aType);
66 | break;
67 |
68 | case ECheckValue:
69 | CheckTypeL(aType);
70 | CheckValueL(aValue);
71 | break;
72 |
73 | case ECheckEnd:
74 | User::Leave(KErrTooBig); //list element contains too many items
75 | break;
76 |
77 | case ESkip:
78 | break; // no checking required
79 |
80 | case EReadValue:
81 | CheckTypeL(aType);
82 | ReadValueL(aValue);
83 | break;
84 |
85 | case EFinished:
86 | User::Leave(KErrEof); // element is after
87 | return; // value should have ended
88 |
89 | default:
90 | Panic(ERFtermSdpAttributeParserInvalidCommand);
91 | }
92 |
93 | AdvanceL();
94 | }
95 |
96 | // ----------------------------------------------------------------------------
97 | // TRFtermSdpAttributeParser::StartListL()
98 | // Process the start of a data element list.
99 | // ----------------------------------------------------------------------------
100 | //
101 | void TRFtermSdpAttributeParser::StartListL(CSdpAttrValueList& /*aList*/)
102 | {
103 | // no checks done here
104 | }
105 |
106 | // ----------------------------------------------------------------------------
107 | // TRFtermSdpAttributeParser::EndListL()
108 | // Process the end of a data element list.
109 | // ----------------------------------------------------------------------------
110 | //
111 | void TRFtermSdpAttributeParser::EndListL()
112 | {
113 | // check we are at the end of a list
114 | if (iCurrentNode.Command() != ECheckEnd)
115 | {
116 | User::Leave(KErrGeneral);
117 | }
118 |
119 | AdvanceL();
120 | }
121 |
122 | // ----------------------------------------------------------------------------
123 | // TRFtermSdpAttributeParser::CheckTypeL()
124 | // Check the type of the current node is the same as the specified type.
125 | // ----------------------------------------------------------------------------
126 | //
127 | void TRFtermSdpAttributeParser::CheckTypeL(TSdpElementType aElementType) const
128 | {
129 | if (iCurrentNode.Type() != aElementType)
130 | {
131 | User::Leave(KErrGeneral);
132 | }
133 | }
134 |
135 | // ----------------------------------------------------------------------------
136 | // TRFtermSdpAttributeParser::CheckValueL()
137 | // Check the value of the current node is the same as the specified type.
138 | // ----------------------------------------------------------------------------
139 | //
140 | void TRFtermSdpAttributeParser::CheckValueL(CSdpAttrValue& aValue) const
141 | {
142 | switch (aValue.Type())
143 | {
144 | case ETypeNil:
145 | Panic(ERFtermSdpAttributeParserNoValue);
146 | break;
147 |
148 | case ETypeUint:
149 | if (aValue.Uint() != (TUint) iCurrentNode.Value())
150 | {
151 | User::Leave(KErrArgument);
152 | }
153 | break;
154 |
155 | case ETypeInt:
156 | if (aValue.Int() != iCurrentNode.Value())
157 | {
158 | User::Leave(KErrArgument);
159 | }
160 | break;
161 |
162 | case ETypeBoolean:
163 | if (aValue.Bool() != iCurrentNode.Value())
164 | {
165 | User::Leave(KErrArgument);
166 | }
167 | break;
168 |
169 | case ETypeUUID:
170 | if (aValue.UUID() != TUUID(iCurrentNode.Value()))
171 | {
172 | User::Leave(KErrArgument);
173 | }
174 | break;
175 |
176 | case ETypeDES:
177 | case ETypeDEA:
178 | Panic(ERFtermSdpAttributeParserValueIsList);
179 | break;
180 |
181 | default:
182 | Panic(ERFtermSdpAttributeParserValueTypeUnsupported);
183 | break;
184 | }
185 | }
186 |
187 | // ----------------------------------------------------------------------------
188 | // TRFtermSdpAttributeParser::ReadValueL()
189 | // Pass the data element value to the observer.
190 | // ----------------------------------------------------------------------------
191 | //
192 | void TRFtermSdpAttributeParser::ReadValueL(CSdpAttrValue& aValue) const
193 | {
194 | iObserver.FoundElementL(iCurrentNode.Value(), aValue);
195 | }
196 |
197 | // ----------------------------------------------------------------------------
198 | // TRFtermSdpAttributeParser::AdvanceL()
199 | // Advance to the next node.
200 | // ----------------------------------------------------------------------------
201 | //
202 | void TRFtermSdpAttributeParser::AdvanceL()
203 | {
204 | // check not at end
205 | if (iCurrentNode.Command() == EFinished)
206 | {
207 | User::Leave(KErrEof);
208 | }
209 |
210 | // move to the next item
211 | iCurrentNode = iNodeList[++iCurrentNodeIndex];
212 | }
213 |
214 | // ----------------------------------------------------------------------------
215 | // TRFtermSdpAttributeParser::TRFtermSdpAttributeNode::TRFtermSdpAttributeNode()
216 | // constructor.
217 | // ----------------------------------------------------------------------------
218 | //
219 | TRFtermSdpAttributeParser::TRFtermSdpAttributeNode::TRFtermSdpAttributeNode()
220 | {
221 | // no implementation needed
222 | }
223 |
224 | // ----------------------------------------------------------------------------
225 | // TRFtermSdpAttributeParser::TRFtermSdpAttributeNode::~TRFtermSdpAttributeNode()
226 | // destructor.
227 | // ----------------------------------------------------------------------------
228 | //
229 | TRFtermSdpAttributeParser::TRFtermSdpAttributeNode::~TRFtermSdpAttributeNode()
230 | {
231 | // no implementation needed
232 | }
233 |
234 | // ----------------------------------------------------------------------------
235 | // TRFtermSdpAttributeParser::TRFtermSdpAttributeNode::SetCommand(TNodeCommand aCommand)
236 | // set iCommand member variable.
237 | // ----------------------------------------------------------------------------
238 | //
239 | void TRFtermSdpAttributeParser::TRFtermSdpAttributeNode::SetCommand(TNodeCommand aCommand)
240 | {
241 | iCommand = aCommand;
242 | }
243 |
244 | // ----------------------------------------------------------------------------
245 | // TRFtermSdpAttributeParser::TRFtermSdpAttributeNode::SetType(TRFtermSdpElementType aType)
246 | // set iType member variable.
247 | // ----------------------------------------------------------------------------
248 | //
249 | void TRFtermSdpAttributeParser::TRFtermSdpAttributeNode::SetType(TSdpElementType aType)
250 | {
251 | iType = aType;
252 | }
253 |
254 | // ----------------------------------------------------------------------------
255 | // void TRFtermSdpAttributeParser::TRFtermSdpAttributeNode::SetValue(TInt aValue)
256 | // set iValue member variable.
257 | // ----------------------------------------------------------------------------
258 | //
259 | void TRFtermSdpAttributeParser::TRFtermSdpAttributeNode::SetValue(TInt aValue)
260 | {
261 | iValue = aValue;
262 | }
263 |
264 | // ----------------------------------------------------------------------------
265 | // TRFtermSdpAttributeParser::TRFtermSdpAttributeNode::Command()
266 | // get iCommand member variable value.
267 | // ----------------------------------------------------------------------------
268 | //
269 | TRFtermSdpAttributeParser::TNodeCommand TRFtermSdpAttributeParser::TRFtermSdpAttributeNode::Command() const
270 | {
271 | return iCommand;
272 | }
273 |
274 | // ----------------------------------------------------------------------------
275 | // TRFtermSdpAttributeParser::TRFtermSdpAttributeNode::Type()
276 | // get iType member variable value.
277 | // ----------------------------------------------------------------------------
278 | //
279 | TSdpElementType TRFtermSdpAttributeParser::TRFtermSdpAttributeNode::Type() const
280 | {
281 | return iType;
282 | }
283 |
284 | // ----------------------------------------------------------------------------
285 | // TRFtermSdpAttributeParser::TRFtermSdpAttributeNode::Value()
286 | // get iValue member variable value.
287 | // ----------------------------------------------------------------------------
288 | //
289 | TInt TRFtermSdpAttributeParser::TRFtermSdpAttributeNode::Value() const
290 | {
291 | return iValue;
292 | }
293 |
294 | // End of File
295 |
--------------------------------------------------------------------------------
/src/RFtermSettings.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermSettings.cpp
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Application settings.
7 | ============================================================================
8 | */
9 |
10 | #include "RFtermSettings.h"
11 | #include "RFtermConstants.h"
12 |
13 | CRFtermSettings *CRFtermSettings::NewL()
14 | {
15 | CRFtermSettings *self = CRFtermSettings::NewLC();
16 | CleanupStack::Pop(self);
17 | return self;
18 | }
19 |
20 | CRFtermSettings *CRFtermSettings::NewLC()
21 | {
22 | CRFtermSettings *self = new (ELeave) CRFtermSettings();
23 | CleanupStack::PushL(self);
24 | self->ConstructL();
25 | return self;
26 | }
27 |
28 | CRFtermSettings::~CRFtermSettings()
29 | {
30 | iObservers.ResetAndDestroy();
31 | }
32 |
33 | CRFtermSettings::CRFtermSettings()
34 | {
35 | SetDefaultValues(EFalse);
36 | }
37 |
38 | void CRFtermSettings::SetDefaultValues(TBool aNotify)
39 | {
40 | iMessageAddendum = KCRLF;
41 | iMessageHistorySize = 8;
42 | iEcho = ETrue;
43 | iFontSize = 120;
44 | iTabSize = 4;
45 | iFontAntialiasing = EFalse;
46 | iWrapText = EFalse;
47 | iCtrlCharMapping = EMapCRtoCRLF;
48 | iCodePage = ECodePageLatin1;
49 | iSaveNotifies = ETrue;
50 | iBgColor = KRgbBlack;
51 | iFontColor = KDefaultFontColor;
52 | iCursorColor = KDefaultFontColor;
53 | iSbColor = KDefaultFontColor;
54 | if (aNotify)
55 | Notify();
56 | }
57 |
58 | void CRFtermSettings::SetMessageAddendum(const TDesC& aAddendum, TBool aNotify)
59 | {
60 | if (aAddendum != KCR &&
61 | aAddendum != KLF &&
62 | aAddendum != KCRLF &&
63 | aAddendum != KNullDesC)
64 | {
65 | iMessageAddendum = KCRLF;
66 | }
67 | else
68 | {
69 | iMessageAddendum = aAddendum;
70 | }
71 | if (aNotify)
72 | Notify();
73 | }
74 |
75 | void CRFtermSettings::SetMessageHistorySize(TInt aSize, TBool aNotify)
76 | {
77 | if (aSize < 0 || aSize > 15)
78 | {
79 | iMessageHistorySize = 8;
80 | }
81 | else
82 | {
83 | iMessageHistorySize = aSize;
84 | }
85 | if (aNotify)
86 | Notify();
87 | }
88 |
89 | void CRFtermSettings::EnableEcho(TBool aState, TBool aNotify)
90 | {
91 | iEcho = aState ? 1 : 0;
92 | if (aNotify)
93 | Notify();
94 | }
95 |
96 | void CRFtermSettings::SetFontSize(TInt aSize, TBool aNotify)
97 | {
98 | if (aSize < 80 || aSize > 160)
99 | {
100 | iFontSize = 120;
101 | }
102 | else
103 | {
104 | iFontSize = aSize;
105 | }
106 | if (aNotify)
107 | Notify();
108 | }
109 |
110 | void CRFtermSettings::SetTabSize(TInt aSize, TBool aNotify)
111 | {
112 | if (aSize < 1 || aSize > 8)
113 | {
114 | iTabSize = 4;
115 | }
116 | else
117 | {
118 | iTabSize = aSize;
119 | }
120 | if (aNotify)
121 | Notify();
122 | }
123 |
124 | void CRFtermSettings::SetFontAntialiasing(TBool aState, TBool aNotify)
125 | {
126 | iFontAntialiasing = aState ? 1 : 0;
127 | if (aNotify)
128 | Notify();
129 | }
130 |
131 | void CRFtermSettings::SetTextWrapping(TBool aState, TBool aNotify)
132 | {
133 | iWrapText = aState ? 1 : 0;
134 | if (aNotify)
135 | Notify();
136 | }
137 |
138 | void CRFtermSettings::SetCtrlCharMapping(TCtrlCharMapping aMapping, TBool aNotify)
139 | {
140 | if (aMapping < EMapCRtoLF || aMapping > EMapNone)
141 | {
142 | iCtrlCharMapping = EMapCRtoCRLF;
143 | }
144 | else
145 | {
146 | iCtrlCharMapping = aMapping;
147 | }
148 | if (aNotify)
149 | Notify();
150 | }
151 |
152 | void CRFtermSettings::SetCodePage(TCodePage aCodePage, TBool aNotify)
153 | {
154 | if (aCodePage < ECodePageLatin1 || aCodePage > ECodePageKOI8)
155 | {
156 | iCodePage = ECodePageLatin1;
157 | }
158 | else
159 | {
160 | iCodePage = aCodePage;
161 | }
162 | if (aNotify)
163 | Notify();
164 | }
165 |
166 | void CRFtermSettings::SetNotifySaving(TBool aSaveNotifies, TBool aNotify)
167 | {
168 | iSaveNotifies = aSaveNotifies ? 1 : 0;
169 | if (aNotify)
170 | Notify();
171 | }
172 |
173 | void CRFtermSettings::SetBackgroundColor(TRgb aColor, TBool aNotify)
174 | {
175 | iBgColor = aColor;
176 | if (aNotify)
177 | Notify();
178 | }
179 |
180 | void CRFtermSettings::SetFontColor(TRgb aColor, TBool aNotify)
181 | {
182 | iFontColor = aColor;
183 | if (aNotify)
184 | Notify();
185 | }
186 |
187 | void CRFtermSettings::SetCursorColor(TRgb aColor, TBool aNotify)
188 | {
189 | iCursorColor = aColor;
190 | if (aNotify)
191 | Notify();
192 | }
193 |
194 | void CRFtermSettings::SetScrollbarsColor(TRgb aColor, TBool aNotify)
195 | {
196 | iSbColor = aColor;
197 | if (aNotify)
198 | Notify();
199 | }
200 |
201 | void CRFtermSettings::ConstructL()
202 | {
203 | }
204 |
205 | // Reading setting data from stream void
206 | void CRFtermSettings::LoadL(RReadStream& aStream)
207 | {
208 | aStream >> iMessageAddendum;
209 | SetMessageAddendum(iMessageAddendum, EFalse);
210 | SetMessageHistorySize(aStream.ReadInt32L(), EFalse);
211 | EnableEcho(aStream.ReadInt8L(), EFalse);
212 | SetFontSize(aStream.ReadInt32L(), EFalse);
213 | SetTabSize(aStream.ReadInt32L(), EFalse);
214 | SetFontAntialiasing(aStream.ReadInt8L(), EFalse);
215 | SetTextWrapping(aStream.ReadInt8L(), EFalse);
216 | SetCtrlCharMapping((TCtrlCharMapping) aStream.ReadInt32L(), EFalse);
217 | SetCodePage((TCodePage) aStream.ReadInt32L(), EFalse);
218 | SetNotifySaving(aStream.ReadInt8L(), EFalse);
219 | SetBackgroundColor(aStream.ReadInt32L(), EFalse);
220 | SetFontColor(TRgb(aStream.ReadInt32L()), EFalse);
221 | SetCursorColor(TRgb(aStream.ReadInt32L()), EFalse);
222 | SetScrollbarsColor(TRgb(aStream.ReadInt32L()), EFalse);
223 | Notify();
224 | }
225 |
226 | // Storing setting data into stream void
227 | void CRFtermSettings::SaveL(RWriteStream& aStream) const
228 | {
229 | aStream << iMessageAddendum;
230 | aStream.WriteInt32L(iMessageHistorySize);
231 | aStream.WriteInt8L(iEcho);
232 | aStream.WriteInt32L(iFontSize);
233 | aStream.WriteInt32L(iTabSize);
234 | aStream.WriteInt8L(iFontAntialiasing);
235 | aStream.WriteInt8L(iWrapText);
236 | aStream.WriteInt32L((TInt)iCtrlCharMapping);
237 | aStream.WriteInt32L((TInt)iCodePage);
238 | aStream.WriteInt8L(iSaveNotifies);
239 | aStream.WriteInt32L(iBgColor.Value());
240 | aStream.WriteInt32L(iFontColor.Value());
241 | aStream.WriteInt32L(iCursorColor.Value());
242 | aStream.WriteInt32L(iSbColor.Value());
243 | }
244 |
245 | void CRFtermSettings::AddObserver(MRFtermSettingsObserver* aObserver)
246 | {
247 | iObservers.Append(aObserver);
248 | }
249 |
250 | void CRFtermSettings::RemoveObserver(MRFtermSettingsObserver* aObserver)
251 | {
252 | TInt id = iObservers.Find(aObserver);
253 | if (id != KErrNotFound)
254 | {
255 | iObservers.Remove(id);
256 | }
257 | }
258 |
259 | void CRFtermSettings::Notify()
260 | {
261 | for (TInt i = iObservers.Count(); i > 0; i--)
262 | {
263 | MRFtermSettingsObserver* observer = iObservers[i - 1];
264 | observer->HandleSettingsChange(this);
265 | }
266 | }
267 |
268 |
--------------------------------------------------------------------------------
/src/RFtermSettingsDialog.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermSettingsDialog.cpp
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Query of send data.
7 | ============================================================================
8 | */
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 |
20 | #include "ColorControl.h"
21 | #include "ColorControl.hrh"
22 | #include "RFterm.hrh"
23 | #include "RFtermConstants.h"
24 | #include "RFtermSettingsDialog.h"
25 |
26 | TInt CRFtermSettingsDialog::RunDlgLD(CRFtermSettings* aSettings)
27 | {
28 | CRFtermSettingsDialog* dlg = new (ELeave) CRFtermSettingsDialog(aSettings);
29 | CleanupStack::PushL(dlg);
30 | dlg->ConstructL(0); // Default menu items
31 | CleanupStack::Pop(dlg);
32 | return dlg->ExecuteLD(R_SETTINGS_DIALOG);
33 | }
34 |
35 | CRFtermSettingsDialog::CRFtermSettingsDialog(CRFtermSettings* aSettings)
36 | : CAknForm()
37 | , iSettings(aSettings)
38 | {
39 | }
40 |
41 | CRFtermSettingsDialog::~CRFtermSettingsDialog()
42 | {
43 | }
44 |
45 | TBool CRFtermSettingsDialog::OkToExitL(TInt aButtonId)
46 | {
47 | TBool result = CAknForm::OkToExitL(aButtonId);
48 |
49 | if (aButtonId == EAknSoftkeySave)
50 | {
51 | ProcessCommandL(EAknFormCmdSave);
52 | }
53 | else if (aButtonId == EAknSoftkeyEdit)
54 | {
55 | StartEditing();
56 | }
57 | else if (aButtonId == EAknSoftkeyDone)
58 | {
59 | result = ETrue;
60 | }
61 |
62 | if (!IsEditable())
63 | {
64 | CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
65 | cba->SetCommandSetL(R_AVKON_SOFTKEYS_EDIT_DONE);
66 | cba->DrawNow();
67 | }
68 |
69 | return result;
70 | }
71 |
72 | void CRFtermSettingsDialog::HandlePointerEventL(const TPointerEvent &aPointerEvent)
73 | {
74 | CAknForm::HandlePointerEventL(aPointerEvent);
75 |
76 | TInt KMaxDelta = 15;
77 |
78 | if (!IsEditable())
79 | {
80 | if (aPointerEvent.iType == TPointerEvent::EButton1Down)
81 | {
82 | iDownPointerPos = aPointerEvent.iPosition;
83 | }
84 | else if (aPointerEvent.iType == TPointerEvent::EButton1Up)
85 | {
86 | TPoint posDelta = iDownPointerPos - aPointerEvent.iPosition;
87 | if (Abs(posDelta.iX) < KMaxDelta && Abs(posDelta.iY) < KMaxDelta)
88 | StartEditing();
89 | }
90 | }
91 | }
92 |
93 | TKeyResponse CRFtermSettingsDialog::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
94 | {
95 | if (aType == EEventKey && aKeyEvent.iScanCode == EStdKeyDevice3 && !IsEditable())
96 | {
97 | StartEditing();
98 | return EKeyWasConsumed;
99 | }
100 | return CAknForm::OfferKeyEventL(aKeyEvent, aType);
101 | }
102 |
103 | void CRFtermSettingsDialog::PreLayoutDynInitL()
104 | {
105 | CAknForm::PreLayoutDynInitL();
106 | LoadFormDataL();
107 | }
108 |
109 | void CRFtermSettingsDialog::LoadFormDataL()
110 | {
111 | TInt index;
112 |
113 | // Input
114 | if (iSettings->MessageAddendum().Compare(KCR) == 0)
115 | {
116 | index = 0;
117 | }
118 | else if (iSettings->MessageAddendum().Compare(KLF) == 0)
119 | {
120 | index = 1;
121 | }
122 | else if (iSettings->MessageAddendum().Compare(KCRLF) == 0)
123 | {
124 | index = 2;
125 | }
126 | else
127 | {
128 | index = 3;
129 | }
130 | CAknPopupFieldText* appendixControl =
131 | (CAknPopupFieldText*)Control(ESettingAppendix);
132 | appendixControl->SetCurrentValueIndex(index);
133 |
134 | CEikNumberEditor* historySizeControl =
135 | (CEikNumberEditor*)Control(ESettingHistorySize);
136 | historySizeControl->SetNumber(iSettings->MessageHistorySize());
137 |
138 | index = ((TInt) iSettings->IsEchoEnabled());
139 | CAknPopupFieldText* echoControl =
140 | (CAknPopupFieldText*)Control(ESettingEcho);
141 | echoControl->SetCurrentValueIndex(index);
142 |
143 | // Output
144 | CAknSlider* fontSizeControl =
145 | (CAknSlider*)Control(ESettingFontSize);
146 | fontSizeControl->SetValueL(iSettings->FontSize());
147 |
148 | CAknSlider* tabSizeControl =
149 | (CAknSlider*)Control(ESettingTabSize);
150 | tabSizeControl->SetValueL(iSettings->TabSize());
151 |
152 | index = ((TInt) iSettings->FontAntialiasing());
153 | CAknPopupFieldText* fontAntialiasingControl =
154 | (CAknPopupFieldText*)Control(ESettingFontAntialiasing);
155 | fontAntialiasingControl->SetCurrentValueIndex(index);
156 |
157 | index = ((TInt) iSettings->DoWrapText());
158 | CAknPopupFieldText* wrapTextControl =
159 | (CAknPopupFieldText*)Control(ESettingWrapText);
160 | wrapTextControl->SetCurrentValueIndex(index);
161 |
162 | index = ((TInt) iSettings->CtrlCharMapping()) - 1;
163 | CAknPopupFieldText* mappingControl =
164 | (CAknPopupFieldText*)Control(ESettingMapping);
165 | mappingControl->SetCurrentValueIndex(index);
166 |
167 | index = ((TInt) iSettings->CodePage()) - 1;
168 | CAknPopupFieldText* codePageControl =
169 | (CAknPopupFieldText*)Control(ESettingCodePage);
170 | codePageControl->SetCurrentValueIndex(index);
171 |
172 | index = ((TInt) iSettings->DoSaveNotifies());
173 | CAknPopupFieldText* saveNotifiesControl =
174 | (CAknPopupFieldText*)Control(ESettingSaveNotifies);
175 | saveNotifiesControl->SetCurrentValueIndex(index);
176 |
177 | // Colors
178 | TRgb color = iSettings->BackgroundColor();
179 | CColorEditor* bgColorEditorControl =
180 | (CColorEditor*)Control(ESettingColorBackground);
181 | bgColorEditorControl->SetColor(color);
182 |
183 | color = iSettings->FontColor();
184 | CColorEditor* fontColorEditorControl =
185 | (CColorEditor*)Control(ESettingColorFont);
186 | fontColorEditorControl->SetColor(color);
187 |
188 | color = iSettings->CursorColor();
189 | CColorEditor* cursorColorEditorControl =
190 | (CColorEditor*)Control(ESettingColorCursor);
191 | cursorColorEditorControl->SetColor(color);
192 |
193 | color = iSettings->ScrollbarsColor();
194 | CColorEditor* sbColorEditorControl =
195 | (CColorEditor*)Control(ESettingColorScrollbars);
196 | sbColorEditorControl->SetColor(color);
197 | }
198 |
199 | TBool CRFtermSettingsDialog::SaveFormDataL()
200 | {
201 | //Input
202 | CAknPopupFieldText* appendixControl =
203 | (CAknPopupFieldText*)Control(ESettingAppendix);
204 | switch (appendixControl->CurrentValueIndex())
205 | {
206 | case 0:
207 | {
208 | iSettings->SetMessageAddendum(KCR, EFalse);
209 | break;
210 | }
211 | case 1:
212 | {
213 | iSettings->SetMessageAddendum(KLF, EFalse);
214 | break;
215 | }
216 | case 2:
217 | {
218 | iSettings->SetMessageAddendum(KCRLF, EFalse);
219 | break;
220 | }
221 | default:
222 | {
223 | iSettings->SetMessageAddendum(KNullDesC, EFalse);
224 | }
225 | }
226 |
227 | CEikNumberEditor* historySizeControl =
228 | (CEikNumberEditor*)Control(ESettingHistorySize);
229 | iSettings->SetMessageHistorySize(historySizeControl->Number(), EFalse);
230 |
231 | CAknPopupFieldText* echoControl =
232 | (CAknPopupFieldText*)Control(ESettingEcho);
233 | iSettings->EnableEcho(echoControl->CurrentValueIndex(), EFalse);
234 |
235 | // Output
236 | CAknSlider* fontSizeControl =
237 | (CAknSlider*)Control(ESettingFontSize);
238 | iSettings->SetFontSize(fontSizeControl->Value(), EFalse);
239 |
240 | CAknSlider* tabSizeControl =
241 | (CAknSlider*)Control(ESettingTabSize);
242 | iSettings->SetTabSize(tabSizeControl->Value(), EFalse);
243 |
244 | CAknPopupFieldText* fontAntialiasingControl =
245 | (CAknPopupFieldText*)Control(ESettingFontAntialiasing);
246 | iSettings->SetFontAntialiasing(fontAntialiasingControl->CurrentValueIndex(), EFalse);
247 |
248 | CAknPopupFieldText* wrapTextControl =
249 | (CAknPopupFieldText*)Control(ESettingWrapText);
250 | iSettings->SetTextWrapping(wrapTextControl->CurrentValueIndex(), EFalse);
251 |
252 | CAknPopupFieldText* mappingControl =
253 | (CAknPopupFieldText*)Control(ESettingMapping);
254 | iSettings->SetCtrlCharMapping((TCtrlCharMapping) (mappingControl->CurrentValueIndex() + 1), EFalse);
255 |
256 | CAknPopupFieldText* codePageControl =
257 | (CAknPopupFieldText*)Control(ESettingCodePage);
258 | iSettings->SetCodePage((TCodePage) (codePageControl->CurrentValueIndex() + 1), EFalse);
259 |
260 | CAknPopupFieldText* saveNotifiesControl =
261 | (CAknPopupFieldText*)Control(ESettingSaveNotifies);
262 | iSettings->SetNotifySaving(saveNotifiesControl->CurrentValueIndex(), EFalse);
263 |
264 | // Colors
265 | CColorEditor* bgColorEditorControl =
266 | (CColorEditor*)Control(ESettingColorBackground);
267 | iSettings->SetBackgroundColor(bgColorEditorControl->Color(), EFalse);
268 |
269 | CColorEditor* fontColorEditorControl =
270 | (CColorEditor*)Control(ESettingColorFont);
271 | iSettings->SetFontColor(fontColorEditorControl->Color(), EFalse);
272 |
273 | CColorEditor* cursorColorEditorControl =
274 | (CColorEditor*)Control(ESettingColorCursor);
275 | iSettings->SetCursorColor(cursorColorEditorControl->Color(), EFalse);
276 |
277 | CColorEditor* scrollbarsColorEditorControl =
278 | (CColorEditor*)Control(ESettingColorScrollbars);
279 | iSettings->SetScrollbarsColor(scrollbarsColorEditorControl->Color());
280 |
281 | // Notify settings change at the last item only!
282 |
283 | return ETrue;
284 | }
285 |
286 | void CRFtermSettingsDialog::DoNotSaveFormDataL()
287 | {
288 | LoadFormDataL();
289 | }
290 |
291 | void CRFtermSettingsDialog::ActivateL()
292 | {
293 | CAknForm::ActivateL();
294 |
295 | TUid naviPaneUid = TUid::Uid(EEikStatusPaneUidNavi);
296 | CEikStatusPane* statusPane = iEikonEnv->AppUiFactory()->StatusPane();
297 | CEikStatusPaneBase::TPaneCapabilities naviPaneCap = statusPane->PaneCapabilities(naviPaneUid);
298 | if (naviPaneCap.IsPresent() && naviPaneCap.IsAppOwned())
299 | {
300 | CAknNavigationControlContainer* naviPane =
301 | static_cast (statusPane->ControlL(naviPaneUid));
302 | CAknNavigationDecorator* naviDecorator = naviPane->Top();
303 | CAknTabGroup* tabs = (CAknTabGroup*)naviDecorator->DecoratedControl();
304 | tabs->SetTabFixedWidthL(KTabWidthWithThreeTabs);
305 | }
306 | }
307 |
308 | void CRFtermSettingsDialog::StartEditing()
309 | {
310 | ProcessCommandL(EAknFormCmdEdit);
311 | CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
312 | cba->SetCommandSetL(R_AVKON_SOFTKEYS_SAVE_BACK);
313 | cba->DrawNow();
314 | }
315 |
316 | SEikControlInfo CRFtermSettingsDialog::CreateCustomControlL(TInt aControlType)
317 | {
318 | SEikControlInfo controlInfo;
319 | controlInfo.iControl = NULL;
320 | controlInfo.iTrailerTextId = 0;
321 | controlInfo.iFlags = 0;
322 |
323 | if (aControlType == EColorEditor)
324 | {
325 | controlInfo.iControl = new (ELeave) CColorEditor;
326 | }
327 |
328 | return controlInfo;
329 | }
330 |
331 | MEikDialogPageObserver::TFormControlTypes
332 | CRFtermSettingsDialog::ConvertCustomControlTypeToBaseControlType(TInt aControlType) const
333 | {
334 | if (aControlType == EColorEditor)
335 | return MEikDialogPageObserver::EMfneDerived;
336 | return CAknForm::ConvertCustomControlTypeToBaseControlType(aControlType);
337 | };
338 |
339 |
--------------------------------------------------------------------------------
/src/RFtermSignalQueryDialog.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermSignalQueryDialog.cpp
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Dialog with the list of RS-232 input/output signals.
7 | ============================================================================
8 | */
9 |
10 | #include // TCallBack
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include "RFtermConstants.h"
19 | #include "RFtermSignalQueryDialog.h"
20 |
21 | // Signal labels
22 | _LIT(KSignalLabelRTS, "RTS");
23 | _LIT(KSignalLabelCTS, "CTS");
24 | _LIT(KSignalLabelDSR, "DSR");
25 | _LIT(KSignalLabelDTR, "DTR");
26 | _LIT(KSignalLabelDCD, "DCD");
27 | _LIT(KSignalLabelRI, "RI");
28 |
29 | // List item pattern
30 | _LIT(KListItemPattern, "%d\t%S\t%S");
31 |
32 | // -----------------------------------------------------------------------------
33 | // CRFtermSignalQueryDialog::RunDlgLD()
34 | // Shows RS-232 signals dialog and destroys it on exit.
35 | // -----------------------------------------------------------------------------
36 | //
37 | TInt CRFtermSignalQueryDialog::RunDlgLD(CRFtermBt* aBtClient)
38 | {
39 | CRFtermSignalQueryDialog* dlg = new (ELeave) CRFtermSignalQueryDialog(aBtClient);
40 | dlg->PrepareLC(R_DIALOG_SIGNAL_QUERY);
41 | dlg->ConstructL();
42 | return dlg->RunLD();
43 | }
44 |
45 | // -----------------------------------------------------------------------------
46 | // CRFtermSignalQueryDialog::CRFtermSignalQueryDialog()
47 | // C++ default constructor can NOT contain any code, that might leave.
48 | // -----------------------------------------------------------------------------
49 | //
50 | CRFtermSignalQueryDialog::CRFtermSignalQueryDialog(CRFtermBt* aBtClient)
51 | : CAknListQueryDialog(&iIndex)
52 | , iBtClient(aBtClient)
53 | {
54 | }
55 |
56 | // -----------------------------------------------------------------------------
57 | // CRFtermAppView::ConstructL()
58 | // Symbian 2nd phase constructor can leave.
59 | // -----------------------------------------------------------------------------
60 | //
61 | void CRFtermSignalQueryDialog::ConstructL()
62 | {
63 | CArrayPtr* iconList = new (ELeave) CAknIconArray(1);
64 | CleanupStack::PushL(iconList);
65 |
66 | CFbsBitmap* offBitmap = NULL;
67 | CFbsBitmap* offMask = NULL;
68 | CFbsBitmap* onBitmap = NULL;
69 | CFbsBitmap* onMask = NULL;
70 |
71 | AknIconUtils::CreateIconL(offBitmap, offMask, KRFtermIconsFile,
72 | EMbmRfterm_0xae7f53faSignal_off,
73 | EMbmRfterm_0xae7f53faSignal_off_mask);
74 | AknIconUtils::CreateIconL(onBitmap, onMask, KRFtermIconsFile,
75 | EMbmRfterm_0xae7f53faSignal_on,
76 | EMbmRfterm_0xae7f53faSignal_on_mask);
77 |
78 | // It takes ownership of the bitmap and mask.
79 | CGulIcon* offIcon = CGulIcon::NewL(offBitmap, offMask);
80 | CGulIcon* onIcon = CGulIcon::NewL(onBitmap, onMask);
81 | iconList->AppendL(offIcon);
82 | iconList->AppendL(onIcon);
83 |
84 | CAknSingleGraphicHeadingPopupMenuStyleListBox* listBox =
85 | static_cast(ListBox());
86 | listBox->ItemDrawer()->ColumnData()->SetIconArray(iconList);
87 | UpdateSignalStatesL();
88 |
89 | CleanupStack::Pop(iconList);
90 |
91 | iTimer = CPeriodic::NewL(EPriorityLow);
92 | const TInt tickInterval = 1000000;
93 | iTimer->Start(tickInterval, tickInterval, TCallBack(TimerCallBack, this));
94 | }
95 |
96 | // ----------------------------------------------------------------------------
97 | // CRFtermSignalQueryDialog::~CRFtermSignalQueryDialog()
98 | // Destructor.
99 | // ----------------------------------------------------------------------------
100 | //
101 | CRFtermSignalQueryDialog::~CRFtermSignalQueryDialog()
102 | {
103 | if (iTimer)
104 | {
105 | iTimer->Cancel();
106 | }
107 | delete iTimer;
108 | iTimer = NULL;
109 | }
110 |
111 | // ----------------------------------------------------------------------------
112 | // CRFtermSignalQueryDialog::HandleListBoxEventL()
113 | // Close dialog with "Back" button.
114 | // ----------------------------------------------------------------------------
115 | //
116 | TBool CRFtermSignalQueryDialog::OkToExitL(TInt aButtonId)
117 | {
118 | if (aButtonId == EAknSoftkeyBack)
119 | {
120 | return ETrue;
121 | }
122 |
123 | return EFalse;
124 | }
125 |
126 | // ----------------------------------------------------------------------------
127 | // CRFtermSignalQueryDialog::HandleListBoxEventL()
128 | // Toggle output if clicked.
129 | // ----------------------------------------------------------------------------
130 | //
131 | void CRFtermSignalQueryDialog::HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType)
132 | {
133 | if (aEventType == EEventItemClicked)
134 | {
135 | if (iBtClient->IsConnected())
136 | {
137 | // 0 -> RTS, 3 -> DTR; outputs only
138 | if (aListBox->CurrentItemIndex() == 0)
139 | {
140 | iBtClient->ToggleOutputSignals(KRS232SignalRTS);
141 | }
142 | else if (aListBox->CurrentItemIndex() == 3)
143 | {
144 | iBtClient->ToggleOutputSignals(KRS232SignalDTR);
145 | }
146 | }
147 | UpdateSignalStatesL();
148 | }
149 | }
150 |
151 | // ----------------------------------------------------------------------------
152 | // CRFtermSignalQueryDialog::UpdateSignalStatesL()
153 | // Update signal states.
154 | // ----------------------------------------------------------------------------
155 | //
156 | void CRFtermSignalQueryDialog::UpdateSignalStatesL()
157 | {
158 | CAknSingleGraphicHeadingPopupMenuStyleListBox* listBox =
159 | static_cast(ListBox());
160 | CDesCArray* listArray = (CDesCArray*) listBox->Model()->ItemTextArray();
161 | listArray->Reset();
162 |
163 | if (iBtClient->IsConnected())
164 | {
165 | HBufC* inputLabel = StringLoader::LoadLC(R_STR_SIGNAL_INPUT);
166 | HBufC* outputLabel = StringLoader::LoadLC(R_STR_SIGNAL_OUTPUT);
167 |
168 | TBuf<16> listItemBuf;
169 | TInt signalState(0);
170 |
171 | TUint8 inputSignals = iBtClient->GetInputSignals();
172 | TUint8 outputSignals = iBtClient->GetOutputSignals();
173 |
174 | // RTS
175 | //(outputSignals & KRS232SignalRTS) ? signalState = 1 : signalState = 0;
176 | signalState = (outputSignals & KRS232SignalRTS) != 0;
177 | listItemBuf.Format(KListItemPattern, signalState, outputLabel, &KSignalLabelRTS);
178 | listArray->AppendL(listItemBuf);
179 | // CTS
180 | listItemBuf.Zero();
181 | signalState = (inputSignals & KRS232SignalCTS) != 0;
182 | listItemBuf.Format(KListItemPattern, signalState, inputLabel, &KSignalLabelCTS);
183 | listArray->AppendL(listItemBuf);
184 | // DSR
185 | listItemBuf.Zero();
186 | signalState = (inputSignals & KRS232SignalDSR) != 0;
187 | listItemBuf.Format(KListItemPattern, signalState, inputLabel, &KSignalLabelDSR);
188 | listArray->AppendL(listItemBuf);
189 | // DTR
190 | listItemBuf.Zero();
191 | signalState = (outputSignals & KRS232SignalDTR) != 0;
192 | listItemBuf.Format(KListItemPattern, signalState, outputLabel, &KSignalLabelDTR);
193 | listArray->AppendL(listItemBuf);
194 | // DCD
195 | listItemBuf.Zero();
196 | signalState = (inputSignals & KRS232SignalDCD) != 0;
197 | listItemBuf.Format(KListItemPattern, signalState, inputLabel, &KSignalLabelDCD);
198 | listArray->AppendL(listItemBuf);
199 | // RI
200 | listItemBuf.Zero();
201 | signalState = (inputSignals & KRS232SignalRI) != 0;
202 | listItemBuf.Format(KListItemPattern, signalState, inputLabel, &KSignalLabelRI);
203 | listArray->AppendL(listItemBuf);
204 |
205 | CleanupStack::PopAndDestroy(outputLabel);
206 | CleanupStack::PopAndDestroy(inputLabel);
207 | }
208 | listBox->HandleItemAdditionL();
209 | }
210 |
211 | // ----------------------------------------------------------------------------
212 | // CRFtermSignalQueryDialog::TimerCallBack()
213 | // Update signal states every second.
214 | // ----------------------------------------------------------------------------
215 | //
216 | TInt CRFtermSignalQueryDialog::TimerCallBack(TAny* aObject)
217 | {
218 | CRFtermSignalQueryDialog* self = static_cast (aObject);
219 | TRAPD(error, self->UpdateSignalStatesL());
220 | return error;
221 | }
222 |
223 | // ----------------------------------------------------------------------------
224 | // CRFtermSignalQueryDialog::OfferKeyEventL()
225 | // Offer the key event to the list box.
226 | // ----------------------------------------------------------------------------
227 | //
228 | TKeyResponse CRFtermSignalQueryDialog
229 | ::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
230 | {
231 | if (aType == EEventKey)
232 | {
233 | // "1" -> RTS
234 | if (aKeyEvent.iCode == 0x31)
235 | {
236 | if (iBtClient->IsConnected())
237 | {
238 | iBtClient->ToggleOutputSignals(KRS232SignalRTS);
239 | UpdateSignalStatesL();
240 | }
241 | }
242 | // "4" -> DTR
243 | else if (aKeyEvent.iCode == 0x34)
244 | {
245 | if (iBtClient->IsConnected())
246 | {
247 | iBtClient->ToggleOutputSignals(KRS232SignalDTR);
248 | UpdateSignalStatesL();
249 | }
250 | }
251 | }
252 | return CAknListQueryDialog::OfferKeyEventL(aKeyEvent, aType);
253 | }
254 |
255 | // End of File
256 |
--------------------------------------------------------------------------------
/src/RFtermTextQueryDialog.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : RFtermTextQueryDialog.cpp
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Query of send data.
7 | ============================================================================
8 | */
9 |
10 | #include "RFtermTextQueryDialog.h"
11 |
12 | CRFtermTextQueryDialog* CRFtermTextQueryDialog::NewL(TDes &aDataText)
13 | {
14 | CRFtermTextQueryDialog* self = new (ELeave) CRFtermTextQueryDialog(aDataText);
15 | return self;
16 | }
17 |
18 | CRFtermTextQueryDialog::CRFtermTextQueryDialog(TDes &aDataText)
19 | : CAknTextQueryDialog(aDataText)
20 | {
21 | }
22 |
23 | CRFtermTextQueryDialog::~CRFtermTextQueryDialog()
24 | {
25 | }
26 |
27 | void CRFtermTextQueryDialog::UpdateLeftSoftKeyL()
28 | {
29 | // Do not hide OK button. Allow empty input.
30 | }
31 |
32 | // End of File
33 |
--------------------------------------------------------------------------------
/src/cpfont.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ============================================================================
3 | Name : cpfont.cpp
4 | Author : Konstantin Baranovskiy
5 | Copyright : GPLv3
6 | Description : Copy font file to c:\resource\fonts\.
7 |
8 | A font must be placed in "resource\fonts\" directory to be properly
9 | processed by Font and Bitmap Server.
10 | But once font file is copied there it cannot be removed because
11 | this file is locked by FbServ.
12 | Locked font file does not allow to remove the application
13 | that installed this font.
14 | Manual font adding from different place brings sporadic device reboots:
15 | https://bugreports.qt.io/browse/QTBUG-6611
16 |
17 | The solution from Nokia Wiki does not work.
18 | The next funcion is not supported by s60v5:
19 | CFbsTypefaceStore::RemoveFontFileLocksL(_L("c:\\resource\\customFont.ttf"));
20 |
21 | Possible solution:
22 | 1) install font file to "\resource\apps\" with other app resources
23 | (from there font file can be removed successfully);
24 | 2) copy font file to "\resource\fonts\" with this tiny app at installation time
25 | and leave it there forever.
26 | This solution is dirty but Symbian API does not leave a choice.
27 | ============================================================================
28 | */
29 |
30 | // INCLUDE FILES
31 | #include
32 | #include
33 | #include "RFtermConstants.h"
34 |
35 | _LIT(KTxtEPOC32EX, "CPFONT");
36 | _LIT(KFontDir, "c:\\resource\\fonts\\");
37 |
38 | LOCAL_D RFs fsSession;
39 |
40 | LOCAL_C void MainL()
41 | {
42 | User::LeaveIfError(fsSession.Connect());
43 | CleanupClosePushL(fsSession);
44 | TInt dirError = fsSession.MkDir(KFontDir);
45 | if (dirError != KErrNone && dirError != KErrAlreadyExists)
46 | User::LeaveIfError(dirError);
47 | CFileMan* fileMan = CFileMan::NewL(fsSession);
48 | CleanupStack::PushL(fileMan);
49 | fileMan->Copy(KRFtermFontPath, KCourierNewFontPath, 0); // do not overwrite
50 | CleanupStack::PopAndDestroy(2); // fileMan, fsSession
51 | }
52 |
53 | GLDEF_C TInt E32Main() // main function called by E32
54 | {
55 | __UHEAP_MARK;
56 | CTrapCleanup* cleanup = CTrapCleanup::New();
57 | TRAPD(error, MainL());
58 | __ASSERT_ALWAYS(!error, User::Panic(KTxtEPOC32EX, error));
59 | delete cleanup;
60 | __UHEAP_MARKEND;
61 | return 0;
62 | }
63 |
--------------------------------------------------------------------------------