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