~noskcaj/ubuntu/saucy/sflphone/merge-1.2.3-2

« back to all changes in this revision

Viewing changes to kde/src/SFLPhoneView.h

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2012-05-19 21:46:37 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20120519214637-la8rbrford5kj6m3
Tags: 1.1.0-1
* New upstream release 
  - Fixes "FTBFS with libccrtp-dev/2.0.2 from experimental" (Closes: #663282)
* NEW Maintainer: Debian VoIP Team - Thanks Francois for your work.
  - (Closes: #665789: O: sflphone -- SIP and IAX2 compatible VoIP phone)
* Added Build-Depends: libdbus-c++-bin
* Add gcc47-fixes.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
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>*
5
 
 *                                                                         *
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.                                   *
10
 
 *                                                                         *
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.                          *
15
 
 *                                                                         *
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
 
 **************************************************************************/
21
 
 
22
 
#ifndef SFLPHONEVIEW_H
23
 
#define SFLPHONEVIEW_H
24
 
 
25
 
#include "ui_SFLPhoneView_base.h"
26
 
#include <QtGui/QWidget>
27
 
 
28
 
//Qt
29
 
class QString;
30
 
class QKeyEvent;
31
 
class QErrorMessage;
32
 
class QListWidget;
33
 
 
34
 
//SFLPhone
35
 
class ConfigurationDialog;
36
 
class AccountWizard;
37
 
class CallView;
38
 
 
39
 
 
40
 
/**
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
43
 
 * here.
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
46
 
 * to treat.
47
 
 *
48
 
 * @short Main view
49
 
 * @author Jérémy Quentin <jeremy.quentin@savoirfairelinux.com>
50
 
 * @version 0.9.6
51
 
 */
52
 
class SFLPhoneView : public QWidget, public Ui::SFLPhone_view
53
 
{
54
 
   Q_OBJECT
55
 
 
56
 
private:
57
 
   AccountWizard * wizard;
58
 
   QErrorMessage * errorWindow;
59
 
 
60
 
protected:
61
 
 
62
 
   /**
63
 
    * override context menu handling
64
 
    * @param event
65
 
    */
66
 
   void contextMenuEvent(QContextMenuEvent *event);
67
 
 
68
 
public:
69
 
   //Constructors & Destructors
70
 
   /**
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
76
 
    *   expected signals.
77
 
    * @param parent
78
 
    */
79
 
   SFLPhoneView(QWidget *parent);
80
 
   virtual ~SFLPhoneView();
81
 
 
82
 
   //Getters
83
 
 
84
 
 
85
 
   QErrorMessage * getErrorWindow();
86
 
 
87
 
 
88
 
   //Daemon getters
89
 
   /**
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.
93
 
   */
94
 
   int phoneNumberTypesDisplayed();
95
 
 
96
 
private slots:
97
 
   /**
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
103
 
    */
104
 
   void action(Call * call, call_action action);
105
 
 
106
 
   /**
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
112
 
    */
113
 
   void setAccountFirst(Account * account);
114
 
 
115
 
   /**
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
124
 
    */
125
 
   void typeString(QString str);
126
 
 
127
 
   /**
128
 
    *   Handles the behaviour when the user types a backspace
129
 
    *   according to the current state (window, item selected...)
130
 
    */
131
 
   void backspace();
132
 
 
133
 
   /**
134
 
    *   Handles the behaviour when the user types escape
135
 
    *   according to the current state (window, item selected...)
136
 
    */
137
 
   void escape();
138
 
 
139
 
   /**
140
 
    *   Handles the behaviour when the user types enter
141
 
    *   according to the current state (window, item selected...)
142
 
    */
143
 
   void enter();
144
 
 
145
 
   /**
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.
150
 
    */
151
 
   void editBeforeCall();
152
 
 
153
 
   /**
154
 
    * Updates the history's search bar's display according to the current
155
 
    * text searched.
156
 
    * If empty, hide the search bar.
157
 
    */
158
 
   void updateRecordButton   ();
159
 
   void updateVolumeButton   ();
160
 
   void updateRecordBar      (double _value = -1);
161
 
   void updateVolumeBar      (double _value = -1);
162
 
   void updateVolumeControls ();
163
 
   void updateDialpad        ();
164
 
 
165
 
 
166
 
public slots:
167
 
   /**
168
 
    * Updates all the display
169
 
    * according to the settings.
170
 
    */
171
 
   void loadWindow();
172
 
 
173
 
   /**
174
 
    *   Updates the toolbar's actions' display according to the selected
175
 
    *   item's state.
176
 
    */
177
 
   void updateWindowCallState();
178
 
 
179
 
 
180
 
   void updateStatusMessage();
181
 
 
182
 
 
183
 
   virtual void keyPressEvent(QKeyEvent *event)
184
 
   {
185
 
      int key = event->key();
186
 
      if(key == Qt::Key_Escape)
187
 
         escape();
188
 
      else if(key == Qt::Key_Return || key == Qt::Key_Enter)
189
 
         enter();
190
 
      else if(key == Qt::Key_Backspace)
191
 
         backspace();
192
 
      else
193
 
      {
194
 
         QString text = event->text();
195
 
         if(! text.isEmpty())
196
 
         {
197
 
            typeString(text);
198
 
         }
199
 
      }
200
 
   }
201
 
 
202
 
   void displayVolumeControls(bool checked = true);
203
 
   void displayDialpad(bool checked = true);
204
 
   void configureSflPhone();
205
 
   void accountCreationWizard();
206
 
   void accept   ();
207
 
   void refuse   ();
208
 
   void hold     ();
209
 
   void transfer ();
210
 
   void record   ();
211
 
   void mailBox  ();
212
 
 
213
 
   void on_widget_dialpad_typed(QString text);
214
 
 
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 );
219
 
 
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);
224
 
 
225
 
signals:
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);
236
 
 
237
 
 
238
 
};
239
 
 
240
 
#endif // SFLPHONEVIEW_H