~ubuntu-branches/ubuntu/karmic/psi/karmic

« back to all changes in this revision

Viewing changes to src/widgets/psitabwidget.h

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2008-08-28 18:46:52 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080828184652-iiik12dl91nq7cdi
Tags: 0.12-2
Uploading to unstable (Closes: Bug#494352)

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *
19
19
 */
20
20
 
21
 
 
22
21
#ifndef PSITABWIDGET_H
23
22
#define PSITABWIDGET_H
24
23
 
43
42
public:
44
43
        PsiTabWidget(QWidget *parent = 0);
45
44
        ~PsiTabWidget();
46
 
        
47
 
        void setTabTextColor( QWidget* tab, const QColor& color);
 
45
 
 
46
        void setTabTextColor(QWidget *tab, const QColor &color);
48
47
        int count();
49
 
        QWidget* currentPage();
 
48
        QWidget *currentPage();
50
49
        int currentPageIndex();
51
 
        QWidget* widget(int index);
52
 
        void addTab(QWidget*, QString);
53
 
        void showPage(QWidget*);
54
 
        void showPageDirectly(QWidget*);
55
 
        
56
 
        void removePage(QWidget*);
 
50
        QWidget *widget(int index);
 
51
        void addTab(QWidget *, QString);
 
52
        void showPage(QWidget *);
 
53
        void showPageDirectly(QWidget *);
 
54
 
 
55
        void removePage(QWidget *);
57
56
        QWidget* page(int index);
58
 
        int getIndex(QWidget*);
59
 
        void setTabLabel(QWidget*, const QString&);
 
57
        int getIndex(QWidget *);
 
58
        void setTabText(QWidget *, const QString &);
60
59
        void setTabPosition(QTabWidget::TabPosition pos);
61
 
        void setCloseIcon(const QIcon&);
 
60
        void setCloseIcon(const QIcon &);
 
61
 
 
62
        void setTabBarShown(bool shown);     // default shown
 
63
        void setTabButtonsShown(bool shown); // default shown
 
64
        void setDragsEnabled(bool enabled);  // default enabled
62
65
 
63
66
public slots:
64
67
        void setCurrentPage(int);
65
68
        void removeCurrentPage();
66
69
 
67
70
signals:
68
 
        void mouseDoubleClickTab( QWidget* tab );
69
 
        void currentChanged(QWidget*);
 
71
        void mouseDoubleClickTab(QWidget *tab);
 
72
        void currentChanged(QWidget *selected);
70
73
        void closeButtonClicked();
71
74
        void aboutToShowMenu(QMenu *);
 
75
 
72
76
        // context menu on the blank space will have tab==-1
73
 
        void tabContextMenu( int tab, QPoint pos, QContextMenuEvent * event);
74
 
 
 
77
        void tabContextMenu(int tab, QPoint pos, QContextMenuEvent *event);
75
78
 
76
79
private slots:
77
 
        void mouseDoubleClickTab( int tab );
78
 
        void tab_currentChanged( int tab );
79
 
        void tab_contextMenu( QContextMenuEvent * event, int tab);
 
80
        void mouseDoubleClickTab(int tab);
 
81
        void tab_currentChanged(int tab);
 
82
        void tab_contextMenu(QContextMenuEvent *event, int tab);
80
83
        void menu_aboutToShow();
81
84
        void menu_triggered(QAction *act);
82
 
        
 
85
 
83
86
private:
84
87
        QVector<QWidget*> widgets_;
85
 
        QTabBar* tabBar_;
86
 
        QVBoxLayout* layout_;
 
88
        QTabBar *tabBar_;
 
89
        QVBoxLayout *layout_;
87
90
        QHBoxLayout *barLayout_;
88
91
        QStackedLayout *stacked_;
89
92
        QToolButton *closeButton_;
93
96
}; 
94
97
 
95
98
 
 
99
#define PSITABDRAGMIMETYPE "x-drag-drop/x-psi-tab-drag"
 
100
 
96
101
#endif