50 #ifndef DESCRIPTORUTIL_H_
51 #define DESCRIPTORUTIL_H_
53 #include "util/functions.h"
54 using namespace ::br::pucrio::telemidia::util;
56 #include "Descriptor.h"
65 namespace descriptor {
68 static short getFitCode(
string fitName) {
69 if (upperCase(fitName) == upperCase(
"fill")) {
70 return Descriptor::FIT_FILL;
72 }
else if (upperCase(fitName) == upperCase(
"hidden")) {
73 return Descriptor::FIT_HIDDEN;
75 }
else if (upperCase(fitName) == upperCase(
"meet")) {
76 return Descriptor::FIT_MEET;
78 }
else if (upperCase(fitName) == upperCase(
"meetBest")) {
79 return Descriptor::FIT_MEETBEST;
81 }
else if (upperCase(fitName) == upperCase(
"slice")) {
82 return Descriptor::FIT_SLICE;
89 static string getFitName(
short fit) {
91 case Descriptor::FIT_FILL:
94 case Descriptor::FIT_HIDDEN:
97 case Descriptor::FIT_MEET:
100 case Descriptor::FIT_MEETBEST:
103 case Descriptor::FIT_SLICE:
111 static short getScrollCode(
string scrollName) {
112 if (upperCase(scrollName) == upperCase(
"none")) {
113 return Descriptor::SCROLL_NONE;
115 }
else if (upperCase(scrollName) == upperCase(
"horizontal")) {
116 return Descriptor::SCROLL_HORIZONTAL;
118 }
else if (upperCase(scrollName) == upperCase(
"vertical")) {
119 return Descriptor::SCROLL_VERTICAL;
121 }
else if (upperCase(scrollName) == upperCase(
"both")) {
122 return Descriptor::SCROLL_BOTH;
124 }
else if (upperCase(scrollName) == upperCase(
"automatic")) {
125 return Descriptor::SCROLL_AUTOMATIC;
132 static string getScrollName(
short scroll) {
134 case Descriptor::SCROLL_NONE:
137 case Descriptor::SCROLL_HORIZONTAL:
140 case Descriptor::SCROLL_VERTICAL:
143 case Descriptor::SCROLL_BOTH:
146 case Descriptor::SCROLL_AUTOMATIC:
Definition: DescriptorUtil.h:66