/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
// SalFrame styles enumclass SalFrameStyleFlags
{
NONE = 0x00000000, DEFAULT = 0x00000001,
MOVEABLE = 0x00000002,
SIZEABLE = 0x00000004,
CLOSEABLE = 0x00000008, // no shadow effect on Windows XP
NOSHADOW = 0x00000010, // indicate tooltip windows, so they can always be topmost
TOOLTIP = 0x00000020, // windows without windowmanager decoration, this typically only applies to floating windows
OWNERDRAWDECORATION = 0x00000040, // dialogs
DIALOG = 0x00000080, // the window containing the intro bitmap, aka splashscreen
INTRO = 0x00000100, // tdf#144624: don't set icon
NOICON = 0x01000000, // system child window inside another SalFrame
SYSTEMCHILD = 0x08000000, // plugged system child window
PLUG = 0x10000000, // floating window FLOAT = 0x20000000, // toolwindows should be painted with a smaller decoration
TOOLWINDOW = 0x40000000,
};
/// A SalFrame is a system window (e.g. an X11 window). class VCL_PLUGIN_PUBLIC SalFrame
: public vcl::DeletionNotifier
, public SalGeometryProvider
{ private: // the VCL window corresponding to this frame
VclPtr<vcl::Window> m_pWindow;
SALFRAMEPROC m_pProc;
Link<bool, void> m_aModalHierarchyHdl; protected: // subclasses need to either keep this up to date // or override GetUnmirroredGeometry()
SalFrameGeometry maGeometry; ///< absolute, unmirrored values
// SalGraphics or NULL, but two Graphics for all SalFrames // must be returned virtual SalGraphics* AcquireGraphics() = 0; virtualvoid ReleaseGraphics( SalGraphics* pGraphics ) = 0;
// Event must be destroyed, when Frame is destroyed // When Event is called, SalInstance::Yield() must be returned virtualbool PostEvent(std::unique_ptr<ImplSVEvent> pData) = 0;
// Before the window is visible, a resize event // must be sent with the correct size virtualvoid Show( bool bVisible, bool bNoActivate = false ) = 0;
// Set ClientSize and Center the Window to the desktop // and send/post a resize message virtualvoid SetMinClientSize( tools::Long nWidth, tools::Long nHeight ) = 0; virtualvoid SetMaxClientSize( tools::Long nWidth, tools::Long nHeight ) = 0; virtualvoid SetPosSize( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt16 nFlags ) = 0; static OUString DumpSetPosSize(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt16 nFlags); virtualvoid GetClientSize( tools::Long& rWidth, tools::Long& rHeight ) = 0; virtualvoid GetWorkArea( AbsoluteScreenPixelRectangle& rRect ) = 0; virtual SalFrame* GetParent() const = 0; // Note: x will be mirrored at parent if UI mirroring is active
SalFrameGeometry GetGeometry() const;
// subclasses either have to keep maGeometry up to date or override this // method to return an up-to-date SalFrameGeometry virtual SalFrameGeometry GetUnmirroredGeometry() const { return maGeometry; }
virtualvoid SetWindowState(const vcl::WindowData*) = 0; // return the absolute, unmirrored system frame state // if this returns false the structure is uninitialised
[[nodiscard]] virtualbool GetWindowState(vcl::WindowData*) = 0; virtualvoid ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay ) = 0; virtualvoid PositionByToolkit( const tools::Rectangle&, FloatWinPopupFlags ) {};
// Enable/Disable ScreenSaver, SystemAgents, ... virtualvoid StartPresentation( bool bStart ) = 0; // Show Window over all other Windows virtualvoid SetAlwaysOnTop( bool bOnTop ) = 0;
// Window to top and grab focus virtualvoid ToTop( SalFrameToTop nFlags ) = 0;
// grab focus to the main widget, can be no-op if the vclplug only uses one widget virtualvoid GrabFocus() {}
// this function can call with the same // pointer style virtualvoid SetPointer( PointerStyle ePointerStyle ) = 0; virtualvoid CaptureMouse( bool bMouse ) = 0; virtualvoid SetPointerPos( tools::Long nX, tools::Long nY ) = 0;
// returns in 'rKeyCode' the single keycode that translates to the given unicode when using a keyboard layout of language 'aLangType' // returns false if no mapping exists or function not supported // this is required for advanced menu support virtualbool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, vcl::KeyCode& rKeyCode ) = 0;
// returns the input language used for the last key stroke // may be LANGUAGE_DONTKNOW if not supported by the OS virtual LanguageType GetInputLanguage() = 0;
// returns system data (most prominent: window handle) virtualconst SystemEnvData& GetSystemData() const = 0;
// tdf#139609 SystemEnvData::GetWindowHandle() calls this to on-demand fill the aWindow // member of SystemEnvData for backends that want to defer doing that virtualvoid ResolveWindowHandle(SystemEnvData& /*rData*/) const {};
// get current modifier, button mask and mouse position struct SalPointerState
{
sal_Int32 mnState;
Point maPos; // in frame coordinates
};
// set new parent window virtualvoid SetParent( SalFrame* pNewParent ) = 0; // reparent window to act as a plugin; implementation // may choose to use a new system window internally // return false to indicate failure virtualvoid SetPluginParent( SystemParentData* pNewParent ) = 0;
// move the frame to a new screen virtualvoid SetScreenNumber( unsignedint nScreen ) = 0;
// shaped system windows // set clip region to none (-> rectangular windows, normal state) virtualvoid ResetClipRegion() = 0; // start setting the clipregion consisting of nRects rectangles virtualvoid BeginSetClipRegion( sal_uInt32 nRects ) = 0; // add a rectangle to the clip region virtualvoid UnionClipRegion( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight ) = 0; // done setting up the clipregion virtualvoid EndSetClipRegion() = 0;
virtualvoid SetModal(bool/*bModal*/)
{
}
// return true to indicate tooltips are shown natively, false otherwise virtualbool ShowTooltip(const OUString& /*rHelpText*/, const tools::Rectangle& /*rHelpArea*/)
{ returnfalse;
}
// Call the callback set; this sometimes necessary for implementation classes // that should not know more than necessary about the SalFrame implementation // (e.g. input methods, printer update handlers). bool CallCallback( SalEvent nEvent, constvoid* pEvent ) const
{ return m_pProc && m_pProc( m_pWindow, nEvent, pEvent ); }
// Helper method for input method handling: Calculate cursor index in (UTF-16) OUString, // starting at nCursorIndex, moving number of characters (not UTF-16 codepoints) specified // in nOffset, nChars. static Selection CalcDeleteSurroundingSelection(std::u16string_view rSurroundingText,
sal_Int32 nCursorIndex, int nOffset, int nChars);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.