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 ADC_DISPLAY_OUT_TREE_HXX 29 #define ADC_DISPLAY_OUT_TREE_HXX 30 31 32 // USED SERVICES 33 // BASE CLASSES 34 // COMPONENTS 35 #include "out_position.hxx" 36 // PARAMETERS 37 38 39 namespace output 40 { 41 42 inline const char * 43 ModuleFileName() 44 { return "module-ix.html"; } 45 inline const char * 46 IndexFilesDirName() 47 { return "index-files"; } 48 inline const char * 49 IndexFile_A() 50 { return "index-1.html"; } 51 52 53 class Tree 54 { 55 public: 56 // LIFECYCLE 57 Tree(); 58 ~Tree(); 59 60 // OPERATIONS 61 void Set_Overview( 62 const StringVector & 63 i_path, 64 const String & i_sFileName ); 65 Node & Set_NamesRoot( 66 const StringVector & 67 i_path ); 68 Node & Set_IndexRoot( 69 const StringVector & 70 i_path ); 71 Node & Set_ProjectsRoot( 72 const StringVector & 73 i_path ); 74 Node & Provide_Node( 75 const StringVector & 76 i_path ); 77 78 // ACCESS 79 Node & RootNode() { return *pRoot; } 80 Node & NamesRootNode() { return *pNamesRoot; } 81 Node & IndexRootNode() { return *pIndexRoot; } 82 Node & ProjectsRootNode() { return *pProjectsRoot; } 83 84 Position Root() { return Position(*pRoot); } 85 Position Overview() { return aOverview; } 86 Position NamesRoot() { return Position(*pNamesRoot); } 87 Position IndexRoot() { return Position(*pIndexRoot); } 88 Position ProjectsRoot() { return Position(*pProjectsRoot); } 89 90 private: 91 // forbidden: 92 Tree(const Tree&); 93 Tree & operator=(const Tree&); 94 95 // DATA 96 Dyn<Node> pRoot; 97 Node * pNamesRoot; 98 Node * pIndexRoot; 99 Node * pProjectsRoot; 100 Position aOverview; 101 }; 102 103 104 // IMPLEMENTATION 105 106 inline Node & 107 Tree::Provide_Node( const StringVector & i_path ) 108 { return pRoot->Provide_Child(i_path); } 109 110 111 inline void 112 Tree::Set_Overview( const StringVector & i_path, 113 const String & i_sFileName ) 114 { aOverview.Set(Provide_Node(i_path), i_sFileName); } 115 116 inline Node & 117 Tree::Set_NamesRoot( const StringVector & i_path ) 118 { pNamesRoot = &Provide_Node(i_path); 119 return *pNamesRoot; } 120 121 inline Node & 122 Tree::Set_IndexRoot( const StringVector & i_path ) 123 { pIndexRoot = &Provide_Node(i_path); 124 return *pIndexRoot; } 125 126 inline Node & 127 Tree::Set_ProjectsRoot( const StringVector & i_path ) 128 { pProjectsRoot = &Provide_Node(i_path); 129 return *pProjectsRoot; } 130 131 132 133 } // namespace output 134 135 136 #endif 137