1 | /* $Id: UIGuestRAMSlider.h 76553 2019-01-01 01:45:53Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIGuestRAMSlider class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2009-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 ___UIGuestRAMSlider_h___
|
---|
19 | #define ___UIGuestRAMSlider_h___
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | /* GUI includes: */
|
---|
25 | #include "QIAdvancedSlider.h"
|
---|
26 | #include "UILibraryDefs.h"
|
---|
27 |
|
---|
28 | /** QIAdvancedSlider subclass used as a guest RAM slider. */
|
---|
29 | class SHARED_LIBRARY_STUFF UIGuestRAMSlider : public QIAdvancedSlider
|
---|
30 | {
|
---|
31 | Q_OBJECT;
|
---|
32 |
|
---|
33 | public:
|
---|
34 |
|
---|
35 | /** Constructs guest RAM slider passing @a pParent to the base-class. */
|
---|
36 | UIGuestRAMSlider(QWidget *pParent = 0);
|
---|
37 | /** Constructs guest RAM slider passing @a pParent and @a enmOrientation to the base-class. */
|
---|
38 | UIGuestRAMSlider(Qt::Orientation enmOrientation, QWidget *pParent = 0);
|
---|
39 |
|
---|
40 | /** Returns the minimum RAM. */
|
---|
41 | uint minRAM() const;
|
---|
42 | /** Returns the maximum optimal RAM. */
|
---|
43 | uint maxRAMOpt() const;
|
---|
44 | /** Returns the maximum allowed RAM. */
|
---|
45 | uint maxRAMAlw() const;
|
---|
46 | /** Returns the maximum possible RAM. */
|
---|
47 | uint maxRAM() const;
|
---|
48 |
|
---|
49 | private:
|
---|
50 |
|
---|
51 | /** Prepares all. */
|
---|
52 | void prepare();
|
---|
53 |
|
---|
54 | /** Calculates page step for passed @a iMaximum value. */
|
---|
55 | int calcPageStep(int iMaximum) const;
|
---|
56 |
|
---|
57 | /** Holds the minimum RAM. */
|
---|
58 | uint m_uMinRAM;
|
---|
59 | /** Holds the maximum optimal RAM. */
|
---|
60 | uint m_uMaxRAMOpt;
|
---|
61 | /** Holds the maximum allowed RAM. */
|
---|
62 | uint m_uMaxRAMAlw;
|
---|
63 | /** Holds the maximum possible RAM. */
|
---|
64 | uint m_uMaxRAM;
|
---|
65 | };
|
---|
66 |
|
---|
67 | #endif /* !___UIGuestRAMSlider_h___ */
|
---|