VirtualBox

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

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

FE/Qt: bugref:8938. Changing connection syntax in UILineTextEdit and UIPopupPane related classes.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.6 KB
Line 
1/* $Id: UIPopupPaneMessage.h 80914 2019-09-20 06:16:55Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIPopupPaneMessage 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_UIPopupPaneMessage_h
19#define FEQT_INCLUDED_SRC_widgets_UIPopupPaneMessage_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 QLabel;
32class UIAnimation;
33
34/** QWidget extension providing GUI with popup-pane message-pane prototype class. */
35class SHARED_LIBRARY_STUFF UIPopupPaneMessage : 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 message-pane passing @a pParent to the base-class.
55 * @param strText Brings the message text.
56 * @param fFcoused Brings whether the pane is focused. */
57 UIPopupPaneMessage(QWidget *pParent, const QString &strText, bool fFocused);
58
59 /** Defines the message @a strText. */
60 void setText(const QString &strText);
61
62 /** Returns the message minimum size-hint. */
63 QSize minimumSizeHint() const;
64 /** Defines the message @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
79private slots:
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
98 /** Adjusts @a font. */
99 static QFont tuneFont(QFont font);
100
101 /** Holds the layout margin. */
102 const int m_iLayoutMargin;
103 /** Holds the layout spacing. */
104 const int m_iLayoutSpacing;
105
106 /** Holds the label size-hint. */
107 QSize m_labelSizeHint;
108 /** Holds the collapsed size-hint. */
109 QSize m_collapsedSizeHint;
110 /** Holds the expanded size-hint. */
111 QSize m_expandedSizeHint;
112 /** Holds the minimum size-hint. */
113 QSize m_minimumSizeHint;
114
115 /** Holds the text. */
116 QString m_strText;
117
118 /** Holds the label instance. */
119 QLabel *m_pLabel;
120
121 /** Holds the desired label width. */
122 int m_iDesiredLabelWidth;
123
124 /** Holds whether message-pane is focused. */
125 bool m_fFocused;
126
127 /** Holds the animation instance. */
128 UIAnimation *m_pAnimation;
129};
130
131#endif /* !FEQT_INCLUDED_SRC_widgets_UIPopupPaneMessage_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use