summaryrefslogtreecommitdiffstats
path: root/src/kile/kilesidebar.h
blob: 2139048293a38f2eae67f5132a931f7762e963c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/**************************************************************************************
    begin                : Fri 18-06-2004
    edit 		 : Wed 1 Jun 2006
    copyright            : (C) 2004 by Jeroen Wijnhout (Jeroen.Wijnhout@kdemail.net)
                           (C) 2006 by Thomas Braun (braun@physik.fu-berlin.de)
                           (C) 2006 by Michel Ludwig (michel.ludwig@kdemail.net)
 **************************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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 KILESIDEBAR_H
#define KILESIDEBAR_H

#include <tqframe.h>
#include <tqmap.h>

class TQWidgetStack;
class KileMultiTabBar;
class SymbolView;

/**
@author Jeroen Wijnhout
*/
class KileSideBar : public TQFrame
{
	Q_OBJECT
  

public:
	KileSideBar(int size, TQWidget *parent = 0, const char *name = 0, Qt::Orientation orientation = Qt::Vertical);
	~KileSideBar();

	int addTab(TQWidget *tab, const TQPixmap &pic, const TQString &text = TQString());

	int currentTab() { return m_nCurrent; }

	bool isVisible() { return !m_bMinimized; }

        void setSize(int sz) { m_nSize = sz; }
        int size() { return m_nSize; }

	TQWidget* currentPage();
	void removePage(TQWidget *w);

	/**
	 * Shows or hides the tab connected to the widget "w". If the tab to be hidden is
	 * currently selected, the next tab will be shown (cyclically).
	 *
	 * @param b set to "true" to show the tab connected to the widget "w", "false" to
	 *          hide it
	 **/
	void setPageVisible(TQWidget *w, bool b);

signals:
	void visibilityChanged(bool );

public slots:
	void setVisible(bool );

	virtual void shrink();
	virtual void expand();

	void showTab(int);
	void showPage(TQWidget *);
	void toggleTab();
	void switchToTab(int id);

private:
	int findNextShownTab(int i);

protected:
	TQWidgetStack		*m_tabStack;
	KileMultiTabBar		*m_tabBar;
	int			m_nTabs;
	int			m_nCurrent;
	TQMap<int,int>		m_indexToPage;
	TQMap<TQWidget*,int>	m_widgetToIndex;
	bool			m_bMinimized;
	int			m_nMinSize, m_nMaxSize, m_nSize;
};

class KileBottomBar : public KileSideBar
{
	Q_OBJECT
  

public:
	KileBottomBar(int size, TQWidget *parent = 0, const char *name = 0);

	void shrink();
	void expand();
};

#endif