merge the formfield patch from ooo-build
[ooovba.git] / autodoc / source / display / inc / toolkit / out_position.hxx
blobdb2942d64b3a2df4ca692b0e14dbef427b7e8afd
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: out_position.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef ADC_DISPLAY_OUT_POSITION_HXX
32 #define ADC_DISPLAY_OUT_POSITION_HXX
35 // USED SERVICES
36 // BASE CLASSES
37 // COMPONENTS
38 #include <toolkit/out_node.hxx>
39 // PARAMETERS
43 namespace output
48 class Position
50 public:
51 // LIFECYCLE
52 Position();
53 explicit Position(
54 Node & i_directory,
55 const String & i_file = String::Null_() );
56 Position(
57 const Position & i_directory,
58 const String & i_rDifferentFile );
59 ~Position();
61 // OPERATIONS
62 Position & operator=(
63 Node & i_node );
64 Position & operator+=(
65 const String & i_nodeName );
66 Position & operator-=(
67 intt i_levels );
69 // INQUIRY
70 bool IsValid() const { return pDirectory->Depth() >= 0; }
71 const String & Name() const { return pDirectory->Name(); }
72 const String & File() const { return sFile; }
73 intt Depth() const { return pDirectory->Depth(); }
75 void Get_Chain(
76 StringVector & o_result ) const
77 { pDirectory->Get_Chain(o_result); }
78 String LinkToRoot(
79 const String & i_localLabel = String::Null_() ) const;
81 void Get_LinkTo(
82 StreamStr & o_result,
83 const Position & i_destination,
84 const String & i_localLabel = String::Null_() ) const;
85 void Get_LinkToRoot(
86 StreamStr & o_result,
87 const String & i_localLabel = String::Null_() ) const;
89 static char Delimiter() { return '/'; }
91 // ACCESS
92 Node & RelatedNode() const { return *pDirectory; }
94 void Set(
95 Node & i_node,
96 const String & i_file = String::Null_() );
97 void Set_File(
98 const String & i_file );
100 private:
101 // DATA
102 String sFile;
103 Node * pDirectory;
107 /// @return No delimiter at start, with delimiter at end.
108 const char * get_UpLink(
109 uintt i_depth );
112 // IMPLEMENTATION
114 inline void
115 Position::Set_File( const String & i_file )
116 { sFile = i_file; }
118 } // namespace output
120 #endif