1 | /* $Id: UIVMLogViewerPanel.h 71638 2018-04-04 05:11:10Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIVMLogViewer class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2010-2017 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef ___UIVMLogViewerPanel_h___
|
---|
19 | #define ___UIVMLogViewerPanel_h___
|
---|
20 |
|
---|
21 | /* Qt includes: */
|
---|
22 | #include <QWidget>
|
---|
23 | #include <QKeySequence>
|
---|
24 | /* GUI includes: */
|
---|
25 | #include "QIWithRetranslateUI.h"
|
---|
26 |
|
---|
27 | /* Forward declarations: */
|
---|
28 | class QHBoxLayout;
|
---|
29 | class QPlainTextEdit;
|
---|
30 | class QTextDocument;
|
---|
31 | class QIToolButton;
|
---|
32 | class UIVMLogViewerWidget;
|
---|
33 |
|
---|
34 |
|
---|
35 | /** QWidget extension acting as the base class for UIVMLogViewerXXXPanel widgets. */
|
---|
36 | class UIVMLogViewerPanel : public QIWithRetranslateUI<QWidget>
|
---|
37 | {
|
---|
38 | Q_OBJECT;
|
---|
39 |
|
---|
40 | public:
|
---|
41 |
|
---|
42 | UIVMLogViewerPanel(QWidget *pParent, UIVMLogViewerWidget *pViewer);
|
---|
43 | void setCloseButtonShortCut(QKeySequence shortCut);
|
---|
44 |
|
---|
45 | protected:
|
---|
46 |
|
---|
47 | virtual void prepare();
|
---|
48 | virtual void prepareWidgets();
|
---|
49 | virtual void prepareConnections();
|
---|
50 |
|
---|
51 | /* Access functions for children classes. */
|
---|
52 | UIVMLogViewerWidget* viewer();
|
---|
53 | const UIVMLogViewerWidget* viewer() const;
|
---|
54 | QHBoxLayout* mainLayout();
|
---|
55 |
|
---|
56 | /** Handles the translation event. */
|
---|
57 | void retranslateUi();
|
---|
58 |
|
---|
59 | /** Handles Qt @a pEvent, used for keyboard processing. */
|
---|
60 | bool eventFilter(QObject *pObject, QEvent *pEvent);
|
---|
61 | /** Handles the Qt show @a pEvent. */
|
---|
62 | void showEvent(QShowEvent *pEvent);
|
---|
63 | /** Handles the Qt hide @a pEvent. */
|
---|
64 | void hideEvent(QHideEvent *pEvent);
|
---|
65 |
|
---|
66 | QTextDocument *textDocument();
|
---|
67 | QPlainTextEdit *textEdit();
|
---|
68 | /* Return the unmodified log. */
|
---|
69 | const QString* logString() const;
|
---|
70 |
|
---|
71 | private:
|
---|
72 |
|
---|
73 | /** Holds the reference to VM Log-Viewer this panel belongs to. */
|
---|
74 | UIVMLogViewerWidget *m_pViewer;
|
---|
75 | QHBoxLayout *m_pMainLayout;
|
---|
76 | QIToolButton *m_pCloseButton;
|
---|
77 | };
|
---|
78 |
|
---|
79 | #endif /* !___UIVMLogViewerPanel!_h___ */
|
---|
80 |
|
---|