LibreOffice Module vcl (master)  1
IconThemeScanner.hxx
Go to the documentation of this file.
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 
10 #ifndef INCLUDED_VCL_ICONTHEMESCANNER_HXX
11 #define INCLUDED_VCL_ICONTHEMESCANNER_HXX
12 
13 #include <vcl/dllapi.h>
14 
15 #include <rtl/ustring.hxx>
16 #include <vcl/IconThemeInfo.hxx>
17 
18 #include <memory>
19 #include <vector>
20 
21 // forward declaration of unit test class. Required for friend relationship.
22 class IconThemeScannerTest;
23 
24 namespace vcl {
25 
29 {
30 public:
34  static std::shared_ptr<IconThemeScanner> Create(const OUString &path);
35 
38  static OUString
39  GetStandardIconThemePath();
40 
41  const std::vector<IconThemeInfo>&
42  GetFoundIconThemes() const {return mFoundIconThemes;}
43 
48  const IconThemeInfo& GetIconThemeInfo(const OUString& themeId);
49 
53  bool
54  IconThemeIsInstalled(const OUString& themeId) const;
55 
56 private:
58 
66  void ScanDirectoryForIconThemes(const OUString &path);
67 
70  bool
71  AddIconThemeByPath(const OUString &path);
72 
76  static std::vector<OUString>
77  ReadIconThemesFromPath(const OUString& dir);
78 
80  static bool
81  FileIsValidIconTheme(const OUString&);
82 
83  std::vector<IconThemeInfo> mFoundIconThemes;
84 
85  friend class ::IconThemeScannerTest;
86 };
87 
88 } // end namespace vcl
89 
90 #endif // INCLUDED_VCL_ICONTHEMESCANNER_HXX
91 
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This class provides information about an icon theme.
const std::vector< IconThemeInfo > & GetFoundIconThemes() const
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
This class scans a folder for icon themes and provides the results.
void Create(SwFormatVertOrient &rItem, SvStream &rStrm, sal_uInt16 nVersionAbusedAsSize)
std::vector< IconThemeInfo > mFoundIconThemes