2 The architecture of Libchenabler
VocHistoryAPP
This package contains the call history application.
Vochistory is a comfortable front-end to organize the call log. It enables the users to manage the call log efficiently and comfortably. The call history is divided into three main types:
It is based on the libchenabler.
AddressBook depends on the following libraries:
l Gtk+-2.0 The GTK+ library contains widgets, that is, GUI components such as GtkButton or GtkTextView.
l libgemwidget A Gtk+ for Embedded library contains widgets which are mostly used in embedded devices.
l libgpephone Shared code for applications developed for the phone application framework providing easy access to softkey definitions and communication.
l libchenabler Libchenabler hides the details of the database and provides some basic interfaces for the call history application, the voicecall application and other applications.
l libiac The package provides various interfaces to make the service oriented communication between applications much easier than using low-level D-Bus routines ever before.
For the time being, voice call enabler could not support the call log management. The functions of calling, sending sms has not be finished.
Src/
typedef struct _VocHistoryListView VocHistoryListView;
struct _VocHistoryListView
{
GpeSKWindow window;
GtkWidget *titlebar;
GtkWidget *scroll_window;
GtkWidget *treeview;
GtkListStore *liststore;
VocHistoryListViewRowCallback row_activated_cb;
};
This structure is derived from the GpeSkwindow class. It shows a list on the screen.
The application creates three instances of this class to show the outgoing, incoming, missing call history list.
Functions:
1. void vochistory_listview_set_row_function (VocHistoryListView *view,
VocHistoryListViewRowCallback cb_func);
Set the callback function when the row is active.
2. gboolean vochistory_listview_load_data(VocHistoryListView * view,voch_call_type_t datatype);
Load data from the database according to the datatype. The datatype should be one of OUTGOING, INCOMING, MISSING. The data is stored into the "liststore".
3. gboolean vochistory_listview_delete_current(VocHistoryListView * view,voch_sid_t sid);
Delete the active row in the liststore, and delete the related data in the database.
4. void getcurrowinfo(VocHistoryListView * view,char *num,
time_t * start_date,time_t * duration)
Get the num,start_time,duration of current active row.
Show the main page in which user can choose to view different types of call log.
mainwindow *GtkWidget : the GpeSkwindow which handle the softkey action.
liststore *GtkListStore : store the list row and the row number;
Functions:
1. static void main_listview_row_activated (GtkTreeView *treeview, GtkTreePath * path, GtkTreeViewColumn * col, gpointer user_data)
The callback function of the row active signal. According to the active row number, it will create different type of VochistoryListview.
For example: choose "outgoing" row will first create a VochistoryListview, then invoke
vochistory_listview_load_data(view,0) to load the outgoing call history from the database.
2. GtkWidget * create_typechose_window()
Create the mainlist and set the softkey labels.
The main function.