1*6a653dafSJuergen Schmidt /**************************************************************
2*6a653dafSJuergen Schmidt  *
3*6a653dafSJuergen Schmidt  * Licensed to the Apache Software Foundation (ASF) under one
4*6a653dafSJuergen Schmidt  * or more contributor license agreements.  See the NOTICE file
5*6a653dafSJuergen Schmidt  * distributed with this work for additional information
6*6a653dafSJuergen Schmidt  * regarding copyright ownership.  The ASF licenses this file
7*6a653dafSJuergen Schmidt  * to you under the Apache License, Version 2.0 (the
8*6a653dafSJuergen Schmidt  * "License"); you may not use this file except in compliance
9*6a653dafSJuergen Schmidt  * with the License.  You may obtain a copy of the License at
10*6a653dafSJuergen Schmidt  *
11*6a653dafSJuergen Schmidt  *   http://www.apache.org/licenses/LICENSE-2.0
12*6a653dafSJuergen Schmidt  *
13*6a653dafSJuergen Schmidt  * Unless required by applicable law or agreed to in writing,
14*6a653dafSJuergen Schmidt  * software distributed under the License is distributed on an
15*6a653dafSJuergen Schmidt  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*6a653dafSJuergen Schmidt  * KIND, either express or implied.  See the License for the
17*6a653dafSJuergen Schmidt  * specific language governing permissions and limitations
18*6a653dafSJuergen Schmidt  * under the License.
19*6a653dafSJuergen Schmidt  *
20*6a653dafSJuergen Schmidt  *************************************************************/
21*6a653dafSJuergen Schmidt 
22*6a653dafSJuergen Schmidt #ifndef __MNSProfileDiscover_h___
23*6a653dafSJuergen Schmidt #define __MNSProfileDiscover_h___
24*6a653dafSJuergen Schmidt 
25*6a653dafSJuergen Schmidt #include <sal/types.h>
26*6a653dafSJuergen Schmidt #include <osl/diagnose.h>
27*6a653dafSJuergen Schmidt #include <osl/conditn.hxx>
28*6a653dafSJuergen Schmidt #ifndef _COM_SUN_STAR_MOZILLA_MOZILLPRODUCTTYPE_HPP_
29*6a653dafSJuergen Schmidt #include <com/sun/star/mozilla/MozillaProductType.hpp>
30*6a653dafSJuergen Schmidt #endif
31*6a653dafSJuergen Schmidt #include <com/sun/star/uno/RuntimeException.hpp>
32*6a653dafSJuergen Schmidt #include <com/sun/star/uno/Sequence.hxx>
33*6a653dafSJuergen Schmidt #include <rtl/ustring.hxx>
34*6a653dafSJuergen Schmidt 
35*6a653dafSJuergen Schmidt #include <vector>
36*6a653dafSJuergen Schmidt #include <map>
37*6a653dafSJuergen Schmidt 
38*6a653dafSJuergen Schmidt using namespace com::sun::star::mozilla;
39*6a653dafSJuergen Schmidt namespace connectivity
40*6a653dafSJuergen Schmidt {
41*6a653dafSJuergen Schmidt     namespace mozab
42*6a653dafSJuergen Schmidt     {
43*6a653dafSJuergen Schmidt         class ProfileStruct;
44*6a653dafSJuergen Schmidt     }
45*6a653dafSJuergen Schmidt }
46*6a653dafSJuergen Schmidt typedef ::std::map < ::rtl::OUString, ::connectivity::mozab::ProfileStruct* > ProfileList;
47*6a653dafSJuergen Schmidt namespace connectivity
48*6a653dafSJuergen Schmidt {
49*6a653dafSJuergen Schmidt     namespace mozab
50*6a653dafSJuergen Schmidt     {
51*6a653dafSJuergen Schmidt         class ProfileStruct
52*6a653dafSJuergen Schmidt         {
53*6a653dafSJuergen Schmidt         public:
54*6a653dafSJuergen Schmidt             ProfileStruct(MozillaProductType aProduct,::rtl::OUString aProfileName,
55*6a653dafSJuergen Schmidt                           const ::rtl::OUString &aProfilePath );
getProductType()56*6a653dafSJuergen Schmidt             MozillaProductType getProductType() { return product;}
getProfileName()57*6a653dafSJuergen Schmidt             ::rtl::OUString getProfileName(){ return profileName;}
58*6a653dafSJuergen Schmidt             ::rtl::OUString getProfilePath() ;
59*6a653dafSJuergen Schmidt         protected:
60*6a653dafSJuergen Schmidt             MozillaProductType product;
61*6a653dafSJuergen Schmidt             ::rtl::OUString profileName;
62*6a653dafSJuergen Schmidt             ::rtl::OUString profilePath;
63*6a653dafSJuergen Schmidt         };
64*6a653dafSJuergen Schmidt 
65*6a653dafSJuergen Schmidt         class ProductStruct
66*6a653dafSJuergen Schmidt         {
67*6a653dafSJuergen Schmidt         public:
setCurrentProfile(::rtl::OUString aProfileName)68*6a653dafSJuergen Schmidt             void setCurrentProfile(::rtl::OUString aProfileName){mCurrentProfileName = aProfileName;}
69*6a653dafSJuergen Schmidt 
70*6a653dafSJuergen Schmidt             ::rtl::OUString mCurrentProfileName;
71*6a653dafSJuergen Schmidt 
72*6a653dafSJuergen Schmidt             ProfileList mProfileList;
73*6a653dafSJuergen Schmidt         };
74*6a653dafSJuergen Schmidt 
75*6a653dafSJuergen Schmidt         //Used to query profiles information
76*6a653dafSJuergen Schmidt         class ProfileAccess
77*6a653dafSJuergen Schmidt         {
78*6a653dafSJuergen Schmidt         public:
79*6a653dafSJuergen Schmidt 
80*6a653dafSJuergen Schmidt             virtual    ~ProfileAccess();
81*6a653dafSJuergen Schmidt             ProfileAccess();
82*6a653dafSJuergen Schmidt             ::rtl::OUString getProfilePath( ::com::sun::star::mozilla::MozillaProductType product, const ::rtl::OUString& profileName ) throw (::com::sun::star::uno::RuntimeException);
83*6a653dafSJuergen Schmidt             ::sal_Int32 getProfileCount( ::com::sun::star::mozilla::MozillaProductType product ) throw (::com::sun::star::uno::RuntimeException);
84*6a653dafSJuergen Schmidt             ::sal_Int32 getProfileList( ::com::sun::star::mozilla::MozillaProductType product, ::com::sun::star::uno::Sequence< ::rtl::OUString >& list ) throw (::com::sun::star::uno::RuntimeException);
85*6a653dafSJuergen Schmidt             ::rtl::OUString getDefaultProfile( ::com::sun::star::mozilla::MozillaProductType product ) throw (::com::sun::star::uno::RuntimeException);
86*6a653dafSJuergen Schmidt             ::sal_Bool SAL_CALL isProfileLocked( ::com::sun::star::mozilla::MozillaProductType product, const ::rtl::OUString& profileName ) throw (::com::sun::star::uno::RuntimeException);
87*6a653dafSJuergen Schmidt             ::sal_Bool SAL_CALL getProfileExists( ::com::sun::star::mozilla::MozillaProductType product, const ::rtl::OUString& profileName ) throw (::com::sun::star::uno::RuntimeException);
88*6a653dafSJuergen Schmidt         protected:
89*6a653dafSJuergen Schmidt             ProductStruct m_ProductProfileList[4];
90*6a653dafSJuergen Schmidt             sal_Int32 LoadProductsInfo();
91*6a653dafSJuergen Schmidt             sal_Int32 LoadXPToolkitProfiles(MozillaProductType product);
92*6a653dafSJuergen Schmidt         };
93*6a653dafSJuergen Schmidt 
94*6a653dafSJuergen Schmidt     }
95*6a653dafSJuergen Schmidt }
96*6a653dafSJuergen Schmidt 
97*6a653dafSJuergen Schmidt #endif // __MNSProfileDiscover_h___
98*6a653dafSJuergen Schmidt 
99