You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

actions.native.js 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. /* @flow */
  2. import {
  3. CLEAR_TOOLBOX_TIMEOUT,
  4. SET_SUBJECT,
  5. SET_SUBJECT_SLIDE_IN,
  6. SET_TOOLBAR_HOVERED,
  7. SET_TOOLBOX_ALWAYS_VISIBLE,
  8. SET_TOOLBOX_ENABLED,
  9. SET_TOOLBOX_TIMEOUT,
  10. SET_TOOLBOX_TIMEOUT_MS,
  11. SET_TOOLBOX_VISIBLE
  12. } from './actionTypes';
  13. /**
  14. * Signals that toolbox timeout should be cleared.
  15. *
  16. * @returns {{
  17. * type: CLEAR_TOOLBOX_TIMEOUT
  18. * }}
  19. */
  20. export function clearToolboxTimeout(): Object {
  21. return {
  22. type: CLEAR_TOOLBOX_TIMEOUT
  23. };
  24. }
  25. /**
  26. * Signals that value of conference subject should be changed.
  27. *
  28. * @param {string} subject - Conference subject string.
  29. * @returns {Object}
  30. */
  31. export function setSubject(subject: string): Object {
  32. return {
  33. type: SET_SUBJECT,
  34. subject
  35. };
  36. }
  37. /**
  38. * Signals that toolbox subject slide in value should be changed.
  39. *
  40. * @param {boolean} subjectSlideIn - True if the subject is shown; otherwise,
  41. * false.
  42. * @returns {{
  43. * type: SET_SUBJECT_SLIDE_IN,
  44. * subjectSlideIn: boolean
  45. * }}
  46. */
  47. export function setSubjectSlideIn(subjectSlideIn: boolean): Object {
  48. return {
  49. type: SET_SUBJECT_SLIDE_IN,
  50. subjectSlideIn
  51. };
  52. }
  53. /**
  54. * Signals that toolbar is hovered value should be changed.
  55. *
  56. * @param {boolean} hovered - Flag showing whether toolbar is hovered.
  57. * @returns {{
  58. * type: SET_TOOLBAR_HOVERED,
  59. * hovered: boolean
  60. * }}
  61. */
  62. export function setToolbarHovered(hovered: boolean): Object {
  63. return {
  64. type: SET_TOOLBAR_HOVERED,
  65. hovered
  66. };
  67. }
  68. /**
  69. * Signals that always visible toolbars value should be changed.
  70. *
  71. * @param {boolean} alwaysVisible - Value to be set in redux store.
  72. * @returns {{
  73. * type: SET_TOOLBOX_ALWAYS_VISIBLE,
  74. * alwaysVisible: boolean
  75. * }}
  76. */
  77. export function setToolboxAlwaysVisible(alwaysVisible: boolean): Object {
  78. return {
  79. type: SET_TOOLBOX_ALWAYS_VISIBLE,
  80. alwaysVisible
  81. };
  82. }
  83. /* eslint-disable flowtype/space-before-type-colon */
  84. /**
  85. * Enables/disables the toolbox.
  86. *
  87. * @param {boolean} enabled - True to enable the toolbox or false to disable it.
  88. * @returns {{
  89. * type: SET_TOOLBOX_ENABLED,
  90. * enabled: boolean
  91. * }}
  92. */
  93. export function setToolboxEnabled(enabled: boolean): Object {
  94. return {
  95. type: SET_TOOLBOX_ENABLED,
  96. enabled
  97. };
  98. }
  99. /**
  100. * Dispatches an action which sets new timeout and clears the previous one.
  101. *
  102. * @param {Function} handler - Function to be invoked after the timeout.
  103. * @param {number} timeoutMS - Delay.
  104. * @returns {{
  105. * type: SET_TOOLBOX_TIMEOUT,
  106. * handler: Function,
  107. * timeoutMS: number
  108. * }}
  109. */
  110. export function setToolboxTimeout(handler: Function, timeoutMS: number)
  111. : Object {
  112. return {
  113. type: SET_TOOLBOX_TIMEOUT,
  114. handler,
  115. timeoutMS
  116. };
  117. }
  118. /* eslint-enable flowtype/space-before-type-colon */
  119. /**
  120. * Dispatches an action which sets new toolbox timeout value.
  121. *
  122. * @param {number} timeoutMS - Delay.
  123. * @returns {{
  124. * type: SET_TOOLBOX_TIMEOUT_MS,
  125. * timeoutMS: number
  126. * }}
  127. */
  128. export function setToolboxTimeoutMS(timeoutMS: number): Object {
  129. return {
  130. type: SET_TOOLBOX_TIMEOUT_MS,
  131. timeoutMS
  132. };
  133. }
  134. /**
  135. * Shows/hides the toolbox.
  136. *
  137. * @param {boolean} visible - True to show the toolbox or false to hide it.
  138. * @returns {{
  139. * type: SET_TOOLBOX_VISIBLE,
  140. * visible: boolean
  141. * }}
  142. */
  143. export function setToolboxVisible(visible: boolean): Object {
  144. return {
  145. type: SET_TOOLBOX_VISIBLE,
  146. visible
  147. };
  148. }