tootle-linux-client/src/API/StatusVisibility.vala

68 lines
1.8 KiB
Vala
Raw Normal View History

2018-04-15 13:29:55 +02:00
public enum Tootle.StatusVisibility {
PUBLIC,
UNLISTED,
PRIVATE,
DIRECT;
public string to_string() {
switch (this) {
case PUBLIC:
return "public";
case UNLISTED:
return "unlisted";
case PRIVATE:
return "private";
case DIRECT:
return "direct";
default:
assert_not_reached();
}
}
2018-05-11 13:28:49 +02:00
public static StatusVisibility from_string (string str) {
switch (str) {
case "public":
return StatusVisibility.PUBLIC;
case "unlisted":
return StatusVisibility.UNLISTED;
case "private":
return StatusVisibility.PRIVATE;
case "direct":
return StatusVisibility.DIRECT;
default:
assert_not_reached();
}
}
2018-04-15 13:29:55 +02:00
public string get_desc() {
switch (this) {
case PUBLIC:
return _("Post to public timelines");
case UNLISTED:
return _("Don\'t post to public timelines");
case PRIVATE:
return _("Post to followers only");
case DIRECT:
return _("Post to mentioned users only");
default:
assert_not_reached();
}
}
public string get_icon() {
switch (this) {
case PUBLIC:
return "network-workgroup-symbolic";
case UNLISTED:
2018-04-15 14:28:23 +02:00
return "view-private-symbolic";
2018-04-15 13:29:55 +02:00
case PRIVATE:
2018-04-15 14:28:23 +02:00
return "security-medium-symbolic";
2018-04-15 13:29:55 +02:00
case DIRECT:
2018-05-11 13:28:49 +02:00
return "mail-send-symbolic";
2018-04-15 13:29:55 +02:00
default:
assert_not_reached();
}
}
}