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