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 25 #ifndef _FILEOPEN_DIALOG_HXX_ 26 #define _FILEOPEN_DIALOG_HXX_ 27 28 #include <vector> 29 #include <com/sun/star/beans/StringPair.hpp> 30 #include <com/sun/star/container/XNameAccess.hpp> 31 #include <com/sun/star/ui/dialogs/XFilePicker.hpp> 32 #include <com/sun/star/uno/XComponentContext.hpp> 33 34 class FileOpenDialog 35 { 36 // a list of filters that are provided within the SaveDialog 37 struct FilterEntry 38 { 39 rtl::OUString maName; 40 rtl::OUString maType; 41 rtl::OUString maUIName; 42 rtl::OUString maFilter; 43 sal_Int32 maFlags; 44 com::sun::star::uno::Sequence< rtl::OUString > maExtensions; 45 46 FilterEntry() : 47 maFlags( 0 ) {} 48 }; 49 com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxMSF; 50 com::sun::star::uno::Reference < ::com::sun::star::ui::dialogs::XFilePicker > mxFilePicker; 51 52 std::vector< FilterEntry > aFilterEntryList; 53 54 public : 55 FileOpenDialog( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxMSF ); 56 ~FileOpenDialog(); 57 58 sal_Int16 execute(); 59 60 void setDefaultName( const rtl::OUString& ); 61 // void setDefaultDirectory( const rtl::OUString& ); 62 63 ::rtl::OUString getURL() const; 64 ::rtl::OUString getFilterName() const; 65 }; 66 67 #endif // _FILEOPEN_DIALOG_HXX_ 68 69