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 INCLUDED_unotools_STARTOPTIONS_HXX 28 #define INCLUDED_unotools_STARTOPTIONS_HXX 29 30 //_________________________________________________________________________________________________________________ 31 // includes 32 //_________________________________________________________________________________________________________________ 33 34 #include "unotools/unotoolsdllapi.h" 35 #include <sal/types.h> 36 #include <osl/mutex.hxx> 37 #include <rtl/ustring.hxx> 38 #include <unotools/options.hxx> 39 40 //_________________________________________________________________________________________________________________ 41 // forward declarations 42 //_________________________________________________________________________________________________________________ 43 44 /*-************************************************************************************************************//** 45 @short forward declaration to our private date container implementation 46 @descr We use these class as internal member to support small memory requirements. 47 You can create the container if it is neccessary. The class which use these mechanism 48 is faster and smaller then a complete implementation! 49 *//*-*************************************************************************************************************/ 50 51 class SvtStartOptions_Impl; 52 53 //_________________________________________________________________________________________________________________ 54 // declarations 55 //_________________________________________________________________________________________________________________ 56 57 /*-************************************************************************************************************//** 58 @short collect informations about startup features 59 @descr - 60 61 @implements - 62 @base - 63 64 @devstatus ready to use 65 *//*-*************************************************************************************************************/ 66 67 class UNOTOOLS_DLLPUBLIC SvtStartOptions: 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 SvtStartOptions(); 96 virtual ~SvtStartOptions(); 97 98 //--------------------------------------------------------------------------------------------------------- 99 // interface 100 //--------------------------------------------------------------------------------------------------------- 101 102 /*-****************************************************************************************************//** 103 @short interface methods to get and set value of config key "org.openoffice.Office.Common/Start/..." 104 @descr These options describe internal states to enable/disable features of installed office. 105 The values are fixed at runtime - and implemented as readonly! 106 107 IsIntroEnabled() : Setting, if the StarOffice Logo is displayed when starting StarOffice. 108 Default = true 109 110 EnableIntro() : Use it to enable/disable the logo at startup. 111 112 @seealso configuration package "org.openoffice.Office.Common/Start" 113 *//*-*****************************************************************************************************/ 114 115 sal_Bool IsIntroEnabled ( ) const ; 116 void EnableIntro ( sal_Bool bState ) ; 117 118 /*-****************************************************************************************************//** 119 @short returns or set the connection URL of an office 120 @descr Specifies the URL for an UNO connection. 121 No default is given, the URL has to be entered manually by the admin/user. 122 zB.: "socket,host=pc1.test.de,port=6001;iiop;" 123 124 @seealso configuration package "org.openoffice.Office.Common/Start" 125 *//*-*****************************************************************************************************/ 126 127 ::rtl::OUString GetConnectionURL( ) const ; 128 void SetConnectionURL( const ::rtl::OUString& sURL ) ; 129 130 //------------------------------------------------------------------------------------------------------------- 131 // private methods 132 //------------------------------------------------------------------------------------------------------------- 133 134 private: 135 136 /*-****************************************************************************************************//** 137 @short return a reference to a static mutex 138 @descr These class use his own static mutex to be threadsafe. 139 We create a static mutex only for one ime and use at different times. 140 141 @seealso - 142 143 @param - 144 @return A reference to a static mutex member. 145 146 @onerror - 147 *//*-*****************************************************************************************************/ 148 149 UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex(); 150 151 //------------------------------------------------------------------------------------------------------------- 152 // private member 153 //------------------------------------------------------------------------------------------------------------- 154 155 private: 156 157 /*Attention 158 159 Don't initialize these static member in these header! 160 a) Double dfined symbols will be detected ... 161 b) and unresolved externals exist at linking time. 162 Do it in your source only. 163 */ 164 165 static SvtStartOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements! 166 static sal_Int32 m_nRefCount ; /// internal ref count mechanism 167 168 }; // class SvtStartOptions 169 170 #endif // #ifndef INCLUDED_unotools_STARTOPTIONS_HXX 171