Preview.h
1 /*
2  * Copyright 2016 Gigatribe
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef GIGA_DATA_PREVIEW_MODEL_H_
18 #define GIGA_DATA_PREVIEW_MODEL_H_
19 
20 #include <string>
21 #include <vector>
22 #include <map>
23 #include "../../rest/prepoc_manage.h"
24 
25 #include "Subtitle.h"
26 #include "Stream.h"
27 #include "PreviewCover.h"
28 
29 namespace giga {
30 namespace data {
31 
35 struct Preview {
37  boost::optional<utility::string_t> type = boost::none;
39  boost::optional<utility::string_t> icon = boost::none;
40  std::unique_ptr<PreviewCover> cover = nullptr;
41  std::vector<std::unique_ptr<Stream>> streams = {};
42  std::vector<std::unique_ptr<Subtitle>> subtitles = {};
44  boost::optional<utility::string_t> albumart = boost::none;
46  boost::optional<utility::string_t> image = boost::none;
48  boost::optional<utility::string_t> pdf = boost::none;
50  boost::optional<utility::string_t> epub = boost::none;
51 
52  template <class Manager>
53  void visit(const Manager& m) {
54  GIGA_MANAGE(m, type);
55  GIGA_MANAGE(m, icon);
56  GIGA_MANAGE(m, cover);
57  GIGA_MANAGE(m, streams);
58  GIGA_MANAGE(m, subtitles);
59  GIGA_MANAGE(m, albumart);
60  GIGA_MANAGE(m, image);
61  GIGA_MANAGE(m, pdf);
62  GIGA_MANAGE(m, epub);
63  }
64 };
65 
66 } /* namespace data */
67 } /* namespace giga */
68 #endif /* GIGA_DATA_PREVIEW_MODEL_H_ */
Definition: Preview.h:35
boost::optional< utility::string_t > albumart
Definition: Preview.h:44
boost::optional< utility::string_t > pdf
Definition: Preview.h:48
boost::optional< utility::string_t > type
Definition: Preview.h:37
boost::optional< utility::string_t > icon
Definition: Preview.h:39
boost::optional< utility::string_t > image
Definition: Preview.h:46
boost::optional< utility::string_t > epub
Definition: Preview.h:50