compile
[kdegraphics.git] / okular / ui / sidebar.h
blob60dc7d6a79480566789b1b43b631dfc7b298a542
1 /***************************************************************************
2 * Copyright (C) 2007 by Pino Toscano <pino@kde.org> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 ***************************************************************************/
10 #ifndef _SIDEBAR_H_
11 #define _SIDEBAR_H_
13 #include <qwidget.h>
15 class QIcon;
16 class QListWidgetItem;
18 class Sidebar : public QWidget
20 Q_OBJECT
21 public:
22 Sidebar( QWidget *parent = 0 );
23 ~Sidebar();
25 int addItem( QWidget *widget, const QIcon &icon, const QString &text );
27 void setMainWidget( QWidget *widget );
28 void setBottomWidget( QWidget *widget );
30 void setItemEnabled( int index, bool enabled );
31 bool isItemEnabled( int index ) const;
33 void setCurrentIndex( int index );
34 int currentIndex() const;
36 void setSidebarVisibility( bool visible );
37 bool isSidebarVisible() const;
39 private slots:
40 void itemClicked( QListWidgetItem *item );
41 void splitterMoved( int pos, int index );
42 void listContextMenu( const QPoint & );
43 void showTextToggled( bool );
44 void iconSizeChanged( QAction *action );
46 private:
47 void saveSplitterSize() const;
49 // private storage
50 class Private;
51 Private *d;
54 #endif