okular/ui/sidebar.h
Jonathan Doman 89fd56c23b Launch documents from external sources in new tabs
FIXED-IN: 4.13.0
BUGS: 331872
BUGS: 332238
REVIEW: 116700
2014-04-09 23:29:58 +02:00

70 lines
2.2 KiB
C++

/***************************************************************************
* Copyright (C) 2007 by Pino Toscano <pino@kde.org> *
* *
* 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. *
***************************************************************************/
#ifndef _SIDEBAR_H_
#define _SIDEBAR_H_
#include <qwidget.h>
#include <KUrl>
class QIcon;
class QListWidgetItem;
class Sidebar : public QWidget
{
Q_OBJECT
public:
Sidebar( QWidget *parent = 0 );
~Sidebar();
int addItem( QWidget *widget, const QIcon &icon, const QString &text );
void setMainWidget( QWidget *widget );
void setBottomWidget( QWidget *widget );
void setItemEnabled( int index, bool enabled );
bool isItemEnabled( int index ) const;
enum SetCurrentIndexBehaviour { UncollapseIfCollapsed, DoNotUncollapseIfCollapsed };
void setCurrentIndex( int index, SetCurrentIndexBehaviour b = UncollapseIfCollapsed );
int currentIndex() const;
void setSidebarVisibility( bool visible );
bool isSidebarVisible() const;
void setCollapsed( bool collapsed );
bool isCollapsed() const;
signals:
void urlsDropped( const KUrl::List& urls );
protected:
void dragEnterEvent( QDragEnterEvent* event );
void dropEvent( QDropEvent* event );
private slots:
void itemClicked( QListWidgetItem *item );
void splitterMoved( int pos, int index );
void listContextMenu( const QPoint & );
void showTextToggled( bool );
void iconSizeChanged( QAction *action );
void appearanceChanged();
private:
void itemClicked( QListWidgetItem *item, SetCurrentIndexBehaviour b );
void saveSplitterSize() const;
// private storage
class Private;
Private *d;
};
#endif