1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef BASIC_VBAHELPR_HXX 25 #define BASIC_VBAHELPR_HXX 26 27 #include <com/sun/star/container/XEnumeration.hpp> 28 #include <com/sun/star/frame/XModel.hpp> 29 #include <rtl/ustring.hxx> 30 31 namespace basic { 32 namespace vba { 33 34 /* This header contains public helper functions for VBA used from this module 35 and from other VBA implementation modules such as vbahelper. 36 */ 37 38 // ============================================================================ 39 40 /** Creates and returns an enumeration of all open documents of the same type 41 as the specified document. 42 43 First, the global module manager (com.sun.star.frame.ModuleManager) is 44 asked for the type of the passed model, and all open documents with the 45 same type will be stored in an enumeration object. 46 47 @param rxModel 48 A document model determining the type of the documents. 49 */ 50 ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > createDocumentsEnumeration( 51 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel ); 52 53 // ============================================================================ 54 55 /** Locks or unlocks the controllers of all documents that have the same type 56 as the specified document. 57 58 First, the global module manager (com.sun.star.frame.ModuleManager) is 59 asked for the type of the passed model, and all open documents with the 60 same type will be locked or unlocked. 61 62 @param rxModel 63 A document model determining the type of the documents to be locked or 64 unlocked. 65 66 @param bLockControllers 67 Passing true will lock all controllers, passing false will unlock them. 68 */ 69 void lockControllersOfAllDocuments( 70 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel, 71 sal_Bool bLockControllers ); 72 73 // ============================================================================ 74 75 /** Enables or disables the container windows of all controllers of all 76 documents that have the same type as the specified document. 77 78 First, the global module manager (com.sun.star.frame.ModuleManager) is 79 asked for the type of the passed model, and the container windows of all 80 open documents with the same type will be enabled or disabled. 81 82 @param rxModel 83 A document model determining the type of the documents to be enabled or 84 disabled. 85 86 @param bEnableWindows 87 Passing true will enable all container windows of all controllers, 88 passing false will disable them. 89 */ 90 void enableContainerWindowsOfAllDocuments( 91 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel, 92 sal_Bool bEnableWindows ); 93 94 // ============================================================================ 95 96 /** Registers the passed path as working directory for the application the 97 passed document belongs to. 98 99 @param rxModel 100 A document model determining the type of the application whose working 101 directory has been changed. 102 103 @param rPath 104 The new working directory. 105 */ 106 void registerCurrentDirectory( 107 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel, 108 const ::rtl::OUString& rPath ); 109 110 // ============================================================================ 111 112 /** Returns the working directory of the application the passed document 113 belongs to. 114 115 @param rxModel 116 A document model determining the type of the application whose working 117 directory is querried. 118 119 @return 120 The working directory of the specified application, or an empty string 121 on error (e.g. if the passed document reference is empty). 122 */ 123 ::rtl::OUString getCurrentDirectory( 124 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel ); 125 126 // ============================================================================ 127 128 } // namespace vba 129 } // namespace basic 130 131 #endif 132