MainViewController.h 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * Copyright 2017 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <UIKit/UIKit.h>
  17. @class StaticContentTableViewManager;
  18. @class UserTableViewCell;
  19. /** @var kCreateUserAccessibilityID
  20. @brief The "Create User" button accessibility ID.
  21. */
  22. extern NSString *const kCreateUserAccessibilityID;
  23. /** @class MainViewController
  24. @brief The first view controller presented when the application is started.
  25. */
  26. @interface MainViewController : UIViewController
  27. /** @property tableViewManager
  28. @brief A @c StaticContentTableViewManager which is used to manage the contents of the table
  29. view.
  30. */
  31. @property(nonatomic, strong) IBOutlet StaticContentTableViewManager *tableViewManager;
  32. /** @property tableView
  33. @brief A UITableView which is used to display user info and a list of actions.
  34. */
  35. @property(nonatomic, weak) IBOutlet UITableView *tableView;
  36. /** @property userInfoTableViewCell
  37. @brief A custom UITableViewCell for displaying the user info.
  38. */
  39. @property(nonatomic, strong) IBOutlet UserTableViewCell *userInfoTableViewCell;
  40. /** @property userInMemoryInfoTableViewCell
  41. @brief A custom UITableViewCell for displaying the user info.
  42. */
  43. @property(nonatomic, strong) IBOutlet UserTableViewCell *userInMemoryInfoTableViewCell;
  44. /** @property userToUseCell
  45. @brief A custom UITableViewCell for choosing which user to use for user operations (either the
  46. currently signed-in user, or the user in "memory".
  47. */
  48. @property(nonatomic, strong) IBOutlet UITableViewCell *userToUseCell;
  49. /** @property consoleTextView
  50. @brief A UITextView with a log of the actions performed in the sample app.
  51. */
  52. @property(nonatomic, weak) IBOutlet UITextView *consoleTextView;
  53. /** @fn userToUseDidChange:
  54. @brief Should be invoked when the user wishes to switch which user to use for user-related
  55. operations in the sample app.
  56. @param sender The UISegmentedControl which prompted the change in value. It is assumed that the
  57. segment at index 0 represents the "signed-in user" and the segment at index 1 represents the
  58. "user in memeory".
  59. */
  60. - (IBAction)userToUseDidChange:(UISegmentedControl *)sender;
  61. /** @fn memoryPlus
  62. @brief Works like the "M+" button on a calculator; stores the currently signed-in user as the
  63. "user in memory" for the application.
  64. */
  65. - (IBAction)memoryPlus;
  66. /** @fn memoryClear
  67. @brief Works like the "MC" button on a calculator; clears the currently stored "user in memory"
  68. for the application.
  69. */
  70. - (IBAction)memoryClear;
  71. /** @fn handleIncomingLinkWithURL:
  72. @brief Handles an incoming link to trigger the appropriate OOBCode if possible.
  73. @param URL The webURL of the incoming universal link.
  74. @return Boolean value indicating whether the incoming link could be handled or not.
  75. */
  76. - (BOOL)handleIncomingLinkWithURL:(NSURL *)URL;
  77. @end