0026936: Drawbacks of inlining in new type system in OCCT 7.0 -- automatic
[occt.git] / samples / qt / AndroidQt / AndroidQt_Window.h
CommitLineData
80eb9670 1// Copyright (c) 2014 OPEN CASCADE SAS
2//
3// This file is part of Open CASCADE Technology software library.
4//
5// This library is free software; you can redistribute it and/or modify it under
6// the terms of the GNU Lesser General Public License version 2.1 as published
7// by the Free Software Foundation, with special exception defined in the file
8// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9// distribution for complete text of the license and disclaimer of any warranty.
10//
11// Alternatively, this file may be used under the terms of Open CASCADE
12// commercial license or contractual agreement.
13
14#ifndef ANDROIDQT_WINDOW_H
15#define ANDROIDQT_WINDOW_H
16
17#include <Aspect_Window.hxx>
18
19//! This class defines dummy window.
20//! The main functionality is viewport dimensions.
21class AndroidQt_Window : public Aspect_Window
22{
23
24public:
25
26 //! Creates a wrapper over existing Window handle
27 AndroidQt_Window(const int theWidth, const int theHeight,
28 const int theX1 = -1, const int theX2 = -1,
29 const int theY1 = -1, const int theY2 = -1);
30
31 //! Returns native Window handle
32 virtual Aspect_Drawable NativeHandle() const { return 0; }
33
34 //! Returns parent of native Window handle.
35 virtual Aspect_Drawable NativeParentHandle() const { return 0; }
36
37 virtual void Destroy() {}
38
39 //! Opens the window <me>
40 virtual void Map() const {}
41
42 //! Closes the window <me>
43 virtual void Unmap() const {}
44
45 //! Applies the resizing to the window <me>
46 virtual Aspect_TypeOfResize DoResize() const { return Aspect_TOR_UNKNOWN; }
47
48 //! Apply the mapping change to the window <me>
49 virtual Standard_Boolean DoMapping() const { return Standard_True; }
50
51 //! Returns True if the window <me> is opened
52 virtual Standard_Boolean IsMapped() const { return Standard_True; }
53
54 //! Returns The Window RATIO equal to the physical WIDTH/HEIGHT dimensions
55 virtual Quantity_Ratio Ratio() const { return 1.0; }
56
57 //! Returns The Window POSITION in PIXEL
58 virtual void Position (Standard_Integer& theX1,
59 Standard_Integer& theY1,
60 Standard_Integer& theX2,
61 Standard_Integer& theY2) const;
62
63 //! Set The Window POSITION in PIXEL
64 virtual void SetPosition (const Standard_Integer theX1,
65 const Standard_Integer theY1,
66 const Standard_Integer theX2,
67 const Standard_Integer theY2);
68
69 //! Returns The Window SIZE in PIXEL
70 virtual void Size (Standard_Integer& theWidth,
71 Standard_Integer& theHeight) const;
72
73 //! Set The Window SIZE in PIXEL
74 virtual void SetSize (const Standard_Integer theWidth,
75 const Standard_Integer theHeight);
76
77private:
78
79 int myWidth;
80 int myHeight;
81
82 int myX1;
83 int myX2;
84 int myY1;
85 int myY2;
86
87public:
88
92efcf78 89 DEFINE_STANDARD_RTTIEXT(AndroidQt_Window,Aspect_Window)
80eb9670 90
91};
92
93DEFINE_STANDARD_HANDLE(AndroidQt_Window, Aspect_Window)
94
95#endif // ANDROIDQT_WINDOW_H