VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerPanel.h@ 102493

Last change on this file since 102493 was 101092, checked in by vboxsync, 12 months ago

FE/Qt: bugref:6699, bugref:9072. Fixing 'type to search' functionality of log viewer. take 1.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.2 KB
Line 
1/* $Id: UIVMLogViewerPanel.h 101092 2023-09-12 12:54:09Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIVMLogViewer class declaration.
4 */
5
6/*
7 * Copyright (C) 2010-2023 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef FEQT_INCLUDED_SRC_logviewer_UIVMLogViewerPanel_h
29#define FEQT_INCLUDED_SRC_logviewer_UIVMLogViewerPanel_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* GUI includes: */
35#include "UIPaneContainer.h"
36#include "UIVMLogBookmark.h"
37
38/* Forward declarations: */
39class QPlainTextEdit;
40class QTextDocument;
41class UIVMLogViewerWidget;
42class UIVMLogViewerSearchWidget;
43class UIVMLogViewerFilterWidget;
44class UIVMLogViewerBookmarksWidget;
45class UIVMLogViewerPreferencesWidget;
46
47class UIVMLogViewerPaneContainer : public UIPaneContainer
48{
49 Q_OBJECT;
50
51signals:
52
53 void sigHighlightingUpdated();
54 void sigSearchUpdated();
55 void sigFilterApplied();
56 void sigDeleteBookmarkByIndex(int bookmarkIndex);
57 void sigDeleteAllBookmarks();
58 void sigBookmarkSelected(int index);
59
60 void sigShowLineNumbers(bool show);
61 void sigWrapLines(bool show);
62 void sigChangeFontSizeInPoints(int size);
63 void sigChangeFont(QFont font);
64 void sigResetToDefaults();
65
66 void sigShowSearchPane();
67
68public:
69
70 UIVMLogViewerPaneContainer(QWidget *pParent, UIVMLogViewerWidget *pViewer);
71
72 /** @name Search page pass through functions
73 * @{ */
74 void refreshSearch();
75 QVector<float> matchLocationVector() const;
76 /** Returns the number of the matches to the current search. */
77 int matchCount() const;
78 /** @} */
79
80 /** @name Filter page pass through functions
81 * @{ */
82 void applyFilter();
83 /** @} */
84
85 /** @name Bookmark page pass through functions
86 * @{ */
87 void updateBookmarkList(const QVector<UIVMLogBookmark>& bookmarkList);
88 void disableEnableBookmarking(bool flag);
89 /** @} */
90
91 /** @name Preferences page pass through functions
92 * @{ */
93 void setShowLineNumbers(bool bShowLineNumbers);
94 void setWrapLines(bool bWrapLines);
95 void setFontSizeInPoints(int fontSizeInPoints);
96 /** @} */
97
98 enum Page
99 {
100 Page_Search = 0,
101 Page_Filter,
102 Page_Bookmark,
103 Page_Preferences,
104 Page_Max
105 };
106
107protected:
108
109 virtual bool eventFilter(QObject *pObject, QEvent *pEvent) override;
110
111private:
112
113 void retranslateUi() override;
114 void prepare() override;
115
116 UIVMLogViewerWidget *m_pViewer;
117 UIVMLogViewerSearchWidget *m_pSearchWidget;
118 UIVMLogViewerFilterWidget *m_pFilterWidget;
119 UIVMLogViewerBookmarksWidget *m_pBookmarksWidget;
120 UIVMLogViewerPreferencesWidget *m_pPreferencesWidget;
121};
122
123/** UIDialonPanel extension acting as the base class for UIVMLogViewerXXXPanel widgets. */
124class UIVMLogViewerPane : public QIWithRetranslateUI<QWidget>
125{
126 Q_OBJECT;
127
128public:
129
130 UIVMLogViewerPane(QWidget *pParent, UIVMLogViewerWidget *pViewer);
131
132protected:
133
134 virtual void retranslateUi() RT_OVERRIDE;
135
136 virtual void prepareWidgets() = 0;
137 virtual void prepareConnections() = 0;
138
139 /* Access functions for children classes. */
140 UIVMLogViewerWidget *viewer();
141 const UIVMLogViewerWidget *viewer() const;
142 QTextDocument *textDocument();
143 QPlainTextEdit *textEdit();
144 /* Return the unmodified log. */
145 const QString *logString() const;
146
147private:
148
149 /** Holds the reference to VM Log-Viewer this panel belongs to. */
150 UIVMLogViewerWidget *m_pViewer;
151};
152
153#endif /* !FEQT_INCLUDED_SRC_logviewer_UIVMLogViewerPanel_h */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette