1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef ARY_IDL_I_NAMELOOKUP_HXX 29 #define ARY_IDL_I_NAMELOOKUP_HXX 30 31 // BASE CLASSES 32 #include <ary/idl/i_types4idl.hxx> 33 34 // USED SERVICES 35 #include <ary/stdconstiter.hxx> 36 #include <ary/itrange.hxx> 37 #include <vector> 38 #include <map> 39 40 41 42 43 namespace ary 44 { 45 namespace idl 46 { 47 48 49 /** This class finds all occurrences in the current language of a 50 name in the repository. 51 */ 52 class NameLookup 53 { 54 public: 55 struct NameProperties 56 { 57 NameProperties() 58 : nId(0), 59 nClass(0), 60 nOwner(0) {} 61 NameProperties( 62 Ce_id i_id, 63 ClassId i_class, 64 Ce_id i_owner ) 65 : nId(i_id), 66 nClass(i_class), 67 nOwner(i_owner) {} 68 Ce_id nId; 69 ClassId nClass; 70 Ce_id nOwner; 71 }; 72 73 /// Map from Name to NameProperties. 74 typedef std::multimap<String, NameProperties> Map_Names; 75 76 // LIFECYCLE 77 NameLookup(); 78 ~NameLookup(); 79 // OPERATIONS 80 void Add_Name( 81 const String & i_name, 82 Ce_id i_id, 83 ClassId i_class, 84 Ce_id i_owner ); 85 private: 86 // DATA 87 Map_Names aNames; 88 }; 89 90 91 92 93 } // namespace idl 94 } // namespace ary 95 #endif 96