Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef INCLUDED_VCL_INC_HEADLESS_SVPFRAME_HXX
21 : #define INCLUDED_VCL_INC_HEADLESS_SVPFRAME_HXX
22 :
23 : #include <vcl/sysdata.hxx>
24 : #include <basegfx/range/b2ibox.hxx>
25 : #include <basebmp/bitmapdevice.hxx>
26 :
27 : #include <salframe.hxx>
28 :
29 : #include <list>
30 :
31 : #ifdef IOS
32 : #define SvpSalInstance AquaSalInstance
33 : #define SvpSalGraphics AquaSalGraphics
34 : #endif
35 :
36 : class SvpSalInstance;
37 : class SvpSalGraphics;
38 :
39 : class VCL_DLLPUBLIC SvpSalFrame : public SalFrame
40 : {
41 : SvpSalInstance* m_pInstance;
42 : SvpSalFrame* m_pParent; // pointer to parent frame
43 : std::list< SvpSalFrame* > m_aChildren; // List of child frames
44 : sal_uLong m_nStyle;
45 : bool m_bVisible;
46 : bool m_bTopDown;
47 : #ifndef IOS
48 : basebmp::BitmapDeviceSharedPtr m_aFrame;
49 : bool m_bDamageTracking;
50 : #endif
51 : basebmp::Format m_nScanlineFormat;
52 : long m_nMinWidth;
53 : long m_nMinHeight;
54 : long m_nMaxWidth;
55 : long m_nMaxHeight;
56 :
57 : SystemEnvData m_aSystemChildData;
58 :
59 : std::list< SvpSalGraphics* > m_aGraphics;
60 :
61 : static SvpSalFrame* s_pFocusFrame;
62 : public:
63 : SvpSalFrame( SvpSalInstance* pInstance,
64 : SalFrame* pParent,
65 : sal_uLong nSalFrameStyle,
66 : bool bTopDown,
67 : basebmp::Format nScanlineFormat,
68 : SystemParentData* pSystemParent = NULL );
69 : virtual ~SvpSalFrame();
70 :
71 : void GetFocus();
72 : void LoseFocus();
73 : void PostPaint(bool bImmediate) const;
74 : void AllocateFrame();
75 :
76 : #if defined ANDROID
77 : const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aFrame; }
78 : #endif
79 :
80 : // SalFrame
81 : virtual SalGraphics* AcquireGraphics() SAL_OVERRIDE;
82 : virtual void ReleaseGraphics( SalGraphics* pGraphics ) SAL_OVERRIDE;
83 :
84 : virtual bool PostEvent( void* pData ) SAL_OVERRIDE;
85 :
86 : virtual void SetTitle( const OUString& rTitle ) SAL_OVERRIDE;
87 : virtual void SetIcon( sal_uInt16 nIcon ) SAL_OVERRIDE;
88 : virtual void SetMenu( SalMenu* pMenu ) SAL_OVERRIDE;
89 : virtual void DrawMenuBar() SAL_OVERRIDE;
90 :
91 : virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle ) SAL_OVERRIDE;
92 : virtual void Show( bool bVisible, bool bNoActivate = false ) SAL_OVERRIDE;
93 : virtual void SetMinClientSize( long nWidth, long nHeight ) SAL_OVERRIDE;
94 : virtual void SetMaxClientSize( long nWidth, long nHeight ) SAL_OVERRIDE;
95 : virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ) SAL_OVERRIDE;
96 : virtual void GetClientSize( long& rWidth, long& rHeight ) SAL_OVERRIDE;
97 : virtual void GetWorkArea( Rectangle& rRect ) SAL_OVERRIDE;
98 : virtual SalFrame* GetParent() const SAL_OVERRIDE;
99 : virtual void SetWindowState( const SalFrameState* pState ) SAL_OVERRIDE;
100 : virtual bool GetWindowState( SalFrameState* pState ) SAL_OVERRIDE;
101 : virtual void ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay ) SAL_OVERRIDE;
102 : virtual void StartPresentation( bool bStart ) SAL_OVERRIDE;
103 : virtual void SetAlwaysOnTop( bool bOnTop ) SAL_OVERRIDE;
104 : virtual void ToTop( sal_uInt16 nFlags ) SAL_OVERRIDE;
105 : virtual void SetPointer( PointerStyle ePointerStyle ) SAL_OVERRIDE;
106 : virtual void CaptureMouse( bool bMouse ) SAL_OVERRIDE;
107 : virtual void SetPointerPos( long nX, long nY ) SAL_OVERRIDE;
108 : using SalFrame::Flush;
109 : virtual void Flush() SAL_OVERRIDE;
110 : virtual void Sync() SAL_OVERRIDE;
111 : virtual void SetInputContext( SalInputContext* pContext ) SAL_OVERRIDE;
112 : virtual void EndExtTextInput( EndExtTextInputFlags nFlags ) SAL_OVERRIDE;
113 : virtual OUString GetKeyName( sal_uInt16 nKeyCode ) SAL_OVERRIDE;
114 : virtual bool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, vcl::KeyCode& rKeyCode ) SAL_OVERRIDE;
115 : virtual LanguageType GetInputLanguage() SAL_OVERRIDE;
116 : virtual void UpdateSettings( AllSettings& rSettings ) SAL_OVERRIDE;
117 : virtual void Beep() SAL_OVERRIDE;
118 : virtual const SystemEnvData* GetSystemData() const SAL_OVERRIDE;
119 : virtual SalPointerState GetPointerState() SAL_OVERRIDE;
120 : virtual KeyIndicatorState GetIndicatorState() SAL_OVERRIDE;
121 : virtual void SimulateKeyPress( sal_uInt16 nKeyCode ) SAL_OVERRIDE;
122 : virtual void SetParent( SalFrame* pNewParent ) SAL_OVERRIDE;
123 : virtual bool SetPluginParent( SystemParentData* pNewParent ) SAL_OVERRIDE;
124 : virtual void ResetClipRegion() SAL_OVERRIDE;
125 : virtual void BeginSetClipRegion( sal_uLong nRects ) SAL_OVERRIDE;
126 : virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) SAL_OVERRIDE;
127 : virtual void EndSetClipRegion() SAL_OVERRIDE;
128 :
129 : #ifndef IOS
130 : // If enabled we can get damage notifications for regions immediately rendered to ...
131 : void enableDamageTracker( bool bOn = true );
132 : #endif
133 :
134 : /*TODO: functional implementation */
135 0 : virtual void SetScreenNumber( unsigned int nScreen ) SAL_OVERRIDE { (void)nScreen; }
136 9874 : virtual void SetApplicationID(const OUString &rApplicationID) SAL_OVERRIDE { (void) rApplicationID; }
137 : bool IsVisible() { return m_bVisible; }
138 :
139 0 : static SvpSalFrame* GetFocusFrame() { return s_pFocusFrame; }
140 :
141 : };
142 :
143 : #endif // INCLUDED_VCL_INC_HEADLESS_SVPFRAME_HXX
144 :
145 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|