CCMenuAccount.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. //
  2. // CCMenuAccount.h
  3. // Nextcloud iOS
  4. //
  5. // Created by Marino Faggiana on 07/04/16.
  6. // Copyright (c) 2017 TWS. All rights reserved.
  7. //
  8. // Author Marino Faggiana <m.faggiana@twsweb.it>
  9. //
  10. // This program is free software: you can redistribute it and/or modify
  11. // it under the terms of the GNU General Public License as published by
  12. // the Free Software Foundation, either version 3 of the License, or
  13. // (at your option) any later version.
  14. //
  15. // This program is distributed in the hope that it will be useful,
  16. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. // GNU General Public License for more details.
  19. //
  20. // You should have received a copy of the GNU General Public License
  21. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. //
  23. #import <UIKit/UIKit.h>
  24. @interface CCMenuItem : NSObject
  25. @property (readwrite, nonatomic, strong) UIImage *image;
  26. @property (readwrite, nonatomic, strong) NSString *title;
  27. @property (readwrite, nonatomic, strong) NSString *argument;
  28. @property (readwrite, nonatomic, weak) id target;
  29. @property (readwrite, nonatomic) SEL action;
  30. @property (readwrite, nonatomic, strong) UIColor *foreColor;
  31. @property (readwrite, nonatomic) NSTextAlignment alignment;
  32. + (instancetype)menuItem:(NSString *)title argument:(NSString*)argument image:(UIImage *)image target:(id)target action:(SEL)action;
  33. @end
  34. typedef struct {
  35. CGFloat R;
  36. CGFloat G;
  37. CGFloat B;
  38. } Color;
  39. typedef struct {
  40. CGFloat arrowSize;
  41. CGFloat marginXSpacing;
  42. CGFloat marginYSpacing;
  43. CGFloat intervalSpacing;
  44. CGFloat menuCornerRadius;
  45. Boolean maskToBackground;
  46. Boolean shadowOfMenu;
  47. Boolean hasSeperatorLine;
  48. Boolean seperatorLineHasInsets;
  49. Color textColor;
  50. Color menuBackgroundColor;
  51. } OptionalConfiguration;
  52. @interface CCMenuView : UIView
  53. @property (atomic, assign) OptionalConfiguration CCMenuViewOptions;
  54. @end
  55. @interface CCMenuAccount : NSObject
  56. + (void)showMenuInView:(UIView *)view fromRect:(CGRect)rect menuItems:(NSArray *)menuItems withOptions:(OptionalConfiguration)options;
  57. + (void)dismissMenu;
  58. + (UIColor *)tintColor;
  59. + (void)setTintColor:(UIColor *)tintColor;
  60. + (UIFont *)titleFont;
  61. + (void)setTitleFont:(UIFont *)titleFont;
  62. @end