|
| 1 | +// |
| 2 | +// LLConfig.h |
| 3 | +// |
| 4 | +// Copyright (c) 2018 LLDebugTool Software Foundation (https://github.com/HDB-Li/LLDebugTool) |
| 5 | +// |
| 6 | +// Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | +// of this software and associated documentation files (the "Software"), to deal |
| 8 | +// in the Software without restriction, including without limitation the rights |
| 9 | +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 10 | +// copies of the Software, and to permit persons to whom the Software is |
| 11 | +// furnished to do so, subject to the following conditions: |
| 12 | +// |
| 13 | +// The above copyright notice and this permission notice shall be included in all |
| 14 | +// copies or substantial portions of the Software. |
| 15 | +// |
| 16 | +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | +// SOFTWARE. |
| 23 | + |
| 24 | +#import <Foundation/Foundation.h> |
| 25 | +#import <UIKit/UIKit.h> |
| 26 | + |
| 27 | +#ifndef LLCONFIG_CUSTOM_COLOR |
| 28 | +#define LLCONFIG_CUSTOM_COLOR ([LLConfig sharedConfig].useSystemColor == NO) |
| 29 | +#define LLCONFIG_TEXT_COLOR [LLConfig sharedConfig].textColor |
| 30 | +#define LLCONFIG_BACKGROUND_COLOR [LLConfig sharedConfig].backgroundColor |
| 31 | +#endif |
| 32 | + |
| 33 | + |
| 34 | +/** |
| 35 | + Color style enum |
| 36 | +
|
| 37 | + - LLConfigColorStyleHack: Green backgroundColor and white textColor. |
| 38 | + - LLConfigColorStyleSimple: White backgroundColor and darkTextColor textColor. |
| 39 | + - LLConfigColorStyleSystem: White backgroundColor and system tint textColor. |
| 40 | + */ |
| 41 | +typedef NS_ENUM(NSUInteger, LLConfigColorStyle) { |
| 42 | + LLConfigColorStyleHack, |
| 43 | + LLConfigColorStyleSimple, |
| 44 | + LLConfigColorStyleSystem, |
| 45 | +}; |
| 46 | + |
| 47 | +/** |
| 48 | + Log Level. It can be used for filter. |
| 49 | + |
| 50 | + - LLConfigLogLevelDefault: Use to save message or note. |
| 51 | + - LLConfigLogLevelAlert: Use to save alert message. |
| 52 | + - LLConfigLogLevelWarning: Use to save warning message. |
| 53 | + - LLConfigLogLevelError: Use to save error message. |
| 54 | + */ |
| 55 | +typedef NS_ENUM(NSUInteger, LLConfigLogLevel) { |
| 56 | + LLConfigLogLevelDefault, |
| 57 | + LLConfigLogLevelAlert, |
| 58 | + LLConfigLogLevelWarning, |
| 59 | + LLConfigLogLevelError, |
| 60 | +}; |
| 61 | + |
| 62 | +/** |
| 63 | + Config file. Must config properties before [LLDebugTool enable]. |
| 64 | + */ |
| 65 | +@interface LLConfig : NSObject |
| 66 | + |
| 67 | +/** |
| 68 | + Singleton to get/save config. |
| 69 | + |
| 70 | + @return Singleton |
| 71 | + */ |
| 72 | ++ (instancetype _Nonnull)sharedConfig; |
| 73 | + |
| 74 | +#pragma mark - StautsBarSytle |
| 75 | +/** |
| 76 | + Window's statusBarStyle when show. |
| 77 | + */ |
| 78 | +@property (assign , nonatomic , readonly) UIStatusBarStyle statusBarStyle; |
| 79 | + |
| 80 | +#pragma mark - Color |
| 81 | +/** |
| 82 | + Use preset the color configuration. For details, please see LLConfigColorStyle. |
| 83 | + */ |
| 84 | +@property (assign , nonatomic) LLConfigColorStyle colorStyle; |
| 85 | + |
| 86 | +/** |
| 87 | + UIControl's background color. Default is [UIColor blackColor]. Set this property will also change useSystemColor to NO. |
| 88 | + */ |
| 89 | +@property (strong , nonatomic , nonnull , readonly) UIColor *backgroundColor; |
| 90 | + |
| 91 | +/** |
| 92 | + UIControl's text color. Default is [UIColor greenColor]. Set this property will also change useSystemColor to NO. |
| 93 | + */ |
| 94 | +@property (strong , nonatomic , nonnull , readonly) UIColor *textColor; |
| 95 | + |
| 96 | +/** |
| 97 | + Use system color or not. If YES, window will draw by system tint color. If NO, window will draw by [backgroundColor] and [textColor]. |
| 98 | + Default is NO. |
| 99 | + */ |
| 100 | +@property (assign , nonatomic) BOOL useSystemColor; |
| 101 | + |
| 102 | +/** |
| 103 | + System tint color. |
| 104 | + */ |
| 105 | +@property (strong , nonatomic , readonly , nonnull) UIColor *systemTintColor; |
| 106 | + |
| 107 | +/** |
| 108 | + Customizing the custom color configuration. |
| 109 | + */ |
| 110 | +- (void)configBackgroundColor:(UIColor *_Nonnull)backgroundColor textColor:(UIColor *_Nonnull)textColor statusBarStyle:(UIStatusBarStyle)statusBarStyle; |
| 111 | + |
| 112 | +#pragma mark - Date Formatter |
| 113 | +/** |
| 114 | + Date Format Style. Use to recording time when create model. Default is "yyyy-MM-dd HH:mm:ss". |
| 115 | + If this value is modified, the old data is not compatible. |
| 116 | + */ |
| 117 | +@property (copy , nonatomic , nonnull) NSString *dateFormatter; |
| 118 | + |
| 119 | +#pragma mark - Window |
| 120 | +/** |
| 121 | + Suspension ball width, must greater than 70. |
| 122 | + */ |
| 123 | +@property (assign , nonatomic) CGFloat suspensionBallWidth; |
| 124 | + |
| 125 | +/** |
| 126 | + Suspension Ball alpha(not active), default is 0.9. |
| 127 | + */ |
| 128 | +@property (assign , nonatomic) CGFloat normalAlpha; |
| 129 | + |
| 130 | +/** |
| 131 | + Suspension Ball alpha(active), default is 1.0. |
| 132 | + */ |
| 133 | +@property (assign , nonatomic) CGFloat activeAlpha; |
| 134 | + |
| 135 | +/** |
| 136 | + Whether the suspension ball can be moved, default is YES. |
| 137 | + */ |
| 138 | +@property (assign , nonatomic) BOOL suspensionBallMoveable; |
| 139 | + |
| 140 | +#pragma mark - User Identity |
| 141 | +/** |
| 142 | + Tag user name is used to create the crash/network/log model. |
| 143 | + */ |
| 144 | +@property (copy , nonatomic , nullable) NSString *userIdentity; |
| 145 | + |
| 146 | +#pragma mark - Network |
| 147 | +/** |
| 148 | + Observer network in hosts, ignore others. |
| 149 | + */ |
| 150 | +@property (strong , nonatomic , nullable) NSArray <NSString *>*hosts; |
| 151 | + |
| 152 | +#pragma mark - Extension |
| 153 | +/** |
| 154 | + Image resource bundle name. |
| 155 | + */ |
| 156 | +@property (copy , nonatomic , readonly , nonnull) NSString *bundlePath; |
| 157 | + |
| 158 | +@end |
0 commit comments