FileAction.kt 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Nextcloud Android client application
  3. *
  4. * @author Álvaro Brey
  5. * Copyright (C) 2022 Álvaro Brey
  6. * Copyright (C) 2022 Nextcloud GmbH
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
  10. * License as published by the Free Software Foundation; either
  11. * version 3 of the License, or any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public
  19. * License along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. package com.nextcloud.ui.fileactions
  23. import androidx.annotation.DrawableRes
  24. import androidx.annotation.IdRes
  25. import androidx.annotation.StringRes
  26. import com.owncloud.android.R
  27. // TODO get rid of id, use enum value directly
  28. enum class FileAction(@IdRes val id: Int, @StringRes val title: Int, @DrawableRes val icon: Int? = null) {
  29. UNLOCK_FILE(R.id.action_unlock_file, R.string.unlock_file),
  30. EDIT(R.id.action_edit, R.string.action_edit),
  31. FAVORITE(R.id.action_favorite, R.string.favorite),
  32. UNSET_FAVORITE(R.id.action_unset_favorite, R.string.unset_favorite),
  33. SEE_DETAILS(R.id.action_see_details, R.string.actionbar_see_details),
  34. LOCK_FILE(R.id.action_lock_file, R.string.lock_file),
  35. RENAME_FILE(R.id.action_rename_file, R.string.common_rename),
  36. MOVE(R.id.action_move, R.string.actionbar_move),
  37. COPY(R.id.action_copy, R.string.actionbar_copy),
  38. DOWNLOAD_FILE(R.id.action_download_file, R.string.filedetails_download),
  39. EXPORT_FILE(R.id.action_export_file, R.string.filedetails_export),
  40. STREAM_MEDIA(R.id.action_stream_media, R.string.stream),
  41. SEND_SHARE_FILE(R.id.action_send_share_file, R.string.action_send_share),
  42. SEND_FILE(R.id.action_send_file, R.string.common_send),
  43. OPEN_FILE_WITH(R.id.action_open_file_with, R.string.actionbar_open_with),
  44. SYNC_FILE(R.id.action_sync_file, R.string.filedetails_sync_file),
  45. CANCEL_SYNC(R.id.action_cancel_sync, R.string.common_cancel_sync),
  46. SELECT_ALL_ACTION_MENU(R.id.action_select_all_action_menu, R.string.select_all),
  47. DESELECT_ALL_ACTION_MENU(R.id.action_deselect_all_action_menu, R.string.deselect_all),
  48. ENCRYPTED(R.id.action_encrypted, R.string.encrypted),
  49. UNSET_ENCRYPTED(R.id.action_unset_encrypted, R.string.unset_encrypted),
  50. SET_AS_WALLPAPER(R.id.action_set_as_wallpaper, R.string.set_picture_as),
  51. REMOVE_FILE(R.id.action_remove_file, R.string.common_remove)
  52. }