Proof-reading - fixed one usage of the i18n plural form (it wasn't doing before,...
[kdeadmin.git] / ksystemlog / src / mainWindow.h
blobad7051378ee4cf34a4ebe512cbaa9652043269fe
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 MAIN_WINDOW_H
23 #define MAIN_WINDOW_H
25 #include <QList>
27 //KDE includes
28 #include <kapplication.h>
29 #include <kxmlguiwindow.h>
30 #include <kconfig.h>
31 #include <kmenu.h>
33 #include <ktoggleaction.h>
35 class QAction;
37 class LogManager;
38 class LogMode;
40 class View;
42 class TabLogViewsWidget;
44 namespace KSystemLog {
46 class MainWindowPrivate;
48 /**
49 * This class serves as the main window for ksystemlog. It handles the
50 * menus, toolbars, and status bars.
52 class MainWindow : public KXmlGuiWindow {
54 Q_OBJECT
56 public:
57 /**
58 * Default Constructor
60 MainWindow();
62 /**
63 * Default Destructor
65 virtual ~MainWindow();
67 TabLogViewsWidget* tabs();
69 protected:
70 /**
71 * This function is called when it is time for the app to save its
72 * properties for session management purposes.
74 void saveProperties(KConfigGroup& configuration);
76 /**
77 * This function is called when this app is restored. The KConfig
78 * object points to the session management config file that was saved
79 * with @ref saveProperties
81 void readProperties(const KConfigGroup& configuration);
83 public slots:
84 void changeStatusBar(const QString& text);
85 void changeWindowTitle(const QString& text);
87 void updateStatusBar();
89 void prepareCreatedLogManager(LogManager* logManager);
91 private slots:
92 void fileOpen();
94 void showConfigurationDialog();
95 void showDetailsDialog();
96 void showLogMessageDialog();
98 //Transmits signals to active LogManager
99 void showSearchBar();
100 void findNext();
101 void findPrevious();
103 void updateSelection();
104 void updateReloading();
106 void toggleFilterBar();
108 void toggleItemTooltip(bool enabled);
109 void toggleNewLinesDisplaying(bool displayed);
110 void toggleResumePauseParsing(bool paused);
112 void changeCurrentTab();
114 void changeResumePauseAction(bool paused);
115 void selectLogModeAction(QAction* action);
117 protected slots:
119 * Last method called before application exitting (Overridden method)
121 bool queryExit();
123 private:
125 void loadLogModePlugins();
127 void setupStatusBar();
129 void setupTabLogViews();
131 void setupActions();
132 void setupLogActions();
134 void updateDetailDialog();
136 MainWindowPrivate* const d;
142 #endif //MAIN_WINDOW_H