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_DOC_D_PARAMETER_HXX
29 #define ARY_DOC_D_PARAMETER_HXX
30 
31 // USED SERVICES
32 	// BASE CLASSES
33 #include <ary/doc/d_node.hxx>
34 
35 namespace ary
36 {
37 namespace doc
38 {
39 
40 
41 /** Documentation unit with Parameter.
42 */
43 template <class T>
44 class Parametrized : public Node
45 {
46   public:
47 	// LIFECYCLE
48 	explicit    		Parametrized(
49 	                        nodetype::id        i_id,
50                             T                   i_Parameter );
51 	virtual				~Parametrized();
52 
53     // INQUIRY
54     const HyperText &   Doc() const;
55     const T &           Parameter() const;
56 
57     // ACESS
58     HyperText &         Doc();
59     void                Set_Parameter(
60                             const T &           i_param );
61   private:
62     // Interface csv::ConstProcessorClient:
63     virtual void        do_Accept(
64                             csv::ProcessorIfc & io_processor ) const;
65     // DATA
66     HyperText           aDoc;
67     T                   aParameter;
68 };
69 
70 
71 
72 
73 // IMPLEMENTATION
74 template <class T>
75 Parametrized<T>::Parametrized( nodetype::id     i_id,
76                                T                i_Parameter )
77     :   Node(i_id),
78         aDoc(),
79         aParameter(i_Parameter)
80 {
81 }
82 
83 template <class T>
84 Parametrized<T>::~Parametrized()
85 {
86 }
87 
88 template <class T>
89 const HyperText &
90 Parametrized<T>::Doc() const
91 {
92     return aDoc;
93 }
94 
95 template <class T>
96 const T &
97 Parametrized<T>::Parameter() const
98 {
99     return aParameter;
100 }
101 
102 template <class T>
103 HyperText &
104 Parametrized<T>::Doc()
105 {
106     return aDoc;
107 }
108 
109 template <class T>
110 inline void
111 Parametrized<T>::Set_Parameter(const T & i_param)
112 {
113     aParameter = i_param;
114 }
115 
116 
117 
118 
119 }   // namespace doc
120 }   // namespace ary
121 #endif
122