1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | /* |
3 | * This file is part of the LibreOffice project. |
4 | * |
5 | * This Source Code Form is subject to the terms of the Mozilla Public |
6 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
7 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
8 | * |
9 | * This file incorporates work covered by the following license notice: |
10 | * |
11 | * Licensed to the Apache Software Foundation (ASF) under one or more |
12 | * contributor license agreements. See the NOTICE file distributed |
13 | * with this work for additional information regarding copyright |
14 | * ownership. The ASF licenses this file to you under the Apache |
15 | * License, Version 2.0 (the "License"); you may not use this file |
16 | * except in compliance with the License. You may obtain a copy of |
17 | * the License at http://www.apache.org/licenses/LICENSE-2.0 . |
18 | */ |
19 | #ifndef INCLUDED_UNOTOOLS_PATHOPTIONS_HXX |
20 | #define INCLUDED_UNOTOOLS_PATHOPTIONS_HXX |
21 | |
22 | #include <unotools/unotoolsdllapi.h> |
23 | #include <i18nlangtag/languagetag.hxx> |
24 | #include <unotools/options.hxx> |
25 | |
26 | #define SVT_SEARCHPATH_DELIMITER ';' |
27 | |
28 | // class SvtPathOptions -------------------------------------------------- |
29 | |
30 | class SvtPathOptions_Impl; |
31 | class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtPathOptions : public utl::detail::Options |
32 | { |
33 | private: |
34 | SvtPathOptions_Impl* pImp; |
35 | |
36 | public: |
37 | enum Paths |
38 | { |
39 | PATH_ADDIN, |
40 | PATH_AUTOCORRECT, |
41 | PATH_AUTOTEXT, |
42 | PATH_BACKUP, |
43 | PATH_BASIC, |
44 | PATH_BITMAP, |
45 | PATH_CONFIG, |
46 | PATH_DICTIONARY, |
47 | PATH_FAVORITES, |
48 | PATH_FILTER, |
49 | PATH_GALLERY, |
50 | PATH_GRAPHIC, |
51 | PATH_HELP, |
52 | PATH_LINGUISTIC, |
53 | PATH_MODULE, |
54 | PATH_PALETTE, |
55 | PATH_PLUGIN, |
56 | PATH_STORAGE, |
57 | PATH_TEMP, |
58 | PATH_TEMPLATE, |
59 | PATH_USERCONFIG, |
60 | PATH_WORK, |
61 | PATH_UICONFIG, |
62 | PATH_FINGERPRINT, |
63 | PATH_COUNT // should always be the last element |
64 | }; |
65 | |
66 | SvtPathOptions(); |
67 | virtual ~SvtPathOptions(); |
68 | |
69 | // get the paths, not const because of using a mutex |
70 | const OUString& GetAddinPath() const; |
71 | const OUString& GetAutoCorrectPath() const; |
72 | const OUString& GetAutoTextPath() const; |
73 | const OUString& GetBackupPath() const; |
74 | const OUString& GetBasicPath() const; |
75 | const OUString& GetBitmapPath() const; |
76 | const OUString& GetConfigPath() const; |
77 | const OUString& GetDictionaryPath() const; |
78 | const OUString& GetFavoritesPath() const; |
79 | const OUString& GetFilterPath() const; |
80 | const OUString& GetGalleryPath() const; |
81 | const OUString& GetGraphicPath() const; |
82 | const OUString& GetHelpPath() const; |
83 | const OUString& GetLinguisticPath() const; |
84 | const OUString& GetModulePath() const; |
85 | const OUString& GetPalettePath() const; |
86 | const OUString& GetPluginPath() const; |
87 | const OUString& GetStoragePath() const; |
88 | const OUString& GetTempPath() const; |
89 | const OUString& GetTemplatePath() const; |
90 | const OUString& GetUserConfigPath() const; |
91 | const OUString& GetWorkPath() const; |
92 | const OUString& GetUIConfigPath() const; |
93 | const OUString& GetFingerprintPath() const; |
94 | |
95 | // set the paths |
96 | void SetAddinPath( const OUString& rPath ); |
97 | void SetAutoCorrectPath( const OUString& rPath ); |
98 | void SetAutoTextPath( const OUString& rPath ); |
99 | void SetBackupPath( const OUString& rPath ); |
100 | void SetBasicPath( const OUString& rPath ); |
101 | void SetBitmapPath( const OUString& rPath ); |
102 | void SetConfigPath( const OUString& rPath ); |
103 | void SetDictionaryPath( const OUString& rPath ); |
104 | void SetFavoritesPath( const OUString& rPath ); |
105 | void SetFilterPath( const OUString& rPath ); |
106 | void SetGalleryPath( const OUString& rPath ); |
107 | void SetGraphicPath( const OUString& rPath ); |
108 | void SetHelpPath( const OUString& rPath ); |
109 | void SetLinguisticPath( const OUString& rPath ); |
110 | void SetModulePath( const OUString& rPath ); |
111 | void SetPalettePath( const OUString& rPath ); |
112 | void SetPluginPath( const OUString& rPath ); |
113 | void SetStoragePath( const OUString& rPath ); |
114 | void SetTempPath( const OUString& rPath ); |
115 | void SetTemplatePath( const OUString& rPath ); |
116 | void SetUserConfigPath( const OUString& rPath ); |
117 | void SetWorkPath( const OUString& rPath ); |
118 | |
119 | OUString SubstituteVariable( const OUString& rVar ) const; |
120 | OUString ExpandMacros( const OUString& rPath ) const; |
121 | OUString UseVariable( const OUString& rVar ) const; |
122 | bool SearchFile( OUString& rIniFile, Paths ePath = PATH_USERCONFIG ); |
123 | const LanguageTag& GetLanguageTag() const; |
124 | bool IsReadonly() const; |
125 | }; |
126 | |
127 | #endif // INCLUDED_UNOTOOLS_PATHOPTIONS_HXX |
128 | |
129 | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |
130 | |