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 INCLUDED_SVTOOLS_MISCOPT_HXX 24 #define INCLUDED_SVTOOLS_MISCOPT_HXX 25 26 //_________________________________________________________________________________________________________________ 27 // includes 28 //_________________________________________________________________________________________________________________ 29 30 #include "svtools/svtdllapi.h" 31 #include <sal/types.h> 32 #include <osl/mutex.hxx> 33 #include <com/sun/star/uno/Sequence.h> 34 #include <rtl/ustring.hxx> 35 #include <unotools/options.hxx> 36 37 //_________________________________________________________________________________________________________________ 38 // forward declarations 39 //_________________________________________________________________________________________________________________ 40 41 /*-************************************************************************************************************//** 42 @short forward declaration to our private date container implementation 43 @descr We use these class as internal member to support small memory requirements. 44 You can create the container if it is necessary. The class which use these mechanism 45 is faster and smaller then a complete implementation! 46 *//*-*************************************************************************************************************/ 47 48 class SvtMiscOptions_Impl; 49 class Link; 50 51 //_________________________________________________________________________________________________________________ 52 // declarations 53 //_________________________________________________________________________________________________________________ 54 55 /*-************************************************************************************************************//** 56 @short collect informations about misc group 57 @descr - 58 59 @implements - 60 @base - 61 62 @ATTENTION This class is partially threadsafe. 63 64 @devstatus ready to use 65 *//*-*************************************************************************************************************/ 66 67 class SVT_DLLPUBLIC SvtMiscOptions: public utl::detail::Options 68 { 69 //------------------------------------------------------------------------------------------------------------- 70 // public methods 71 //------------------------------------------------------------------------------------------------------------- 72 73 public: 74 75 //--------------------------------------------------------------------------------------------------------- 76 // constructor / destructor 77 //--------------------------------------------------------------------------------------------------------- 78 79 /*-****************************************************************************************************//** 80 @short standard constructor and destructor 81 @descr This will initialize an instance with default values. 82 We implement these class with a refcount mechanism! Every instance of this class increase it 83 at create and decrease it at delete time - but all instances use the same data container! 84 He is implemented as a static member ... 85 86 @seealso member m_nRefCount 87 @seealso member m_pDataContainer 88 89 @param - 90 @return - 91 92 @onerror - 93 *//*-*****************************************************************************************************/ 94 95 SvtMiscOptions(); 96 virtual ~SvtMiscOptions(); 97 98 void AddListenerLink( const Link& rLink ); 99 void RemoveListenerLink( const Link& rLink ); 100 101 //--------------------------------------------------------------------------------------------------------- 102 // interface 103 //--------------------------------------------------------------------------------------------------------- 104 105 sal_Bool UseSystemFileDialog() const; 106 void SetUseSystemFileDialog( sal_Bool bSet ); 107 sal_Bool IsUseSystemFileDialogReadOnly() const; 108 109 sal_Bool IsPluginsEnabled() const; 110 void SetPluginsEnabled( sal_Bool bEnable ); 111 sal_Bool IsPluginsEnabledReadOnly() const; 112 113 sal_Int16 GetSymbolsSize() const; 114 void SetSymbolsSize( sal_Int16 eSet ); 115 sal_Int16 GetCurrentSymbolsSize() const; 116 bool AreCurrentSymbolsLarge() const; 117 sal_Bool IsGetSymbolsSizeReadOnly() const; 118 119 sal_Int16 GetSymbolsStyle() const; 120 void SetSymbolsStyle( sal_Int16 eSet ); 121 sal_Int16 GetCurrentSymbolsStyle() const; 122 ::rtl::OUString GetCurrentSymbolsStyleName() const; 123 sal_Bool IsGetSymbolsStyleReadOnly() const; 124 125 sal_Int16 GetToolboxStyle() const; 126 void SetToolboxStyle( sal_Int16 nStyle ); 127 sal_Bool IsGetToolboxStyleReadOnly() const; 128 129 sal_Bool IsModifyByPrinting() const; 130 void SetModifyByPrinting(sal_Bool bSet ); 131 132 sal_Bool UseSystemPrintDialog() const; 133 void SetUseSystemPrintDialog( sal_Bool bSet ); 134 135 //------------------------------------------------------------------------------------------------------------- 136 // private methods 137 //------------------------------------------------------------------------------------------------------------- 138 139 private: 140 141 /*-****************************************************************************************************//** 142 @short return a reference to a static mutex 143 @descr These class is partially threadsafe (for de-/initialization only). 144 All access methods are'nt safe! 145 We create a static mutex only for one ime and use at different times. 146 147 @seealso - 148 149 @param - 150 @return A reference to a static mutex member. 151 152 @onerror - 153 *//*-*****************************************************************************************************/ 154 155 SVT_DLLPRIVATE static ::osl::Mutex& GetInitMutex(); 156 157 //------------------------------------------------------------------------------------------------------------- 158 // private member 159 //------------------------------------------------------------------------------------------------------------- 160 161 private: 162 163 /*Attention 164 165 Don't initialize these static member in these header! 166 a) Double dfined symbols will be detected ... 167 b) and unresolved externals exist at linking time. 168 Do it in your source only. 169 */ 170 171 static SvtMiscOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements! 172 static sal_Int32 m_nRefCount ; /// internal ref count mechanism 173 174 }; // class SvtMiscOptions 175 176 #endif // #ifndef INCLUDED_SVTOOLS_MISCOPT_HXX 177