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 #ifndef RPTUI_METADATA_HXX_
24 #define RPTUI_METADATA_HXX_
25 
26 #include "ModuleHelper.hxx"
27 
28 /** === begin UNO includes === **/
29 #include <com/sun/star/beans/Property.hpp>
30 #include <com/sun/star/inspection/XPropertyHandler.hpp>
31 /** === end UNO includes === **/
32 
33 //............................................................................
34 namespace rptui
35 {
36 //............................................................................
37 
38 	struct OPropertyInfoImpl;
39 
40 	//========================================================================
41 	//= OPropertyInfoService
42 	//========================================================================
43 	class OPropertyInfoService
44         :public OModuleClient
45 	{
46         OPropertyInfoService(const OPropertyInfoService&);
47         void operator =(const OPropertyInfoService&);
48 	protected:
49 		static sal_uInt16				s_nCount;
50 		static OPropertyInfoImpl*		s_pPropertyInfos;
51 		// TODO: a real structure which allows quick access by name as well as by id
52 
53 	public:
OPropertyInfoService()54         OPropertyInfoService(){}
~OPropertyInfoService()55         virtual ~OPropertyInfoService(){}
56         // IPropertyInfoService
57 		sal_Int32				            getPropertyId(const String& _rName) const;
58 		String					            getPropertyTranslation(sal_Int32 _nId) const;
59 		rtl::OString			            getPropertyHelpId(sal_Int32 _nId) const;
60         sal_uInt32                          getPropertyUIFlags(sal_Int32 _nId) const;
61         static void                         getExcludeProperties(::std::vector< com::sun::star::beans::Property >& _rExcludeProperties,const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyHandler >& _xFormComponentHandler);
62 
63         bool                                isComposable(
64                                                 const ::rtl::OUString& _rPropertyName,
65                                                 const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyHandler >& _xFormComponentHandler
66                                             );
67 
68 	protected:
69 		static const OPropertyInfoImpl* getPropertyInfo();
70 
71 		static const OPropertyInfoImpl* getPropertyInfo(const String& _rName);
72 		static const OPropertyInfoImpl* getPropertyInfo(sal_Int32 _nId);
73 	};
74 
75     //========================================================================
76     //= HelpIdUrl
77 	//========================================================================
78     /// small helper to translate help ids into help urls
79     class HelpIdUrl
80     {
81     public:
82         static ::rtl::OUString getHelpURL( const rtl::OString& _sHelpId );
83     };
84 
85 	//========================================================================
86 	//= UI flags (for all browseable properties)
87 	//========================================================================
88 
89 #define PROP_FLAG_NONE              0x00000001  // no special flag
90 #define PROP_FLAG_ENUM              0x00000002  // the property is some kind of enum property, i.e. its
91                                                 // value is chosen from a fixed list of possible values
92 #define PROP_FLAG_ENUM_ONE          0x00000004  // the property is an enum property starting with 1
93                                                 //  (note that this includes PROP_FLAG_ENUM)
94 #define PROP_FLAG_COMPOSEABLE       0x00000008  // the property is "composeable", i.e. an intersection of property
95                                                 //  sets should expose it, if all elements do
96 #define PROP_FLAG_EXPERIMENTAL      0x00000010  // the property is experimental, i.e. should not appear in the
97                                                 // UI, unless experimental properties are enabled by a configuraiton
98                                                 // option
99 #define PROP_FLAG_DATA_PROPERTY     0x00000020  // the property is to appear on the "Data" page
100 
101 	//========================================================================
102 	//= property ids (for all browseable properties)
103 	//= The ID is used for the view order in the property browser.
104 	//========================================================================
105 
106 	#define PROPERTY_ID_FORCENEWPAGE	                1
107 	#define PROPERTY_ID_NEWROWORCOL	                    2
108 	#define PROPERTY_ID_KEEPTOGETHER	                3
109 	#define PROPERTY_ID_CANGROW	                        4
110 	#define PROPERTY_ID_CANSHRINK	                    5
111 	#define PROPERTY_ID_REPEATSECTION	                6
112 	#define PROPERTY_ID_PRESERVEIRI                     7
113     #define PROPERTY_ID_VISIBLE                         8
114     #define PROPERTY_ID_GROUPKEEPTOGETHER               9
115     #define PROPERTY_ID_PAGEHEADEROPTION                10
116     #define PROPERTY_ID_PAGEFOOTEROPTION                11
117     #define PROPERTY_ID_POSITIONX                       12
118     #define PROPERTY_ID_POSITIONY                       13
119     #define PROPERTY_ID_WIDTH                           14
120     #define PROPERTY_ID_HEIGHT                          15
121 	#define PROPERTY_ID_FORMULA     	                16
122 	#define PROPERTY_ID_PRINTREPEATEDVALUES             17
123 	#define PROPERTY_ID_CONDITIONALPRINTEXPRESSION	    18
124 	#define PROPERTY_ID_INITIALFORMULA 	                19
125 	#define PROPERTY_ID_STARTNEWCOLUMN                  20
126     #define PROPERTY_ID_TYPE                            21
127     #define PROPERTY_ID_DATAFIELD                       22
128 	#define PROPERTY_ID_CHARFONTNAME                    23
129 	#define PROPERTY_ID_PRINTWHENGROUPCHANGE            24
130 	#define PROPERTY_ID_DEEPTRAVERSING                  25
131 	#define PROPERTY_ID_PREEVALUATED                    26
132 
133     #define PROPERTY_ID_BACKTRANSPARENT                 27
134     #define PROPERTY_ID_CONTROLBACKGROUNDTRANSPARENT    28
135     #define PROPERTY_ID_BACKCOLOR                       29
136     #define PROPERTY_ID_CONTROLBACKGROUND               30
137 
138     #define PROPERTY_ID_FORMULALIST                     31
139     #define PROPERTY_ID_SCOPE                           32
140     #define PROPERTY_ID_RESETPAGENUMBER                 33
141     #define PROPERTY_ID_CHARTTYPE                       34
142     #define PROPERTY_ID_MASTERFIELDS                    35
143     #define PROPERTY_ID_DETAILFIELDS                    36
144     #define PROPERTY_ID_PREVIEW_COUNT                   37
145     #define PROPERTY_ID_AREA                            38
146     #define PROPERTY_ID_MIMETYPE                        39
147 
148     #define PROPERTY_ID_FONT                            40
149     #define PROPERTY_ID_PARAADJUST                      41
150     #define PROPERTY_ID_VERTICALALIGN                   42
151 
152 
153 //............................................................................
154 } // namespace rptui
155 //............................................................................
156 
157 #endif // RPTUI_METADATA_HXX_
158 
159