File: InfoTagPicture.h

package info (click to toggle)
kodi 2%3A20.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 143,820 kB
  • sloc: cpp: 664,925; xml: 68,398; ansic: 37,223; python: 6,903; sh: 4,209; javascript: 2,325; makefile: 1,754; perl: 969; java: 513; cs: 390; objc: 340
file content (180 lines) | stat: -rw-r--r-- 5,485 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
/*
 *  Copyright (C) 2021 Team Kodi
 *  This file is part of Kodi - https://kodi.tv
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 *  See LICENSES/README.md for more information.
 */

#pragma once

#include "AddonClass.h"

class CPictureInfoTag;

namespace XBMCAddon
{
namespace xbmc
{

///
/// \defgroup python_InfoTagPicture InfoTagPicture
/// \ingroup python_xbmc
/// @{
/// @brief **Kodi's picture info tag class.**
///
/// \python_class{ InfoTagPicture() }
///
/// Access and / or modify the picture metadata of a ListItem.
///
///-------------------------------------------------------------------------
/// @python_v20 New class added.
///
/// **Example:**
/// ~~~~~~~~~~~~~{.py}
/// ...
/// tag = item.getPictureInfoTag()
///
/// datetime_taken  = tag.getDateTimeTaken()
/// tag.setResolution(1920, 1080)
/// ...
/// ~~~~~~~~~~~~~
///
class InfoTagPicture : public AddonClass
{
private:
  CPictureInfoTag* infoTag;
  bool offscreen;
  bool owned;

public:
#ifndef SWIG
  explicit InfoTagPicture(const CPictureInfoTag* tag);
  explicit InfoTagPicture(CPictureInfoTag* tag, bool offscreen = false);
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
  ///
  /// \ingroup python_InfoTagPicture
  /// @brief \python_func{ xbmc.InfoTagPicture([offscreen]) }
  /// Create a picture info tag.
  ///
  /// @param offscreen            [opt] bool (default `False`) - if GUI based locks should be
  ///                                          avoided. Most of the times listitems are created
  ///                                          offscreen and added later to a container
  ///                                          for display (e.g. plugins) or they are not
  ///                                          even displayed (e.g. python scrapers).
  ///                                          In such cases, there is no need to lock the
  ///                                          GUI when creating the items (increasing your addon
  ///                                          performance).
  ///                                          Note however, that if you are creating listitems
  ///                                          and managing the container itself (e.g using
  ///                                          WindowXML or WindowXMLDialog classes) subsquent
  ///                                          modifications to the item will require locking.
  ///                                          Thus, in such cases, use the default value (`False`).
  ///
  ///
  ///-----------------------------------------------------------------------
  /// @python_v20 New function added.
  ///
  /// **Example:**
  /// ~~~~~~~~~~~~~{.py}
  /// ...
  /// pictureinfo = xbmc.InfoTagPicture(offscreen=False)
  /// ...
  /// ~~~~~~~~~~~~~
  ///
  InfoTagPicture(...);
#else
  explicit InfoTagPicture(bool offscreen = false);
#endif
  ~InfoTagPicture() override;

#ifdef DOXYGEN_SHOULD_USE_THIS
  ///
  /// \ingroup python_InfoTagPicture
  /// @brief \python_func{ getResolution() }
  /// Get the resolution of the picture in the format "w x h".
  ///
  /// @return [string] Resolution of the picture in the format "w x h".
  ///
  ///
  ///-----------------------------------------------------------------------
  /// @python_v20 New function added.
  ///
  getResolution();
#else
  String getResolution();
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
  ///
  /// \ingroup python_InfoTagPicture
  /// @brief \python_func{ getDateTimeTaken() }
  /// Get the date and time at which the picture was taken in W3C format.
  ///
  /// @return [string] Date and time at which the picture was taken in W3C format.
  ///
  ///
  ///-----------------------------------------------------------------------
  /// @python_v20 New function added.
  ///
  getDirector();
#else
  String getDateTimeTaken();
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
  ///
  /// \ingroup python_InfoTagPicture
  /// @brief \python_func{ setResolution(width, height) }
  /// Sets the resolution of the picture.
  ///
  /// @param width              int - Width of the picture in pixels.
  /// @param height             int - Height of the picture in pixels.
  ///
  ///
  ///-----------------------------------------------------------------------
  /// @python_v20 New function added.
  ///
  setResolution(...);
#else
  void setResolution(int width, int height);
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
  ///
  /// \ingroup python_InfoTagPicture
  /// @brief \python_func{ setDateTimeTaken(datetimetaken) }
  /// Sets the date and time at which the picture was taken in W3C format.
  /// The following formats are supported:
  /// - YYYY
  /// - YYYY-MM-DD
  /// - YYYY-MM-DDThh:mm[TZD]
  /// - YYYY-MM-DDThh:mm:ss[TZD]
  /// where the timezone (TZD) is always optional and can be in one of the
  /// following formats:
  /// - Z (for UTC)
  /// - +hh:mm
  /// - -hh:mm
  ///
  /// @param datetimetaken      string - Date and time at which the picture was taken in W3C format.
  ///
  ///
  ///-----------------------------------------------------------------------
  /// @python_v20 New function added.
  ///
  setDateTimeTaken(...);
#else
  void setDateTimeTaken(const String& datetimetaken);
#endif

#ifndef SWIG
  static void setResolutionRaw(CPictureInfoTag* infoTag, const String& resolution);
  static void setResolutionRaw(CPictureInfoTag* infoTag, int width, int height);
  static void setDateTimeTakenRaw(CPictureInfoTag* infoTag, String datetimetaken);
#endif
};

} // namespace xbmc
} // namespace XBMCAddon