LibreOffice Module vcl (master)  1
IconThemeInfo.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_ICONTHEMEINFO_HXX
11 #define INCLUDED_VCL_ICONTHEMEINFO_HXX
12 
13 #include <vcl/dllapi.h>
14 #include <tools/gen.hxx>
15 #include <rtl/ustring.hxx>
16 
17 #include <vector>
18 
19 // forward declaration of unit test classes. Required for friend relationship.
20 class IconThemeInfoTest;
21 class IconThemeSelectorTest;
22 class IconThemeScannerTest;
23 
24 namespace vcl {
25 
29 
30 public:
31 
33  static const OUStringLiteral HIGH_CONTRAST_ID;
34 
39  IconThemeInfo(const OUString& urlToFile);
40 
41  const OUString& GetDisplayName() const {return mDisplayName;}
42 
43  const OUString& GetThemeId() const { return mThemeId; }
44 
45  const OUString& GetUrlToFile() const { return mUrlToFile; }
46 
52  static Size SizeByThemeName(const OUString&);
53 
55  static bool UrlCanBeParsed(const OUString& url);
56 
60  static const vcl::IconThemeInfo&
61  FindIconThemeById(const std::vector<vcl::IconThemeInfo>& themes, const OUString& themeId);
62 
64  static bool
65  IconThemeIsInVector(const std::vector<vcl::IconThemeInfo>& themes, const OUString& themeId);
66 
67 private:
69  IconThemeInfo();
70 
77  static OUString FileNameToThemeId(const OUString&);
78 
82  static OUString ThemeIdToDisplayName(const OUString&);
83 
85  OUString mDisplayName;
87  OUString mThemeId;
89  OUString mUrlToFile;
90 
91  friend class ::IconThemeInfoTest;
92  friend class ::IconThemeScannerTest;
93  friend class ::IconThemeSelectorTest;
94 };
95 
96 } // namespace vcl
97 
98 
99 #endif // INCLUDED_VCL_ICONTHEMEINFO_HXX
This class provides information about an icon theme.
OUString mThemeId
The theme id.
const OUString & GetThemeId() const
OUString mUrlToFile
The url to the icon theme package.
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
static const OUStringLiteral HIGH_CONTRAST_ID
The name of the icon theme to use for high contrast mode.
const OUString & GetUrlToFile() const
const OUString & GetDisplayName() const
OUString mDisplayName
The name which is presented to the user.