[70027] | 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 |
|
---|
[70500] | 18 | #ifndef ___UIVMLogViewerPanel_h___
|
---|
| 19 | #define ___UIVMLogViewerPanel_h___
|
---|
[70027] | 20 |
|
---|
| 21 | /* Qt includes: */
|
---|
| 22 | #include <QWidget>
|
---|
[71477] | 23 | #include <QKeySequence>
|
---|
[70027] | 24 | /* GUI includes: */
|
---|
| 25 | #include "QIWithRetranslateUI.h"
|
---|
| 26 |
|
---|
| 27 | /* Forward declarations: */
|
---|
| 28 | class QHBoxLayout;
|
---|
[70539] | 29 | class QPlainTextEdit;
|
---|
| 30 | class QTextDocument;
|
---|
[70706] | 31 | class QIToolButton;
|
---|
[70027] | 32 | class UIVMLogViewerWidget;
|
---|
| 33 |
|
---|
[70466] | 34 |
|
---|
[70500] | 35 | /** QWidget extension acting as the base class for UIVMLogViewerXXXPanel widgets. */
|
---|
| 36 | class UIVMLogViewerPanel : public QIWithRetranslateUI<QWidget>
|
---|
[70027] | 37 | {
|
---|
| 38 | Q_OBJECT;
|
---|
| 39 |
|
---|
| 40 | public:
|
---|
| 41 |
|
---|
[70500] | 42 | UIVMLogViewerPanel(QWidget *pParent, UIVMLogViewerWidget *pViewer);
|
---|
[71477] | 43 | void setCloseButtonShortCut(QKeySequence shortCut);
|
---|
[70027] | 44 |
|
---|
[70500] | 45 | protected:
|
---|
[70308] | 46 |
|
---|
[70500] | 47 | virtual void prepare();
|
---|
| 48 | virtual void prepareWidgets();
|
---|
| 49 | virtual void prepareConnections();
|
---|
[70027] | 50 |
|
---|
[70500] | 51 | /* Access functions for children classes. */
|
---|
| 52 | UIVMLogViewerWidget* viewer();
|
---|
| 53 | const UIVMLogViewerWidget* viewer() const;
|
---|
| 54 | QHBoxLayout* mainLayout();
|
---|
[70027] | 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 |
|
---|
[70539] | 66 | QTextDocument *textDocument();
|
---|
| 67 | QPlainTextEdit *textEdit();
|
---|
| 68 | /* Return the unmodified log. */
|
---|
| 69 | const QString* logString() const;
|
---|
[70500] | 70 |
|
---|
| 71 | private:
|
---|
| 72 |
|
---|
[70487] | 73 | /** Holds the reference to VM Log-Viewer this panel belongs to. */
|
---|
[70027] | 74 | UIVMLogViewerWidget *m_pViewer;
|
---|
[70308] | 75 | QHBoxLayout *m_pMainLayout;
|
---|
[70706] | 76 | QIToolButton *m_pCloseButton;
|
---|
[70027] | 77 | };
|
---|
| 78 |
|
---|
[70500] | 79 | #endif /* !___UIVMLogViewerPanel!_h___ */
|
---|
[71638] | 80 |
|
---|