1
/***************************************************************************
2
* Copyright (C) 2009-2012 by Savoir-Faire Linux *
3
* Author : Jérémy Quentin <jeremy.quentin@savoirfairelinux.com> *
4
* Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com>*
6
* This program is free software; you can redistribute it and/or modify *
7
* it under the terms of the GNU General Public License as published by *
8
* the Free Software Foundation; either version 3 of the License, or *
9
* (at your option) any later version. *
11
* This program is distributed in the hope that it will be useful, *
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
* GNU General Public License for more details. *
16
* You should have received a copy of the GNU General Public License *
17
* along with this program; if not, write to the *
18
* Free Software Foundation, Inc., *
19
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
20
**************************************************************************/
22
#ifndef SFLPHONEVIEW_H
23
#define SFLPHONEVIEW_H
25
#include "ui_SFLPhoneView_base.h"
26
#include <QtGui/QWidget>
35
class ConfigurationDialog;
41
* This is the main view class for sflphone-client-kde. Most of the non-menu,
42
* non-toolbar, and non-statusbar (e.g., non frame) GUI code should go
44
* As the state of the view has effects on the window,
45
* it emits some signals to ask for changes that the window has
49
* @author Jérémy Quentin <jeremy.quentin@savoirfairelinux.com>
52
class SFLPhoneView : public QWidget, public Ui::SFLPhone_view
57
AccountWizard * wizard;
58
QErrorMessage * errorWindow;
63
* override context menu handling
66
void contextMenuEvent(QContextMenuEvent *event);
69
//Constructors & Destructors
71
* This constructor does not load the window as it would
72
* better wait for the parent window to connect to the signals
73
* for updating it (statusMessageChangeAsked...).
74
* You should call the loadWindow() method once
75
* you have constructed the object and connected the
79
SFLPhoneView(QWidget *parent);
80
virtual ~SFLPhoneView();
85
QErrorMessage * getErrorWindow();
90
* Used to sort contacts according to their types with Kabc.
91
* @return the integer resulting to the flags of the types
92
* chosen to be displayed in SFLphone configuration.
94
int phoneNumberTypesDisplayed();
98
* Performs the action action on the call call, then updates window.
99
* The call object will handle the action with its "actionPerformed" method.
100
* See the documentation for more details.
101
* @param call the call on which to perform the action
102
* @param action the code of the action to perform
104
void action(Call * call, call_action action);
107
* Sets the account account to be the prior account.
108
* That means it's gonna be used when the user places a call
109
* if it's defined and registered, else the first registered of
110
* accountList will be used.
111
* @param account the account to use prior
113
void setAccountFirst(Account * account);
116
* Handles the behaviour when the user types something with
117
* the dialpad widget or his keyboard (normally it's a one char
118
* string but we use a string just in case).
119
* Adds str to the selected item if in the main window
120
* and creates a new item if no item is selected.
121
* Send DTMF if appropriate according to current item's state.
122
* Adds str to the search bar if in history or address book.
123
* @param str the string sent by the user
125
void typeString(QString str);
128
* Handles the behaviour when the user types a backspace
129
* according to the current state (window, item selected...)
134
* Handles the behaviour when the user types escape
135
* according to the current state (window, item selected...)
140
* Handles the behaviour when the user types enter
141
* according to the current state (window, item selected...)
146
* Displays a message window with editable text of the selected
147
* phone number in history or address book.
148
* Once the user accepts, place a call with the chosen phone number.
149
* Keeps the peer name of the contact or past call.
151
void editBeforeCall();
154
* Updates the history's search bar's display according to the current
156
* If empty, hide the search bar.
158
void updateRecordButton ();
159
void updateVolumeButton ();
160
void updateRecordBar (double _value = -1);
161
void updateVolumeBar (double _value = -1);
162
void updateVolumeControls ();
163
void updateDialpad ();
168
* Updates all the display
169
* according to the settings.
174
* Updates the toolbar's actions' display according to the selected
177
void updateWindowCallState();
180
void updateStatusMessage();
183
virtual void keyPressEvent(QKeyEvent *event)
185
int key = event->key();
186
if(key == Qt::Key_Escape)
188
else if(key == Qt::Key_Return || key == Qt::Key_Enter)
190
else if(key == Qt::Key_Backspace)
194
QString text = event->text();
202
void displayVolumeControls(bool checked = true);
203
void displayDialpad(bool checked = true);
204
void configureSflPhone();
205
void accountCreationWizard();
213
void on_widget_dialpad_typed(QString text);
215
void on_slider_recVol_valueChanged ( int value );
216
void on_slider_sndVol_valueChanged ( int value );
217
void on_toolButton_recVol_clicked ( bool checked );
218
void on_toolButton_sndVol_clicked ( bool checked );
220
void on1_error(MapStringString details);
221
void on1_incomingCall(Call* call);
222
void on1_voiceMailNotify(const QString &accountID, int count);
223
void on1_volumeChanged(const QString &device, double value);
226
void statusMessageChangeAsked ( const QString& message );
227
void windowTitleChangeAsked ( const QString& title );
228
void enabledActionsChangeAsked ( const bool* enabledActions );
229
void actionIconsChangeAsked ( const QString* actionIcons );
230
void actionTextsChangeAsked ( const QString* actionTexts );
231
void transferCheckStateChangeAsked ( bool transferCheckState );
232
void recordCheckStateChangeAsked ( bool recordCheckState );
233
void addressBookEnableAsked ( bool enableAddressBook );
234
void screenChanged(int screen);
235
void incomingCall(const Call * call);
240
#endif // SFLPHONEVIEW_H