1
/***************************************************************************
2
* Copyright (C) 2012-2014 by Savoir-Faire Linux *
3
* Author : Emmanuel Lepage Valle <emmanuel.lepage@savoirfairelinux.com >*
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License as published by *
7
* the Free Software Foundation; either version 3 of the License, or *
8
* (at your option) any later version. *
10
* This program is distributed in the hope that it will be useful, *
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13
* GNU General Public License for more details. *
15
* You should have received a copy of the GNU General Public License *
16
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
17
**************************************************************************/
18
#ifndef OVERLAYTOOLBAR_H
19
#define OVERLAYTOOLBAR_H
22
#include <QtGui/QToolButton>
23
#include <QtGui/QItemSelectionModel>
26
#include <QtGui/QWidget>
27
#include <QtCore/QHash>
28
#include "lib/sflphone_const.h"
39
class ObserverToolButton;
41
class ObserverToolButton : public QToolButton
45
explicit ObserverToolButton(QWidget* parent = nullptr);
47
void setNewText(const QString& text) {
52
class OverlayToolbar : public QWidget
56
explicit OverlayToolbar(QWidget* parent = nullptr);
57
virtual ~OverlayToolbar();
60
void setForcedParent(QWidget* parent);
61
void setIconSize(int size);
64
ObserverToolButton* actionButton(int key);
68
void addAction(ExtendedAction* action, int key = -1);
72
QSvgRenderer* m_pRightRender ;
73
QSvgRenderer* m_pLeftRender ;
74
QWidget* m_pForcedParent;
76
QHBoxLayout* m_pLayout ;
77
QHash<int,ObserverToolButton*> m_hButtons;
81
virtual void updateState();
85
void paintEvent ( QPaintEvent* event);
86
void hideEvent ( QHideEvent* event);
87
void showEvent ( QShowEvent* event);
88
bool eventFilter( QObject *obj, QEvent *event);
91
ObserverToolButton* createButton(ExtendedAction* action);
94
void visibilityChanged(bool);