UBDockPaletteWidget.cpp 1.71 KB
Newer Older
1
/*
2
 * Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
3 4 5
 *
 * This file is part of Open-Sankoré.
 *
Claudio Valerio's avatar
Claudio Valerio committed
6 7 8
 * Open-Sankoré is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, version 3 of the License,
9 10 11 12 13 14
 * with a specific linking exception for the OpenSSL project's
 * "OpenSSL" library (or with modified versions of it that use the
 * same license as the "OpenSSL" library).
 *
 * Open-Sankoré is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Claudio Valerio's avatar
Claudio Valerio committed
15 16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
17
 *
Claudio Valerio's avatar
Claudio Valerio committed
18 19
 * You should have received a copy of the GNU General Public License
 * along with Open-Sankoré.  If not, see <http://www.gnu.org/licenses/>.
20 21 22
 */


Claudio Valerio's avatar
Claudio Valerio committed
23

shibakaneki's avatar
shibakaneki committed
24 25
#include "UBDockPaletteWidget.h"

26 27
#include "core/memcheck.h"

28
UBDockPaletteWidget::UBDockPaletteWidget(QWidget *parent, const char *name):QWidget(parent)
shibakaneki's avatar
shibakaneki committed
29 30 31 32 33 34
{
    setObjectName(name);
}

UBDockPaletteWidget::~UBDockPaletteWidget()
{
35

shibakaneki's avatar
shibakaneki committed
36 37
}

38
QPixmap UBDockPaletteWidget::iconToRight()
shibakaneki's avatar
shibakaneki committed
39
{
40
    return mIconToRight;
shibakaneki's avatar
shibakaneki committed
41 42
}

43
QPixmap UBDockPaletteWidget::iconToLeft()
shibakaneki's avatar
shibakaneki committed
44
{
45
    return mIconToLeft;
shibakaneki's avatar
shibakaneki committed
46 47
}

48
QString UBDockPaletteWidget::name()
shibakaneki's avatar
shibakaneki committed
49
{
50
    return mName;
shibakaneki's avatar
shibakaneki committed
51
}
52

53 54 55
/**
  * When a widget registers a mode it means that it would be displayed on that mode
  */
56 57 58 59 60 61 62 63
void UBDockPaletteWidget::registerMode(eUBDockPaletteWidgetMode mode)
{
    if(!mRegisteredModes.contains(mode))
        mRegisteredModes.append(mode);
}

void UBDockPaletteWidget::slot_changeMode(eUBDockPaletteWidgetMode newMode)
{
64
    this->setVisible(this->visibleInMode( newMode ));
65 66 67
}