/* -*- 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 . */ #pragma once #include #include #include #include #include #include namespace sd::framework { typedef ::cppu::WeakComponentImplHelper < css::drawing::framework::XPane, css::drawing::framework::XPane2 > PaneInterfaceBase; /** A pane is a wrapper for a window and possibly for a tab bar (for view switching). Panes are unique resources. This class has two responsibilities: 1. It implements the XPane interface. This is the most important interface of this class for API based views (of which there not that many yet) because it gives access to the XWindow. 2. It gives access to the underlying VCL Window. This is necessary at the moment and in the foreseeable future because many parts of the Draw and Impress views rely on direct access on the Window class. */ class Pane : protected cppu::BaseMutex, public PaneInterfaceBase { public: /** Create a new Pane object that wraps the given window. @param rsPaneURL The URL that is used by the configuration to identify the pane. The given URL has to be valid. @param pWindow The VCL Window (usually this really is an sd::Window) that is wrapped by the new Pane object. The given pointer must not be NULL. */ Pane ( const css::uno::Reference& rxPaneId, vcl::Window* pWindow) noexcept; virtual ~Pane() override; virtual void SAL_CALL disposing() override; /** This method is typically used to obtain a Window pointer from an XPane object. */ virtual vcl::Window* GetWindow(); //----- XPane ------------------------------------------------------------- /** For a UNO API based implementation of a view this may the most important method of this class because the view is only interested in the window of the pane. */ virtual css::uno::Reference SAL_CALL getWindow() override; virtual css::uno::Reference SAL_CALL getCanvas() override; //----- XPane2 ------------------------------------------------------------- virtual sal_Bool SAL_CALL isVisible() override; virtual void SAL_CALL setVisible (sal_Bool bIsVisible) override; virtual css::uno::Reference SAL_CALL getAccessible() override; virtual void SAL_CALL setAccessible ( const css::uno::Reference& rxAccessible) override; //----- XResource --------------------------------------------------------- virtual css::uno::Reference SAL_CALL getResourceId() override; /** For the typical pane it makes no sense to be displayed without a view. Therefore this default implementation returns always . */ virtual sal_Bool SAL_CALL isAnchorOnly() override; protected: css::uno::Reference mxPaneId; VclPtr mpWindow; css::uno::Reference mxWindow; css::uno::Reference mxCanvas; /** Override this method, not getCanvas(), when you want to provide a different canvas. @throws css::uno::RuntimeException */ virtual css::uno::Reference CreateCanvas(); /** Throw DisposedException when the object has already been disposed or is currently being disposed. Otherwise this method returns normally. @throws css::lang::DisposedException */ void ThrowIfDisposed() const; }; } // end of namespace sd::framework /* vim:set shiftwidth=4 softtabstop=4 expandtab: */