-
Notifications
You must be signed in to change notification settings - Fork 5
/
PWThemeParsed.h
151 lines (111 loc) · 3.81 KB
/
PWThemeParsed.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
//
// ProWidgets
//
// 1.0.0
//
// Created by Alan Yip on 18 Jan 2014
// Copyright 2014 Alan Yip. All rights reserved.
//
#import "header.h"
#import "PWTheme.h"
#define PW_DECLARE_BOOL(ivar, setName) - (BOOL)ivar;\
- (void)set##setName:(NSNumber *)number;
#define PW_DECLARE_COLOR(ivar) @property(nonatomic, copy) UIColor * ivar;
#define PW_DECLARE_IMAGE(ivar, setName) - (UIImage *)ivar##ForOrientation:(PWWidgetOrientation)orientation;\
- (void)set##setName:(UIImage *)image forOrientation:(NSNumber *)orientation;
#define PW_DECLARE_DOUBLE(ivar, setName) - (CGFloat)ivar;\
- (void)set##setName:(NSNumber *)number;
typedef struct PWThemeParsedImageSet {
UIImage *portrait;
UIImage *landscape;
} PWThemeParsedImageSet;
typedef struct PWThemeParsedCellHeight {
struct {
BOOL defined;
CGFloat normal;
CGFloat textarea;
} portrait;
struct {
BOOL defined;
CGFloat normal;
CGFloat textarea;
} landscape;
} PWThemeParsedCellHeight;
typedef struct PWThemeParsedOverrideSide {
BOOL defined;
CGSize portrait;
CGSize landscape;
} PWThemeParsedOverrideSide;
@interface PWThemeParsed : PWTheme {
// style
BOOL _wantsDarkKeyboard;
// image
PWThemeParsedImageSet _sheetBackgroundImage;
PWThemeParsedImageSet _navigationBarBackgroundImage;
PWThemeParsedImageSet _cellBackgroundImage;
PWThemeParsedImageSet _cellSelectedBackgroundImage;
// colors
UIColor *_tintColor;
UIColor *_sheetForegroundColor;
UIColor *_sheetBackgroundColor;
UIColor *_navigationBarBackgroundColor;
UIColor *_navigationTitleTextColor;
UIColor *_navigationButtonTextColor;
UIColor *_cellSeparatorColor;
UIColor *_cellBackgroundColor;
UIColor *_cellTitleTextColor;
UIColor *_cellValueTextColor;
UIColor *_cellButtonTextColor;
UIColor *_cellInputTextColor;
UIColor *_cellInputPlaceholderTextColor;
UIColor *_cellPlainTextColor;
UIColor *_cellSelectedBackgroundColor;
UIColor *_cellSelectedTitleTextColor;
UIColor *_cellSelectedValueTextColor;
UIColor *_cellSelectedButtonTextColor;
UIColor *_cellHeaderFooterViewBackgroundColor;
UIColor *_cellHeaderFooterViewTitleTextColor;
UIColor *_switchThumbColor;
UIColor *_switchOnColor;
UIColor *_switchOffColor;
// numerical values
CGFloat _cornerRadius;
PWThemeParsedCellHeight _cellHeight;
}
// style
PW_DECLARE_BOOL(wantsDarkKeyboard, WantsDarkKeyboard)
// colors
PW_DECLARE_COLOR(tintColor)
PW_DECLARE_COLOR(sheetForegroundColor)
PW_DECLARE_COLOR(sheetBackgroundColor)
PW_DECLARE_COLOR(navigationBarBackgroundColor)
PW_DECLARE_COLOR(navigationTitleTextColor)
PW_DECLARE_COLOR(navigationButtonTextColor)
PW_DECLARE_COLOR(cellSeparatorColor)
PW_DECLARE_COLOR(cellBackgroundColor)
PW_DECLARE_COLOR(cellTitleTextColor)
PW_DECLARE_COLOR(cellValueTextColor)
PW_DECLARE_COLOR(cellButtonTextColor)
PW_DECLARE_COLOR(cellInputTextColor)
PW_DECLARE_COLOR(cellInputPlaceholderTextColor)
PW_DECLARE_COLOR(cellPlainTextColor)
PW_DECLARE_COLOR(cellSelectedBackgroundColor)
PW_DECLARE_COLOR(cellSelectedTitleTextColor)
PW_DECLARE_COLOR(cellSelectedValueTextColor)
PW_DECLARE_COLOR(cellSelectedButtonTextColor)
PW_DECLARE_COLOR(cellHeaderFooterViewBackgroundColor)
PW_DECLARE_COLOR(cellHeaderFooterViewTitleTextColor)
PW_DECLARE_COLOR(switchThumbColor)
PW_DECLARE_COLOR(switchOnColor)
PW_DECLARE_COLOR(switchOffColor)
// images
PW_DECLARE_IMAGE(sheetBackgroundImage, SheetBackgroundImage)
PW_DECLARE_IMAGE(navigationBarBackgroundImage, NavigationBarBackgroundImage)
PW_DECLARE_IMAGE(cellBackgroundImage, CellBackgroundImage)
PW_DECLARE_IMAGE(cellSelectedBackgroundImage, CellSelectedBackgroundImage)
// doubles
PW_DECLARE_DOUBLE(cornerRadius, CornerRadius)
// cell height
- (CGFloat)heightOfCellOfType:(PWWidgetCellType)type forOrientation:(PWWidgetOrientation)orientation;
- (void)setHeightOfCell:(CGFloat)height forType:(PWWidgetCellType)type forOrientation:(PWWidgetOrientation)orientation;
@end