konqframestatusbar.h 2.9 KB
Newer Older
1 2
/*  This file is part of the KDE project
    Copyright (C) 1998, 1999 Michael Reiher <michael.reiher@gmx.de>
3
    Copyright 2007, 2010 David Faure <faure@kde.org>
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

    This program 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; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

#ifndef KONQ_FRAMESTATUSBAR_H
#define KONQ_FRAMESTATUSBAR_H

#include <KStatusBar>
David Faure's avatar
David Faure committed
24
#include "konqstatusbarmessagelabel.h"
25 26 27 28 29
class QLabel;
class QProgressBar;
class QCheckBox;
class KonqView;
class KonqFrame;
30 31 32 33
namespace KParts
{
class ReadOnlyPart;
}
34 35 36 37 38 39 40 41 42 43

/**
 * The KonqFrameStatusBar is the statusbar under each konqueror view.
 * It indicates in particular whether a view is active or not.
 */
class KonqFrameStatusBar : public KStatusBar
{
    Q_OBJECT

public:
Laurent Montel's avatar
Laurent Montel committed
44
    explicit KonqFrameStatusBar(KonqFrame *_parent = Q_NULLPTR);
45 46
    virtual ~KonqFrameStatusBar();

47
    void setMessage(const QString &msg, KonqStatusBarMessageLabel::Type type);
48

49 50 51
    /**
     * Checks/unchecks the linked-view checkbox
     */
52
    void setLinkedView(bool b);
53 54 55
    /**
     * Shows/hides the active-view indicator
     */
56
    void showActiveViewIndicator(bool b);
57 58 59
    /**
     * Shows/hides the linked-view indicator
     */
60
    void showLinkedViewIndicator(bool b);
61 62 63 64 65 66
    /**
     * Updates the active-view indicator and the statusbar color.
     */
    void updateActiveStatus();

public Q_SLOTS:
67 68 69 70
    void slotConnectToNewView(KonqView *, KParts::ReadOnlyPart *oldOne, KParts::ReadOnlyPart *newOne);
    void slotLoadingProgress(int percent);
    void slotSpeedProgress(int bytesPerSecond);
    void slotDisplayStatusText(const QString &text);
71 72

    void slotClear();
73
    void message(const QString &message);
74 75 76 77 78 79 80 81 82 83

Q_SIGNALS:
    /**
     * This signal is emitted when the user clicked the bar.
     */
    void clicked();

    /**
     * The "linked view" checkbox was clicked
     */
84
    void linkedViewClicked(bool mode);
85 86

protected:
Laurent Montel's avatar
Laurent Montel committed
87 88
    bool eventFilter(QObject *, QEvent *) Q_DECL_OVERRIDE;
    void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE;
89 90 91 92 93 94
    /**
     * Brings up the context menu for this frame
     */
    virtual void splitFrameMenu();

private:
95
    KonqFrame *m_pParentKonqFrame;
96 97
    QCheckBox *m_pLinkedViewCheckBox;
    QProgressBar *m_progressBar;
98
    KonqStatusBarMessageLabel *m_pStatusLabel;
99
    QLabel *m_led;
100 101 102 103 104
    QString m_savedMessage;
};

#endif /* KONQ_FRAMESTATUSBAR_H */