LibreOffice Module framework (master) 1
window.hxx
Go to the documentation of this file.
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#pragma once
21
22#include <com/sun/star/awt/XWindow.hpp>
23#include <com/sun/star/awt/XTopWindow.hpp>
24
26#include <vcl/window.hxx>
27#include <vcl/svapp.hxx>
28
29// namespaces
30
31namespace framework{
32
34{
35 public:
36
37
38static bool isTopWindow(const css::uno::Reference< css::awt::XWindow >& xWindow)
39{
40 // even child frame containing top level windows (e.g. query designer of database) will be closed
41 css::uno::Reference< css::awt::XTopWindow > xTopWindowCheck(xWindow, css::uno::UNO_QUERY);
42 if (xTopWindowCheck.is())
43 {
44 // Note: Toolkit interface XTopWindow sometimes is used by real VCL-child-windows also .-)
45 // Be sure that these window is really a "top system window".
46 // Attention ! Checking Window->GetParent() is not the right approach here.
47 // Because sometimes VCL create "implicit border windows" as parents even we created
48 // a simple XWindow using the toolkit only .-(
49 SolarMutexGuard aSolarGuard;
51 if ( pWindow && pWindow->IsSystemWindow() )
52 return true;
53 }
54
55 return false;
56}
57
58};
59
60} // namespace framework
61
62/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static vcl::Window * GetWindow(const css::uno::Reference< css::awt::XWindow > &rxWindow)
static bool isTopWindow(const css::uno::Reference< css::awt::XWindow > &xWindow)
Definition: window.hxx:38