CCMenuAccount.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. //
  2. // CCMenuAccount.h
  3. // Nextcloud
  4. //
  5. // Created by Marino Faggiana on 07/04/16.
  6. // Copyright (c) 2016 Marino Faggiana. All rights reserved.
  7. //
  8. // Author Marino Faggiana <marino.faggiana@nextcloud.com>
  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. UIColor *textColor;
  50. UIColor *separatorColor;
  51. Color menuBackgroundColor;
  52. } OptionalConfiguration;
  53. @interface CCMenuView : UIView
  54. @property (atomic, assign) OptionalConfiguration CCMenuViewOptions;
  55. @end
  56. @interface CCMenuAccount : NSObject
  57. + (void)showMenuInView:(UIView *)view fromRect:(CGRect)rect menuItems:(NSArray *)menuItems withOptions:(OptionalConfiguration)options;
  58. + (void)dismissMenu;
  59. + (UIColor *)tintColor;
  60. + (void)setTintColor:(UIColor *)tintColor;
  61. + (UIFont *)titleFont;
  62. + (void)setTitleFont:(UIFont *)titleFont;
  63. @end