/* * 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 . */ import com.sun.star.frame.XDesktop; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XInterface; import com.sun.star.accessibility.XAccessible; import com.sun.star.awt.XExtendedToolkit; /** This class tries to simplify some tasks like loading a document or getting various objects. */ public class SimpleOffice { private XDesktop mxDesktop = null; private OfficeConnection aConnection; private int mnPortNumber; public SimpleOffice (int nPortNumber) { mnPortNumber = nPortNumber; connect (); getDesktop (); } public void connect () { aConnection = new OfficeConnection (mnPortNumber); mxDesktop = null; getDesktop (); } public XDesktop getDesktop () { if (mxDesktop != null) return mxDesktop; try { // Get the factory of the connected office. XMultiServiceFactory xMSF = aConnection.getServiceManager (); if (xMSF == null) { MessageArea.println ("can't connect to office"); return null; } else MessageArea.println ("Connected successfully."); // Create a new desktop. mxDesktop = UnoRuntime.queryInterface( XDesktop.class, xMSF.createInstance ("com.sun.star.frame.Desktop") ); } catch (Exception e) { MessageArea.println ("caught exception while creating desktop: " + e); } return mxDesktop; } /** Return a reference to the extended toolkit which is a broadcaster of top window, key, and focus events. */ public XExtendedToolkit getExtendedToolkit () { XExtendedToolkit xToolkit = null; try { // Get the factory of the connected office. XMultiServiceFactory xMSF = aConnection.getServiceManager (); if (xMSF != null) { xToolkit = UnoRuntime.queryInterface( XExtendedToolkit.class, xMSF.createInstance ("stardiv.Toolkit.VCLXToolkit") ); } } catch (Exception e) { MessageArea.println ("caught exception while creating extended toolkit: " + e); } return xToolkit; } public XAccessible getAccessibleObject (XInterface xObject) { XAccessible xAccessible = null; try { xAccessible = UnoRuntime.queryInterface( XAccessible.class, xObject); } catch (Exception e) { MessageArea.println ( "caught exception while getting accessible object" + e); e.printStackTrace(); } return xAccessible; } } on value='distro/collabora/cp-4.4'>distro/collabora/cp-4.4 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/include/vcl/toolkit
AgeCommit message (Expand)Author
2022-09-19tdf#149797 Change highlight background color in some controlsIlhan Yesil
2022-09-08loplugin:unnecessaryvirtualNoel Grandin
2022-08-11jsdialog: dump tooltips for IconView entriesMike Kaganski
2022-08-09move scrbar.hxx to vcl/toolkitCaolán McNamara
2022-08-01Fix typo in codeAndrea Gelmini
2022-07-26tdf#150017 vcl,sw: add UITestMichael Stahl
2022-07-22tdf#117276 sc: Show hidden filter elements as inactive elementsBalazs Varga
2022-07-20move wintypes.hxx from tools to vclChris Sherlock
2022-07-13tdf#149956 Pass the correct frame to VclStatusListenerMaxim Monastirsky
2022-07-13clang-tidy modernize-pass-by-value in vclNoel Grandin
2022-07-08[API CHANGE] Drop css::accessibility::XAccessibleStateSetNoel Grandin
2022-06-10Entry may have no textMike Kaganski
2022-06-09Accessibility for IconViewMike Kaganski
2022-06-01Introduce weld::IconView::insert_separatorMike Kaganski
2022-05-30Related: tdf#89131 draw up/down spins disabled if value is at max/minCaolán McNamara
2022-05-12these members can be privateCaolán McNamara
2022-05-12merge SetNodeBitmaps and SetNodeDefaultImagesCaolán McNamara
2022-05-04Related: tdf#131725 if SvTreeListBox RTL set, set scrollbars to matchCaolán McNamara
2022-05-03Don't add empty labels to fontwork's icon viewMike Kaganski
2022-05-01jsdialog: export symbol for buttonsSzymon Kłos
2022-04-13loplugin:stringviewparam whitelist some more functionsNoel Grandin
2022-04-02loplugin:stringviewparam convert methods using indexOfNoel Grandin
2022-03-11new loplugin:trivialdestructorNoel Grandin
2022-03-04jsdialog: enable Accessibility Check dialogSzymon Kłos
2021-12-30jsdialog: send info about initial focus in dialogSzymon Kłos
2021-12-08only autopopup on mouse hover, not keyboard traversalCaolán McNamara
2021-11-05use more DECL_DLLPRIVATE_STATIC_LINKNoel Grandin
2021-11-04use more DECL_DLLPRIVATE_LINKNoel Grandin
2021-10-11In O[U]StringBuffer, make string_view params replacements for OUString onesStephan Bergmann
2021-10-08loplugin:moveparam in vclNoel Grandin
2021-09-30loplugin:constmethod handle more casesNoel Grandin
2021-09-13loplugin:methodcyclesNoel Grandin
2021-08-30tdf#74702 vcl: introduce GetSystemTextColor()Chris Sherlock
2021-08-18loplugin:constparamsNoel Grandin
2021-08-18jsdialog: dump FixedImageSzymon Kłos
2021-08-08no need to allocate ControlLayoutData separatelyNoel Grandin
2021-08-06drop intermediate vcl::Window from Application::GetDefDialogParentCaolán McNamara
2021-08-05make Dialog::GetDefaultParent privateCaolán McNamara
2021-07-30flatten vcl::ImplControlDataNoel Grandin
2021-07-29jsdialog: toolbox popupsSzymon Kłos
2021-07-28jsdialog: dump and activate popup windowsSzymon Kłos