xtd - Reference Guide  0.1.1
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
system_images.h
Go to the documentation of this file.
1 #pragma once
5 #include <map>
6 #include <xtd/static.h>
7 #include "../drawing_export.h"
8 #include "bitmap.h"
9 #include "size.h"
10 
12 namespace xtd {
14  namespace drawing {
16  class system_icons;
18 
27  public:
28  static xtd::drawing::size default_size() {return {32, 32};}
29  static xtd::drawing::image image_loading() {return image_loading(default_size());}
30  static xtd::drawing::image image_loading(const xtd::drawing::size& size) {return system_images::from_name("image-loading", size);}
31  static xtd::drawing::image image_missing() {return image_missing(default_size());}
32  static xtd::drawing::image image_missing(const xtd::drawing::size& size) {return from_name("image-missing", size);}
33 
34  static xtd::drawing::image from_name(const xtd::ustring& name) {return from_name(default_theme(), name, default_size());}
35  static xtd::drawing::image from_name(const xtd::ustring& name, const xtd::drawing::size& size) {return from_name(default_theme(), name, size);}
36  static xtd::drawing::image from_name(const xtd::ustring& theme, const xtd::ustring& name) {return from_name(theme, name, default_size());}
37  static xtd::drawing::image from_name(const xtd::ustring& theme, const xtd::ustring& name, const xtd::drawing::size& size);
38 
39  static std::vector<xtd::ustring> contexts();
40  static std::map<xtd::ustring, std::vector<xtd::ustring>> context_names();
41  static std::vector<xtd::ustring> names();
42  static std::vector<xtd::ustring> names(const xtd::ustring& context) {return context_names()[context];}
43  static std::vector<xtd::drawing::size> sizes();
44 
45  private:
46  friend class system_icons;
47  static xtd::ustring default_theme();
48  static xtd::ustring fallback_theme();
49  static std::vector<xtd::ustring> themes();
50  };
51  }
52 }
53 
Contains xtd::drawing::bitmap class.
An abstract base class that provides functionality for the bitmap and metafile descended classes.
Definition: image.h:34
Stores an ordered pair of integers, which specify a height and width.
Definition: size.h:25
Each property of the xtd::drawing::system_icons class is an xtd::drawing::icon object for Windows sys...
Definition: system_icons.h:24
Each property of the xtd::drawing::system_images class is an xtd::drawing::image object for Windows s...
Definition: system_images.h:26
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
#define drawing_export_
Define shared library export.
Definition: drawing_export.h:13
#define static_
This keyword is use to represent a static object. A static object can't be instantiated (constructors...
Definition: static.h:38
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17
Contains xtd::drawing::size class.
Contains xtd::static_object class.