xref: /AOO41X/main/unotools/inc/unotools/startoptions.hxx (revision bae3752ec30c258ca902793e4eea3c818b0bcaad)
1*bae3752eSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*bae3752eSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*bae3752eSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*bae3752eSAndrew Rist  * distributed with this work for additional information
6*bae3752eSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*bae3752eSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*bae3752eSAndrew Rist  * "License"); you may not use this file except in compliance
9*bae3752eSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*bae3752eSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*bae3752eSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*bae3752eSAndrew Rist  * software distributed under the License is distributed on an
15*bae3752eSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*bae3752eSAndrew Rist  * KIND, either express or implied.  See the License for the
17*bae3752eSAndrew Rist  * specific language governing permissions and limitations
18*bae3752eSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*bae3752eSAndrew Rist  *************************************************************/
21*bae3752eSAndrew Rist 
22*bae3752eSAndrew Rist 
23cdf0e10cSrcweir #ifndef INCLUDED_unotools_STARTOPTIONS_HXX
24cdf0e10cSrcweir #define INCLUDED_unotools_STARTOPTIONS_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir //_________________________________________________________________________________________________________________
27cdf0e10cSrcweir //  includes
28cdf0e10cSrcweir //_________________________________________________________________________________________________________________
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #include "unotools/unotoolsdllapi.h"
31cdf0e10cSrcweir #include <sal/types.h>
32cdf0e10cSrcweir #include <osl/mutex.hxx>
33cdf0e10cSrcweir #include <rtl/ustring.hxx>
34cdf0e10cSrcweir #include <unotools/options.hxx>
35cdf0e10cSrcweir 
36cdf0e10cSrcweir //_________________________________________________________________________________________________________________
37cdf0e10cSrcweir //  forward declarations
38cdf0e10cSrcweir //_________________________________________________________________________________________________________________
39cdf0e10cSrcweir 
40cdf0e10cSrcweir /*-************************************************************************************************************//**
41cdf0e10cSrcweir     @short          forward declaration to our private date container implementation
42cdf0e10cSrcweir     @descr          We use these class as internal member to support small memory requirements.
43cdf0e10cSrcweir                     You can create the container if it is neccessary. The class which use these mechanism
44cdf0e10cSrcweir                     is faster and smaller then a complete implementation!
45cdf0e10cSrcweir *//*-*************************************************************************************************************/
46cdf0e10cSrcweir 
47cdf0e10cSrcweir class SvtStartOptions_Impl;
48cdf0e10cSrcweir 
49cdf0e10cSrcweir //_________________________________________________________________________________________________________________
50cdf0e10cSrcweir //  declarations
51cdf0e10cSrcweir //_________________________________________________________________________________________________________________
52cdf0e10cSrcweir 
53cdf0e10cSrcweir /*-************************************************************************************************************//**
54cdf0e10cSrcweir     @short          collect informations about startup features
55cdf0e10cSrcweir     @descr          -
56cdf0e10cSrcweir 
57cdf0e10cSrcweir     @implements     -
58cdf0e10cSrcweir     @base           -
59cdf0e10cSrcweir 
60cdf0e10cSrcweir     @devstatus      ready to use
61cdf0e10cSrcweir *//*-*************************************************************************************************************/
62cdf0e10cSrcweir 
63cdf0e10cSrcweir class UNOTOOLS_DLLPUBLIC SvtStartOptions: public utl::detail::Options
64cdf0e10cSrcweir {
65cdf0e10cSrcweir     //-------------------------------------------------------------------------------------------------------------
66cdf0e10cSrcweir     //  public methods
67cdf0e10cSrcweir     //-------------------------------------------------------------------------------------------------------------
68cdf0e10cSrcweir 
69cdf0e10cSrcweir     public:
70cdf0e10cSrcweir 
71cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
72cdf0e10cSrcweir         //  constructor / destructor
73cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
74cdf0e10cSrcweir 
75cdf0e10cSrcweir         /*-****************************************************************************************************//**
76cdf0e10cSrcweir             @short      standard constructor and destructor
77cdf0e10cSrcweir             @descr      This will initialize an instance with default values.
78cdf0e10cSrcweir                         We implement these class with a refcount mechanism! Every instance of this class increase it
79cdf0e10cSrcweir                         at create and decrease it at delete time - but all instances use the same data container!
80cdf0e10cSrcweir                         He is implemented as a static member ...
81cdf0e10cSrcweir 
82cdf0e10cSrcweir             @seealso    member m_nRefCount
83cdf0e10cSrcweir             @seealso    member m_pDataContainer
84cdf0e10cSrcweir 
85cdf0e10cSrcweir             @param      -
86cdf0e10cSrcweir             @return     -
87cdf0e10cSrcweir 
88cdf0e10cSrcweir             @onerror    -
89cdf0e10cSrcweir         *//*-*****************************************************************************************************/
90cdf0e10cSrcweir 
91cdf0e10cSrcweir          SvtStartOptions();
92cdf0e10cSrcweir         virtual ~SvtStartOptions();
93cdf0e10cSrcweir 
94cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
95cdf0e10cSrcweir         //  interface
96cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
97cdf0e10cSrcweir 
98cdf0e10cSrcweir         /*-****************************************************************************************************//**
99cdf0e10cSrcweir             @short      interface methods to get and set value of config key "org.openoffice.Office.Common/Start/..."
100cdf0e10cSrcweir             @descr      These options describe internal states to enable/disable features of installed office.
101cdf0e10cSrcweir                         The values are fixed at runtime - and implemented as readonly!
102cdf0e10cSrcweir 
103cdf0e10cSrcweir                         IsIntroEnabled()    :   Setting, if the StarOffice Logo is displayed when starting StarOffice.
104cdf0e10cSrcweir                                                 Default = true
105cdf0e10cSrcweir 
106cdf0e10cSrcweir                         EnableIntro()       :   Use it to enable/disable the logo at startup.
107cdf0e10cSrcweir 
108cdf0e10cSrcweir             @seealso    configuration package "org.openoffice.Office.Common/Start"
109cdf0e10cSrcweir         *//*-*****************************************************************************************************/
110cdf0e10cSrcweir 
111cdf0e10cSrcweir         sal_Bool    IsIntroEnabled  (                   ) const ;
112cdf0e10cSrcweir         void        EnableIntro     ( sal_Bool bState   )       ;
113cdf0e10cSrcweir 
114cdf0e10cSrcweir         /*-****************************************************************************************************//**
115cdf0e10cSrcweir             @short      returns or set the connection URL of an office
116cdf0e10cSrcweir             @descr      Specifies the URL for an UNO connection.
117cdf0e10cSrcweir                         No default is given, the URL has to be entered manually by the admin/user.
118cdf0e10cSrcweir                         zB.: "socket,host=pc1.test.de,port=6001;iiop;"
119cdf0e10cSrcweir 
120cdf0e10cSrcweir             @seealso    configuration package "org.openoffice.Office.Common/Start"
121cdf0e10cSrcweir         *//*-*****************************************************************************************************/
122cdf0e10cSrcweir 
123cdf0e10cSrcweir         ::rtl::OUString GetConnectionURL(                               ) const ;
124cdf0e10cSrcweir         void            SetConnectionURL( const ::rtl::OUString& sURL   )       ;
125cdf0e10cSrcweir 
126cdf0e10cSrcweir     //-------------------------------------------------------------------------------------------------------------
127cdf0e10cSrcweir     //  private methods
128cdf0e10cSrcweir     //-------------------------------------------------------------------------------------------------------------
129cdf0e10cSrcweir 
130cdf0e10cSrcweir     private:
131cdf0e10cSrcweir 
132cdf0e10cSrcweir         /*-****************************************************************************************************//**
133cdf0e10cSrcweir             @short      return a reference to a static mutex
134cdf0e10cSrcweir             @descr      These class use his own static mutex to be threadsafe.
135cdf0e10cSrcweir                         We create a static mutex only for one ime and use at different times.
136cdf0e10cSrcweir 
137cdf0e10cSrcweir             @seealso    -
138cdf0e10cSrcweir 
139cdf0e10cSrcweir             @param      -
140cdf0e10cSrcweir             @return     A reference to a static mutex member.
141cdf0e10cSrcweir 
142cdf0e10cSrcweir             @onerror    -
143cdf0e10cSrcweir         *//*-*****************************************************************************************************/
144cdf0e10cSrcweir 
145cdf0e10cSrcweir         UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
146cdf0e10cSrcweir 
147cdf0e10cSrcweir     //-------------------------------------------------------------------------------------------------------------
148cdf0e10cSrcweir     //  private member
149cdf0e10cSrcweir     //-------------------------------------------------------------------------------------------------------------
150cdf0e10cSrcweir 
151cdf0e10cSrcweir     private:
152cdf0e10cSrcweir 
153cdf0e10cSrcweir         /*Attention
154cdf0e10cSrcweir 
155cdf0e10cSrcweir             Don't initialize these static member in these header!
156cdf0e10cSrcweir             a) Double dfined symbols will be detected ...
157cdf0e10cSrcweir             b) and unresolved externals exist at linking time.
158cdf0e10cSrcweir             Do it in your source only.
159cdf0e10cSrcweir          */
160cdf0e10cSrcweir 
161cdf0e10cSrcweir         static SvtStartOptions_Impl*    m_pDataContainer    ;   /// impl. data container as dynamic pointer for smaller memory requirements!
162cdf0e10cSrcweir         static sal_Int32                m_nRefCount         ;   /// internal ref count mechanism
163cdf0e10cSrcweir 
164cdf0e10cSrcweir };      // class SvtStartOptions
165cdf0e10cSrcweir 
166cdf0e10cSrcweir #endif  // #ifndef INCLUDED_unotools_STARTOPTIONS_HXX
167