VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPaneDetails.h@ 82781

Last change on this file since 82781 was 76581, checked in by vboxsync, 5 years ago

Fe/QT: scm header guard alignment.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.0 KB
Line 
1/* $Id: UIPopupPaneDetails.h 76581 2019-01-01 06:24:57Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIPopupPaneDetails class declaration.
4 */
5
6/*
7 * Copyright (C) 2013-2019 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 FEQT_INCLUDED_SRC_widgets_UIPopupPaneDetails_h
19#define FEQT_INCLUDED_SRC_widgets_UIPopupPaneDetails_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24/* Qt includes: */
25#include <QWidget>
26
27/* GUI includes: */
28#include "UILibraryDefs.h"
29
30/* Forward declarations: */
31class QTextEdit;
32class UIAnimation;
33
34/** QWidget extension providing GUI with popup-pane details-pane prototype class. */
35class SHARED_LIBRARY_STUFF UIPopupPaneDetails : public QWidget
36{
37 Q_OBJECT;
38 Q_PROPERTY(QSize collapsedSizeHint READ collapsedSizeHint);
39 Q_PROPERTY(QSize expandedSizeHint READ expandedSizeHint);
40 Q_PROPERTY(QSize minimumSizeHint READ minimumSizeHint WRITE setMinimumSizeHint);
41
42signals:
43
44 /** Notifies about focus enter. */
45 void sigFocusEnter();
46 /** Notifies about focus enter. */
47 void sigFocusLeave();
48
49 /** Notifies about size-hint change. */
50 void sigSizeHintChanged();
51
52public:
53
54 /** Constructs details-pane passing @a pParent to the base-class.
55 * @param strText Brings the details text.
56 * @param fFcoused Brings whether the pane is focused. */
57 UIPopupPaneDetails(QWidget *pParent, const QString &strText, bool fFocused);
58
59 /** Defines the details @a strText. */
60 void setText(const QString &strText);
61
62 /** Returns the details minimum size-hint. */
63 QSize minimumSizeHint() const;
64 /** Defines the details @a minimumSizeHint. */
65 void setMinimumSizeHint(const QSize &minimumSizeHint);
66 /** Lays the content out. */
67 void layoutContent();
68
69 /** Returns the collapsed size-hint. */
70 QSize collapsedSizeHint() const { return m_collapsedSizeHint; }
71 /** Returns the expanded size-hint. */
72 QSize expandedSizeHint() const { return m_expandedSizeHint; }
73
74public slots:
75
76 /** Handles proposal for @a iWidth. */
77 void sltHandleProposalForWidth(int iWidth);
78 /** Handles proposal for @a iHeight. */
79 void sltHandleProposalForHeight(int iHeight);
80
81 /** Handles focus enter. */
82 void sltFocusEnter();
83 /** Handles focus leave. */
84 void sltFocusLeave();
85
86private:
87
88 /** Prepares all. */
89 void prepare();
90 /** Prepares content. */
91 void prepareContent();
92 /** Prepares animations. */
93 void prepareAnimation();
94
95 /** Updates size-hint. */
96 void updateSizeHint();
97 /** Updates visibility. */
98 void updateVisibility();
99
100 /** Adjusts @a font. */
101 static QFont tuneFont(QFont font);
102
103 /** Holds the layout margin. */
104 const int m_iLayoutMargin;
105 /** Holds the layout spacing. */
106 const int m_iLayoutSpacing;
107
108 /** Holds the text-editor size-hint. */
109 QSize m_textEditSizeHint;
110 /** Holds the collapsed size-hint. */
111 QSize m_collapsedSizeHint;
112 /** Holds the expanded size-hint. */
113 QSize m_expandedSizeHint;
114 /** Holds the minimum size-hint. */
115 QSize m_minimumSizeHint;
116
117 /** Holds the text. */
118 QString m_strText;
119
120 /** Holds the text-editor instance. */
121 QTextEdit *m_pTextEdit;
122
123 /** Holds the desired textr-editor width. */
124 int m_iDesiredTextEditWidth;
125 /** Holds the maximum pane height. */
126 int m_iMaximumPaneHeight;
127 /** Holds the desired textr-editor height. */
128 int m_iMaximumTextEditHeight;
129 /** Holds the text content margin. */
130 int m_iTextContentMargin;
131
132 /** Holds whether details-pane is focused. */
133 bool m_fFocused;
134
135 /** Holds the animation instance. */
136 UIAnimation *m_pAnimation;
137};
138
139#endif /* !FEQT_INCLUDED_SRC_widgets_UIPopupPaneDetails_h */
140
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use