Proof-reading - fixed one usage of the i18n plural form (it wasn't doing before,...
[kdeadmin.git] / ksystemlog / src / tabLogViewsWidget.h
blob85d368e58dfe38bd80a73d9d264676009cacd88d
1 /***************************************************************************
2 * KSystemLog, a system log viewer tool *
3 * Copyright (C) 2007 by Nicolas Ternisien *
4 * nicolas.ternisien@gmail.com *
5 * *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the *
18 * Free Software Foundation, Inc., *
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
20 ***************************************************************************/
22 #ifndef _TAB_LOG_VIEWS_WIDGET_H_
23 #define _TAB_LOG_VIEWS_WIDGET_H_
25 #include <ktabwidget.h>
26 #include <QList>
28 class QString;
29 class QIcon;
31 class LogManager;
32 class TabLogManager;
33 class View;
34 class LogMode;
36 class TabLogViewsWidgetPrivate;
38 class TabLogViewsWidget : public KTabWidget {
40 Q_OBJECT
42 public:
43 TabLogViewsWidget(QWidget* parent = NULL);
45 virtual ~TabLogViewsWidget();
47 QList<LogManager*> logManagers();
49 LogManager* activeLogManager();
51 void load(LogMode* logMode, LogManager* manager);
53 public slots:
55 LogManager* createTab();
56 LogManager* duplicateTab();
58 void closeTab();
60 void moveTabLeft();
61 void moveTabRight();
63 void reloadCurrent();
64 void reloadAll();
66 /**
67 * Display a reload icon on the specified view tab
69 void changeReloadingTab(View* view, bool reloading);
71 //Methods that transmit a signal to the current logViewWidget
72 void expandAllCurrentView();
73 void collapseAllCurrentView();
74 void selectAllCurrentView();
76 void fileSaveCurrentView();
77 void copyToClipboardCurrentView();
78 void sendMailCurrentView();
79 void printSelectionCurrentView();
81 private slots:
82 void changeTab(View* view, const QIcon& icon, const QString& label);
84 void changeCurrentTab();
85 void changeTitleAddedLines(View*, int);
87 void showContextMenu(const QPoint& cursorPosition);
88 void showContextMenu(QWidget* tab, const QPoint& cursorPosition);
90 signals:
91 void tabCreationRequested();
92 void tabClosingRequested();
94 void logManagerCreated(LogManager* manager);
96 void statusBarChanged(const QString& message);
98 private:
99 TabLogManager* newTabLogManager();
101 void newTab(View* view);
103 LogManager* findRelatedLogManager(View* view);
105 QIcon logModeIcon(LogMode* icon);
107 TabLogManager* activeTabLogManager();
108 TabLogManager* findRelatedTabLogManager(View* view);
110 void prepareContextMenu(bool onTab);
112 TabLogViewsWidgetPrivate* const d;
116 #endif // _TAB_LOG_VIEWS_WIDGET_H_