| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_CLOUD_DEVICES_COMMON_CLOUD_PRINTER_DESCRIPTION_H_ | 5 #ifndef COMPONENTS_CLOUD_DEVICES_COMMON_CLOUD_PRINTER_DESCRIPTION_H_ |
| 6 #define COMPONENTS_CLOUD_DEVICES_COMMON_CLOUD_PRINTER_DESCRIPTION_H_ | 6 #define COMPONENTS_CLOUD_DEVICES_COMMON_CLOUD_PRINTER_DESCRIPTION_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include <string> | 10 #include <string> |
| 9 | 11 |
| 10 #include "base/logging.h" | 12 #include "base/logging.h" |
| 11 #include "components/cloud_devices/common/description_items.h" | 13 #include "components/cloud_devices/common/description_items.h" |
| 12 | 14 |
| 13 // Defines printer options, CDD and CJT items. | 15 // Defines printer options, CDD and CJT items. |
| 14 // https://developers.google.com/cloud-print/docs/cdd | 16 // https://developers.google.com/cloud-print/docs/cdd |
| 15 | 17 |
| 16 namespace cloud_devices { | 18 namespace cloud_devices { |
| 17 | 19 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 66 |
| 65 enum MarginsType { | 67 enum MarginsType { |
| 66 NO_MARGINS, | 68 NO_MARGINS, |
| 67 STANDARD_MARGINS, | 69 STANDARD_MARGINS, |
| 68 CUSTOM_MARGINS, | 70 CUSTOM_MARGINS, |
| 69 }; | 71 }; |
| 70 | 72 |
| 71 struct Margins { | 73 struct Margins { |
| 72 Margins(); | 74 Margins(); |
| 73 Margins(MarginsType type, | 75 Margins(MarginsType type, |
| 74 int32 top_um, | 76 int32_t top_um, |
| 75 int32 right_um, | 77 int32_t right_um, |
| 76 int32 bottom_um, | 78 int32_t bottom_um, |
| 77 int32 left_um); | 79 int32_t left_um); |
| 78 | 80 |
| 79 bool operator==(const Margins& other) const; | 81 bool operator==(const Margins& other) const; |
| 80 bool operator!=(const Margins& other) const { return !(*this == other); } | 82 bool operator!=(const Margins& other) const { return !(*this == other); } |
| 81 | 83 |
| 82 MarginsType type; | 84 MarginsType type; |
| 83 int32 top_um; | 85 int32_t top_um; |
| 84 int32 right_um; | 86 int32_t right_um; |
| 85 int32 bottom_um; | 87 int32_t bottom_um; |
| 86 int32 left_um; | 88 int32_t left_um; |
| 87 }; | 89 }; |
| 88 | 90 |
| 89 struct Dpi { | 91 struct Dpi { |
| 90 Dpi(); | 92 Dpi(); |
| 91 Dpi(int32 horizontal, int32 vertical); | 93 Dpi(int32_t horizontal, int32_t vertical); |
| 92 | 94 |
| 93 bool IsValid() const; | 95 bool IsValid() const; |
| 94 bool operator==(const Dpi& other) const; | 96 bool operator==(const Dpi& other) const; |
| 95 bool operator!=(const Dpi& other) const { return !(*this == other); } | 97 bool operator!=(const Dpi& other) const { return !(*this == other); } |
| 96 | 98 |
| 97 int32 horizontal; | 99 int32_t horizontal; |
| 98 int32 vertical; | 100 int32_t vertical; |
| 99 }; | 101 }; |
| 100 | 102 |
| 101 enum FitToPageType { | 103 enum FitToPageType { |
| 102 NO_FITTING, | 104 NO_FITTING, |
| 103 FIT_TO_PAGE, | 105 FIT_TO_PAGE, |
| 104 GROW_TO_PAGE, | 106 GROW_TO_PAGE, |
| 105 SHRINK_TO_PAGE, | 107 SHRINK_TO_PAGE, |
| 106 FILL_PAGE, | 108 FILL_PAGE, |
| 107 }; | 109 }; |
| 108 | 110 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 OM_FOLIO, | 284 OM_FOLIO, |
| 283 OM_FOLIO_SP, | 285 OM_FOLIO_SP, |
| 284 OM_INVITE, | 286 OM_INVITE, |
| 285 }; | 287 }; |
| 286 | 288 |
| 287 struct Media { | 289 struct Media { |
| 288 Media(); | 290 Media(); |
| 289 | 291 |
| 290 explicit Media(MediaType type); | 292 explicit Media(MediaType type); |
| 291 | 293 |
| 292 Media(MediaType type, int32 width_um, int32 height_um); | 294 Media(MediaType type, int32_t width_um, int32_t height_um); |
| 293 | 295 |
| 294 Media(const std::string& custom_display_name, | 296 Media(const std::string& custom_display_name, |
| 295 const std::string& vendor_id, | 297 const std::string& vendor_id, |
| 296 int32 width_um, | 298 int32_t width_um, |
| 297 int32 height_um); | 299 int32_t height_um); |
| 298 | 300 |
| 299 bool MatchBySize(); | 301 bool MatchBySize(); |
| 300 | 302 |
| 301 bool IsValid() const; | 303 bool IsValid() const; |
| 302 bool operator==(const Media& other) const; | 304 bool operator==(const Media& other) const; |
| 303 bool operator!=(const Media& other) const { return !(*this == other); } | 305 bool operator!=(const Media& other) const { return !(*this == other); } |
| 304 | 306 |
| 305 MediaType type; | 307 MediaType type; |
| 306 int32 width_um; | 308 int32_t width_um; |
| 307 int32 height_um; | 309 int32_t height_um; |
| 308 bool is_continuous_feed; | 310 bool is_continuous_feed; |
| 309 std::string custom_display_name; | 311 std::string custom_display_name; |
| 310 std::string vendor_id; | 312 std::string vendor_id; |
| 311 }; | 313 }; |
| 312 | 314 |
| 313 struct Interval { | 315 struct Interval { |
| 314 Interval(); | 316 Interval(); |
| 315 Interval(int32 start, int32 end); | 317 Interval(int32_t start, int32_t end); |
| 316 explicit Interval(int32 start); | 318 explicit Interval(int32_t start); |
| 317 | 319 |
| 318 bool operator==(const Interval& other) const; | 320 bool operator==(const Interval& other) const; |
| 319 bool operator!=(const Interval& other) const { return !(*this == other); } | 321 bool operator!=(const Interval& other) const { return !(*this == other); } |
| 320 | 322 |
| 321 int32 start; | 323 int32_t start; |
| 322 int32 end; | 324 int32_t end; |
| 323 }; | 325 }; |
| 324 | 326 |
| 325 typedef std::vector<Interval> PageRange; | 327 typedef std::vector<Interval> PageRange; |
| 326 | 328 |
| 327 class ContentTypeTraits; | 329 class ContentTypeTraits; |
| 328 class PwgRasterConfigTraits; | 330 class PwgRasterConfigTraits; |
| 329 class ColorTraits; | 331 class ColorTraits; |
| 330 class DuplexTraits; | 332 class DuplexTraits; |
| 331 class OrientationTraits; | 333 class OrientationTraits; |
| 332 class MarginsTraits; | 334 class MarginsTraits; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 355 | 357 |
| 356 typedef TicketItem<PwgRasterConfig, PwgRasterConfigTraits> | 358 typedef TicketItem<PwgRasterConfig, PwgRasterConfigTraits> |
| 357 PwgRasterConfigTicketItem; | 359 PwgRasterConfigTicketItem; |
| 358 typedef TicketItem<Color, ColorTraits> ColorTicketItem; | 360 typedef TicketItem<Color, ColorTraits> ColorTicketItem; |
| 359 typedef TicketItem<DuplexType, DuplexTraits> DuplexTicketItem; | 361 typedef TicketItem<DuplexType, DuplexTraits> DuplexTicketItem; |
| 360 typedef TicketItem<OrientationType, OrientationTraits> OrientationTicketItem; | 362 typedef TicketItem<OrientationType, OrientationTraits> OrientationTicketItem; |
| 361 typedef TicketItem<Margins, MarginsTraits> MarginsTicketItem; | 363 typedef TicketItem<Margins, MarginsTraits> MarginsTicketItem; |
| 362 typedef TicketItem<Dpi, DpiTraits> DpiTicketItem; | 364 typedef TicketItem<Dpi, DpiTraits> DpiTicketItem; |
| 363 typedef TicketItem<FitToPageType, FitToPageTraits> FitToPageTicketItem; | 365 typedef TicketItem<FitToPageType, FitToPageTraits> FitToPageTicketItem; |
| 364 typedef TicketItem<Media, MediaTraits> MediaTicketItem; | 366 typedef TicketItem<Media, MediaTraits> MediaTicketItem; |
| 365 typedef TicketItem<int32, CopiesTraits> CopiesTicketItem; | 367 typedef TicketItem<int32_t, CopiesTraits> CopiesTicketItem; |
| 366 typedef TicketItem<PageRange, PageRangeTraits> PageRangeTicketItem; | 368 typedef TicketItem<PageRange, PageRangeTraits> PageRangeTicketItem; |
| 367 typedef TicketItem<bool, CollateTraits> CollateTicketItem; | 369 typedef TicketItem<bool, CollateTraits> CollateTicketItem; |
| 368 typedef TicketItem<bool, ReverseTraits> ReverseTicketItem; | 370 typedef TicketItem<bool, ReverseTraits> ReverseTicketItem; |
| 369 | 371 |
| 370 } // namespace printer | 372 } // namespace printer |
| 371 | 373 |
| 372 } // namespace cloud_devices | 374 } // namespace cloud_devices |
| 373 | 375 |
| 374 #endif // COMPONENTS_CLOUD_DEVICES_COMMON_CLOUD_PRINTER_DESCRIPTION_H_ | 376 #endif // COMPONENTS_CLOUD_DEVICES_COMMON_CLOUD_PRINTER_DESCRIPTION_H_ |
| OLD | NEW |