1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: MNSProfileDiscover.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __MNSProfileDiscover_h___
32 #define __MNSProfileDiscover_h___
34 #ifndef MINIMAL_PROFILEDISCOVER
35 #include "mozilla_profile_discover.h"
38 #include <sal/types.h>
39 #include <osl/diagnose.h>
40 #include <osl/conditn.hxx>
41 #ifndef _COM_SUN_STAR_MOZILLA_MOZILLPRODUCTTYPE_HPP_
42 #include <com/sun/star/mozilla/MozillaProductType.hpp>
44 #include <com/sun/star/uno/RuntimeException.hpp>
45 #include <com/sun/star/uno/Sequence.hxx>
46 #include <rtl/ustring.hxx>
52 #define INCL_DOSERRORS
53 #define INCL_DOSFILEMGR
57 using namespace com::sun::star::mozilla
;
58 namespace connectivity
65 typedef ::std::map
< ::rtl::OUString
, ::connectivity::mozab::ProfileStruct
* > ProfileList
;
66 namespace connectivity
73 ProfileStruct(MozillaProductType aProduct
,::rtl::OUString aProfileName
,
74 #ifdef MINIMAL_PROFILEDISCOVER
75 const ::rtl::OUString
&aProfilePath
77 nsILocalFile
* aProfilePath
80 MozillaProductType
getProductType() { return product
;}
81 ::rtl::OUString
getProfileName(){ return profileName
;}
82 ::rtl::OUString
getProfilePath() ;
83 #ifndef MINIMAL_PROFILEDISCOVER
84 nsILocalFile
*getProfileLocal(){ return profilePath
;}
87 MozillaProductType product
;
88 ::rtl::OUString profileName
;
89 #ifdef MINIMAL_PROFILEDISCOVER
90 ::rtl::OUString profilePath
;
92 nsCOMPtr
<nsILocalFile
> profilePath
;
99 void setCurrentProfile(::rtl::OUString aProfileName
){mCurrentProfileName
= aProfileName
;}
101 ::rtl::OUString mCurrentProfileName
;
103 ProfileList mProfileList
;
106 //Used to query profiles information
111 virtual ~ProfileAccess();
113 ::rtl::OUString
getProfilePath( ::com::sun::star::mozilla::MozillaProductType product
, const ::rtl::OUString
& profileName
) throw (::com::sun::star::uno::RuntimeException
);
114 ::sal_Int32
getProfileCount( ::com::sun::star::mozilla::MozillaProductType product
) throw (::com::sun::star::uno::RuntimeException
);
115 ::sal_Int32
getProfileList( ::com::sun::star::mozilla::MozillaProductType product
, ::com::sun::star::uno::Sequence
< ::rtl::OUString
>& list
) throw (::com::sun::star::uno::RuntimeException
);
116 ::rtl::OUString
getDefaultProfile( ::com::sun::star::mozilla::MozillaProductType product
) throw (::com::sun::star::uno::RuntimeException
);
117 ::sal_Bool SAL_CALL
isProfileLocked( ::com::sun::star::mozilla::MozillaProductType product
, const ::rtl::OUString
& profileName
) throw (::com::sun::star::uno::RuntimeException
);
118 ::sal_Bool SAL_CALL
getProfileExists( ::com::sun::star::mozilla::MozillaProductType product
, const ::rtl::OUString
& profileName
) throw (::com::sun::star::uno::RuntimeException
);
120 ProductStruct m_ProductProfileList
[4];
121 sal_Int32
LoadProductsInfo();
122 #ifndef MINIMAL_PROFILEDISCOVER
123 nsresult
LoadMozillaProfiles();
125 sal_Int32
LoadXPToolkitProfiles(MozillaProductType product
);
126 #ifndef MINIMAL_PROFILEDISCOVER
127 //used by isProfileLocked
128 nsresult
isExistFileOrSymlink(nsILocalFile
* aFile
,PRBool
*bExist
);
129 nsresult
isLockExist(nsILocalFile
* aFile
);
136 #endif // __MNSProfileDiscover_h___